text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
libero ut purus semper ullamcorper.
Pellentesque mattis tincidunt odio. Nullam pulvinar
orci at dolor. Sed volutpat eros ac elit.
Praesent porttitor libero sed felis. Vivamus lobortis
pellentesque diam.
Proin laoreet massa ac metus. Integer faucibus lorem
molestie nibh. Integer id massa. I... | [
-0.2648944854736328,
-0.20659039914608002,
0.48791956901550293,
-0.0002499888651072979,
-0.23396383225917816,
0.9987213015556335,
0.03665937855839729,
-0.34860098361968994,
-0.010444436222314835,
-0.32828229665756226,
-0.07192635536193848,
0.33238551020622253,
-0.292498379945755,
-0.360242... | |
and `clear` on them. In IE7, using `clear` on an element with `float` only clears the float below other floats *floated in the same direction*.
A modified version of the [easyclearing](http://www.positioniseverything.net/easyclearing.html) fix may do the trick, but don't get your hopes up. See this page for details: [... | [
0.013084352016448975,
-0.13730527460575104,
0.6835469007492065,
-0.2091158628463745,
-0.005357872694730759,
-0.304995596408844,
0.2697898745536804,
0.07716937363147736,
-0.19227296113967896,
-0.4250379502773285,
-0.2527240216732025,
0.7136498093605042,
-0.130679652094841,
-0.20863278210163... | |
I'm looking to do a partial SSL site in rails. I basically want to protect the user actions behind SSL, but nothing else.
Anyone know of a plugin or gem that makes this simple and efficient?
This is typically done with the [SSL Requirement](http://github.com/rails/ssl_requirement/tree/master) plugin. It sets up `befor... | [
0.7515433430671692,
-0.14198753237724304,
0.0027477340772747993,
-0.07596205174922943,
-0.2237130105495453,
-0.3333395719528198,
0.2432459592819214,
-0.2838786840438843,
-0.21204908192157745,
-0.7984134554862976,
-0.09484146535396576,
0.5254858732223511,
-0.38266074657440186,
-0.1332205533... | |
On Linux, `ulimit -n` can be used to change or view the limit on the number of file descriptors for a process, and `lsof -p nnn | wc -l` seems to consistently report the actual file descriptor usage.
But on Mac OS X, `lsof -p nnn | wc -l` can return a number higher than the limit. I suppose this means `lsof` is retur... | [
-0.030217943713068962,
0.07206609100103378,
0.5808631777763367,
-0.15304666757583618,
-0.12681454420089722,
-0.07664094120264053,
-0.16084185242652893,
0.1036282628774643,
-0.4981592893600464,
-0.716819167137146,
-0.12096791714429855,
0.8126024007797241,
-0.3022976517677307,
0.141562253236... | |
descriptors, but most of what is likely inflating your count is the loaded frameworks and libraries for an application. You can look at the "FD" column to see if a line is a file descriptor--in which case it's a number, possibly followed by a letter indicating the mode--or something else (see the description of the FD ... | [
0.619267463684082,
-0.05877736583352089,
0.6728951930999756,
0.28795868158340454,
-0.23935160040855408,
-0.08276505023241043,
0.1914149522781372,
-0.1763686090707779,
-0.4696175158023834,
-0.740350604057312,
-0.026766875758767128,
0.4687369167804718,
-0.36135759949684143,
0.237944662570953... | |
need to put together a regex to feed the output through that filers precisely by the FD column. | [
0.10211694240570068,
-0.01616380363702774,
0.6151767373085022,
0.2533661723136902,
0.2470768839120865,
0.07951176166534424,
-0.38375037908554077,
-0.059118278324604034,
0.025526637211441994,
-0.5569348335266113,
-0.13583026826381683,
0.7132603526115417,
-0.08691107481718063,
0.067472681403... | |
I have some legacy C code that I recently compiled on Linux. On the original HPUX the application opens and closes multiple curses windows. On the Linux box it can handle one window, but if I close that window, it crashes the program with an error message of "Aborted". Any ideas?
Discovered that it was the touchwin com... | [
0.3543088734149933,
0.4033856987953186,
0.22572562098503113,
0.19885607063770294,
-0.1609470695257187,
-0.10818574577569962,
0.7245903611183167,
0.29938098788261414,
0.0395931601524353,
-0.8485835194587708,
0.08365853130817413,
0.6946901679039001,
-0.04873540624976158,
0.10048560798168182,... | |
I have a very simple page built to display a map and overlay a line based on
points in a GeoRSS XML file. Here is the publicly accessible file.
<http://68.178.230.189/georssimport.html>
Firefox is loading in about 5 secs, which is expected because there are a lot of
points to map, but IE (6 & 7) is taking upwards of 4... | [
0.23206064105033875,
0.15945686399936676,
0.6038401126861572,
-0.07046377658843994,
0.015933813527226448,
-0.2830807566642761,
0.5308416485786438,
-0.015057566575706005,
-0.11222481727600098,
-0.8200824856758118,
0.0008082248969003558,
0.4582347273826599,
-0.20952832698822021,
0.0376449897... | |
of code seems to have no negative consequences. :-) Thanks all for the help. Up-votes all around. | [
0.6472578644752502,
0.013128869235515594,
0.309582382440567,
0.6523741483688354,
-0.46487507224082947,
-0.2184918224811554,
0.6215976476669312,
-0.0007631602347828448,
-0.09744793176651001,
-0.552133321762085,
-0.2244022637605667,
0.27751970291137695,
0.1571403592824936,
-0.244579076766967... | |
I am new to Haskell and facing a "cannot construct infinite type" error that I cannot make sense of.
In fact, beyond that, I have not been able to find a good explanation of what this error even means, so if you could go beyond my basic question and explain the "infinite type" error, I'd really appreciate it.
Here's... | [
0.001863535726442933,
0.1881774663925171,
0.5007892847061157,
-0.2669998109340668,
-0.037302713841199875,
0.3639323115348816,
0.4309851825237274,
-0.021860133856534958,
-0.10731561481952667,
-0.3560497760772705,
-0.03842632845044136,
0.2606251835823059,
-0.7674296498298645,
-0.075343176722... | |
x:s:y:intersperse s xs
```
And here's the error trying to load it into the interpreter:
```
Prelude> :load ./chapter.3.ending.real.world.haskell.exercises.hs
[1 of 1] Compiling Main (chapter.3.ending.real.world.haskell.exercises.hs, interpreted )
chapter.3.ending.real.world.haskell.exercises.hs:147:0:
Occurs check... | [
-0.2171962708234787,
-0.01707642897963524,
0.4757344126701355,
-0.13522545993328094,
-0.14898519217967987,
0.29821789264678955,
0.5612621903419495,
-0.3104586899280548,
-0.26607927680015564,
-0.558356761932373,
-0.02359861508011818,
0.38239771127700806,
-0.7871518731117249,
-0.174550652503... | |
"s (x:y:xs)", x and y became **lists**. And yet I was treating x and y as elements, not lists.
**Guideline for dealing with the "infinite type" error:**
*Most of the time, when you get this error, you have forgotten the types of the various variables you're dealing with, and you have attempted to use a variable as i... | [
0.1601712852716446,
0.08116379380226135,
0.09255315363407135,
-0.1027134507894516,
-0.34962669014930725,
-0.04853779450058937,
0.47766029834747314,
-0.12704718112945557,
-0.48203909397125244,
-0.586229681968689,
-0.13815878331661224,
0.3033112585544586,
-0.3793613016605377,
0.1237742081284... | |
they are lists. This will work:
```
intersperse _ [] = []
intersperse _ [x] = x
intersperse s (x:y:xs) = x ++ [s] ++ y ++ intersperse s xs
```
The infinite type error occurs because the : operator has type a -> [a] -> [a], while you treat it as [a] -> a -> [a], which means that [a] must be identified with a, which ... | [
-0.0756048858165741,
0.09175805002450943,
0.37761569023132324,
-0.1240917220711708,
-0.061477068811655045,
0.17240336537361145,
0.31798574328422546,
-0.4200253486633301,
-0.637567400932312,
-0.5551520586013794,
-0.07728519290685654,
0.09718484431505203,
-0.9039017558097839,
0.0360892675817... | |
x
intersperse s (x:xs) = x ++ [s] ++ intersperse s xs
``` | [
-0.13008259236812592,
0.06945761293172836,
0.7161255478858948,
-0.2324935793876648,
-0.28996917605400085,
0.09621637314558029,
0.08609955757856369,
-0.26174068450927734,
-0.03310128301382065,
-0.505511462688446,
-0.36424756050109863,
0.1102641299366951,
-0.7007393836975098,
0.1018943190574... | |
Firebug is reporting a "return not in function" error with no location (well, line 1 of nothing). How can I track down the source of this error?
```
return not in function
[Break on this error] return(0)
javascript:return... (line 1)
```
I'm running FireBug 1.05 on FF 2.0.0.20 on Ubuntu.
I found a **solution** that... | [
0.053316738456487656,
0.2026071399450302,
0.6037642955780029,
-0.3690558671951294,
0.1982508897781372,
0.029136449098587036,
0.6318248510360718,
-0.6429898142814636,
0.09848705679178238,
-0.59446120262146,
-0.38941487669944763,
0.5295491218566895,
-0.6155530214309692,
-0.023353492841124535... | |
return function() { fn(val); return false; };
}
```
The code was in a loop in which the id was changing, necessitating the capture function.
Formerly the href was 'javascript: return 0' and the capture function wasn't returning false directly, instead using the result of the fn, and there was a path when it was ret... | [
-0.13656453788280487,
0.00040702050318941474,
0.41235753893852234,
-0.2699875235557556,
-0.14096355438232422,
-0.09613508731126785,
0.4430626928806305,
-0.13998502492904663,
0.02128322422504425,
-0.4281527101993561,
-0.18186716735363007,
0.6163902282714844,
-0.5745329260826111,
0.255419224... | |
telling. I believe you're trying to return a value in the `href` attribute of an anchor, as below:
```
<a href="javascript: return false">Test</a>
```
The reason Firebug isn't telling you the location is because it's not in any JavaScript, but is rather in a one-liner in the DOM. | [
0.535843551158905,
0.23856070637702942,
0.46053770184516907,
-0.019714033231139183,
0.21352741122245789,
-0.45062631368637085,
0.27020150423049927,
-0.11966942995786667,
0.23981225490570068,
-0.06447099149227142,
-0.0042887660674750805,
0.7002061009407043,
-0.1408286839723587,
0.2168929874... | |
I am using the google ajax rest api and I'd like to get local results by prefix. For example: I type in "sta" and I get "starbucks".
I wonder if there is a documented or undocumented wildcard operator that that allows you to find results that *start* with a string.
I know that Google does have a wildcard operator b... | [
0.4653454124927521,
0.30671417713165283,
0.13267004489898682,
0.06858782470226288,
-0.10679878294467926,
-0.11107797920703888,
0.0013769768411293626,
0.3631429970264435,
-0.05392852798104286,
-0.6008732318878174,
0.15499858558177948,
0.018985144793987274,
-0.17453448474407196,
0.0248201247... | |
the local search. Given that there seems to be no official Google Suggest API, you aren't likely to find one for the local search. However, there are plenty of products (including Firefox and the Google Toolbar) that make use of Google Suggest, so the methods they use probably aren't going away. A quick search for a Su... | [
0.4846769869327545,
0.15755203366279602,
0.2616903781890869,
0.360095739364624,
-0.14472046494483948,
-0.04087380692362785,
-0.03980805352330208,
-0.0870838612318039,
0.16547541320323944,
-0.7129014134407043,
0.39681118726730347,
0.3022316098213196,
-0.29711347818374634,
0.2111956477165222... | |
I'm having a truly... *bizzare* error in none other than Internet Explorer with a windowing system I'm developing. Basically, the windows are absolutely positioned divs containing ah iFrame that shows their page and resizes along with them. In all other browsers this works fine as intended, but in IE the iFrame doesn't... | [
0.46880659461021423,
0.297484815120697,
0.2564522922039032,
-0.1213982105255127,
-0.05959106609225273,
-0.13274621963500977,
0.3775653839111328,
0.34648197889328003,
-0.07517354935407639,
-0.8816730976104736,
0.05155940726399422,
0.1989012360572815,
-0.3426768481731415,
0.4703317880630493,... | |
var cancelSpawn = false;
if ( $('.windowType_'+type).length )
{
//Update the SRC attribute for the iframe contained within the window. This should effectively
//reload the window too.
$('.windowType_'+type).children("iframe").attr("src", "/darknova4/"+url);
} else {
//First, cre... | [
0.2501163184642792,
-0.39251279830932617,
0.4446193277835846,
-0.12496823072433472,
0.17407217621803284,
0.15597838163375854,
0.1751881092786789,
-0.33780527114868164,
-0.0005648320657201111,
-0.2470647394657135,
-0.247319296002388,
0.8097727298736572,
-0.3526862561702728,
-0.0249735694378... | |
<div class='windowContent newspawn'><iframe src='/darknova4/"+url+"' frameborder='0' width='100%' height='100%' scrolling='auto'></iframe></div> \
</div>");
//Move this window to the top of the stack
$(".newspawn").parent(".window").css("z-index", windowZIndex++);
//Set the data for this window's type... | [
0.20686544477939606,
-0.07453636080026627,
0.9399736523628235,
-0.1756926327943802,
0.1606467068195343,
-0.06254209578037262,
0.2544070780277252,
-0.24439337849617004,
-0.07519127428531647,
-0.6735366582870483,
-0.4531579315662384,
0.4008677303791046,
-0.2840614914894104,
0.264175891876220... | |
}
}
```
On Internet Explorer, this produces a blank white window, which indicates an invisible iFrame since all of my windowed pages have a black background. I suspected the famous (and still not quite fixed) z-index bug, so I made the following change to play with the stacking order and see if I could find a quick-f... | [
-0.1020078957080841,
0.1395605206489563,
0.6218786239624023,
-0.19182127714157104,
0.07369178533554077,
-0.04364578425884247,
0.3815220892429352,
-0.021881312131881714,
-0.08200940489768982,
-0.8663775324821472,
-0.19742771983146667,
0.5060369968414307,
-0.40091779828071594,
0.254466533660... | |
shows up, the iFrame shows up, and all looks good, until you try to use it. I can't explain why, but **Mousing Over the iFrame** causes it to *disappear*. I have no code on the site tied to the mouse move event, and no code on the iFrame's pages that would cause it to do anything on mouseover. It's really weird. Does a... | [
0.40797823667526245,
0.03053906001150608,
0.12153636664152145,
-0.02805006317794323,
0.15222208201885223,
-0.4509204030036926,
0.3133338391780853,
0.5081586837768555,
-0.3255085051059723,
-0.5519261360168457,
0.045511696487665176,
0.1865285336971283,
-0.3538118302822113,
0.2170657366514206... | |
as mentioned is really bizzare in IE. I can post more code if you think it will help, but this is where I think the error is. Namely, I'd be happy to post the CSS on the parent window and the JavaScript for my mouse events, etc.
Thanks to anyone who can provide some insight on this strange behavior.
Try removing `posi... | [
0.1873742789030075,
0.03351319953799248,
0.5998991131782532,
-0.2603185772895813,
-0.11286229640245438,
0.0859232023358345,
0.3530437648296356,
0.09708692133426666,
-0.25444117188453674,
-0.6747155785560608,
0.0053531695157289505,
0.32127583026885986,
-0.42592477798461914,
0.00677302759140... | |
fixes the height problem caused by the above `position: relative` change in IE7 and IE8.
With both fixes in place, the iframe appears to be working correctly in IE7, IE8, and IE8 emulating IE7 on my machine. | [
-0.11334255337715149,
0.07270277291536331,
0.7311486005783081,
-0.27899396419525146,
0.2681359648704529,
0.4314641058444977,
0.3154488205909729,
-0.13055042922496796,
-0.15992335975170135,
-0.6821210384368896,
0.08377763628959656,
0.5772157907485962,
0.030712813138961792,
-0.44038802385330... | |
Anyone have tried to run Visual Studio 2008 over linux wit wine? Any troubles? It works?
WineHQ has some [test results](http://appdb.winehq.org/objectManager.php?sClass=version&iId=11022&iTestingId=21512) on this subject, which seems to give a firm *no*. However, as you can see they are somewhat outdated. You could alw... | [
0.1703527867794037,
0.29849210381507874,
0.0317876860499382,
-0.1906479001045227,
-0.23380614817142487,
-0.1546972543001175,
0.4337969720363617,
0.1965777426958084,
-0.24668557941913605,
-0.33326655626296997,
0.21494215726852417,
0.83409583568573,
-0.10210664570331573,
-0.08265890926122665... | |
I want to use jQuery to dynamically expand my markup so that my divs show up as nice rounded boxes.
For example if my DOM has a series of div objects with unique ids like:
```
<div id="queuediv0" class="isequeue" > </div>
```
Which can be selected using:
```
$(“.isequeue”)
```
I want to replace/wrap those divs ... | [
-0.15379607677459717,
-0.22531764209270477,
0.6164879202842712,
-0.1464553028345108,
-0.19106526672840118,
0.25941523909568787,
-0.09513271600008011,
-0.21193115413188934,
-0.19751779735088348,
-0.7925441861152649,
-0.05294360592961311,
0.3389105498790741,
-0.009519168175756931,
0.31931728... | |
<div class="isequeue_wrapper_dk" style="margin: 0 1px;"> </div>
</div>
<p class="isequeue_header">
Header text
</p>
<div class="isequeue_wrapper_ic">
<div class="isequeue_wrapper_lt" style="margin: 0 5px;"> </div>
<div class="isequeue_wrapper_lt" style="margin: 0 3px;"> </div>
... | [
-0.35636213421821594,
-0.4003869295120239,
0.45063352584838867,
-0.20474569499492645,
-0.26254889369010925,
0.24106785655021667,
-0.05928315594792366,
-0.2875060737133026,
-0.25676506757736206,
-0.655322253704071,
-0.010430244728922844,
0.2589561939239502,
0.046739812940359116,
0.173269838... | |
class="isequeue" >
</div>
<div class="isequeue_wrapper_oc">
<div class="isequeue_wrapper_dk" style="margin: 0 1px;"> </div>
<div class="isequeue_wrapper_dk" style="margin: 0 2px;"> </div>
<div class="isequeue_wrapper_dk" style="margin: 0 3px;"> </div>
<div class="isequeue_wr... | [
-0.1879565417766571,
-0.059306658804416656,
0.34429261088371277,
0.05136583000421524,
0.04055981710553169,
0.13813252747058868,
-0.20335322618484497,
-0.23309104144573212,
-0.029048817232251167,
-0.8674761056900024,
-0.06104639917612076,
0.2309250831604004,
0.04063034802675247,
0.156887128... | |
clean way to accomplish this, but it has eluded me for now. jQuery.wrap() will place the selected objects into the innermost part of the supplied source, but how do you accomplish this when you want the selected item to be a sibling of the newly added source.
Thanks,
Jim
Something like this could work:
```
$(function... | [
0.30774086713790894,
-0.23082858324050903,
0.2955242991447449,
0.11203357577323914,
0.09841977804899216,
-0.3058285713195801,
0.40056461095809937,
-0.17477719485759735,
-0.16145390272140503,
-0.8667140603065491,
-0.05792564898729324,
0.5439029335975647,
-0.2763105034828186,
0.1311413496732... | |
could also have them as a string and inserted the same way. | [
0.49261704087257385,
-0.22740662097930908,
0.09086018800735474,
0.3917366564273834,
-0.07248380035161972,
0.3286478519439697,
-0.02620713785290718,
-0.24637843668460846,
-0.2200816571712494,
-0.26062873005867004,
0.0896390974521637,
0.32322800159454346,
-0.009416117332875729,
0.15211637318... | |
I'm writing MIPS program that will examine a list of 10 numbers to be input from the terminal. And these numbers will output on the terminal in an ascending order. And below are my MIPS program...please can someone help me look into it, because i m running and isn't working proply....
```
.data
array: .space 4... | [
-0.10949680954217911,
-0.04673027992248535,
0.7457367181777954,
0.19293126463890076,
0.44347620010375977,
0.4553351104259491,
0.3440568149089813,
0.12366136908531189,
-0.19224174320697784,
-0.6800817847251892,
-0.4612427055835724,
0.4544636309146881,
-0.5244132876396179,
-0.093397185206413... | |
syscall
li $v0,5
syscall
sw $v0,0($a1)
addi $a1,$a1,4
bnez $t1,loop
li $t1,9
li $t2,9
la $a1,array
loop1:
beqz $t2,here
addi $t2,$t2,-1
lw $t5,0($a1)
lw $t6,4($a1)
add $a1,$a1,4
ble $t5,$t6,loop1
sw $t5,0($a1)
sw $t6,-4($a1)
bnez $t2,loop1
here:
la $a1,array
addi $t1,$t1,-1
add $t2,$t2,$t1
bnez $... | [
-0.23237019777297974,
-0.035731252282857895,
0.2019205391407013,
-0.6402450203895569,
0.04304137080907822,
0.6452540159225464,
0.34388723969459534,
-0.33202773332595825,
-0.12435217201709747,
-0.24205294251441956,
-0.3746583163738251,
0.19890518486499786,
-0.43831124901771545,
-0.262497961... | |
comment a lot since it doesn't read anywhere close to a natural language.
```
.data
array: .space 40
prompt: .asciiz "Enter a number: "
spacee: .asciiz " "
output: .asciiz "The numbers are: "
.text
main:
li $t1,10 #load 10 into $t1
la $a1,array #load a pointer to array into $a1
loop:
addi $t1,$t1... | [
0.07936761528253555,
-0.04682043194770813,
0.4450690448284149,
-0.10397011041641235,
0.13493609428405762,
0.4842287302017212,
0.11897419393062592,
0.11731832474470139,
0.006654523313045502,
-0.5027220249176025,
-0.38865402340888977,
0.536984920501709,
-0.7029241323471069,
-0.06576587259769... | |
#display prompt
li $v0,5 #load 5 into $v0 (read integer)
syscall #prompt for input
sw $v0,0($a1) #store input int to array
addi $a1,$a1,4 #add 4 to $a1, save to $a1
bnez $t1,loop #if $t1 isn't zero,goto loop
li $t1,9 #if $t1 is zero, load 9 into $t1
li $t2,9 | [
-0.08965916186571121,
-0.16339051723480225,
0.3592984974384308,
-0.5224969983100891,
0.04351038485765457,
0.5573605895042419,
0.41488468647003174,
-0.03128110244870186,
-0.0667247399687767,
-0.40911945700645447,
-0.3795067071914673,
0.5023249983787537,
-0.5199249982833862,
-0.1833037137985... | |
#and load 9 into $t2
la $a1,array #load array pointer into $a1
loop1:
beqz $t2,here #if $t2 is zero, goto here
addi $t2,$t2,-1 #subtract 1 from $t2, save to $t2
lw $t5,0($a1) #load an input int into $t5
lw $t6,4($a1) #load the next one into $t6
addi $a1,$a1,4 #add 4 to $a1, save to $a1
ble... | [
-0.15282396972179413,
-0.1275864988565445,
0.33957377076148987,
-0.49849364161491394,
0.1379026174545288,
0.661585807800293,
0.26692286133766174,
-0.2425951361656189,
-0.1565675288438797,
-0.23661792278289795,
-0.28757742047309875,
0.3879799544811249,
-0.5133553743362427,
-0.25264790654182... | |
in $a1
sw $t6,-4($a1) #and store $t6 in $a1-4 (swapping them)
bnez $t2,loop1 #if $t2 is not zero, to go loop1
here:
la $a1,array #load array into $a1
addi $t1,$t1,-1 #subtract 1 from $t1, save to $t1
add $t2,$t2,$t1 #add $t2 to $t1, save to $t2
bnez $t1,loop1 #if $t1 isn't zero, goto loop1
li... | [
0.11049143970012665,
-0.17072659730911255,
0.24204882979393005,
-0.510644793510437,
0.006772943772375584,
0.44067397713661194,
0.321942001581192,
-0.4063113033771515,
-0.10830715298652649,
-0.10546094924211502,
-0.3393787145614624,
0.2987448573112488,
-0.7105308771133423,
-0.21765451133251... | |
$a0
syscall #display message to screen
la $a1,array #load array pointer into $a1
li $t1,10 #load 10 into $t1
loop2:
li $v0,1 #load 1 into $v0 (print int)
lw $a0,0($a1) #load $a1 into $a0
syscall #print first number to screen
li $v0,4 #load 4 into $v1 | [
-0.07949359714984894,
-0.06279455870389938,
0.48553359508514404,
-0.6154021620750427,
0.017673898488283157,
0.6472308039665222,
0.26587650179862976,
-0.3016197979450226,
-0.2395486682653427,
-0.2846892476081848,
-0.4076686501502991,
0.36433932185173035,
-0.7722795605659485,
-0.174742802977... | |
(print string)
la $a0,spacee #load ' ' into $a0
syscall #print ' ' to screen
addi $a1,$a1,4 #add 4 to $a1, save to $a1
addi $t1,$t1,-1 #subtract 1 from $t1, save to $t1
bnez $t1,loop2 #if $t1 isn't zero, goto loop2
li $v0,10 #exit
syscall
```
I don't have a MIPS processor, ... | [
0.14050213992595673,
0.008336038328707218,
0.44508588314056396,
-0.38438501954078674,
0.24772198498249054,
0.38198691606521606,
0.5056405663490295,
-0.13320115208625793,
-0.0611465685069561,
-0.5111523866653442,
-0.21764998137950897,
0.3034127354621887,
-0.43207743763923645,
0.034725815057... | |
t6;
int arr[10] = {10,9,8,7,6,5,4,3,2,1};
t1 = 9;
t2 = 9;
a1 = arr;
loop1:
if(t2 == 0)
goto here;
t2 = t2 - 1;
t5 = *a1;
t6 = *(a1 + 1);
a1 = a1 + 1;
if(t5 <= t6)
goto loop1;
*a1 = t5;
*(a1-1) = t6;
if(t2 != 0)
goto loop1;
here:
a1 = arr;
t1 = t1 - 1;
t2 = t2 + t1;
if(t1 != 0)
goto loop1;
printf("... | [
-0.042795706540346146,
-0.10453464835882187,
0.1294514536857605,
-0.4532209634780884,
0.07004615664482117,
0.5426011681556702,
0.6370086669921875,
-0.6838068962097168,
-0.3785140812397003,
0.06469124555587769,
-0.5402956604957581,
0.3982301354408264,
-0.4214968681335449,
0.1346320509910583... | |
so, object initializers are all kinds of handy - especially if you're doing linq, where they're downright necessary - but I can't quite figure out this one:
```
public class Class1 {
public Class2 instance;
}
public class Class2 {
public Class1 parent;
}
```
using like this:
```
Class1 class1 = new Class1();... | [
-0.4721728265285492,
-0.1908431351184845,
0.08300115168094635,
0.041402418166399,
-0.10534403473138809,
-0.02300378866493702,
0.10829060524702072,
-0.1846577674150467,
-0.11818522959947586,
-0.5255802869796753,
-0.29359760880470276,
0.514397382736206,
-0.3200676739215851,
0.033739890903234... | |
are doing something like
```
select new Class1() { ...
```
it doesn't even have a name to refer to it by!
how do I get around this? can I simply not make nested references using object initializers?
> can I simply not make nested references using object initializers?
You are right - you cannot. There would be a cy... | [
0.35270804166793823,
0.1774451732635498,
0.00895540788769722,
-0.16811954975128174,
0.04733407124876976,
-0.15075349807739258,
0.24696138501167297,
-0.17018388211727142,
-0.2892371714115143,
-0.5400007963180542,
-0.1656634509563446,
0.41795727610588074,
-0.5927647948265076,
0.2177305221557... | |
public B Child
{
get { return this.child; }
set
{
if (this.child != value)
{
this.child = value;
this.child.Parent = this;
}
}
}
private B | [
0.05313917621970177,
0.021152978762984276,
-0.1128668412566185,
-0.15607033669948578,
0.33047914505004883,
0.2980118989944458,
0.060067128390073776,
-0.2464955747127533,
0.1974012404680252,
-0.417583167552948,
-0.34519562125205994,
0.374540776014328,
-0.40069863200187683,
0.127511501312255... | |
child = null;
}
public class B
{
public A Parent
{
get { return this.parent; }
set
{
if (this.parent != value)
{
this.parent = value;
this.parent.Child = this;
}
} | [
0.09988421946763992,
-0.14022734761238098,
-0.16774970293045044,
-0.17573967576026917,
0.17445869743824005,
0.2327716201543808,
0.3910004496574402,
-0.09505770355463028,
0.13032715022563934,
-0.4036499261856079,
-0.49861687421798706,
0.17822909355163574,
-0.39802274107933044,
0.32139164209... | |
}
private A parent = null;
}
```
Building the relation inside the property has the benifit that you cannot get an inconsitent state if you forget one of the initialization statements. It is quite obvious that this is an suboptimal solution because you need two statements to get one thing done.
```
b.Parent = a;
a... | [
-0.23295047879219055,
0.2522587180137634,
-0.07967247813940048,
0.027677517384290695,
-0.1088336780667305,
0.13207761943340302,
0.46777260303497314,
-0.20390751957893372,
-0.1948554813861847,
-0.3768620193004608,
-0.40977048873901367,
0.4043526351451874,
-0.34246423840522766,
0.50078499317... | |
I was recently asked by a friend of mine who's just starting to play around with threading what the difference between using a secondary object purely for the purpose of locking or just locking the object you're referencing is. I had to admit that I had no idea, can anyone tell me? I will try and demonstrate with a cou... | [
0.370855450630188,
-0.0142968213185668,
0.46392208337783813,
-0.0637335255742073,
0.3203570246696472,
-0.05200329050421715,
0.2833050787448883,
-0.09293610602617264,
-0.22594937682151794,
-0.12778913974761963,
-0.06060940772294998,
0.5338018536567688,
-0.43597322702407837,
0.60749030113220... | |
//Do something with the data and then remove it
}
}
}
```
Second method:
```
List<string> data = new List<string>();
void main()
{
lock(data)
{
if (data.contains("SomeSearchString"))
{
//Do something with the data and then remove it
}
}
}
```
Is there a ... | [
-0.1527661383152008,
-0.28766554594039917,
0.31796255707740784,
-0.15014991164207458,
0.24683889746665955,
-0.20676085352897644,
0.1942153126001358,
-0.2686685621738434,
-0.16739851236343384,
-0.347067266702652,
-0.29564380645751953,
0.5255909562110901,
-0.5334363579750061,
0.2222383618354... | |
down to personal coding style? If there is a significant difference, can anyone explain what it is?
I did come across another question [[Difference between lock(locker) and lock(variable\_which\_I\_am\_using)](https://stackoverflow.com/questions/230716/difference-between-locklocker-and-lockvariablewhichiamusing)] in w... | [
0.3245946764945984,
-0.11185363680124283,
-0.11044815927743912,
0.11930650472640991,
-0.061501387506723404,
0.06825222820043564,
0.16294728219509125,
-0.15905225276947021,
-0.21846041083335876,
-0.4097559154033661,
0.11645165085792542,
0.47114020586013794,
-0.0932958722114563,
-0.147082373... | |
about** there is no risk of unexpected consequences (deadlocks, pulse/wait gotchas, etc) from *other* code (not yours) locking against the primary object (which is commonly available to other code).
IMO, perhaps the CLR team would have done better with an explicit `Lock` type - or maybe `Monitor` should have been non-... | [
0.4494566321372986,
0.06199915334582329,
0.11505994200706482,
0.1389445662498474,
0.0470610186457634,
-0.463594913482666,
0.41771966218948364,
0.3132592737674713,
-0.39524713158607483,
-0.38096001744270325,
-0.2786504328250885,
0.5884429216384888,
-0.17178566753864288,
0.07294635474681854,... | |
For example I've often wanted to search stackoverflow with
```
SELECT whatever FROM questions WHERE
views * N + votes * M > answers AND NOT(answered) ORDER BY views;
```
or something like that.
*Is there any reasonable way to allow users to use SQL as a search/filter language?*
I see a few problems with it:
* ... | [
0.284576952457428,
0.263339638710022,
-0.07956725358963013,
0.12327888607978821,
-0.17785079777240753,
-0.2589665353298187,
0.2604556083679199,
-0.10836202651262283,
-0.4015512466430664,
-0.5600665211677551,
0.08757394552230835,
0.7503524422645569,
-0.42326223850250244,
0.15032976865768433... | |
what not as well.
**Accessing/changing stuff**
No problem, just run the query with a crippled user, with permissions only to select
**SQL injection**
Just sanitize the query
**DOS attacks**
Time-out the query and throttle the access by IP. I guess you can also throttle the CPU usage in some servers | [
0.3086859881877899,
0.1684321165084839,
0.45765364170074463,
0.3716937005519867,
-0.13225841522216797,
-0.23495449125766754,
0.32093843817710876,
0.17063526809215546,
-0.46962451934814453,
-0.6520513296127319,
0.015470173209905624,
0.702660322189331,
-0.13830430805683136,
0.227275282144546... | |
Let's say I have a set of vectors (readings from sensor 1, readings from sensor 2, readings from sensor 3 -- indexed first by timestamp and then by sensor id) that I'd like to correlate to a separate set of vectors (temperature, humidity, etc -- also all indexed first by timestamp and secondly by type).
What is the cl... | [
0.701763391494751,
-0.07639665901660919,
0.5220754742622375,
0.2770601809024811,
-0.10943106561899185,
0.1687593013048172,
-0.16319409012794495,
-0.45552000403404236,
0.01127056684345007,
-0.6133519411087036,
0.26070722937583923,
0.19077087938785553,
-0.0588686428964138,
0.2828330099582672... | |
like to see:
```
$ In [27]: x
$ Out[27]:
array([[ 0, 0, 0],
[-1, 0, -1],
[-2, 0, -2],
[-3, 0, -3],
[-4, 0.1, -4]])
$ In [28]: y
$ Out[28]:
array([[0, 0],
[1, 0],
[2, 0],
[3, 0],
[4, 0.1]])
$ In [28]: magical_correlation_function(x, y)
$ Out[28]:
array... | [
0.007298815064132214,
0.4056242108345032,
0.32125553488731384,
-0.354629248380661,
-0.10334288328886032,
0.21432006359100342,
0.2612145245075226,
-0.3901062607765198,
-0.2141817808151245,
-0.07929373532533646,
-0.07807011902332306,
0.0977141261100769,
-0.5531947612762451,
0.149054318666458... | |
, 0.70710678, 1. ]
[-0.70710678, 1. , 0.70710678]])
```
Ps2: whoops, mis-transcribed my example. Sorry all. Fixed now.
The simplest thing that I could find was using the scipy.stats package
```
In [8]: x
Out[8]:
array([[ 0. , 0. , 0. ],
[-1. , 0. , -1. ],
[-2. , 0. , -2. ]... | [
0.1069917380809784,
-0.20826390385627747,
0.35959985852241516,
0.27725571393966675,
0.14126712083816528,
0.058306511491537094,
0.2141909897327423,
0.45490139722824097,
-0.375199556350708,
-0.741219162940979,
-0.07228275388479233,
0.30512115359306335,
-0.3713564872741699,
-0.106272548437118... | |
, 0. , -3. ],
[-4. , 0.1, -4. ]])
In [9]: y
Out[9]:
array([[0. , 0. ],
[1. , 0. ],
[2. , 0. ],
[3. , 0. ],
[4. , 0.1]])
In [10]: import scipy.stats
In [27]: (scipy.stats.cov(y,x)
/(numpy.sqrt(scipy.stats.var(y,axis=0)[:,numpy.newaxis]))
/(numpy.sqrt(scipy.stat... | [
0.005330040585249662,
-0.4432971477508545,
0.5781941413879395,
0.24586240947246552,
0.01340850442647934,
0.5487817525863647,
-0.2559542953968048,
0.026194380596280098,
-0.4090860188007355,
-0.49252626299858093,
-0.37830162048339844,
0.43382206559181213,
-0.2998996376991272,
0.1767994165420... | |
],
[-0.70710678, 1. , -0.70710678]])
```
These aren't the numbers you got, but you've mixed up your rows. (Element [0,0] should be 1.)
A more complicated, but purely numpy solution is
```
In [40]: numpy.corrcoef(x.T,y.T)[numpy.arange(x.shape[1])[numpy.newaxis,:]
,nump... | [
-0.2450174242258072,
0.28660714626312256,
0.37712806463241577,
-0.29169031977653503,
-0.14883986115455627,
0.6847718954086304,
-0.10939120501279831,
-0.4399709701538086,
-0.23895235359668732,
-0.34107109904289246,
-0.3226253390312195,
0.36547741293907166,
-0.4305739402770996,
-0.0361168496... | |
],
[-0.70710678, 1. , -0.70710678]])
```
This will be slower because it computes the correlation of each element in x with each other element in x, which you don't want. Also, the advanced indexing techniques used to get the subset of the array you desire can make your head hurt.
If you're going to us... | [
0.5497079491615295,
-0.31814756989479065,
0.2535546123981476,
0.17317254841327667,
-0.348951518535614,
-0.5111536979675293,
-0.08573881536722183,
-0.13471238315105438,
-0.40706667304039,
-0.4491507112979889,
0.007632272318005562,
0.7126970291137695,
-0.4888448417186737,
0.17121687531471252... | |
This is one of my first issues. Whenever I exit out the program, tcpClient.Connect() takes forever to close. I've tried a ton of things, and none of them seem to work.
Take a look at the CreateConnection() thread, if the client isn't connected yet... and I close the program, it takes forever to close. If it IS connect... | [
0.24231913685798645,
0.18430201709270477,
0.35308969020843506,
0.08383330702781677,
0.14628438651561737,
-0.3530545234680176,
0.48874369263648987,
0.3924139440059662,
-0.2981908917427063,
-0.732765257358551,
0.019798636436462402,
0.4250930845737457,
-0.14332163333892822,
0.6022697687149048... | |
the actual bytes with a buffer instead of this version that just does masterServer.writeLine() and masterServer.readline() or are they both just as efficient?
If you see anything else to help me improve this... by all means, go ahead. I'm trying to teach myself how to do this and I have no help, so don't let me go on ... | [
0.30529889464378357,
-0.21576601266860962,
0.5044260025024414,
0.15235459804534912,
-0.05846579372882843,
0.06043875962495804,
0.2883267104625702,
-0.33033308386802673,
-0.19121132791042328,
-0.642386794090271,
-0.2868649363517761,
0.5213890671730042,
-0.35605186223983765,
0.25015410780906... | |
int MyPort = 56789;
private IPAddress myIp = IPAddress.Parse("210.232.115.79");
private IPAddress serverIp = IPAddress.Parse("72.216.18.77"); // Master Server's IP Address
public static TcpClient masterServer = new TcpClient();
private StreamWriter responseWriter;
private Stream... | [
-0.17514371871948242,
-0.12657442688941956,
1.128545880317688,
-0.11552591621875763,
0.03986293449997902,
0.5482856631278992,
0.49115830659866333,
-0.04711465537548065,
-0.326334685087204,
-0.6828621625900269,
-0.3033164441585541,
0.4409547448158264,
-0.558588445186615,
0.27664637565612793... | |
}
private delegate void AddMessageDelegate(string message, int category);
private delegate void ConnectedDelegate();
private bool isConnected { get; set; }
public Form1()
{
InitializeComponent();
isConnected = false;
}
private void | [
0.4326346814632416,
-0.2694178521633148,
-0.057720281183719635,
0.15132489800453186,
0.19367188215255737,
-0.25725436210632324,
0.4456521272659302,
-0.33139580488204956,
-0.5517434477806091,
-0.2715950608253479,
-0.4336346685886383,
0.19300776720046997,
-0.5188746452331543,
0.4893814623355... | |
LogMessage(string message, int category)
{
if (category == 1)
{
ListViewItem item = new ListViewItem(message);
item.BackColor = Color.LightGreen;
item.UseItemStyleForSubItems = true; | [
-0.1780586540699005,
-0.5541519522666931,
0.6888535022735596,
-0.3237924873828888,
0.07716064155101776,
0.16387559473514557,
0.4283726215362549,
-0.4390166401863098,
-0.3786298930644989,
-0.3401646912097931,
-0.46064308285713196,
0.443005234003067,
-0.5483061671257019,
0.196958526968956,
... | |
Log.Items.Add(item).SubItems.Add(DateTime.Now.ToString());
}
if (category == 2)
{
ListViewItem item = new ListViewItem(message);
item.BackColor = Color.Orange; | [
-0.1462438851594925,
-0.6575850248336792,
0.6045662760734558,
-0.4747782349586487,
0.10823323577642441,
0.1752287894487381,
0.3489065170288086,
-0.2533074617385864,
-0.5285189151763916,
-0.3690949082374573,
-0.42023080587387085,
0.42595240473747253,
-0.45912328362464905,
0.2267756760120391... | |
item.UseItemStyleForSubItems = true;
Log.Items.Add(item).SubItems.Add(DateTime.Now.ToString());
}
if (category == 3)
{
ListViewItem item = new ListViewItem(message);
item.BackColor = Color.Yellow; | [
-0.1037064865231514,
-0.49528443813323975,
0.7120715975761414,
-0.4423796236515045,
0.10678518563508987,
0.17076048254966736,
0.4966062605381012,
-0.3875593841075897,
-0.45365315675735474,
-0.3053152561187744,
-0.36536046862602234,
0.41089990735054016,
-0.3696035146713257,
0.32503244280815... | |
item.UseItemStyleForSubItems = true;
Log.Items.Add(item).SubItems.Add(DateTime.Now.ToString());
}
if (category == 0)
{
Log.Items.Add(message).SubItems.Add(DateTime.Now.ToString());
} | [
-0.14596912264823914,
-0.4049323499202728,
0.5769580006599426,
-0.36035484075546265,
0.18162740767002106,
0.17592091858386993,
0.5244722366333008,
-0.36566057801246643,
-0.4549374580383301,
-0.11894358694553375,
-0.4062553644180298,
0.46141350269317627,
-0.30426856875419617,
0.238298326730... | |
}
private void Connected()
{
LogMessage("Found and Accepted Master Server's connection. Waiting for reply...",1);
Status.Text = "Connected!";
Status.ForeColor = Color.Green;
commandsThread = new Thread(new ThreadStart(RecieveCommands)); | [
-0.015891533344984055,
-0.33375975489616394,
0.24119456112384796,
-0.019041113555431366,
0.44763100147247314,
-0.16692963242530823,
0.5432581901550293,
-0.05878740921616554,
-0.4830351173877716,
-0.43643370270729065,
-0.5152155160903931,
0.4527217745780945,
-0.5360490083694458,
0.714042246... | |
sendClientInfo();
}
private void exitButton_Click(object sender, EventArgs e)
{
Disconnect();
exitButton.Enabled = false;
exitButton.Text = "Closing...";
if (connectionThread != null)
{ | [
-0.38357266783714294,
-0.28105810284614563,
0.704862654209137,
-0.38260990381240845,
0.3678961992263794,
-0.03357243537902832,
0.6398316621780396,
0.06798316538333893,
-0.12012368440628052,
-0.2709624767303467,
-0.6566050052642822,
0.5695366859436035,
-0.5525662899017334,
0.381627082824707... | |
while (connectionThread.IsAlive)
{
Application.DoEvents();
}
}
this.Close();
} | [
-0.013878680765628815,
0.014887235127389431,
0.7174819111824036,
-0.20535525679588318,
0.4376211166381836,
0.1023162379860878,
0.40752914547920227,
-0.08039477467536926,
-0.11087009310722351,
-0.6331774592399597,
-0.20551711320877075,
0.448930948972702,
-0.3255043625831604,
0.3262333571910... | |
private void Form1_Load(object sender, EventArgs e)
{
Connect();
}
private void Disconnect()
{
RequestExitConnectionThread = true;
if (masterServer != null) | [
-0.03899240121245384,
-0.4635442793369293,
0.4430291950702667,
-0.06091015413403511,
0.2373008280992508,
-0.0788763016462326,
0.5248888731002808,
-0.435282438993454,
-0.14802803099155426,
-0.31809914112091064,
-0.5166528820991516,
0.49051475524902344,
-0.43629130721092224,
0.39943131804466... | |
masterServer.Close();
if (connectionThread != null)
connectionThread.Abort();
LogMessage("Closing Client. Please wait while Program threads end.", 2);
}
private void Disconnected()
{
Status.Text = "Disconnected"; | [
0.18178212642669678,
-0.20815719664096832,
0.6112995743751526,
-0.16242732107639313,
0.4691746234893799,
-0.14852610230445862,
0.5551102161407471,
-0.04985516145825386,
-0.5423393845558167,
-0.0900011882185936,
-0.6538046002388,
0.6096500754356384,
-0.5007524490356445,
0.7228436470031738,
... | |
Status.ForeColor = Color.Red;
Connect();
}
private void Connect()
{
LogMessage("Attempting to connect to Master Server...", 1);
connectionThread = new Thread(new ThreadStart(CreateConnection));
connectionThread.Start();
} | [
0.021627485752105713,
-0.3329850435256958,
0.34913456439971924,
-0.03245317190885544,
0.4946906864643097,
0.06589581072330475,
0.48046615719795227,
0.02993232198059559,
-0.5051389336585999,
-0.5979882478713989,
-0.4142115116119385,
0.3185962438583374,
-0.42692330479621887,
0.78666675090789... | |
private void CreateConnection()
{
int i = 1;
bool success = false;
while (!success)
{
try | [
0.36325737833976746,
-0.16398295760154724,
-0.018918093293905258,
-0.20241916179656982,
0.30504927039146423,
-0.0630660131573677,
0.6905648112297058,
-0.2961168587207794,
0.025267072021961212,
-0.2525327205657959,
-0.34962916374206543,
0.6024539470672607,
-0.2677749991416931,
0.34803932905... | |
{
using (masterServer = new TcpClient())
{
IAsyncResult result = masterServer.BeginConnect(serverIp, MyPort, null, null); | [
0.047092255204916,
-0.1839437633752823,
0.4526035785675049,
-0.1169695258140564,
0.2439807504415512,
-0.10278438776731491,
0.5957015156745911,
-0.34826964139938354,
0.023420734331011772,
-0.4223771393299103,
-0.12777893245220184,
0.28868263959884644,
-0.41176021099090576,
0.580669999122619... | |
success = result.AsyncWaitHandle.WaitOne(1000, false);
}
if (success)
{
BeginInvoke(new ConnectedDelegate(this.Connected), new object[] {}); | [
-0.16826628148555756,
-0.2503410279750824,
0.39697885513305664,
-0.08938693255186081,
0.25118643045425415,
-0.11035321652889252,
0.4450388252735138,
-0.45111507177352905,
-0.3402646481990814,
-0.322327584028244,
-0.3107653260231018,
0.43293511867523193,
-0.04588467255234718,
0.552432537078... | |
break;
}
else
{ | [
-0.1858692467212677,
0.06979331374168396,
-0.22444528341293335,
-0.2912537455558777,
0.2823234498500824,
-0.4559909403324127,
0.49608561396598816,
0.16902461647987366,
-0.12836149334907532,
-0.15955384075641632,
-0.5861650109291077,
0.6661565899848938,
-0.11660199612379074,
-0.166895598173... | |
Thread.Sleep(2000);
BeginInvoke(new AddMessageDelegate(LogMessage), new object[] { "Connection Retry # " + i.ToString() + ". Master Server hasn't been started yet.", 3 });
}
}
catch | [
-0.04220831021666527,
-0.36184364557266235,
0.4433245062828064,
-0.20997756719589233,
0.28257036209106445,
-0.2016696333885193,
0.30887123942375183,
-0.14450255036354065,
-0.5858123898506165,
-0.474247545003891,
-0.09653119742870331,
0.37137818336486816,
-0.3491241931915283,
0.464812517166... | |
{
MessageBox.Show("Error!");
}
i++;
}
}
private void RecieveCommands() | [
-0.015260702930390835,
-0.473458856344223,
-0.01376365590840578,
0.019137974828481674,
0.06539319455623627,
-0.00041407320532016456,
0.5440001487731934,
-0.3804340064525604,
-0.1826196312904358,
-0.35465946793556213,
-0.6446594595909119,
0.6835042834281921,
-0.43418484926223755,
0.16109094... | |
{
MessageBox.Show("Hello!");
commandReader = new StreamReader(masterServer.GetStream());
string CommandResponse = commandReader.ReadLine();
string Command = null;
if (CommandResponse != null)
MessageBox.Show("Recieved Command that was NOT nul... | [
-0.43972036242485046,
-0.5369464755058289,
0.29125353693962097,
-0.2964310348033905,
0.07687515765428543,
0.07040048390626907,
0.53547203540802,
-0.1765052080154419,
-0.13878120481967926,
-0.3171885013580322,
-0.7273179888725281,
0.543251633644104,
-0.5518838763237,
0.29943183064460754,
... | |
if (CommandResponse != null)
{
MessageBox.Show("Recieved null response!");
BeginInvoke(new AddMessageDelegate(LogMessage), new object[] { "Disconnected From Master Server. Reason: Recieved Null response.", 1 });
Disconnected(); | [
-0.14578309655189514,
-0.5094156861305237,
0.35100895166397095,
-0.3124699890613556,
0.24315600097179413,
0.030048133805394173,
0.5513918399810791,
-0.34782031178474426,
-0.2749398946762085,
-0.285750150680542,
-0.6411986351013184,
0.4463356137275696,
-0.4916723370552063,
0.286669135093688... | |
}
else if (CommandResponse.StartsWith("0"))
{
MessageBox.Show("Recieved 0 as a response!");
Command = CommandResponse.Substring(2).Trim();
isConnected = false;
BeginInvoke(new AddMessageDelegate(LogMessage), | [
-0.055602848529815674,
-0.5161152482032776,
0.35191038250923157,
-0.1645420491695404,
0.585120439529419,
-0.09133988618850708,
0.5885348916053772,
-0.5438545346260071,
-0.28903496265411377,
-0.42248842120170593,
-0.36718282103538513,
0.5625112652778625,
-0.2861209809780121,
0.1305702924728... | |
new object[] { "Disconnected From Master Server. Reason: " + Command, 1 });
}
else if (CommandResponse.StartsWith("1"))
{
MessageBox.Show("Recieved 1 as a response!");
isConnected = true; | [
0.09856303781270981,
-0.5120218992233276,
0.5261894464492798,
-0.05692804604768753,
0.13653160631656647,
-0.12918296456336975,
0.518112301826477,
-0.40053993463516235,
-0.35831257700920105,
-0.4593661427497864,
-0.4030526578426361,
0.32031774520874023,
-0.4265384078025818,
0.38274544477462... | |
BeginInvoke(new AddMessageDelegate(LogMessage), new object[] { "Connected to Master Server Successfully.", 1 });
}
}
//************************** RESPONSE'S BELOW HERE ************************* \\
private void sendClientInfo()
{
responseWriter = new StreamWriter... | [
-0.3667588531970978,
-0.49879589676856995,
1.0465631484985352,
-0.10753513127565384,
0.11774971336126328,
0.0802663192152977,
0.5120249390602112,
-0.3635839819908142,
-0.03088768757879734,
-0.8292484283447266,
-0.5077999830245972,
0.5173740983009338,
-0.3305334448814392,
0.0956657007336616... | |
responseWriter.Flush();
}
}
}
```
Adding a check within your connection process to cancel it if the program is exiting should help.
Try adding this in `CreateConnection()` inside your `while(!success)` loop but before your `try` block:
```
if(RequestExitConnectionThread)
{
break;
}
```
Here's an e... | [
-0.2986404299736023,
-0.29827409982681274,
0.5443601012229919,
-0.21109464764595032,
0.2589890956878662,
0.01266979705542326,
0.551934540271759,
-0.30240598320961,
0.15221621096134186,
-0.5486841201782227,
-0.2651064097881317,
0.6959222555160522,
-0.5037451386451721,
0.18762391805648804,
... | |
The canvas element unfortunately doesn't handle text well. There are a bunch of approaches (see e.g. <http://canvaspaint.org/blog/2006/12/rendering-text/> ), but they mostly seem like hacks. What can I do that is cross-platform and gives me the most flexibility to make my fonts like how I want?
According to the [docume... | [
0.23029126226902008,
-0.12191656231880188,
0.4081912934780121,
-0.16487374901771545,
-0.28438133001327515,
0.24061766266822815,
0.10800966620445251,
-0.1973237544298172,
-0.26972585916519165,
-0.8334115147590637,
0.08639916777610779,
0.39477574825286865,
-0.11984482407569885,
-0.0919762328... | |
Im trying to build a little site using XML instead of a database.
I would like to build a next and prev button which will work relative to the content I have displayed.
I found the php function next() and prev() as well as current() but I do not know how to set the pointer to a specific position to be able to naviga... | [
0.21437376737594604,
0.19433648884296417,
0.668035089969635,
0.011341186240315437,
-0.33722612261772156,
-0.0115280756726861,
0.24007706344127655,
-0.13327662646770477,
-0.3561256527900696,
-0.7920465469360352,
0.1797550916671753,
0.5662983655929565,
-0.323069304227829,
-0.0443051196634769... | |
at index '0'), it's fairly simple:
```
$List = array('page1', 'page2', 'page3', 'page4', 'page5');
$CurrentPage = 3; // 'page4'
while (key($List) !== $CurrentPage) next($List); // Advance until there's a match
```
I personally don't rely on automatic indexing because there's always a chance that the automatic index... | [
-0.27807143330574036,
0.07165892422199249,
0.7811051607131958,
-0.06693074107170105,
0.049488700926303864,
-0.19822101294994354,
0.04068337380886078,
-0.3631190359592438,
-0.1554863601922989,
-0.6633903384208679,
-0.09960339218378067,
0.6456637382507324,
-0.29430365562438965,
-0.0847666636... | |
I am having trouble getting SendMessage to activate a menu on another program. When looking through Spy++ when a user clicks on the menu the following occurs:
```
000A0628 P WM_NCLBUTTONDOWN nHittest:HTMENU xPos:1706 yPos:395 [wParam:00000005 lParam:018B06AA time:27:23:56.156 point:(1706, 395)]
000A0628 S WM_SYSCOM... | [
-0.6540151834487915,
0.22693859040737152,
0.6007655262947083,
-0.09612468630075455,
-0.09826645255088806,
0.1863999217748642,
0.7661843299865723,
-0.5353317260742188,
-0.1310361623764038,
-0.479046493768692,
-0.24971598386764526,
0.5983736515045166,
-0.25168561935424805,
-0.286549657583236... | |
cch:26 [lResult:0000001A]
000C0672 S EM_CANUNDO wParam:00000000 lParam:00000000
000C0672 R EM_CANUNDO fCanUndo:True [lResult:00000001]
000A0628 R WM_INITMENU lResult:00000000
000A0628 S WM_MENUSELECT uItem:0 fuFlags:MF_POPUP | MF_HILITE | MF_MOUSESELECT hmenu:00200355 [wParam:80900000 lParam:00200355]
000A0628 R W... | [
-0.6477850675582886,
0.3861899673938751,
0.8924708366394043,
0.039502911269664764,
0.18823730945587158,
0.08586759865283966,
0.2692570090293884,
-0.5193535089492798,
-0.5133163928985596,
-0.2318221628665924,
-0.12115207314491272,
0.6866469979286194,
-0.16597279906272888,
-0.275427699089050... | |
fuFlags:FFFF (menu was closed) hmenu:00000000 [wParam:FFFF0000 lParam:00000000]
000A0628 R WM_MENUSELECT lResult:00000000
000A0628 S WM_EXITMENULOOP fIsTrackPopupMenu:False [wParam:00000000 lParam:00000000]
000A0628 R WM_EXITMENULOOP lResult:00000000
000A0628 R WM_SYSCOMMAND lResult:00000000
```
Does anyone know ... | [
-0.09810717403888702,
0.03317462280392647,
0.8983794450759888,
-0.18686947226524353,
0.017243819311261177,
0.0657876655459404,
0.53641676902771,
-0.39834192395210266,
-0.384326308965683,
-0.24763470888137817,
-0.10594282299280167,
0.7748008370399475,
-0.27328813076019287,
-0.29922035336494... | |
so that it blocks and acts as a synchronous call. It's extra work, but if you insist on synchronous behavior from something that is inherently asynchronous, it's your best solution.) | [
0.14837613701820374,
-0.16014178097248077,
0.027644513174891472,
0.19560764729976654,
0.329414427280426,
0.22170080244541168,
0.5215308666229248,
-0.29943007230758667,
0.05841156095266342,
0.022230202332139015,
-0.2819986939430237,
0.6179896593093872,
-0.5735074281692505,
-0.15578164160251... | |
Runing such script:
```
1: function foo()
2: {
3: bar
4: }
5:
6: function bar()
7: {
8: throw "test"
9: }
10:
11: foo
```
I see
```
test
At C:\test.ps1:8 char:10
```
Can I get a detailed stack trace instead?
```
At bar() in C:\test.ps1:8
At foo() in C:\test.ps1:3
At C:\test.ps1:11
```
There i... | [
-0.021825730800628662,
0.14884436130523682,
0.2652708888053894,
-0.0005882372497580945,
0.05133669450879097,
-0.15311723947525024,
0.5810273289680481,
-0.06667529791593552,
-0.1875602900981903,
-0.5158467888832092,
-0.10379495471715927,
0.496574342250824,
-0.43841493129730225,
-0.371115624... | |
a `Get-PSCallStack` before every throw in your script. That way you get a stack trace immediately before hitting an exception.
I think one could script such functionality by using the debugging and tracing features of Powershell but I doubt it'd be easy. | [
0.39508458971977234,
-0.11743969470262527,
0.24590347707271576,
0.2729874551296234,
0.0806218683719635,
-0.44917818903923035,
0.3866243064403534,
-0.033023446798324585,
-0.11183251440525055,
-0.5940878391265869,
-0.06387248635292053,
0.5229556560516357,
-0.03572827950119972,
-0.08160266280... | |
**Duplicate of** ["how does one get a count of rows in a datastore model in google appengine?"](https://stackoverflow.com/questions/751124/how-does-one-get-a-count-of-rows-in-a-datastore-model-in-google-appengine)
---
I want to know how many users I have. Previously, I achieved this with the following code:
```
use... | [
0.11588539928197861,
0.2361370027065277,
0.40076562762260437,
0.22607111930847168,
-0.013061804696917534,
0.18889127671718597,
0.0026337692979723215,
-0.00800193939357996,
-0.6399426460266113,
-0.5891427397727966,
0.23580078780651093,
0.2825823426246643,
-0.40878811478614807,
0.32272171974... | |
distributed nature is really bad for aggregates. What you probably want to do is add a transactional counter to that entity, and if there are lots of transactions a sharded counter. See: <http://code.google.com/appengine/articles/sharding_counters.html>
UPDATE: Since 1.3.1 cursors make stuff like this a lot easier: <h... | [
-0.09455500543117523,
-0.24664245545864105,
0.30699869990348816,
-0.00001619623253645841,
-0.5782763957977295,
-0.3152972459793091,
0.07985478639602661,
0.1982361525297165,
-0.6178536415100098,
-0.537024736404419,
0.17309118807315826,
0.2712923586368561,
-0.6685810089111328,
0.194829970598... | |
Is it possible to have default arguments in MATLAB?
For instance, here:
```
function wave(a, b, n, k, T, f, flag, fTrue=inline('0'))
```
I would like to have the true solution be an optional argument to the wave function. If it is possible, what is the proper way to do this?
Currently, I am trying what I posted ab... | [
-0.3061387836933136,
-0.14140614867210388,
0.4455137252807617,
-0.04979899898171425,
-0.18129874765872955,
0.06720534712076187,
0.23486658930778503,
-0.04246651381254196,
-0.05255981162190437,
-0.43128660321235657,
0.08114475756883621,
0.7510590553283691,
-0.15597468614578247,
-0.289682626... | |
of arguments. Something like:
```
function f(arg1, arg2, arg3)
if nargin < 3
arg3 = 'some default'
end
end
```
There are a few fancier things you can do with `isempty`, etc., and you might want to look at MATLAB central for some packages that bundle these sorts of things.
You might have a look at `varar... | [
-0.18513834476470947,
0.061935070902109146,
0.29391852021217346,
-0.19529831409454346,
-0.4132450222969055,
0.2602463960647583,
0.328622967004776,
0.09516584128141403,
-0.20885571837425232,
-0.3304404020309448,
-0.09811581671237946,
0.6026907563209534,
-0.1356215476989746,
0.07065134495496... | |
How do I find out about the memory used by each object in a program?
For example : I want to know how much memory(in Kb) is used by this object "someclassinstance"..
someclass someclassinstance=new someclass();
I can see the total memory used by the application in the task manager...But Is there a way to see detaile... | [
0.13219782710075378,
-0.010172512382268906,
0.3158435821533203,
0.39356109499931335,
-0.14363066852092743,
-0.4390183687210083,
0.3994883894920349,
0.2103479504585266,
-0.35603874921798706,
-0.6415501236915588,
-0.04078160226345062,
0.5103172063827515,
0.07981708645820618,
0.20272472500801... | |
comes with the documentation you will need. | [
0.20924070477485657,
0.35103875398635864,
0.20054417848587036,
0.6363794207572937,
0.6086713075637817,
-0.3283335566520691,
-0.3010255694389343,
0.1774364560842514,
0.09311838448047638,
-0.5713016986846924,
0.00005702825728803873,
0.17925907671451569,
0.18235377967357635,
-0.26430964469909... | |
I have something like this in models.py
```
class ZipCode(models.Model):
zip = models.CharField(max_length=20)
cities = City.objects.filter(zip=self).distinct()
class City(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
state = models.ForeignKey(State)
... | [
0.044022392481565475,
-0.24733613431453705,
0.4839751720428467,
-0.12217898666858673,
-0.04689595103263855,
-0.24173150956630707,
0.0688987523317337,
-0.10561975836753845,
-0.3142313063144684,
-0.8996028900146484,
0.06958696246147156,
0.37364664673805237,
-0.3800416588783264,
0.40677145123... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.