text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
} // normal __set() code here trigger_error('Cannot access private property ' . __CLASS__ . '::$' . $key, E_USER_ERROR); } } ``` (Code proved by tsteiner at nerdclub dot net [on bugs.php.net](https://bugs.php.net/bug.php?id=34044))
[ -0.14696745574474335, 0.1861073076725006, -0.11294889450073242, 0.016415318474173546, 0.517581582069397, 0.041144635528326035, 0.528879702091217, -0.0014190285000950098, -0.3074604272842407, -0.27598023414611816, -0.21939384937286377, 0.46011248230934143, -0.6001275777816772, 0.19341143965...
I have a bash script which will be run on a Mac via ssh. The script requires a particular network drive to already be mounted. On the Mac, I mount this drive by opening a folder "JPLemme" on that drive in Finder. This mounts the drive until the Mac goes to sleep at night. Obviously, Finder isn't available via ssh, so ...
[ 0.1191033348441124, 0.36150509119033813, 0.36838066577911377, -0.20662707090377808, -0.227493554353714, -0.27447211742401123, 0.36465492844581604, -0.22156739234924316, -0.44714221358299255, -0.6431716680526733, -0.05929836630821228, 0.9972124099731445, -0.004237383604049683, -0.1705299764...
Google has failed me. I would also be willing to entertain better solutions like mounting the drive directly; I've avoided that approach because I don't want the Mac to choke trying to mount the drive a second time after I've already mounted it in an unexpected way. (I don't really like Macs or AppleScript...) Your net...
[ 0.19284068048000336, -0.08960910886526108, 0.5321481823921204, 0.2438078224658966, -0.1532493531703949, -0.17106971144676208, 0.3077363967895508, 0.04680510237812996, -0.14494706690311432, -0.5666738748550415, 0.09912276268005371, 0.7155858874320984, -0.005894992500543594, 0.29692500829696...
set theServer to mount volume "smb://path/to/volume" as username "YourUserName" with password "YourPassword" --Please note here that this is a plain string without any built-in security. Use at your own risk. on error set VolumeCount to (get count of disks) repeat with x from 1 to VolumeCoun...
[ 0.03370760753750801, -0.05643542483448982, 1.1967427730560303, 0.0765608549118042, 0.0791410505771637, -0.34430134296417236, 0.10516069829463959, -0.15031155943870544, -0.21542279422283173, -0.6419188380241394, -0.16345073282718658, 1.002953052520752, -0.00727647403255105, -0.0746156945824...
if name of thisVolume is "JPLemme" then set theServer to thisVolume exit repeat end if end repeat end try end tell ``` You can clean it up as necessary, but that's the core of it. Good
[ 0.10504499077796936, 0.24861547350883484, 0.6265562176704407, 0.02537301741540432, 0.054802194237709045, -0.5558847188949585, 0.7171705961227417, 0.06950969249010086, 0.18478277325630188, -0.6046382784843445, -0.3286602199077606, 0.540184497833252, -0.1953909546136856, 0.2705404460430145, ...
luck
[ -0.06309817731380463, 0.2695752680301666, -0.14556680619716644, 0.2382047027349472, 0.01650954596698284, -0.038881655782461166, 0.17070187628269196, 0.34535712003707886, -0.10364504158496857, -0.3298308551311493, 0.009908454492688179, 0.09379258751869202, 0.2428748607635498, 0.023777285590...
I'm aiming to create a set of objects, each of which has a unique identifier. If an object already exists with that identifier, I want to use the existing object. Otherwise I want to create a new one. I'm trying not to use the word Singleton, because I know it's a dirty word here... I can use a factory method: ``` ...
[ 0.05821874737739563, -0.0542043000459671, 0.09147819131612778, 0.057362448424100876, 0.05216285586357117, 0.147829070687294, 0.2663310468196869, -0.06807995587587357, -0.16097787022590637, -0.8695255517959595, -0.19514942169189453, 0.3132328391075134, -0.43545296788215637, 0.42334106564521...
node == new MyClass(name); } return node; } ``` Or equally, I could have a separate MyClassFactory method. But I had intended to subclass MyClass: ``` public class MySubClass extends MyClass; ``` If I do no more, and invoke MySubClass.getInstance(): ``` MyClass subclassObj = MySubClass.getInstance("new n...
[ -0.3650653660297394, -0.019282400608062744, 0.3742828667163849, -0.14830587804317474, -0.07858964800834656, -0.10095646977424622, 0.4493947923183441, 0.10669776052236557, -0.10415817052125931, -0.8479116559028625, -0.3194584250450134, 0.17792552709579468, -0.44727858901023865, 0.4258850216...
programs, Web Services, Stored SQL procedures, message-driven triggers, etc. So each class "is-a" element in this network, and has methods to navigate and modify dependency relationships with other nodes. The difference between the subclasses will be the implementation of the `populate()` method used to set up the obj...
[ 0.02870233915746212, -0.2153141349554062, 0.2652384042739868, 0.2672622501850128, 0.16778217256069183, -0.38161027431488037, 0.23782411217689514, 0.026381269097328186, -0.16015712916851044, -0.813666820526123, -0.2045331597328186, 0.21592147648334503, -0.6234140992164612, 0.264490276575088...
in the method that you've called it on the subclass. The java compiler probably even resolves the call statically to a call to the parent class. So you will need to either reimplement the static method in your child classes as you propose, or make them not static so you can inheritance (on a hierarchy of factory **obj...
[ 0.11961224675178528, -0.11864696443080902, -0.1045919731259346, -0.05856938660144806, -0.006262572947889566, -0.0725105032324791, 0.24876998364925385, -0.1507938653230667, -0.3634721338748932, -0.5447641015052795, 0.023501429706811905, 0.2743045687675476, -0.44419151544570923, 0.2091042548...
personally, I'd just use factory objects rather than classes with static methods.
[ 0.5862004160881042, 0.07848457247018814, -0.597055196762085, 0.2070910632610321, -0.24865509569644928, 0.13995800912380219, 0.18495677411556244, 0.3921210765838623, -0.1287914514541626, -0.2367687225341797, 0.07061999291181564, 0.3335699737071991, 0.04329870641231537, 0.1632097363471985, ...
> **Possible Duplicate:** > > [LINQ equivalent of foreach for IEnumerable<T>](https://stackoverflow.com/questions/200574/linq-equivalent-of-foreach-for-ienumerablet) The linq extension methods for ienumerable are very handy ... but not that useful if all you want to do is apply some computation to each item in the ...
[ -0.013575252145528793, 0.27158573269844055, 0.36062514781951904, 0.08409599214792252, 0.01073461677879095, -0.010216087102890015, 0.38140612840652466, 0.14625991880893707, -0.3604982793331146, -0.625812828540802, -0.060840096324682236, 0.36905065178871155, -0.03743068501353264, -0.08621625...
did write my own version in case it's useful for anyone else: ``` using System.Collections; using System.Collections.Generic; public delegate void Function<T>(T item); public delegate void Function(object item); public static class EnumerableExtensions { public static void For(this IEnumerable enumerable, Functi...
[ 0.177028626203537, -0.1998472809791565, 0.6180945038795471, 0.09494343400001526, 0.07016579061746597, 0.01988888718187809, 0.40196362137794495, -0.232659250497818, -0.2802966833114624, -0.3445204198360443, -0.22082869708538055, 0.5425810217857361, -0.08233317732810974, 0.2516866624355316, ...
foreach (T item in enumerable) { func(item); } } } ``` usage is: `myEnumerable.For<MyClass>(delegate(MyClass item) { item.Count++; });` Shedding a little more light on why: LINQ is functional in nature. It is used to query data and return results. A LINQ query shouldn't be altering t...
[ -0.14374879002571106, 0.039756715297698975, 0.6282886266708374, 0.027857469394803047, -0.002215946326032281, -0.22316329181194305, 0.080071821808815, -0.17900237441062927, -0.09401334822177887, -0.41994109749794006, -0.31718605756759644, 0.37334614992141724, -0.24583794176578522, 0.1115902...
of something besides what you are passing in to it. And if you need a Foreach() extension method, it *is* easy to roll your own. If, on the other hand, what you want is to take input and call a function on each item that returns a result, LINQ provides a way through its select method. For example, the following code ...
[ 0.27967169880867004, 0.028397349640727043, 0.39121946692466736, -0.04815436154603958, 0.20211602747440338, -0.02228115126490593, -0.014466180466115475, -0.3138420283794403, -0.3762423098087311, -0.20427554845809937, -0.3108212351799011, 0.4117675721645355, -0.3820568323135376, 0.1892159730...
-5, 3, -2, 1, 2, -7 }; IEnumerable<bool> isPositiveList = list.Select<int, bool>(i => i > 0); foreach (bool isPositive in isPositiveList) { Console.WriteLine(isPositive); } Console.ReadKey(); } ```
[ -0.26021525263786316, 0.005274998489767313, 0.634177565574646, -0.36329489946365356, 0.40734735131263733, 0.053398195654153824, 0.4601708650588989, -0.3234519362449646, 0.12084076553583145, -0.5674266815185547, -0.5003387928009033, 0.6316443681716919, -0.2695261240005493, -0.15857617557048...
For some reason my code won't work. ``` from tan in TANS where tan.ID.ToString().Count() != 1 select tan ``` I want to select all IDs that are duplicates in a table so I am using the count != 1 and I get this error. NotSupportedException: Sequence operators not supported for type 'System.String' Help p...
[ 0.3351702392101288, -0.007800067309290171, 0.46672743558883667, -0.49673333764076233, 0.34292149543762207, -0.16416646540164948, 0.317921906709671, -0.423862487077713, -0.17018714547157288, -0.5938254594802856, -0.1836041808128357, 0.7004383206367493, -0.27545544505119324, 0.19524897634983...
bit weird to Google a problem and find an answer YOU wrote ..) At the core of this problem is the the LINQ statement is trying to build an SQL statement, and the database doesn't know how to apply Count() to a string. However, if you use LINQ against a collection in memory, then it would treat the string as an IEnumera...
[ 0.241807758808136, 0.11441852152347565, 0.23985455930233002, 0.3923543393611908, -0.155435249209404, -0.41680318117141724, 0.17144271731376648, 0.22110414505004883, -0.02638574317097664, -0.20553557574748993, 0.2773362994194031, 0.22122851014137268, -0.34203770756721497, 0.0068969111889600...
Is there a SSCLI equivalent for .Net Framework 3.5? Something that can be debugged and stepped through. If you are using Visual Studio 2008 (and especially VS2008 SP1) you should enable the ".NET Framework source stepping" debugger option.
[ 0.20786136388778687, -0.5625842809677124, -0.028316596522927284, 0.23010237514972687, -0.23828761279582977, -0.429101824760437, 0.14522111415863037, -0.22684486210346222, -0.3091418743133545, -0.36457541584968567, 0.11295095831155777, 0.7329702973365784, -0.3154655694961548, -0.41608154773...
Say we have normal distribution n(x): mean=0 and \int\_{-a}^{a} n(x) = P. What is the easiest way to compute standard deviation of such distribution? May be there are standard libraries for python or C, that are suitable for that task? The standard deviation of a mean-zero gaussian distribution with Pr(-a < X < a) = P...
[ 0.16026443243026733, -0.3887510597705841, 0.4604835510253906, -0.08101851493120193, -0.2696734368801117, 0.09663540869951248, -0.10361214727163315, -0.19410179555416107, -0.07822221517562866, -0.4016352593898773, 0.007972785271704197, 0.5638620853424072, -0.4325776696205139, 0.093323223292...
binary search would do the trick). Alternatively, here's a nice way to approximate erf and inverseErf: <http://homepages.physik.uni-muenchen.de/~Winitzki/erf-approx.pdf> For Python, inverseErf is available as `erfinv` in the SciPy library, so the following gives the standard deviation: ``` a/(math.sqrt(2)*erfinv(P)...
[ -0.08173571527004242, -0.030491020530462265, 0.4281782805919647, -0.08558784425258636, -0.5002800822257996, 0.1999703347682953, 0.20712073147296906, -0.10158448666334152, -0.056550268083810806, -0.5549827218055725, 0.04745791107416153, 0.5814707279205322, -0.40900376439094543, -0.212058618...
I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the content of the model? I disagree, Yuriy, t...
[ 0.15380144119262695, 0.1554069221019745, 0.31766942143440247, 0.27216288447380066, 0.09975594282150269, -0.2588958442211151, -0.01465966273099184, -0.043803174048662186, -0.08099403232336044, -0.3715306520462036, -0.1831008493900299, 0.4951375722885132, -0.33547475934028625, 0.167061805725...
framework. Controls are a very powerful and useful concept which can significantly increase development time, and shouldn't be discarded solely because they carry some emotional baggage from the ugly old webforms days! :)
[ 0.2509211003780365, 0.10067664086818695, 0.37169525027275085, 0.45040756464004517, 0.05207471922039986, -0.29204073548316956, 0.20153957605361938, -0.5134590268135071, 0.08931823074817657, -0.7120694518089294, 0.024914612993597984, 0.36297255754470825, -0.23116689920425415, 0.0129176545888...
During a recent load test, I've been getting some strange "Index Out of Range Exception" Stack trace: ``` at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) ...
[ 0.08132501691579819, 0.07029914855957031, 0.22546957433223724, -0.16361495852470398, 0.21828226745128632, 0.008160163648426533, 0.4046272039413452, -0.450151264667511, -0.3202676475048065, -0.626581609249115, -0.1680222451686859, 0.552641749382019, -0.13340593874454498, -0.0957933664321899...
.Net classes. I figure this has something to do with viewstate, but I can't find out why this is being thrown. Any Ideas? If someone initiates a post, the application starts sending the post with all 500KBs of viewstate. Half way through postback, the user gets bored and clicks something else. The browser cuts off th...
[ 0.3001597821712494, -0.25967109203338623, 0.12083420902490616, 0.2641203701496124, -0.49805396795272827, -0.4331236779689789, 0.35301539301872253, 0.372402548789978, -0.3316836953163147, -0.742824912071228, -0.08282482624053955, 0.31663474440574646, -0.25934889912605286, 0.4881851971149444...
to happen when a malicious user is crafting a custom postback response, so I don't think event validation is involved here.
[ 0.24723805487155914, -0.1747906655073166, 0.05555272474884987, -0.029625458642840385, -0.11260852217674255, -0.10566306859254837, 0.27792176604270935, 0.1013428345322609, -0.3623787462711334, -0.018713150173425674, -0.014970109798014164, 0.1382870227098465, -0.05104035511612892, -0.2507842...
I have to do some work for college and my professor likes to torture us with Nassi-Shneiderman diagrams. Has anyone a good editor/graphcial tool to draw these? Requirements: * cross platform (or able to run within wine) * open source (or a least free to for private use) -- After considering some editors, I ended u...
[ 0.2462785243988037, 0.48732587695121765, 0.25410711765289307, -0.1130446121096611, -0.277321994304657, -0.06672675907611847, 0.39941877126693726, 0.021816693246364594, 0.10351129621267319, -0.9485894441604614, 0.2462216466665268, 0.35016611218452454, -0.2062588334083557, -0.324399173259735...
Sometimes software installers force you to scroll to the end of the EULA before the “I agree” box is enabled. How can I produce the same effect on a web page? ``` <html> <head> <script type="text/javascript"> function setupPage() { var agreement = document.getElementById("agreete...
[ 0.5760557651519775, -0.12395031750202179, 0.8749384880065918, -0.23855102062225342, 0.17922043800354004, -0.446970671415329, 0.37079957127571106, -0.5541842579841614, 0.3071928918361664, -0.854608416557312, -0.45605331659317017, 0.6744581460952759, -0.24035418033599854, -0.0036550001241266...
var scrollableHeight = agreement.scrollHeight; if (scrollableHeight > visibleHeight) { var checkbox = document.getElementById("agreebox"); checkbox.checked=false; checkbox.disabled=true;
[ -0.0805092602968216, 0.08775180578231812, 0.7099803686141968, -0.12558799982070923, 0.33881592750549316, -0.2182580679655075, 0.4998936653137207, -0.4075654447078705, 0.3334946632385254, -0.5087816119194031, -0.6402509808540344, 0.7383251786231995, -0.2533375918865204, 0.05910659581422806,...
agreement.onscroll = handleScroll; } } function handleScroll() { var agreement = document.getElementById("agreetext"); var visibleHeight = agreement.clientHeight;
[ -0.07597848027944565, -0.03506140783429146, 0.9410349726676941, -0.45720627903938293, -0.03492389991879463, -0.074435293674469, 0.34864622354507446, -0.397075355052948, -0.03021717444062233, -0.6124483942985535, -0.3694038987159729, 0.5926690697669983, -0.13416767120361328, 0.0827494263648...
var scrollableHeight = agreement.scrollHeight; var position = agreement.scrollTop; if (position + visibleHeight == scrollableHeight) { document.getElementById("agreebox").disabled=false; }
[ -0.23373030126094818, 0.04533659666776657, 0.7948323488235474, -0.12634138762950897, 0.3085724115371704, -0.1432238072156906, 0.36806565523147583, -0.36869528889656067, 0.2773238718509674, -0.5179562568664551, -0.4631112515926361, 0.7662477493286133, -0.0936504676938057, 0.1275336146354675...
} </script> </head> <body> <form> <textarea id="agreetext" rows="8" cols="40">Long agreement</textarea> <br/><br/> <input type="checkbox" id="agreebox" value="true"/> <label id="agreelabel" for="agreebox">I agree</label> <br/><br/>
[ -0.2559454143047333, 0.03676050901412964, 0.5984752178192139, -0.05227808281779289, 0.05119529739022255, -0.1610351800918579, -0.3001554608345032, -0.6685587167739868, 0.3616938292980194, -0.8217384815216064, -0.26151856780052185, 0.7477603554725647, -0.18482361733913422, -0.40959030389785...
<input type="submit" value="Continue"/> </form> <script type="text/javascript"> // We put this at the end of the page rather than in an document.onload // because the document.onload event doesn't fire until all images have loaded. setupPage(); </script> <...
[ 0.48262831568717957, -0.02684713900089264, 0.6203581094741821, 0.046637602150440216, 0.04159335792064667, -0.47223779559135437, 0.10220781713724136, -0.4236017167568207, -0.10012383759021759, -0.6640738844871521, -0.329701691865921, 0.4572194814682007, -0.12371506541967392, -0.130448043346...
Server 2008 machine with SP1, Visual Studio 2008 with SP1. My user; Developer, is in the local Administrators group. That said, some actions I perform in Visual Studio (use the properties window of a web application to invoke the creation of a virtual directory in local IIS) tell me that Admin privileges are required. ...
[ -0.28836584091186523, 0.12215234339237213, 0.4879549741744995, -0.056871168315410614, -0.7128148078918457, -0.19623123109340668, 0.3504905700683594, -0.08262676745653152, -0.2173202782869339, -0.5777468681335449, 0.04908818006515503, 0.6941303610801697, -0.21669995784759521, -0.12436998635...
admin group will mean that that user can perform admin tasks. Let's say you have a normal user and that user is logged on and tries to perform an admin task. That user won't be able to perform such task cause it's not on the admin group. He will need to provide the username/password of an admin to perform such task. Bu...
[ 0.2307446002960205, 0.3138326406478882, 0.559806227684021, 0.21610453724861145, -0.29552608728408813, -0.4612548351287842, 0.09493470191955566, 0.029038455337285995, -0.10126347839832306, -0.4774215519428253, -0.10587452352046967, 0.6641256213188171, -0.21814431250095367, -0.05899043753743...
you are an administrator with admin rights, you can do whatever you want in the system. That's not very secure. In Vista, you are in the admin group but that doesn't mean every task should/will be run with admin privileges. You are an administrator, you can change whatever you want in the system but by default, things ...
[ 0.26004505157470703, 0.0261888038367033, 0.2103266417980194, 0.3421250581741333, 0.14528025686740875, -0.3875346779823303, 0.14760491251945496, 0.15878455340862274, -0.4271354079246521, -0.5882330536842346, -0.22673742473125458, 0.7357925772666931, -0.14829839766025543, 0.2084031105041504,...
I need to display 2d images in opengl using textures. The image dimensions are not necessarily powers of 2. I thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don't want to copy data a pixel at a time into a larger texture....
[ 0.12377205491065979, -0.05180187523365021, 0.43619704246520996, 0.06979381293058395, -0.3685503900051117, 0.018945425748825073, 0.10632427781820297, -0.058058012276887894, -0.17847514152526855, -0.9854655861854553, -0.01258500199764967, 0.6075971722602844, -0.2667236328125, 0.0145066073164...
size it is very fast even on low end hardware A couple of GL extensions come to mind. Have a look at [GL\_ARB\_texture\_rectangle](http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt) (if you don't need mipmapping), or [GL\_ARB\_texture\_non\_power\_of\_two](http://www.opengl.org/registry/specs/ARB/texture_n...
[ -0.2728068232536316, -0.11015821248292923, 0.5383589863777161, -0.3238924741744995, -0.3011830747127533, -0.1610649973154068, -0.31927093863487244, -0.1390852928161621, -0.7045766711235046, -1.0147374868392944, -0.05723799765110016, 0.7471291422843933, -0.029035767540335655, -0.11344492435...
Like all developers with OCD I try to organise my namespaces within our project so that they match where the file they are contained within sits of disk. However after a pretty massive refactoring session within VS.NET I've moved files within projects and created new subfolders a plenty, leaving the refactoring of the...
[ 0.5557324886322021, 0.2229005992412567, 0.08253294974565506, 0.042452432215213776, -0.17958061397075653, -0.004892511293292046, 0.4287029802799225, 0.13597489893436432, -0.17255070805549622, -0.7306551337242126, 0.28670910000801086, 0.37126684188842773, -0.06949961185455322, 0.194397777318...
files or even writing my own tool?). There are a couple of options: 1. Use the Class View window to rename the namespaces. 2. User "ReSharper" from jetbrains to do the refactoring.
[ 0.11843814700841904, -0.22566528618335724, 0.4550231993198395, 0.2327130287885666, 0.11913349479436874, -0.10178513824939728, 0.14531828463077545, -0.15786664187908173, -0.10151434689760208, -0.6140264272689819, -0.3474661409854889, 0.664883017539978, -0.234246164560318, 0.1220009773969650...
Is there a way or tool for Vista I can use to search for content in Java files? (I do not have an Eclipse project set up for it) I used to be able to do it easily in the windows search tool when I had Windows 2000. Edit: I have already enabled "search file contents" and added additional file types as recommended by ...
[ 0.22131851315498352, 0.08562347292900085, 0.03150026500225067, 0.12482768297195435, -0.25919875502586365, -0.18741634488105774, 0.39540451765060425, -0.15345892310142517, -0.22380022704601288, -0.8008811473846436, 0.09204544872045517, 0.5006606578826904, -0.231266051530838, -0.332897990942...
(can replace strings) but doesn't show lines.
[ -0.20927934348583221, -0.2670733630657196, 0.2295314222574234, -0.07403251528739929, -0.241341695189476, 0.10596941411495209, 0.4859478175640106, 0.2250569462776184, -0.0601932592689991, -0.5166584253311157, -0.5132162570953369, -0.006965535692870617, -0.15771527588367462, -0.1367957890033...
is it possible to create something like [this](https://web.archive.org/web/20200805044711/http://geekswithblogs.net/AzamSharp/archive/2008/02/24/119946.aspx) i ASP.NET MVC beta 1 i have tried but the ``` override bool OnPreAction(string actionName, System.Reflection.MethodInfo methodInfo) ...
[ 0.16925835609436035, -0.16327230632305145, 0.2338818907737732, 0.07674470543861389, -0.036098580807447433, -0.23969699442386627, 0.4148864448070526, -0.1819084733724594, -0.5029049515724182, -0.4330543875694275, -0.05958336219191551, 0.38062652945518494, -0.44431763887405396, -0.0868306830...
with the security attribute which is not a good idea. I think it's a perfectly fine way to go about it and it is supported by the framework. It will give you a nice declarative implementation. Check out the AuthorizeAttribute in System.Web.Mvc. It will allow you to do something like this: ``` [Authorize(Roles="Admin,...
[ -0.09340309351682663, -0.14350643754005432, 0.43109819293022156, -0.07290222495794296, -0.07891539484262466, -0.11468314379453659, 0.43587470054626465, -0.34870055317878723, -0.14775025844573975, -0.5621177554130554, -0.3117780387401581, 0.599500298500061, -0.3357924520969391, 0.0668944343...
I have a support environment where we connect to many of our customers' systems using VPN and Remote Desktop. Right now, support personnel have to manually set up the VPN connection on their workstation. Is there a way to programmatically create the VPN connection? Check out the DotRas project on CodePlex, the RasPhone...
[ 0.4890541732311249, 0.14382897317409515, 0.5510231852531433, 0.005512346979230642, 0.25759604573249817, -0.05170433223247528, 0.12509070336818695, -0.05613093450665474, -0.2549976408481598, -0.5990220308303833, -0.08461638540029526, 0.7626834511756897, -0.0483497679233551, -0.0345481894910...
I am trying to use symbolic links in one of the applications I have running on Tomcat5. Thanks to some help from [another StackOverflow question](https://stackoverflow.com/questions/315093/configure-symlinks-for-single-directory-in-tomcat) I was able to do it by creating a context.xml file in /...myapplication/META-...
[ -0.0611233152449131, 0.16404308378696442, 0.22879306972026825, -0.14102578163146973, -0.1485539972782135, 0.3186749219894409, 0.37535056471824646, -0.14494550228118896, -0.573384702205658, -0.6765834093093872, 0.066903255879879, 0.5530462265014648, -0.28288915753364563, 0.21788595616817474...
have allowed them in the META-INF/context.xml My question is, does the conf/context.xml control all applications? If I want symbolic links to work only in one application, do I need to remove the conf/context.xml and create new context files for each application? Or is there a way I can allow symbolic links in myappli...
[ 0.0394434779882431, 0.11434049159288406, 0.543805718421936, -0.1882956624031067, 0.016803784295916557, -0.1996658593416214, 0.2340364009141922, -0.32382652163505554, -0.40399596095085144, -0.4025396704673767, -0.3039078116416931, 0.6051571369171143, -0.39639726281166077, 0.1359590590000152...
`myapplication`, trying to say `<Context allowLinks="true" ...>` in your `META-INF/context.xml` will have no effect because *normally* the `conf/context.xml` setting will take precedence. But, if you say `<Context allowLinks="true" **override="true"** ...>` in your `META-INF/context.xml`, then all your `<Context>` s...
[ 0.02230105921626091, 0.22225159406661987, 0.4214758574962616, 0.16274528205394745, -0.0483541265130043, -0.4254724979400635, 0.39776095747947693, 0.0619196854531765, -0.15557561814785004, -0.7655056715011597, -0.25306960940361023, 0.5214192867279053, 0.023371344432234764, 0.129051476716995...
how do i define a named\_scope to return all the records that were created within the last 7 days, and then how do i use that named scope in a controller? I would recommend watching the [Railscast Episode on named\_scope](http://railscasts.com/episodes/108). Ideally, the code you're looking for would be: ``` named_s...
[ 0.3371329605579376, -0.37306976318359375, 0.6331605315208435, 0.1949613094329834, 0.3338561952114105, -0.20423482358455658, 0.05263187363743782, -0.0037391018122434616, -0.31563082337379456, -0.8099868297576904, 0.0856279507279396, 0.41578325629234314, 0.012292890809476376, 0.5140542984008...
I have a table with a credit and debit column. I need to get the highest balance out of that, and I think a stored procedure is the way to do it, but I have no idea how. I need to start with the first row, add the debits, subtract the credits and store the value A. Second row is A+debit-credit=B; A = max(A,B) Repeat...
[ 0.1588091403245926, 0.14519882202148438, 0.48605969548225403, -0.01244616974145174, 0.20476855337619781, 0.25917476415634155, -0.5148264169692993, -0.24196156859397888, -0.36248067021369934, -0.10409142076969147, 0.188594251871109, 0.7301045656204224, -0.017725294455885887, 0.3064721822738...
:= 0; SELECT @high := GREATEST(@balance := @balance+credit-debit, @high) FROM mytable; SELECT @high; ``` **edit:** In response to your comment about forming a stored function from this... unlike stored procedures, stored functions must return one value, so they can't contain a `SELECT` query unless the query stores i...
[ 0.2716813087463379, -0.11950909346342087, 0.4762894809246063, -0.05341413989663124, 0.1364695429801941, -0.06090560927987099, -0.14631888270378113, -0.20102031528949738, -0.2345026284456253, -0.09337163716554642, -0.058904360979795456, 0.5426467061042786, -0.04054560884833336, 0.2832759320...
:= @balance+debit_acc-credit_acc, @high)) INTO @high FROM credit_acc where credit_used_acc=63395; RETURN @high; END$$ ```
[ -0.10463151335716248, 0.08809147030115128, 0.7197911143302917, -0.119283027946949, 0.2509557902812958, 0.08609017729759216, -0.12545044720172882, -0.0822887048125267, -0.11184585839509964, 0.1280844360589981, -0.4067208170890808, 0.7484703063964844, -0.06874416768550873, 0.3766126036643982...
Edit: Warning - I now realize that the following technique is generally regarded as a bad idea because it creates hidden dependencies for the sake of looking neat. --- I recently discovered that you can use the StackTrace to infer information about the caller of a method. This enables you to create a seemingly "cool...
[ 0.6764911413192749, 0.12507249414920807, 0.08000284433364868, -0.043557438999414444, 0.22180667519569397, -0.44577568769454956, 0.47108641266822815, -0.15436173975467682, -0.024284755811095238, -0.4185098111629486, -0.0769016295671463, 0.7374972105026245, -0.4858669936656952, 0.05383827909...
Object valueToReturn = null; string key = GenerateCacheKeyFromMethodPrototype(new StackTrace().GetFrame(1).GetMethod()); //frame 1 contains caller if(key is in cache) valueToReturn = itemFromCache; return valueToReturn; } } public class Foo { private static Cache cache = new Cache(); public Bla...
[ 0.212266206741333, -0.0044248271733522415, 0.6083140969276428, -0.11076688766479492, 0.26290056109428406, 0.1835150271654129, 0.5972722768783569, -0.6064996123313904, -0.3384071886539459, -0.29776015877723694, -0.33188772201538086, 0.6711073517799377, -0.2754782736301422, 0.175891220569610...
return valueToReturn; } } ``` I'm sure there are errors in the above pseudocode, but you get my drift. --- Edit: thanks for everyone's responses. There's two reasons why not to do this: * It's slow * It's creates a brittle solution. If you wanted to do this, you'd better off using a tool that supports Aspect Or...
[ -0.02012655697762966, 0.030513271689414978, 0.061899442225694656, 0.22703897953033447, -0.03961586952209473, -0.21865631639957428, 0.3346835970878601, 0.37528344988822937, 0.08104956895112991, -0.6750578880310059, -0.06351681798696518, 0.7712273597717285, 0.0810125544667244, 0.212100714445...
I'd like to make a video tutorial for my SDK--one of those videos that shows the screen while some dude talks about what he's doing. Can someone direct me to easy and preferably free tools for doing so? Desired features: - Cuts (recording several snippets of video and putting them together afterward) - Subtitles (not ...
[ 0.45102357864379883, -0.2706391215324402, 0.5021567344665527, 0.5859998464584351, 0.049572620540857315, -0.48077192902565, 0.4269372820854187, 0.2213382124900818, -0.0875600203871727, -0.6505724787712097, -0.005300979595631361, 0.8553709983825684, 0.14891719818115234, -0.06809569150209427,...
text boxes.
[ 0.1544090062379837, 0.41667911410331726, -0.4870706796646118, 0.363898903131485, 0.007783963344991207, -0.1239030659198761, -0.18194538354873657, 0.5842271447181702, -0.236785888671875, -0.3899230360984802, -0.2725560963153839, -0.06082390993833542, -0.28247007727622986, 0.1633116900920868...
I am doing a join on two tables. One is a user's table and the other a list of premium users. I need to have the premium members show up first in my query. However, just because they are in the premium user table doesn't mean they are still a premium member - there is an IsActive field that also needs to be checked. S...
[ 0.36444681882858276, -0.1333645135164261, 0.6454830765724182, -0.07228630036115646, -0.04624558612704277, -0.04136485978960991, -0.06979446113109589, -0.1264207661151886, -0.15098245441913605, -0.6200283765792847, 0.019576042890548706, 0.6497529149055481, -0.2512633204460144, 0.16820216178...
Users.Id ORDER BY PremiumUsers.IsActive DESC ``` The problem with this is that it places non-active premium members above non-premium members. (I'm using MS SQL Server 2005 for this) ``` ORDER BY COALESCE(PremiumUsers.IsActive, 0) DESC ``` That will group the NULLs with not-actives.
[ -0.1615419238805771, -0.09223611652851105, 0.22607608139514923, 0.14337439835071564, -0.10655280202627182, -0.31795403361320496, 0.1777685433626175, -0.04127052426338196, -0.10891314595937729, -0.5596792697906494, -0.10197882354259491, 0.6196504235267639, -0.4445565640926361, 0.09752582758...
I have the following method in my code: ``` private bool GenerateZipFile(List<FileInfo> filesToArchive, DateTime archiveDate) { try { using (ZipOutputStream zipStream = new ZipOutputStream(File.Create(GetZipFileName(archiveDate)))) { zipStream.SetLevel(9); // maximum compression. ...
[ 0.24760621786117554, -0.23267994821071625, 0.6424092054367065, -0.12239669263362885, 0.4201379418373108, -0.09131138026714325, 0.2351730763912201, -0.4114916920661926, -0.09739963710308075, -0.6770057082176208, -0.15562580525875092, 0.39719444513320923, -0.3022424280643463, -0.059402998536...
{ string fileName = ZipEntry.CleanName(fi.Name); ZipEntry entry = new ZipEntry(fileName); entry.DateTime = fi.LastWriteTime; zipStream.PutNextEntry(entry); using (FileStream fs = File.OpenRead(fi.FullName))
[ 0.0396554209291935, -0.6281463503837585, 0.6817647814750671, -0.25654298067092896, 0.6686604619026184, 0.1301882565021515, 0.14497004449367523, -0.25873929262161255, -0.16074979305267334, -0.6747425198554993, -0.5657011270523071, 0.36129459738731384, -0.3994061350822449, 0.1878588050603866...
{ StreamUtils.Copy(fs, zipStream, buffer); } zipStream.CloseEntry(); } zipStream.Finish(); zipStream.Close();
[ 0.05509461462497711, -0.28572821617126465, 0.6528609395027161, -0.024517206475138664, 0.4369552731513977, -0.14940404891967773, 0.03796270489692688, 0.21942822635173798, 0.13933640718460083, -0.5111615061759949, -0.5266121029853821, 0.20539864897727966, -0.36747750639915466, 0.310786724090...
} return true; } catch (Exception ex) { OutputMessage(ex.ToString()); return false; } } ``` This code generates a ZIP file with all the correct entries, but each file is listed as being 4 TB (both unpacked and packed) and creates the following error when I try to open it: ```...
[ 0.1286218911409378, 0.109683558344841, 0.1864728182554245, -0.20065703988075256, 0.5500475764274597, 0.04305465519428253, 0.48602285981178284, -0.3817821443080902, -0.26117369532585144, -0.3807855248451233, -0.23240557312965393, 0.3026151657104492, -0.5025274157524109, 0.07100925594568253,...
not in the standard Zip 2.0 format Please see www.winzip.com/zip20.htm for more information error: no files were found - nothing to do ``` The code is practically taken from the samples, but I seem to be missing something. Does anyone have any pointers? I used to use SharpZipLib until I switched to [DotNetZip](ht...
[ 0.2112608700990677, -0.007882584817707539, 0.341826856136322, 0.03087812475860119, 0.012161482125520706, -0.09400060027837753, 0.2930368483066559, -0.2411748319864273, -0.294968843460083, -0.5771244764328003, -0.0887337177991867, 0.33774852752685547, -0.5030659437179565, -0.033718805760145...
zip.AddFile("ReadMe.txt"); zip.Save(); } } catch (System.Exception ex1) { System.Console.Error.WriteLine("exception: " + ex1); } ```
[ -0.015249529853463173, -0.14142321050167084, 0.37884029746055603, -0.24499277770519257, 0.48079586029052734, 0.10152353346347809, 0.31218424439430237, -0.29029420018196106, -0.17163227498531342, -0.5003831386566162, -0.44651103019714355, 0.3693988621234894, -0.5261297225952148, 0.055525146...
I'm trying to create some skinned forms (just the border and caption) with a different approach than you usually see but I'm having some issues with form flickering while I resize the form. I don't know how else to explain the problem, so here's a video I created to demonstrate the problem: <http://www.screencast.com/...
[ 0.722931444644928, -0.16520094871520996, 0.44980084896087646, 0.09513264894485474, -0.03971713036298752, -0.09867474436759949, 0.3237602710723877, -0.10322251170873642, -0.22024595737457275, -0.9653229117393494, 0.3507789373397827, 0.41322287917137146, 0.06362243741750717, 0.10471146553754...
the form's original border over to the new areas. In your case, the new areas are initialized black likely because the form originally had black pixels at its border. To get rid of the flickering, just keep the rightmost and bottommost line of pixels in the form always set to TransparencyKey -- this will keep the new ...
[ 0.4713895320892334, -0.3537469506263733, 0.8363520503044128, 0.004332606680691242, -0.25434887409210205, -0.2705596089363098, 0.06552410870790482, -0.25011536478996277, -0.04640178009867668, -0.9002727270126343, -0.1290312558412552, 0.05249887704849243, -0.1024637520313263, -0.015222922898...
In other languages you can use strings as keys - PHP: ``` $array['string'] = 50; $array['anotherstring'] = 150; ``` Is this possible in VBA? In VBA you can create a Collection object. Items in the collection can be accessed by index (Long integer) or by a string key.
[ -0.07563747465610504, -0.04078245162963867, 0.1884842813014984, 0.02179465815424919, -0.3732665479183197, 0.07023576647043228, 0.009779544547200203, -0.31557509303092957, -0.46128904819488525, 0.033249981701374054, -0.1397174596786499, 0.2843659520149231, -0.37416934967041016, 0.1626823544...
I've got a structure as follows: ``` typedef struct { std::wstring DevAgentVersion; std::wstring SerialNumber; } DeviceInfo; ``` But when I try to use it I get all sorts of memory allocation errors. If I try to pass it into a function like this: ``` GetDeviceInfo(DeviceInfo *info); ``` I will get a runt...
[ 0.14593693614006042, 0.2533070743083954, 0.4909858703613281, -0.281446248292923, 0.15201765298843384, -0.1500861644744873, 0.21870261430740356, -0.31025680899620056, -0.2923908829689026, -0.7778239250183105, 0.017863715067505836, 0.42916813492774963, -0.42370009422302246, 0.443147033452987...
string. What is the best way to initialize this structure (and all of it's internal strings? You should use `new` instead of `malloc`, to assure the constructor gets called for the `DeviceInfo` and its contained `wstring`s. ``` DeviceInfo *info = new DeviceInfo; ``` In general, it's best to avoid using `malloc` in ...
[ -0.028845855966210365, 0.11462318152189255, 0.601665198802948, -0.15761852264404297, 0.32578569650650024, -0.18929237127304077, -0.012387888506054878, -0.14905008673667908, -0.18199849128723145, -0.7739661335945129, -0.29618385434150696, 0.7529202103614807, -0.40938302874565125, 0.10324266...
I want to pass in the tType of a class to a function, and the class object to a generic function. I need to be able to cast to that Type (of class) so I can access the class's methods. Something like: ``` void GenericFunction(Object obj, Type type) { (type)obj.someContainer.Add(1); } ``` Would implementing an ...
[ 0.4435925781726837, -0.03998623043298721, 0.16326923668384552, 0.12717486917972565, -0.0005340325296856463, 0.12215140461921692, 0.16939687728881836, -0.14443479478359222, -0.028477979823946953, -0.6242800951004028, 0.23261955380439758, 0.5257949829101562, -0.3468553423881531, 0.2216120511...
SomeThing : ICanReport { public void Report() { Console.WriteLine("I'm SomeThing"); } } public class SomeOtherThing : ICanReport { public void Report() { Console.WriteLine("I'm SomeOtherThing"); } } public class TestThings { //#1 use safe downcasting public void TheMethod(object x) { ...
[ 0.3359370827674866, -0.2230895757675171, 0.23783506453037262, -0.01584746316075325, 0.07906053215265274, -0.1110316663980484, 0.4643726050853729, -0.016137322410941124, 0.04063046723604202, -0.3097483813762665, -0.20259101688861847, 0.44326868653297424, -0.021257253363728523, 0.54313039779...
// 100% safe, but a little complex public void AnotherMethod<T>(T x) where T : ICanReport { x.Report(); } //#3 use an interface as the parameter type. // simple and safe public void LastMethod(ICanReport x) { x.Report(); } //sample calls public void Test1() ...
[ 0.5553035140037537, -0.4159838557243347, -0.10558183491230011, 0.17702744901180267, 0.13190843164920807, -0.06809823960065842, 0.3991324305534363, -0.46768876910209656, 0.2417801469564438, -0.4210355579853058, 0.023281440138816833, 0.4745517671108246, -0.2601788640022278, 0.029119627550244...
a = new SomeThing(); SomeOtherThing b = new SomeOtherThing(); TheMethod(a); TheMethod(b); AnotherMethod(a); AnotherMethod(b); LastMethod(a); LastMethod(b); } } ```
[ -0.09138155728578568, -0.1392165869474411, 0.44904467463493347, -0.5291430354118347, 0.004336546175181866, -0.07454268634319305, 0.1531665027141571, -0.16761714220046997, -0.16597816348075867, -0.36034607887268066, -0.4169033169746399, 0.39831864833831787, -0.12084750086069107, 0.541399598...
I'm refactoring a 500-lines of C++ code in main() for solving a differential equation. I'd like to encapsulate the big ideas of our solver into smaller functions (i.e. "SolvePotential(...)" instead of 50 lines of numerics code). Should I code this sequentially with a bunch of functions taking **very long** parameters...
[ -0.025006001815199852, -0.26368874311447144, 0.46820715069770813, -0.008026469498872757, 0.10808918625116348, 0.31178805232048035, -0.06252963095903397, -0.3203411400318146, -0.195586696267128, -0.3526371717453003, 0.03761059045791626, 0.4169008731842041, -0.5607470870018005, 0.09141943603...
I create a "SolvePotential" class that would be called like so: ``` int main(int *argc, void **argv){ potential = SolvePotential(nx, ny, nz, nOrder); potential.solve(); return 0; } ``` Where I would define functions in SolvePotential that uses member variables rather than long parameter lists, such as: ```...
[ -0.18055972456932068, -0.2880918085575104, 0.37909427285194397, -0.047202687710523605, 0.014147920534014702, 0.09323471784591675, 0.13053536415100098, -0.32954126596450806, -0.19136135280132294, -0.49776196479797363, -0.0008593201637268066, 0.8502286672592163, -0.49371013045310974, -0.1483...
"Is it '12' or 'one dozen'?", but what do you think? Neither. "Move all my code from one single function to one single class" is not OOP. One of the fundamental rules of OOP is that a class should have *one single area of responsibility*. This is not a single responsibility, it is around 15: ``` SolverPotential::solve...
[ -0.0051149181090295315, -0.08194666355848312, 0.20497477054595947, 0.16094829142093658, -0.046345144510269165, -0.06268373131752014, 0.16722460091114044, -0.3056420385837555, -0.47721371054649353, -0.5093058943748474, -0.022287800908088684, 0.47764039039611816, -0.35983312129974365, -0.025...
the wrong order? Will the class be in a valid state if I do? Will I get valid data out of it? However, why is it an either-or? Why can't you make *multiple* classes *and* functions? ``` // This struct could be replaced with something like typedef boost::tuple<double,double,double> coord3d struct coord3d { double x, y...
[ 0.009645918384194374, -0.3825790584087372, 0.3721115291118622, 0.009788532741367817, -0.17232342064380646, 0.16156604886054993, 0.11820060759782791, -0.6776506304740906, -0.1010679081082344, -0.5046370625495911, 0.0018928698264062405, 0.6245614290237427, -0.5066062808036804, -0.21410512924...
If necessary/convenient, each could be made a class, or probably better still, a functor, to maintain the necessary state, and perhaps to allow you to pass them as arguments to other functions efficiently. If optimal performance is important, you may have to be careful with directly returning larger structures, rather...
[ 0.02427801862359047, -0.0584229975938797, -0.07467195391654968, 0.39008083939552307, -0.10799738764762878, 0.25652170181274414, 0.14824439585208893, -0.2655258774757385, -0.3130931556224823, -0.4870947301387787, -0.278972327709198, 0.6245353817939758, -0.1983174979686737, -0.22280007600784...
need some OOP, that it should be modelled as a class with a number of member functions, each of which of course maintain the class invariant, no matter how, when and why they're called. If you need to compose a number of functions, gluing them together to form new, larger, pieces of functionality, functional programmi...
[ 0.05260100215673447, -0.08039239048957825, -0.05097560957074165, 0.3886070251464844, 0.24109093844890594, -0.0061475844122469425, -0.14633487164974213, 0.1757488250732422, -0.5079307556152344, -0.5184704661369324, -0.45540183782577515, 0.45540130138397217, -0.30062294006347656, -0.18233722...
Making a functor do the heavy lifting allows it to be used with std::transform or std::for\_each. You may also want to use currying to gradually assemble your functions (perhaps some of the functions can be parametrized with a set of fixed parameters, which don't vary between calls). Again, create a functor which is in...
[ -0.04902120307087898, -0.4523408114910126, -0.016455305740237236, 0.24513718485832214, -0.2854616343975067, -0.03354571759700775, -0.01659911870956421, -0.20626232028007507, -0.16531433165073395, -0.3746720850467682, -0.31043991446495056, 0.8516002893447876, -0.4216430187225342, -0.3631100...
functions to allow them to work together without having to jump through hoops like pointer indirection or inheritance. Don't get too hung up on OOP. Use the tools at your disposal. I don't know enough of the context of your question to say for sure, but it seems to me that what you really need isn't a class, it's jus...
[ 0.03876600041985512, -0.13659164309501648, 0.11604838073253632, 0.2284725159406662, 0.14475460350513458, 0.14185120165348053, 0.13396978378295898, -0.19166146218776703, -0.09029381722211838, -0.7104354500770569, -0.13650506734848022, 0.6993206739425659, -0.4669901430606842, -0.334403753280...
that make up the responsibility of the function. So nowhere do you have a huge class with a dozen different responsibilities, or a big monolithic function which does everything sequentially. In any case, there is nothing wrong with "very long parameter lists" (You can usually shorten them by grouping some of them toge...
[ 0.4382390081882477, 0.14027705788612366, -0.09047334641218185, 0.4137726128101349, -0.020797964185476303, -0.2812039852142334, 0.19025656580924988, -0.09976326674222946, -0.46536505222320557, -0.327128142118454, -0.24678801000118256, 0.34322333335876465, -0.15902169048786163, 0.24339784681...
Is there a [REPL](http://en.wikipedia.org/wiki/REPL) (Read-Eval-Print Loop) available anywhere for Actionscript 3? I could not find anything on google, but it would really come in handy. [Google harder](http://eval.hurlant.com/demo/). ;)
[ 0.03544322028756142, -0.2979314625263214, 0.2822497487068176, 0.26992303133010864, -0.22488918900489807, 0.16736075282096863, 0.3221721649169922, -0.333402156829834, -0.6872978806495667, 0.08076979964971542, -0.1986473947763443, 0.36023810505867004, -0.33333584666252136, -0.387276619672775...
I am creating a jQuery plugin. How do I get the real image width and height with Javascript in Safari? The following works with Firefox 3, IE7 and Opera 9: ``` var pic = $("img") // need to remove these in of case img-element has set width and height pic.removeAttr("width"); pic.removeAttr("height"); var pic_real...
[ 0.2308332622051239, 0.07114020735025406, 0.7157601118087769, -0.1620098352432251, -0.2050035297870636, -0.0635669082403183, 0.33941972255706787, -0.2725919783115387, -0.27683648467063904, -0.9715671539306641, 0.008117083460092545, 0.7266612648963928, -0.2542533576488495, -0.001087911077775...
Make in memory copy of image to avoid css issues .attr("src", $(img).attr("src")) .load(function() { pic_real_width = this.width; // Note: $(this).width() will not pic_real_height = this.height; // work for in memory images. }); ``` To avoid any of the effects CSS might have on the image...
[ 0.25070053339004517, -0.03473084047436714, 0.5637543797492981, 0.026122085750102997, 0.11345783621072769, 0.038829464465379715, 0.0529257133603096, -0.11997932940721512, -0.37101122736930847, -0.6100554466247559, -0.07924548536539078, 0.6818922758102417, -0.14049126207828522, 0.02217927947...
I am new with Linq and I would like to sort some data that are in the BindingList. Once I did my Linq query, I need to use back the BindingList collection to bind my data. ``` var orderedList = //Here is linq query return (BindingList<MyObject>)orderedList; ``` This compiled but fails in execution, what is the tri...
[ 0.06681764870882034, 0.25810617208480835, 0.885325014591217, -0.08412838727235794, 0.15764905512332916, -0.3839638829231262, 0.02644030749797821, -0.6405263543128967, -0.1371326446533203, -0.5897151231765747, -0.013937178067862988, 0.4423753321170807, -0.47710755467414856, 0.07014107704162...
We have a server (written in C and C++) that currently catches a SEGV and dumps some internal info to a file. I would like to generate a core file and write it to disk at the time we catch the SEGV, so our support reps and customers don't have to fuss with ulimit and then wait for the crash to happen again in order to ...
[ 0.30805277824401855, 0.07860057055950165, 0.17615659534931183, 0.1589723378419876, 0.2081499546766281, -0.2631066143512726, -0.0026477002538740635, 0.20578500628471375, -0.0647013857960701, -0.5726015567779541, -0.10661369562149048, 0.33885395526885986, -0.31850147247314453, 0.067827239632...
a core file, but it is out of date, and doesn't seem very portable (for example, I'm guessing it would not work in our 64 bit builds). What is the best way to generate and dump a core file in a Linux process? Google has a library for generating coredumps from inside a running process called [google-coredumper](http://c...
[ 0.3558753728866577, 0.04824649915099144, 0.1510227471590042, 0.2598205506801605, 0.073362335562706, -0.048394232988357544, 0.1376742422580719, -0.037046678364276886, 0.016273001208901405, -0.45758336782455444, -0.09059933573007584, 0.19598935544490814, -0.42699190974235535, 0.0642049834132...
always work.
[ 0.6701381802558899, 0.07480218261480331, -0.10016102343797684, -0.03844088688492775, -0.133469820022583, 0.10392750799655914, 0.22711381316184998, 0.23868443071842194, -0.2145007997751236, -0.4473004639148712, -0.11905629187822342, 0.5758558511734009, 0.07758378982543945, -0.31855115294456...
Ok, so after spending a good portion of a day debugging a stupid typing mistake inside a piece of code I am curious as to why the specific actions occured rather than an exception. First of all the problem code. ``` Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn Dim hl As ...
[ -0.09817536175251007, -0.014962159097194672, 0.4963345527648926, 0.060458313673734665, -0.2574511170387268, -0.28910285234451294, 0.2454579472541809, -0.11216968297958374, -0.34139806032180786, -0.7055150270462036, -0.3821973204612732, 0.2626124620437622, -0.6042848825454712, 0.17075890302...
login credentials (Windows authentication in the browser). Does anyone have an idea why this is the case, and why an exception or something else didn't happen? **EDIT** The reason for the question is that due to this mistake, the page is rendered useless, and prompts for Windows Login, and NOT giving stack overflow ...
[ 0.20437997579574585, 0.18555279076099396, 0.3168708384037018, 0.41709020733833313, 0.3151232600212097, -0.1742633879184723, 0.3140881657600403, -0.15485091507434845, -0.2818923592567444, -0.6754720211029053, -0.3236091136932373, 0.2320190817117691, -0.3489345908164978, 0.10447190701961517,...
core file in a signal handler, though it is not guaranteed to always work.
[ 0.14051827788352966, -0.1984100192785263, 0.06969783455133438, 0.20257176458835602, 0.2496436983346939, -0.2981257140636444, 0.08310320228338242, -0.10840484499931335, -0.06278868019580841, -0.4357612133026123, -0.47497910261154175, 0.1415618658065796, -0.25709813833236694, -0.015428015030...
I recently watched [this youtube tutorial](http://www.youtube.com/watch?v=hp1Y9bhail8) on the Null Object design pattern. Even though there were some errors in it: such as the NullCar that doesn't do anything creates an infinite loop, the concept was well explained. My question is, what do you do when the objects that ...
[ 0.5384772419929504, 0.010631770826876163, -0.2310628443956375, 0.034061871469020844, -0.2969553768634796, -0.285410612821579, 0.46761181950569153, -0.047300759702920914, -0.11837495118379593, -0.41652965545654297, 0.1404409110546112, 0.2836481034755707, -0.3097214996814728, 0.2245550304651...
testing for default value testing ? If not , why not ? As far as I've understood it the idea is that the null object's value is as close to "nothing" as possible. That unfortunately means you have to define it yourself. As an example I personally use "" when I can't pass a null String, null object number for me is -1 (...
[ 0.5861139297485352, -0.12372729182243347, -0.03542478755116463, 0.12170444428920746, -0.24169234931468964, -0.3128524720668793, 0.31235525012016296, -0.09971408545970917, -0.05074191838502884, -0.40779316425323486, 0.12471819669008255, 0.41886740922927856, -0.057498663663864136, 0.10036279...
and so forth. If I have custom class I have to create a null object from, I remove all actual data from it and see where that takes me and then apply what I just mentioned until it's "empty". So you really don't "know" which value to return by default, you just have to decide it by yourself.
[ 0.2775127589702606, -0.041079577058553696, 0.07753835618495941, -0.010608372278511524, -0.03431733697652817, 0.0918627455830574, 0.11327871680259705, 0.010208736173808575, -0.1169125884771347, -0.37956106662750244, -0.024877723306417465, 0.15607570111751556, -0.11587055027484894, 0.3753143...
I am using C# 3.0 / .NET 3.5 and planning to build an eCommerce website. I've seen NHibernate, LLBLGEN, Genome, Linq to SQL, Entity Framework, SubSonic, etc. I don't want to code everything by hand. If there is some specific bottleneck I'll manage to optimize the database/code. Which ORM would be best? There is so m...
[ 0.4051995277404785, 0.20701901614665985, 0.38646426796913147, -0.052429892122745514, 0.012417279183864594, -0.3376862406730652, 0.12270119041204453, 0.08798804134130478, -0.25158804655075073, -0.9572460055351257, 0.022969920188188553, 0.6262460947036743, -0.15021902322769165, 0.25204092264...
But once you get the basics down it really speeds up development. I like Fluent nHibernate for a way to configure without the xml files. The one thing I suggest though is to abstract out your data access from your application. this way should you choose wrong you don't have to worry about re-coding the App tiers.
[ 0.23267483711242676, 0.04546017944812775, 0.1198326051235199, 0.1615508496761322, -0.19166310131549835, -0.0898723229765892, 0.3736129105091095, 0.24306942522525787, -0.059221383184194565, -0.5581516027450562, 0.11811341345310211, 0.7220433354377747, 0.07110423594713211, -0.119392737746238...
I was using jQuery plugins to create a rounded corner for my `<li>`, but it was not working on a lot of browsers and didn't support mouse over. I am wondering what is the best way to use two images (left corner and right corner) as the left and right side with using `<li>`. You could put Divs inside your li's like so:...
[ 0.08181952685117722, -0.09100915491580963, 0.4413354992866516, -0.05999785289168358, -0.4949547052383423, 0.28363037109375, -0.00898755807429552, -0.09185077995061874, 0.307931125164032, -1.0061216354370117, 0.08180246502161026, 0.6843529343605042, -0.015742847695946693, -0.170217335224151...
Here's the purpose of my console program: Make a web request > Save results from web request > Use QueryString to get next page from web request > Save those results > Use QueryString to get next page from web request, etc. So here's some pseudocode for how I set the code up. ``` for (int i = 0; i < 3; i++) ...
[ 0.05299980565905571, 0.14744383096694946, 0.7309190034866333, -0.22019580006599426, 0.1679771989583969, 0.1491498202085495, 0.1792513132095337, -0.2778129577636719, 0.2838596999645233, -0.6910551190376282, 0.06483561545610428, 0.5795374512672424, -0.20144766569137573, 0.19327926635742188, ...