text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
select tl).Any();
```
I am trying to see if there are records where Message starts with "Do not return" and Type is "Int"
and there is another message where Note start with "Do no return" and Type is "Ext".
Seems like my query is wrong as not returning anything.
```
var intMessages = from tl in resultlist
... | [
-0.2674223780632019,
-0.30403995513916016,
0.45253822207450867,
-0.34720444679260254,
0.07046739012002945,
-0.006267172284424305,
0.40305548906326294,
-0.2782966196537018,
-0.12392527610063553,
-0.5839083790779114,
-0.3375833332538605,
0.6969504356384277,
-0.46677279472351074,
0.0543411560... | |
&& tl.Type == "Int"
select tl;
var extMessages = from tl in resultlist
where tl.Message.StartsWith("Do not return")
&& tl.Type == "Ext" | [
-0.05098729953169823,
-0.3573547899723053,
0.4822668433189392,
-0.30497226119041443,
0.010814797133207321,
0.23140330612659454,
0.4532035291194916,
-0.2864851951599121,
0.05087505280971527,
-0.35124969482421875,
-0.5317774415016174,
0.525307834148407,
-0.5487635731697083,
0.084262885153293... | |
select tl;
var intAndExtMessages = intMessages.Any() && extMessages.Any();
```
This will ensure that in the result set there are some *"Do not return"* messages which start with `"Int"` **AND** in the same result set are some other messages which start with *"Ext"*
The function (the condition in query) checks if th... | [
-0.06038036197423935,
-0.3411684036254883,
0.3208443820476532,
-0.2516723871231079,
0.02491186000406742,
0.005481166299432516,
0.32696205377578735,
-0.2425275295972824,
0.12082697451114655,
-0.6375589966773987,
-0.3701779842376709,
0.6214401721954346,
-0.39639267325401306,
-0.0157938487827... | |
out if in the resultlist exist items of two different types or for two exclusive conditions, so this it can't be done in a single iteration (each LINQ query is an iterator in the end..). | [
-0.3036330044269562,
-0.08163900673389435,
0.29349398612976074,
0.17453883588314056,
0.033188801258802414,
-0.01845327392220497,
-0.06510552018880844,
-0.5381248593330383,
0.002041720785200596,
-0.17693087458610535,
-0.3480069041252136,
0.03715066611766815,
-0.2573149800300598,
0.162110880... | |
I want to show an image on my report if that image exists in the database for the person record displaying on the report. However, if that person record does not have an image, I want to display an embedded image in the exact location where the database image would be. When I put them on top of each other and toggle th... | [
0.11520928144454956,
-0.07320693880319595,
0.17023873329162598,
0.2743574380874634,
-0.10912897437810898,
0.1331755816936493,
0.04099029675126076,
-0.28616124391555786,
-0.44583794474601746,
-0.6423184871673584,
0.2260284423828125,
0.47832947969436646,
-0.005959991365671158,
0.080599464476... | |
image is set to hidden SSRS will show a blank space to the right of the visible image.
I have tried to put the images in a table and toggle the columns without luck and played around with the image settings (AutoFit, Clip, etc). It does not look like we can use an expression because they are of different types (embed... | [
0.05988910794258118,
-0.44342440366744995,
0.9004297256469727,
0.06959497183561325,
-0.32297924160957336,
-0.1627315729856491,
0.17246532440185547,
-0.02138698846101761,
-0.5252918601036072,
-0.6573944687843323,
0.16865138709545135,
0.8383229970932007,
-0.14690248668193817,
-0.004430106841... | |
TcmUploadAssembly (v6.1.0.966 for T2011SP1).
Have you registered the Templating DLLs `DD4T.ContentModel.Contracts.dll`, `DD4T.ContentModel.dll` and `DD4T.Templates.Base.dll` into the GAC on your TCM server? Just uploading them is not enough. Have a look at <http://code.google.com/p/dynamic-delivery-4-tridion/wiki/40_T... | [
0.3622676134109497,
-0.38809657096862793,
0.5010671615600586,
0.17064179480075836,
-0.07275654375553131,
-0.26945003867149353,
0.3468545973300934,
-0.15746597945690155,
-0.4468097984790802,
-0.3589355945587158,
0.25336211919784546,
0.8647210001945496,
-0.47473040223121643,
0.37149184942245... | |
So evidently:
```
\n = CR (Carriage Return) // Used as a new line character in Unix
\r = LF (Line Feed) // Used as a new line character in Mac OS
\r\n = CR + LF // Used as a new line character in Windows
(char)13 = \n = CR // Same as \n
```
but then I also heard that for HTML textarea, when it's submitted and parse... | [
0.3108895421028137,
0.2901238203048706,
0.3589562177658081,
-0.04829181358218193,
-0.23046167194843292,
-0.20390993356704712,
0.13123607635498047,
0.07673535495996475,
-0.08587402105331421,
-0.31277498602867126,
-0.14657817780971527,
0.6248876452445984,
-0.2643231153488159,
0.1906507015228... | |
on a new line, can I use '\r\n' as the delimiter regardless of whether or not the user is using mac, pc, etc
All newlines should be converted in `\r\n` by [the spec](http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1).
So you could indeed do a simple `explode("\r\n", $theContent)` no matter the platform used... | [
0.23709680140018463,
0.09087041765451431,
0.6254443526268005,
-0.025500696152448654,
0.2825697660446167,
-0.2150295376777649,
0.17708323895931244,
-0.300563782453537,
-0.3094538152217865,
-0.1824163943529129,
-0.5137369632720947,
0.5565796494483948,
-0.4562912583351135,
0.09161417186260223... | |
I have an exploded search string, and I need to see if any or all parts of it match an entry in a mysql DB table.
If user searches for something like "pour house greensboro", then "pour house" would match an entry in the table. But the search could also be "$1 beer pour house greensboro, or anything else like that, an... | [
0.6057665348052979,
0.8807181119918823,
0.178437739610672,
-0.317660391330719,
-0.21313467621803284,
-0.0716494619846344,
-0.022947246208786964,
-0.08058410882949829,
-0.3298030197620392,
-0.5219300389289856,
0.2602360248565674,
0.12015871703624725,
-0.18740315735340118,
0.3437795341014862... | |
to check it like this:
0 + 1 + 2 + 3 + 4
0 + 1 + 2 + 3
0 + 1 + 2
0 + 1
0
1 + 2 + 3 + 4
1 + 2 + 3
1 + 2
1
2 + 3 + 4
2 + 3
2
3 + 4
3
4
there could be more or less than 5 parts of the string
is there any way to do this easily?
I figured out how to | [
0.29323869943618774,
0.055265527218580246,
0.12526340782642365,
0.06054287403821945,
-0.2909192442893982,
0.16263659298419952,
0.38003939390182495,
-0.39103642106056213,
-0.1316697895526886,
-0.21576565504074097,
0.2963082492351532,
0.09308236837387085,
-0.10770285874605179,
0.270163476467... | |
do this, didn't think to update this until now...
```
(for $i=0; $i < count($search_string); $i++){
$output = '';
(for $a=$i; $a < count($search_string); $a++){
$output = $output." ".$search_string[$a];
}
}
``` | [
-0.09399893134832382,
0.003299316857010126,
0.38486915826797485,
-0.4345078468322754,
0.3310736417770386,
-0.15217208862304688,
0.5421060919761658,
-0.35395216941833496,
-0.14767061173915863,
-0.4395400285720825,
-0.41059979796409607,
0.6342944502830505,
-0.665643036365509,
0.0066531728953... | |
I have a table in SQL Server. This table has an image field and the application stores files in it.
Is there a way to read the size of the file in the image field using T-SQL?
```
SELECT DATALENGTH(imagecol) FROM table
```
See [MSDN](http://msdn.microsoft.com/en-us/library/ms173486.aspx) | [
0.2350086122751236,
0.17609907686710358,
0.3787092864513397,
0.05208447575569153,
0.08786305040121078,
-0.13539846241474152,
-0.28812262415885925,
0.057697270065546036,
-0.4390977621078491,
-0.7502967715263367,
0.16769912838935852,
0.28518053889274597,
-0.2818319797515869,
0.22300237417221... | |
What does `sys.stdout.flush()` do?
Python's standard out is buffered (meaning that it collects some of the data "written" to standard out before it writes it to the terminal). Calling `sys.stdout.flush()` forces it to "flush" the buffer, meaning that it will write everything in the buffer to the terminal, even if norma... | [
-0.04742070287466049,
-0.0675763264298439,
0.21957094967365265,
-0.37899547815322876,
-0.15883302688598633,
0.020717667415738106,
-0.047847311943769455,
0.013976020738482475,
-0.4401712715625763,
-0.4641411304473877,
-0.15133117139339447,
0.4425353407859802,
-0.5347809791564941,
-0.1680242... | |
How do I turn this:
```
<a class="link">
<p class="paragraph">This is some text</p>
<p class="paragraph">This is some more text</p>
<p class="paragraph">And some more</p>
</a>
```
into this:
```
<a class="link">
This is some text This is some more text And some more
</a>
```
with jQuery. I tried using... | [
0.0368218719959259,
-0.1618482768535614,
0.46275174617767334,
-0.1818603277206421,
-0.14408205449581146,
-0.03882899507880211,
-0.08283372968435287,
-0.3432110548019409,
-0.09717488288879395,
-0.6324840188026428,
-0.06206313893198967,
0.5201194286346436,
-0.2081884890794754,
-0.05143121257... | |
[working example](http://jsfiddle.net/ehCVt/).
**Update** (see comments)
In the case that this needs to apply to multiple `.link` elements, you can use `each`:
```
$("a.link").each(function() {
$(this).text($(this).text());
});
``` | [
0.06236683577299118,
-0.030934277921915054,
0.4347150921821594,
-0.18085572123527527,
0.044838327914476395,
-0.06363572925329208,
0.25728800892829895,
-0.4020197093486786,
-0.1541447937488556,
-0.5156834721565247,
-0.3147847652435303,
0.5182660222053528,
-0.5982798933982849,
0.005274536088... | |
I have a class in which i have intialized hashmap in static block. Passing the key, I have retrived the value which is a class. In order to create object for this class. I have used the constructor class to get the constructor and passed arguments and created object.
I have two class in hashmap. To create objectfor Ec... | [
-0.3398095369338989,
0.012526369653642178,
0.23213067650794983,
-0.1286037564277649,
-0.3791068196296692,
0.16589540243148804,
0.3393978476524353,
-0.3748333752155304,
-0.151561439037323,
-0.47488895058631897,
0.012456297874450684,
0.3823278844356537,
-0.43213242292404175,
0.24357716739177... | |
two argument.
2. In EchoExpression, the constructor contains two arguments.
eg:
```
JXPathExpression check = new JXPathExpression(String expression, Class<?> type)
```
String belongs to String.class but what class does the Class type argument belongs too? so that i can use it in getting the constructor
```
public... | [
0.2852618098258972,
-0.06518646329641342,
0.19872424006462097,
-0.5085676312446594,
-0.2007419317960739,
0.24126729369163513,
0.1339162141084671,
-0.5111455917358398,
0.11094628274440765,
-0.7436918616294861,
-0.08108103275299072,
0.7957608103752136,
-0.6216747164726257,
-0.122521743178367... | |
hmap.put("Out", OutExpression.class);
}
public void getExpo(String key,String expression)
{
Class aClass =map.get(key);
//Constructor implementation for OutExpression where only one argument string is passed
Constructor constructor = aClass.getConstructor(new Clas... | [
0.010462400503456593,
-0.08888416737318039,
0.42025840282440186,
-0.22373442351818085,
0.2145325243473053,
0.30354347825050354,
0.31548354029655457,
-0.7305315136909485,
-0.2726992070674896,
-0.2750466465950012,
-0.3152971863746643,
0.6959579586982727,
-0.5422195792198181,
-0.0830269008874... | |
return null;
}
}
```
For such a thing you should in all cases try to have unified constructor parameters or a way to store the parameters per class.
Now for your questions. `Class<?>` is a reference to a unknown class. Basically to any class. When using it its more or less equal to `Clas... | [
-0.03285706043243408,
0.033602867275476456,
-0.024262109771370888,
0.2570245862007141,
-0.2310624122619629,
0.19422589242458344,
0.0660615786910057,
0.1403282880783081,
-0.18604549765586853,
-0.4944043755531311,
0.09204412251710892,
0.27424514293670654,
-0.3111625611782074,
0.5469895005226... | |
first need to fetch the fitting constructor. At this point its already possible to fetch errors that happen in case the class does not support instances with this configuration of arguments.
Fetching the constructor works this way:
```
aClass.getConstructor(new Class[]{String.class, Object.class, ...});
```
This work... | [
-0.27397504448890686,
-0.17650574445724487,
0.3012499511241913,
0.16771656274795532,
-0.08290622383356094,
0.15104250609874725,
0.12472482770681381,
-0.4490984380245209,
-0.0009545990615151823,
-0.9737582206726074,
-0.16022391617298126,
0.9837735295295715,
-0.40459126234054565,
-0.00084672... | |
its a option not to load the new objects using reflection but rather by storing instances of those objects and returning copies of the objects created using copy constructors or the `clone` method. In many cases this is less difficult to get running. | [
0.14789915084838867,
-0.07739399373531342,
-0.1532117873430252,
0.16128230094909668,
-0.10514896363019943,
-0.023158490657806396,
0.13412854075431824,
0.09021133929491043,
-0.08638548105955124,
-0.4578162431716919,
-0.25138312578201294,
0.3487066924571991,
-0.32579073309898376,
-0.08484268... | |
I am hoping this isn't a repeat. I've checked the searches and I can't seem to find a clear answer to this.
I have a table that has it's primary key set to be a `UniqueIdentifier`. I also have another table that has a `varchar` column that basically contains a url with a query string that contains guids from my first ... | [
0.17259947955608368,
0.07454658299684525,
0.376686155796051,
0.0771043673157692,
0.07541213929653168,
-0.008357394486665726,
0.21947048604488373,
0.001749314134940505,
-0.2513110041618347,
-0.7847533226013184,
0.3773213028907776,
0.20539914071559906,
-0.19727757573127747,
0.684567093849182... | |
StateName
EB06F84C-15B9-4397-98AD-4A63DA2A238E Active
```
**URLTable**
```
URL
page.aspx?id=EB06F84C-15B9-4397-98AD-4A63DA2A238E
```
What I'm trying to do is join together `URLTable` and `StateTable` ON the value of `StateID` is contained in URL of URL table. I haven't really figured out the join. I've even tr... | [
-0.13117699325084686,
-0.13785848021507263,
0.27094766497612,
0.40731632709503174,
0.0007196865044534206,
0.07722477614879608,
-0.12642039358615875,
0.0012661726213991642,
-0.44001489877700806,
-0.3900972604751587,
0.40973353385925293,
0.09034541994333267,
0.25342223048210144,
0.0586549714... | |
and `varchar`.
Is there any way to join 2 tables using a like command and where the like command isn't comparing 2 incompatible variables?
Thank you!!
UPDATE: Let me add some additional things I should have mentioned. The query is for the purposes of building analytics reports. The tables are part of a CMS analyti... | [
0.2334991991519928,
0.13125938177108765,
0.3412829041481018,
0.22006118297576904,
-0.39331185817718506,
-0.053507059812545776,
0.14887623488903046,
-0.1477511078119278,
-0.40610721707344055,
-0.5277822613716125,
0.23468197882175446,
0.6671142578125,
-0.331263929605484,
0.009596592746675014... | |
there may be multiple values such as `id=guid&user=guid&date=date`.
UPDATE 2: One more thing I just realized to my horror is that sometimes the query string has the dashes removed from the GUID.. and sometimes not.. so unless I"m mistaken, I can't cast the substring to `Uniqueidentifier`. Can anyone confirm? *sigh*. ... | [
0.2744998037815094,
0.09226654469966888,
0.38150671124458313,
-0.03542462736368179,
0.06033124029636383,
-0.27987807989120483,
0.2883526682853699,
-0.2102469652891159,
0.07670243829488754,
-0.5024430751800537,
-0.0061728996224701405,
0.5116340517997742,
-0.13941077888011932,
0.299572497606... | |
+ CONVERT(varchar(50), StateID) + '%'
```
or
```
WHERE URL LIKE N'%' + CONVERT(nvarchar(50), StateID) + N'%'
```
if URL is nvarchar(...)
**EDIT**
As pointed out in another answer, this could result in poor performance on large tables.
The LIKE combined with a CONVERT will result in a table scan. This may not be ... | [
-0.045910414308309555,
-0.08432216942310333,
0.7029281258583069,
-0.05463014543056488,
-0.28509223461151123,
0.1179434210062027,
0.41466793417930603,
-0.6199618577957153,
-0.03991086781024933,
-0.8174915909767151,
-0.022578412666916847,
0.383939266204834,
-0.2683676481246948,
0.24634604156... | |
The following form has 11 checkboxes.. I set up the script to execute a function on the click of a button that would show a popup telling how many of the checkboxes were checked.. However, when I click the button, nothing happens. I think my mistake may be in the function code and discerning the use of name vs. id etc.... | [
0.5026077628135681,
0.12500406801700592,
0.26824134588241577,
-0.17319855093955994,
-0.18829379975795746,
0.2803463637828827,
-0.17787982523441315,
-0.6206958293914795,
-0.24461889266967773,
-0.6843025088310242,
-0.09697556495666504,
0.03941449895501137,
-0.2524537146091461,
-0.17118877172... | |
type="checkbox" name="ingredients" value="mushrooms" /> Fresh Mushrooms<br /></td>
<td><input type="checkbox" name="ingredients" value="pepperoni" /> Pepperoni<br /></td>
</tr>
<tr>
<td><input type="checkbox" name="ingredients" value="onions" /> Fresh Onions<br /></td>
<td><input type="checkbox" name="ingredients" val... | [
-0.12415564060211182,
0.39912232756614685,
-0.31540992856025696,
-0.5047152638435364,
-0.09005779772996902,
0.403653085231781,
-0.240932434797287,
-0.285211443901062,
-0.24553817510604858,
-0.7769442796707153,
-0.21448121964931488,
0.40422821044921875,
-0.033092740923166275,
-0.26222398877... | |
var max = form.ckbox.length;
for (var idx = 0; idx < max; idx++) {
if (eval("document.form.ckbox[" + idx + "].checked") == true) {
total++;
} | [
0.33560100197792053,
-0.3775412440299988,
0.44340699911117554,
-0.12075735628604889,
-0.13685764372348785,
0.34979507327079773,
0.6068773865699768,
-0.5263283848762512,
-0.2402345836162567,
0.0308713149279356,
-0.20045064389705658,
0.32584643363952637,
-0.12609770894050598,
-0.070228591561... | |
}
alert("You selected " + total + " boxes.");
}
}
</script>
<input type="button" name="submit" value="Submit" onclick="anyCheck(form1);" />
</form>
</body>
</html>
```
UPDATED CODE:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tr... | [
0.36466076970100403,
-0.1949101984500885,
0.03082168474793434,
-0.2899619936943054,
-0.17237980663776398,
0.4831591844558716,
-0.43934202194213867,
-0.28379178047180176,
-0.48767557740211487,
-0.7461401224136353,
0.019100189208984375,
0.20291085541248322,
0.11598651111125946,
-0.3351545333... | |
value="peppers" /> Fresh Green Peppers<br /></td>
</tr>
<tr>
<td><input type="checkbox" name="ingredients" value="beef" /> Beef<br /></td>
<td><input type="checkbox" name="ingredients" value="tomatoes" /> Diced Tomatoes<br /></td>
<td><input type="checkbox" name="ingredients" value="bacon" /> Bacon Bits<br /></td>
</t... | [
0.15984974801540375,
0.06660860031843185,
-0.05375852435827255,
-0.3614101707935333,
0.13163769245147705,
0.3504185974597931,
-0.25297248363494873,
-0.22217492759227753,
0.004896392580121756,
-0.7088348865509033,
-0.13741038739681244,
0.3836473226547241,
0.04017551615834236,
-0.29651388525... | |
if (inputs[i].type.toLowerCase() === "checkbox" && inputs[i].checked)
total++;
}
alert("You selected " + total + " boxes.");
}
}
</script>
<input type="button" name="submit" value="Submit" onclick="anyCheck();" />
</form>
</body>
</html>
```
The reason is that your user for your ASP.Net web a... | [
0.09250867366790771,
-0.4629330039024353,
0.6829859018325806,
-0.023411370813846588,
-0.14937946200370789,
-0.06357428431510925,
0.1512620449066162,
-0.3060905933380127,
-0.30499938130378723,
-0.8887709975242615,
-0.28429171442985535,
0.45398345589637756,
-0.08110860735177994,
-0.030765587... | |
an hour for a timeout, you won't get to make more http requests for that user for that hour for that app domain, until the thread you tied up waiting for a message has timed out. | [
0.5522290468215942,
-0.24831674993038177,
0.5024186372756958,
0.23945559561252594,
0.08508654683828354,
-0.10814813524484634,
0.28284427523612976,
0.11963186413049698,
-0.2978392243385315,
-0.4618782699108124,
0.04073326662182808,
0.10304932296276093,
-0.010521305724978447,
0.1381394565105... | |
I am setting a background image on my XAML Grid with a Uri. The Uri points off to a HTTP url, where it will fetch, and then render the image as a background for a Win8 metro app.
I've been trying to figure out if there is an event or something I can hook into to let me know that WPF has loaded it into memory, AND fini... | [
0.27318263053894043,
0.013366175815463066,
0.6374768614768982,
0.08252241462469101,
0.27292850613594055,
0.08402101695537567,
0.06532610952854156,
0.42179355025291443,
-0.11857196688652039,
-0.8320193886756897,
-0.08939989656209946,
0.22673173248767853,
-0.13059742748737335,
0.131721735000... | |
as the background, which means it either pops up mid-fade, or after the fade effect has completed. This looks quite poor.
The goal is to have a fade transition between app pages (I already have this), without the inconsistency of the background image popping up whenever it's done.
Any suggestions would be welcomed.
Y... | [
0.5291239619255066,
-0.3050084710121155,
0.7427845597267151,
-0.11354348063468933,
0.06477521359920502,
0.0662827417254448,
0.05984979867935181,
-0.029548993334174156,
-0.3247864842414856,
-0.6799036264419556,
-0.40302470326423645,
0.6695453524589539,
-0.34427475929260254,
-0.0747614130377... | |
I am trying to implement a generic timer function in OCaml which will take as input a function of arbitrary arity and return type ***'r*** and returns a function with:
* the same arity and types of input parameters
, and
* return type `float * 'r` where the float would be a metric of the time spent in the function (e.... | [
0.29494330286979675,
0.0917242094874382,
0.09069955348968506,
-0.20527169108390808,
-0.129251167178154,
0.08779831975698471,
-0.05267912149429321,
-0.15727946162223816,
0.10853604227304459,
-0.5937089323997498,
-0.05436938256025314,
0.5487186908721924,
-0.548387348651886,
0.068737410008907... | |
let timerf x y =
let t0 = Sys.time ()
in let result | [
0.21098458766937256,
-0.3379649817943573,
0.42056211829185486,
-0.30070313811302185,
0.266767293214798,
0.202297642827034,
0.07047498226165771,
-0.5497994422912598,
0.1729184240102768,
-0.33093714714050293,
-0.4428543448448181,
0.4026513695716858,
-0.09449523687362671,
0.13873597979545593,... | |
= f x y
in let diff = Sys.time() -. t0 | [
0.1602286994457245,
-0.42591574788093567,
0.424800843000412,
-0.350563108921051,
0.17462891340255737,
0.10809343308210373,
0.24987739324569702,
-0.39344215393066406,
0.33470362424850464,
-0.36217811703681946,
-0.3633262813091278,
0.4508187472820282,
0.016812115907669067,
0.1327175796031952... | |
in diff, result
in timerf
```
works only with functions of input arity 2. It is not obvious to me how to generalize it to handle functions of any arity. I was hoping the partial function applications would somehow magically solve the conundrum but I can't get it to work.
I u... | [
0.1950971931219101,
-0.03394576534628868,
0.413044273853302,
-0.3193020522594452,
-0.2904413938522339,
-0.15420085191726685,
0.1283702403306961,
-0.2789294719696045,
0.205515056848526,
-0.2705414891242981,
-0.16518640518188477,
0.5840792059898376,
-0.43520987033843994,
0.2860918641090393,
... | |
of making a timer function with arbitrary arity. But you cannot do it in an easy way in OCaml.
Moreover, a timer function with only one param is enough for use in practice:
```
let timer f x =
let t0 = Sys.time()
in let result = f x | [
0.14378859102725983,
-0.17993158102035522,
0.012857118621468544,
-0.10363753885030746,
-0.10449933260679245,
-0.12690702080726624,
0.21488110721111298,
-0.5263238549232483,
-0.10345079749822617,
-0.368243932723999,
-0.26936617493629456,
0.6176674365997314,
-0.34452277421951294,
-0.23339091... | |
in let diff = Sys.time() -. t0
in diff, result
```
Since any function `g` with any arity can be passed to `timer` easily | [
0.28170648217201233,
-0.09697184711694717,
0.1142265647649765,
-0.37501415610313416,
-0.13393157720565796,
0.08065003901720047,
0.04295564070343971,
-0.41819602251052856,
0.34266552329063416,
-0.4058540165424347,
-0.4018126428127289,
0.7199726104736328,
-0.3936689496040344,
0.2585779726505... | |
by:
```
let diff, result = timer (fun () -> g x1 x2 x3 ... xN) ()
```
*or better by using partial application (as suggested by @Andreas):*
```
let diff, result = timer (g x1 x2 x3 ... xN-1) xN
``` | [
0.1760653257369995,
0.13239306211471558,
0.36764708161354065,
-0.2180541306734085,
-0.3375398516654968,
0.04799158126115799,
0.12902840971946716,
-0.5354511737823486,
-0.138510063290596,
-0.20695437490940094,
-0.4131128191947937,
0.6549960970878601,
-0.361666738986969,
0.12566359341144562,... | |
Given the following php code...
```
<?php
exec('myscript.php');
exec('finish.php');
?>
```
Is there a way to tell when myscript.php has stopped running?
I'd like to prevent `finish.php` from running until `myscript.php` is completed.
The exec() calls will block until the external job has completed. U... | [
0.5899617671966553,
0.26623475551605225,
0.35837164521217346,
-0.1817522943019867,
0.12921860814094543,
-0.22219771146774292,
0.5556602478027344,
0.2470753937959671,
-0.15507526695728302,
-0.2740178108215332,
-0.35327374935150146,
0.5999172329902649,
-0.1597864180803299,
0.1445605009794235... | |
[JSFiddle](http://jsfiddle.net/adzFe/)
--------------------------------------
Is there any way to make something like the X on that link with pure css?

I spent more time on this than I should have, and haven't tested in IE for obvious reasons. That ... | [
-0.07135365158319473,
0.10842815041542053,
0.905572235584259,
0.011876337230205536,
-0.49206018447875977,
0.03549892455339432,
0.25078922510147095,
-0.3021998107433319,
-0.22311194241046906,
-0.6582522392272949,
-0.1427336484193802,
0.13713303208351135,
-0.5211406350135803,
-0.136003524065... | |
0px;
padding: 11px 3px;
}
.boxclose:before {
content: "×";
}
``` | [
-0.03578907623887062,
-0.11179262399673462,
0.49030232429504395,
-0.21710728108882904,
0.04638059437274933,
-0.05576001852750778,
0.36995387077331543,
-0.29787877202033997,
-0.09851089864969254,
-0.2136249989271164,
-0.5764781832695007,
0.20861603319644928,
-0.48419448733329773,
-0.0306147... | |
I have managed to break a working application, and cannot work out how to fix it.
I have a java web-app which runs on "tc server" on a Windows7 box from within Eclipse (spring STS version.)
The app will use java.awt.robot to perform a screen capture, and display the captured image on the subsequent page.
So far s... | [
0.28080207109451294,
0.21450437605381012,
0.577474057674408,
0.1961669623851776,
-0.08191646635532379,
-0.08329088985919952,
0.6002574563026428,
0.03962605074048042,
-0.35050562024116516,
-0.650596022605896,
-0.10829852521419525,
0.5812567472457886,
-0.09177272021770477,
0.0839539468288421... | |
an exception from Robot because it cannot run in a HeadlessEnvironment.
Google searches indicate that a headlessEnvironment is for running without a screen and keyboard, but I have both.
The application worked previously without ever encountering the HeadlessEnvironment.
If I debug and display the GraphicsEnvironment... | [
-0.11270925402641296,
0.31659114360809326,
0.7662231922149658,
-0.13845175504684448,
0.08858194202184677,
0.014083999209105968,
0.5869978666305542,
0.0007852993439882994,
-0.3476940095424652,
-0.6165366768836975,
-0.3767271339893341,
0.548825204372406,
-0.4036468267440796,
0.33959087729454... | |
original version of eclipse, which now also has the same problem.
I feel rather stuck now, and as most searches are telling me how I can turn Headless mode ON, can anyone explain how to turn headless mode back off again ?
Many Thanks !
<------------- EDIT: Stack Trace Added ------------------------------------------... | [
-0.1471114307641983,
-0.1187741607427597,
0.5481554269790649,
-0.28661757707595825,
-0.44382888078689575,
0.14694102108478546,
0.27081793546676636,
-0.3830428123474121,
-0.19248895347118378,
-0.6510549187660217,
-0.2618285119533539,
0.5704416036605835,
-0.284662663936615,
-0.35888853669166... | |
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.... | [
-0.29713690280914307,
0.19924801588058472,
0.37268397212028503,
-0.0005121998838149011,
-0.17228952050209045,
0.42900121212005615,
0.24527089297771454,
-0.48823001980781555,
-0.27031210064888,
-0.5586747527122498,
-0.07691625505685806,
0.40285587310791016,
-0.04295562207698822,
0.043917942... | |
Lets say I have table with ID int, VALUE string:
```
ID | VALUE
1 abc
2 abc
3 def
4 abc
5 abc
6 abc
```
If I do select value, count(\*) group by value I should get
```
VALUE | COUNT
abc 5
def 1
```
Now the tricky part, if | [
-0.05534394085407257,
0.21957628428936005,
0.22547386586666107,
-0.3346058428287506,
-0.0031556414905935526,
-0.02341734804213047,
0.041288308799266815,
-0.7326240539550781,
-0.19114777445793152,
-0.6759188771247864,
-0.09653187543153763,
0.42028385400772095,
-0.5234156250953674,
0.1250596... | |
there is count == 1 I need to get that ID from first table. Should I be using CTE? creating resultset where I will add ID string == null and run update b.ID = a.ID where count == 1 ?
Or is there another easier way?
EDIT:
I want to have result table like this:
```
ID VALUE count
null abc 5
3 def ... | [
0.35092905163764954,
-0.0772782638669014,
0.13456659018993378,
0.03058822825551033,
-0.10714451223611832,
-0.1356038600206375,
0.12462757527828217,
-0.4584529399871826,
-0.2053048014640808,
-0.6878939270973206,
0.23974576592445374,
0.6738104224205017,
-0.1861913949251175,
0.160803452134132... | |
use either one, otherwise you can return null. Like this:
```
Select Case When Min(id) = Max(id) Then Min(id) Else Null End As Id,
Value, Count(*) As [Count]
From YourTable
Group By Value
```
Since you are already performing an aggregate, including the MIN and Max function is not likely to take any extra (n... | [
0.08584030717611313,
-0.13793517649173737,
-0.25210386514663696,
-0.16325193643569946,
-0.2478916496038437,
0.07805154472589493,
0.05149920657277107,
-0.2399527132511139,
-0.11204145103693008,
-0.5850061178207397,
0.22129075229167938,
0.7191218733787537,
-0.21546177566051483,
-0.3100750446... | |
I have the following code which deletes a record from a database. However I would like it also to remove an associated file from the server. One of the columns contains the path to the file. Can someone explain how I would use the unlink function here?
```
<?php
include('config.php');
if (isset($_GET['id']) && is_... | [
0.27095896005630493,
0.1463230401277542,
0.4317527115345001,
-0.07361482083797455,
0.05514572933316231,
-0.07368654012680054,
0.33906951546669006,
-0.29972290992736816,
-0.13858823478221893,
-0.5387040972709656,
0.0792844146490097,
0.4244207441806793,
-0.37220412492752075,
0.31956282258033... | |
header("Location: view.php");
}
else
{
header("Location: view.php");
}
?>
```
Before anything else, fix your [SQL injection](http://bobby-tables.com) holes.
To answer your question, first you have to select the record to details about that local file. Once you've nuked the database record, you've los... | [
0.1997959166765213,
0.43085211515426636,
0.3717242479324341,
0.10245358943939209,
0.2156529277563095,
-0.11220284551382065,
0.18069809675216675,
-0.23258325457572937,
-0.37709638476371765,
-0.4519050419330597,
0.11167778074741364,
0.45136770606040955,
-0.19124403595924377,
0.23436528444290... | |
I want to understand how I can update my GUI with a simple text string on a regular basis.
Essentially, I'm writing a twitter application which regularly polls twitter for updates. I want the contents of the update to be shown in a text block, one by one on a constant loop.
In order to keep the GUI responsive I need ... | [
0.5114627480506897,
0.09918303787708282,
0.32118117809295654,
0.022729849442839622,
-0.23946373164653778,
0.06523234397172928,
0.27586469054222107,
0.09921973943710327,
-0.1851453334093094,
-0.7014750242233276,
0.1107076033949852,
0.5261741280555725,
-0.2124219387769699,
-0.181569948792457... | |
'MainWindowGoUpdate' is going to be on the 'wrong thread' but how can I get the GUI thread to listen for the event?
A pointer appreciated.
```
public partial class MainWindow : Window
{
public MainWindow()
{
public static event UpdateTimeLineEvent _goUpdate;
public static string TheTimeLine;
UpdateT... | [
-0.06080752611160278,
-0.3362581431865692,
0.7595714926719666,
-0.3888249397277832,
0.4567906856536865,
0.000701302255038172,
0.44786810874938965,
-0.11784783750772476,
-0.18538156151771545,
-0.6460017561912537,
-0.46065250039100647,
0.7463071942329407,
-0.4307844340801239,
0.3595989644527... | |
}
void startTimelineUpdater_DoWork(object sender, DoWorkEventArgs e)
{
while (true)
{
Xtweet getSQL = new Xtweet();
var sqlset = getSQL.CollectLocalTimelineSql();
int i = 0;
while (i < 10)
{
foreach (var stringse in sqlset)
{
StringBuilder sb = new | [
0.08173935860395432,
-0.394666463136673,
0.7066444158554077,
-0.3956664502620697,
0.3240586817264557,
0.03328823298215866,
0.5363461375236511,
-0.4667375981807709,
-0.06169380247592926,
-0.5225232839584351,
-0.1889883428812027,
0.38076889514923096,
-0.34847530722618103,
0.21060773730278015... | |
StringBuilder();
sb.Append(stringse[0] + ": ");
sb.Append(stringse[1] + " @ ");
sb.Append(stringse[2]);
sb.Append("\n");
TheTimeLine = sb.ToString();
_goUpdate += new UpdateTimeLineEvent(MainWindowGoUpdate);
_goUpdate.Invoke();
Thread.... | [
0.07192005217075348,
-0.38619542121887207,
0.7598161697387695,
-0.6439529657363892,
0.502110481262207,
0.10222305357456207,
0.6135302186012268,
-0.2881004810333252,
-0.4356508255004883,
-0.7340061664581299,
-0.4060642123222351,
0.24562086164951324,
-0.42987290024757385,
0.5899890661239624,... | |
i++;
}
}
}
}
void MainWindowGoUpdate()
{
txtb_timeline.Text = TheTimeLine;
}
void startTimelineUpdater_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
txtb_timeline.Text = "should not see this";
}
}
```
I will try these change:
In your UpdateTi... | [
-0.140227809548378,
-0.1612621545791626,
0.8888328671455383,
-0.31063222885131836,
0.3280775547027588,
0.13368560373783112,
0.528749942779541,
-0.19611799716949463,
-0.19991447031497955,
-0.8571628928184509,
-0.2790745198726654,
0.4484785497188568,
-0.35078543424606323,
0.3784606456756592,... | |
(startTimelineUpdater_ProgressChanged);
```
In startTimelineUpdater\_DoWork remove these lines
```
TheTimeLine = sb.ToString();
_goUpdate += new UpdateTimeLineEvent(MainWindowGoUpdate);
_goUpdate.Invoke();
```
and insert these:
```
BackgroundWorker bkgwk = sender as BackgroundWorker;
bkgwk.ReportProgress(... | [
-0.1668386310338974,
-0.1129394918680191,
0.9031565189361572,
-0.3168310821056366,
0.3195004463195801,
0.14460425078868866,
0.4689319133758545,
-0.22199751436710358,
-0.26419055461883545,
-0.5749642252922058,
-0.40967732667922974,
0.27576780319213867,
-0.47338584065437317,
0.29798445105552... | |
So here's my code :
```
public class SetWritable<T extends Writable> implements Writable {
private Class<? extends Writable> valueClass;
private Set<T> values;
public SetWritable(Class<T> valueClass) {
this.valueClass = valueClass;
this.values = new HashSet<T>();
}
pub... | [
0.17628158628940582,
-0.27171218395233154,
0.2803804874420166,
-0.16402168571949005,
0.22112151980400085,
-0.02763606421649456,
0.1821020245552063,
-0.11024339497089386,
0.0215307530015707,
-0.5359759330749512,
-0.1056307926774025,
0.8036433458328247,
-0.4460238516330719,
0.061167635023593... | |
int len = in.readInt();
for (int i = 0; i < len; i++) {
//this line is where I get the warning
//FYI, WritableFactories.newInstance returns an instance of Writable
T value = (T) WritableFactories.newInstance(valueClass); | [
0.1408991813659668,
-0.5455978512763977,
0.46276363730430603,
-0.24869951605796814,
0.05624595284461975,
0.2115635871887207,
0.5031656622886658,
-0.18274067342281342,
-0.23515357077121735,
-0.47246941924095154,
-0.14882861077785492,
0.5430583953857422,
-0.501246988773346,
0.323976278305053... | |
value.readFields(in);
values.add(value);
}
}
}
```
What's confusing to me is this : I've asserted that T extends Writable, so why am I getting a warning when I try to cast the Writable to T? And since I know T extends Writable, is it safe to suppress this warning?
You are gettin... | [
0.45865598320961,
0.07986276596784592,
0.30489838123321533,
-0.3130579888820648,
0.22235363721847534,
-0.4911577105522156,
0.3496592342853546,
-0.1951785534620285,
-0.17730796337127686,
-0.33370494842529297,
-0.20839111506938934,
0.8049401044845581,
-0.46036630868911743,
0.3281401395797729... | |
*might* not be a safe cast. However, since you are using `Class<T>` as your argument to `newInstance` it is safe to suppress this warning.
It might be better to store `valueClass` as `Class<T>` and use [`Class#cast`](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#cast%28java.lang.Object%29) to cast for ... | [
0.3664465844631195,
-0.028221912682056427,
0.17205248773097992,
-0.24318674206733704,
0.09275416284799576,
-0.055829454213380814,
0.5108172297477722,
-0.14077411592006683,
0.08003740012645721,
-0.7010103464126587,
0.049647256731987,
0.47053608298301697,
-0.12555770576000214,
0.251960784196... | |
I was asked to create an export and import mysql database with it's structure and data into a .sql file using php scripting and not phpmyadmin to make the user be able to backup his data?
Does anybody have an idea how to do that??
Thanks in advance
<http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/using-php-to... | [
0.03190206363797188,
0.1962941288948059,
0.5798221826553345,
0.14733172953128815,
0.04697882756590843,
0.205197274684906,
0.328800231218338,
-0.1254095435142517,
-0.13079889118671417,
-0.34930872917175293,
-0.26270467042922974,
0.8000706434249878,
-0.39450302720069885,
-0.0483965128660202,... | |
According to <http://en.wikipedia.org/wiki/Producer-consumer_problem> I want to simulate P/C problem using semaphore. I am getting deadlock and I don't know what is problem.
```
public static void main(String[] args) {
CustomBlockingQueue blockingQueue = new CustomBlockingQueue();
new Thread(new Produc... | [
0.28103405237197876,
0.08369079977273941,
0.7526229023933411,
-0.13852474093437195,
0.03109859861433506,
0.36718568205833435,
0.40033772587776184,
-0.40697839856147766,
-0.4044490456581116,
-0.5232807993888855,
-0.19735145568847656,
0.5335130095481873,
-0.6394592523574829,
0.55381721258163... | |
emptyCount = new Semaphore(MAX_SIZE);
@Override
public boolean offer(Object e) {
try {
mutex.acquire();
} catch (InterruptedException e2) {
e2.printStackTrace();
}
boolean result = super.offer(e);
System.out.println("offer " + size());
try... | [
0.05247777700424194,
-0.2798442244529724,
0.4736744463443756,
-0.2838313579559326,
0.11543826013803482,
0.2619568109512329,
0.3141005039215088,
-0.6059574484825134,
-0.05814917013049126,
-0.6458733677864075,
-0.4200995862483978,
0.5237924456596375,
-0.26037487387657166,
0.11523023247718811... | |
fillCount.release();
emptyCount.acquire();
mutex.release();
} catch (InterruptedException e1) {
e1.printStackTrace();
}
return result;
}
@Override
public Object poll() {
try | [
-0.03219614550471306,
-0.489582896232605,
0.5526780486106873,
-0.16376325488090515,
0.32709869742393494,
0.22341319918632507,
0.17534856498241425,
-0.44234445691108704,
-0.14957864582538605,
-0.2428733855485916,
-0.24446558952331543,
0.6687263250350952,
-0.5244990587234497,
0.1146812885999... | |
{
mutex.acquire();
} catch (InterruptedException e2) {
e2.printStackTrace();
}
Object result = super.poll();
System.out.println("poll " + size());
try {
emptyCount.release(); | [
-0.15310975909233093,
-0.5323531627655029,
0.5301938652992249,
-0.28460994362831116,
0.2541036903858185,
0.28758761286735535,
0.32246944308280945,
-0.3733380138874054,
-0.24639546871185303,
-0.3009181320667267,
-0.31528690457344055,
0.5478554368019104,
-0.5205841064453125,
0.25991913676261... | |
fillCount.acquire();
mutex.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
return result;
}
}
class Producer implements Runnable {
private CustomBlockingQueue blockingQueue;
private Random random = new Random();
public Producer(Custo... | [
0.16367124021053314,
-0.5500001311302185,
0.06876790523529053,
-0.24615195393562317,
0.09411722421646118,
0.10341467708349228,
0.2368793934583664,
-0.18469072878360748,
-0.44737666845321655,
-0.38990381360054016,
-0.10340504348278046,
0.35162293910980225,
-0.640796422958374,
0.528444051742... | |
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {
TimeUnit.SECONDS.sleep(random.nextInt(2));
blockingQueue.offer(new Object());
} catch (InterruptedException e) {
e.printStackTrace(); | [
0.25510671734809875,
-0.5336092114448547,
0.3550280034542084,
-0.12283651530742645,
0.5007582902908325,
-0.06357509642839432,
0.638340175151825,
-0.2255619317293167,
-0.12002769112586975,
-0.3455791473388672,
-0.1561511754989624,
0.5163461565971375,
-0.379141241312027,
0.5595454573631287,
... | |
}
}
}
}
class Consumer implements Runnable {
private CustomBlockingQueue blockingQueue;
private Random random = new Random();
public Consumer(CustomBlockingQueue blockingQueue) {
this.blockingQueue = blockingQueue;
}
@Override
public void run() {
while (!Thread.cur... | [
0.17702347040176392,
-0.3779161870479584,
0.23786133527755737,
-0.21888527274131775,
0.08528609573841095,
0.4460199177265167,
0.33750659227371216,
-0.3858087360858917,
-0.12993887066841125,
-0.5199474096298218,
0.12197916954755783,
0.5917127728462219,
-0.3748931586742401,
0.687150299549102... | |
TimeUnit.SECONDS.sleep(random.nextInt(4));
blockingQueue.poll();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
```
Using semaphores
Semaphores solve the problem of lost wakeup calls. In the solution below we use two semaphores, fillC... | [
0.41035693883895874,
-0.37813642621040344,
0.4436313509941101,
0.012054502964019775,
0.5411109328269958,
0.19086599349975586,
0.18792381882667542,
-0.4534321129322052,
-0.39138540625572205,
-0.7736186981201172,
-0.022085338830947876,
0.31750577688217163,
-0.408834308385849,
0.0967834591865... | |
and emptyCount, to solve the problem. fillCount is the number of items to be read in the buffer, and emptyCount is the number of available spaces in the buffer where items could be written. fillCount is incremented and emptyCount decremented when a new item has been put into the buffer. If the producer tries to decreme... | [
-0.20657624304294586,
-0.04360957816243172,
0.6236214637756348,
-0.09225819259881973,
0.2617797255516052,
0.35434022545814514,
-0.10120533406734467,
-0.1521570086479187,
-0.3865366280078888,
-0.4349919557571411,
-0.1364179402589798,
0.5778141617774963,
-0.13171400129795074,
0.2725238204002... | |
INTO OUTFILE '$backupFile' FROM $tableName";
$result = mysql_query($query);
```
or
```
$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);
``` | [
-0.38319188356399536,
-0.15336430072784424,
0.4799101948738098,
-0.21403314173221588,
0.26750755310058594,
0.17290277779102325,
0.549727201461792,
-0.12437704205513,
0.009966336190700531,
-0.41324082016944885,
-0.6252710223197937,
0.6025707721710205,
-0.46468493342399597,
0.288046807050704... | |
My ultimate goal is to do this programmatically, but as a sanity check I'm trying to just post an uploaded photo (from my computer) to a Facebook page using the Facebook Graph API Explorer. I have the access token and photo\_upload and publish\_stream permissions.
I just don't understand what to do to indicate where ... | [
0.5966479182243347,
0.08213541656732559,
0.5062242150306702,
0.085792675614357,
-0.14893163740634918,
-0.08955474942922592,
0.4222998321056366,
-0.03574744984507561,
-0.375834196805954,
-0.5792204141616821,
0.11952389031648636,
0.36092907190322876,
-0.20441438257694244,
0.03692806139588356... | |
url, and Facebook should pick it up. Since it's just a string, you can use the Explorer for that.
However, Facebook should come back with reasonable errors for photo uploads - I'd start coding rather than worry about the explorer tool! | [
0.49697521328926086,
0.09622760862112045,
0.39539870619773865,
0.18405388295650482,
-0.27176353335380554,
-0.30639445781707764,
0.15475836396217346,
0.4942520260810852,
-0.18436239659786224,
-0.32038432359695435,
-0.04736175760626793,
0.22615914046764374,
-0.030719729140400887,
0.334418833... | |
I have a thread in a function which start the live monitoring, it basically, opens the serial port and continously reading data from serial port. However, If I need to terminate this thread, how should I do it? Because If I don't terminate the running thread which opened the specific serial port and reading data. When ... | [
0.594613254070282,
-0.08938461542129517,
0.2985522150993347,
-0.11395443230867386,
-0.005130847916007042,
-0.2702517509460449,
0.4454773962497711,
0.06878844648599625,
-0.23650920391082764,
-0.49100348353385925,
-0.02626046910881996,
0.8284159302711487,
-0.4697442352771759,
0.5258222818374... | |
open the same serial port again next time. Does anyone have any idea of how to achieve this?
I have seen some forum said that Thread.Abort() is dangerous to use. It should only be used in last resort.
Thanks for any helps.
Charles
Generally, you design the method that is run in the background thread to listen for c... | [
0.535293698310852,
-0.06842080503702164,
0.33244019746780396,
0.0851731076836586,
0.3130277693271637,
-0.16403716802597046,
0.3998313844203949,
-0.06114974245429039,
-0.5468006134033203,
-0.25928035378456116,
-0.20313695073127747,
0.5301960110664368,
-0.7618345022201538,
0.4496100544929504... | |
= true;}}
public bool IsCancelPending{get{lock(syncObj){return cancelled;}}}
}
public void RunListener(object status)
{
var threadStatus = (ThreadStatus)status;
var listener = new SerialPort("COM1");
listener.Open();
//this will loop until we cancel it, the port closes,
//or DoSomethingWithData ... | [
0.3666575849056244,
-0.06814651191234589,
0.669738233089447,
-0.2635749280452728,
0.41523802280426025,
0.020242825150489807,
0.69368976354599,
-0.39295533299446106,
-0.34735673666000366,
-0.5208627581596375,
-0.1648818850517273,
0.6283120512962341,
-0.4006495177745819,
0.6179293394088745,
... | |
new ThreadStatus();
backgroundThread.Start(status);
...
//when you need to get out...
//signal the thread to stop looping
status.Cancel();
//and block this thread until the background thread ends normally.
backgroundThread.Join()
``` | [
0.1795257180929184,
-0.3787965476512909,
0.6274899840354919,
-0.25602445006370544,
0.5549526214599609,
-0.11738339811563492,
0.3672108054161072,
0.11407722532749176,
-0.688729465007782,
-0.513059139251709,
-0.4604847729206085,
0.19348110258579254,
-0.6051543354988098,
0.6571276187896729,
... | |
I've got a div with a huge amount of child divs (around 4k-5k!). Each child has a `'mousedown'` and `'mouseup'` event attached to it.
Should I instead attach these events once to the parent and select the child using `$(e.target)`? Would there be any performance advantage, and if so why?
I would imagine that using [jq... | [
0.49184566736221313,
-0.2838953137397766,
0.2475273609161377,
0.04120979830622673,
0.2802108824253082,
0.3161553740501404,
0.09476518630981445,
-0.0652068555355072,
0.14758145809173584,
-0.6740970611572266,
-0.0008498392417095602,
0.2463170886039734,
0.12884196639060974,
0.1824663132429123... | |
function()
{
alert("Booya!");
});
```
Where your html might look like:
```
<body>
<!-- lots of other elements -->
<div id="divWithHugeAmountsOfChildDiv">
<!-- lots of different type of elements -->
<div class="childCLASSEStoMouseDown">Booya?</div>
<!-- lots of different type of elements -->
</div... | [
-0.05661139264702797,
-0.3713326156139374,
0.2654917240142822,
-0.12003178894519806,
0.04006011784076691,
0.055744245648384094,
0.16490189731121063,
-0.2096002697944641,
-0.1555437594652176,
-0.6389179229736328,
-0.3496343493461609,
0.3789469003677368,
-0.35633113980293274,
-0.100460268557... | |
jQuery documentation for the `On` method. | [
-0.04273052513599396,
-0.03634853661060333,
0.20122407376766205,
0.1010294035077095,
0.07496040314435959,
-0.24276931583881378,
-0.303308367729187,
0.060278329998254776,
-0.10155020654201508,
-0.3709419071674347,
-0.3668198883533478,
0.361659437417984,
0.23252274096012115,
-0.2503408789634... | |
I'm using an ObjectDataSource to bind an object to a GridView. In the OnRowDataBound event handler I'm trying to determine if a certain button should be visible or not. When the runtime encounters this statement it fires an "No default member found for type 'Pledge'." error:
```
lbDel.Visible = Not (e.Row.DataItem("Bi... | [
0.6445910334587097,
-0.3557541072368622,
0.5001368522644043,
-0.1700323522090912,
-0.027583742514252663,
-0.10473965108394623,
0.4086533486843109,
-0.6059260964393616,
0.05627749115228653,
-0.7010974884033203,
-0.07389254868030548,
0.5609625577926636,
-0.28440603613853455,
0.05854225903749... | |
}
public int Add(Pledge pledge)
{
return List.Add(pledge);
}
}
```
My Pledge class:
```
public class Pledge
{
public int PledgeID { get; set; }
public int EventID { get; set; }
public int SponsorID { get; set; }
public int StudentID { get; set; }
public decimal Amount { get; ... | [
0.7886532545089722,
-0.030433274805545807,
0.25217142701148987,
-0.22979764640331268,
0.03368105739355087,
-0.15198053419589996,
0.33104461431503296,
-0.5909084677696228,
0.2761569917201996,
-0.39711031317710876,
-0.32067182660102844,
0.4892836809158325,
0.0070238239131867886,
-0.039248030... | |
public string EventName { get; set; }
public DateTime EventDate { get; set; }
public bool BillingReady { get; set; }
public string SponsorName { get; set; }
public int Grade_level { get; set; }
public string StudentName { get; set; }
public string NickName { get; set; }
public int Laps { get... | [
0.4971354603767395,
-0.09846305847167969,
0.515625536441803,
-0.012418062426149845,
0.27299538254737854,
-0.1171722412109375,
0.31446319818496704,
-0.1265057921409607,
0.35473528504371643,
-0.11777493357658386,
-0.2293839007616043,
0.6690890192985535,
0.2951391041278839,
0.0024293314199894... | |
GridViewRowEventArgs)
If (e.Row.RowType = DataControlRowType.DataRow) And _
Not ((e.Row.RowState = DataControlRowState.Edit) Or ((e.Row.RowState = DataControlRowState.Alternate) And (e.Row.RowState = DataControlRowState.Edit))) Then
Dim lbDel As LinkButton
Dim lbEd As LinkButton
lbDel ... | [
0.01139831729233265,
-0.5291801691055298,
0.7830466628074646,
-0.20911702513694763,
-0.04783936217427254,
0.19130977988243103,
0.0862540453672409,
-0.38572707772254944,
-0.001343535608612001,
-0.8049952387809753,
-0.3902621269226074,
0.5605221390724182,
-0.35535645484924316,
0.093194596469... | |
= Not (e.Row.DataItem("BillingReady")) '<-- Problem happens here
lbEd.Visible = Not (e.Row.DataItem("BillingReady"))
End If
End If
End Sub
```
Yes, I'm having to mix VB and C# but I don't think that's the problem. If I understand the C# equivalent of a VB Default Property is called an index... | [
0.6084703207015991,
-0.08443981409072876,
0.722675085067749,
-0.12620434165000916,
0.10175473988056183,
-0.2628902494907379,
0.2621680498123169,
-0.7033962607383728,
0.175945445895195,
-0.3067711293697357,
-0.14376387000083923,
0.8058046698570251,
-0.3982319235801697,
0.26463061571121216,
... | |
`Pledge`:
```
Dim pledge = DirectCast(e.Row.DataItem, Pledge)
lbDel.Visible = Not pledge.BillingReady
``` | [
0.7115528583526611,
-0.000591786636505276,
0.30845388770103455,
0.013302246108651161,
-0.11917154490947723,
-0.25862082839012146,
0.28569647669792175,
-0.32810741662979126,
-0.017570149153470993,
-0.34080493450164795,
-0.2532653212547302,
0.48796865344047546,
-0.22528496384620667,
0.006900... | |
Ok, so I'm interested in message queueing. I really did loads of research on this subject already. I read 'programming windows azure' (about Azure Queues), I read loads of tutorials and information about the Azure service bus, I watched channel 9 videos on messaging patterns, etc.
But what I just don't understand: how... | [
0.5616436004638672,
-0.20163819193840027,
-0.10797198861837387,
0.3434266149997711,
-0.20370908081531525,
-0.06575819849967957,
0.004616627003997564,
0.4308454394340515,
-0.5155884027481079,
-0.4335240125656128,
0.3294992744922638,
0.36168816685676575,
-0.18989942967891693,
0.1283559352159... | |
instance: I could try to save a Customer, an Order and an Address to the database, so I put these 3 objects in a queue to read the on the other side a put them in my database. How do I know what to do with these kind of objects?
Just some questions I have:
1. What kind of data would one put in a queue. A command mayb... | [
0.20735278725624084,
0.15062150359153748,
-0.2246895730495453,
0.07844660431146622,
-0.20362399518489838,
0.46676769852638245,
0.05682264268398285,
-0.18904057145118713,
-0.4847823679447174,
-0.6526011228561401,
0.37800025939941406,
0.3948523998260498,
-0.6011281609535217,
0.01252862531691... | |
thinking about putting stuff in the queue in the service layer (after it has been validated) and reading it in the data access layer so I can put it in the database.
3. How many queues should one make? Just one queue between the layers you want to connect, or multiple queues between them (maybe for different purposes, ... | [
0.6460726261138916,
-0.22264759242534637,
0.34765520691871643,
0.33123287558555603,
-0.08671315014362335,
-0.3211893141269684,
-0.02071399800479412,
-0.09944502264261246,
-0.3657478094100952,
-0.46664226055145264,
0.2778905928134918,
0.33716675639152527,
-0.33439236879348755,
0.02566705457... | |
writing it? Then the database should be online. And should I read data through a queue or could my service layer just pull the data from the data access layer and pass it to the presentation layer?
I think that were most of the questions that were buzzing around in my head. I hope anyone can clear this up for me.
1. W... | [
0.6695016026496887,
-0.06086982786655426,
0.16635873913764954,
0.1373022198677063,
-0.17419205605983734,
-0.2600526511669159,
-0.17935089766979218,
0.22048518061637878,
-0.14728154242038727,
-0.5170057415962219,
0.2021089792251587,
0.35175999999046326,
-0.16190055012702942,
-0.257097095251... | |
I wouldn't necessarily think about queuing between layers, so much as queueing between user-facing, realtime processes (eg, web servers) and background processing. Use queueing to do things that you don't want your web roles taking the time to do while a user is waiting.
3. You can make as many as you want, really. If ... | [
0.5963078737258911,
-0.2559431195259094,
0.5428497791290283,
0.19259098172187805,
-0.020029237493872643,
0.3472059369087219,
-0.22077281773090363,
0.05530731752514839,
-0.6068425178527832,
-0.4690820276737213,
0.21976442635059357,
0.2590862214565277,
-0.30394819378852844,
-0.12531539797782... | |
etc.
4. I would definitely not use a queue as data storage and retrieval. It's just the wrong tool for that job, like trying to use TCP to store data.
Note that a single worker instance (ie, VM) can read as many queues as you would like it to. You just have to write the code that way. If you have a lot of queues that ... | [
0.5053521990776062,
0.09580736607313156,
0.18915955722332,
0.10998840630054474,
-0.06535724550485611,
-0.08291025459766388,
-0.04870020970702171,
0.11366642266511917,
-0.6123720407485962,
-0.6223830580711365,
0.22910982370376587,
0.44505399465560913,
-0.4752066433429718,
0.0672875121235847... | |
you can have many workers reading from the same queue, in order to spread the work out over them evenly. | [
0.8522643446922302,
-0.05080872401595116,
0.07519753277301788,
0.099215567111969,
-0.049236223101615906,
0.13863298296928406,
-0.37485289573669434,
0.23769360780715942,
-0.3955831527709961,
-0.6557587385177612,
0.04440512880682945,
0.2696790099143982,
0.07675115764141083,
0.119831360876560... | |
This entry appears to be about 80% of what I want to do but nothing I've come up with is working: [bash: how to delete elements from an array based on a pattern](https://stackoverflow.com/questions/3578584/bash-how-to-delete-elements-from-an-array-based-on-a-pattern)
I have two arrays:
```
@tapes_in_drives=(SP1026,SP... | [
0.3091980516910553,
0.10002060979604721,
0.3012947142124176,
0.07338076829910278,
0.09948990494012833,
0.06453622132539749,
0.18310019373893738,
-0.40844133496284485,
-0.567882776260376,
-0.7147805094718933,
0.28534790873527527,
0.5740272998809814,
-0.36157599091529846,
0.08271606266498566... | |
I wrote this in Perl originally, hence the @variable definitions and I was super tired when I wrote this question.
**CODE:**
```
#!/usr/bin/bash
# If media expires less than this many days, keep it
export days_expired="30"
# Set to 1 to get debug output to console
export debug="1"
# Get list of SPxxxxx tapes that ... | [
0.2777051031589508,
-0.21567727625370026,
0.7881508469581604,
-0.04304993525147438,
0.2899307310581207,
-0.23358674347400665,
0.28782781958580017,
-0.5702661871910095,
-0.2876250147819519,
-0.5215239524841309,
-0.2766120433807373,
0.7893014550209045,
-0.4223259389400482,
0.1305671632289886... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.