text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
"4123", "4132", "4213", "4231","4312", "4321"]
#alphabet hashing where 0 = a
alphabet1 = {'0000':'a', '0001':'b', '0010':'c', '0011':'d',
'0100':'e', '0101':'f', '0110':'g', '0111':'h',
'1000':'i', '1001':'j', '1010':'k', '1011':'l',
'1100':'m', '1101':'n', '1110':'o', '1111':'p'... | [
-0.5742636919021606,
0.0015202192589640617,
0.1499946117401123,
0.030801793560385704,
0.11846273392438889,
0.7636730074882507,
0.4594863951206207,
-0.10555456578731537,
0.06548237055540085,
-0.5874776244163513,
-0.39187273383140564,
0.05287878215312958,
-0.2109626829624176,
0.0917225405573... | |
'1000':'h', '1001':'i', '1010':'j', '1011':'k',
'1100':'l', '1101':'m', '1110':'n', '1111':'o'}
hex = {'0000':'0', '0001':'1', '0010':'2', '0011':'3',
'0100':'4', '0101':'5', '0110':'6', '0111':'7',
'1000':'8', '1001':'9', '1010':'a', '1011':'b',
'1100':'c', '1... | [
-0.062418095767498016,
0.09360316395759583,
0.2296036034822464,
0.14139124751091003,
0.13790728151798248,
0.9836062788963318,
0.160459503531456,
-0.1965385526418686,
0.009754982776939869,
-0.5802337527275085,
-0.2740769684314728,
0.23803171515464783,
-0.07761373370885849,
0.420115947723388... | |
l = len(bin_string)
answer = 0
for index in range(l):
answer += int(bin_string[l - index - 1]) * (2**index)
return answer
#code to try and ping ip addresses
def ping(ipaddress):
#ping the network addresses
import subprocess
# execute the code and pipe the result to a string, w... | [
0.1911393702030182,
-0.3688391447067261,
0.64455646276474,
-0.15877176821231842,
0.2340371459722519,
0.1950421929359436,
0.37731802463531494,
-0.25295138359069824,
-0.09023303538560867,
-0.7076655030250549,
-0.07974328100681305,
0.4945302903652191,
-0.33161160349845886,
-0.3731911480426788... | |
= subprocess.Popen(test, shell=True, stdout=subprocess.PIPE)
# give it time to respond
process.wait()
# read the result to a string
result_str = process.stdout.read()
#For now, need to manually check if the ping worked, fix later
print result_str
#now iterate over the permuation and then ... | [
0.163784459233284,
-0.17578642070293427,
0.4221166968345642,
-0.22253987193107605,
-0.015641964972019196,
0.3471006453037262,
0.35269585251808167,
-0.6832665205001831,
-0.07868348807096481,
-0.5927096605300903,
-0.0557745136320591,
0.3289906978607178,
-0.29267480969429016,
0.02591275610029... | |
for index in permute:
temp_code += box[int(index) - 1]
box_codes.append(temp_code)
#now manipulate the codes using leter translation, network, whatever
#binary
print string.join(box_codes, "")
#alphabet1
print string.join( map(lambda x: alphabet1[x], box_codes), "")
#alph... | [
0.04945511370897293,
-0.0031558361370116472,
0.5901795625686646,
0.039767760783433914,
-0.3242332339286804,
0.5308101177215576,
0.015061326324939728,
-0.5994256138801575,
-0.0005801310180686414,
-0.8216514587402344,
0.02902393974363804,
0.15158338844776154,
-1.0352156162261963,
-0.26658257... | |
see who is reachable
ipcodes = zip(box_codes[0:8:2], box_codes[1:8:2])
ip = ""
for code in ipcodes:
bin = bin_to_dec(code[0] + code[1])
ip += repr(bin) + "."
print ip[:-1]
#ping(ip[:-1])
print
print
```
[t-shirt](http://2.bp.blogspot.com/_iQVgmEEAit4/SPkKHA3e8fI/AAAAAAAAAB8... | [
-0.00460383715108037,
-0.149037167429924,
0.6821819543838501,
0.21013179421424866,
0.41689324378967285,
-0.28706884384155273,
0.2564786970615387,
0.05877210199832916,
-0.38772544264793396,
-0.4837665259838104,
-0.09901408106088638,
0.17590367794036865,
-0.03565909340977669,
-0.018693670630... | |
Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features).
How do you get around this?
One way I found, which was surprised could work: Create a .NET DLL from a Java .jar file! U... | [
0.343645304441452,
-0.12254162132740021,
0.427386075258255,
0.02526228316128254,
-0.1757085770368576,
-0.33176934719085693,
0.04578134045004845,
0.28684163093566895,
0.03349054604768753,
-0.9354817867279053,
-0.07138200849294662,
0.32287752628326416,
0.08096662908792496,
0.1762170344591140... | |
also reference IKVM.OpenJDK.ClassLibrary.dll. Your code might look a bit like this:
```
QueryParser parser = new QueryParser("field1", analyzer);
java.util.Map boosts = new java.util.HashMap();
boosts.put("field1", new java.lang.Float(1.0));
boosts.put("field2", new java.lang.Float(10.0));
MultiFieldQueryParser multi... | [
-0.16061757504940033,
0.009158962406218052,
0.6601971387863159,
-0.09901558607816696,
-0.008195274509489536,
-0.16367226839065552,
0.27151474356651306,
-0.6414846777915955,
-0.3953714966773987,
-0.7469314932823181,
-0.0498579666018486,
0.596362829208374,
-0.3721863627433777,
-0.13056269288... | |
libraries like the Lucene highlighter, make sure you reference the core assembly (else you'll get warnings about missing classes). So the highlighter is built like this:
```
ikvmc -target:library lucene-highlighter-2.4.0.jar -r:lucene-core-2.4.0.dll
``` | [
-0.10693719983100891,
-0.19185590744018555,
0.36333268880844116,
0.10589627176523209,
-0.0430409237742424,
-0.21075642108917236,
-0.2364301085472107,
0.48677143454551697,
-0.2015945464372635,
-0.565744161605835,
-0.20327046513557434,
0.26499977707862854,
-0.3613576889038086,
-0.08797832578... | |
Given the following markup:
```
<ul>
<li>apple</li>
<li class="highlight">orange</li>
<li>pear</li>
</ul>
```
Both the `ul`s and the `li`s widths appear to be 100%. If I apply a `background-color` to the list item, the highlight stretches the full width of the page.
I only want the background highlight to ... | [
-0.07667030394077301,
-0.17999602854251862,
0.7191121578216553,
-0.3309640884399414,
-0.1480058878660202,
0.2330852448940277,
0.17551380395889282,
0.052934207022190094,
-0.35735365748405457,
-0.7715845108032227,
-0.2953171133995056,
0.46668869256973267,
-0.16556964814662933,
-0.22762450575... | |
element goes below the list, as it did before. Clearing should take care of that. | [
0.15581396222114563,
0.000361814716598019,
0.14541436731815338,
-0.06728238612413406,
0.11788856983184814,
-0.14340628683567047,
0.042260266840457916,
-0.31961414217948914,
-0.269241601228714,
-0.4526704251766205,
-0.2055654674768448,
0.5486556887626648,
-0.031101098284125328,
-0.253861278... | |
The code at the end produces a compile error:
```
NotApplicable.java:7: run() in cannot be applied to (int)
run(42);
^
1 error
```
The question is why? Why does javac think I am calling run(), and does not find run(int bar)? It correctly called foo(int bar). Why do I have to use NotA... | [
0.08050762116909027,
0.18626300990581512,
0.1632048487663269,
-0.4367057979106903,
0.3016330301761627,
-0.16685207188129425,
0.6635279655456543,
-0.26559528708457947,
-0.09233522415161133,
-0.34781715273857117,
-0.4078143835067749,
0.5479906797409058,
-0.7393412590026855,
0.155807375907897... | |
Runnable() {
public void run() {
foo(42);
run(42);
// uncomment below to fix
//NotApplicable.this.run(42);
} | [
0.0911070927977562,
-0.05121587589383125,
0.01412227563560009,
-0.25145280361175537,
0.6244539022445679,
-0.014865749515593052,
0.5868390202522278,
0.14932425320148468,
-0.30296656489372253,
-0.2707977592945099,
-0.4287113547325134,
0.5983250141143799,
-0.8906804919242859,
0.29958844184875... | |
};
}
private void run(int bar) {
}
public void foo(int bar) {
}
}
```
The explanation for the behavior of your code sample is that `this` is defined to be the class that you are currently "most" inside of. In this case, you are "most" inside the anonymous inner class that subclasses runnable and ... | [
0.09048660844564438,
-0.11009372770786285,
0.07831818610429764,
-0.221855029463768,
0.19217754900455475,
-0.18806348741054535,
0.2575305700302124,
-0.16846919059753418,
-0.21701142191886902,
-0.3756234347820282,
-0.18346795439720154,
0.404319167137146,
-0.4612847864627838,
0.32736641168594... | |
currently executing instance of `Runnable` with method `run()`
`NotApplicable.this` -> currently executing instance of `NotApplicable` with method `run(int)`
The compiler will look up the nesting tree for the first method that matches the NAME of the method. *–Thanks to DJClayworth for this clarification*
The anonym... | [
-0.09975429624319077,
0.08613050729036331,
0.12486759573221207,
-0.027644691988825798,
0.28427717089653015,
-0.2519448697566986,
0.4444873034954071,
-0.09094849228858948,
-0.33571991324424744,
-0.5346399545669556,
-0.23556125164031982,
0.44114169478416443,
-0.6267168521881104,
0.1988549083... | |
new Runnable() {
public void printit() {
System.out.println( "Anonymous Inner" );
}
public void run() {
printit(); // prints "Anonymous Inner" | [
0.2264517843723297,
-0.45205822587013245,
0.3316805362701416,
-0.3448137044906616,
0.4054920971393585,
0.035672079771757126,
0.4340917766094208,
-0.050578925758600235,
-0.38083764910697937,
-0.6240617036819458,
-0.2436579465866089,
0.7184816598892212,
-0.7947968244552612,
0.322430342435836... | |
this.printit(); //prints "Anonymous Inner"
// would not be possible to execute next line without this behavior
Outer.this.printit(); //prints "Outer"
}
};
}
public void printit() {
System.out.println( "Outer" ); | [
0.014417629688978195,
-0.20956985652446747,
0.3049575686454773,
-0.5924599170684814,
0.2899557650089264,
-0.1420477032661438,
0.47835463285446167,
-0.26498958468437195,
-0.1703166365623474,
-0.4829680919647217,
-0.149936705827713,
0.7708073258399963,
-0.6263678669929504,
0.0090198377147316... | |
}
}
``` | [
0.17493881285190582,
0.41805654764175415,
0.05209751054644585,
-0.04864929988980293,
0.437467485666275,
-0.15825650095939636,
0.13202530145645142,
0.5446501970291138,
0.35430577397346497,
-0.4846813380718231,
-0.2295716553926468,
0.546978771686554,
-0.3188462555408478,
0.2798506021499634,
... | |
This sounds dumb, but I can't get it to work. I think i just dont' understand the difference between `%%v, %v% and %v`
Here's what I'm trying to do:
```
for %%v in (*.flv) do ffmpeg.exe -i "%%v" -y -f mjpeg -ss 0.001 -vframes 1 -an "%%v.jpg"
```
This successfully generates a thumbnail for each of the movies, but th... | [
0.293910413980484,
0.2613920569419861,
0.5572642087936401,
-0.07794118672609329,
0.05213585123419762,
0.121062733232975,
0.3156631588935852,
-0.004394691903144121,
0.03924261033535004,
-0.5495068430900574,
0.16446751356124878,
0.82717365026474,
-0.09673575311899185,
0.120551697909832,
-0... | |
of.
Any ideas?
Use %%~nV to get the filename only. | [
0.30090707540512085,
0.09422384202480316,
0.3173638880252838,
0.04384922236204147,
0.03263324126601219,
-0.16958071291446686,
0.1093922033905983,
0.2934136390686035,
0.08428028225898743,
-0.5727397799491882,
-0.033750176429748535,
0.2657518684864044,
-0.17026664316654205,
0.312681853771209... | |
I was making the following call:
```
result = RegOpenKeyEx(key, s, 0, KEY_READ, &key);
```
(C++, Visual Studio 5, Vista 64bit).
It is failing with error code 2 ("File not found") even though "`regedit`" shows that the key exists. This code has always worked on 32bit XP. Why is it "file not found" when it clearly is... | [
-0.1346408873796463,
0.5306771993637085,
0.34684765338897705,
-0.039933014661073685,
0.20815593004226685,
-0.04623649641871452,
0.4500811994075775,
-0.28237253427505493,
-0.1624056100845337,
-0.49900785088539124,
-0.1867358684539795,
0.7372597455978394,
-0.20429925620555878,
0.110949464142... | |
Is it possible to change the `RowCount` of a `DataGrid` in flash after it has been created on the stage?
I am loading an XML file externally that contains the number of rows the `DataGrid` should have, but the problem is that because this file is not loaded at runtime, it just picks the default 3 items. Maybe I have t... | [
-0.013792922720313072,
0.024469519034028053,
0.33925119042396545,
0.10392964631319046,
-0.18176409602165222,
-0.13368023931980133,
0.14400197565555573,
-0.0511680506169796,
-0.22689585387706757,
-0.828001081943512,
0.011007505469024181,
0.6354822516441345,
-0.2719055414199829,
-0.197327092... | |
need. | [
-0.11111244559288025,
0.3568730056285858,
-0.12111796438694,
0.21866324543952942,
-0.20474907755851746,
0.0006210501305758953,
-0.3928278386592865,
-0.2663509249687195,
0.08287559449672699,
-0.9067088961601257,
0.04478773847222328,
0.5442390441894531,
-0.3654240071773529,
0.601727247238159... | |
Currently I have:
```
<system.net>
<mailSettings>
<smtp from="me@mydomain.com">
<network
host="localhost"
port="25"
/>
</smtp>
</mailSettings>
</system.net>
```
How can I change it so the email is sent with a name and not the email address only?
We... | [
0.24226076900959015,
0.06411246955394745,
0.5326024889945984,
-0.17255747318267822,
0.17033609747886658,
0.05131771042943001,
0.24551787972450256,
0.028580520302057266,
-0.3809889554977417,
-0.7682963609695435,
-0.06322057545185089,
0.07364818453788757,
-0.20069637894630432,
0.543216764926... | |
in quotes, followed by the e-mail address.
```
new SmtpClient(...).Send("\"John Smith\" jsmith@somewhere.com", ...);
```
And...it looks like you can encode it into the attribute too...
```
<smtp from=""John Smith" <jsmith@somewhere.com>">
``` | [
0.15004150569438934,
0.13210950791835785,
0.6227289438247681,
-0.09982704371213913,
0.18639051914215088,
0.010327582247555256,
0.568595826625824,
0.08864318579435349,
-0.24523670971393585,
-0.40266281366348267,
-0.5417482256889343,
0.14160288870334625,
-0.46402883529663086,
0.3063346445560... | |
What is the latest version of the Boost library that is compatible with Microsoft Visual C++ 6? And can you provide a link to download it directly?
The Downloads link at <http://www.boost.org> only gives a download for version 1.36.0, and the documentation for that version lists Visual C++ 7.1 as the lowest version of... | [
0.17865188419818878,
0.10956433415412903,
0.17841047048568726,
0.025161972269415855,
-0.2492590695619583,
0.002577920211479068,
0.3070484399795532,
-0.025281278416514397,
-0.045219939202070236,
-0.12294753640890121,
-0.05099005252122879,
0.854119062423706,
-0.35827401280403137,
-0.24579443... | |
I'm using c#, and have an open tcpip connection receiving data. Is it possible to save the stream to an ms sql server database as I'm receiving it, instead of receiving all the data then saving it all? If the stream could be sent to the database as it's being received, you wouldn't have to keep the entire chunk of data... | [
0.4239071011543274,
-0.030105452984571457,
0.14493897557258606,
0.22930704057216644,
-0.15944910049438477,
0.09419187158346176,
-0.05372646823525429,
0.13807395100593567,
-0.1808621883392334,
-0.5667598843574524,
0.02571447566151619,
0.21534447371959686,
-0.3494464159011841,
0.251879990100... | |
a BLOB column is vastly different then getting the data then translating it into inserts for separate rows.
Regardless, streaming into a BLOB column is possible by first creating the row with the blob column that you need to insert into, the repeatedly calling an update statement:
```
update myTable set myColumn.Writ... | [
0.13838399946689606,
-0.16623355448246002,
0.650864839553833,
-0.170132577419281,
0.011932211928069592,
0.09301887452602386,
-0.15881016850471497,
0.21717742085456848,
-0.3492860496044159,
-0.6472965478897095,
-0.17442159354686737,
0.03210515156388283,
-0.41496357321739197,
-0.010072145611... | |
When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.
Is there a better way of doing an upgrade o... | [
0.3138211965560913,
0.16716550290584564,
0.4255288541316986,
0.22262278199195862,
0.1495475471019745,
-0.1775680035352707,
0.15154168009757996,
0.3748508393764496,
-0.05534627288579941,
-0.866065263748169,
-0.02083790861070156,
0.9805324673652649,
-0.01848447322845459,
0.04481533542275429,... | |
the update at night because i know no one is connected to the database.
you can dump the `mysql.user` and `mysql.db` tables, which contains all the user info, and reimport that as well, to avoid having to recreate all that. i'd also suggest running repairs on the table after you re-import.
alternatively, you could cre... | [
0.7019237279891968,
0.07431112974882126,
0.7402291297912598,
0.30242660641670227,
0.10127536952495575,
-0.171839639544487,
0.06662555038928986,
-0.2975561320781708,
0.039471808820962906,
-0.6977245807647705,
0.023941196501255035,
0.62088942527771,
0.009373852983117104,
0.18675586581230164,... | |
compatibility issues.
[here](http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html) is some information for a 4.1 - 5.x upgrade, for example. | [
0.22423480451107025,
-0.00844997726380825,
0.36285507678985596,
0.12089172750711441,
0.12059573084115982,
-0.18284086883068085,
0.23303131759166718,
-0.22166137397289276,
0.09973408281803131,
-0.37262099981307983,
-0.5405730605125427,
0.8300721049308777,
-0.10553222894668579,
0.04502849653... | |
I need to be able to lock down the valid characters in a textbox, I presently have a regex which I can check each character against such as
> [A-Za-z]
would lock down to just Alpha characters.
```
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Back)
{
base.OnKeyPress(... | [
-0.18753384053707123,
0.08630552887916565,
0.8348723649978638,
-0.3800159692764282,
0.4590133726596832,
0.02203512378036976,
0.6092653870582581,
-0.5228409171104431,
0.06567959487438202,
-0.6319580078125,
-0.5137418508529663,
0.7980045080184937,
-0.3204580545425415,
0.19851411879062653,
... | |
else
{
e.Handled = true;
}
}
}
```
I had placed the regex code in the OnKeyPress code, but I wat to allow all special keys, such as Ctrl-V, Ctrl-C and Backspace to be allowed.
As you can see I have the backspace key being handled. However, Ctrl-V, for example cannot see the V key because it runs once... | [
0.07021570205688477,
-0.06598091125488281,
0.31854957342147827,
-0.007236095145344734,
0.012986693531274796,
-0.2692756950855255,
0.29569146037101746,
-0.1480623334646225,
-0.27591440081596375,
-0.5216161608695984,
-0.13498038053512573,
0.8882936835289001,
-0.3070546090602875,
0.1888454705... | |
and then use the Char.IsLetter method to check that the entered key is a letter. | [
-0.05104178562760353,
0.2709277272224426,
0.2792806923389435,
-0.3555472195148468,
0.1790466159582138,
0.22881269454956055,
0.41042718291282654,
-0.4533921480178833,
-0.14051952958106995,
-0.2818913459777832,
-0.5130690932273865,
0.5406145453453064,
0.1931481957435608,
-0.13406124711036682... | |
I work on a desktop sales app that is run off a tablet and was wondering if this and other "traditional" desktop tablet applications could be viable as a offline web application. The main difference with tablet applications being the inking support. I think a web app can get close with browser gestures.
I don't see the... | [
0.6309813857078552,
0.2500462532043457,
0.2401697039604187,
-0.019415898248553276,
0.046419065445661545,
0.11156661063432693,
-0.14426523447036743,
0.07399041950702667,
0.02358129620552063,
-0.796868622303009,
0.31672221422195435,
0.5145545601844788,
0.18051990866661072,
-0.304301559925079... | |
I am hacking up a tagging application for emacs. I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag. I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.
The font I am using is a variable width font. On top of that, each tag is goi... | [
0.3656628727912903,
0.14036409556865692,
0.5606411099433899,
-0.05005069449543953,
-0.007723082788288593,
0.05405213311314583,
0.2121746838092804,
0.14084556698799133,
-0.05329447612166405,
-0.8196386694908142,
0.08133821934461594,
0.6068792939186096,
-0.12412404268980026,
0.10171537846326... | |
screen width.
I really have no idea where to start. I tried longlines mode on the tagcloud buffer, but that didn't work.
Source code is at: <http://emacswiki.org/cgi-bin/emacs/free-tagging.el>
You probably want to track [`posn-at-point`](http://www.gnu.org/software/emacs/elisp/html_node/Accessing-Events.html#index-po... | [
0.15083838999271393,
-0.267406165599823,
0.5851818323135376,
-0.15990158915519714,
-0.2085649073123932,
-0.002693585120141506,
-0.016924144700169563,
0.06814827769994736,
-0.34891775250434875,
-0.8498218059539795,
0.037951964884996414,
0.523921012878418,
-0.2634662091732025,
-0.03195843100... | |
I have seen many programs consisting of structures like the one below
```
typedef struct
{
int i;
char k;
} elem;
elem user;
```
Why is it needed so often? Any specific reason or applicable area?
As Greg Hewgill said, the typedef means you no longer have to write `struct` all over the place. That not only ... | [
-0.12937870621681213,
0.09760738164186478,
0.2693929970264435,
-0.05726742744445801,
-0.3043648302555084,
-0.16958414018154144,
0.3889591693878174,
-0.2950729429721832,
-0.25871625542640686,
-0.9036372900009155,
-0.27787497639656067,
0.25904381275177,
-0.32947656512260437,
0.36238649487495... | |
when you don't need to see the "struct" keyword all over the place, it looks more as if there really is a type called "Point" in your language. Which, after the `typedef`, is the case I guess.
Also note that while your example (and mine) omitted naming the `struct` itself, actually naming it is also useful for when yo... | [
-0.006976542063057423,
0.08488897234201431,
0.4001769721508026,
-0.2399516999721527,
-0.16933023929595947,
-0.11787112802267075,
0.1107977032661438,
-0.11694855242967606,
0.039084069430828094,
-0.6445779204368591,
-0.3196267783641815,
0.28109657764434814,
-0.32548439502716064,
0.0251186508... | |
int y)
{
Point *p;
if((p = malloc(sizeof *p)) != NULL)
{
p->x = x;
p->y = y;
}
return p;
}
```
In this latter case, you cannot return the Point by value, since its definition is hidden from users of the header file. This is a technique used widely in [GTK+](http://www.gtk.org/), for instance.
**UPD... | [
-0.016424909234046936,
-0.01666327565908432,
0.17732582986354828,
-0.3104071319103241,
-0.36825308203697205,
-0.12192010134458542,
0.03184615820646286,
-0.2653215825557709,
-0.020848257467150688,
-0.33792412281036377,
-0.43800610303878784,
0.25072821974754333,
-0.3933306634426117,
0.180283... | |
CodingStyle document](https://www.kernel.org/doc/html/latest/process/coding-style.html#typedefs) for Linus' angry words. :) My point is that the "should" in the question is perhaps not set in stone, after all. | [
0.7372133135795593,
-0.007062441203743219,
-0.12483946233987808,
0.1418350487947464,
-0.03521681949496269,
-0.05717923119664192,
0.19588710367679596,
-0.23280160129070282,
0.3131110668182373,
-0.3462076485157013,
0.038078006356954575,
0.26432374119758606,
-0.21393440663814545,
-0.030153591... | |
What is the purpose of the `strdup()` function in C?
Exactly what it sounds like, assuming you're used to the abbreviated way in which C and UNIX assigns words, it ***duplicates strings*** :-)
Keeping in mind it's actually not part of the current (C17) ISO C standard itself(a) (it's a POSIX thing), it's effectively do... | [
0.14153461158275604,
0.11234762519598007,
0.37166905403137207,
-0.11335133016109467,
-0.10698295384645462,
-0.0601470023393631,
0.19134566187858582,
-0.11540491133928299,
-0.24421563744544983,
-0.25087106227874756,
-0.299410343170166,
0.44777911901474,
-0.4477333128452301,
0.30139070749282... | |
memory
strcpy(dst, src); // Copy the characters
return dst; // Return the new string
}
```
In other words:
1. It tries to allocate enough memory to hold the old string (plus a '\0' character to mark the end of the string).
2. If the allocation failed, it sets `... | [
-0.22752539813518524,
-0.25794488191604614,
0.34242501854896545,
-0.2772413194179535,
0.05428795516490936,
0.2599357068538666,
0.081438809633255,
-0.34556910395622253,
0.03482479974627495,
-0.294087290763855,
-0.39184629917144775,
0.5979275107383728,
-0.25209325551986694,
0.14505635201931,... | |
`ENOMEM` and returns `NULL` immediately. Setting of `errno` to `ENOMEM` is something `malloc` does in POSIX so we don't need to explicitly do it in our `strdup`. If you're *not* POSIX compliant, ISO C doesn't actually mandate the existence of `ENOMEM` so I haven't included that here(b).
3. Otherwise the allocation work... | [
0.06478143483400345,
-0.006394485477358103,
-0.015753338113427162,
0.12578372657299042,
0.17900016903877258,
-0.09790030866861343,
0.24413782358169556,
-0.09576423466205597,
-0.04938805103302002,
-0.6351068615913391,
-0.20880348980426788,
0.6327196955680847,
-0.4536280632019043,
-0.1883465... | |
other thing to keep in mind, it looks like this *is* currently slated to be in the C2x iteration of the standard, along with `strndup`, as per draft `N2912` of the document.
---
(a) However, functions starting with `str` and a lower case letter are reserved by the standard for future directions. From `C11 7.1.3 Reser... | [
-0.027944182977080345,
0.06394022703170776,
0.7045740485191345,
0.13958095014095306,
0.10674821585416794,
-0.14320652186870575,
0.012654858641326427,
-0.02379698120057583,
-0.29556408524513245,
-0.5740405321121216,
-0.38848382234573364,
0.25642505288124084,
-0.05021103098988533,
0.22645254... | |
`mem`, or `wcs` and a lowercase letter may be added to the declarations in the `<string.h>` header.
So you should probably call it something else if you want to be safe.
---
(b) The change would basically be replacing `if (d == NULL) return NULL;` with:
```
if (d == NULL) {
errno = ENOMEM;
return NULL;
}
`... | [
0.13742941617965698,
-0.24708294868469238,
0.2744610607624054,
-0.04872232675552368,
-0.0490683950483799,
-0.30439719557762146,
0.1347254365682602,
-0.2304246425628662,
-0.1669558584690094,
-0.4935491383075714,
-0.48789772391319275,
0.6119561195373535,
-0.3402027487754822,
0.09933136403560... | |
parallel. Or it may not :-) Optimisation mantra #1: "measure, don't guess".
In any case, should you decide to go that route, you would do something like:
```
char *strdup(const char *src) {
size_t len = strlen(src) + 1; // String plus '\0'
char *dst = malloc(len); // Allocate space
if (ds... | [
-0.024511445313692093,
-0.4098188281059265,
0.338301420211792,
0.2240324467420578,
-0.020960437133908272,
0.10976504534482956,
0.14946965873241425,
-0.17546053230762482,
-0.35318222641944885,
-0.4424271583557129,
-0.10451184958219528,
0.5903502106666565,
-0.4288182556629181,
0.151825457811... | |
// Copy the block
return dst; // Return the new string
}
``` | [
0.1932600885629654,
0.05380071699619293,
0.1278448849916458,
-0.15940916538238525,
0.07849074900150299,
-0.37812522053718567,
0.30650511384010315,
0.026401281356811523,
0.0003463286266196519,
-0.34522998332977295,
-0.4812485873699188,
0.450192928314209,
-0.4758222699165344,
0.4268799126148... | |
Is it possible to have something like a `JTextArea` which will color some keywords based on some mappings I have ?
I am not sure, because I believe `JTextArea` only directly supports a single font in a single color.
According to [`SyntaxHighlighter` class](http://www.cs.bris.ac.uk/Teaching/Resources/COMS30122/tools/hi... | [
0.0951850637793541,
-0.2405509203672409,
0.24098742008209229,
0.0007878151955083013,
-0.23708340525627136,
-0.09788665175437927,
0.12095200270414352,
0.2179984599351883,
-0.09223546832799911,
-0.8553351163864136,
-0.22997207939624786,
0.5068100690841675,
-0.05001519247889519,
-0.0502644181... | |
```
div#thing {
position: absolute;
top: 0px;
z-index: 2;
margin: 0 auto;
}
<div id="thing">
<p>text text text with no fixed size, variable font</p>
</div>
```
The div is at the top, but I can't center it with `<center>` or `margin: 0 auto`;
Your problem may be solved if you give your `div` a fixed width,... | [
-0.504234254360199,
0.0692858174443245,
0.6907540559768677,
-0.02487812004983425,
0.06758534908294678,
0.027920925989747047,
0.0686841681599617,
-0.3402608335018158,
-0.08593019843101501,
-0.29978713393211365,
-0.49420249462127686,
0.6908106803894043,
-0.07659494131803513,
0.16886287927627... | |
There are a couple of questions similar to this on stack overflow but not quite the same.
I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and p... | [
0.4023790955543518,
0.12793418765068054,
0.223436176776886,
0.11458870768547058,
-0.12139395624399185,
-0.19857539236545563,
0.046767428517341614,
0.06988977640867233,
-0.25299349427223206,
-0.4673393964767456,
0.1258915215730667,
0.5067631602287292,
0.08289129287004471,
0.0600736998021602... | |
this? Or provide a better solution than using DirectoryEntry?
Okay, it's taken a while, messing around with different solutions but the one that fits best with my original question is given below. I can't get the DirectoryEntry object to access the members of a local group using the 'standard' methods, the only way I c... | [
-0.040064264088869095,
-0.08311197906732559,
0.4879612326622009,
-0.15421433746814728,
0.1979111135005951,
-0.19451190531253815,
0.29610100388526917,
-0.32195132970809937,
-0.13334599137306213,
-0.6404693722724915,
0.11386682838201523,
0.5480337142944336,
-0.33049651980400085,
0.4207381904... | |
DirectoryEntry(member))
{
Console.WriteLine(memberEntry.Path);
}
}
}
```
I also used a similar technique to add and remove members from the local group.
Hopefully this helps someone else as well.
Keith.
**EDIT** by Tim: added VB.Net version
```
Public Function MembersOfGroup(ByVal G... | [
-0.14058944582939148,
-0.2967582046985626,
0.8762974143028259,
-0.26164835691452026,
0.14079420268535614,
-0.19151173532009125,
0.3783200979232788,
-0.23390229046344757,
-0.34831035137176514,
-0.4619554877281189,
-0.1409362256526947,
0.6201798319816589,
-0.3023967146873474,
0.2309026420116... | |
For Each member As Object In DirectCast(search.Invoke("Members"), IEnumerable)
Dim memberEntry As New DirectoryEntry(member)
members.Add(memberEntry)
Next
End Using
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Return members
End Funct... | [
-0.049690861254930496,
-0.1736203134059906,
0.6400774717330933,
-0.22166115045547485,
0.1314825862646103,
-0.2529290020465851,
0.46663016080856323,
-0.15764553844928741,
-0.23107954859733582,
-0.30899110436439514,
-0.448565274477005,
0.2027706354856491,
-0.45763328671455383,
0.651584267616... | |
I am developing an application that needs to use regini (because of legacy reasons) to insert something into the registry. I have been trying to do this in such a way the the user of the application is not aware of this. I have written the following code:
```
System.Diagnostics.ProcessStartInfo pi = new ProcessStartIn... | [
0.207933709025383,
0.2239362746477127,
0.734599232673645,
-0.2796342968940735,
0.4287640452384949,
0.21456952393054962,
0.30966973304748535,
-0.4262614846229553,
-0.2776617407798767,
-0.7063493728637695,
-0.14447836577892303,
0.46696242690086365,
-0.432752788066864,
0.3589872121810913,
-... | |
that
```
pi.WindowStyle = ProcessWindowStyle.Hidden;
```
would prevent that. How can I prevent regini from opening its own command window?
Try to add this line:
```
pi.CreateNoWindow = true;
``` | [
0.25340035557746887,
-0.09075970202684402,
0.43744149804115295,
-0.10708120465278625,
0.2827831208705902,
0.12605319917201996,
0.4020850360393524,
-0.15570665895938873,
0.010966097936034203,
-0.4565325975418091,
0.06423085182905197,
0.5106344819068909,
-0.33933043479919434,
0.4536807537078... | |
Anyone got an idea how to get from an Xserver the list of all open windows?
From the CLI you can use
```
xwininfo -tree -root
```
If you need to do this within your own code then you need to use the `XQueryTree` function from the `Xlib` library. | [
0.5571073889732361,
0.23513075709342957,
0.14962546527385712,
0.22483566403388977,
-0.18421998620033264,
-0.36711597442626953,
-0.016521362587809563,
0.5495372414588928,
-0.20294348895549774,
-0.5734016299247742,
0.09365551173686981,
0.6999322772026062,
-0.2835317850112915,
0.1251345872879... | |
I feel that using GetEnumerator() and casting IEnumerator.Current is expensive. Any better suggestions?
I'm open to using a different data structure if it offers similiar capabilities with better performance.
**After thought:**
Would a generic stack be a better idea so that the cast isn't necessary?
Have you don... | [
0.6136602759361267,
-0.1669960469007492,
-0.033590808510780334,
0.1956745982170105,
-0.052527401596307755,
-0.0781107172369957,
0.2628246247768402,
-0.35059618949890137,
-0.27872663736343384,
-0.643873393535614,
0.2691943347454071,
0.45341649651527405,
-0.17318902909755707,
0.1036863252520... | |
a faster looping construct. (I would recommend generics even though it wouldn't matter that much. Again, do benchmarks).
EDIT:
Examples of looping that might not be necessary are when you try to do lookups in a list or match two lists or similar. If the looping takes a long time, see if it make sense to put the lists... | [
0.3483135402202606,
-0.3377377986907959,
-0.18575207889080048,
0.48552563786506653,
-0.14992128312587738,
-0.034304000437259674,
0.36906111240386963,
-0.1525382697582245,
-0.38208892941474915,
-0.8360682725906372,
-0.008030889555811882,
0.4759669005870819,
-0.43001285195350647,
-0.26386803... | |
We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ?
We are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different compilers and stdlibs. The code should com... | [
0.4324356019496918,
0.4660765826702118,
0.28123095631599426,
0.13675878942012787,
0.042731013149023056,
-0.2924710512161255,
0.1390494555234909,
-0.0725412368774414,
-0.19130036234855652,
-0.3673965334892273,
-0.05975114554166794,
0.5739471316337585,
-0.327629029750824,
0.10051172971725464... | |
use.
```
#if (__cplusplus > 199711L) || defined(__GNUG__)
typedef unsigned long long uint_64_t;
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 uint_64_t;
#else
#error "Please define uint_64_t"
#endif
uint_64_t foo;
std::fstream fstm( "file.txt" );
fstm >> foo;
``` | [
-0.1286606639623642,
0.029402965679764748,
0.6276729106903076,
-0.16364344954490662,
0.23515978455543518,
-0.23504242300987244,
0.1811147779226303,
-0.12768317759037018,
-0.3650011122226715,
-0.5047062039375305,
-0.3078418970108032,
0.7067455649375916,
-0.5925896167755127,
0.04538216441869... | |
Please forgive my long question. I have an idea for a design that I could use some comments on. Is it a good idea to do this? And what are the pit falls I should be aware of? Are there other similar implementations that are better?
**My situation is as follows:**
I am working on a rewrite of a windows forms applica... | [
0.35076671838760376,
0.3087962865829468,
0.2365082949399948,
-0.06537286192178726,
0.059144526720047,
-0.10206259042024612,
0.4471668601036072,
-0.18720479309558868,
-0.3135881721973419,
-0.45229652523994446,
0.12052031606435776,
0.19433525204658508,
0.3203285336494446,
0.13731133937835693... | |
we have no external customers or users, they are all internal to the company, and they are all be trusted not to do anything malicious to the software or database.
The current design doesn't have too many tables (about 10 - 20) but some of them have millions of records that belong to several hundred constructions. The... | [
0.5132659077644348,
0.35624706745147705,
0.376041054725647,
0.16400636732578278,
0.5881452560424805,
0.15028895437717438,
0.028461622074246407,
0.041833970695734024,
-0.24157121777534485,
-0.6689010262489319,
0.176767036318779,
0.3728641867637634,
-0.09935042262077332,
0.24851877987384796,... | |
one construction. Each child database should be of identical design. This should eliminate the performance problems we are seeing today since the data stored in each database would be less than one percent of the total data amount.
My concern is that instead of maintaining one database we will now get hundreds of dat... | [
0.5628330111503601,
0.22322866320610046,
0.14030086994171143,
0.36377692222595215,
0.5954101085662842,
0.41641634702682495,
-0.06931865960359573,
-0.012870118953287601,
-0.4987804889678955,
-0.7778379917144775,
0.2727868854999542,
0.27095040678977966,
-0.2700112462043762,
0.552987635135650... | |
we keep track of all database changes done to the system so they can be applied to the child databases. Updating the client application won't be a problem, we have good control of that aspect.
I am thinking of a change tracing system where we store database scripts for all changes in a table in the master database. We... | [
0.56499183177948,
-0.1348402500152588,
0.5173571109771729,
0.1597212553024292,
0.37122565507888794,
0.28080636262893677,
0.08865933865308762,
-0.1698080599308014,
-0.3198409080505371,
-0.7521114945411682,
0.2338239699602127,
0.494803786277771,
-0.07360103726387024,
0.18305931985378265,
-... | |
version number of the master database and if there are patches with version numbers greater than the version number of the child database we run these and update the child database to the latest version.
As I see it this should work well. Any changes to the system will first be tested and validated before committed a... | [
0.6561933755874634,
0.044640857726335526,
0.6835432648658752,
-0.022159133106470108,
0.17890816926956177,
-0.0009576119482517242,
0.2132677435874939,
-0.21214500069618225,
-0.3673943281173706,
-0.6363887786865234,
-0.07083316892385483,
0.6815640330314636,
-0.08136316388845444,
0.3048557341... | |
too frequent this should not be a problem.
So what do you think? Will this work? Have any of you done something similar? Should we scrap the solution and go for the monolithic system instead?
I have a similar situation here, though I use MySQL. Every database has a versions table that contains the version (simply an i... | [
0.4483400285243988,
0.13597941398620605,
0.3130268454551697,
0.04329195246100426,
0.02426266483962536,
-0.07838912308216095,
0.093727245926857,
0.14108417928218842,
-0.44938772916793823,
-0.6889216303825378,
0.24972175061702728,
0.5563015937805176,
-0.28084802627563477,
0.2759648561477661,... | |
name. The script looks up the highest version number in a database and applies only the functions that have a higher version number in order.
This makes it easy to update databases (just add new change functions) and allows me to quickly upgrade a recovered database if necessary (just run the script again).
Even when... | [
0.03575459495186806,
-0.025936150923371315,
0.39372411370277405,
-0.05824385583400726,
0.02079131454229355,
-0.24988426268100739,
0.3971990644931793,
-0.2228192239999771,
-0.18096114695072174,
-0.8263627886772156,
-0.057533007115125656,
0.5911449790000916,
-0.1831587702035904,
0.0192828010... | |
complicated changes in the process.
"""
def change105(...):
"Drop old table"
def change106(...):
"Rename new table to old table"
```
if in change104() is something going wrong (and throws an exception) you can simply delete the already converted data from the new table, fix your change function and run th... | [
-0.031790610402822495,
0.08538608253002167,
0.4879566729068756,
-0.10195428878068924,
0.29236623644828796,
-0.0860723927617073,
0.2775315046310425,
-0.20506785809993744,
-0.5611540675163269,
-0.9240437746047974,
-0.15863047540187836,
0.7070427536964417,
-0.5602531433105469,
0.2306116372346... | |
somehow to keep them in sync. Maybe you could distribute a new software version and then you want to upgrade the database when a client is actually starting to use this new software. But I haven't tried that. | [
0.805427610874176,
-0.005160857457667589,
0.2500419020652771,
0.2832135260105133,
0.13411180675029755,
-0.12135889381170273,
0.11478680372238159,
0.3278568387031555,
-0.10771120339632034,
-0.5194656848907471,
0.6625210642814636,
0.44878658652305603,
-0.1443190574645996,
0.20170535147190094... | |
I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies?
The isolated storage gives an advantage over cookies i... | [
0.6582576632499695,
0.37819069623947144,
-0.18704652786254883,
0.29070115089416504,
-0.005698907654732466,
-0.2902924418449402,
0.07287201285362244,
-0.05686645954847336,
-0.20257265865802765,
-0.4944760203361511,
0.3730349540710449,
0.08576437085866928,
-0.012633609585464,
0.1402273029088... | |
situation here, though I use MySQL. Every database has a versions table that contains the version (simply an integer) and a short comment of what has changed in this version. I use a script to update the databases. Every database change can be in one function or sometimes one change is made by multiple functions. Funct... | [
0.17509721219539642,
0.10130169242620468,
0.5854200720787048,
-0.0029110871255397797,
0.0980861634016037,
0.053813423961400986,
0.01995050348341465,
0.12321016192436218,
-0.4331146478652954,
-0.7742702960968018,
0.15543445944786072,
0.4801723062992096,
-0.11583563685417175,
0.1277103424072... | |
allows me to quickly upgrade a recovered database if necessary (just run the script again).
Even when testing the changes before this allows for defensive changes. If you make some heavy changes on a table and you want to play it safe:
```
def change103(...):
"Create new table."
def change104(...):
"""Transfe... | [
-0.07368050515651703,
0.03684692829847336,
0.4656525254249573,
0.04172365739941597,
0.21667012572288513,
-0.18672017753124237,
0.4341888427734375,
-0.3261951804161072,
-0.27461084723472595,
-0.9132598638534546,
0.035043325275182724,
0.7628182172775269,
-0.26120421290397644,
-0.139755040407... | |
(and throws an exception) you can simply delete the already converted data from the new table, fix your change function and run the script again.
But I don't think that changing a database dynamically when a client connects is a good idea. Sometimes changes can take some time. And the software that accesses a database... | [
0.37120431661605835,
-0.029690705239772797,
0.3951975107192993,
0.27283498644828796,
0.18191100656986237,
-0.04100630804896355,
0.15168440341949463,
0.05142706632614136,
-0.46623820066452026,
-0.8517317771911621,
0.2539832592010498,
0.7112320065498352,
-0.33100131154060364,
0.2548122107982... | |
that. | [
0.14583395421504974,
0.26844504475593567,
0.19980299472808838,
0.2355840653181076,
0.06883420795202255,
-0.21310508251190186,
-0.006811793427914381,
-0.016548411920666695,
0.022815069183707237,
-0.5300772190093994,
-0.025831039994955063,
0.1715977042913437,
-0.14602704346179962,
0.16757817... | |
I have WPF ListBox which is bound to a ObservableCollection,
when the collection changes, all items update their position.
The new position is stored in the collection but the UI does not update.
So I added the following:
```
void scenarioItems_CollectionChanged(object sender, System.Collections.Specialized.Notif... | [
-0.09390311688184738,
-0.5000882148742676,
0.5367820858955383,
-0.13890902698040009,
0.2944786548614502,
0.17912407219409943,
0.03522232174873352,
-0.4730819761753082,
-0.1328534185886383,
-0.7925848364830017,
-0.16271324455738068,
0.450377881526947,
-0.3983128070831299,
0.0662616342306137... | |
UI is updated,
but this is probably very bad coding :p
Suggestions?
I have a Listbox bound to an object property which is of type `List<MyCustomType>()` and I verified that the following code updates the listbox when the List is updated.
```
void On_MyObjProperty_PropertyChanged(object sender, System.ComponentModel.... | [
0.026070570573210716,
-0.11697041243314743,
1.0511980056762695,
0.010836311616003513,
-0.037246618419885635,
-0.09657572954893112,
0.36680397391319275,
-0.2969275712966919,
-0.2315099537372589,
-1.2023754119873047,
-0.18450646102428436,
0.7478923797607422,
-0.019733306020498276,
0.16529187... | |
I've been teaching myself Objective-C over the past month or so (I'm a Java head) and I've got my brain wrapped around most of it now. One thing that's confusing me at the moment: What's the difference between importing a class via @class vs doing a #import?
Is one better than another one, or do I need to use one ins... | [
0.3077596426010132,
0.0028486959636211395,
-0.07430019974708557,
-0.1832917332649231,
-0.3407769203186035,
-0.11883478611707687,
0.21007581055164337,
0.10897698253393173,
-0.16317003965377808,
-0.4331743121147156,
-0.11208169907331467,
0.5814636945724487,
-0.13603533804416656,
-0.155871421... | |
used on a line by itself with some class names), just tells the compiler "Hey, you're going to see a new token soon; it's a class, so treat it that way).
This is very useful when you've got the potential for 'circular includes'; ie, Object1.h makes reference to Object2, and Object2.h makes reference to Object1. If you... | [
0.12462139129638672,
-0.15037089586257935,
0.25366026163101196,
-0.09448035806417465,
-0.24499653279781342,
0.045530617237091064,
0.15594206750392914,
-0.05178491398692131,
-0.5282399654388428,
-0.4925379455089569,
-0.056075479835271835,
0.03342648968100548,
-0.4178175628185272,
0.12179338... | |
`@class Object2;`, then there's no circular reference. Just be sure to actually `#import` the required headers into your implementation (.m) files. | [
0.5711497664451599,
-0.08664324134588242,
0.2526640295982361,
0.17068921029567719,
-0.000522156129591167,
-0.4902041554450989,
0.2403285950422287,
0.22759568691253662,
-0.22453010082244873,
-0.560047447681427,
-0.20826180279254913,
0.6473678946495056,
-0.16957533359527588,
-0.0511329621076... | |
Today I happens to find that one C# class can inherit one interface both in implicit and explicit way. This surprises me. If C# works in this way, then one instance can behave differently when referenced in different way.
```
interface IFoo
{
void DoSomething();
}
class Foo : IFoo
{
#region IFoo Members
p... | [
-0.07826530933380127,
-0.4145989418029785,
0.7119293808937073,
-0.03306533768773079,
0.21770207583904266,
-0.3839830756187439,
0.25691676139831543,
-0.18674778938293457,
-0.06533531099557877,
-0.983652651309967,
-0.05893354490399361,
0.4388699531555176,
-0.1558283418416977,
0.4037412405014... | |
Console.WriteLine("do something explicitly");
}
#endregion
}
Foo f = new Foo();
f.DoSomething();
((IFoo)f).DoSomething();
```
Above code runs and output
```
do something implicitly
do something explicitly
```
I believe that this design of C# make inconsistency of behavior. Perhaps... | [
0.18806226551532745,
-0.1086832731962204,
0.3314977288246155,
-0.10968824476003647,
0.15012869238853455,
-0.37540626525878906,
0.24772129952907562,
-0.26508471369743347,
0.15957924723625183,
-0.5217739343643188,
0.05846555903553963,
0.8331500887870789,
-0.3646031320095062,
-0.0041930684819... | |
both implicitly and explicitly. You only implement IFoo.DoSometing() explicitly. You have a new method on your class called DoSomething(). It has nothing to do with IFoo.DoSomething, except that it has the same name and parameters. | [
0.15569829940795898,
-0.3161258399486542,
0.09720666706562042,
0.017497453838586807,
-0.16041746735572815,
-0.21638739109039307,
0.3213716745376587,
-0.17640940845012665,
-0.08813662827014923,
-0.6461448669433594,
0.19521990418434143,
0.4785747528076172,
-0.4593627154827118,
0.191930130124... | |
Any ideas on how to disable, but not uninstall Resharper 4.x or above?
You can disable ReSharper 4 and lower using the Visual Studio Add-In Manager (remove the check from check box on the left).
In ReSharper 5 and above (tested up to version 7.0.1), [this is how you can suspend](https://stackoverflow.com/questions/253... | [
0.2897251844406128,
-0.1715301275253296,
0.2968362867832184,
-0.05653196945786476,
0.19133421778678894,
-0.2532119154930115,
0.4933502972126007,
-0.0453130342066288,
-0.5204927325248718,
-0.2093338966369629,
-0.7016044855117798,
0.8711299896240234,
-0.38687536120414734,
0.00664542615413665... | |
Are there any libraries out there (preferably a self contained Text Edit Control) for .NET that have Spell Check capabilities. I would like to add the typical red underline to miss-spelled words in the edit area of my application.
Edit: To clarify, this is for WinForms
Not a redlining control, but: [Aspell.Net](http:/... | [
0.2587127685546875,
0.017917269840836525,
0.24484996497631073,
-0.08183654397726059,
-0.43061232566833496,
-0.014371923170983791,
0.4227338433265686,
-0.1988876461982727,
-0.045766040682792664,
-0.6261764764785767,
-0.06562712043523788,
0.5211828947067261,
-0.29712480306625366,
-0.39553275... | |
checked February 2010 (Tahnks, @magnifico).
May 2012, source no longer accessible... sorry. | [
0.2644997239112854,
0.1449139565229416,
0.08108016848564148,
0.11170393228530884,
0.134302020072937,
-0.13492244482040405,
0.7831714153289795,
0.43263471126556396,
-0.3023204505443573,
-0.11076696217060089,
0.011575490236282349,
0.1766342967748642,
0.1141296848654747,
0.21781164407730103,
... | |
Is there a csh script/command to list all the files in source source tree which have line endings that show up as "^M" in emacs (under linux).
Thanks!
Based on my answer to [another question](https://stackoverflow.com/questions/204765/elegant-way-to-search-for-utf-8-files-with-bom#211855):
```
fgrep -rl `echo -ne '\r... | [
-0.43382710218429565,
0.06277414411306381,
0.32935628294944763,
-0.06623679399490356,
0.17109361290931702,
0.0052702296525239944,
0.28045856952667236,
0.04474646598100662,
-0.4836713969707489,
-0.44725480675697327,
-0.4271446764469147,
0.4300004839897156,
-0.3075880706310272,
-0.3161546885... | |
I want to examine the contents of a `std::vector` in GDB, how do I do it? Let's say it's a `std::vector<int>` for the sake of simplicity.
To view vector std::vector myVector contents, just type in GDB:
```
(gdb) print myVector
```
This will produce an output similar to:
```
$1 = std::vector of length 3, capacity 4 ... | [
0.19923412799835205,
0.046020783483982086,
0.7601432204246521,
-0.10963398218154907,
-0.2666080594062805,
-0.07770486176013947,
-0.04840243235230446,
-0.09430038183927536,
-0.19834427535533905,
-0.9049663543701172,
0.20132797956466675,
0.8830965161323547,
-0.2214815765619278,
-0.0787227153... | |
as I think). | [
-0.04305799677968025,
0.16624639928340912,
0.36558589339256287,
-0.19046001136302948,
0.13888661563396454,
0.31374451518058777,
0.23540948331356049,
-0.06414930522441864,
-0.15145285427570343,
-0.18108141422271729,
-0.25924643874168396,
0.42459404468536377,
-0.0028414714615792036,
0.359875... | |
I've decided to integrate NUnit with VWD2008.
I did the following-
1) Installed NUnit - Ran a Sample project that was included with the installation all the tests were fine.
2) Installed TestDriven.Net 2.0 - Personal distribution.
3) I have written on an MVC Project a test and when I try to right click the context and... | [
0.35545697808265686,
0.012300267815589905,
0.14083462953567505,
0.05438714474439621,
-0.7303300499916077,
-0.22491759061813354,
0.6617749333381653,
-0.2953985631465912,
0.28914570808410645,
-0.44603967666625977,
0.2861073911190033,
0.872567355632782,
-0.365281343460083,
-0.0297976806759834... | |
didn't like that and put their lawyers on it.
<http://weblogs.asp.net/nunitaddin/archive/2007/07/06/microsoft-amp-testdriven-net.aspx>
You could try sharpdevelop if you want a free ide with unit-testing support. | [
0.21326923370361328,
-0.25756627321243286,
-0.19339030981063843,
0.31983813643455505,
-0.3822227418422699,
-0.16389307379722595,
0.23669587075710297,
-0.022854706272482872,
0.2248784750699997,
-0.1063491478562355,
0.5908806324005127,
0.7275413274765015,
0.19438742101192474,
0.0150582827627... | |
Does anyone know how I can add a class to the link rendered using the Html.RouteLink helper method in ASP.Net MVC, it has the htmlAttributes object as the last parameter which I assumed I would be able to use, but since class is obviously a reserved word, I cannot supply this as one of the properties on the object.
Try... | [
-0.01621374301612377,
-0.07269411534070969,
0.5360403060913086,
-0.12183347344398499,
-0.0010174517519772053,
-0.1832979917526245,
0.15618965029716492,
0.33360356092453003,
-0.19729840755462646,
-0.9220477342605591,
0.00958238448947668,
0.4374590814113617,
-0.17429398000240326,
0.129892751... | |
I'd like to post some form variables into a classic ASP page. I don't want to have to alter the classic ASP pages, because of the amount of work that would need to be done, and the amount of pages that consume them.
The classic ASP page expects form variables Username and Userpassword to be submitted to them.
```
use... | [
0.39511266350746155,
-0.10138026624917984,
0.44273102283477783,
-0.12405495345592499,
-0.14446578919887543,
-0.16451971232891083,
0.28482651710510254,
-0.37565356492996216,
0.0863000750541687,
-0.7045409679412842,
-0.1649811863899231,
0.4224027693271637,
-0.3465902507305145,
-0.14506196975... | |
element's names to be "username" and "UserPassword".
Any ideas?
You can't really "forward" a POST on, like you're wanting to do (in your OP). The client has to initiate the POST to your ASP page(s) (which the code in your second post is doing).
---
Here's the self-POSTing code from your own reply so you can mark an ... | [
-0.05758757144212723,
-0.2983761429786682,
0.3880380690097809,
0.04112517833709717,
0.022971535101532936,
-0.07366562634706497,
0.1751006692647934,
-0.2389993816614151,
-0.188582643866539,
-0.5052963495254517,
-0.09233583509922028,
0.37994450330734253,
-0.3612862825393677,
0.25319153070449... | |
"post" ;
public string FormName = "form1" ;
public void Add( string name, string value ){
Inputs.Add(name, value ) ;
}
public void Post(){
System.Web.HttpContext.Current.Response.Clear() ;
System.Web.HttpContext.Current.Response.Write( "<html><head>" ) ;
Sys... | [
0.04614253714680672,
-0.3317893445491791,
0.6968488693237305,
-0.21484968066215515,
-0.10681980103254318,
0.355004221200943,
0.18239492177963257,
-0.29674845933914185,
-0.08629036694765091,
-0.5126435160636902,
-0.566438615322113,
0.16475263237953186,
-0.5199568271636963,
0.224043920636177... | |
name=\"{0}\" method=\"{1}\" action=\"{2}\" >" ,
FormName,Method,Url)) ;
for ( int i = 0 ; i< Inputs.Keys.Count ; i++){
System.Web.HttpContext.Current.Response.Write( string .Format( "<input name=\"{0}\" type=\"hidden\" value=\"{1}\">" ,Inputs.Keys[i],Inputs[Inputs.Keys[i]])) ;
... | [
-0.3349049985408783,
-0.37068474292755127,
0.9396156668663025,
-0.36176618933677673,
0.12591947615146637,
0.1931317001581192,
0.34038329124450684,
-0.660226047039032,
-0.0552259124815464,
-0.6225736737251282,
-0.5322906970977783,
0.3512161672115326,
-0.2982746362686157,
0.18820342421531677... | |
}
}
``` | [
0.17493881285190582,
0.41805654764175415,
0.05209751054644585,
-0.04864929988980293,
0.437467485666275,
-0.15825650095939636,
0.13202530145645142,
0.5446501970291138,
0.35430577397346497,
-0.4846813380718231,
-0.2295716553926468,
0.546978771686554,
-0.3188462555408478,
0.2798506021499634,
... | |
Is there a way to resize a `std::vector` to lower capacity when I no longer need previously reserved space?
Effective STL, by Scott Meyers, Item 17: Use the `swap` trick to trim excess capacity.
```
vector<Person>(persons).swap(persons);
```
After that, `persons` is "shrunk to fit".
This relies on the fact that `ve... | [
0.020162032917141914,
-0.1502431333065033,
-0.07948440313339233,
0.2643371820449829,
0.3039891719818115,
0.3868880271911621,
0.011866373009979725,
-0.28638848662376404,
-0.27774813771247864,
-0.5522308349609375,
-0.23253582417964935,
0.5782516598701477,
-0.41790005564689636,
-0.38956183195... | |
I'm addicted to Vim, it's now my de facto way of editing text files.
Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps?
Some questions I have:
* How do I invoke a maven task without leaving vi?
* Can I get code completion?
* How's the syntax... | [
0.522575855255127,
-0.16156911849975586,
0.4692007899284363,
0.02264779433608055,
-0.3029360771179199,
-0.32513049244880676,
0.4258347153663635,
-0.18358372151851654,
-0.4448298215866089,
-0.6548202037811279,
0.04838099330663681,
0.8158692121505737,
-0.028174186125397682,
-0.22460523247718... | |
vi functionality within Eclipse with [viPlugin](http://viplugin.com/)
* Syntax highlighting is great with vim
* Vim has good support for writing little macros like running ant/[maven](http://vim.wikia.com/wiki/Use_maven_with_quickfix) builds
Have fun :-) | [
0.4471084475517273,
-0.29982712864875793,
0.5929467678070068,
0.04435177892446518,
-0.4026387631893158,
-0.1331542283296585,
0.4419591426849365,
-0.1323736160993576,
-0.22320353984832764,
-0.6463873386383057,
0.23919309675693512,
0.7121933102607727,
-0.23606036603450775,
-0.134154483675956... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.