text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
is based on XUL (<http://en.wikipedia.org/wiki/XUL>). You can use a program called XULRunner to create similar applications. | [
0.22546370327472687,
0.0324321985244751,
0.5489645004272461,
0.18622396886348724,
-0.3839889168739319,
-0.2383800894021988,
-0.2778427004814148,
0.3449302911758423,
-0.07062589377164841,
-0.3747332692146301,
-0.0037308973260223866,
0.11766424030065536,
-0.05152564495801926,
0.2731953859329... | |
We have a web service that we will be hosting on a public web server and it will be contacted by web services hosted on web servers within the walls of a hospital. We have written both pieces of the software so we have complete control over what is implemented.
We would like to secure communications between the two we... | [
0.753818154335022,
0.14644195139408112,
0.5419877767562866,
0.24998025596141815,
0.20823517441749573,
-0.15963326394557953,
0.21192567050457,
0.004669894464313984,
0.15290790796279907,
-0.6436043977737427,
0.22807000577449799,
0.3858208954334259,
-0.0864638164639473,
0.16086390614509583,
... | |
all of our customers (hospitals) will be able to do the same thing. Some will not have the ability to give us a static IP and some will not be able to do a VPN, so we cant solely rely on those methods.
*What techniques are you using or do you recommend to authorize communications to your web services?* Our main concer... | [
0.5025116205215454,
0.18099282681941986,
0.599291980266571,
0.22231511771678925,
0.15854908525943756,
-0.3995416462421417,
0.15601608157157898,
0.053918398916721344,
-0.34314629435539246,
-0.4931737184524536,
0.20128829777240753,
0.33894675970077515,
-0.03414266183972359,
0.283181697130203... | |
system but I feel a software solution is necessary as well.
The system is not yet in production but is nearing the completion of development. Its developed in C# on .net 3.5
FWIW I was thinking of some sort of token based authorization because I know a previous employer used something along those lines. However, I do... | [
0.670903742313385,
0.014539321884512901,
0.6149364709854126,
0.018515342846512794,
0.3943272829055786,
-0.22072939574718475,
0.19432489573955536,
-0.1304413229227066,
-0.1529027223587036,
-0.5906122922897339,
0.04828707501292229,
0.5167247653007507,
-0.19845175743103027,
0.1272076964378357... | |
that interacts with them. All of the web references where added using the .net 2.0 method (from vs.net08, targeted to .net 3.5) and we would prefer to not completely redo that. I wont say that WCF is not an option, but I don't think we will go with that option willingly.
Their UI is based on XUL (<http://en.wikipedia.o... | [
0.33294478058815,
0.023930789902806282,
0.6200537085533142,
0.10149835050106049,
-0.5341811180114746,
-0.19752052426338196,
0.015543251298367977,
0.20727838575839996,
-0.17411234974861145,
-0.8741787672042847,
0.17399005591869354,
0.22749626636505127,
-0.2345728725194931,
0.243045240640640... | |
[This](https://web.archive.org/web/20130307101732/http://geekswithblogs.net:80/AzamSharp/archive/2007/12/11/117590.aspx) blogpost and one of our senior developers at work believe that web development has come full circle with ASP.net MVC. Its not really a question about VB script vs VB9/10 or whatever is the latest. Be... | [
0.11485186964273453,
-0.436461478471756,
0.7223705649375916,
0.012638055719435215,
-0.4089348614215851,
-0.12108337134122849,
0.06525842100381851,
-0.21058736741542816,
-0.46137702465057373,
-0.5199837684631348,
-0.42245620489120483,
0.364522784948349,
-0.2102736234664917,
0.26574760675430... | |
from ASP. | [
-0.2461981475353241,
0.011153468862175941,
-0.2830219566822052,
-0.33853378891944885,
-0.005790377035737038,
0.26223787665367126,
0.07834408432245255,
-0.05424168333411217,
-0.5101197957992554,
-0.3122643530368805,
-0.22857466340065002,
0.21405872702598572,
0.06592486053705215,
-0.13034927... | |
Im breaking my head against the table right now. I have a flash batch uploader, which puts every file through upload.php which thumbnails the images, and moves them to appropriate directories. When I upload in IE, it functions perfectly (never thought I'd say this), but in Firefox, when flash executes upload.php it has... | [
0.3280445635318756,
0.3727704584598541,
0.41552695631980896,
-0.286275178194046,
-0.4185791611671448,
-0.16286106407642365,
0.26811838150024414,
0.0904724970459938,
-0.03738166764378548,
-0.7862465977668762,
0.1072765365242958,
0.6518478989601135,
-0.2680632174015045,
0.004600616171956062,... | |
this:
```
$_SESSION["uploaded_ids"][] = $inserted_id;
```
Overwrites the entire array with just the last ID, since it cannot read it to append it.
What can I do? the uploader in question is this:
[MultiPowUpload](http://www.element-it.com/MultiPowUpload.aspx)
If the php file is being executed via some form of aja... | [
0.11408806592226028,
0.01696726679801941,
0.29512733221054077,
-0.10605045408010483,
-0.23225831985473633,
-0.29418081045150757,
0.5632483959197998,
-0.17084066569805145,
-0.23680970072746277,
-0.5908827781677246,
-0.04799928516149521,
0.6341394782066345,
-0.3537427484989166,
-0.0454400330... | |
I need to select the rows of a table where a column value is numeric, any Help?
EDIT: I have a varchar column and I need to select the ones that are numbers and the ones that are not.
EDIT 2: Integer.TryParse cannot be use because it cannot be translate to SQL.
I don't know if there is a mapping for int.TryParse() in... | [
-0.06575176864862442,
0.2612900137901306,
0.47333964705467224,
-0.20505769550800323,
0.024619629606604576,
0.18737752735614777,
0.38859957456588745,
-0.45247015357017517,
-0.04909844696521759,
-0.6173444390296936,
0.0730709433555603,
0.5348007678985596,
-0.3995346426963806,
-0.012259834446... | |
);
```
You might want to look at [Dynamic LINQ](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx), too. That would allow you to do something like:
```
var query = context.Table.Where( "IsNumeric(Column)" );
```
**EDIT** Dynamic LINQ is available in the... | [
-0.13906027376651764,
-0.19481545686721802,
0.3425215482711792,
0.0410759411752224,
-0.05367371439933777,
-0.06793154031038284,
-0.0365048311650753,
-0.05277125909924507,
-0.45057323575019836,
-0.13903497159481049,
-0.1688506305217743,
0.3437986671924591,
-0.4680953621864319,
-0.1504470854... | |
**What size, in pixels, should a custom Firefox toolbar button icon be?**
I've seen quite a variety. Most commonly I've come across 32x32, 24x24 and 16x16 but also 10x10, 15x15, 16x14, etc. I cannot find a definitive reference.
Also see: [How big should an Internet Explorer icon be?](https://stackoverflow.com/questio... | [
0.1883062720298767,
0.04823888838291168,
0.5065915584564209,
-0.16034477949142456,
-0.00201281625777483,
0.30788782238960266,
0.043745141476392746,
-0.18983733654022217,
-0.6967839598655701,
-0.721846878528595,
-0.02829737961292267,
0.3225937485694885,
-0.44617539644241333,
-0.115777559578... | |
I have a visual brush which is a group of shapes, the main colour of which is a dynamic resource itself - so the shape is for example MyShape and the Colour, MyColour which is referenced by the Shape object.
My problem is when I update the colour for this - it only happens the first time the shape is loaded (the col... | [
0.5795050263404846,
-0.010305625386536121,
0.44624072313308716,
-0.04589591547846794,
-0.2862982153892517,
0.25054484605789185,
0.07731323689222336,
-0.23468302190303802,
-0.08130902051925659,
-0.7949926257133484,
0.3948230743408203,
0.5096017122268677,
-0.07892860472202301,
-0.01322173327... | |
dynamic resource work within another dynamic resource and have them both update when I change the colour.
I have no idea how to get this to work - I spent time creating a colour-picker for WPF only to find I cannot change the colour of this item - 1-Tier resources work where I set the brush/colour directly but not a... | [
0.03000161051750183,
-0.4593432545661926,
0.28957444429397583,
0.0712369978427887,
-0.1416030377149582,
0.35473671555519104,
0.16593776643276215,
-0.23237605392932892,
-0.44615107774734497,
-0.7711856365203857,
0.11734264343976974,
0.5502206683158875,
-0.3525298237800598,
0.012340130284428... | |
mentioned does not work when the MyColor is in a seperate Resource.
Unless I misunderstand the situation, exactly what you're talking about works pretty well. I just tried it out with this Xaml:
```
<Window x:Class="ConditionalTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmln... | [
0.11527161300182343,
-0.08416041731834412,
0.6914998292922974,
-0.07331813871860504,
-0.10217030346393585,
0.06128479540348053,
-0.07599326968193054,
-0.38774850964546204,
0.11423201858997345,
-0.4921649098396301,
0.29204127192497253,
0.3367469906806946,
-0.10890135169029236,
0.04286814853... | |
Width="100" Fill="{DynamicResource MyColor}" />
</VisualBrush.Visual>
</VisualBrush>
</Window.Resources>
<Grid Background="{DynamicResource MyBrush}">
<Button Height="30" Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" Content="ChangeColor" Click="Button_Click" /... | [
-0.27883440256118774,
-0.4485121965408325,
0.724746584892273,
0.09121626615524292,
-0.37225770950317383,
0.2450786978006363,
-0.0010163806146010756,
-0.25980105996131897,
-0.021446922793984413,
-0.45556339621543884,
0.43185439705848694,
0.6187795996665955,
0.01828441023826599,
-0.030566351... | |
The question was about plain [c](/questions/tagged/c "show questions tagged 'c'") functions, not [c++](/questions/tagged/c%2b%2b "show questions tagged 'c++'") `static` methods, as clarified in comments.
I understand what a `static` variable is, but what is a `static` function?
And why is it that if I declare a funct... | [
0.38136690855026245,
0.1309114545583725,
-0.03282659873366356,
-0.11479794234037399,
-0.40383970737457275,
-0.07013458013534546,
0.28237277269363403,
-0.2775734066963196,
-0.15426230430603027,
0.11455371975898743,
-0.12612828612327576,
0.6400153636932373,
-0.3563055396080017,
-0.1772830635... | |
to temporarily clear space in `main.c` until I have a better idea of how to group all those functions into proper `.h` and `.c` files. Just a temporary, quick solution.
`static` functions are functions that are only visible to other functions in the same file (more precisely *the same [translation unit](http://en.wikip... | [
-0.05621286854147911,
0.01676855981349945,
0.5130167603492737,
-0.007481462322175503,
0.09463378041982651,
-0.10744168609380722,
0.22144074738025665,
0.29278305172920227,
-0.24786776304244995,
-0.26996010541915894,
-0.6319727301597595,
0.2745493948459625,
-0.3800819516181946,
0.34563323855... | |
I'm currently using Lighttpd on a VPS. Before that it was nginx, but I came back to Lighttpd because I needed CGI.
Apache's HTTPD is mainstream. All documentations include examples for Apache and most modules are only available for Apache.
Is the effort to use something different from Apache really worth it?
I wouldn... | [
0.31443819403648376,
-0.11516623198986053,
0.532469630241394,
-0.02994638681411743,
-0.6170333623886108,
-0.5063657164573669,
-0.022542256861925125,
-0.03336326405405998,
-0.35757124423980713,
-0.6540621519088745,
-0.1729268580675125,
0.2995501160621643,
-0.5313647389411926,
0.161884769797... | |
languages.
You should consider the functionality you need and pick a server which offers those, possibly the one which uses less resources which most likely won't be Apache. | [
0.32941752672195435,
0.0035508538130670786,
-0.013789725489914417,
0.17582820355892181,
0.1611589640378952,
0.1677679419517517,
0.532640814781189,
0.6755492687225342,
-0.3299567997455597,
-0.5965675115585327,
-0.2199837863445282,
0.5161003470420837,
-0.2529065012931824,
-0.4026792943477630... | |
I'm building a decent sized application in ASP.NET/VB.NET with various objects... I've never used interfaces before, and a fellow programmer balked when I mentioned this to him. Can anyone give me a quick overview on how they're used, what they're used for, and why I would use them? Maybe I don't need to use them for t... | [
0.5313602685928345,
0.23383308947086334,
0.08144441992044449,
0.31144648790359497,
-0.07601886987686157,
-0.18977229297161102,
0.014926676638424397,
0.3713435232639313,
-0.3735990524291992,
-0.9597350358963013,
0.34065544605255127,
0.37928521633148193,
0.005929053295403719,
0.2335498780012... | |
This allows you generalize functions for any class which implements a particular interface (i.e. classes which have the same methods), even if those classes don't necessarily descend from one another.
```
Module Module1
Interface ILifeform
ReadOnly Property Name() As String
Sub Speak()
Sub... | [
0.16560351848602295,
-0.18131904304027557,
0.4038301706314087,
-0.2097165435552597,
-0.21832114458084106,
-0.06880809366703033,
0.20960268378257751,
-0.5630673170089722,
0.06165958568453789,
-0.6491196155548096,
-0.17816385626792908,
0.8150131702423096,
-0.6118495464324951,
-0.094515457749... | |
Get
Return "Doggy!"
End Get
End Property
Public Sub Speak() Implements ILifeform.Speak
Console.WriteLine("Woof!")
End Sub
Public Sub Eat() Implements ILifeform.Eat | [
-0.06800805777311325,
-0.039639364928007126,
0.44382786750793457,
-0.17145127058029175,
0.06421952694654465,
0.03837602585554123,
0.4168983995914459,
-0.4304671883583069,
-0.024487750604748726,
-0.450697124004364,
-0.526513934135437,
0.5734151005744934,
-0.11907794326543808,
0.083834983408... | |
Console.WriteLine("Yum, doggy biscuits!")
End Sub
End Class
Class Ninja
Implements ILifeform
Public ReadOnly Property Name() As String Implements ILifeform.Name
Get
Return "Ninja!!"
End Get | [
-0.1421189159154892,
-0.3148215413093567,
0.04053962603211403,
0.19583766162395477,
0.23059304058551788,
-0.2013673335313797,
0.40395864844322205,
-0.4007391035556793,
0.11123993247747421,
-0.5583224296569824,
-0.27545228600502014,
0.5783206224441528,
0.11994273215532303,
0.187331825494766... | |
End Property
Public Sub Speak() Implements ILifeform.Speak
Console.WriteLine("Ninjas are silent, deadly killers")
End Sub
Public Sub Eat() Implements ILifeform.Eat
Console.WriteLine("Ninjas don't eat, they wail on guitars and kick ass")
End Sub
End Class
... | [
0.16633102297782898,
0.07116367667913437,
-0.20251229405403137,
0.043642204254865646,
-0.1699637472629547,
0.29284802079200745,
0.7273310422897339,
-0.31144461035728455,
-0.20200170576572418,
-0.2546895146369934,
-0.1865483820438385,
0.5689529180526733,
0.0779932513833046,
0.14187799394130... | |
Implements ILifeform
Public ReadOnly Property Name() As String Implements ILifeform.Name
Get
Return "Monkey!!!"
End Get
End Property
Public Sub Speak() Implements ILifeform.Speak
Console.WriteLine("Ook ook") | [
-0.20592240989208221,
0.07521677017211914,
0.1998402178287506,
-0.13811105489730835,
-0.1914369761943817,
0.1659102886915207,
0.3827057480812073,
-0.31445178389549255,
0.20536090433597565,
-0.4141876995563507,
-0.42416077852249146,
0.35953566431999207,
-0.2639614939689636,
0.10511247068643... | |
End Sub
Public Sub Eat() Implements ILifeform.Eat
Console.WriteLine("Bananas!")
End Sub
End Class
Sub Main()
Dim lifeforms As ILifeform() = New ILifeform() {New Dog(), New Ninja(), New Monkey()}
For Each x As ILifeform In lifeforms
HandleLifeform(x)
... | [
-0.03153914213180542,
-0.46210065484046936,
0.5358508229255676,
0.05312669277191162,
0.08491893112659454,
0.1571555882692337,
0.4734971523284912,
-0.23590944707393646,
-0.03772180154919624,
-0.5647174119949341,
-0.13539092242717743,
0.41223573684692383,
-0.35303637385368347,
0.108797185122... | |
Console.ReadKey(True)
End Sub
Sub HandleLifeform(ByVal x As ILifeform)
Console.WriteLine("Handling lifeform '{0}'", x.Name)
x.Speak()
x.Eat()
Console.WriteLine()
End Sub
End Module
```
None of the classes above descend from one another, but my HandleLifeform method is gene... | [
-0.18167847394943237,
0.018061267212033272,
0.731802225112915,
-0.21224798262119293,
-0.06678938120603561,
0.047461897134780884,
0.14658494293689728,
-0.15777498483657837,
0.4178823232650757,
-0.7103378772735596,
-0.1208362802863121,
0.6312001943588257,
-0.2601092457771301,
0.0977954566478... | |
I am writing an app to discover what features exist on a pc. The user would go to a web page, download the app and execute it (with all the appropriate warnings, this is not spyware). The app would use the standard MS api to determine such things as connection speed, installed memory, firewall health, etc. Writing the ... | [
0.4459753632545471,
0.22127972543239594,
0.5964915752410889,
-0.04900548979640007,
-0.14225122332572937,
0.09841105341911316,
0.25420403480529785,
0.1927785575389862,
-0.16627684235572815,
-0.7134885191917419,
-0.13619567453861237,
0.689044177532196,
-0.2920452356338501,
-0.100273922085762... | |
and Vista.
Thanks for the help.
Vista does have .NET 3.0 installed. XP SP2 doesn't have any .NET framework installed by default. | [
0.16114570200443268,
-0.06797028332948685,
0.36370906233787537,
0.09609320759773254,
-0.3195759356021881,
-0.3439430892467499,
0.2720315754413605,
-0.006601445842534304,
-0.2981128394603729,
-0.7087920904159546,
-0.16658398509025574,
0.6329600811004639,
-0.3792232871055603,
-0.222205877304... | |
I am having a problem with logging to output from an automated build.
The build is done with a Makefile and the makefile utility.
The problem is that normal output like compiler command lines go to stdout and compile errors go to stderr.
I want to get the output from the build as it would show on the screen. So some... | [
0.6982948780059814,
0.23912352323532104,
-0.10136448591947556,
-0.24493315815925598,
-0.03548154607415199,
0.12893055379390717,
0.6433236002922058,
-0.20602160692214966,
-0.04272284731268883,
-0.602936327457428,
-0.06862369179725647,
0.4621028006076813,
-0.3716259300708771,
0.1307416558265... | |
buffered and so the result in the log file is all mixed up.
I could capture the output into 2 separate log files but then I would have no info on how to glue them back together into a single log file.
Is there a way to turn off buffering for stdout and stderr in this case?
```
make -k > build.log 2>&1
```
This shou... | [
0.23827826976776123,
0.09719344228506088,
0.44799917936325073,
-0.06515729427337646,
-0.2936857044696808,
0.3026006519794464,
0.08570224046707153,
-0.21042072772979736,
-0.33537256717681885,
-0.6028528213500977,
0.06758416444063187,
0.5389494895935059,
-0.5556707978248596,
0.14288809895515... | |
console:
```
make -k 2>&1 | tee build.log
``` | [
-0.057679545134305954,
0.1894311159849167,
0.12571655213832855,
-0.1776803582906723,
0.3040396571159363,
-0.09077256172895432,
0.060973159968853,
-0.10540901869535446,
0.32686710357666016,
-0.767460823059082,
-0.2759146988391876,
0.581767201423645,
-0.21316468715667725,
0.1197858601808548,... | |
So I have an address table that is shared among various other tables, such as schools, parks, churches, etc. Schools, parks, etc all foreign key to a row in address.
What I'm wondering is, if I have a specific row in the address table, is there a way to find out which row in which table points to it. So basically jus... | [
0.5632293820381165,
0.32908838987350464,
-0.03479798883199692,
0.3691522777080536,
0.3045434355735779,
-0.053972601890563965,
-0.10232950747013092,
0.1278252750635147,
-0.32540687918663025,
-0.7366160154342651,
0.014563721604645252,
0.005486923269927502,
-0.023036150261759758,
0.3389576077... | |
of 10 other tables...
You're going to have to query each of the other tables.
I would do it as a UNION query:
```
SELECT id, "schools" as whichTable from schools where address_id=1
UNION
SELECT id, "parks" as whichTable from parks where address_id=1
UNION
...
```
so that you only have to run one query and... | [
0.31700000166893005,
0.14082783460617065,
0.2947710454463959,
0.28884291648864746,
0.12085609883069992,
0.3673154413700104,
-0.30379387736320496,
-0.10307703167200089,
-0.32118186354637146,
-0.7253468632698059,
-0.03196541219949722,
-0.09804560989141464,
-0.35972195863723755,
0.37714082002... | |
I was talking to someone today about picking a design pattern for how to handle logic in their WPF program and hoping that the SO community can help with further advice to make the decision easier. **What factors in favour of commands outweigh the inconvenience?**
I prepared a full [sample](http://www.aussiedesignedso... | [
0.18769070506095886,
-0.3085278272628784,
0.16505154967308044,
0.008837760426104069,
-0.1970137655735016,
0.21076424419879913,
0.24049045145511627,
-0.7036144137382507,
-0.15547296404838562,
-0.5737884044647217,
-0.10756829380989075,
0.4970448315143585,
-0.21038149297237396,
-0.47971639037... | |
simple Click event handlers as the natural way to connect logic to UI objects.
He was a bit stunned by the amount of overhead required to use commands with both the command being created in the code behind file:
```
public static readonly ICommand cmdShow2 = new RoutedUICommand(
"Show Window2", "cmdShow2",
typeo... | [
-0.2698216438293457,
-0.3564307987689972,
0.2406376600265503,
0.12875813245773315,
-0.2307218611240387,
-0.2385457456111908,
0.04823886230587959,
-0.42908892035484314,
-0.19151704013347626,
-0.3029235601425171,
-0.19042938947677612,
0.6638869643211365,
-0.46608766913414,
-0.129518672823905... | |
</Window.CommandBindings>
<DockPanel>
<StackPanel Margin="0,8,0,0">
<Button x:Name="Show2EventBased"
Margin="10,2,10,2"
Click="OnShow2"
Content="Show2 via WPF Event"/>
<Button x:Name="Show2Command" | [
-0.029000991955399513,
-0.24662800133228302,
0.589846134185791,
-0.21044962108135223,
-0.1483067274093628,
0.029319914057850838,
0.03773342818021774,
-0.18167923390865326,
-0.33389776945114136,
-0.5041295289993286,
-0.17206794023513794,
0.2549477517604828,
-0.13861502707004547,
0.006571881... | |
Command="{x:Static w:TestDespatchWindow.cmdShow2}"
Margin="10,2,10,2"
Content="Show2 via WPF"/>
</StackPanel>
</DockPanel>
</Window>
```
I can't (yet) claim to be a WPF expert so I may have painted things as more complex than they really are but my suspicion is that ... | [
0.4140409827232361,
-0.08547220379114151,
0.27178817987442017,
-0.03510865196585655,
0.07439196109771729,
-0.061336345970630646,
0.37769249081611633,
-0.03562188893556595,
-0.346942275762558,
-0.5889832973480225,
-0.026958629488945007,
0.5484846234321594,
-0.04391105845570564,
-0.235018640... | |
can't simplify things much more than the above.
**Edit:**
I found an interesting [3-way comparison](http://mikestedman.blogspot.com/2008/11/delegatecommand-vs-routedcommand-vs.html) between DelegateCommand, RoutedCommand and Event.
Commands their advantages and disadvantages, you have to choose based on your situatio... | [
0.2263643592596054,
-0.3471985161304474,
0.31157103180885315,
0.2756756544113159,
-0.21497003734111786,
-0.12271901965141296,
0.4240207374095917,
-0.3410055339336395,
-0.073111392557621,
-0.7134978175163269,
-0.11202109605073929,
0.6916932463645935,
-0.14593130350112915,
-0.013624729588627... | |
lines event handler into some impossible to follow monstrosity involving changing 4 separate places in the application ([How should the ViewModel close the form?](https://stackoverflow.com/questions/501886) ). | [
0.0767364427447319,
-0.44798198342323303,
0.7669732570648193,
0.18943871557712555,
0.1872483491897583,
-0.02160950005054474,
0.25785031914711,
-0.18654228746891022,
-0.3619938790798187,
-0.07668223232030869,
-0.3590141832828522,
-0.04147707670927048,
-0.35032790899276733,
0.111463598906993... | |
I am trying to debug a small operating system I have written in an university course in C++. At runtime somewhere one of my objects is getting corrupted. It seems like this happens due to accidentally writing to the wrong memory address. As I am unable to find the place where this happens from pure looking at the code,... | [
0.11145424097776413,
0.2943499684333801,
-0.17742764949798584,
0.00081361219054088,
-0.019139941781759262,
-0.25104907155036926,
0.45793417096138,
0.18729200959205627,
0.05241706222295761,
-0.6404820680618286,
0.022805599495768547,
0.45289748907089233,
-0.382150799036026,
0.348834544420242... | |
or more general a specific memory range? I would like to break as soon as write access happens, so I can verify if this is valid or not.
You can put a watchpoint:
```
watch x
```
This will break when `x` is modified. `x` can be any type of variable. If you have:
```
class A;
A x;
```
Then gdb will break whenever ... | [
0.3765411674976349,
0.06145034730434418,
0.18525825440883636,
0.05021273344755173,
0.1387643814086914,
-0.24817563593387604,
0.24972860515117645,
0.04777548462152481,
-0.1871805042028427,
-0.40874072909355164,
-0.24901361763477325,
0.717805027961731,
-0.5586332082748413,
-0.016776468604803... | |
leads to awful performance. For example, if `A` above is a class with many members then gdb **can** watch the entire instance `x`, but the way it'll work is:
* execute an instruction
* jump to the debug breakpoint
* check if `x` has changed
* return to the program
Naturally, this is **very** slow. If `x` is an `int` ... | [
0.28605660796165466,
-0.08456338942050934,
0.002037567552179098,
0.0461907833814621,
-0.03813967853784561,
-0.2773576080799103,
0.43671301007270813,
-0.1260519027709961,
-0.3404994010925293,
-0.5445968508720398,
-0.012282319366931915,
0.6329405307769775,
-0.4102948009967804,
0.229380533099... | |
How do i parse tokens from an input string.
For example:
```
char *aString = "Hello world".
```
I want the output to be:
> "Hello" "world"
You are going to want to use `strtok` - [here is a good example.](http://www.java2s.com/Code/C/String/Truncatestringbydelimiterhowtousestrtok.htm) | [
-0.12992975115776062,
0.1148422360420227,
-0.10057902336120605,
-0.14285269379615784,
-0.12437872588634491,
0.0739368125796318,
0.29009774327278137,
-0.2664027512073517,
-0.1822555512189865,
-0.39913293719291687,
0.020528558641672134,
0.21844904124736786,
-0.13505585491657257,
-0.084955468... | |
I know how to do this with pure PHP but I need to do this without reloading the page. Is there anyway with jQuery to effectively pull back some database results (based on what a user has input in the first text field on a form) then populate some of the remaining fields with data pulled back from a db query?
Essential... | [
0.4066556394100189,
0.08248190581798553,
0.2761270999908447,
0.14767242968082428,
-0.43654194474220276,
-0.23275728523731232,
-0.1307363510131836,
-0.3136589229106903,
-0.0667065680027008,
-0.2768808901309967,
0.35929036140441895,
0.4935127794742584,
-0.10164649784564972,
0.008957286365330... | |
subsequent fields are then populated w/o a page reload.
I am familiar with the basics of jQuery but I haven't used it to do anything like this in which I am pulling data back from the server and trying to populate it client side.
Any suggestions / examples on how to best get started with this would be very much appre... | [
-0.0038181201089173555,
-0.1121249794960022,
0.49623602628707886,
-0.02287638559937477,
-0.11233742535114288,
-0.20413894951343536,
0.11757296323776245,
-0.2924500107765198,
0.007910924963653088,
-0.7849498391151428,
-0.328998863697052,
0.40701818466186523,
-0.37141621112823486,
0.05895595... | |
$.each(data, function(i,item){
if (item.field == "first_name") {
$("#first_name").val(item.value);
} else if (item.field == "last_name") {
$("#last_name").val(item.value);
}
});
});
});
```
Then just you have a | [
0.07719607651233673,
-0.1337481141090393,
0.5155318379402161,
-0.08214075118303299,
0.3232254385948181,
0.1028301864862442,
0.15731588006019592,
-0.3576519191265106,
-0.23889070749282837,
-0.4994916021823883,
-0.44782471656799316,
0.6805627942085266,
-0.2750508189201355,
0.4037660360336303... | |
PHP script (in this case lookup.php) that takes an email in the query string and returns a JSON formatted array back with the values you want to access. This is the part that actually hits the database to look up the values:
```
<?php
//look up the record based on email and get the firstname and lastname
...
//build ... | [
-0.2976371645927429,
0.06708769500255585,
0.18734972178936005,
-0.18167845904827118,
-0.25676921010017395,
-0.07024293392896652,
0.22890867292881012,
-0.07641912996768951,
-0.026061659678816795,
-0.4873476028442383,
-0.14069536328315735,
0.332633912563324,
-0.2503823935985565,
-0.175246357... | |
array('field' => 'last_name',
'value' => $last_name));
echo json_encode($json );
?>
```
You'll want to do other things like sanitize the email input, etc, but should get you going in the right direction. | [
0.1287897825241089,
-0.04831864684820175,
0.14473792910575867,
-0.30629539489746094,
0.29383766651153564,
-0.185479998588562,
0.5285760164260864,
-0.5219522714614868,
0.03697022795677185,
-0.4980330467224121,
-0.3140072822570801,
0.42105579376220703,
-0.4429756999015808,
-0.091842696070671... | |
I have a large .NET remoting project using the 2.0 framework. The server's API is exposed via interfaces and shared types are contained in an assembly shared with the client application.
I have some methods that accept arrays of a base class that has many different classes inheriting from it.
For example I have base ... | [
0.5818279385566711,
-0.012063579633831978,
0.10646266490221024,
0.056918803602457047,
-0.17233781516551971,
0.06630542129278183,
-0.11865945160388947,
-0.3216077387332916,
-0.1387261152267456,
-0.747842013835907,
0.18522432446479797,
0.5733859539031982,
-0.003234782023355365,
0.19888345897... | |
them won't be able to resolve the new type.
What do you feel is the most flexible way to handle this situation?
EDIT: This is a Windows forms client application and remoting server hosted in a Windows service.
ClickOnce is a good solution.
Or go with a class-agnostic Web Services approach. Pass around versioned, bin... | [
0.23615488409996033,
-0.014706834219396114,
0.16534565389156342,
0.2791743576526642,
-0.2184261828660965,
-0.18475668132305145,
0.26024022698402405,
0.28649649024009705,
-0.3358103334903717,
-0.7713368535041809,
-0.008485407568514347,
0.3013222813606262,
-0.4888553023338318,
0.229946091771... | |
with the Serialization changes in recent versions of .Net) and leads to madness... | [
0.19243885576725006,
0.038880687206983566,
0.7504992485046387,
0.17015492916107178,
0.0027615579310804605,
-0.4578157663345337,
0.7314971685409546,
0.21968314051628113,
-0.1696183979511261,
-0.37334030866622925,
0.08519094437360764,
0.04576078802347183,
-0.44223618507385254,
0.535332024097... | |
I have a table that was doing a fine job of full-text search until last week. There are over seven million records, and I see it has over seven million entries in the full-text index.
But nothing more recent than a week old shows up in the search results. I can see in the table's full-text index properties that there... | [
0.29277676343917847,
0.2871975302696228,
0.5790663957595825,
0.11785778403282166,
0.3834162652492523,
0.061361562460660934,
0.05088207498192787,
0.2403271645307541,
-0.6782630681991577,
-0.5602548122406006,
0.2095956653356552,
0.2509753406047821,
0.1623251885175705,
0.5056598782539368,
0... | |
that started the "ALTER FULLTEXT INDEX" job started blocking all the other requests on the server, so I killed it.
I have confirmed that the Full-Text Indexing service is running and starts automatically. I have also confirmed that it's automatically checking for changes, although turning that from "Automatic" to "Man... | [
0.242819145321846,
-0.01226863730698824,
0.8760231137275696,
0.0013535961043089628,
-0.1407243013381958,
0.04795191064476967,
0.6935932040214539,
0.018950127065181732,
-0.2552178204059601,
-0.6704918742179871,
-0.11032354086637497,
0.6940469741821289,
-0.296038419008255,
0.2157896459102630... | |
successfully" but doesn't seem to have any effect.
The last thing I did today was:
1. disable the full-text index
2. rebuild the clustered index that the FTI is based on
3. re-enable the FTI
This started off an "ALTER FULLTEXT INDEX" job that, again, blocked all processes that were doing actual work.
We are tryin... | [
0.03168696537613869,
-0.06398353725671768,
0.6612711548805237,
-0.03370506688952446,
0.4370461404323578,
-0.14594924449920654,
0.6423702239990234,
-0.33823949098587036,
-0.40081489086151123,
-0.5181862711906433,
-0.5301203727722168,
0.6745932102203369,
-0.1920342743396759,
-0.4276157319545... | |
A has worked in the past.)
Is there a faster way to do any of this? And any idea how I got in this situation in the first place?
That's an interesting problem. You got yourself into it I think because it was disabled. I may have found a way to get you out of it without blocking everything else.
First, know that this ... | [
0.03125351667404175,
-0.025180375203490257,
0.48256659507751465,
0.015456614084541798,
-0.05191074684262276,
-0.15333208441734314,
0.5338159203529358,
-0.20011866092681885,
-0.3520573675632477,
-0.3666379153728485,
0.3372524380683899,
0.7459108829498291,
-0.5053479671478271,
-0.12969152629... | |
run into the same issue as [this](http://www.eggheadcafe.com/software/aspnet/30096293/still-have-stuck-pending.aspx) guy. He just set a job to run every hour or so. Granted, it's a temporary solution but it will give you time until you can actually rebuild the index.
Something else that just came to mind, have you tri... | [
0.7067120671272278,
-0.03367653861641884,
0.5325219631195068,
0.14143939316272736,
0.1951037496328354,
-0.16006848216056824,
0.17120110988616943,
0.28477585315704346,
-0.5897893905639648,
-0.35402870178222656,
0.518157958984375,
0.2087632566690445,
-0.2401430606842041,
0.31104323267936707,... | |
What is the best / most flexible way to have WCF output XHTML? If there is no "WCF Way" (tm) to do XHTML output - is there any common tooling out there for it? Or do I need to roll my own?
I don't believe there is an "official" WCF way to return XHTML, as of .NET 3.5 SP1. [Aaron Lerch suggested having WCF apply a defau... | [
0.577019989490509,
0.07972408086061478,
0.44435983896255493,
-0.13592112064361572,
-0.5422876477241516,
-0.15792356431484222,
0.10397505015134811,
-0.4071924090385437,
-0.09983248263597488,
-0.3177514374256134,
-0.06841510534286499,
0.7447795271873474,
-0.35156071186065674,
-0.220177158713... | |
Kit](http://msdn.microsoft.com/en-us/netframework/cc950529.aspx) or using the [raw programming model described by Carlos Figueira](http://blogs.msdn.com/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-web.aspx). Some of the [WCF sample code](http://www.thatindigogirl.com) provided online by Michele Leroux B... | [
0.6100538969039917,
-0.06076519563794136,
0.28637850284576416,
0.16958320140838623,
-0.12650519609451294,
-0.03124586120247841,
0.05379389971494675,
-0.6151717305183411,
-0.017097225412726402,
-0.46049055457115173,
0.030231308192014694,
0.6837794184684753,
-0.145731583237648,
-0.1595795154... | |
id) {
Item obj = GetItem(objectId);
Stream xml = GetXmlStream(obj);
return TransformXmlStream(xml, defaultTransform);
}
public static Stream GetXmlStream(IXmlSerializable item) {
MemoryStream stream = new MemoryStream();
using (XmlWriter writer = XmlWriter.Create(stream, new XmlWriterSe... | [
0.06340472400188446,
-0.585408627986908,
0.701744794845581,
-0.09785376489162445,
-0.09978670626878738,
0.4210943877696991,
0.16133148968219757,
-0.3157384693622589,
0.055515557527542114,
-0.5637664198875427,
-0.2308121621608734,
0.5676000118255615,
-0.6295170187950134,
0.23877118527889252... | |
dcs.WriteObject(writer, item);
writer.Flush();
writer.Close();
}
}
stream.Seek(0, SeekOrigin.Begin);
return stream;
}
public static Stream TransformXmlStream(Stream xml, string xsltFile) {
XmlReader reader = XmlReader.Create(xml);
XslCompiledTransform trans = new X... | [
-0.11112909764051437,
-0.5692307949066162,
0.8214471340179443,
-0.02731139026582241,
0.05344926565885544,
0.2538841664791107,
0.12955108284950256,
-0.23203009366989136,
0.07380696386098862,
-0.5855540633201599,
-0.25889497995376587,
0.5973063707351685,
-0.4765695035457611,
0.23203191161155... | |
if (writer != null) {
trans.Transform(reader, writer);
writer.Flush();
writer.Close();
}
}
stream.Seek(0, SeekOrigin.Begin);
return stream;
}
```
It does the job, but I don't think it's a scenario the designers of WCF anticipated. :-) | [
-0.013818972744047642,
-0.31657519936561584,
0.5992326736450195,
-0.40579327940940857,
0.3153690695762634,
0.09580661356449127,
0.5433230996131897,
-0.22699517011642456,
0.25069233775138855,
-0.6386271715164185,
-0.17700669169425964,
0.6320027709007263,
-0.4357406795024872,
0.2273294925689... | |
I've done some work for a personal project of mine, and now I understand why people tell us to plan out all our interfaces and design *before* coding. I've got some good classes and already have some working code, but all in all the the organization (architecture) is somewhat of a mess, and I'm already saying "If I did... | [
0.6272643208503723,
0.42177125811576843,
-0.03479418903589249,
-0.07858449965715408,
0.07484078407287598,
0.010190904140472412,
0.4234674870967865,
-0.07785764336585999,
-0.22965748608112335,
-0.8438782691955566,
0.2951187193393707,
0.5143105387687683,
-0.012634302489459515,
0.105523161590... | |
great, and write all new code for the deficient parts (basically starting from scratch with a fair amount of copy and paste from this project).
I've got git history I'm not sure I want to lose, but the task of slowly rewriting everything seems daunting. So the question I'm asking is: when refactoring a young project, ... | [
0.48897457122802734,
0.29030999541282654,
-0.04213038831949234,
0.307186096906662,
0.2757055461406708,
0.04084235429763794,
0.13142357766628265,
-0.10071616619825363,
-0.11586063355207443,
-0.6061636209487915,
0.18019649386405945,
0.6641878485679626,
0.1445377767086029,
0.20339316129684448... | |
bug fixes enhancements etc. You may not know why you made a change at the time, but you needed to, and rewriting the code could remove that needed change.
Taking small steps also helps you avoid the "Oh 'expletive'" scenario where you try and make some massive change and encounter a situation where it doesn't behave ... | [
0.23647817969322205,
0.04286377504467964,
-0.032248545438051224,
0.269954115152359,
0.1970118135213852,
0.13716073334217072,
0.6430472135543823,
0.10108203440904617,
-0.37356066703796387,
-0.6876830458641052,
-0.16622264683246613,
0.5736642479896545,
-0.5005102157592773,
-0.045976694673299... | |
After seeing some of the problems that Microsoft has had upgrading people from Internet Explorer 6 and also seeing how Firefox has automatic updates, it's made me consider the benefits and drawbacks of a push-style upgrade system for our web app. In your opinion, should a web app have automatic updates? Why or why not?... | [
0.25409719347953796,
0.027456652373075485,
0.1416814774274826,
0.2446817010641098,
0.04705793038010597,
-0.015684042125940323,
0.14416202902793884,
-0.16242669522762299,
-0.1363121122121811,
-0.5245161056518555,
-0.027652563527226448,
0.7833373546600342,
-0.06367895007133484,
-0.1858524233... | |
system?
Edit: For clarification, the web app is a content management system with a website front-end, similar to Joomla or Drupal. We would be offering the CMS as a product, so any updates would install the latest version of the application on our clients' servers.
Pushing a client app update to somebody's computer is... | [
0.21286411583423615,
0.019202159717679024,
0.6118238568305969,
0.33478447794914246,
0.0781276747584343,
0.11467737704515457,
0.06242092326283455,
0.00008506919402861968,
-0.48584622144699097,
-0.3761829435825348,
-0.1432264745235443,
0.4430731236934662,
-0.40451914072036743,
-0.07674961537... | |
to their users, you would be risking your users business. | [
0.6768769025802612,
0.22724515199661255,
-0.22106128931045532,
0.18121330440044403,
0.16004592180252075,
-0.07307274639606476,
0.2720153033733368,
0.1019788533449173,
-0.2660006284713745,
-0.23346634209156036,
0.15364409983158112,
0.46223485469818115,
-0.08853243291378021,
0.01658020913600... | |
I'm working on a registration process for an internal application. My initial design is below.
My main question is whether it's really necessary to include a `registration_confirmation_code`. Does it protect the app from a realistic threat or just add unnecessary complexity? I'm not sure about that.
---
* User enter... | [
0.43181312084198,
0.18942001461982727,
0.5216874480247498,
0.08763996511697769,
0.34404850006103516,
-0.014382877387106419,
0.34091371297836304,
-0.2519955337047577,
-0.1887550801038742,
-0.5685362815856934,
-0.009315558709204197,
0.26431596279144287,
-0.3165641725063324,
0.070317476987838... | |
table has a column `registration_confirmation_code` which is a randomly-generated string.
* App sends an email to the address the user entered. It contains a link to a page that will let the user confirm their registration and set their username and password.
The link has the user's `id` and `registration_confirmation... | [
0.033110495656728745,
0.33370131254196167,
0.979353666305542,
0.09482494741678238,
0.2879071831703186,
0.25885793566703796,
-0.06663797795772552,
-0.1574379950761795,
-0.4041573107242584,
-0.6206191182136536,
-0.15369649231433868,
-0.0448504276573658,
-0.34028157591819763,
-0.0163570158183... | |
`registration_confirmed` is `false`. They should only be able to confirm their registration once.
+ `registration_confirmation_code` request param matches the value in the DB for that user. That ensures this is a legitimate registration confirmation by the intended user and not someone else hitting the URL with random... | [
0.6051020622253418,
0.16003479063510895,
0.605629563331604,
0.11868489533662796,
0.03321994096040726,
-0.18935972452163696,
0.4606195092201233,
-0.5998795628547668,
-0.15681906044483185,
-0.3296958804130554,
-0.3758906126022339,
0.3656187057495117,
0.05871749296784401,
0.16026359796524048,... | |
from a visitor. Rule of thumb is to always make sure you're getting what you expect, and nothing else. I'd say you're doing it well, including email verification.
A small question though; why make it a two-step process? why not allow the user to enter a password right away? This usually feels much more comfortable for... | [
0.29790380597114563,
-0.03517714887857437,
0.47626015543937683,
-0.014396019279956818,
0.254072904586792,
-0.4739859104156494,
0.11653643846511841,
0.32150012254714966,
-0.11648312211036682,
-0.18613633513450623,
-0.34435349702835083,
0.3721185326576233,
0.020077919587492943,
0.05407009273... | |
The application I'm working on has a single class that maintains a database connection. All members of this class are static to enforce a singleton-like pattern, so the actual connection logic is performed in a static initializer block:
```
public class HibernateUtil {
private static final SessionFactory sessionF... | [
0.0550711527466774,
0.055243950337171555,
0.7579782009124756,
-0.0787893757224083,
0.08911850303411484,
0.08186838775873184,
0.4372308850288391,
-0.22369426488876343,
0.08975420147180557,
-0.6573176980018616,
-0.335500568151474,
0.4389351010322571,
-0.47523653507232666,
0.3633086681365967,... | |
//return the currently open session
}
static void closeSession() {
//close the currently open session
}
}
```
However, the application now needs to open a database connection to a second database. The way this class in structured now, the only way to maintain the second connection while keeping ... | [
0.07836585491895676,
-0.09483703225851059,
0.22443577647209167,
0.07814408838748932,
0.09429854899644852,
-0.39980295300483704,
0.4797893762588501,
0.1818697601556778,
-0.14312298595905304,
-0.8910239934921265,
-0.2225375473499298,
0.37641024589538574,
-0.3193792998790741,
0.43620586395263... | |
copy/paste.
Can anyone suggest a way that I could rework this setup to maintain multiple connections simultaneously while not being overly destructive to the code already calling the existing methods?
Keep the static methods and let them delegate to corresponding instance methods of a default instance.
For the seco... | [
0.6435375809669495,
0.18692512810230255,
0.025307251140475273,
0.3564847707748413,
0.11288169026374817,
-0.05435824766755104,
0.25548917055130005,
0.31283608078956604,
-0.10868092626333237,
-0.8412219882011414,
0.2756015956401825,
0.8580291271209717,
-0.5770420432090759,
0.1608288437128067... | |
I want to pop up a messagebox in SWT with a potentially long list of items. Can I add a List widget, or should I make a new shell and populate it with a Label, List, and two Buttons?
Keep the static methods and let them delegate to corresponding instance methods of a default instance.
For the secondary databases allo... | [
0.33019962906837463,
-0.10508260875940323,
0.1005154475569725,
0.32093679904937744,
0.10087999701499939,
0.11918521672487259,
0.089243583381176,
0.09231019765138626,
-0.35368362069129944,
-0.6574826240539551,
0.11779481172561646,
0.5820578932762146,
-0.39612528681755066,
0.2253398448228836... | |
I know that the title might sound a little contradictory, but what I'm asking is with regards to ORM frameworks (SQLAlchemy in this case, but I suppose this would apply to any of them) that allow you to define your schema within your application.
Is it better to change the database schema directly and then update the... | [
0.5968865156173706,
0.38045135140419006,
0.24773283302783966,
0.19558250904083252,
0.20885086059570312,
-0.10587795823812485,
-0.14861038327217102,
-0.1012282446026802,
-0.2820902466773987,
-0.4125215709209442,
0.1846928894519806,
0.43369174003601074,
-0.0881214365363121,
0.145996198058128... | |
personal belief is that you should design the database on its own merits. The database is the best place to handle things modeling your Domain data. The database is also the biggest source of slow down in applications and letting your ORM design your database seems like a bad idea to me. :)
Of course, I've only got a ... | [
0.7435966730117798,
0.543106198310852,
0.2340117245912552,
0.27168622612953186,
0.12721224129199982,
0.08079791069030762,
0.36150577664375305,
0.18094530701637268,
-0.15968304872512817,
-0.46444836258888245,
0.4000051021575928,
0.5480840802192688,
0.2415464222431183,
-0.046662718057632446,... | |
Is is possible to detect if a Python script was started from the command prompt or by a user "double clicking" a .py file in the file explorer on Windows?
Here is an example of how to obtain the parent process id and name of the current running script. As suggested by [Tomalak](https://stackoverflow.com/users/18771/tom... | [
0.008792090229690075,
-0.16974911093711853,
0.34047436714172363,
-0.14052443206310272,
-0.009628158062696457,
0.06290868669748306,
-0.021680301055312157,
-0.11048901826143265,
-0.14755474030971527,
-0.4816083014011383,
-0.26316332817077637,
0.4151948094367981,
-0.3262651860713959,
0.052072... | |
are dictionaries with the following key-value pairs:
- name: <Name of the process PID>
- parent_id: <PID of this process parent>
"""
# get the names and occurences of all running process names
items, instances = win32pdh.EnumObjectItems(None, None, 'Process', win32pdh.PERF_DETAIL_WIZARD)
... | [
-0.1869814246892929,
0.14962732791900635,
0.29002144932746887,
0.32148289680480957,
0.13488632440567017,
0.1775851547718048,
0.03132948279380798,
-0.08678105473518372,
-0.0323101170361042,
-0.7435006499290466,
-0.20267167687416077,
0.3544350564479828,
-0.1993740051984787,
0.282830476760864... | |
counter_items = ['ID Process', 'Creating Process ID']
# output dict
pid_dict = {}
# loop over each program (multiple instances might be running)
for instance, max_instances in instance_dict.items():
for inum in xrange(max_instances):
# define the counters for the query
... | [
-0.03387825936079025,
-0.07388684898614883,
0.37171295285224915,
0.09611344337463379,
-0.12337315827608109,
0.25560513138771057,
0.01952635869383812,
-0.5301951766014099,
-0.2440101057291031,
-0.4643785357475281,
0.030267540365457535,
0.13099120557308197,
-0.3778707683086395,
0.18546491861... | |
{}
for item in counter_items:
path = win32pdh.MakeCounterPath((None,'Process',instance, None,inum,item))
hcs[item] = win32pdh.AddCounter(hq,path)
win32pdh.CollectQueryData(hq)
# store the values in a temporary dict
hc_dict = {} | [
-0.23804955184459686,
-0.22350293397903442,
0.5715983510017395,
0.03308692201972008,
0.05922110751271248,
0.2299681454896927,
0.2816976010799408,
-0.5445868372917175,
-0.3662135899066925,
-0.42822352051734924,
-0.22053049504756927,
0.21012337505817413,
-0.44079864025115967,
0.2300870567560... | |
for item, hc in hcs.items():
type,val=win32pdh.GetFormattedCounterValue(hc,win32pdh.PDH_FMT_LONG)
hc_dict[item] = val
win32pdh.RemoveCounter(hc)
win32pdh.CloseQuery(hq)
# obtain the pid and ppid of the current instance | [
-0.6329248547554016,
-0.1297949105501175,
0.8076207637786865,
0.055033180862665176,
0.11532700061798096,
0.14448177814483643,
0.2011796534061432,
-0.45162510871887207,
-0.12240473181009293,
-0.6424436569213867,
-0.3656595051288605,
0.2625567317008972,
-0.27852436900138855,
0.22461527585983... | |
# and store it in the output dict
pid, ppid = (hc_dict[item] for item in counter_items)
pid_dict[pid] = {'name': instance, 'parent_id': ppid}
return pid_dict
def getParentInfo(pid):
"""
Returns a PID, Name tuple of the parent process for the argument pid process.
"""
pid_i... | [
-0.22743460536003113,
-0.3597302734851837,
0.5712817907333374,
-0.04864951968193054,
0.04997243359684944,
0.40314581990242004,
0.09391767531633377,
-0.4275241792201996,
0.014437534846365452,
-0.4346006512641907,
-0.5144606232643127,
0.4129977822303772,
-0.4592341482639313,
0.01798702031373... | |
ppid, pid_info[ppid]['name']
if __name__ == "__main__":
"""
Print the current PID and information of the parent process.
"""
pid = os.getpid()
ppid, ppname = getParentInfo(pid)
print "This PID: %s. Parent PID: %s, Parent process name: %s" % (pid, ppid, ppname)
dummy = raw_input()
```
Whe... | [
-0.5104557275772095,
-0.10069970786571503,
0.8029627203941345,
-0.20215672254562378,
0.031008437275886536,
0.396443247795105,
-0.25420188903808594,
-0.05293133482336998,
-0.34885674715042114,
-0.8215270042419434,
-0.3982637822628021,
0.03219061717391014,
0.031048115342855453,
0.40640163421... | |
I'd like GCC to include files from `$HOME/include` in addition to the usual include directories, but there doesn't seem to be an analogue to `$LD_LIBRARY_PATH`.
I know I can just add the include directory at command line when compiling (or in the makefile), but I'd really like a universal approach here, as in the libr... | [
0.4099591374397278,
-0.007646001875400543,
0.12213367223739624,
-0.2459486871957779,
-0.058393124490976334,
-0.5443391799926758,
-0.18491831421852112,
0.02220129780471325,
-0.32519564032554626,
-0.4491225481033325,
-0.3510344922542572,
0.6483219861984253,
-0.6648173928260803,
0.11088731884... | |
I am trying to perform a search for users based on a full-text search.
SELECT \* FROM users WHERE MATCH ( name ) AGAINST ( 'FDR' IN BOOLEAN MODE );
However the query yields no results. I can replace the search value with other strings and yield results.
I have even tried using a null stop word list with no success. ... | [
0.09183640778064728,
0.0395580418407917,
0.47124388813972473,
-0.2682342231273651,
-0.2794685959815979,
0.10300042480230331,
0.6177617311477661,
-0.08458860963582993,
-0.022474126890301704,
-0.7522391676902771,
-0.2797843813896179,
0.6508311033248901,
-0.3693588674068451,
0.086815796792507... | |
maximum lengths of
> words to be indexed are defined by the
> ft\_min\_word\_len and ft\_max\_word\_len
> system variables.
Also see [Server System Variables](http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html) | [
0.0007450133562088013,
-0.20051205158233643,
0.6075809597969055,
0.060247939079999924,
-0.033119458705186844,
0.20846286416053772,
0.36936596035957336,
-0.3692406415939331,
-0.43953144550323486,
-0.6550930738449097,
-0.12977293133735657,
0.4502279758453369,
0.14701467752456665,
0.039572123... | |
The other week, I wrote a little thread class and a one-way message pipe to allow communication between threads (two pipes per thread, obviously, for bidirectional communication). Everything worked fine on my Athlon 64 X2, but I was wondering if I'd run into any problems if both threads were looking at the same variabl... | [
0.3197533190250397,
-0.1513449251651764,
0.2750161290168762,
0.2371964007616043,
-0.082493357360363,
0.2008228302001953,
0.4184340536594391,
0.1668689101934433,
-0.1830860674381256,
-0.4208175539970398,
0.3465045392513275,
0.49734437465667725,
-0.33847126364707947,
0.16091009974479675,
0... | |
this something I need to worry about, or will *volatile* and proper use of lightweight locking mechanisms (I was using \_InterlockedExchange to set my volatile pipe variables) handle all cases where I want to write "lock free" code for multicore x86 CPUs?
I'm already aware of and have used Critical Sections, Mutexes, ... | [
0.3031986355781555,
0.3758566975593567,
0.2143879383802414,
0.11483491212129593,
0.1828741580247879,
-0.2693250775337219,
0.2426927238702774,
-0.1658218801021576,
-0.24806787073612213,
-0.39924147725105286,
-0.07644355297088623,
0.6661823391914368,
-0.23590117692947388,
0.33130526542663574... | |
read by your code then it will probably be in cache, in which case volatile will force it to be re-read from cache, NOT from memory.
There are not a lot of cache coherency instructions in x86. There are prefetch instructions like [`prefetchnta`](http://www.felixcloutier.com/x86/PREFETCHh.html), but that doesn't affect... | [
0.5278493762016296,
-0.0018776528304442763,
0.2578905522823334,
0.06673119962215424,
-0.22606684267520905,
-0.010537542402744293,
0.24910695850849152,
-0.09004718065261841,
-0.20031516253948212,
-0.7069565653800964,
-0.1146225556731224,
0.3171558082103729,
-0.35229483246803284,
0.270343571... | |
each other (including the private L1 caches of different cores). A core that wants to write a cache line has to force other cores to invalidate their copy of it before it can change its own copy from Shared to Modified state.
---
You don't need any fence instructions (like MFENCE) to produce data in one thread and co... | [
0.3777141869068146,
-0.003104513045400381,
-0.03338484838604927,
0.1125759407877922,
0.2227739840745926,
-0.2072625756263733,
0.45002481341362,
-0.3513370454311371,
-0.39936330914497375,
-0.5949002504348755,
-0.15699219703674316,
0.39297860860824585,
-0.4791441559791565,
0.2017506808042526... | |
C++'s memory model is weakly-ordered. `volatile` is an old, bad way to do this; C++11 std::atomic is a much better way to write lock-free code. | [
-0.484506219625473,
0.27161160111427307,
0.049553390592336655,
-0.2406601458787918,
-0.1368916630744934,
-0.14663895964622498,
0.13559354841709137,
0.04890017583966255,
0.018906723707914352,
0.08420757949352264,
-0.2720041871070862,
0.4455671012401581,
-0.6463890671730042,
-0.0177504401654... | |
I have an object, a Timeline, that encapsulates a thread. Events can be scheduled on the timeline; the thread will wait until it is time to execute any event, execute it, and go back to sleep (for either (a) the time it takes to get to the next event or (b) indefinitely if there are no more events).
The sleeping is ha... | [
0.38769978284835815,
-0.2969192564487457,
0.516958475112915,
-0.023755474016070366,
0.21785211563110352,
-0.17317096889019012,
-0.03382479026913643,
0.016343005001544952,
-0.10512194037437439,
-0.6890996694564819,
-0.15774807333946228,
0.13457249104976654,
-0.08428093791007996,
0.385014921... | |
I've even implemented IDisposable and Dispose() also calls Stop().
Still, when I use this component in a forms application, my application will never shut down properly when I close the form. For some reason, Stop() is never called, so neither my object's destructor triggers, nor is the Dispose() method called, *befor... | [
0.5307037234306335,
-0.030326705425977707,
0.5428986549377441,
-0.08879245072603226,
0.11355026811361313,
-0.40523234009742737,
0.47699275612831116,
-0.060502924025058746,
-0.17899112403392792,
-0.7271504998207092,
-0.11356588453054428,
0.37358054518699646,
-0.2230733036994934,
0.364563733... | |
the Timeline class), this seems very ugly and an extra (unnecessary) gotcha for the application developer. The using() clause, which I would normally use when resource release becomes an issue, doesn't apply as this is going to be a long-lived object.
On the one hand, I can understand that .NET will want to wait for a... | [
0.3175470530986786,
0.024509012699127197,
0.10907930135726929,
0.20318293571472168,
0.08152027428150177,
-0.30408769845962524,
0.3869010806083679,
0.030314568430185318,
-0.19152434170246124,
-0.5747746229171753,
0.09112830460071564,
0.3491857051849365,
-0.1898166984319687,
0.61007744073867... | |
I make .NET notify my object when the application is exiting, but before it will wait for all threads to finish?
---
EDIT: In response to the people saying that it is ok for the client program to be aware of the thread: I respectfully disagree.
As I said in my original post, the thread is hidden away in another obje... | [
0.8064047694206238,
-0.11540619283914566,
0.4738404452800751,
-0.11545120924711227,
-0.148516446352005,
-0.2859199047088623,
0.50278639793396,
0.18152020871639252,
-0.24845050275325775,
-0.8506600260734558,
-0.1650194376707077,
0.2816053330898285,
-0.23540610074996948,
0.26894068717956543,... | |
blinks for exactly 800ms. Does it start a thread? I don't care. Does it create a hidden window and use system timers (ew)? I don't care. Does it hire midgets to turn my light on and off? I don't care.
And I *especially* don't want to have to care that if I ever create an Animator, I have to keep track of it and call a... | [
0.6777870655059814,
-0.05951259285211563,
0.8022961020469666,
0.13188289105892181,
-0.005283422768115997,
0.10819782316684723,
0.4908231198787689,
0.3477966785430908,
-0.27838489413261414,
-0.6719954013824463,
-0.16186541318893433,
0.36781349778175354,
-0.2724672257900238,
0.03308903053402... | |
it for reference, *sans* methods that add events to the list:
```
internal class Timeline : IDisposable {
private Thread eventThread;
private volatile bool active;
private SortedList<DateTime, MethodInvoker> events = new SortedList<DateTime,MethodInvoker>();
private EventWaitHandle wakeup = new EventWa... | [
-0.150709331035614,
-0.4444054663181305,
0.3930448591709137,
-0.24926955997943878,
0.3964857757091522,
0.045499011874198914,
0.07189495116472244,
-0.2554449737071991,
-0.2864494323730469,
-0.47937384247779846,
-0.3449130952358246,
0.3961576223373413,
-0.406662255525589,
0.49341556429862976... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.