text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm interested in the best practices of using LDAP authentication in a Java-based web application. In my app I don't want to store username\password, only some ids. But I want to retrieve addition information (Name, Last name) if any exists in an LDAP catalog.
My team uses LDAP as a standard way of authentication. Basi... | [
0.1717720925807953,
0.23758971691131592,
-0.00038432006840594113,
-0.0676533505320549,
-0.21062181890010834,
-0.3154398500919342,
0.02790885977447033,
-0.14461873471736908,
0.03045581467449665,
-0.7833601236343384,
-0.12953439354896545,
0.32365262508392334,
-0.3811176121234894,
-0.04999022... | |
locally. You can either read LDAP data (e-mail, department etc) from LDAP each time, or pull it in application in some way, though reading it from LDAP is probably simpler and smarter since LDAP data can change. Of course, if you need reporting or use LDAP data extensively, you might want to pull it from LDAP (manually... | [
0.046856485307216644,
0.048818062990903854,
0.26385530829429626,
0.1226692795753479,
-0.20590899884700775,
-0.3373132646083832,
0.1423928141593933,
0.27966201305389404,
-0.697918176651001,
-0.6366646885871887,
-0.4324573576450348,
0.5803730487823486,
-0.38107115030288696,
0.060220073908567... | |
plus. Don't use LDAP for users for only one application; no real benefits in that scenario. | [
0.4278930723667145,
-0.08724435418844223,
0.16954626142978668,
0.4292854368686676,
-0.18925079703330994,
-0.6286650896072388,
0.1600160151720047,
0.3845931887626648,
0.17121119797229767,
-0.43712469935417175,
-0.09138932824134827,
0.4409458339214325,
-0.5944663882255554,
-0.255114942789077... | |
I Have a really simple test class as below.
For some reason my test is being ignored by the GUI and coming up yellow.
I have updated the framework and runner to 2.4.8 as I thought it might have been differences between versions being the problem.
```
using System;
using NUnit.Framework;
namespace TestRunner
{
[... | [
0.49464094638824463,
-0.07040874660015106,
0.09831766039133072,
-0.2693260610103607,
-0.05451655015349388,
-0.11177597939968109,
0.8500577807426453,
-0.46563780307769775,
0.44483405351638794,
-0.6745033860206604,
0.10992548614740372,
0.6981460452079773,
-0.2005658894777298,
0.0938945338129... | |
}
}
}
```
Your TestMe class needs to be public.
Here is some [documentation](http://www.nunit.org/index.php?p=testFixture&r=2.4.8) on the requirements for classes marked with the TestFixture attribute that discusses the conditions under which a class may not be recognized as a test fixture. | [
0.5083428025245667,
0.20419101417064667,
-0.20049139857292175,
-0.07792575657367706,
0.22375649213790894,
-0.373294860124588,
0.3381122052669525,
0.0958285704255104,
0.2683139145374298,
-0.5091502666473389,
-0.33819156885147095,
0.6538329720497131,
-0.20074644684791565,
0.3376951515674591,... | |
I have to spend a fair portion of my time developing in dotnet 1.1, and as I'm sure anyone in a similar position will appreciate, the more I get used dotnet 2.0 and above, the more annoying it is to go back to the early version. I'm getting increasingly fed up of messing about with ArrayLists and the like when I want t... | [
0.5536736845970154,
0.037560999393463135,
0.2350713312625885,
-0.1862291693687439,
-0.11425716429948807,
-0.26730790734291077,
0.11121007800102234,
0.15469957888126373,
-0.3022190034389496,
-0.6305891871452332,
0.1634252518415451,
0.6142147183418274,
-0.45958495140075684,
-0.01490670163184... | |
mentioned above?
Tools: only one Microsoft's Support Liftcycle for .NET 1.1 at <http://support.microsoft.com/lifecycle/?p1=1249>
Which shows .NET 1.1 is already into "extended" (i.e. limited) support. | [
0.17507760226726532,
-0.12716034054756165,
0.4151768386363983,
0.01058544497936964,
-0.08978744596242905,
0.08936868607997894,
0.3358180820941925,
-0.1885550618171692,
-0.41647955775260925,
-0.11873483657836914,
-0.34186166524887085,
0.21632970869541168,
-0.054477352648973465,
-0.270944505... | |
So I'm trying to get a process to be run as a super user from within a python script using subprocess. In the ipython shell something like
```
proc = subprocess.Popen('sudo apach2ctl restart',
shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, | [
-0.12833386659622192,
-0.2063935548067093,
0.16014844179153442,
0.04905744269490242,
0.27199113368988037,
0.08800843358039856,
0.302217036485672,
0.17362947762012482,
-0.11073970049619675,
-0.4954321086406708,
-0.042050089687108994,
0.42427390813827515,
-0.27951759099960327,
0.180325850844... | |
stderr=subprocess.PIPE)
```
works fine, but as soon as I stick it into a script I start getting: `sudo: apach2ctl: command not found`.
I would guess this is due to the way sudo handles environments on ubuntu. (I've also tried `sudo -E apche2ctl restart` and `sudo env path=$PATH apache2ctl restart` with no avail)
So... | [
-0.05724777281284332,
0.0051799677312374115,
0.23179766535758972,
-0.08174101263284683,
-0.09237270802259445,
-0.13220378756523132,
0.6562246084213257,
0.2788037061691284,
-0.009911537170410156,
-0.8223992586135864,
-0.25676578283309937,
0.7240869402885437,
-0.2717140316963196,
0.229074090... | |
both a string and tokenized into a list. In the python interpreter, with a string I'll get the password prompt properly (still doesnt work in a python script as in my original problem), a list just gives the help screen for sudo.
Edit 2:
So what I gather is that while Popen will work with some commands just as string... | [
-0.2074255645275116,
-0.232394278049469,
0.27784377336502075,
-0.1930839568376541,
-0.4169808626174927,
-0.12368886917829514,
0.391387015581131,
-0.17531581223011017,
-0.05324112996459007,
-0.5064518451690674,
-0.053873978555202484,
0.578407347202301,
-0.14211782813072205,
-0.1463178992271... | |
Is there a cost to using server tags in an ASP.NET MVC view? In other words, is the a context switch when you jump out of markup and into a <% %> block and what is the penalty paid in this instance?
No, it shouldn't deadlock.
`Func1` can get the lock if it's called by someone that already holds the lock (like `Func2`)... | [
0.20038491487503052,
-0.2562270164489746,
0.34417304396629333,
0.01874675415456295,
0.1135827973484993,
-0.367003858089447,
0.24959878623485565,
-0.3053680658340454,
-0.45318183302879333,
-0.30590391159057617,
-0.4043281078338623,
0.4435395896434784,
-0.44602254033088684,
0.032907098531723... | |
lock is released."
The goal of lock is to prevent **different threads** from accessing the same resource. `Func1` and `Func2` are on the **same thread**. | [
0.05738464742898941,
-0.16267266869544983,
0.38998764753341675,
0.3078058660030365,
0.2878771424293518,
-0.505501389503479,
-0.04868311434984207,
-0.19245503842830658,
-0.18622265756130219,
-0.28169041872024536,
-0.22626928985118866,
0.44665297865867615,
-0.532796323299408,
0.3553744256496... | |
I'm using Visual C# Express to write Windows Form applications, and call me old school, but I don't like the designer. It is a nuisance and pollutes my project with lots of unwanted files, as well as unwanted monkey-generated source code.
Please tell me there's a way to turn it off completely.
Just **dont add "new for... | [
0.5252819657325745,
0.3809204697608948,
0.16933593153953552,
-0.11943617463111877,
-0.12050744146108627,
-0.41517511010169983,
0.3827894330024719,
0.20998765528202057,
0.05659835413098335,
-0.5658915042877197,
-0.08669419586658478,
0.16259890794754028,
-0.15387481451034546,
0.2791275084018... | |
I have a python script which is querying a MySQL server on a shared linux host. For some reason, queries to MySQL often return a "server has gone away" error:
```
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')
```
If you try the query again immediately afterwards, it usually succeeds. So, I... | [
-0.06459353864192963,
0.4011647403240204,
-0.04426654800772667,
-0.27742087841033936,
-0.06604840606451035,
-0.14519739151000977,
0.3936695158481598,
0.22089815139770508,
-0.1475914567708969,
-0.5568280220031738,
0.12196479737758636,
0.6291404962539673,
-0.3037804067134857,
0.0951809734106... | |
database)
cursor = conn.cursor()
try:
cursor.execute(query)
rows = cursor.fetchall()
for row in rows:
# do something with the data
except MySQLdb.Error, e:
print "MySQL Error %d: %s" % (e.args[0], e.args[1])
```
Clearly I could do it by having another attempt in the except clause, but that's ... | [
-0.5248965620994568,
0.3668892979621887,
0.6027037501335144,
-0.1095808818936348,
-0.01759202592074871,
0.013764552772045135,
0.5500122308731079,
-0.12712211906909943,
-0.14821521937847137,
-0.5390446782112122,
0.004545741714537144,
0.554841160774231,
-0.7210962176322937,
0.093284577131271... | |
cursor.execute(query)
rows = cursor.fetchall()
for row in rows:
# do something with the data
break
except MySQLdb.Error, e:
attempts += 1
print "MySQL Error %d: %s" % (e.args[0], e.args[1])
``` | [
-0.40263473987579346,
0.25444841384887695,
0.5847475528717041,
-0.19869093596935272,
-0.02623256854712963,
0.16851088404655457,
0.492980033159256,
-0.3208233118057251,
-0.19538085162639618,
-0.5241572260856628,
-0.3120287358760834,
0.48189470171928406,
-0.5510741472244263,
0.11344102770090... | |
When writing a class to act as a wrapper around a heap-allocated object, I encountered a problem with implicit type conversion that can be reduced to this simple example.
In the code below the wrapper class manages a heap-allocated object and implicitly converts to a reference to that object. This allows the wrapper o... | [
-0.08751280605792999,
0.043459758162498474,
0.050375282764434814,
-0.23749105632305145,
-0.15453913807868958,
0.05808994546532631,
0.2530684173107147,
-0.19061313569545746,
0.2842074930667877,
-0.5842878818511963,
-0.08130401372909546,
0.5708416104316711,
-0.4936707317829132,
0.01725642569... | |
fail in this case? (2) could it be related to argument-dependent lookup? and (3) is there anything that can be done to make this work without the explicit cast?
```
#include <fstream>
template <typename T>
class wrapper
{
T* t;
public:
explicit wrapper(T * const p) : t(p) { }
~wrapper() { delete t; }
... | [
-0.04744478315114975,
0.06031668558716774,
0.2708454132080078,
-0.23648668825626373,
0.3021356165409088,
0.08649604767560959,
0.7822224497795105,
-0.2204166203737259,
0.12729951739311218,
-0.5874427556991577,
-0.3970548212528229,
0.6069205403327942,
-0.5886179804801941,
0.10861200094223022... | |
"(2) Hello, world!\n";
// file << "(3) This line doesn't compile!\n";
}
```
It fails because you're trying to resolve an operator of your `wrapper<T>` class that doesn't exist. If you want it to work without the cast, you could put together something like this:
```
template<typename X> wrapper<T> &operator <<(X &... | [
-0.09803204983472824,
0.02705821767449379,
0.1624341458082199,
-0.17523331940174103,
-0.07424890249967575,
0.2791581451892853,
0.7479223608970642,
-0.4275757968425751,
-0.16993026435375214,
-0.38370373845100403,
-0.2198210209608078,
0.3811935484409332,
-0.586603045463562,
0.086811959743499... | |
`wrapper<T> &`. | [
0.21585071086883545,
0.16784460842609406,
0.41767552495002747,
-0.0708794891834259,
0.17153280973434448,
-0.23051460087299347,
0.14000655710697174,
0.04550805687904358,
0.07891334593296051,
-0.45745983719825745,
-0.5328526496887207,
0.44006189703941345,
-0.2955206632614136,
0.1169146671891... | |
jQuery, when i use it to create a modal window which contains form elemets,
it takes out those elements when i submit the form.
example of the form:
```
<form enctype="multipart/form-data" action="/system/article/add/" class="from" method="post">
<label for="article_title" class="required">Title:</label>
... | [
0.11571025848388672,
-0.1694820076227188,
0.6770291924476624,
0.053693681955337524,
-0.19896049797534943,
-0.3106801509857178,
-0.2336297631263733,
-0.4545164108276367,
-0.019107114523649216,
-0.4666329622268677,
-0.37880226969718933,
0.38925787806510925,
-0.0730007067322731,
-0.1628523916... | |
id="photo_title" name="photo_title" value="" type="text">
<label for="photot" class="optional">Photo thumb:</label>
<input type="file" name="photot" id="photot" class="formfield">
<label for="photo_checkbox" class="optional">Include lighbox?</label>
<input name="photo_checkbox" value="... | [
0.0754222571849823,
-0.09656262397766113,
0.6256157159805298,
-0.14335177838802338,
0.23152238130569458,
-0.022132685407996178,
-0.18674856424331665,
-0.7520997524261475,
-0.033236101269721985,
-0.6090641617774963,
-0.5517014861106873,
0.5433756113052368,
-0.465080589056015,
-0.28620177507... | |
autoOpen: false,
buttons: {
"Ok": function() {
$(this).dialog("close");
}
}
});
});
```
So what i nocited during the inspetion via firebug, is that jquery actually removes my form elements within #add\_photo and puts them outside the form in DOM, so even | [
0.24976585805416107,
0.16351011395454407,
0.6446930766105652,
-0.31293004751205444,
0.34364017844200134,
-0.13441744446754456,
0.6589057445526123,
-0.4583396911621094,
-0.03361599147319794,
-0.13986270129680634,
-0.25132104754447937,
0.7879676818847656,
-0.3311062753200531,
0.0588529296219... | |
tough in html the modal dialog is within my form, in DOM it isn't ....
An this is the reason why i'm having the issue!
Have anyone encountered simmilar problem?
Any solution?! Thank you very much!
I just had the same problem. I solved it by adding another
```
<div id="beforesubmit" style="display:none"></div>
`... | [
-0.14465466141700745,
0.04660242795944214,
0.7241966128349304,
-0.23511147499084473,
-0.4469855725765228,
-0.059759195894002914,
0.3749128580093384,
-0.10742402076721191,
-0.42105087637901306,
-0.7218669056892395,
-0.2544196546077728,
0.8447266817092896,
-0.15650250017642975,
-0.6114789247... | |
I want to reload my user profile from a script file. I thought that dot sourcing it from within the script file would do the trick, but it doesn't work:
```
# file.ps1
. $PROFILE
```
However, it does work if I dot source it from PowerShell's interpreter.
**Why do I want to do this?**
I run this script every time I ... | [
0.5560113191604614,
0.06620737910270691,
0.25945568084716797,
-0.0128175038844347,
0.03848809376358986,
-0.09979211539030075,
0.4278064966201782,
-0.07836157083511353,
0.10004646331071854,
-0.873386800289154,
0.0724925845861435,
0.7681534886360168,
-0.2680118680000305,
0.11428865045309067,... | |
me, provides a superior PowerShell session) and probably won't work right in other PowerShell environments.
Here's a script that I have been using for a while, and it has worked very well for me in every environment. I simply put this function into my Profile.ps1 at ~\Documents\WindowsPowerShell, and whenever I want t... | [
-0.0715491771697998,
0.049911707639694214,
0.8874965906143188,
-0.23025979101657867,
0.18935543298721313,
0.0961744412779808,
0.29849475622177124,
0.07462465763092041,
-0.1407010704278946,
-1.0043487548828125,
0.011226369999349117,
0.7763408422470093,
-0.21057549118995667,
0.11246161907911... | |
) | % {
if(Test-Path $_){
Write-Verbose "Running $_"
. $_
}
}
}
``` | [
0.023165816441178322,
0.3147296905517578,
0.32907357811927795,
-0.248160719871521,
0.20942912995815277,
-0.059215039014816284,
0.7419350147247314,
-0.0441865473985672,
0.20601414144039154,
-0.11584825813770294,
-0.5404501557350159,
0.5956836342811584,
-0.3495185077190399,
0.257468432188034... | |
Does anyone know of a good online compiler/runtime (for C++, Java, Python, ObjC etc.) that I can access on the web?
What I'm looking for is something that would allow me to type in a program in a web form and to run the program and see the results online.
(Let's not get into the why for now. Suffice it to say for th... | [
0.519750714302063,
0.26913902163505554,
-0.2639325261116028,
0.3189529776573181,
-0.14032027125358582,
-0.10321434587240219,
0.19590207934379578,
0.35661208629608154,
-0.23291397094726562,
-0.8707886338233948,
0.18731480836868286,
0.4619019627571106,
-0.03771291300654411,
-0.14673116803169... | |
online
> compiler/interpreter, and a simple
> collaboration tool. Paste your code
> below, and codepad will run it and
> give you a short URL you can use to
> share it in chat or email.
Languages:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tc... | [
0.420558363199234,
0.09802591800689697,
0.11554792523384094,
0.139017716050148,
-0.20738132297992706,
-0.05683448165655136,
-0.11425139755010605,
0.37128186225891113,
-0.2008858472108841,
-0.6294498443603516,
-0.3576095700263977,
0.28832700848579407,
-0.6146336793899536,
-0.025081139057874... | |
This code:
```
abstract class C
{
protected abstract void F(D d);
}
class D : C
{
protected override void F(D d) { }
void G(C c)
{
c.F(this);
}
}
```
Generates this error:
> Cannot access protected member 'C.F(D)' via a qualifier of type 'C'; the qualifier must be of type 'D' (or deriv... | [
0.20032009482383728,
0.10959503799676895,
0.1252099573612213,
0.08110659569501877,
0.2897607982158661,
-0.3883585035800934,
0.5842572450637817,
-0.2565435469150543,
-0.16257235407829285,
-0.21665585041046143,
-0.17147205770015717,
0.5783168077468872,
-0.43455493450164795,
0.444836616516113... | |
for why this is (Thanks [Greg](https://stackoverflow.com/questions/567705/why-cant-i-access-c-protected-members-except-like-this/567732#567732)) but I'm still a bit perplexed as to the rational; given:
```
class E : C
{
protected override void F(D d) { }
}
```
Why *shouldn't* D be able to be able to call E.F? ... | [
0.15570534765720367,
0.04443509876728058,
0.17034226655960083,
0.06081053242087364,
0.13624601066112518,
-0.21450117230415344,
0.19820038974285126,
-0.28730642795562744,
-0.2985129952430725,
-0.2784997224807739,
-0.1996125727891922,
0.5199533104896545,
-0.23037324845790863,
0.3600257337093... | |
member
* Make it public
* Make it internal. This will allow any types to access the member within the same assembly (or other assemblies should you add friend's)
* Derive D from C
**EDIT**
This scenario is called out in section 3.5.3 of the C# spec.
The reason this is not allowed is because it would allow for cros... | [
0.44120171666145325,
-0.0444054938852787,
-0.013204984366893768,
-0.1323813945055008,
-0.02945309318602085,
-0.47696006298065186,
0.4339776635169983,
-0.14170853793621063,
-0.53148353099823,
-0.36176797747612,
-0.03226267546415329,
0.19182319939136505,
-0.35469135642051697,
0.3657289743423... | |
but I don't 100% know).
**EDIT2** Why this is bad
Caveat, this is my opinion
The reason this is now allowed is it makes it very difficult to reason about the behavior of a class. The goal of access modifiers is to give the developer control over exactly who can access specific methods. Imagine the following class
`... | [
-0.14040648937225342,
-0.0609445795416832,
0.23279191553592682,
0.24516388773918152,
0.07759016752243042,
-0.28812718391418457,
0.4017617106437683,
-0.07642685621976852,
0.029467187821865082,
-0.6897321939468384,
-0.16791705787181854,
0.5302454233169556,
-0.14113757014274597,
0.33028969168... | |
be called.
1. Where it's invoked in C
2. Where I explicitly invoke it in MyClass
I can examine these calls and come to a reasonable conclusion about how MyClass functions.
Now, if C# does allow cross hierarchy protected access I can make no such guarantee. Anyone in a completely different assembly can come by and d... | [
0.35283422470092773,
-0.08870460838079453,
0.0630924329161644,
-0.2050064653158188,
-0.2785514295101166,
-0.1435679793357849,
0.29050979018211365,
0.12756308913230896,
0.07642233371734619,
-0.5401053428649902,
-0.0896129235625267,
0.6177871823310852,
-0.2803844213485718,
0.1250392198562622... | |
On [JSON.org](http://json.org) the essential data structures that JSON represents are given as
1. A collection of name/value pairs, and
2. An ordered list of values.
I have not been able to find anywhere whether a second member having the same name as one already parsed into the current object should (a) throw an ex... | [
0.06273480504751205,
0.16283971071243286,
0.07021565735340118,
-0.07791907340288162,
-0.1482473611831665,
-0.21666914224624634,
0.19542084634304047,
-0.028985565528273582,
-0.4162547290325165,
-0.5554216504096985,
-0.4419037997722626,
0.2910940647125244,
-0.4812197983264923,
-0.15602563321... | |
latest value for repeated keys will override any previously assigned value for that key, within the specific object. Think in terms of assigning a value to an object property; A later assignment will override an earlier one.
To demonstrate this, I have set up an [example here](http://jsbin.com/amane). The code is disp... | [
-0.07045385986566544,
-0.25901544094085693,
0.7600544095039368,
-0.22342661023139954,
0.34966301918029785,
0.11178796738386154,
0.1755385845899582,
-0.30902788043022156,
-0.2415226697921753,
-0.4995782673358917,
-0.3318033516407013,
0.5121273994445801,
-0.17898757755756378,
0.3176061213016... | |
});
});
```
By the Way, I have used eval() here for ease of use. I would recommend using a JSON parser instead of eval() due to security issues. | [
-0.18463754653930664,
0.1321817934513092,
0.04929506033658981,
-0.3569537103176117,
-0.11495142430067062,
-0.33157801628112793,
0.5442781448364258,
0.007649158127605915,
-0.15875351428985596,
-0.2946695387363434,
-0.4602055549621582,
0.7387421727180481,
-0.5747911334037781,
-0.186872795224... | |
Informally, most of us understand that there are 'binary' files (object files, images, movies, executables, proprietary document formats, etc) and 'text' files (source code, XML files, HTML files, email, etc).
In general, you need to know the contents of a file to be able to do anything useful with it, and form that p... | [
0.5536226630210876,
0.31930187344551086,
-0.14010193943977356,
0.37937474250793457,
0.06084360182285309,
-0.3143249452114105,
-0.011828545480966568,
0.31824666261672974,
-0.33234071731567383,
-0.6062814593315125,
-0.4381934106349945,
0.45959076285362244,
0.16961625218391418,
0.067265287041... | |
'text' files, but to avoid offending anyone with this imprecise definition, I will continue to use 'scare' quotes.
However, there are various tools that work on a wide range of files, and in practical terms, you want to do something different based on whether the file is 'text' or 'binary'. An example of this is any t... | [
0.33541417121887207,
0.08978082984685898,
0.2449573129415512,
0.2020542472600937,
-0.1253032088279724,
-0.39924314618110657,
0.32977741956710815,
0.2612721920013428,
-0.16007007658481598,
-0.5300112962722778,
0.0024324352853000164,
0.8546423316001892,
-0.2273496389389038,
-0.00688603147864... | |
console.
So, the question is, how do you tell if a file is 'text' or 'binary'? And to restrict is further, how do you tell on a Linux like file-system? I am not aware of any filesystem meta-data that indicates the 'type' of a file, so the question further becomes, by inspecting the content of a file, how do I tell if ... | [
0.025496039539575577,
0.06792890280485153,
0.5114060640335083,
0.24783629179000854,
0.12042347341775894,
-0.18888425827026367,
-0.1800452023744583,
0.07137124985456467,
0.06472601741552353,
-0.6967818140983582,
-0.08678467571735382,
0.9645587801933289,
-0.11482501775026321,
0.0209222938865... | |
guess it is helpful, in general, to be pointed at existing code that does this, I should have specified), I'm not really after what existing programs can I use to do this.
The spreadsheet software my company makes reads a number of binary file formats as well as text files.
We first look at the first few bytes for a ... | [
0.6516329050064087,
0.2850872576236725,
0.09663425385951996,
0.20957612991333008,
0.08948104828596115,
0.1789723038673401,
0.0708334818482399,
0.13081511855125427,
-0.1874358057975769,
-0.4476199746131897,
0.2727218270301819,
0.49515199661254883,
0.18500067293643951,
0.07594337314367294,
... | |
a [UTF-8](http://en.wikipedia.org/wiki/UTF-8), [UTF-16](http://en.wikipedia.org/wiki/UTF-8) or a text file encoded in the current [code page](http://en.wikipedia.org/wiki/Code_page) of the host operating system. If it passes none of these tests, we assume that it is not a file we can deal with and throw an appropriate ... | [
0.07635924220085144,
0.03949977084994316,
0.27797260880470276,
-0.051716651767492294,
0.1305156797170639,
-0.25618648529052734,
0.028648367151618004,
0.1390208750963211,
-0.10313805192708969,
-0.5182770490646362,
-0.9057785272598267,
0.26697051525115967,
-0.3442347049713135,
0.299885451793... | |
Consider the task:
1. Read a polygon from a KML file using library A
2. Intersect it with another polygon using library B
3. Calculate its area using library C
Each library has it's own Polygon class, and they are all equivalent. Which is the best practice when using all these classes? At the moment I first wrote th... | [
0.18907500803470612,
0.17111964523792267,
0.12065175920724869,
0.2386062890291214,
-0.1849575787782669,
0.10045060515403748,
-0.0326806902885437,
-0.19990311563014984,
-0.19620615243911743,
-0.8022403717041016,
0.07529749721288681,
0.2953989803791046,
-0.131615549325943,
0.1185692474246025... | |
as text files.
We first look at the first few bytes for a [magic number](http://en.wikipedia.org/wiki/Magic_number_(programming)) which we recognize. If we do not recognize the magic number of any of the binary types we read, then we look at up to the first 2K bytes of the file to see whether it appears to be a [UTF-... | [
0.35248973965644836,
0.039099957793951035,
0.4411299228668213,
0.08364176005125046,
-0.005147753283381462,
-0.13057160377502441,
0.2154158055782318,
-0.02420041523873806,
-0.2927600145339966,
-0.6736193895339966,
-0.6678388714790344,
0.38004812598228455,
-0.18494416773319244,
0.16655787825... | |
Please look at the following file: (it is a complete file)
```
#ifndef TEES_ALGORITHM_LIBRARY_WRAPPER_H
#define TEES_ALGORITHM_LIBRARY_WRAPPER_H
#ifdef _TEES_COMPILE_AS_LIB
#include <dfa\Includes\DFC_algorithms.hpp>
#include <DFA\FuzzyClassifier\FuzzyAlgorithmIntialization\InitFuzzyAlgorithm.hpp>
typedef teesalgorith... | [
-0.31566712260246277,
0.17798326909542084,
0.6390637159347534,
-0.15569476783275604,
-0.04404667764902115,
0.07074925303459167,
0.13825783133506775,
-0.4334300756454468,
-0.3446098268032074,
-0.43745285272598267,
-0.5886005759239197,
0.3504246771335602,
-0.21818076074123383,
0.016509307548... | |
#ifdef _DEBUG
#error No AlgorithmLibWrapper libraries compiled for this version of VC
#else
#error No AlgorithmLibWrapper libraries compiled for this version of VC
#endif
#elif defined(UNDER_CE) // Win CE
#ifdef _DEBUG
#pragma comment( lib, "AlgorithmLibW... | [
-0.04024646803736687,
0.1612488329410553,
0.2624783515930176,
-0.11672036349773407,
-0.002886385889723897,
-0.054855380207300186,
0.1713680922985077,
-0.3606739342212677,
-0.09626059234142303,
-0.6398133635520935,
-0.2416926473379135,
0.48919084668159485,
-0.471103310585022,
0.172507092356... | |
#else
#pragma comment( lib, "AlgorithmLibWrapperCE" )
#endif
#else // If VC 2005
#ifdef _DEBUG
#pragma comment( lib, "AlgorithmLibWrapperd" )
#else
#pragma comment( lib, "AlgorithmLibWrapper" )
#endif
#endif
#endif | [
-0.5083140134811401,
0.020193101838231087,
0.5287549495697021,
-0.3120487332344055,
-0.20606644451618195,
0.0929117500782013,
0.1843014657497406,
-0.5191266536712646,
-0.1420941799879074,
-0.4017658829689026,
-0.4789654314517975,
0.3472680449485779,
-0.49811509251594543,
0.1498218178749084... | |
#endif
#endif //TEES_ALGORITHM_LIBRARY_WRAPPER_H
```
I am getting the following errors; I don't know why. I manually counted the preprocessor directives also.
> AlgorithmLibraryWrapper.hpp:10:1: unterminated #ifdef
>
> AlgorithmLibraryWrapper.hpp:7:1: unterminated #ifndef
I am using the poor vxWorks gcc compil... | [
0.08916305005550385,
0.2878420352935791,
0.48220890760421753,
-0.07983450591564178,
-0.08264946937561035,
-0.32113760709762573,
0.3347404897212982,
-0.07720738649368286,
0.030303634703159332,
-0.6882268786430359,
-0.15743470191955566,
0.8092708587646484,
-0.4824308156967163,
0.171356186270... | |
Express edition. Again, you can preprocess code that even doesn't compile, so no problem with nonworking library etc.
Most compilers have an option that will give you the output from the preprocessor so you can check what it's doing. For example,
```
gcc -E file.c >file.preproc
```
will give you the pre-processed s... | [
-0.44833505153656006,
-0.3364982306957245,
0.26078668236732483,
0.05330439656972885,
-0.4177645444869995,
-0.20459423959255219,
0.019041823223233223,
-0.013822170905768871,
-0.047670576721429825,
-0.6247009634971619,
-0.102625772356987,
0.41016608476638794,
-0.5951240062713623,
-0.32788375... | |
I am following the tutorial here:
<http://nutch.sourceforge.net/docs/en/tutorial.html>
Crawling works fine, as does the test search from the command line.
When I try to fire up tomcat after moving ROOT.war into place(and it unarchiving and creating a new ROOT folder during startup), I get a page with the 500 error... | [
-0.23846513032913208,
0.32767897844314575,
0.5057370066642761,
-0.12006358057260513,
-0.1457882672548294,
0.13303035497665405,
0.798275887966156,
-0.2915607988834381,
-0.30365127325057983,
-0.7178742289543152,
-0.00037044400232844055,
0.5763384103775024,
-0.2909741699695587,
0.019253242760... | |
at org.apache.commons.digester.Digester.createSAXException(Digester.java:3207)
at org.apache.commons.digester.Digester.endElement(Digester.java:1225) ............ etc.
```
So it looks like the root of the error is default web.xml, not in the Log4JLogger - although I know very little about Java. I did not edit the... | [
0.07043184340000153,
0.5677729845046997,
-0.04529384896159172,
0.06985867768526077,
-0.00395929766818881,
-0.24810457229614258,
0.493470162153244,
0.09214934706687927,
-0.408251017332077,
-0.6828047037124634,
0.04356386512517929,
0.43261784315109253,
-0.5031500458717346,
0.2001166045665741... | |
and restart Tomcat and then it should work.
Also your Tomcat seems to be ancient, if possible I'd recommend getting 5.5.x or 6.x. | [
0.33550477027893066,
-0.020742442458868027,
0.2705381214618683,
0.44203364849090576,
0.26581913232803345,
-0.09902332723140717,
0.1851326823234558,
0.22927547991275787,
-0.08434104919433594,
-0.3892133831977844,
0.11660487949848175,
0.701657235622406,
0.2745864689350128,
0.0753758996725082... | |
What is the best way to ensure thread-safe Linq-to-XML, for writing?
We recently got overloaded on our web cluster and I had to pull a quick overloaded.aspx out of my butt to capture emails that people can be contacted with later when the site becomes more responsive. In my short 5 minute haste, I wrote this:
```
pri... | [
-0.2554737329483032,
-0.2595154941082001,
0.8009235858917236,
-0.040356919169425964,
0.20499153435230255,
-0.1219814121723175,
0.23420973122119904,
-0.4450065791606903,
-0.26258227229118347,
-0.47606754302978516,
-0.3687269985675812,
0.51535564661026,
-0.4260977804660797,
0.080699302256107... | |
(regex.IsMatch(email))
{
lock (LockHandle)
{
try
{
string fileName = Server.MapPath("emails.xml");
XDocument xdoc = XDocument.Load(fileName);
xdoc.Element("emails").Add(new XElement("email", email));
xdoc.Save(fileName);
}
catch {} | [
0.03467059135437012,
-0.1922922283411026,
0.568721354007721,
-0.22196905314922333,
0.33605119585990906,
0.09676019102334976,
0.15302370488643646,
-0.4112662374973297,
-0.10797689110040665,
-0.49138087034225464,
-0.3417103588581085,
0.3386023938655853,
-0.5199118256568909,
0.152395665645599... | |
}
ResponseText.Text = "Thanks! We'll get back to you.";
}
}
}
```
I wasn't able to lookup if Linq-to-XML was threadsafe; so, the theory went "let me just lock a static object, and that will prevent multiple writes." Was this the best approach? Was it even needed (is Linq-to-Xml thread safe?). Sad to say... | [
0.034947268664836884,
-0.1340463012456894,
0.384174108505249,
0.0675385370850563,
-0.06592994928359985,
-0.2774721086025238,
0.28612637519836426,
0.003127327188849449,
-0.3604060113430023,
-0.3734707534313202,
-0.08746632188558578,
0.5570756196975708,
-0.24792338907718658,
-0.1133318319916... | |
better way; or, if it was just overkill to lock it in the first place.
It is not inherently thread safe to save a file this way, therefore it was smart to use a static lock handle. | [
-0.016743885353207588,
-0.4414156675338745,
0.07039318978786469,
0.25009870529174805,
0.08414903283119202,
-0.24342766404151917,
0.06897778064012527,
-0.2357080727815628,
-0.23447278141975403,
-0.32253357768058777,
0.057293862104415894,
0.5169768929481506,
-0.06194401904940605,
0.106623135... | |
So, for example, say I had a list of numbers and I wanted to create a list that contained each number multiplied by 2 and 3. Is there any way to do something like the following, but get back a single list of numbers instead of a list of lists of numbers?
```
mult_nums = [ [(n*2),(n*3)] | n <- [1..5]]
-- this returns ... | [
-0.09670987725257874,
0.20163026452064514,
0.26187676191329956,
-0.08123818784952164,
-0.22344006597995758,
0.32478684186935425,
0.22951607406139374,
-0.3061373829841614,
-0.3946804106235504,
-0.6168758869171143,
-0.13553167879581451,
0.41516128182411194,
-0.3858640193939209,
0.22640156745... | |
I'm working on a job portal using asp.net 3.5
I've used Lucene for job and resume search functionality.
Would like to know tips/recommendations if any with respect to Lucene performance optimization, scalability, etc.
Thanks a ton!
As others answered, optparse is the best option, but if you just want quick code try so... | [
0.07053593546152115,
-0.3092021644115448,
0.3377135396003723,
-0.1271522343158722,
-0.03234196826815605,
0.09152819216251373,
0.0235200896859169,
-0.039684683084487915,
-0.05708576366305351,
-1.0301462411880493,
-0.32961636781692505,
0.6854771971702576,
-0.1184319406747818,
-0.075491316616... | |
args = ()
# ... anywhere in code ...
if 'debug' in args:
print 'debug flag'
if 'xls' in args:
print 'xls flag'
```
**EDIT**: Here's an optparse example because so many people are answering optparse without really explaining why, or explaining what you have to change to make it work.
The primary reason to ... | [
-0.018134376034140587,
-0.21325840055942535,
0.4301091432571411,
-0.22607094049453735,
0.11030547320842743,
0.03516882285475731,
0.21957731246948242,
-0.14767545461654663,
-0.28279995918273926,
-0.8036437630653381,
-0.43996739387512207,
0.5887367129325867,
-0.7221664190292358,
-0.469092190... | |
optparse you need to change your specifications to put '-' or '--' in front of the optional arguments and you need to allow all the arguments to be in any order.
So here's an example using optparse:
```
import sys, re, optparse
first_re = re.compile(r'^\d{3}$')
parser = optparse.OptionParser()
parser.set_defaults(d... | [
-0.16797007620334625,
-0.43316295742988586,
0.43640273809432983,
-0.38203102350234985,
0.3855116367340088,
0.3157612383365631,
0.09829378128051758,
-0.4970104396343231,
0.25353261828422546,
-0.5088983178138733,
-0.458836168050766,
1.1327317953109741,
-0.612528920173645,
-0.5792091488838196... | |
arguments")
if options.debug:
print 'debug flag'
if options.xls:
print 'xls flag'
```
The differences here with optparse and your spec is that now you can have command lines like:
```
python script.py --debug --xls 001
```
and you can easily add new options by calling parser.add\_option() | [
0.13062863051891327,
-0.18939290940761566,
0.27407047152519226,
-0.2829766273498535,
0.054446496069431305,
0.25803911685943604,
0.030543923377990723,
-0.108395516872406,
-0.06589841842651367,
-0.4557715952396393,
-0.32171356678009033,
1.0306041240692139,
-0.510461688041687,
-0.357416003942... | |
At the risk of sounding like a total noob, how do I implement ISynchronizeInvoke on a System.Timers.Timer?
I have a class (no UI) that is making calls to mciSendString. I have a timer that is supposed to poll for the current status. All of the calls from the class work, but not the ones coming from the timers elapsed ... | [
0.30559903383255005,
-0.09361112862825394,
0.36678555607795715,
0.35729488730430603,
0.005510132759809494,
-0.025797560811042786,
0.0639212504029274,
-0.1798245757818222,
-0.28454676270484924,
-0.6273971199989319,
0.1373814046382904,
0.3977013826370239,
0.09044909477233887,
0.2371945381164... | |
yet.
Code Sample:
```
[DllImport("winmm.dll")]
private static extern Int32 mciSendString(string command, StringBuilder buffer, Int32 bufferSize, IntPtr hwndCallback);
public cPlayer()
{
tmrPoll = new System.Timers.Timer(1000);
tmrPoll.Enabled = false;
tmrPoll.Elapsed += new El... | [
0.322775274515152,
-0.11124444007873535,
0.9821509122848511,
0.010990824550390244,
0.11794215440750122,
0.32878801226615906,
0.32346269488334656,
-0.6821192502975464,
-0.18343012034893036,
-0.49241864681243896,
-0.004000684712082148,
0.45849111676216125,
-0.24414680898189545,
0.68690830469... | |
{
Console.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId.ToString());
tmrPoll.Stop();
int res = 0;
res = mciSendString("status MediaFile position", _sbBuffer, _sbBuffer.Capacity, IntPtr.Zero);
if (res == 0) _position = int.Parse(_sbBuffer.ToString());
if... | [
-0.47401663661003113,
-0.3666916489601135,
0.8618603348731995,
-0.13990099728107452,
0.6957066059112549,
0.11138390749692917,
0.3831079304218292,
-0.3897956311702728,
-0.14281028509140015,
-0.5947859287261963,
-0.4941622018814087,
0.6553521752357483,
-0.2530364990234375,
0.4611838757991791... | |
else {
Console.WriteLine("Failed: Error " + res.ToString());
}
res = mciSendString("status MediaFile length", _sbBuffer, _sbBuffer.Capacity, IntPtr.Zero);
if (res == 0) Console.WriteLine("Length = " + _sbBuffer.ToString());
if (res == 0) _length = int.Parse(_sbBuffer.ToStri... | [
-0.44695425033569336,
-0.19413217902183533,
0.8153256773948669,
-0.10761552304029465,
0.41320040822029114,
0.17765162885189056,
0.3793334662914276,
-0.6045883297920227,
-0.0853615403175354,
-0.710008442401886,
-0.5060529708862305,
0.8375027775764465,
-0.22662541270256042,
0.312101751565933... | |
" + _sbBuffer.ToString());
}
private void SendCommand(string cmd)
{
mciSendString(cmd, null, 0, IntPtr.Zero);
Poll();
}
```
For clarification, if I call from SendCommand (whatever it may be, Play, Stop, etc.) it works and the result of Poll() is what I'd expect. When the timer fires,... | [
-0.047689542174339294,
0.14048373699188232,
1.0466015338897705,
-0.4058844745159149,
0.20216132700443268,
0.15845154225826263,
0.6391350030899048,
-0.9131020903587341,
-0.4465855658054352,
-0.5465438961982727,
-0.026647847145795822,
0.6982641220092773,
-0.3714076578617096,
0.61542171239852... | |
an answer over at the msdn forum. Someone left me a message with a link to codeplex ([nito.async](http://www.codeplex.com/NitoAsync)). I used the GenericSynchronizingObject to get the job done. | [
0.3393256664276123,
-0.1302551031112671,
0.0019831133540719748,
0.1958514153957367,
-0.3649972081184387,
-0.14006461203098297,
0.2598780393600464,
0.049166470766067505,
-0.25058284401893616,
-0.50211101770401,
0.2396264672279358,
0.08174797147512436,
-0.14174051582813263,
0.238155409693717... | |
I am trying to create a simple C# app which does port forwarding, and need to know how to use the IP\_HDRINCL socket option to try to fake out the receiving end to think the connection is really to the source. Any examples would be greatly appreciated.
```
sock = new Socket( AddressFamily.InterNetwork, SocketType.Raw, ... | [
0.04532705992460251,
0.1692042350769043,
0.5988548994064331,
-0.07679539918899536,
-0.05267002061009407,
0.06009826436638832,
0.6644828915596008,
-0.08760000765323639,
-0.06798118352890015,
-0.8818458914756775,
-0.24518464505672455,
0.1982714682817459,
-0.4452988803386688,
0.14549329876899... | |
), null );
```
The only problem is that I've been able to successfully receive data from a raw socket like this, (including the IP header) but not send it. | [
0.22930844128131866,
0.2276172935962677,
0.053782325237989426,
0.11656655371189117,
-0.10602311044931412,
-0.1459404081106186,
0.40327510237693787,
-0.01618720032274723,
0.07671041041612625,
-0.36179307103157043,
-0.20369216799736023,
0.5786550045013428,
-0.13495837152004242,
0.29627728462... | |
Last May at Railsconf on Portland, I went to a presentation where it was argued that, in Rails, Ruby class member variables, like @@foo, are dangerous because they are inherently unthreadsafe.
I researched the question afterward and I never found a link that really fleshed out the question. I would appreciate a point... | [
0.44086238741874695,
-0.05591851472854614,
-0.157120943069458,
0.174630269408226,
-0.2844027280807495,
-0.45983099937438965,
0.7255827188491821,
0.06839229166507721,
-0.182395339012146,
-0.25671830773353577,
0.2093641608953476,
0.4723837077617645,
-0.1528749018907547,
0.16198384761810303,
... | |
@@foo had problems beyond the usual caveats that any shared variable access must be strictly controlled. I know that there were memory leaks in the Ruby code itself that were fixed a little while ago. I'm looking for article links on Ruby shared variables and multitasking, the more in-depth, the better. \*Currently I d... | [
0.6781132221221924,
0.22951637208461761,
0.11679498106241226,
-0.1737593412399292,
-0.46062904596328735,
-0.0905974879860878,
0.8867920637130737,
0.39573967456817627,
-0.32930946350097656,
-0.22116370499134064,
0.40553227066993713,
0.7958273887634277,
-0.21818892657756805,
0.21933110058307... | |
multiple times (once per mongrel, for example, if you use mongrel) so the class member variable could vary independently within those processes.
I think there's a [scoping change for @@ variables in Ruby 1.9](http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9#l38), which should probably be taken into account - we'll al... | [
0.3585704565048218,
-0.1796894371509552,
0.09797514975070953,
-0.3124472200870514,
-0.3806975185871124,
0.16081108152866364,
0.4944760799407959,
-0.20609506964683533,
-0.6053062081336975,
-0.37092816829681396,
0.13902772963047028,
0.4728224575519562,
-0.48352503776550293,
0.056174170225858... | |
could add some AR-style declarative macro goodness.) | [
0.12219295650720596,
-0.020308207720518112,
0.22731205821037292,
0.06011518836021423,
0.10238262265920639,
0.5478671193122864,
0.4887966811656952,
0.17196960747241974,
-0.12505580484867096,
-0.39588040113449097,
-0.08487800508737564,
0.6597060561180115,
-0.13673079013824463,
-0.50341516733... | |
I am using BeautifulStoneSoup to parse an XML document and change some attributes. I noticed that it automatically converts all XML tags to lowercase. For example, my source file has `<DocData>` elements, which BeautifulSoup converts to `<docdata>`.
This appears to be causing problems since the program I am feeding my... | [
0.20111694931983948,
0.19666215777397156,
0.429960161447525,
-0.08607052266597748,
-0.21835912764072418,
-0.07178400456905365,
0.19713519513607025,
-0.35279178619384766,
0.10776801407337189,
-0.5934346318244934,
0.17097313702106476,
0.3393590748310089,
-0.4576745331287384,
-0.0080363862216... | |
<configuration>
<outputDirectory>
${project.build.directory}
</outputDirectory>
</configuration>
</plugin>
```
Then run `mvn clean dependency:copy-dependencies` to copy perform the copy. Combine this with the [assembly plugin](http://maven.apache.org/plugins/maven-assembly-plugin/ "Mav... | [
0.47755134105682373,
0.151861310005188,
0.046650148928165436,
-0.19116385281085968,
0.2683281898498535,
-0.36855894327163696,
0.3792624771595001,
-0.24684306979179382,
-0.2549406886100769,
-0.6713405251502991,
-0.4053988754749298,
0.47774097323417664,
-0.28085562586784363,
0.24922084808349... | |
I am looking for a way for clients in a LAN to find all the instances of my server application without any configuration. Instead of hacking something myself, I'd like to use an existing solution. Personally, I need it to be done in Python, but I'd happy to hear about solutions in any other language.
So why am I not u... | [
0.5511895418167114,
0.06715629249811172,
0.03265148401260376,
-0.023669680580496788,
-0.06097407266497612,
-0.043384891003370285,
0.10831210017204285,
0.11107167601585388,
-0.5619415044784546,
-0.6590949892997742,
-0.04348282516002655,
0.43644893169403076,
-0.2824976146221161,
-0.147481858... | |
rights, i.e. only use ports>1024.
* **Solid**. It must allow multiple services of the same and different service type on a single machine and continue advertising the services even when the instance that started the advertisement server stops or crashes.
* **Portable**. It must run nearly everywhere, or at least on \*B... | [
0.48397716879844666,
0.09509091824293137,
0.6552731394767761,
0.4690267741680145,
0.0603410042822361,
-0.3583063781261444,
-0.12273404747247696,
-0.11474159359931946,
-0.39736229181289673,
-0.8452377319335938,
-0.04276164621114731,
0.7488288283348083,
-0.07147622853517532,
0.01367291714996... | |
is a strict no-no.
I expect something like this:
```
def registerService(service): # (type, port)
if listen(multicast, someport):
if fork() == child:
services = [service]
for q in queriesToMe():
if q == DISCOVERY:
answer(filter(q.criteria, servic... | [
-0.05142882093787193,
-0.012306523509323597,
0.1506100296974182,
-0.17068365216255188,
0.11553066223859787,
0.037574492394924164,
0.23139744997024536,
-0.23105506598949432,
0.03047245554625988,
-0.532548189163208,
-0.2037101835012436,
0.42794063687324524,
-0.06560516357421875,
0.5156923532... | |
elif q == ADVERTISE and q.sender == "localhost":
services.append(q.service)
else:
advertiseAt("localhost", service)
```
I wrote an application/library (currently Python and CLI interface) that matches all these critera. It's called [minusconf](http://code.google.com/p/minusconf/). Turns... | [
0.548281192779541,
-0.08476734906435013,
0.6441096067428589,
-0.29593154788017273,
-0.3649985194206238,
0.1750756949186325,
0.10988100618124008,
0.14892812073230743,
0.17047569155693054,
-0.6135585308074951,
0.03517229110002518,
0.4426115155220032,
-0.6715555787086487,
0.05630284175276756,... | |
I need to calculate a StartDate and EndDate of a current Quarter and the previous Quarter in vb.net.
Forgive my lack of a VB.net-specific answer, but given a generic sort of date object with various functions in some pseudo-language (with zero-based day and month indexes)...
```
//round the current month number down t... | [
0.2489641308784485,
0.13247822225093842,
1.0861451625823975,
-0.13980086147785187,
0.1005682572722435,
0.10386291891336441,
0.3340359032154083,
-0.3888106942176819,
-0.2699364721775055,
-0.4095623195171356,
-0.03366636112332344,
0.27278777956962585,
0.1673363298177719,
0.42538073658943176,... | |
- (Today.Month Mod 3) + 1, 1)
Dim ThisQuarterEnd As Date = New Date(CInt(IIf(Today.Month < 9, Today.Year, Today.Year + 1)), (Today.Month - (Today.Month Mod 3) + 3 Mod 12) + 1, 1).AddDays(-1)
Dim LastQuarterStart As Date = New Date(CInt(IIf(Today.Month < 3, Today.Year - 1, Today.Year)), (Today.Month - (Today.Month Mod... | [
0.07177314162254333,
-0.06178130954504013,
1.0166937112808228,
-0.1621427983045578,
0.2427695393562317,
0.16089974343776703,
0.1731119304895401,
-0.05900195613503456,
-0.3722917139530182,
-0.49011126160621643,
-0.5437909364700317,
0.708138644695282,
0.04325664043426514,
0.3502555787563324,... | |
I have a View Controller I'm reusing to edit individual objects (NSString, NSNumber, NSDate) in a previous View Controller's TableView. I'm loosely basing this off of the EditingViewController in Apple's SQLiteBooks sample project. the datePicker is instantiated in the nib file.
The issue here is it works fine & dand... | [
-0.08249744772911072,
-0.2831224203109741,
0.6488105058670044,
-0.09469395875930786,
-0.12741781771183014,
0.09807147085666656,
0.0038845736999064684,
0.19489255547523499,
-0.31041276454925537,
-0.7937930822372437,
0.1810815930366516,
0.23045162856578827,
-0.09221960604190826,
0.4644823968... | |
first edit. How can I set those highlighted values to the initial value of the 2nd date object or reset the whole UIdatePicker instance.
2nd related question (bonus points ;-) as I struggle to wrap my head around Cocoa: why, in the SQLiteBooks example is there no @property or @synthesize statements for the datePicker ... | [
-0.08164507895708084,
-0.15247023105621338,
0.45763099193573,
0.07591231912374496,
-0.156616672873497,
-0.13500142097473145,
0.24387525022029877,
-0.020199129357933998,
-0.3823437988758087,
-0.559666097164154,
-0.03840835765004158,
0.5146505236625671,
-0.22601567208766937,
-0.1571965068578... | |
1776. HOW can we turn this behavior off?
Store the date from the first picker in, e.g. storedDate. Then set the date to be displayed in your UIDatePicker using its date property. Assume your UIDatePicker is named picker, then
```
picker.date = storedDate; // picker's date is initialised to today's date/time
```
You... | [
0.33582091331481934,
-0.24165396392345428,
0.21004344522953033,
-0.053381018340587616,
0.15073570609092712,
0.1657516211271286,
-0.4382265508174896,
-0.056184761226177216,
-0.39959627389907837,
-0.4876568615436554,
0.04054807871580124,
0.22872412204742432,
-0.3403297960758209,
0.4393670856... | |
declarations (specifically, the @synthesize) tell the compiler to use these declarations to automatically generate accessor methods as needed to satisfy your class's interface.
The dot syntax in Objective-C is translated by the compiler to the invocation of accessor methods. So...
```
foo.bar = @"hello";
```
Is tr... | [
0.36963504552841187,
0.2462301105260849,
0.46793776750564575,
-0.02268182300031185,
-0.027907270938158035,
-0.14276458323001862,
0.17471417784690857,
-0.14155729115009308,
0.01521711703389883,
-0.39461708068847656,
-0.34527266025543213,
0.8144447803497314,
-0.2741948962211609,
0.0754750669... | |
better defensive coding to use properties. | [
-0.1314965784549713,
0.06835071742534637,
-0.21314793825149536,
0.23830261826515198,
-0.34246307611465454,
-0.037237249314785004,
0.24922233819961548,
-0.32120969891548157,
0.20439213514328003,
-0.9584338665008545,
-0.4056968688964844,
0.657892107963562,
0.10549583286046982,
-0.34326684474... | |
Here is an extract of HTML from within a standard HTML page:
```
<form name="login_form" action="http://localhost/BOB.WebPortal/LoginForm.aspx" method="post>
<div id="content_logins">
<div id="spacer_ie" style="width:990px; height:7px; border:none; float:left"></div>
<div style="width:... | [
-0.26710009574890137,
-0.03343871980905533,
0.7788313031196594,
-0.09173326939344406,
-0.28394266963005066,
0.3771325647830963,
0.29177096486091614,
-0.3259901702404022,
-0.28792181611061096,
-0.4710872769355774,
-0.4549923837184906,
0.04562586173415184,
-0.05889332666993141,
-0.1056678071... | |
<div style="width:110px; border:none; float:left">
<input type="password" name="pword" id="pword" size="13" /></div>
<div style="width:140px; height:22px; border:none; margin-top:-2px; float:left">
<!--input class="btbgfix" type="image" src="images/submit.png" alt... | [
-0.1674230694770813,
-0.14414189755916595,
0.6408095955848694,
0.007849279791116714,
-0.3703731596469879,
0.10316618531942368,
0.1282249540090561,
-0.5417758822441101,
-0.3338876962661743,
-0.4820947051048279,
-0.34136492013931274,
0.32946041226387024,
0.12257354706525803,
-0.0944806635379... | |
<input name="submit" id="loginButton" class="btbgfix" type="image" src="images/submit.png" alt="Submit" value="Login"></div>
<div style="width:320px; height:22px border:none; float:left">
<img name="login" src="x.gif" id="alogin" usemap="#m_login" border="0" width="320" height="22" />
... | [
-0.262294203042984,
-0.0644320547580719,
0.7526517510414124,
-0.0711182951927185,
-0.20999327301979065,
0.28151246905326843,
0.07579334825277328,
-0.6027606725692749,
-0.4215996265411377,
-0.7144491076469421,
-0.25923627614974976,
0.4840468764305115,
-0.05856357514858246,
-0.00180731306318... | |
</map>
</div>
</div>
</form>
```
My problem is that I am trying to retrieve the post value uname and pword using Request.Form from within the Page\_Load event of the C# codebehind file in my ASP.Net application. However I find that Request.Form is empty. However if I use Request.Params... | [
-0.0005568443448282778,
0.045292481780052185,
0.4825919270515442,
-0.1715826690196991,
-0.18080584704875946,
0.20166702568531036,
0.2411724179983139,
-0.4929672181606293,
-0.27908068895339966,
-0.5780285000801086,
-0.22987934947013855,
0.3506726920604706,
-0.28728267550468445,
0.2477686703... | |
query string values in the URL.
Am I doing something wrong in my html?
Assuming that's a direct copy-paste from your HTML, you're missing a closing quote on the end of "post". | [
0.24437811970710754,
0.3577965199947357,
0.3212125301361084,
0.04381473734974861,
-0.2543128728866577,
-0.21752774715423584,
0.6384109854698181,
0.4149731993675232,
-0.1572079062461853,
-0.3741546869277954,
-0.038210537284612656,
0.1811656653881073,
-0.23782116174697876,
0.3899310827255249... | |
I have a pair of SQL Servers at different webhosts, and I'm looking for a way to periodically update the one server using the other. Here's what I'm looking for:
1. As automated as possible - ideally, without any involvement on my part once it's set up.
2. Pushes a number of databases, in their entirely (including any... | [
0.3849516212940216,
0.15300880372524261,
0.30898547172546387,
0.22195540368556976,
0.03990214690566063,
-0.20349948108196259,
-0.047057267278432846,
-0.027606261894106865,
-0.3946166932582855,
-0.5471286773681641,
0.05094940587878227,
0.3770761787891388,
-0.020223887637257576,
0.2680579125... | |
recreate the publication and subscription
4. One database is about 4GB in size and contains binary data. I'm not sure if there's a way to export this to a script, but it would be a mammoth file if I did.
Originally, I was thinking of writing something that takes a scheduled full backup of each database, FTPs the backu... | [
0.62721186876297,
-0.18150979280471802,
0.2358386069536209,
0.24227455258369446,
0.18905258178710938,
0.06924396753311157,
-0.11639989167451859,
0.1612948179244995,
-0.5269112586975098,
-0.6231833100318909,
0.0027456695679575205,
0.2884003221988678,
-0.2588546872138977,
0.25642111897468567... | |
transfer them - can these backups be done synchronously? Also, the server being refreshes is our test server, so if there's some downtime involved in moving the data, that's fine.
Does anybody out there have a better idea, or is what I'm currently considering the best non-replication way to go? Thanks for your help, e... | [
0.4485653042793274,
-0.02308971807360649,
0.38741132616996765,
0.5775837898254395,
-0.07838808745145798,
-0.13647019863128662,
0.10495615750551224,
0.12094094604253769,
-0.44860848784446716,
-0.5505703687667847,
-0.062028829008340836,
0.17203034460544586,
0.08270211517810822,
-0.0056217587... | |
all your input!
I'd write a .NET console app for this. Doing a backup is as easy as opening a SQL connection and executing a "BACKUP DATABASE [] TO DISK = N''. Then use the built in .NET FTP libraries to push it up to the other server. You can even throw in [sharpziplib](http://www.icsharpcode.net/OpenSource/SharpZipLi... | [
0.3520180583000183,
-0.34605681896209717,
0.5292442440986633,
0.3365761935710907,
0.16957317292690277,
-0.160025954246521,
0.13248950242996216,
-0.047500137239694595,
-0.4422781467437744,
-0.661529004573822,
-0.3749047815799713,
0.9567243456840515,
-0.1901520937681198,
-0.06958367675542831... | |
I've installed VS 2008 and SP1. I've tried to load a solution that has a WCF project and it complains that "This project type is not supported by this installation".
I've tried the devenv.exe /setup but that didn't help.
If it matters, this is all on Windows 7. On a Windows Vista installation I have no problems with... | [
0.39177194237709045,
0.12133835256099701,
0.5245872139930725,
-0.1848001778125763,
-0.24758212268352509,
-0.35133105516433716,
0.5182757377624512,
0.05791351944208145,
-0.2185712307691574,
-0.8220755457878113,
-0.05225491151213646,
1.038313627243042,
-0.20303818583488464,
0.246645197272300... | |
I noticed that my app sends icons to the Windows tray with a size of 16x16 pixels--and my Vista PC I've got a doublewide taskbar that appears to show icons at 18x18. The resizing artifacts on my app's icon look awful. How can I ask Windows what size the icons should be?
**Edit**
I'm generating the icon dynamically, w... | [
0.37689897418022156,
0.18344460427761078,
0.8159370422363281,
0.16060350835323334,
-0.07837019860744476,
0.3293111026287079,
0.5146902203559875,
-0.09872215986251831,
-0.5018842220306396,
-0.7667617797851562,
0.032297853380441666,
0.5633963942527771,
-0.041337721049785614,
0.09669996798038... | |
value.*
* **GetThemeBackgroundContentRect** didn't help, either.
So, it turned out I had made a pretty bone-head maneuver during the install and didn't install the Web Developer portion, only the C# portion. Once I installed that, all was well. | [
0.46741750836372375,
0.2794859707355499,
0.4483130872249603,
0.21728266775608063,
-0.25759607553482056,
-0.3023560345172882,
0.4975000023841858,
-0.022048277780413628,
0.13100795447826385,
-0.20324918627738953,
0.1897500902414322,
0.8535439372062683,
0.1457909196615219,
0.03218453004956245... | |
I'm trying to learn an SDK that requires a header file be included. There are two statements in the header file that says
```
typedef long long SomeIdentifier_SInt64;
```
and
```
typedef unsigned long SomeIdentifier_UInt64;
```
The compiler (MSVC++ 6) is complaining that this is illegal. If so, does this mean the... | [
0.30896899104118347,
0.2589534819126129,
0.260384738445282,
-0.09728427976369858,
-0.07377298176288605,
-0.40579941868782043,
0.4983120560646057,
-0.07761240005493164,
-0.0696743056178093,
-0.5614666938781738,
-0.017559124156832695,
0.6118568778038025,
-0.23573820292949677,
0.3550484180450... | |
I am trying to run a simple SQL statement with DB2 and am having a few problems.
I would like to have a single script in a txt/db2 file and have the engine process all of the commands
Here is the script:
```
CONNECT TO MYDB
CREATE TABLE PERSONS(
PID SMALLINT NOT NULL,
NAME VARCHAR(20) NOT NULL
)
TERMINATE... | [
-0.180757537484169,
0.12191832065582275,
-0.028127016499638557,
-0.07970180362462997,
-0.06149393320083618,
0.05411466211080551,
0.3728473484516144,
-0.2568989396095276,
-0.14503242075443268,
-0.42895936965942383,
0.1344066858291626,
0.45422688126564026,
-0.2606198489665985,
0.331242144107... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.