text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Is it possible to map an enum as a string using Fluent Nhibernate? Yes, it does that by default if you just do: ``` Map(x => x.YourProperty); ``` Make sure you're using the latest version off the trunk. --- As [Yavor Shahpasov](https://stackoverflow.com/users/463181/yavor-shahpasov) pointed out in the comments, in...
[ -0.19880282878875732, 0.007121238857507706, 0.24413281679153442, -0.051135268062353134, -0.10912317037582397, 0.03983394801616669, 0.3966858386993408, -0.15026454627513885, -0.15435229241847992, -0.662881076335907, -0.37324681878089905, 0.2993444502353668, -0.5179693698883057, 0.3566038608...
I have this code, ``` showmessage('C:\TEMP\'+openfiles[openfilelist.ItemIndex].ID); if removedir('C:\TEMP\'+openfiles[openfilelist.ItemIndex].ID) then showmessage('Removed') else showmessage('Failed'); ``` The message shows `C:\TEMP\0` and this directory does exist as the program created it earlier and used file...
[ -0.11400622874498367, 0.3759104311466217, 0.30017659068107605, -0.2143321931362152, 0.20322108268737793, 0.016872338950634003, 0.5493295788764954, -0.3512110114097595, -0.1738973706960678, -0.5156614184379578, -0.3393177092075348, 0.3949779272079468, -0.4265916049480438, 0.3497274219989776...
string to whatever `removedir()` is expecting. I looked this up at Delphi basics and it's expecting a string. I'm confused, since string + string = string. What is going on? Make sure that neither your program nor any other program have the directory as their current working directory. When you recompile the program t...
[ 0.18729166686534882, -0.21674370765686035, 0.2502904236316681, -0.06639743596315384, 0.15669146180152893, -0.31550976634025574, 0.08501259982585907, 0.22386257350444794, -0.16526448726654053, -0.2062637209892273, -0.266681969165802, 0.5060040950775146, -0.5576852560043335, 0.36515870690345...
I have a windows service that hosts the main WCF service. The clients for this service are both hosted in IIS 7, the first one is an IIS hosted WCF service and the second is a standard Asp.Net application. Both of the IIS hosted clients communicate with the windows service over named pipes. The IIS hosted WCF service ...
[ 0.32148581743240356, 0.24606677889823914, 0.6537089943885803, -0.2646450996398926, -0.1288161724805832, -0.2968846261501312, 0.4206695854663849, -0.20701037347316742, 0.042489729821681976, -0.9388980865478516, -0.011956220492720604, 0.5349214673042297, -0.3044799566268921, 0.55425876379013...
know where. And second, why would the IIS hosted WCF service be able to communicate without issue, but the Asp.Net application fail? Ok, I solved it, or rather I figured out where the permission issue was. It turns out the Anonymous Authentication setting was using some weird user created by our client (the physical p...
[ 0.2530286908149719, 0.005153445992618799, 0.36829930543899536, 0.49580657482147217, 0.15729235112667084, -0.5721583366394043, 0.2694154381752014, 0.029479658231139183, -0.16956597566604614, -0.4516342878341675, 0.1373239904642105, 0.20875020325183868, -0.14552760124206543, 0.27633205056190...
there were virtually no articles relating to it.
[ 0.2865953743457794, 0.4251948595046997, -0.3104289472103119, 0.09453170746564865, -0.17493484914302826, -0.0424451045691967, -0.15551771223545074, 0.44752150774002075, -0.03418751433491707, 0.1612154096364975, -0.037686049938201904, 0.09610378742218018, -0.023902371525764465, 0.32971131801...
I have a Qt/C++ project and an old VB6 project. The user base might not have permissions to HKEY\_LOCAL\_MACHINE due to lack of administrator rights but I need to update a registry entry. How can I get a list of the groups to which a user belongs? I have this [is\_admin](http://web.archive.org/web/20150324022053/htt...
[ 0.11539747565984726, 0.462446928024292, -0.14984457194805145, -0.010387011803686619, 0.06577746570110321, -0.32641249895095825, 0.2436307817697525, -0.010015507228672504, -0.2330138385295868, -0.6867495179176331, 0.036491066217422485, 0.17963439226150513, -0.025089316070079803, 0.331840753...
I'm using a Delphi TActionList, with Shortcut Keys for some actions. I want to prevent certain actions from being triggered multiple times by keyboard auto-repeat, but I do *not* want to affect auto-repeat operation globally. What's the best way of doing this? ***Clarification***: I still need to handle multiple fast...
[ 0.32631728053092957, -0.0712251141667366, 0.4498513340950012, 0.01793169602751732, 0.13041087985038757, -0.023092297837138176, 0.8831531405448914, -0.1702945977449417, -0.5135415196418762, -0.5143086910247803, -0.12573909759521484, 0.645074188709259, -0.44891074299812317, -0.04830895364284...
make this work.
[ 0.6055503487586975, 0.2285478711128235, -0.3148837089538574, 0.4936005771160126, 0.14526797831058502, 0.0670957937836647, -0.055996380746364594, 0.35427558422088623, 0.6197561025619507, -0.8310555219650269, 0.05465715378522873, 0.11385934054851532, 0.06392086297273636, 0.06238570064306259,...
From a logical point of view an application may need dozens or hundreds of threads, some of which will we sleeping most of the time, but a very few will be always running concurrently. The question is: Does it make any sense to spawn more concurrent threads than processors there are in a system, or it is a waste? I've...
[ 0.5695064067840576, 0.08117883652448654, -0.009914702735841274, 0.45451924204826355, 0.1872842162847519, -0.08834271878004074, 0.02754204161465168, 0.27460822463035583, -0.5428908467292786, -0.5967845916748047, 0.11508025228977203, 0.4168432354927063, -0.23307448625564575, 0.04881533980369...
network IO, you can often improve throughput by adding a few more threads. Those extra threads will be awake and doing stuff while the other threads are blocking on IO.
[ 0.5487532615661621, -0.3035238981246948, 0.1897820234298706, 0.41120871901512146, -0.18503445386886597, -0.2889919877052307, 0.1407259851694107, 0.3375360667705536, -0.7349451780319214, -1.0732260942459106, 0.20795190334320068, 0.38100096583366394, -0.35049980878829956, -0.0144627448171377...
I'm trying to execute a asp.net webservice using jquery. When I pass only one input parameter it works fine: ``` $.ajax({ type: "POST", url: url, data: "{'Id1':'2'}", contentType: "application/json; charset=utf-8", dataType: "json", success: callback }); ``` but if I try to pass mu...
[ 0.01613592356443405, -0.04816092923283577, 0.29704180359840393, -0.02374829724431038, -0.217635840177536, 0.06567945331335068, 0.5315525531768799, -0.21898974478244781, 0.0008138175471685827, -0.8209378123283386, -0.2725084722042084, 0.37771445512771606, -0.3305962085723877, -0.30789816379...
dataType: "json", success: callback }); ``` Of course, when I try to pass 2 input parameters, I modify the web method so that it takes 2 input parameters. Any ideas? Found the solution: It should be: ``` "{'Id1':'2','Id2':'2'}" ``` and not ``` "{'Id1':'2'},{'Id2':'2'}" ```
[ -0.1781027466058731, -0.011955906637012959, 0.4189358949661255, 0.1270391345024109, 0.11133746802806854, 0.0569305494427681, 0.14413008093833923, -0.3712283670902252, -0.075184665620327, -0.7083024382591248, -0.20838114619255066, 0.44961538910865784, -0.39162325859069824, -0.25484994053840...
I'm trying to figure out how to best lay this out. I'll explain what I have now, but I'm wondering if there is a better way to do this. I have a class Section that has basic properties: Name, Description, et.al. I use a list of Sections for the users to choose from. They can add a Section as many times as they want to...
[ 0.3362937867641449, 0.14263063669204712, 0.08053097128868103, 0.27641016244888306, -0.0736980065703392, 0.0716349333524704, -0.01905343495309353, 0.08883398026227951, -0.07467343658208847, -0.711761474609375, 0.0589287094771862, -0.1997310370206833, -0.01675724796950817, 0.3719731569290161...
be displayed. This Group property is not on the table, there is no group needed when I list out the Sections for the user to choose from, it wouldn't make sense. Think of this Section they are adding as a clone with extra properties. I have another table that has a foreign key to the Parent and to the Section. Many se...
[ 0.3477476239204407, 0.15669406950473785, 0.5219966173171997, 0.10305001586675644, -0.09644058346748352, 0.08706334978342056, -0.0074565354734659195, -0.16094712913036346, -0.17823565006256104, -0.8740196824073792, 0.047179605811834335, 0.091385617852211, -0.26133835315704346, 0.48928594589...
of its Sections, do I want to try and use the same Section class and add a Grouping property? ``` Section 1 Section 2 Section 3 Parent 1 Section 1 - Group = g1, DisplayOrder = 1 Section 1 - Group = g2, DisplayOrder = 2 Section 2 - Group = g2, DisplayOrder = 3 Section 3 - Group = g3, DisplayOrde...
[ -0.12857766449451447, 0.5084027051925659, 0.20103034377098083, 0.026722818613052368, -0.26974689960479736, 0.2449834942817688, 0.3689509332180023, -0.25944992899894714, -0.44962695240974426, -0.25836798548698425, -0.5048173069953918, -0.3242720365524292, -0.37119242548942566, 0.38794168829...
= g2, DisplayOrder = 2 Section 2 - Group = g3, DisplayOrder = 3 ``` Tell me if you have no idea what I'm saying and I'll try to explain it better...or I'll delete it and pretend like I never asked. =P It sounds like the group isn't an intrinsic property of a section. It's only meaningful when relating sections t...
[ 0.02761108987033367, 0.23820364475250244, 0.197036013007164, -0.12254232168197632, -0.18904513120651245, 0.002689796034246683, 0.1218390241265297, -0.18353226780891418, -0.2848740220069885, -0.408395379781723, -0.2571794390678406, -0.013912292197346687, -0.4401087760925293, 0.4519219994544...
a property of parent, e.g. ``` interface IParent { void AddSection(string group, ISection section); IEnumerable<ISection> GetSectionsInGroup(string group); } ``` You may need more than one section grouping strategy, after all, so it's best not to couple your section design to the types of collection it can...
[ 0.15300968289375305, -0.10494113713502884, 0.12790967524051666, 0.1444340944290161, 0.09355998039245605, -0.21032513678073883, -0.04211035743355751, -0.22377125918865204, -0.11151548475027084, -0.7084353566169739, -0.2864641547203064, 0.06829667836427689, -0.152551531791687, 0.410477399826...
i have a label in my form, and im trying to get the value of the label using HttpContext.Current.Request. But the label is not int he key, only the input types. is there any way of retrieving the value of a label? Hello Request["lbl1"] doesnt work. you cannot get label values from request collection. Textboxes, Dro...
[ 0.12243705987930298, 0.04363353177905083, 0.31843820214271545, 0.019839441403746605, -0.18237127363681793, -0.1656687706708908, 0.3543187975883484, -0.25413432717323303, -0.19025680422782898, -0.7125198245048523, -0.1130433902144432, 0.33574238419532776, -0.3501332700252533, 0.153614118695...
The subversion repository at work was set up without much planning as to its structure. There are currently no explicit tags, trunk or branches configured, although some tagging metadata is present through the use of subclipse:tags Currently the repository is in the format: > /CoreCodeA > > > /CoreCodeB > > > /Pr...
[ 0.18272292613983154, -0.35384732484817505, 0.2786366641521454, 0.06242316588759422, -0.1758989840745926, -0.12392817437648773, 0.3368627727031708, 0.008092165924608707, -0.3262471556663513, -0.35445651412010193, -0.1555282324552536, -0.15498965978622437, -0.35267922282218933, 0.23075973987...
upon the same theme). These dependencies are referenced inside the contents of some text based project property files. I've been playing with using the svndumpfilter command, piping the output through sed and reorganising this into two separate repositories ("old" and "new"). Easy enough to do, and I now have two dist...
[ 0.3304544687271118, -0.07989078015089035, 0.507699191570282, 0.05491863936185837, 0.16521945595741272, -0.2098073959350586, 0.349610835313797, -0.09957457333803177, -0.39824000000953674, -0.6080262064933777, -0.16722050309181213, 0.4378111958503723, 0.027324747294187546, 0.2619845569133758...
I need to have tags and branches in this codebase sooner rather than later. But I also don't want to have to force the developers to re-check out their projects if I change my mind a few months down the line. I guess my choices for each repository are: 1. Mark the repository with a "pre-restructuring" tag, reorganise...
[ 0.5922076106071472, 0.16000597178936005, 0.14911657571792603, -0.06764744222164154, 0.09395512193441391, -0.07907142490148544, 0.5340790152549744, -0.1809932142496109, -0.28103870153427124, -0.6139745712280273, -0.4059220850467682, 0.54590904712677, -0.15439452230930328, 0.1297029256820678...
Previous builds are broken, will definitely require x.x.1 patch releases if ever needed again 3. Restructure the entire repository AND edit the project property files at each stage * Good: Continuity of code is maintained and projects should build * Bad: Editing actual content of files is far more fragile than simply...
[ 0.33519741892814636, 0.08725062757730484, 0.21304991841316223, 0.15181829035282135, 0.039557360112667084, -0.18539229035377502, 0.5531787872314453, -0.17912743985652924, -0.2139895260334015, -0.6523665189743042, -0.10932928323745728, 0.49652382731437683, -0.10268647223711014, 0.02247312664...
knowing what's the amount of code, number of needed changes in code after restructuring and number of people working on the code, it is quite difficult to recommend anything specific, but I'd start with getting all the affected people on board with this and dedicating 1-2 days to the repo overhaul - code freeze, only f...
[ 0.6304284334182739, 0.028111863881349564, 0.1874762326478958, 0.15494012832641602, -0.02806478552520275, -0.13968108594417572, 0.5945958495140076, -0.0708099752664566, -0.32820120453834534, -0.2424498349428177, -0.23550505936145782, 0.5219414234161377, -0.030432967469096184, -0.22133769094...
worry that much about access to the historical code layout. You can always tag the current layout under something like /oldlayoutdonottouchthiswithoutrealneed and leave it there for patching the old versions. For tricks like this, SVN is a really great tool. P.S. I have never used subclipse, but looks like subclipse t...
[ 0.1526089459657669, -0.08541710674762726, 0.3674858808517456, 0.12151267379522324, 0.11004762351512909, -0.3411211371421814, 0.3815997540950775, 0.3350588083267212, -0.4016224443912506, -0.7370899319648743, 0.0938086286187172, 0.45420852303504944, -0.05789323151111603, 0.09147564321756363,...
If you have a List how do you return the item if a specified property or collection of properties exists? ``` public class Testing { public string value1 { get; set; } public string value2 { get; set; } public int value3 { get; set; } } public class TestingList { public void TestingNewList() { ...
[ 0.7512750625610352, -0.11151903122663498, -0.18806742131710052, 0.08301273733377457, -0.13975979387760162, -0.11437661945819855, 0.4985179901123047, -0.5654435157775879, -0.07988809049129486, -0.5973271727561951, -0.20598933100700378, 0.6082295775413513, -0.29549357295036316, 0.19382882118...
{ new Testing {value1 = "Value1 - 1", value2 = "Value2 - 1", value3 = 3}, new Testing {value1 = "Value1 - 2", value2 = "Value2 - 2", value3 = 2},
[ 0.3015001714229584, -0.17691394686698914, 0.009120313450694084, 0.10979072004556656, 0.006278405897319317, 0.14085669815540314, 0.5725685954093933, -0.5669010281562805, 0.19409535825252533, -0.5476385951042175, 0.010856185108423233, 0.5233317613601685, 0.0929190069437027, 0.162574663758277...
new Testing {value1 = "Value1 - 3", value2 = "Value2 - 3", value3 = 3}, new Testing {value1 = "Value1 - 4", value2 = "Value2 - 4", value3 = 4},
[ 0.29870688915252686, -0.18363474309444427, 0.11703912168741226, 0.1412481963634491, -0.020556269213557243, 0.13940152525901794, 0.4818824827671051, -0.6130560040473938, 0.16696318984031677, -0.5049776434898376, -0.0031051672995090485, 0.5381723642349243, 0.10296304523944855, 0.198747456073...
new Testing {value1 = "Value1 - 5", value2 = "Value2 - 5", value3 = 5}, new Testing {value1 = "Value1 - 6", value2 = "Value2 - 6", value3 = 6},
[ 0.31070613861083984, -0.22869692742824554, 0.11595387756824493, 0.14450675249099731, 0.03179985657334328, 0.1490907073020935, 0.4760071039199829, -0.5964118242263794, 0.1852969229221344, -0.5276870727539062, 0.014775792136788368, 0.5275556445121765, 0.14893478155136108, 0.24154335260391235...
new Testing {value1 = "Value1 - 7", value2 = "Value2 - 7", value3 = 7} }; //use testList.Contains to see if value3 = 3 //use testList.Contains to see if value3 = 2 and value1 = "Value1 - 2" } } ``` If you're using .NET 3.5 or better, LINQ is the answer to this one: ```...
[ 0.5396877527236938, -0.2138969749212265, 0.34337517619132996, 0.031667403876781464, 0.13470058143138885, -0.318135529756546, 0.3317451477050781, -0.49147829413414, -0.017728887498378754, -0.6710585355758667, -0.05796298384666443, 0.5023530125617981, -0.17515671253204346, 0.0638650879263877...
== 3); testList.Where(t => t.value3 == 2 && t.value1 == "Value1 - 2"); ``` If not using .NET 3.5 then you can just loop through and pick out the ones you want.
[ 0.40814584493637085, -0.30452534556388855, -0.055220846086740494, -0.10901612043380737, 0.08246076107025146, -0.22983795404434204, 0.6709498167037964, -0.3220115303993225, 0.02340392954647541, -0.5263514518737793, -0.03972959518432617, 0.3348419666290283, -0.36848586797714233, -0.044464167...
I am trying to style some form labels by selecting them with their 'for' attribute. But nothing is being picked up when I preview it in IE7. I'm doing this because I'd like to style them differently to each other, without adding to the existing markup. So if my css looks like the following, I get nothing: ``` <style...
[ 0.6402090787887573, 0.199797123670578, 0.26048406958580017, -0.3857930600643158, -0.11043350398540497, 0.08589784801006317, 0.21904197335243225, -0.29128965735435486, 0.06000887230038643, -1.033293604850769, -0.02983962930738926, 0.5017053484916687, -0.39900124073028564, -0.179239988327026...
the way I'm writing the CSS, IE7, or something else? This user seems to have had the same problem you are having: [here](http://reference.sitepoint.com/css/attributeselector#usernote472) He says that because "for" is a reserved word, it can't be used as a property name. But 'htmlFor' is the DOM property name associate...
[ 0.41361546516418457, 0.14660607278347015, 0.6361181139945984, -0.19198164343833923, -0.15079206228256226, -0.10866428166627884, -0.030876336619257927, -0.1816537082195282, -0.33409562706947327, -0.5424885749816895, -0.016579536721110344, 0.5329363942146301, -0.12801115214824677, 0.16884128...
When calling `execl(...)`, I get an `errno=2`. What does it mean? How can I know the meaning of this `errno`? You can use [`strerror()`](http://en.cppreference.com/w/c/string/byte/strerror) to get a human-readable string for the error number. This is the same string printed by [`perror()`](http://en.cppreference.com/w/...
[ 0.04511133208870888, 0.017376406118273735, 0.2998199164867401, -0.1370583325624466, -0.03510693833231926, -0.10786204040050507, 0.3287914991378784, -0.07603044807910919, -0.2412019968032837, -0.4486774504184723, -0.09287068247795105, 0.7019943594932556, -0.285391241312027, 0.14990894496440...
How do I prevent the name of the Solution Folder in a VS project from being appended to the namespace generated for new items added to the solution folder? Example: C# project in a VS solution Default Namespace set in C# project properties: "BigClient.Domain" If you create a solution folder in this project called "My...
[ 0.371550977230072, -0.15400104224681854, 0.4259662926197052, 0.147683247923851, -0.07511087507009506, -0.21957840025424957, 0.35486406087875366, -0.18977387249469757, -0.2084501087665558, -0.8028542399406433, -0.07720638066530228, 0.4948362410068512, -0.2850363850593567, 0.3511232137680053...
"MySpecialStuff" solution-folder-name to the namespace. I seem to recall reading a blog post by someone that this was possible (either via options/settings in VS or a registry setting) but I cannot recall where or how now that I want it :) My platform is VS 2008 if answer = different for different VS versions. Make a...
[ 0.2787523567676544, -0.19161349534988403, 0.692692756652832, 0.02732010930776596, -0.3168752193450928, -0.02720792219042778, 0.35174891352653503, 0.2705407440662384, -0.07507109642028809, -0.882677435874939, 0.057685211300849915, 0.7000306844711304, -0.0028267530724406242, 0.06234878674149...
I am submitting a ColdFusion Form and I want to run some JavaScript to check field validation before I run my ColdFusion code to process the form as needed. How can I do this? What do I do in JS to call my .cfm file after the form passes validation? Thanks! -Jason You need ``` <form name="myform" action="myserversc...
[ 0.34824469685554504, 0.47338876128196716, 0.5790460705757141, 0.04841921478509903, -0.036389607936143875, -0.22074228525161743, 0.5026519894599915, -0.24523000419139862, -0.07860743254423141, -0.411609947681427, -0.017225176095962524, 0.3551798164844513, 0.214579239487648, -0.2437143176794...
Currently my team uses Visual Sourcesafe, and being very familiar with how horrible the GUI is first hand and having heard the internet mummer about how unreliable it is, I've been trying to push a move to SVN. Today I was talking to manager about the eventual move, which he supports, and he asked if it was possible t...
[ 0.48512741923332214, 0.2135246992111206, 0.33174601197242737, -0.01135179866105318, -0.2819097936153412, -0.20543940365314484, 0.03243016451597214, 0.2875288724899292, -0.22088953852653503, -1.0129430294036865, 0.13934214413166046, 0.6252449154853821, -0.0010536035988479853, 0.191965848207...
SVN, and he brought up that that may be a major sticking point in the migration. I told him that in my local SVN (which I keep to ease my development, checking only periodically in sourcesafe), I place shared code/libraries in one location, and refer ANT to that location. However, I got the sense that he wasn't hugely...
[ 0.21209704875946045, 0.014946901239454746, 0.18323811888694763, -0.03767811879515648, 0.0417301282286644, 0.058649852871894836, 0.2174157202243805, 0.1776108592748642, -0.4332687556743622, -0.7944190502166748, -0.005418399348855019, 0.027582338079810143, -0.29944920539855957, 0.25426617264...
to. I am curious about how developers at large work around this limitation, and do newer source control systems like Git and Mercurial support links? Look into [`svn:externals`](http://svnbook.red-bean.com/en/1.0/ch07s03.html) properties.
[ 0.18521727621555328, 0.043495047837495804, 0.29070597887039185, -0.14844907820224762, -0.14669834077358246, -0.367686927318573, 0.12040747702121735, 0.1676401048898697, -0.23511163890361786, -0.4727620482444763, -0.24894927442073822, 0.6687324047088623, -0.12781891226768494, 0.098202995955...
I have a very common situation here. And for years I haven't found if what i am doing is RIGHT by industry standards.Consider an application which connects to the database, but where the connection string instead of being stored in some file/setting is being passed as a command line parameter at startup OR the database...
[ 0.3011898696422577, 0.09592168033123016, 0.08385743200778961, 0.2009662240743637, 0.24242135882377625, -0.22527748346328735, 0.07795535027980804, 0.19145704805850983, -0.41312485933303833, -0.7419382333755493, -0.12263292819261551, 0.603216826915741, -0.2483525574207306, 0.2485479265451431...
connections string. Another way I would do it is using Singleton. Either options my DAL can access the connection string when it needs to through a GetConnectionString method. Is there a BETTER way of doing this? **Update:** i do not have a config file and even if I did I would need the connection string to be read ...
[ -0.15022487938404083, -0.13715137541294098, 0.3295193314552307, 0.20075088739395142, -0.090331070125103, -0.047181155532598495, 0.12349279969930649, 0.44531941413879395, -0.41947728395462036, -0.9353435635566711, -0.06825296580791473, 0.31029167771339417, -0.2800482511520386, 0.27540051937...
up the connection string out of config and [inject](http://en.wikipedia.org/wiki/Dependency_injection) it into any classes that need it. Depending on the size of your application, an [IoC](http://en.wikipedia.org/wiki/Inversion_of_control) container like [Unity](http://www.codeplex.com/unity) or [Castle Windsor](http:/...
[ -0.011906687170267105, -0.24680767953395844, 0.1876620352268219, 0.30796799063682556, 0.11597597599029541, -0.42256519198417664, 0.26568594574928284, -0.03350869193673134, -0.4375200569629669, -0.5642417073249817, -0.33937734365463257, -0.05816112086176872, -0.4301249086856842, 0.265643507...
the class's constructor, or via a property, or whatever). Rather than having a data access class have to ask for the connection string (from some sort of global or a singleton), have it passed in via the constructor or a property. **Update #2:** I think there's still some misunderstanding as to what this approach ent...
[ 0.04476042464375496, -0.20614178478717804, 0.4137336015701294, 0.17146070301532745, 0.09076420962810516, -0.20292998850345612, -0.0032978132367134094, -0.07298095524311066, -0.23716983199119568, -0.4951055645942688, -0.33643507957458496, 0.5141668319702148, -0.25688794255256653, 0.43296638...
{ _connString = connString; } } ``` [These](http://misko.hevery.com/2008/08/25/root-cause-of-singletons/) [articles](http://googletesting.blogspot.com/2008/12/static-methods-are-death-to-testability.html) (and in fact, many of the articles in that blog) detail a number of reasons why the latter is better ...
[ 0.08663707226514816, 0.049419503659009933, 0.051705826073884964, 0.26789000630378723, -0.00846031028777361, -0.32971516251564026, 0.2927149534225464, -0.10595067590475082, -0.42990148067474365, -0.39430680871009827, -0.04064011946320534, 0.27787142992019653, -0.3478396534919739, 0.32529103...
process of bootstrapping your application), rather than sprinkled throughout your whole codebase.
[ 0.5733373165130615, 0.0675138309597969, 0.020014503970742226, 0.018107395619153976, 0.18745961785316467, -0.16452239453792572, 0.6376063823699951, -0.3763768672943115, -0.4821282625198364, -0.4134214520454407, -0.16442567110061646, 0.302055299282074, -0.10230456292629242, 0.071390047669410...
How do you write (and run) a correct micro-benchmark in Java? I'm looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Related: [Is stopwatch benchmarking acceptable?](https://stackoverflow.com/questio...
[ 0.21039830148220062, 0.03747931867837906, 0.03926316276192665, -0.006119313649833202, -0.005415047984570265, -0.49171698093414307, 0.3171568512916565, -0.28582286834716797, -0.29829052090644836, -0.5071221590042114, 0.1575513333082199, 0.4705807566642761, -0.18857501447200775, -0.424034982...
and compilations before timing phase(s). (Fewer iterations is OK on the warmup phase. The rule of thumb is several tens of thousands of inner loop iterations.) **Rule 2:** Always run with `-XX:+PrintCompilation`, `-verbose:gc`, etc., so you can verify that the compiler and other parts of the JVM are not doing unexpect...
[ 0.35719048976898193, 0.055887479335069656, 0.2844696640968323, -0.08609224855899811, 0.03485335409641266, -0.21894744038581848, 0.3970128297805786, -0.3185068368911743, -0.48999878764152527, -0.35992807149887085, -0.42872416973114014, 0.6955065727233887, -0.3521868586540222, -0.36454281210...
`-XX:+PrintCompilation` flag reports OSR compilations with an at-sign to denote the non-initial entry point, for example: `Trouble$1::run @ 2 (41 bytes)`. Prefer server to client, and regular to OSR, if you are after best performance. **Rule 4:** Be aware of initialization effects. Do not print for the first time duri...
[ 0.26831382513046265, -0.0017438960494473577, 0.43595701456069946, -0.15367496013641357, -0.03476585075259209, -0.13416147232055664, 0.5598515868186951, -0.1674957275390625, -0.3962516784667969, -0.6050857901573181, -0.4373198449611664, 0.6720972061157227, -0.3915375769138336, -0.2413405030...
Be aware of deoptimization and recompilation effects. Do not take any code path for the first time in the timing phase, because the compiler may junk and recompile the code, based on an earlier optimistic assumption that the path was not going to be used at all. Rule 2 is your first line of defense against such effects...
[ 0.49614277482032776, 0.04103860631585121, -0.23841910064220428, 0.3458380401134491, 0.10254617780447006, -0.29709023237228394, 0.5733456611633301, -0.2875140607357025, -0.16820058226585388, -0.7367324829101562, 0.00477351201698184, 0.7106496095657349, 0.06288283318281174, -0.34468647837638...
on a quiet machine, and run it several times, discarding outliers. Use `-Xbatch` to serialize the compiler with the application, and consider setting `-XX:CICompilerCount=1` to prevent the compiler from running in parallel with itself. Try your best to reduce GC overhead, set `Xmx`(large enough) equals `Xms` and use [`...
[ 0.2585165202617645, 0.01933543011546135, 0.1851218193769455, 0.2240007221698761, 0.1128346398472786, -0.1575457900762558, 0.2752894461154938, -0.03454804793000221, -0.45769914984703064, -0.49950894713401794, -0.28609201312065125, 0.39282679557800293, -0.4332183301448822, -0.020702943205833...
What am I doing wrong here? My use of the INTO clause seems to match the example I found in Microsoft's Transact-SQL reference pages, but I must be missing something. ``` DECLARE @rowtemp table(TestRunID int, RunOrder int) SELECT TestRunID, ROW_NUMBER() OVER (ORDER BY TestRuns.TestTime ASC) AS 'RunOrder' INTO @rowte...
[ 0.5304096937179565, -0.06003774702548981, -0.07147178053855896, -0.23281942307949066, -0.14336484670639038, -0.00026173758669756353, 0.5898211002349854, -0.35361987352371216, 0.15828244388103485, -0.5066090226173401, -0.04377567768096924, 0.5162866711616516, -0.26316604018211365, 0.0739686...
= @runID ```
[ 0.2621568739414215, 0.11609447002410889, 0.05742913857102394, -0.06344316154718399, 0.015723921358585358, -0.28999415040016174, 0.3360602855682373, 0.09100545197725296, 0.11452949047088623, -0.14013798534870148, -0.2476935237646103, 0.19825804233551025, -0.5476844906806946, 0.4134183824062...
I'm working on a simple little swing component, and I'm tearing out my hair trying to figure out why my paint method isn't working. The idea behind this component is that it's a small JPanel with a label. The background (behind the label) is supposed to be white, with a colored rectangle on the left-hand side indicati...
[ 0.7155171036720276, -0.0013179106172174215, 0.3238464593887329, -0.0966862216591835, -0.28156015276908875, 0.20624278485774994, 0.05634896457195282, -0.412748783826828, -0.03138386085629463, -0.5504888892173767, 0.06584955751895905, 0.199501633644104, -0.34552001953125, -0.2292942851781845...
JPanel { private static final Color BACKGROUND = Color.WHITE; private static final Color FOREGROUND = Color.BLACK; private static final Color BORDER_COLOR = new Color(229, 172, 0); private static final Color BAR_GRAPH_COLOR = new Color(255, 255, 165); private int actual = 0; private int expected = ...
[ 0.15545114874839783, -0.23043540120124817, 0.8388787508010864, -0.19384706020355225, 0.1078781932592392, 0.5318752527236938, 0.3357323110103607, -0.3539884090423584, -0.1744050234556198, -0.42269495129585266, -0.6729233264923096, 0.4265659749507904, -0.34418830275535583, 0.2707390487194061...
super.add(label); super.setOpaque(true); } public void setActualAndExpected(int actual, int expected) { this.actual = actual; this.expected = expected; } @Override public void paint(Graphics g) { double proportion = (expected == 0) ? 0 : ((double) actual) / expected; Rect...
[ 0.44692233204841614, -0.5394651889801025, 0.7164435982704163, -0.14402765035629272, -0.22108013927936554, 0.352245956659317, 0.3928034007549286, -0.2747434675693512, -0.0406111441552639, -0.6128031015396118, -0.18189772963523865, 0.44645291566848755, -0.5237433314323425, -0.159760087728500...
g.fillRect(bounds.x, bounds.y, (int) (bounds.width * proportion), bounds.height); g.setColor(BORDER_COLOR); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); label.setText(String.format("%s of %s (%.1f%%)", actual, expected, proportion * 100)); super.paint(g); g.dispose(); ...
[ 0.34938862919807434, -0.28480276465415955, 0.6765429973602295, -0.15204393863677979, 0.0467665009200573, 0.378003865480423, 0.3021445870399475, -0.6343622803688049, 0.12181048840284348, -0.7683650255203247, -0.2600407600402832, 0.4768339693546295, -0.45115843415260315, -0.04833880066871643...
a = new BarGraphPanel(); BarGraphPanel b = new BarGraphPanel(); BarGraphPanel c = new BarGraphPanel(); a.setActualAndExpected(75, 100); b.setActualAndExpected(85, 200); c.setActualAndExpected(20, 300); super.add(a); super.add(b); super.add(c); } public static voi...
[ 0.2707540988922119, -0.0396793968975544, 0.5859227776527405, -0.5696189403533936, 0.06589619815349579, 0.3328193426132202, 0.3337428867816925, -0.42420732975006104, -0.5045228600502014, -0.19243672490119934, -0.3540287911891937, 0.2859705090522766, -0.7387452125549316, 0.043913766741752625...
createAndShowGUI(); } }); } public static void createAndShowGUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { } MyFrame frame = new MyFrame(); frame.pack(); frame.setVisible(true); } } ``` The t...
[ 0.5673332810401917, -0.31470656394958496, 0.3420822322368622, 0.1082538515329361, 0.08069254457950592, 0.03567241504788399, 0.33218586444854736, -0.7194387912750244, -0.025476515293121338, -0.6168034076690674, -0.11629515141248703, 0.5038794279098511, -0.2732236385345459, 0.163865923881530...
correctly, which indicates to me that the paint() method is actually being called, but the rectangles aren't being drawn to the Graphics object. What am I doing wrong? And why does Swing programming suck so much? --- Here's my final code. Thanks, everyone, for your help! ``` public void paintComponent(Graphics g) ...
[ 0.5021408796310425, 0.04018634185194969, 0.7055977582931519, -0.10252581536769867, -0.20850315690040588, 0.24471966922283173, 0.2755427658557892, -0.5955653786659241, 0.07820561528205872, -0.4980858862400055, 0.030474495142698288, 0.656211793422699, -0.0738777443766594, -0.4648338258266449...
1); FontMetrics metrics = g.getFontMetrics(); String label = String.format("%s of %s (%.1f%%)", actual, expected, proportion * 100); Rectangle2D textBounds = metrics.getStringBounds(label, g); g.setColor(FOREGROUND); g.drawString(label, 5, (int) ((bounds.height + textBounds.getHeight()) / 2)); } ``` I...
[ 0.4526555836200714, -0.04053901508450508, 0.8058828115463257, 0.010979677550494671, 0.02471015974879265, 0.002135487273335457, 0.49884870648384094, -0.5050920844078064, -0.15993471443653107, -0.6157182455062866, 0.0562458336353302, 0.6395473480224609, 0.021277187392115593, -0.1336366236209...
code. It should be: ``` g.setColor(BORDER_COLOR); g.drawRect(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1); ``` **EDIT2:** OK, got it. Your full `paintComponent` method should be as follows: ``` @Override public void paintComponent(Graphics g) { double proportion = (expected == 0) ? 0 : ((double) act...
[ 0.39394378662109375, -0.21179310977458954, 0.8831338286399841, 0.024735713377594948, 0.023291800171136856, 0.22826224565505981, 0.19308805465698242, -0.24028486013412476, 0.09489359706640244, -0.7869226336479187, -0.22623248398303986, 0.39486774802207947, -0.1603802591562271, -0.3071173727...
given to `g.fillRect()` and `g.drawRect()` are relative to the component, so they must start at (0,0). And no, I can't help you with your last question, though I feel your pain. :)
[ -0.05186879634857178, 0.18877452611923218, 0.652752161026001, -0.058572761714458466, -0.11109963804483414, 0.273628830909729, -0.09849567711353302, -0.32053646445274353, 0.11593321710824966, -0.38759103417396545, -0.16336026787757874, 0.5383861660957336, -0.2704474627971649, -0.15028110146...
MS SQL Server doesn't have row level triggers, correct? If I needed to insert a row from within a trigger and then insert another row, based on the result of the first insert, would a cursor be the best solution? For example, is there a better way to do this: ``` CREATE TABLE t1 (foo int) CREATE TABLE t2 (id int IDEN...
[ -0.2973039746284485, -0.11851084977388382, 0.45927003026008606, 0.04265991225838661, -0.011961029842495918, -0.08915997296571732, -0.033491529524326324, -0.4835999608039856, -0.1975041925907135, -0.2674867808818817, 0.09183157235383987, 0.7796068787574768, -0.525678813457489, -0.1311648935...
FETCH NEXT FROM c INTO @foo WHILE @@FETCH_STATUS = 0 BEGIN INSERT INTO t2 (foo) VALUES (@foo) INSERT INTO t3 (t2_id) VALUES (@@IDENTITY) FETCH NEXT FROM c INTO @foo END CLOSE c DEALLOCATE c ``` I assume you are on 2005 or better? If so, look into the OUTPUT clause, you shoul...
[ 0.09565013647079468, -0.1457902491092682, 0.7258611917495728, -0.0942959263920784, 0.1340041607618332, -0.3214173913002014, -0.08408156782388687, -0.35029250383377075, -0.2322307527065277, -0.4043101966381073, -0.08631432056427002, 0.7076470851898193, -0.21649286150932312, -0.0662691742181...
t2 (id int IDENTITY, foo int); CREATE TABLE t3 (t2_id int); GO CREATE TRIGGER t1_insert ON t1 FOR INSERT AS BEGIN DECLARE @new_rows TABLE(new_id INT, old_foo INT); INSERT t2(foo) OUTPUT inserted.id, inserted.foo INTO @new_rows SELECT foo FROM inserted; INSERT t3 SELECT new_id FROM...
[ 0.09952490776777267, -0.19857566058635712, 0.5720458626747131, -0.23524190485477448, 0.3392188847064972, 0.181072399020195, -0.05307765677571297, -0.7752639651298523, -0.11358728259801865, -0.529003381729126, -0.4317137598991394, 0.5049825310707092, -0.5343796014785767, -0.0850463137030601...
then a trigger on T2 that inserts into T3. This isn't going to be as efficient IMHO, and is not easier to manage, but I will submit that it is easier to follow (and may be your only option if you are stuck on 2000). Both could be set-based and wouldn't need cursors or any other row-by-row processing method. ``` USE te...
[ 0.048613060265779495, -0.12316518276929855, 0.19209781289100647, -0.31565535068511963, -0.004081234335899353, -0.11820880323648453, 0.06528262048959732, -0.42170339822769165, 0.07857780158519745, -0.5120720267295837, -0.2331153005361557, 0.6648091077804565, -0.7023835182189941, -0.20222476...
TRIGGER t2_insert ON t2 FOR INSERT AS BEGIN INSERT t3(t2_id) SELECT id FROM inserted; END GO INSERT t1(foo) SELECT 1 UNION ALL SELECT 5; SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; GO DROP TABLE t1,t2,t3; ``` (BTW, if you are going for identity values, use SCOPE\_IDENTITY(), not @@IDENTITY.)
[ 0.2698369026184082, -0.18249203264713287, 0.5045074224472046, -0.3583858013153076, 0.4559628665447235, -0.015103565528988838, 0.0868191197514534, -0.6782204508781433, 0.05727606639266014, -0.24323290586471558, -0.30739712715148926, 0.7350748181343079, -0.5170931220054626, -0.11846798658370...
How can I obtain the command line arguments of another process? Using static functions of the `System.Diagnostics.Process` class I can obtain a list of running processes, e.g. by name: ``` Process[] processList = Process.GetProcessesByName(processName); ``` However, there is no way to access the command line used ...
[ 0.07314735651016235, 0.08884043991565704, 0.31256094574928284, -0.047297559678554535, 0.15820646286010742, 0.05448836833238602, 0.017524538561701775, -0.2908628284931183, -0.18025363981723785, -0.628430187702179, -0.169469952583313, 0.5178830027580261, -0.17913708090782166, 0.4659033417701...
contain the original file name or arguments used to start the process. (source: [MSDN](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.startinfo.aspx)) Stuart's WMI suggestion is a good one: ``` string wmiQuery = string.Format("select CommandLine from Win32_Process where Name='{0}'", processName); ...
[ -0.07278159260749817, 0.0032219402492046356, 0.5653660893440247, -0.13098804652690887, 0.420596182346344, 0.07508677989244461, -0.08592068403959274, -0.5083283185958862, -0.13491401076316833, -0.4397982358932495, -0.3866720497608185, 0.4259524941444397, -0.21154852211475372, 0.494936108589...
I have a class (class A) that is designed to be inherited by other classes written by other people. I also have another class (class B), that also inherits from A. B has to access some A's member functions that shouldn't be accessed by other inheriting classes. So, these A's member functions should be public for B, b...
[ -0.09700830280780792, -0.020359288901090622, -0.09164587408304214, -0.13750670850276947, 0.20361541211605072, -0.1625811904668808, 0.28394532203674316, -0.1848975419998169, -0.11665251851081848, -0.48703572154045105, -0.20807228982448578, 0.6584646105766296, -0.3163463771343231, 0.27289366...
A { private: virtual void PrivateFunc() { //do something and call A's PrivateFunc A::PrivateFunc(); // Can't, it's private! } }; ``` What you say is: there are two sets of subclasses of A. One set should have access, the other set shouldn't. It feels wrong to have only one brand of subclasses (i.e. B) 's...
[ 0.32885247468948364, -0.10977911204099655, -0.20023173093795776, -0.1618194431066513, -0.09323707967996597, -0.25200697779655457, 0.5595853924751282, -0.10989328473806381, -0.27230438590049744, -0.3461815118789673, -0.2748936712741852, 0.41241633892059326, -0.4573424458503723, 0.4223618507...
may get around it.) A suggestion: ``` // separate the 'invisible' from the 'visible'. class A_private_part { protected: int inherited_content(); public: int public_interface(); }; class B_internal : public A_private_part { }; class A_export : private A_private_part { public: int public_interface(...
[ -0.14469322562217712, -0.13337990641593933, 0.6648411154747009, -0.20425577461719513, 0.004441889934241772, 0.06717225909233093, 0.4065990447998047, -0.21699854731559753, -0.43979746103286743, -0.6341546177864075, -0.39634740352630615, 0.389866441488266, -0.4930717945098877, 0.233361065387...
VisibleFunctionality m_Visible; }; ```
[ -0.1331958770751953, -0.052025727927684784, 0.2667309045791626, -0.24774590134620667, 0.07946370542049408, -0.052478596568107605, -0.06768206506967545, 0.3920726180076599, -0.16705209016799927, -0.7785659432411194, -0.5390671491622925, 0.8596079349517822, -0.5041800737380981, 0.08777690678...
Assuming that I want to use a hash as an ID instead of a numeric. Would it be an performance advantage to store them as `BINARY` over non-binary? ``` CREATE TABLE `test`.`foobar` ( `id` CHAR(32) BINARY CHARACTER SET ascii COLLATE ascii_bin NOT NULL, PRIMARY KEY (`id`) ) CHARACTER SET ascii; ``` Yes. Often a hash ...
[ 0.03540217503905296, 0.27334195375442505, 0.1392619013786316, -0.041116081178188324, -0.0537283830344677, 0.03256271034479141, 0.06533375382423401, -0.3441024422645569, -0.31473779678344727, -0.45929110050201416, -0.1684664487838745, 0.3733096420764923, -0.33044567704200745, 0.189926400780...
can gain some space efficiency by using binary strings. ``` CREATE TABLE test.foobar ( id BINARY(16) NOT NULL PRIMARY KEY ); INSERT INTO test.foobar (id) VALUES (UNHEX(MD5('hash'))); ``` --- Re. your comments that you are more concerned about performance than space efficiency: I don't know of any reason that th...
[ 0.2142045795917511, 0.1755051165819168, -0.08079414814710617, -0.013271699659526348, -0.07124119251966476, 0.08025389909744263, 0.3105338513851166, -0.5059837698936462, -0.2603590190410614, -0.4636211097240448, -0.18052519857883453, 0.2887299060821533, -0.1283542811870575, 0.04390448704361...
in hex. Likewise the cache memory for the index on that column can store twice as much. The result is a more effective cache, because a random query has a greater chance of hitting the cached data or index, instead of requiring a disk access. Cache efficiency is important for most database applications, because usual...
[ 0.004464366473257542, 0.011201822198927402, 0.2293296903371811, 0.34133827686309814, -0.19544674456119537, -0.11134123802185059, 0.09075446426868439, -0.23920877277851105, -0.3132065236568451, -0.6097614765167236, 0.019190073013305664, 0.6251833438873291, 0.0014167953049764037, 0.113853521...
a BIGINT, I would choose BIGINT. The cache efficiency will be even greater, and also on 64-bit processors integer arithmetic and comparisons should be very fast. I don't have measurements to support the claims above. The net benefit of choosing one data type over another depends a lot on data patterns and types of que...
[ -0.15176445245742798, -0.07821135222911835, 0.04608318582177162, -0.005422576330602169, -0.1894598752260208, 0.007764455862343311, 0.1702028214931488, -0.1882113814353943, -0.06634003669023514, -0.9091590046882629, 0.11229876428842545, 0.4765888750553131, -0.4422244131565094, 0.12995415925...
(5.13 sec) mysql> SELECT BENCHMARK(100000000, 'foo' = BINARY 'FOO'); 1 row in set (4.23 sec) ``` So binary string comparison is 17.5% faster than case-insensitive string comparison. But notice that after evaluating this expression 100 million times, the total difference is still less than 1 second. While we can meas...
[ 0.06986905634403229, -0.21218222379684448, 0.454708993434906, 0.10134244710206985, 0.043527085334062576, 0.31214290857315063, 0.6801546216011047, -0.28843075037002563, -0.03366594389081001, -0.8317006230354309, 0.1753237098455429, 0.5098728537559509, 0.39061155915260315, -0.109995536506176...
the greatest bang for the buck. * Don't sweat the small stuff. Of course, a tiny difference adds up with enough iterations, but given those iterations, a performance improvement with greater absolute benefit is still preferable.
[ 0.5039020776748657, 0.18155398964881897, 0.2016022801399231, 0.08164973556995392, -0.37370800971984863, -0.05684449151158333, 0.3948007822036743, -0.03852009028196335, -0.3341448903083801, -0.13437257707118988, 0.31036779284477234, 0.8348276615142822, 0.2643355429172516, -0.087970748543739...
When should I use ASP.NET Themes, and when should I use CSS? What are the advantages or disadvantages of using one over the other? I would recommend using CSS over Themes. The reason for this is in CSS you can modify your styles to they work with all browsers. You can do the same thing with themes but Microsoft's desig...
[ 0.5200628042221069, 0.15559948980808258, 0.21126295626163483, 0.1889074146747589, -0.3485773801803589, -0.2132941335439682, 0.0669657289981842, 0.36252033710479736, -0.39335691928863525, -0.9141283631324768, 0.2339647114276886, 0.3763222098350525, -0.1972360759973526, 0.21471954882144928, ...
I'm going back to the basics here but in Lua, you can define a table like so: ``` myTable = {} myTable [1] = 12 ``` Printing the table reference itself brings back a pointer to it. To access its elements you need to specify an index (i.e. exactly like you would an array) ``` print(myTable ) --prints pointer prin...
[ -0.15490172803401947, 0.11011070758104324, 0.5248385071754456, -0.13408897817134857, -0.061305105686187744, 0.13693152368068695, -0.24832510948181152, -0.1763722449541092, -0.3973398506641388, -0.6786828637123108, 0.021021872758865356, 0.5078344345092773, -0.45548009872436523, 0.1014008745...
--Printed pointer to function ``` Is there a way to access the body of a defined function. I am trying to put together a small code visualizer and would like to 'seed' a given function with special functions/variables to allow a visualizer to 'hook' itself into the code, I would need to be able to redefine the functi...
[ 0.5051583647727966, 0.1427232027053833, -0.10129114240407944, 0.3559022843837738, -0.13313522934913635, 0.0669439509510994, -0.22208841145038605, -0.09520161896944046, -0.2669059932231903, -0.41319361329078674, 0.02336733229458332, 0.3308395743370056, -0.21327435970306396, 0.04197888448834...
BTW that function may be defined in run-time with loadstring-like facility. Partial solutions are possible — depending on what you actually want to achieve. You may get source code position from the debug library — if debug library is enabled and debug symbols are not stripped from the bytecode. After that you may lo...
[ 0.4040164649486542, -0.15650968253612518, 0.23862303793430328, 0.04665761440992355, 0.1465338170528412, 0.016628514975309372, 0.16092340648174286, -0.3100137710571289, -0.271369993686676, -0.551010012626648, -0.30962860584259033, 0.5102985501289368, -0.0952531099319458, -0.1616447120904922...
from being collected by GC. If you would need a solution for analyzing Lua code, take a look at [Metalua](http://metalua.luaforge.net/).
[ 0.46154481172561646, 0.028918279334902763, 0.1767328977584839, -0.06806455552577972, -0.029084356501698494, -0.06124831736087799, -0.19964513182640076, -0.20151013135910034, -0.3486686944961548, -0.3186521828174591, -0.2688913345336914, -0.1128605455160141, -0.27524182200431824, 0.15056315...
I currently have a site where different users can login, and depending on their sub domain, are presented with different data from different databases. I am overriding the SqlMembershipProvider to use a "temp" connection string, that I dynamically set during the Initialize Method, per this post's instructions: <http:/...
[ -0.13123135268688202, 0.07101524621248245, 0.429295152425766, -0.002019500592723489, 0.18113604187965393, -0.34468868374824524, 0.217207670211792, -0.09003321826457977, -0.17803990840911865, -0.7424896955490112, -0.019617054611444473, 0.2564985454082489, -0.22590653598308563, 0.59924179315...
ConfigurationManager.ConnectionStrings[specifiedConnectionString]; var fi = typeof(ConfigurationElement).GetField("_bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(connectionString, false); connectionString.ConnectionString = WakeflyClientHelper.GetClientConnectionStr...
[ 0.0934048444032669, -0.30501389503479004, 0.3868371546268463, 0.02977890335023403, 0.22850878536701202, -0.1552967131137848, 0.3123365044593811, -0.10623347014188766, -0.26861143112182617, -0.6568914651870728, -0.2177731841802597, 0.484849750995636, -0.5776340365409851, 0.5321053862571716,...
databases, not each of their own. It looks like the Initialize is called by the application, and not on a per request basis. **So my question to you is... What would be the easiest way to implement a solution to this?** I have not written a custom provider before, so I'm not sure how that works, or what the limitati...
[ 0.5915598273277283, 0.029348105192184448, 0.183872789144516, 0.3637252449989319, 0.15030604600906372, -0.027516387403011322, 0.0972859188914299, -0.05900169536471367, -0.3689587116241455, -0.6687124371528625, 0.0988026112318039, 0.43848228454589844, -0.2932819724082947, -0.1213116422295570...
sub domain need the ability to add/edit/delete user's within their own sub domain, without seeing other sub domains' users. Would that be possible under this scheme? The code for the SQLMembershipProvider is provided [here](http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolki...
[ 0.17661844193935394, -0.0612604022026062, 0.3642597198486328, 0.24735690653324127, 0.12515932321548462, -0.11239605396986008, 0.31688418984413147, -0.02192484401166439, -0.24004098773002625, -0.5215128660202026, -0.28224965929985046, 0.038529038429260254, -0.2382831573486328, 0.41088423132...
I have a section of code that is being used to determine if a certain event should happen. The code looks like this. ``` If (Date.Now.Ticks Mod 100) < 4 Then Return True Else Return False End If ``` The idea here is that this event should happen 4 time out of 100, or 4...
[ 0.7437363266944885, 0.05803751200437546, 0.4486845135688782, 0.09410830587148666, 0.2776893675327301, 0.1763239949941635, 0.3541402220726013, -0.10592073947191238, -0.15804113447666168, -0.2526916563510895, 0.28706368803977966, 0.4753696918487549, 0.05295940861105919, 0.4736272990703583, ...
percentages range from 10% to 60%. The application is being hosted on two load balanced Win2k3 servers. Any suggestion would be helpful. Keith The reason you're getting that behavior is *you're not asking for 4% of the time that you be given a True value*, you're asking that any time the number of Ticks modulo 100 i...
[ 0.3490320146083832, -0.12777505815029144, 0.3773048520088196, 0.18005578219890594, -0.12925268709659576, 0.3445407450199127, 0.23800015449523926, -0.4533791244029999, -0.12462909519672394, -0.4906401038169861, 0.3266576826572418, 0.45281529426574707, -0.17553578317165375, 0.199110254645347...
by returning true whenever the random double is less than 0.04.
[ 0.18868590891361237, -0.04693559929728508, 0.11753162741661072, -0.21266700327396393, 0.18592962622642517, -0.1405157744884491, 0.6069951057434082, -0.3328121304512024, 0.09169222414493561, -0.08964373171329498, -0.2055371105670929, 0.34597262740135193, -0.23597252368927002, 0.035368360579...
I've been looking through the ANTLR v3 documentation (and my trusty copy of "The Definitive ANTLR reference"), and I can't seem to find a clean way to implement escape sequences in string literals (I'm currently using the Java target). I had hoped to be able to do something like: ``` fragment ESCAPE_SEQUENCE : '\...
[ -0.08976124972105026, 0.1433664858341217, 0.05482591688632965, -0.26219770312309265, 0.060074638575315475, -0.018909264355897903, 0.5409071445465088, -0.26194891333580017, -0.1222585067152977, -0.5047032237052917, -0.0412457101047039, 0.3139605224132538, -0.4063304662704468, 0.042968217283...
setText(getText().substring(1, getText().length() - 1)); } ; ``` For example, I would want the input token "`'Foo\'s House'`" to become the String "`Foo's House`". Unfortunately, the `setText(...)` call in the `ESCAPE_SEQUENCE` fragment sets the text for the entire `STRING` token, which is obviously not w...
[ 0.19117435812950134, 0.09049694985151291, 0.2541750967502594, -0.37842273712158203, -0.022627070546150208, -0.13855187594890594, 0.29922300577163696, -0.42576438188552856, -0.014034749940037727, -0.41868409514427185, -0.4453910291194916, 0.4788826107978821, -0.7212057709693909, 0.115682415...
wrote. ``` STRING @init{StringBuilder lBuf = new StringBuilder();} : '"' ( escaped=ESC {lBuf.append(getText());} | normal=~('"'|'\\'|'\n'|'\r') {lBuf.appendCodePoint(normal);} )* '"' {setText(lBuf.toString());} ; fragment ESC :
[ -0.3767778277397156, -0.15450738370418549, 0.45618972182273865, -0.20726455748081207, 0.09611717611551285, 0.10927177965641022, 0.7489985823631287, -0.41573038697242737, 0.2688918113708496, -0.7246586084365845, -0.3504782021045685, 0.35011693835258484, -0.3718166649341583, 0.03811658918857...
'\\' ( 'n' {setText("\n");} | 'r' {setText("\r");} | 't' {setText("\t");} | 'b' {setText("\b");} | 'f' {setText("\f");} | '"' {setText("\"");}
[ -0.17287836968898773, -0.09614770114421844, 0.5431011915206909, -0.4174848794937134, 0.39827215671539307, 0.1843147724866867, 0.23214776813983917, -0.2740791440010071, -0.00720457686111331, -0.4994208812713623, -1.0206665992736816, 0.6724872589111328, -0.5041402578353882, -0.03379030525684...
| '\'' {setText("\'");} | '/' {setText("/");} | '\\' {setText("\\");} | ('u')+ i=HEX_DIGIT j=HEX_DIGIT k=HEX_DIGIT l=HEX_DIGIT {setText(ParserUtil.hexToChar(i.getText(),j.getText(),
[ -0.4202500581741333, -0.09583481401205063, 0.6617552638053894, -0.1234680563211441, 0.12070585787296295, 0.3097482919692993, 0.1693175733089447, -0.48425665497779846, -0.13027143478393555, -0.6076390743255615, -0.6476250290870667, 0.42568567395210266, -0.5490590929985046, -0.06709731370210...
k.getText(),l.getText()));} ) ; ```
[ -0.30510395765304565, -0.14604628086090088, 0.5527278184890747, -0.4153554141521454, 0.2612956464290619, -0.09707140922546387, 0.1833513081073761, -0.007951974868774414, 0.05209622159600258, -0.5150648951530457, -0.9362537860870361, 0.5574010014533997, -0.6395577192306519, 0.31310975551605...
I have a function that I use to add vectors, like this: ``` public static Vector AddVector(Vector v1, Vector v2) { return new Vector( v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); } ``` Not very interesting. However, I overload the '+' operator for vectors and in the overload I call the AddVector fun...
[ 0.08219083398580551, -0.10299264639616013, 0.4848634600639343, -0.0767970010638237, -0.42701107263565063, 0.23240213096141815, -0.007856783457100391, -0.25694215297698975, 0.008253215812146664, -0.5034083127975464, 0.10715431720018387, 0.5388931632041931, -0.5813022255897522, 0.17554309964...
in two method calls because I managed to gain 10% in **total** performance by duplicating the code of the AddVector as well as the dot product method in the '+' and '\*' operator overload methods. Of course, this is a niche case because they get called tens of thousands of times per second, but I didn't expect this. I ...
[ 0.02079564891755581, -0.12056759744882584, 0.14622892439365387, -0.06805285811424255, -0.19565704464912415, -0.04756670445203781, 0.09263239055871964, -0.3075602948665619, -0.03013981506228447, -0.5831637978553772, 0.17821381986141205, 0.6400594115257263, -0.5256613492965698, -0.0842119157...