text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
to unlock the > > semaphore by performing a `sem_post()` > function, this wait shall be ter- > > minated when the specified timeout > expires From my limited understanding of how semphores work I can see that `sem_timedwait()` is safer, but I still should be able to use sem\_wait() Is this correct? If not w...
[ 0.4715413451194763, -0.4233727753162384, 0.38353750109672546, -0.03463629260659218, 0.1778794676065445, -0.2978382706642151, 0.655727744102478, -0.37031057476997375, -0.06612975150346756, -0.4789399802684784, -0.0644451379776001, 0.5307564735412598, -0.09426248073577881, 0.2187708020210266...
interval that you choose, each time decrementing the total timeout until you either run out of timeout or the semaphore is acquired. A much better solution is to rewrite the algorithm to use a condition variable, and then you can use `pthread_cond_timedwait()` to get the appropriate timeout.
[ 0.3278929889202118, -0.46795618534088135, 0.26050999760627747, 0.08328969031572342, 0.3693266212940216, 0.14552831649780273, 0.1352842003107071, -0.12706293165683746, -0.02955004759132862, -0.7959845662117004, 0.09468135237693787, 0.5758751034736633, 0.07554057985544205, -0.010847058147192...
Just for kicks I'm playing around a bit with C# and WPF. I'm going through some examples on sending a button click event to a button programmatically since Button.PerformClick() is no longer present. The example I'm following is using the IInvokeProvider from the System.Windows.Automation.Provider namespace. My copy of...
[ 0.6701028347015381, -0.2290472537279129, 0.1534472554922104, -0.08552983403205872, -0.6250531673431396, -0.26419028639793396, 0.23564288020133972, -0.0168844573199749, -0.35640570521354675, -0.605571985244751, 0.3208162188529968, 0.47152823209762573, -0.4342450499534607, 0.0418616645038127...
the .NET Framework version 3.5. Add a reference to UIAutomationProvider.dll... That should allow you to use the System.Windows.Automation.Provider namespace.
[ 0.46623796224594116, -0.17060935497283936, 0.46442487835884094, 0.09373756498098373, -0.2193508893251419, -0.29383090138435364, 0.18607312440872192, 0.06351137161254883, -0.03192237764596939, -0.8180860280990601, -0.35406386852264404, 0.3294474482536316, -0.3725719749927521, 0.167267352342...
Ok this is a new one for me. Basically I have a table articles: ``` id: int auto increment title: varchar(200) description: varchar(1000) ctext: longtext chtml: longtext ``` Now I do an insert into this table with mysql\_query: ``` INSERT INTO articles (title, description, ctext, chtml) VALUES ('$title', '$descript...
[ -0.07922405004501343, 0.4118663966655731, 0.8548032641410828, -0.18563812971115112, -0.17837867140769958, -0.07431963086128235, 0.40774106979370117, -0.3106050193309784, -0.1968325525522232, -0.7277405858039856, 0.01861967332661152, 0.6823040246963501, -0.06936056166887283, -0.080164775252...
tell. Now I dumped the query out to a file in /tmp and ran it with: ``` mysql -u username -p dbname < /tmp/query ``` **Same thing.** I copy the query into Navicat and it... works. So what on earth is going on? Some random thoughts: * Have you tried controlling the text length see if it only fails at one point? *...
[ 0.7267922163009644, 0.11426105350255966, 0.46941062808036804, 0.10968507826328278, -0.05494356527924538, -0.14615082740783691, 0.44870269298553467, -0.21184375882148743, -0.037806879729032516, -0.518932580947876, 0.25851818919181824, 0.7090237140655518, -0.39325907826423645, 0.273109406232...
copy-paste? Again, might be related to an invalid character that's not passed through the copy-paste but was saved in the file. * Just to cover the basics we so often forget, how do you verify that the data is not inserted? I mean, how to you visualize it? You could have a line break that hides the first lines from 2 o...
[ 0.20824217796325684, 0.11681399494409561, 0.32721245288848877, 0.18910954892635345, -0.04143224284052849, 0.02102045528590679, 0.09697271883487701, 0.15739646553993225, -0.16791024804115295, -0.8235692977905273, -0.10597667098045349, 0.3360550105571747, -0.309428334236145, 0.05636049434542...
I am using Log4net for a while now and it's an amazing logging framework, especially when hooked into Castle.Windsor. However... I usually use the rolling file appender, but this has resulted in too many log files than I actually want, so instead, for my latest project, have used the basic LogFileAppender instead, but...
[ 0.2660592496395111, -0.05891343206167221, 0.5533884167671204, -0.19672062993049622, 0.03719542175531387, 0.0504792183637619, 0.20895761251449585, -0.018365608528256416, -0.6307163834571838, -0.7288023233413696, 0.22005276381969452, 0.5587440729141235, -0.13862600922584534, 0.36475896835327...
<maximumFileSize value="2048KB"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%-16date{dd MMM HH:mm:ss} %-7level %-25.35logger{1} %message%newline"/> </layout> </appender> ``` Its seems like the maximumFileSize attribute is not being respected. Any solutions? Alternatively, how can...
[ -0.004659938160330057, -0.37725675106048584, 0.8485841155052185, -0.03825864568352699, 0.001530332025140524, 0.07149946689605713, 0.1144736036658287, -0.05439205467700958, -0.7779228687286377, -0.6442149877548218, -0.010712035931646824, 0.6096184849739075, -0.033238887786865234, 0.21083033...
type="log4net.Appender.RollingFileAppender"> <file value="log.txt" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="0" /> <maximumFileSize value="10MB" /> <staticLogFileName value="true" /> <layout type="log4net.Layout.PatternLayout"> <convers...
[ 0.01210669707506895, -0.21729108691215515, 0.5813466310501099, -0.1870402693748474, 0.20115835964679718, 0.13703259825706482, -0.02321077510714531, -0.24093344807624817, -0.5776347517967224, -0.6106173992156982, -0.1734035164117813, 0.5198017358779907, -0.0242528785020113, 0.17036923766136...
I am using the gethostbyname() function in the usual manner... ``` iaHost.s_addr = inet_addr(lpServerName); if (iaHost.s_addr == INADDR_NONE) { // Wasn't an IP address string, assume it is a name lpHostEntry = 0; lpHostEntry = gethostbyname(lpServerName); } ``` to access my web site and return informatio...
[ -0.12753604352474213, 0.4288904368877411, 0.47629907727241516, -0.3034323751926422, 0.21316419541835785, -0.16407695412635803, 0.2547421455383301, -0.010318187065422535, -0.15160077810287476, -0.6830558776855469, -0.06857676804065704, 0.7797208428382874, -0.5062916874885559, 0.193632706999...
when I use the loop-back address, the code above works fine. When I try and access a web site exterior to my computer I get the following error: "Windows has triggered a breakpoint in test\_gethostbyname.exe. This may be due to a corruption of the heap, and indicates a bug in test\_gethostbyname.exe or any of the DLLs ...
[ 0.39135053753852844, 0.3945426344871521, -0.03338070958852768, -0.2954258322715759, 0.11854219436645508, -0.2728337347507477, 0.8359352350234985, 0.27823516726493835, -0.13425320386886597, -0.8447779417037964, -0.1381245106458664, 0.5085417628288269, -0.1449916660785675, 0.2840020060539245...
have done. I have tried the "getaddrinfo" command with the same results. I have searched the web for any kind of information on this problem with no joy (other than segmentation faults on unix systems). Does anyone know of any problem with this command that would cause this error to occur? Thanks in advance, Jay I ...
[ 0.6465956568717957, 0.3256620168685913, 0.2958697974681854, 0.05915322154760361, 0.10394812375307083, -0.16537068784236908, 0.3937738239765167, 0.04824334755539894, -0.34792664647102356, -0.5861918330192566, -0.027615729719400406, 0.8255965709686279, -0.23182331025600433, -0.07269512116909...
worked.
[ 0.5422989726066589, 0.27161961793899536, 0.20862004160881042, 0.3360151946544647, 0.05967733636498451, -0.36222153902053833, 0.2716764807701111, 0.35259634256362915, -0.01432340033352375, -0.5132689476013184, -0.1299685388803482, 0.3415607213973999, 0.3127664625644684, 0.06320304423570633,...
In Django / Pinax, I've come across the login form which starts like this : ``` <form class="login" method="POST" action=""> ``` It works perfectly well. So I assume that either some java-script or something in the Django framework is putting the value into the action attribute. So, my questions: * How does Djang...
[ 0.22025565803050995, 0.02723097801208496, 0.17714615166187286, -0.35154709219932556, -0.38977861404418945, -0.32399243116378784, -0.0821448266506195, -0.11997676640748978, -0.21247118711471558, -0.1652580201625824, 0.08509717136621475, 0.4922982454299927, -0.36871621012687683, -0.278795242...
URL the browser currently has loaded, which is the script that served the form in the first place.
[ 0.04507070779800415, 0.2269749790430069, 0.7922510504722595, -0.18391549587249756, -0.5068853497505188, -0.5118730068206787, 0.11239304393529892, 0.5752390027046204, -0.06960214674472809, -0.456332802772522, -0.4654237926006317, 0.2647934556007385, -0.21419352293014526, 0.5056963562965393,...
I use one WYSIWYG editor in a small cms. It allows users to upload files, images, etc. If I add image named dog.jpg, in source I'll get: ``` <img src="/myweb/userfiles/images/dog.jpg" /> ``` I can save this to a database and use it later on any page, until I move my site to a live domain. myweb is virtual directory...
[ 0.2533576786518097, 0.2801589071750641, 0.37542855739593506, -0.20067770779132843, -0.2161223292350769, 0.1090349331498146, 0.31623417139053345, 0.03840729594230652, -0.33727991580963135, -1.1723501682281494, -0.0024818438105285168, -0.06746891885995865, -0.41599828004837036, 0.49081856012...
save with empty string. I also have to replace full url, which editor creates for some files. On display I would have to add correct Application dir. I would probably save both versions in database, and only on server change force display version to update. By now I've come up with: ``` p = p.Replace("href=\"" + full...
[ 0.019526807591319084, 0.2209998071193695, 0.6907336115837097, -0.20369784533977509, -0.053940653800964355, 0.2671492397785187, 0.26428481936454773, -0.04214290902018547, -0.09343405812978745, -0.6678853034973145, -0.30102673172950745, 0.6332147121429443, -0.4517236649990082, -0.04242618009...
you have other solution, great. I am unsure the regex version has any of the characteristics you mention in this case. That said, you can do: ``` string ReplaceUrlPaths(string html, string partialPath, string fullPath) { var pattern = string.Format("((href|src)=\")({0}|{1})", partialPath, fullPath); ...
[ 0.4663468897342682, -0.20762480795383453, 0.35916391015052795, -0.08119112253189087, 0.2066269963979721, -0.06349688768386841, 0.5266144871711731, -0.2580527365207672, -0.030430246144533157, -0.728462815284729, -0.11105740815401077, 0.6528742909431458, -0.5065876841545105, -0.1450300365686...
var input = @"<img src=""/myweb/userfiles/images/dog.jpg"" />"; //carefull with any special regex char in the paths var replaced = ReplaceUrlPaths(input, "/myweb", "/some/full/path"); Assert.AreEqual( @"<img src=""/userfiles/images/dog.jpg"" />", replaced); } ``` ...
[ -0.03073519468307495, -0.10679835081100464, 0.5860234498977661, -0.2597510814666748, -0.043767958879470825, 0.12111634016036987, 0.4458986222743988, -0.5141720175743103, -0.11262878030538559, -0.6386098861694336, -0.16703440248966217, 0.8267135620117188, -0.43922460079193115, -0.1540510654...
it all, by defining a web site with an alternate port to just have it as a root Url.
[ 0.4626637101173401, 0.023200714960694313, 0.46635714173316956, 0.2567647099494934, -0.01965205743908882, -0.4291412830352783, 0.19153344631195068, 0.5826208591461182, -0.18974223732948303, 0.014020197093486786, -0.16849415004253387, 0.10987022519111633, -0.3875897228717804, 0.7181929349899...
I have a base32 string which I need to convert to a byte array. And I'm having trouble finding a conversion method in the .NET framework. I can find methods for base64 but not for base32. `Convert.FromBase64String` – something like this for base32 would be perfect. Is there such a method in the framework or do I have...
[ 0.292449027299881, 0.1571405827999115, 0.08641910552978516, -0.19382700324058533, 0.09350760281085968, -0.008362708613276482, 0.41699278354644775, -0.14152772724628448, -0.2738109230995178, -0.6617509126663208, 0.0930764377117157, 0.638064444065094, -0.45284318923950195, 0.1322091072797775...
{ if (string.IsNullOrEmpty(input)) { throw new ArgumentNullException("input"); } input = input.TrimEnd('='); //remove padding characters int byteCount = input.Length * 5 / 8; //this must be TRUNCATED byte[] returnArray = new byte[byteCount]; byte cur...
[ -0.22494079172611237, -0.3290368318557739, 0.5230313539505005, -0.3991563618183136, 0.16018559038639069, 0.3041311800479889, 0.16508623957633972, -0.3029836416244507, -0.12450966984033585, -0.47094032168388367, -0.07337820529937744, 0.5538758039474487, -0.11277615278959274, -0.045950386673...
int mask = 0, arrayIndex = 0; foreach (char c in input) { int cValue = CharToValue(c); if (bitsRemaining > 5) { mask = cValue << (bitsRemaining - 5);
[ -0.10611367970705032, -0.498658686876297, 0.5744040012359619, -0.3582051396369934, 0.3508480191230774, 0.4311423599720001, 0.18926957249641418, -0.13670071959495544, 0.021918220445513725, -0.4136202931404114, -0.39413946866989136, 0.868777871131897, -0.20705758035182953, -0.072346515953540...
curByte = (byte)(curByte | mask); bitsRemaining -= 5; } else { mask = cValue >> (5 - bitsRemaining);
[ -0.0658031478524208, -0.48208996653556824, 0.43775370717048645, -0.2671348750591278, 0.1941925436258316, 0.25189587473869324, 0.21184754371643066, -0.11693324893712997, -0.19252116978168488, -0.5228462219238281, -0.17469733953475952, 1.1034488677978516, 0.11658117920160294, -0.205441549420...
curByte = (byte)(curByte | mask); returnArray[arrayIndex++] = curByte; curByte = (byte)(cValue << (3 + bitsRemaining)); bitsRemaining += 3; } } //if we
[ 0.21077090501785278, -0.38135987520217896, 0.4546005129814148, -0.1914282739162445, -0.12824396789073944, 0.31758204102516174, -0.002241759328171611, -0.2598353624343872, -0.16760468482971191, -0.4571938216686249, 0.12787765264511108, 1.0687475204467773, 0.09741240739822388, -0.29583737254...
didn't end with a full byte if (arrayIndex != byteCount) { returnArray[arrayIndex] = curByte; } return returnArray; } public static string ToString(byte[] input) { if (input == null || input.Length == 0) {
[ -0.10643501579761505, -0.3365122973918915, 0.43553581833839417, -0.2467285692691803, -0.25066521763801575, 0.1936616599559784, 0.23823265731334686, -0.03383004292845726, -0.18194423615932465, 0.07687468826770782, 0.11547939479351044, 0.3963279128074646, -0.1653595119714737, 0.0612778365612...
throw new ArgumentNullException("input"); } int charCount = (int)Math.Ceiling(input.Length / 5d) * 8; char[] returnArray = new char[charCount]; byte nextChar = 0, bitsRemaining = 5; int arrayIndex = 0; foreach (byte b in input) {
[ -0.212220698595047, -0.17421559989452362, 0.3458797335624695, -0.3921341896057129, 0.11451034992933273, 0.36475878953933716, 0.43754932284355164, -0.5109608173370361, -0.22226952016353607, -0.38970422744750977, -0.24202848970890045, 0.634555459022522, 0.01605996862053871, 0.093275003135204...
nextChar = (byte)(nextChar | (b >> (8 - bitsRemaining))); returnArray[arrayIndex++] = ValueToChar(nextChar); if (bitsRemaining < 4) { nextChar = (byte)((b >> (3 - bitsRemaining)) & 31); returnArray[arrayIndex++] = ValueToChar(nextChar);
[ -0.4772847592830658, -0.39512085914611816, 0.5219097137451172, -0.5841307044029236, 0.3041445016860962, 0.10057152062654495, 0.3951422870159149, -0.603559136390686, -0.18190190196037292, -0.329147607088089, -0.4524074196815491, 0.5791327953338623, -0.2629098892211914, -0.11800040304660797,...
bitsRemaining += 5; } bitsRemaining -= 3; nextChar = (byte)((b << bitsRemaining) & 31); } //if we didn't end with a full char if (arrayIndex != charCount) {
[ -0.17023326456546783, -0.24153971672058105, 0.3938949406147003, -0.335212767124176, 0.0807437002658844, 0.1853247731924057, 0.4596785008907318, -0.2788986265659332, -0.15405283868312836, -0.1002904549241066, -0.030433738604187965, 0.508184015750885, 0.07789918780326843, 0.15235868096351624...
returnArray[arrayIndex++] = ValueToChar(nextChar); while (arrayIndex != charCount) returnArray[arrayIndex++] = '='; //padding } return new string(returnArray); } private static int CharToValue(char c) { int value = (int)c; //65-90 == uppercase letters i...
[ -0.036292918026447296, -0.18786896765232086, 0.649848461151123, -0.4278428554534912, 0.07979889214038849, 0.46995440125465393, 0.10035081207752228, -0.6941845417022705, -0.0851072445511818, -0.2916368842124939, -0.1788056194782257, 0.48060673475265503, -0.3020245134830475, -0.0067459987476...
{ return value - 65; } //50-55 == numbers 2-7 if (value < 56 && value > 49) { return value - 24; } //97-122 == lowercase letters
[ 0.23914466798305511, 0.2983357906341553, 0.20413286983966827, -0.2185671478509903, 0.07158086448907852, 0.5171599388122559, 0.043873380869627, -0.6403605341911316, -0.09468778222799301, -0.464881956577301, -0.4776169955730438, 0.5434778332710266, 0.0005234871059656143, -0.16621820628643036...
if (value < 123 && value > 96) { return value - 97; } throw new ArgumentException("Character is not a Base32 character.", "c"); } private static char ValueToChar(byte b) { if (b < 26) {
[ -0.04054422676563263, 0.19075991213321686, 0.11437754333019257, -0.518790602684021, 0.1867927461862564, 0.23020192980766296, 0.1422298401594162, -0.2983478605747223, 0.0976528748869896, -0.03686453402042389, -0.35707762837409973, 0.40579405426979065, -0.23181557655334473, 0.034725919365882...
return (char)(b + 65); } if (b < 32) { return (char)(b + 24); } throw new ArgumentException("Byte is not a value Base32 value.", "b"); } } ```
[ -0.16006134450435638, 0.10763812810182571, 0.15578611195087433, -0.41406285762786865, 0.002136909868568182, 0.21198037266731262, 0.23225249350070953, -0.33534306287765503, -0.14735420048236847, -0.21218442916870117, -0.39024361968040466, 0.5630717277526855, -0.3508225381374359, 0.067727565...
How can i retrieve NULL Field [ Date Out ]in sql 2005 database to a Grid View in ASP.Net. I need this field to be edited by the user. I had a need for a base32 encoder/decoder, so I spent a couple hours this afternoon throwing this together. I believe it conforms to the standards listed here: <https://www.rfc-editor.or...
[ 0.18460994958877563, -0.22116242349147797, 0.08318111300468445, -0.07535182684659958, 0.25055256485939026, -0.13436411321163177, 0.3918256461620331, -0.1868756115436554, -0.45134374499320984, -0.5379900336265564, 0.1658196896314621, 0.37598422169685364, -0.3604806363582611, 0.1595197618007...
ArgumentNullException("input"); } input = input.TrimEnd('='); //remove padding characters int byteCount = input.Length * 5 / 8; //this must be TRUNCATED byte[] returnArray = new byte[byteCount]; byte curByte = 0, bitsRemaining = 8; int mask = 0, arrayIndex = 0; ...
[ -0.37192264199256897, -0.24098189175128937, 0.4569370746612549, -0.3606411814689636, 0.1333741396665573, 0.48470163345336914, 0.049024175852537155, -0.22064626216888428, -0.11037028580904007, -0.3486664593219757, -0.18392537534236908, 0.6388162970542908, -0.14024369418621063, -0.1376133412...
{ int cValue = CharToValue(c); if (bitsRemaining > 5) { mask = cValue << (bitsRemaining - 5); curByte = (byte)(curByte | mask);
[ -0.04712828993797302, -0.5452771186828613, 0.5123775601387024, -0.23673126101493835, 0.31012097001075745, 0.3474451005458832, -0.04823658987879753, -0.05035993456840515, -0.1536257565021515, -0.5106553435325623, -0.21657992899417877, 0.9713255763053894, 0.04594733566045761, -0.153343424201...
bitsRemaining -= 5; } else { mask = cValue >> (5 - bitsRemaining); curByte = (byte)(curByte | mask); returnArray[arrayIndex++] = curByte;
[ -0.008882480673491955, -0.47548043727874756, 0.5022837519645691, -0.29141154885292053, -0.025409383699297905, 0.2760368883609772, 0.19061359763145447, -0.3230412006378174, -0.20492993295192719, -0.3112579584121704, -0.04194467142224312, 0.9946088790893555, 0.11646491289138794, -0.225052371...
curByte = (byte)(cValue << (3 + bitsRemaining)); bitsRemaining += 3; } } //if we didn't end with a full byte if (arrayIndex != byteCount) {
[ 0.18724848330020905, -0.46457168459892273, 0.5485840439796448, -0.11048804968595505, -0.12308298051357269, 0.04840138182044029, 0.05382424220442772, -0.09068012237548828, -0.2565121650695801, -0.3292856514453888, 0.32989606261253357, 0.8333758115768433, 0.1286117434501648, -0.1759507805109...
returnArray[arrayIndex] = curByte; } return returnArray; } public static string ToString(byte[] input) { if (input == null || input.Length == 0) { throw new ArgumentNullException("input"); } int charCount = (int)Math.Ceiling(input.Length / 5d) *...
[ -0.07197053730487823, -0.19204701483249664, 0.6524806022644043, -0.3671458065509796, -0.036194492131471634, 0.29134318232536316, 0.26297831535339355, -0.4710860848426819, -0.1915237009525299, -0.33956193923950195, -0.1128239557147026, 0.7472694516181946, -0.04306793957948685, 0.17604744434...
char[] returnArray = new char[charCount]; byte nextChar = 0, bitsRemaining = 5; int arrayIndex = 0; foreach (byte b in input) { nextChar = (byte)(nextChar | (b >> (8 - bitsRemaining))); returnArray[arrayIndex++] = ValueToChar(nextChar);
[ -0.41537410020828247, -0.16141095757484436, 0.4760230481624603, -0.6065078973770142, 0.23694302141666412, 0.3905965983867645, 0.39217695593833923, -0.5298243165016174, -0.12872478365898132, -0.1592089980840683, -0.32013559341430664, 0.47471460700035095, -0.08356481790542603, 0.046647001057...
if (bitsRemaining < 4) { nextChar = (byte)((b >> (3 - bitsRemaining)) & 31); returnArray[arrayIndex++] = ValueToChar(nextChar); bitsRemaining += 5; }
[ -0.3156651258468628, -0.34490716457366943, 0.440854549407959, -0.3782431483268738, 0.2899291217327118, 0.1790444403886795, 0.3727819323539734, -0.5456186532974243, -0.23143097758293152, -0.2448127567768097, -0.2711166441440582, 0.5981304049491882, -0.04433498904109001, -0.08589689433574677...
bitsRemaining -= 3; nextChar = (byte)((b << bitsRemaining) & 31); } //if we didn't end with a full char if (arrayIndex != charCount) { returnArray[arrayIndex++] = ValueToChar(nextChar); while (arrayIndex != charCount) returnArray[arrayIndex++] = '='; ...
[ -0.23249591886997223, -0.3533858358860016, 0.6963931322097778, -0.33050432801246643, 0.034866273403167725, 0.14315348863601685, 0.3035154938697815, -0.5321122407913208, -0.12452902644872665, -0.2493007928133011, -0.10431916266679764, 0.48589348793029785, -0.003904944285750389, 0.0811926648...
} return new string(returnArray); } private static int CharToValue(char c) { int value = (int)c; //65-90 == uppercase letters if (value < 91 && value > 64) { return value - 65; }
[ 0.06130414083600044, -0.12611743807792664, 0.5455411076545715, -0.31937146186828613, 0.3118355870246887, 0.5310173630714417, 0.05279792100191116, -0.34685420989990234, -0.20255208015441895, -0.306807279586792, -0.3666234016418457, 0.462839275598526, -0.3950950801372528, 0.17505133152008057...
//50-55 == numbers 2-7 if (value < 56 && value > 49) { return value - 24; } //97-122 == lowercase letters if (value < 123 && value > 96) {
[ 0.4381923973560333, 0.19781039655208588, 0.14472351968288422, -0.16474218666553497, 0.048734426498413086, 0.342022567987442, 0.1045948714017868, -0.7191024422645569, 0.012966121546924114, -0.3134957253932953, -0.4270578622817993, 0.4677703082561493, -0.09384380280971527, -0.328718334436416...
return value - 97; } throw new ArgumentException("Character is not a Base32 character.", "c"); } private static char ValueToChar(byte b) { if (b < 26) { return (char)(b + 65); } if (b < 32)
[ -0.08572550117969513, 0.1940455585718155, 0.30019113421440125, -0.5278031826019287, 0.07140526175498962, 0.31126904487609863, 0.17842428386211395, -0.3462432026863098, 0.05863789841532707, -0.0740555077791214, -0.41167283058166504, 0.45649996399879456, -0.1828540414571762, 0.11312986165285...
{ return (char)(b + 24); } throw new ArgumentException("Byte is not a value Base32 value.", "b"); } } ```
[ -0.08647270500659943, 0.10909056663513184, 0.015531910583376884, -0.3653656840324402, -0.06990024447441101, 0.22727634012699127, 0.2223386913537979, -0.18583592772483826, -0.19148316979408264, -0.29908686876296997, -0.2974974513053894, 0.6132535934448242, -0.3602817952632904, 0.08373697847...
In my current project, I am using four grid views in different tabs. As the system has developed, they have some shared methods, such as show a custom tooltip and a right click menu for when on rows. I am now going through a code cleaning exercise. What I see below is that I now have four event handlers calling the sa...
[ 0.3287324905395508, 0.044499363750219345, 0.46444788575172424, -0.21491050720214844, -0.25761649012565613, 0.09921057522296906, 0.05607306957244873, -0.024575555697083473, -0.49506211280822754, -0.7338274717330933, 0.34637710452079773, 0.7096826434135437, -0.3226107060909271, 0.32821136713...
sender, GridMenuEventArgs e) { GridMenu(sender, e); } private void grdApplicantsLevel1_ShowGridMenu(object sender, GridMenuEventArgs e) { GridMenu(sender, e); } private void grdApplicationsLevel1_ShowGridMenu(object sender, GridMenuEventArgs e) { GridMenu(sender, e)...
[ -0.11668303608894348, -0.37175193428993225, 0.5602659583091736, 0.032863181084394455, -0.18111957609653473, 0.229958638548851, 0.30267757177352905, -0.2871437966823578, -0.164713516831398, -0.8541179299354553, -0.5129242539405823, 0.6177593469619751, -0.5367549061775208, 0.3671227693557739...
private void GridMenu(object sender, GridMenuEventArgs e) { GridView view = (GridView)sender; if (view.CalcHitInfo(e.Point).InRow) popupMenu1.ShowPopup(Cursor.Position); } ``` Instead of registering directly to `GridMenu`, create a general event handler named `Grid_ShowGridMenu`. ...
[ -0.18758535385131836, -0.20305056869983673, 0.5010777711868286, 0.03492182120680809, -0.07652345299720764, 0.13059653341770172, 0.2656840980052948, -0.21004004776477814, -0.08502611517906189, -0.7409741282463074, -0.32972148060798645, 0.668891191482544, -0.4348028600215912, 0.3205170631408...
e` directly to `GridMenu`, pass only *necessary* values to `GridMenu` and change the signature of `GridMenu` so it can be more *reusable*. ``` private void GridMenu(GridView grid, Point hitPoint) { if (grid.CalcHitInfo(hitPoint).InRow) popupMenu1.ShowPopup(Cursor.Position); } ```
[ 0.01539417915046215, -0.2844771444797516, 0.7288026809692383, -0.0027988969814032316, 0.1794411838054657, 0.13115333020687103, -0.15073440968990326, -0.16923296451568604, -0.032178960740566254, -0.7843272686004639, -0.39033788442611694, 0.4585345983505249, -0.38110506534576416, 0.163315325...
I have a foo that has a relationship to many bar's. When I delete bar's in my system I want to keep them in the database for some crazy business reason so I just set a deleted field to true. Can I specify in my hibernate mapping that I only want my collection to hold elements where that field is false? Hibernate prov...
[ 0.4714242219924927, 0.25542789697647095, 0.3927060663700104, -0.3578866720199585, -0.12118241935968399, -0.14561940729618073, 0.5725235939025879, -0.3874281942844391, 0.02655051462352276, -0.4093864858150482, -0.14774982631206512, 0.4680733382701874, -0.7366074323654175, -0.051848661154508...
class Bar { private Long id; private boolean deleted; private String text; // constructors, getters, setters } ``` Example mappings **NB: the `filter` element** ``` <hibernate-mapping package="org.nkl.hib"> <class name="Foo"> <id name="id" column="FOO_ID"> <generator class="sequence" /> ...
[ -0.053934670984745026, -0.14646273851394653, 0.33196821808815, -0.23316656053066254, -0.1703731268644333, 0.1557776778936386, 0.015150477178394794, -0.6000049114227295, -0.07852976769208908, -0.557174563407898, -0.23583965003490448, 0.14696112275123596, -0.578542172908783, 0.04865423589944...
</class> <filter-def name="deleted"> <filter-param name="deleted" type="boolean" /> </filter-def> </hibernate-mapping> <hibernate-mapping package="org.nkl.hib"> <class name="Bar"> <id name="id" column="BAR_ID"> <generator class="sequence" /> </id> <property name="text" /> <property name...
[ 0.09969287365674973, -0.09942835569381714, 0.42895710468292236, -0.33092620968818665, -0.2232842743396759, 0.20820112526416779, 0.36520352959632874, -0.6501054167747498, -0.016175515949726105, -0.8314598798751831, -0.3443559408187866, 0.47543200850486755, -0.3918256163597107, -0.1175005584...
Configuration configuration = new Configuration(); configuration.configure(); sessionFactory = configuration.buildSessionFactory(); } @Test public void testBarFilter() { doInTransaction(new Command() { public void execute(Session session) { Foo foo = new ...
[ 0.5253854393959045, -0.10084948688745499, 0.16708853840827942, -0.30581432580947876, 0.20218081772327423, 0.2043316662311554, 0.6590319275856018, -0.2860099971294403, 0.023648399859666824, -0.5081189274787903, -0.15998056530952454, 0.8091700077056885, -0.33062151074409485, 0.25683841109275...
foo.addBar(new Bar("bar1")); foo.addBar(new Bar("bar2")); foo.addBar(new Bar("bar3")); session.save(foo); } }); doInTransaction(new Command() { public void execute(Session session)
[ 0.395168662071228, 0.04692835360765457, 0.48954659700393677, -0.5216842889785767, 0.3183673918247223, 0.19266653060913086, 0.7383305430412292, -0.38354766368865967, -0.2517726719379425, -0.2620101273059845, -0.4594358801841736, 0.9916194081306458, -0.3738114833831787, 0.3837677240371704, ...
{ Bar bar = (Bar) session.createQuery( "from Bar b where b.text = 'bar2'"). uniqueResult(); bar.setDeleted(true);
[ 0.24203844368457794, 0.3681953251361847, 0.4386778771877289, -0.4121735990047455, 0.1915513426065445, 0.06824860721826553, 0.7901485562324524, -0.6129209995269775, -0.037557072937488556, -0.41821086406707764, -0.5078833699226379, 0.41058602929115295, -0.3172531723976135, 0.5319179892539978...
session.update(bar); } }); doInTransaction(new Command() { public void execute(Session session) { session.enableFilter("deleted"). setParameter("deleted", Boolean.FALSE);
[ 0.16898426413536072, -0.2014395296573639, 0.4210796654224396, -0.29688358306884766, 0.2206394374370575, 0.05973538011312485, 0.6912333369255066, -0.23327580094337463, -0.13051867485046387, -0.31553131341934204, -0.29463523626327515, 0.9224168062210083, -0.4268224537372589, 0.23880589008331...
Foo foo = (Foo) session.createQuery("from Foo"). uniqueResult(); assertEquals(2, foo.getBars().size()); } }); } private void doInTransaction(Command command) { Session session = sessionFactory.openSession();
[ 0.26405057311058044, 0.07175731658935547, 0.503756582736969, -0.43690913915634155, 0.049630772322416306, 0.19781149923801422, 0.8125789761543274, -0.4285154342651367, -0.1991247981786728, -0.1622941642999649, -0.2335801124572754, 1.0071922540664673, -0.35168367624282837, 0.4095156788825989...
Transaction tx = session.beginTransaction(); command.execute(session); tx.commit(); session.close(); } } interface Command { public void execute(Session session); } ```
[ -0.016515428200364113, 0.05771016329526901, 0.32771798968315125, -0.12897974252700806, 0.07364685833454132, 0.10670323669910431, 0.3383321166038513, -0.18079756200313568, -0.4434879720211029, -0.24768196046352386, -0.28082144260406494, 0.834254801273346, -0.39299529790878296, 0.49826046824...
Given a set of PDF files among which some pages are color and the remaining are black & white, is there any program to find out among the given pages which are color and which are black & white? This would be useful, for instance, in printing out a thesis, and only spending extra to print the color pages. Bonus points ...
[ 0.1501283347606659, -0.13276387751102448, 0.2136094868183136, 0.6408067941665649, 0.025409096851944923, -0.29433467984199524, -0.1961231231689453, -0.32174503803253174, -0.28648674488067627, -0.33373183012008667, -0.25504156947135925, 0.5637304186820984, 0.1987370103597641, -0.220955684781...
interesting questions I've seen! I agree with some of the other posts that rendering to a bitmap and then analyzing the bitmap will be the most reliable solution. For simple PDFs, here's a faster but less complete approach. 1. Parse each PDF page 2. Look for color directives (g, rg, k, sc, scn, etc) 3. Look for embedd...
[ 0.17774467170238495, 0.06593725085258484, 0.5164811611175537, 0.22356334328651428, -0.09844793379306793, 0.03813028708100319, 0.15769590437412262, -0.23196329176425934, 0.0621737465262413, -0.7232900857925415, -0.062096983194351196, 0.44434845447540283, -0.2075706273317337, -0.121936120092...
interesting to you, as it's very doable but not in 5 minutes. First the main program: ``` use CAM::PDF; my $infile = shift; my $pdf = CAM::PDF->new($infile); PAGE: for my $p (1 .. $pdf->numPages) { my $tree = $pdf->getPageContentTree($p); if (!$tree) { print "Failed to parse page $p\n"; next PAGE; ...
[ -0.17919376492500305, -0.126054584980011, 0.9372316002845764, 0.18469734489917755, 0.18612854182720184, -0.043700672686100006, -0.033446114510297775, -0.11880907416343689, -0.1508498191833496, -0.5132378339767456, -0.1439855992794037, 0.7650179862976074, -0.05022690072655678, -0.0349538214...
} elsif ($name eq 'rgb') { my ($r, $g, $b) = @rest; if ($r != $g || $r != $b) { print "Page $p is color\n"; next PAGE; } } elsif ($name eq 'cmyk') { my ($c,
[ -0.2529568076133728, 0.21080537140369415, 0.7329336404800415, -0.2169473022222519, 0.1788889467716217, 0.35368186235427856, -0.19857566058635712, -0.21660704910755157, -0.25989484786987305, -0.6789898872375488, -0.5282949805259705, 0.4266018271446228, -0.5605303049087524, 0.119439214468002...
$m, $y, $k) = @rest; if ($c != 0 || $m != 0 || $y != 0) { print "Page $p is color\n"; next PAGE; } } else { $uncertain = $name; } } if ($uncertain) {
[ -0.28442636132240295, 0.11451494693756104, 0.49654221534729004, -0.3880801796913147, 0.39294660091400146, 0.5408596992492676, 0.10195019841194153, -0.2703310549259186, -0.12159962207078934, -0.5729261040687561, -0.6194236874580383, 0.37667331099510193, -0.5038125514984131, 0.27354317903518...
print "Page $p has user-defined color ($uncertain), needs more investigation\n"; } else { print "Page $p is grayscale\n"; } } ``` And then here's the helper renderer that handles color directives on each page: ``` package My::Renderer::FindColors; sub new { my $pkg = shift; return bless { colors =...
[ -0.0018983413465321064, 0.06042646989226341, 0.7347896099090576, -0.3702828288078308, 0.12498839199542999, 0.3176860213279724, 0.18772996962070465, -0.4275076687335968, -0.15323017537593842, -0.7428674101829529, -0.41834723949432373, 0.5125209093093872, -0.33208784461021423, -0.00145130534...
$b) = @_; push @{$self->{colors}}, ['rgb', $r, $g, $b]; } sub g { my ($self, $gray) = @_; push @{$self->{colors}}, ['rgb', $gray, $gray, $gray]; } sub k { my ($self, $c, $m, $y, $k) = @_; push @{$self->{colors}}, ['cmyk', $c, $m, $y, $k]; } sub cs { my ($self, $name) = @_; $self->{cs} = $name; } su...
[ -0.34372106194496155, 0.025751212611794472, 0.4036239981651306, -0.31732165813446045, 0.019876129925251007, 0.44680917263031006, 0.3837130069732666, -0.32851463556289673, -0.1264313906431198, -0.5834326148033142, -0.5643674731254578, 0.2463609278202057, -0.3533913195133209, 0.2459863275289...
if ($cs eq 'DeviceRGB') { $self->rg(@rest); } elsif
[ -0.22675029933452606, -0.0750570148229599, 0.363400936126709, -0.5282379984855652, 0.008499380201101303, -0.06991846859455109, 0.3097163736820221, -0.2589070498943329, -0.2118278294801712, -0.6684337258338928, -0.2952888607978821, 0.5323320031166077, -0.2691890597343445, 0.0842310190200805...
($cs eq 'DeviceGray') { $self->g(@rest); } elsif ($cs eq 'DeviceCMYK') { $self->k(@rest); } else { push @{$self->{colors}}, [$cs, @rest]; } } sub sc { my ($self, @rest) = @_; $self->_sc($self->{cs}, @rest); } sub SC { my ($self, @rest) = @_; $self->_sc($self->{CS}, @rest); } sub scn { sc(@_); } sub SC...
[ -0.20072877407073975, 0.09279201179742813, 0.845929741859436, -0.39296820759773254, -0.08177055418491364, 0.17583660781383514, 0.16104495525360107, -0.3902375400066376, -0.3928508758544922, -0.6879572868347168, -0.552598774433136, 0.2621350586414337, -0.1847413182258606, 0.4041808843612671...
I have a Data: URL (see: <http://en.wikipedia.org/wiki/Data_URI_scheme>) (as a NSString) and I want to open it in Safari. How would you accomplish this (I tried openURL:.) Example: ``` data:text/html;base64,(Some Base64 Encoded Data Here) ``` In iPhone OS 2.2.1 and 5.0.1, in both the simulator and on a device, op...
[ 0.30387991666793823, 0.27172547578811646, 0.4635758697986603, -0.08884159475564957, -0.04857110604643822, -0.2594453990459442, 0.44325634837150574, -0.06137336790561676, -0.03721465915441513, -0.7456676363945007, -0.2179412841796875, 0.3929350972175598, -0.06303785741329193, 0.113359741866...
than 2K, probably) you could wrap it as a query parameter to an http URL that simply returns a redirect to the data url. Then you could use openURL to open the http URL. Yes, this means bouncing through some server, but it would work. Alternatively, since Safari obviously hasn't done it, you *could* tell the iPhone th...
[ 0.22294729948043823, -0.28915488719940186, 0.5176867842674255, 0.5530559420585632, -0.10786397755146027, -0.19124136865139008, 0.4535966217517853, -0.10849130153656006, -0.21602296829223633, -0.5905970931053162, -0.09773577749729156, 0.4295266568660736, -0.3445606827735901, 0.0544731169939...
a web page whose contents are nothing more than `<iframe src="<the data url>"/>` and again, use openURL on that URL.
[ 0.03322746232151985, 0.31542253494262695, 0.3583068251609802, 0.0817657858133316, -0.07827884703874588, -0.4406513273715973, 0.15695776045322418, 0.38267049193382263, -0.16540288925170898, -0.6687141060829163, -0.6499553918838501, 0.16387620568275452, -0.2617686092853546, 0.310426622629165...
I'm looking for a development job and see that many listings specify that the developers must be versed in multithreading. This appears both for Java job listings, and for C++ listings that involve "system programming" on UNIX. In the past few years I have been working with Java and using its various synchronization ...
[ 0.5175051093101501, 0.15972431004047394, -0.13011468946933746, -0.15646567940711975, -0.1198280081152916, -0.05969465151429176, -0.18741878867149353, 0.24379387497901917, -0.4094800651073456, -0.8674460649490356, 0.19982390105724335, 0.8106591701507568, -0.2023915797472, -0.137722730636596...
the techniques to address them are fundamentally different. Java obviously includes some nicer mechanisms and synchronized versions of collections, etc. If I want to refresh or relearn threading on UNIX, what's the best approach? Which library should I look at? etc. Is there some great current tutorial on threads in c...
[ -0.21538980305194855, 0.047851212322711945, -0.022635137662291527, 0.2100628763437271, -0.2506163418292999, 0.017381178215146065, 0.20643146336078644, 0.009520826861262321, -0.3524418771266937, -0.7478548884391785, 0.12369711697101593, 0.5576287508010864, -0.33970406651496887, -0.053759917...
write a lot more low-level thread primitives or rely on libraries (like boost) that are not part of the standardized language.
[ 0.2182767540216446, 0.025847015902400017, -0.1412893682718277, 0.2715893089771271, -0.13854292035102844, -0.22079578042030334, 0.2660258114337921, 0.23359601199626923, 0.04801894351840019, -0.3197937309741974, -0.28031808137893677, 0.3521496653556824, -0.1435941457748413, -0.40213954448699...
I'm trying to design a simple game ---Pong, Arkanoid--- using strictly "Proper OO", whatever that means. So, by designing myself to death, I'm trying to get to a point where I'll know what to do or not do next time... Who should handle, for example, colissions? And scorekeeping? My first idea was giving a couple job...
[ 0.11425081640481949, 0.4171132743358612, 0.09581763297319412, 0.14066492021083832, 0.11117466539144516, 0.15711690485477448, 0.08330047875642776, 0.13810892403125763, -0.2552894949913025, -0.58192378282547, 0.21477343142032623, 0.14684171974658966, -0.279495507478714, 0.09766596555709839, ...
then it owns the methods that use that state * if a method requires state from more than one object: + if a container object owns all of the objects used by the method, then it owns the method, too + otherwise you need a 'bridge' object to own the utility method + unless there is a strong argument for one object to ...
[ -0.07955194264650345, -0.06049109995365143, 0.2195781022310257, 0.5858289003372192, -0.11464056372642517, -0.2423933893442154, -0.2056347131729126, -0.28108373284339905, -0.13100847601890564, -0.5296489000320435, 0.0645691454410553, -0.017757324501872063, -0.22175318002700806, 0.6043422222...
I used the "pull interface" refactoring feature of Eclipse today to create an interface based on an existing class. The dialog box offered to create all the new methods of the new interface as "abstract" methods. What would be the benefit of that? I thought that the fact that you were allowed to declare interface met...
[ 0.5690568089485168, 0.012942972593009472, 0.026043318212032318, 0.03724665939807892, -0.3138773441314697, -0.2038312554359436, 0.04744058847427368, 0.005121774505823851, -0.003537527285516262, -0.1599826216697693, 0.21567486226558685, 0.4680602550506592, -0.4512590169906616, -0.04491646587...
why one would explicitly choose to mark them as abstract since if they're in an interface they are abstract anyway. According to the [Java Language Specification](http://docs.oracle.com/javase/specs/jls/se7/html/jls-9.html#jls-9.1.1.1), the `abstract` keyword for interfaces is obsolete and should no longer be used. (Se...
[ 0.22555497288703918, 0.2827537953853607, 0.25235462188720703, -0.23630324006080627, -0.16839957237243652, -0.12784449756145477, 0.2834884822368622, 0.11556202173233032, -0.21667033433914185, -0.4477403461933136, -0.053403060883283615, 0.4489764869213104, -0.43391698598861694, 0.26771339774...
I know this question has probably been asked already but I would really like to know of a program that will show line by line the differences between to word documents. Thus I need a word document format that supports this (.doc, .docx and .ods obviously don't). Are HTML and XML the only formats that come close to sup...
[ 0.17241668701171875, 0.08465556055307388, 0.43750378489494324, -0.012196261435747147, -0.32659655809402466, 0.013852881267666817, 0.2927081286907196, 0.19374434649944305, -0.13778690993785858, -0.5657001733779907, 0.04215344041585922, 0.8252451419830322, -0.07828903943300247, 0.08872614800...
I am trying to modify the default style of the ContextMenu in WPF. Normally you can creat a copy of the default in Expression Blend using the Edit Control Parts (Template) > Edit a Copy menu option. However I can't work out how to do this with a ContextMenu. Any idea how I can get the default style to modify? I am t...
[ 0.42309725284576416, -0.026407690718770027, 0.31608977913856506, -0.036457281559705734, -0.15844380855560303, -0.19266928732395172, 0.5608078837394714, 0.08544818311929703, -0.1743307262659073, -0.8729247450828552, 0.007887915708124638, 0.9651741981506348, -0.3104988634586334, 0.0261159762...
left side of the menu is wasted space. I would like to modify the default style of the context menu background to remove this. Simply I don't know how to access this default style. For templates and styles that are not accessible through the Expression Interface (such as the ContextMenu template) you can use the follow...
[ 0.11208046972751617, 0.07402434945106506, 0.5712811946868896, -0.3766575753688812, 0.2361871749162674, 0.1123289093375206, 0.5073047280311584, -0.5092880129814148, -0.09390410035848618, -0.6563830375671387, -0.16060204803943634, 0.7052716016769409, -0.36092206835746765, 0.10436462610960007...
When I select a `Node` in the `TreeView`, it highlights and I show data based on that `Node`. When I select another `Control` (the `TreeView` loses focus) it is no longer highlighted. How do I keep it highlighted after losing focus? While doing a search I cant tell which node is selected since I must keep the focus ...
[ 0.0327768437564373, -0.15922853350639343, 0.5704916715621948, 0.11653170734643936, -0.1397622972726822, -0.1726042777299881, 0.5431073904037476, -0.07316561043262482, -0.07895039767026901, -0.5233960151672363, -0.04425663501024246, 0.5165061950683594, -0.1686197966337204, 0.010037143714725...
Many programming languages introduce themselves with a simple "Hello World" program. As a programmer, I must admit that this does not give very good insight into the strenghts and capabilities of the language. What kind of problem would you suggest to use when providing a demo of a programming language? I think the "...
[ 0.21008098125457764, 0.2866826355457306, -0.36640554666519165, 0.10471785813570023, -0.2549157738685608, -0.20000116527080536, 0.2640864849090576, 0.5349680781364441, -0.14806875586509705, -0.668385922908783, -0.061911653727293015, 0.7257264256477356, -0.15950581431388855, 0.03553273156285...
format it correctly for that language * Your compiler is working and you know how to use it. So, for those reasons I don't find any better alternative to "Hello World." However, in terms of a good intro to languages in general, I'm a big fan of coding challenges like [Python Challenge](http://www.pythonchallenge.com/...
[ 0.5631135106086731, 0.2539091408252716, -0.28871864080429077, 0.28326693177223206, -0.1781034618616104, -0.14688633382320404, 0.166026771068573, 0.22493787109851837, -0.24837049841880798, -0.6700389385223389, -0.025570496916770935, 0.5638218522071838, -0.013092986308038235, -0.540104150772...
of the language. I only wish every language had such a fun programming challenge. I think a LISP, Haskell, C++, C, Java, etc Challenge would be a fun introduction to the languages for people. They could be tailored to the languages. The C++ challenge could quickly start having challenges involving pointers and other...
[ -0.030381636694073677, 0.25065404176712036, -0.15383055806159973, 0.3258223831653595, -0.12462766468524933, -0.0626237615942955, 0.24306677281856537, 0.21021728217601776, -0.32838860154151917, -0.49468591809272766, -0.08523475378751755, 0.7355181574821472, -0.4155985713005066, -0.081940434...
I am devoloping an windows application in dot net.It's config file includes sensitive data such as sql pass..So When deploying application i want to give it as encrypted. I googled arund and found one that Rsiprovider to encrypt the fields. But encryption is machine specific and needs deploying config file in clear mod...
[ 0.4469512701034546, 0.075527623295784, 0.2620803713798523, 0.07654568552970886, -0.0564253106713295, -0.32559826970100403, 0.38874551653862, -0.3624204099178314, -0.16497986018657684, -0.561221182346344, -0.1595674306154251, 0.6582494378089905, -0.31864187121391296, 0.17143531143665314, ...
that key... The post-setup encryption is meant to hide the config from prying eyes.
[ 0.2291775792837143, 0.1164763793349266, 0.480791300535202, 0.1201300323009491, 0.7888855934143066, -0.456092894077301, 0.058801066130399704, -0.04918937385082245, 0.09857446700334549, -0.10521353781223297, -0.25581949949264526, 0.5526423454284668, 0.03391041234135628, -0.05173613503575325,...
I'm toying with the idea of writing a physics simulation software in which each physical element would be simulated in its own thread. There would be several advantages to this approach. It would be conceptually very close to how the real world works. It would be much easier to scale the system to multiple machines. ...
[ 0.5630525946617126, -0.1667785346508026, 0.2923559844493866, 0.5132972598075867, 0.11725961416959763, 0.051708679646253586, 0.302823543548584, 0.07619349658489227, -0.48580947518348694, -0.46985939145088196, 0.4289565980434418, 0.06174656003713608, -0.20731545984745026, 0.31746920943260193...
that ensures all threads regularly synchronize with each others. I just need to be able to ask the runtime (whichever it is---could be Java, Erlang, or whatever is most appropriate for this problem) to run the threads at a more or less equal speed. Any suggestions would be extremely appreciated. **UPDATE 2009-03-16**...
[ 0.5728305578231812, 0.09928115457296371, 0.18870432674884796, 0.027786986902356148, -0.04406831040978432, -0.16444309055805206, 0.6802088022232056, 0.07480888068675995, -0.4448574483394623, -0.42397868633270264, -0.09265711903572083, 0.48202991485595703, -0.28991687297821045, -0.0468359999...
best answer to the question itself, which is why I accepted it. You'll need some kind of synchronization. [CyclicBarrier](http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/CyclicBarrier.html) class has what you need: > A synchronization aid that allows a > set of threads to all wait for each > other to re...
[ 0.21184147894382477, -0.11680421233177185, 0.5227413177490234, 0.0464654341340065, -0.07698258012533188, -0.08602229505777359, 0.19421696662902832, -0.2639566659927368, -0.3665043115615845, -0.6221185326576233, 0.20254045724868774, 0.16589611768722534, -0.4303203225135803, 0.00512750679627...
were slower. When remaining threads reach the barrier, they all will continue.
[ 0.5339410305023193, -0.5432558655738831, 0.3875477612018585, 0.38275715708732605, -0.349424809217453, 0.2709324061870575, 0.5319953560829163, -0.22398771345615387, -0.47792893648147583, -0.9058694243431091, 0.06592458486557007, -0.11749599128961563, -0.07543207705020905, 0.3578751385211944...
I'm currently brushing up on LINQ and am trying to comprehend the difference between the `let` and using the `into` keyword. So far the `let` keyword seems better than the `into` keyword as far as my understanding goes. The `into` keyword essentially allows one to continue a query after a projection. (Just want to st...
[ 0.17311064898967743, -0.12583620846271515, 0.40752989053726196, -0.25106263160705566, -0.0653776228427887, -0.11871051788330078, 0.03620758652687073, -0.4466944932937622, 0.2692939043045044, -0.4206611216068268, -0.24093306064605713, 0.32431527972221375, -0.2897632122039795, 0.217208877205...
takes the result of the select and places it into the `noVowel` variable which then allows one to introduce additional `where`, `orderby`, and `select` clauses. Once the `noVowel` variable is created, the `n` variable is no longer available. The `let` keyword, on the other hand, uses temp anonymous types to allow you...
[ 0.37747645378112793, -0.17502367496490479, 0.4859687387943268, -0.0671883076429367, 0.19873572885990143, -0.12150196731090546, 0.09945013374090195, -0.47936564683914185, 0.1452471911907196, -0.3914942443370819, -0.39592835307121277, 0.3655925393104553, -0.4603625535964966, 0.37545138597488...
haven't used it in this case). While I can see the difference, I can't quite understand why one would want to use the `into` keyword over the `let` keyword unless one explicitly wanted to make sure that previous variables were not able to be used in latter parts of the query. So, is there a good reason why both key...
[ 0.6198456287384033, -0.08845501393079758, 0.06901384890079498, -0.02568194828927517, -0.09136373549699783, -0.13103626668453217, 0.1636858731508255, -0.1324170082807541, 0.18943272531032562, -0.47728949785232544, -0.2581914961338043, 0.224509134888649, -0.23081031441688538, 0.4456148743629...
tmp = from n in names select Regex.Replace(n, "[aeiou]", ""); var noVowels = from noVowel in tmp where noVowel.Length > 2 select noVowel; ``` (Admittedly in this case I would do it with dot notation in two lines, but ignoring that...) Often you don't *want* the whole baggage ...
[ 0.2239612340927124, -0.3043595850467682, 0.38658028841018677, -0.19966264069080353, -0.13786019384860992, 0.2876030206680298, 0.40746787190437317, -0.5600391626358032, -0.3968763053417206, -0.5585700869560242, -0.29667744040489197, 0.1609925478696823, -0.5087684988975525, 0.089670456945896...
query in two as per the above example. Not only does that mean the earlier parts of the query can't be used when they shouldn't be, it simplifies what's going on - and of course it means there's potentially less copying going on at each step. On the other hand, when you *do* want to keep the rest of the context, `let`...
[ -0.010855899192392826, -0.09339205175638199, -0.011891037225723267, 0.29507142305374146, -0.30550673604011536, -0.12944038212299347, 0.08671754598617554, -0.2630575895309448, -0.11339810490608215, -0.7603209614753723, -0.06821933388710022, 0.31751549243927, -0.2479599267244339, 0.093005910...
I'm currently transfering some source code from a Subversion (SVN) repository to my client's Team Foundation Server. One of the things I stumbled upon is that there seems to be no way to edit the repository without first pulling all files in that repository to a local working folder in the local workspace. I'm using Vi...
[ -0.08267063647508621, 0.044018182903528214, 0.17037205398082733, 0.04664598032832146, -0.06113990768790245, 0.0183275006711483, 0.26505792140960693, 0.03808208554983139, -0.271786630153656, -0.9379566311836243, -0.11944253742694855, 0.2542288303375244, -0.27037936449050903, -0.015925327315...
a local copy of that folder. I want to create the new "Docs" folder server-side. However, I noticed the "New Folder" button on the Source Control Explorer toolbar is grayed out when the selected repository folder isn't available as a working folder in the local workspace. Using SVN this never was a problem, because us...
[ 0.3359781801700592, -0.13214954733848572, 0.5251346230506897, 0.005618290510028601, -0.1387624591588974, -0.1534918248653412, 0.5111583471298218, 0.2673051357269287, -0.6402551531791687, -0.6022650003433228, -0.03534897416830063, 0.8930339217185974, -0.07404451072216034, 0.2401906847953796...
do need to map the server-side folder to a workspace on your local machine. In source control explorer, use the "Workspaces..." drop down box to create such a mapping. I find that the simplest approach is to map the root node in TFVC ($) to a directory on your local machine such as c:\tfs, and allow the hierarchy to p...
[ 0.0036652821581810713, -0.07691001892089844, 0.14989463984966278, 0.07625947147607803, 0.2223762720823288, -0.2140296995639801, -0.02628479339182377, 0.2835140824317932, -0.06501196324825287, -0.7976211905479431, -0.23192566633224487, 0.4936627149581909, -0.32139086723327637, 0.14425812661...