text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Is there a way to attach an event to a foreign / separate window from an .NET process that when the foreign window is closed or is about to close my application can be notified? I found this <http://msdn.microsoft.com/en-us/library/ms229658.aspx> But that seems to only be for the .NET compact framework. I am looking ...
[ 0.2967356741428375, -0.28077444434165955, 0.06563467532396317, -0.09261234849691391, -0.0222637839615345, -0.15884248912334442, 0.22847802937030792, 0.16245031356811523, -0.6152262687683105, -0.4375106394290924, 0.044464919716119766, 0.27770787477493286, -0.31906425952911377, 0.19738301634...
I have a form with many input fields. When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array? ``` $('#myForm').submit(function() { // get all the inputs into an array. var $inputs = $('#myForm :input'); // not sure if you wanted this...
[ 0.3536495566368103, -0.0012592978309839964, 0.470513254404068, -0.15210026502609253, -0.3397933542728424, -0.06960806250572205, 0.2251698225736618, -0.44818004965782166, 0.11872709542512894, -0.7813942432403564, 0.006795438937842846, 0.4565182030200958, -0.32433927059173584, 0.101736404001...
= $(this).val(); }); }); ``` --- Thanks to the tip from Simon\_Weaver, here is another way you could do it, using [`serializeArray`](http://api.jquery.com/serializeArray/): ``` var values = {}; $.each($('#myForm').serializeArray(), function(i, field) { values[field.name] = field.value; }); ``` Note that ...
[ 0.26184362173080444, -0.15716056525707245, 0.7691259980201721, -0.09577091038227081, -0.11393619328737259, 0.07202973961830139, 0.49268314242362976, -0.44808268547058105, -0.3867342472076416, -0.6003966927528381, -0.15827597677707672, 0.524511992931366, -0.34662333130836487, 0.350776255130...
How do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this (called "sequence expression" in the Bash [documentation](http://www.gnu.org/software/bash/manual/bashref.html#Brace-Expansion)): ``` for i in {1..5}; do echo $i; done ``` Which gives: > 1 > > 2 > ...
[ 0.23368585109710693, 0.17409974336624146, 0.18398168683052063, -0.5319911241531372, -0.17078158259391785, 0.13712213933467865, 0.49811896681785583, -0.8002732396125793, -0.07908368855714798, -0.26555827260017395, 0.03535081818699837, 0.5588874220848083, -0.2273140400648117, -0.048596527427...
`seq` over the other methods because I can actually remember it ;)
[ -0.06237491965293884, 0.171430766582489, 0.2956993579864502, -0.16673602163791656, 0.07745645940303802, 0.03866231441497803, 0.2584891617298126, -0.03951353207230568, 0.03733108565211296, -0.5835976600646973, -0.3747332692146301, 0.4209424555301666, -0.030835779383778572, -0.14458796381950...
Ok, my actual problem was this: I was implementing an `IList<T>`. When I got to `CopyTo(Array array, int index)`, this was my solution: ``` void ICollection.CopyTo(Array array, int index) { // Bounds checking, etc here. if (!(array.GetValue(0) is T)) throw new ArgumentException("Cannot cast to this typ...
[ 0.23501765727996826, -0.04467052221298218, 0.3552248775959015, 0.0636187195777893, 0.2228183001279831, -0.04051743820309639, 0.17170724272727966, -0.22602535784244537, -0.023986821994185448, -0.5835505127906799, 0.22885651886463165, 0.7523992657661438, -0.5350916385650635, 0.28966227173805...
(ICollection)_list; string[] testArray = new string[6]; coll.CopyTo(testArray, 2); } ``` Now, this test should pass. It throws the `ArgumentException` about not being able to cast. Why? `array[0] == null`. The `is` keyword always returns false when checking a variable that is set to `null`. Now, this is hand...
[ 0.3728727698326111, -0.046465132385492325, 0.031105676665902138, 0.0019997593481093645, -0.06987835466861725, -0.24478420615196228, 0.5877140760421753, -0.5030950307846069, 0.09298816323280334, -0.39825132489204407, 0.1561342030763626, 0.5182521343231201, -0.4121609032154083, 0.23945730924...
works... Is there a better way though? The only way to be sure is with reflection, but 90% of the time you can avoid the cost of that by using `array is T[]`. Most people are going to pass a properly typed array in, so that will do. But, you should always provide the code to do the reflection check as well, just in cas...
[ 0.46227702498435974, 0.2285434454679489, 0.16762277483940125, 0.1296578049659729, 0.09147359430789948, -0.08957745134830475, 0.424583375453949, -0.39788591861724854, -0.18064984679222107, -0.8059115409851074, 0.3439488708972931, 0.5704620480537415, -0.23846863210201263, -0.0956100970506668...
index) { // Bounds checking, etc here. CopyToImpl(array, index); } void ICollection.CopyTo(Array array, int index) { // Bounds checking, etc here. if (array is T[]) { // quick, avoids reflection, but only works if array is typed as exactly T[] CopyToImpl((T[])localArray, ind...
[ 0.1553695946931839, -0.30126312375068665, 0.5341655015945435, 0.1938415914773941, 0.45588570833206177, -0.0395541749894619, 0.20283937454223633, -0.32102227210998535, -0.2709265351295471, -0.5941712260246277, 0.014499799348413944, 0.507075309753418, -0.47399672865867615, 0.1643775254487991...
elementType = array.GetType().GetElementType(); if (!elementType.IsAssignableFrom(typeof(T)) && !typeof(T).IsAssignableFrom(elementType)) { throw new Exception(); } CopyToImpl((object[])array, index); } } private void CopyToImpl(object[] array, int index) { ...
[ 0.14714689552783966, -0.07223349809646606, 0.42322978377342224, -0.2790219783782959, 0.2796517610549927, -0.029087569564580917, 0.34009647369384766, -0.6006456613540649, -0.07880426198244095, -0.26149389147758484, -0.1184551939368248, 0.6049733757972717, -0.5155532360076904, 0.021350562572...
// Handle the copying here } } ``` **EDIT**: Ok, forgot to point something out. A couple answers naively used what, in this code, reads as `element.IsAssignableFrom(typeof(T))` only. You *should* also allow `typeof(T).IsAssignableFrom(elementType)`, as the BCL does, in case a developer knows that all of the values...
[ 0.18196426331996918, 0.07445354759693146, 0.3812851011753082, 0.019801821559667587, 0.25084376335144043, -0.042090851813554764, 0.27961820363998413, -0.05680854246020317, -0.12460213154554367, -0.30423733592033386, -0.06683892756700516, 0.47842156887054443, -0.3401074707508087, 0.109642691...
I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load, but I'm not talking massive. I never really liked Java as a la...
[ 0.6984861493110657, 0.0876631960272789, 0.07280538231134415, -0.17070479691028595, -0.2771477997303009, -0.2907775342464447, 0.03636448085308075, 0.3052482008934021, -0.23589752614498138, -0.6918271780014038, 0.15208597481250763, 0.39265769720077515, -0.44904837012290955, -0.10944602638483...
missing, or is just a bunch of hot air? What justifies the high price of the proprietary app servers? I'm not trolling here: I'm looking for concrete examples of things that Java EE really nails that are missing from *modern* LAMP frameworks, if such differences exist. (Modern = Rails, Django, etc). Alternatively pipe...
[ 0.14733684062957764, 0.2540196180343628, 0.24344128370285034, 0.0639093816280365, -0.2431238293647766, -0.33140406012535095, 0.16178792715072632, 0.021064607426524162, -0.48405522108078003, -0.03837273269891739, -0.22731710970401764, 0.4587897062301636, -0.7226540446281433, 0.0013626021100...
web sites" and "It scales because it is really actually much better than the LAMP stack". I've done quite a bit of reading, and have concluded that Java EE only has one really good trick: transactions (thanks Will) and as for the rest you can succeed or fail on your own merit, there is nothing intrinsically in the env...
[ 0.5352990627288818, 0.13995380699634552, 0.25366538763046265, 0.39537331461906433, -0.13668397068977356, -0.5705839991569519, 0.5973399877548218, 0.14805497229099274, -0.44298848509788513, -0.6713014841079712, 0.0061279116198420525, 0.790644109249115, -0.1571216881275177, -0.22604894638061...
for quite a bit of JMS traffic that perhaps could have been avoided with a different design.) Useful discussion * <http://www.subbu.org/blog/2007/10/large-scale-web-site-development> * <http://highscalability.com/> * <http://www.oreillynet.com/onlamp/blog/2004/07/php_scales.html> * <http://www.schlossnagle.org/~georg...
[ -0.03131038695573807, 0.06935416162014008, 0.46370136737823486, 0.12705667316913605, -0.3641599118709564, -0.23965761065483093, 0.08306147903203964, -0.3411867618560791, -0.20256103575229645, -0.3634016811847687, 0.20266000926494598, 0.510377824306488, -0.2745424211025238, 0.04773437231779...
database, putting it on a messaging queue (JMS), and then deleting that row from the database. This simple case involves two separate systems, and can not reliably be done out side of a transaction. For example, you can put the row on to the message queue, but (due to a system failure) not remove the row from the datab...
[ -0.07305924594402313, -0.31213879585266113, 0.15426521003246307, 0.16138048470020294, 0.04876583069562912, -0.11418744921684265, 0.06070840358734131, -0.012344429269433022, -0.7200120687484741, -0.4689798653125763, -0.02167525142431259, 0.15058530867099762, -0.6277154684066772, 0.394631057...
The nice thing with Java EE, though, is that you don't have to deal with these kind of issues -- the container gets to deal with them. And, again, not every problem requires this level o transaction handling. But for those that do, it's invaluable. And once you get used to using them, you'll find the transaction manag...
[ 0.05456799268722534, 0.07042933255434036, 0.06952686607837677, -0.04965107515454292, -0.10972405225038528, -0.46047183871269226, -0.14937980473041534, 0.23331618309020996, -0.4718111753463745, -0.5994660258293152, -0.03104330040514469, 0.6920507550239563, -0.21872971951961517, -0.269181996...
What is the best way to persist/save printer settings in .Net? There used to be a bug in .Net 1.1 in the serialization of the `PrinterSetting` object and there were some [workarounds](http://www.codeproject.com/KB/cs/printersettings.aspx) but I'm wondering if there isn't a better or easier way of doing this in the more...
[ 0.4927588403224945, 0.11489580571651459, 0.48372000455856323, 0.0062627787701785564, 0.2744327485561371, -0.06754282116889954, -0.023367710411548615, 0.12276794761419296, -0.3681181073188782, -0.8450431823730469, 0.39696165919303894, 0.662687361240387, -0.21434159576892853, 0.0278199333697...
ghetto method of [dumping the current DEVMODE and overwriting it back when they want to use it again](http://nicholas.piasecki.name/blog/2008/11/programmatically-selecting-complex-printer-options-in-c-shar/) to send some proprietary printer settings to a copier machine at work. I couldn't find a better way to get to so...
[ 0.3607349991798401, -0.031842052936553955, -0.11182793974876404, 0.16913145780563354, 0.01505785807967186, 0.12331519275903702, 0.16926738619804382, -0.012474029324948788, -0.1922094076871872, -0.5072303414344788, 0.3030390739440918, 0.122557632625103, -0.3112971782684326, -0.0629489049315...
of the same printer driver. For me, that's no big deal since it's a controlled office environment. For you, I guess it would depend on the context of how your users use the program. Good luck!
[ 0.6516460180282593, 0.39081093668937683, 0.3563542366027832, 0.19442614912986755, 0.4973258972167969, -0.22095467150211334, 0.13775493204593658, 0.4550565779209137, -0.0971379205584526, -0.5176675915718079, 0.014879170805215836, 0.7153530716896057, 0.22872860729694366, -0.1799304485321045,...
I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK (<http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code>), but I'm wanting to look at the class definitions for the MXML core library (like NumericSt...
[ 0.7959253191947937, 0.020825831219553947, -0.1729484647512436, 0.06000456586480141, -0.38670268654823303, -0.29471883177757263, -0.1320471316576004, 0.0374353863298893, -0.442818820476532, -0.6408886909484863, 0.01846551150083542, 0.5413771271705627, -0.1674710363149643, 0.0402422361075878...
it in the director structure? If you have installed the sdk or Flex builder all of the source files are installed locally on your computer, I believe. I have flex builder 3 installed source is located here(depending on where you installed): *Source for flex 3 sdk* C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fra...
[ 0.5381171703338623, -0.08569736778736115, 0.4548000693321228, -0.0694841742515564, -0.014285719022154808, -0.42167583107948303, 0.030450893566012383, -0.15279340744018555, -0.03133142367005348, -0.6058576703071594, -0.15453223884105682, 0.6980237364768982, -0.16610312461853027, -0.03182862...
I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the edges connecting the nodes. What I NEED is the distance between the t...
[ -0.4023776352405548, 0.08248913288116455, 0.30001354217529297, -0.09262154996395111, -0.23509614169597626, -0.008782976306974888, 0.09580031782388687, -0.3096146583557129, -0.16502974927425385, -0.6665158867835999, 0.068294957280159, 0.4334549903869629, -0.2642255127429962, 0.1411107778549...
for (int i = 0; i < size(); i++) { if (!visited[i] && ((best < 0) || (distances[i] < distances[best]))) { best = i;
[ -0.5519447922706604, -0.2613523006439209, 0.6737699508666992, -0.2866067588329315, 0.12880666553974152, -0.09082348644733429, 0.5709000825881958, -0.3331620693206787, -0.009032622911036015, -0.7373257875442505, -0.36676350235939026, 0.6145713925361633, -0.10978195816278458, 0.2553713917732...
} } return best; } // Dijkstra's Continued public double[] distancesFrom(int source) { double[] result = new double[size()]; java.util.Arrays.fill(result, Double.POSITIVE_INFINITY); result[source] = 0; // zero distance from itself boolean[] visited = new boolean[size()];...
[ -0.09185429662466049, -0.26225319504737854, 0.5240843296051025, -0.43476602435112, 0.07952997833490372, 0.043408896774053574, 0.5014467239379883, -0.6126266717910767, -0.24496842920780182, -0.3035992383956909, -0.13049472868442535, 0.5308820009231567, -0.2908744812011719, 0.107169076800346...
int node = cheapest(result, visited); visited[node] = true; for (int j = 0; j < size(); j++) { result[j] = Math.min(result[j], result[node]
[ -0.38619765639305115, -0.49990779161453247, 0.5354458093643188, -0.0010234437650069594, 0.12466073781251907, 0.32639530301094055, 0.3687993288040161, -0.08296117931604385, -0.18484635651111603, -0.5306550860404968, -0.26804137229919434, 0.6930909752845764, 0.16448631882667542, 0.0539760105...
+ getCost(node, j)); } } return result; } ``` With this implementation I can give it a particular node and it will give me a list of all the distances from that node. So, I could grab the largest distance in that list of distances but I can't be sure that any particular node is one of...
[ -0.23337596654891968, -0.20487210154533386, 0.6196760535240173, -0.1965210884809494, 0.07907132804393768, -0.018680794164538383, 0.21630671620368958, -0.2233920842409134, 0.0029694726690649986, -0.6593658924102783, 0.03318553790450096, 0.26965269446372986, -0.07424789667129517, 0.148737117...
run this Dijkstra's algorithm on every node, go through each returned list of distances and looking for the largest distance. After exhausting each node returning it's list of distances I should have the value of the largest distance between any two nodes (the "road" distance between the two most widely seperated villa...
[ -0.17618370056152344, -0.05623979493975639, 0.17284220457077026, -0.014751926995813847, 0.06149422749876976, 0.16894905269145966, 0.3492209315299988, -0.42831480503082275, -0.12292283028364182, -0.7321699857711792, 0.2980576157569885, 0.17159180343151093, -0.0124431811273098, -0.0409715883...
a sample input for the problem: Total Nodes: 5 Edges: Nodes 2 - Connect - Node 4. Distance/Weight 25 Nodes 2 - Connect - Node 5. Distance/Weight 26 Nodes 3 - Connect - Node 4. Distance/Weight 16 Nodes 1 - Connect - Node 4. Distance/Weight 14 The answer to this sample input is "67 miles". Which is the l...
[ 0.0035845430102199316, 0.3110688030719757, 0.4138852655887604, 0.047423385083675385, -0.09634725749492645, 0.351559579372406, 0.6581716537475586, -0.5006691217422485, -0.37603995203971863, -0.4233570396900177, 0.19231194257736206, 0.10953938215970993, 0.08576596528291702, -0.01861332915723...
algorithm](http://en.wikipedia.org/wiki/Floyd_Warshall) * [Johnson's algorithm](http://en.wikipedia.org/wiki/Johnson's_algorithm). I can't give you much guidance about them though - I'm no expert.
[ -0.18156617879867554, 0.26687347888946533, 0.16224472224712372, -0.2609562873840332, 0.14616630971431732, 0.16629086434841156, 0.31832632422447205, -0.4669397175312042, -0.447849303483963, -0.5400770902633667, -0.019974302500486374, 0.3946320116519928, -0.5161737203598022, 0.25897556543350...
What should happen when I call `$user->get_email_address()`? ------------------------------------------------------------ ### Option 1: Pull the email address from the database on demand ``` public function get_email_address() { if (!$this->email_address) { $this->read_from_database('email_address'); ...
[ -0.10300911962985992, 0.022180549800395966, 0.4319732189178467, -0.20334593951702118, 0.2702490985393524, -0.10753781348466873, 0.20254482328891754, -0.41120776534080505, 0.1627783328294754, -0.6608794927597046, -0.3534977436065674, 0.8249918818473816, -0.5460898280143738, -0.0396850258111...
minimize the number of database queries, or whether it's best to minimize the amount of data that gets transferred from the database. Another possibility is that it's best to load the attributes that you'll need the most / contain the least data at object creation and everything else on demand. A follow-up question: ...
[ 0.239823579788208, -0.17570888996124268, 0.07650256156921387, 0.31811580061912537, -0.11300571262836456, 0.19625622034072876, 0.17063000798225403, -0.04706689342856407, -0.5127736330032349, -0.5864779353141785, -0.021389497444033623, 0.4297339618206024, -0.2044062465429306, 0.0737132057547...
**lazy loading** - and the opposite behaviour (loading *everything* up front just in case you need it) is known as **eager loading**. That said, there is a third option you might want to consider, which is lazy-loading the entire User object when any of its properties are accessed: ``` public function get_email_addr...
[ 0.11896780878305435, -0.20763027667999268, 0.1560632288455963, -0.14825139939785004, -0.17710170149803162, -0.25276491045951843, 0.26207244396209717, -0.1636805385351181, -0.3832603991031647, -0.687181293964386, -0.45174917578697205, 0.7679286003112793, -0.5636788010597229, 0.0068448386155...
IDs only, without the memory hit of fully loading every single user, but then you only require a single database call for each user to populate the rest of the user fields.
[ 0.5509747266769409, -0.10141810774803162, 0.24816110730171204, 0.33094915747642517, -0.07447504997253418, -0.33994269371032715, -0.08525057137012482, -0.2612104117870331, -0.11000026762485504, -0.570896565914154, -0.05312802642583847, 0.4864925146102905, -0.21712638437747955, -0.2313354760...
How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images. OK guys, I got the problem solved. Here's the code snippet: ``` private void SaveToImage(W...
[ 0.272155225276947, -0.06199619174003601, 0.5199899673461914, 0.03048587404191494, -0.010673556476831436, 0.18651147186756134, 0.20517970621585846, -0.13779090344905853, -0.04774896055459976, -0.7461655735969543, 0.11653661727905273, 0.7609725594520569, -0.40869542956352234, 0.0797654539346...
if (data.GetDataPresent(typeof(Bitmap))) { Bitmap image = (Bitmap)data.GetData(typeof(Bitmap)); image.Save(filePath); } } ``` Hope it helps :)
[ 0.1301383078098297, -0.39219173789024353, 0.5502959489822388, -0.11594770103693008, 0.4729962944984436, -0.0011351825669407845, 0.21905900537967682, -0.1773410141468048, -0.09499432891607285, -0.7927672266960144, -0.24365778267383575, 0.6171351671218872, -0.37320536375045776, -0.0966088995...
The [Flot API documentation](http://flot.googlecode.com/svn/trunk/API.txt) describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to prevent Flot from drawing the vertical grid lines with...
[ 0.4327167272567749, -0.24835310876369476, 0.3414134383201599, 0.19760559499263763, -0.1529495269060135, 0.27178341150283813, 0.0691206306219101, -0.10692943632602692, -0.5497872829437256, -0.3885570764541626, 0.5817111730575562, 0.25950583815574646, -0.4769464433193207, 0.12001602351665497...
vertical ticks often cut through the bars in a way that is visually noisy. As Laurimann noted, Flot continues to evolve. The ability to control this has been added to the API (as noted in the flot issue Nelson linked to). If you download the latest version (which is still labeled 0.6), you can disable lines on an axis...
[ 0.4717758893966675, -0.338516503572464, 0.5120359659194946, 0.20582382380962372, -0.13711248338222504, 0.11163950711488724, 0.25704625248908997, 0.1065506860613823, -0.46602949500083923, -0.5079396963119507, 0.1324004977941513, 0.10632771998643875, -0.4476158022880554, 0.2585781514644623, ...
I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista. From what I've read, [this is expected behavior](https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback....
[ 0.4026671051979065, -0.007243819069117308, 0.3831219971179962, -0.11777463555335999, -0.12830616533756256, -0.28048187494277954, 0.5716446042060852, 0.03278534859418869, -0.26908132433891296, -1.0080584287643433, 0.16665242612361908, 1.0124539136886597, -0.2721942663192749, 0.4799537658691...
up the port? I've never used an HttpListener, but from your description it sounds more like you want to listen on a regular TCP port, instead of embedding your application into a server URL namespace (which is what HttpListener appears to do). You should be able to use regular socket functions (System.Net.Sockets.TcpLi...
[ 0.5396380424499512, -0.0062128035351634026, 0.2856746315956116, 0.2790297567844391, -0.15074945986270905, -0.23581542074680328, 0.23472203314304352, 0.043985430151224136, -0.5355079770088196, -0.5694504380226135, 0.045464493334293365, 0.9909645318984985, -0.3945854902267456, 0.449897289276...
I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored? From: [How to Remove Individual Entries from Run Command History](http://www.pchell.com/support/editrunmrulistentries.shtml) > Where is the Run MRU (Most Recently > Used) List? > > > The RUNMRU list i...
[ 0.5311640501022339, 0.10635311156511307, 0.3248676359653473, -0.08932089805603027, 0.04006268456578255, 0.059741485863924026, 0.37136346101760864, 0.01241018995642662, -0.07551185041666031, -0.5747600197792053, -0.12483110278844833, 0.7570684552192688, -0.3706206679344177, 0.16835652291774...
individual entries, so I setup a > VBScript that you can download and run > to delete individual commands from > this list. Follow these instructions > to download and use this program to > clear unwanted entries from the Run > Command history. > > > 1) Click on the following link and > download the EditRunMRU...
[ 0.29273471236228943, 0.0362178198993206, 0.656299352645874, -0.0012194388546049595, -0.0699060708284378, -0.10562767833471298, 0.2767012119293213, -0.15324415266513824, -0.35011616349220276, -0.6383432149887085, -0.16114376485347748, 0.611587405204773, -0.34921795129776, 0.1384800523519516...
I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from [dbb](http://www.vbforums.com/showthread.php?t=379072) and [marxidad](http://www.motobit.com/tip...
[ 0.13973468542099, 0.38977622985839844, 0.49004030227661133, -0.4356975853443146, -0.08497586846351624, 0.35176610946655273, 0.367277592420578, -0.7032961249351501, -0.1684761941432953, -0.29718345403671265, -0.1309872567653656, 0.42140626907348633, -0.4852137565612793, 0.24013271927833557,...
objNode.dataType = "bin.base64" objNode.nodeTypedValue = arrData EncodeBase64 = Replace(objNode.Text, vbLf, "") Set objNode = Nothing Set objXML = Nothing End Function ```
[ -0.39039191603660583, 0.01612270064651966, 0.4101986885070801, -0.3403020203113556, 0.217061385512352, -0.2082151472568512, 0.6117480993270874, -0.13870595395565033, -0.2531559467315674, -0.42984142899513245, -0.5019189119338989, 0.25491002202033997, -0.38462546467781067, 0.194251194596290...
I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code. Any idea where this code is available? You can find it on Eclipse's repository: ...
[ 0.9944093227386475, -0.10563676804304123, -0.05200466141104698, 0.0835447758436203, -0.3547549843788147, -0.17964333295822144, -0.09866225719451904, 0.39391887187957764, -0.35357174277305603, -0.7026635408401489, 0.05316263809800148, 0.44232887029647827, -0.01843760348856449, -0.0017489317...
I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on single windows machines, from 1 to 150 client machines per customer) and a web ...
[ 0.9475014209747314, 0.32200002670288086, 0.3554956614971161, -0.054095495492219925, 0.4453866183757782, -0.010240213945508003, -0.10273489356040955, -0.061204131692647934, 0.009686494246125221, -0.318151593208313, -0.14655165374279022, 0.35990577936172485, 0.05665824934840202, 0.3179532885...
without capability to use the client the system becomes basically useless. Our basic assumption is that the customer is "honest enough" and only thing we would like to cover is stopping the client design environment if not properly licensed with a time expiration license. I've evaluated different licensing product an...
[ 0.578267514705658, 0.17205552756786346, 0.6087960600852966, 0.015278796665370464, 0.2568831443786621, -0.3689969778060913, 0.14239990711212158, -0.1391759067773819, 0.3715916574001312, -0.4293907582759857, -0.31315070390701294, 0.8544080257415771, 0.017255954444408417, -0.1678241342306137,...
if they lose of copy it then the licensing schema will fail but it will be their fault * The client will open the license file on startup and check its validity using a public key embedded in the binaries * If license XML is valid and the data in it (expiration date and product name) are correct than the designer work;...
[ 0.8737736344337463, 0.3737744092941284, 0.6329131722450256, 0.043949007987976074, 0.1534295380115509, -0.49515751004219055, 0.2524181008338928, -0.14049744606018066, 0.019004931673407555, -0.515396773815155, -0.2114562690258026, 0.5395704507827759, -0.07711517810821533, 0.29586777091026306...
very good (though be certain that if someone really wants to, they'll break it). Whatever you do, you should follow Eric Sink's [advice](http://www.ericsink.com/bos/Transparency.html): > The goal should simply be to "keep > honest people honest". If we go > further than this, only two things > happen: > > > 1. ...
[ 0.33225205540657043, 0.4159892201423645, -0.08584263175725937, 0.20270217955112457, 0.013355638831853867, -0.2328248918056488, 0.5169172286987305, -0.11955801397562027, 0.07276306301355362, -0.5762165188789368, 0.08527103066444397, 0.9002377390861511, 0.09878399968147278, -0.14378705620765...
some kind of id and expiration date along with a simple signature on the client and refuse to start if the license expired or signature failed. It's not that hard to break it, but no licensing scheme is and if you consider your customers honest, this will be more than enough.
[ 0.7462377548217773, 0.27636635303497314, 0.5372015237808228, -0.002727572340518236, 0.3482653498649597, -0.374759316444397, 0.06568294018507004, -0.253415048122406, -0.17269548773765564, -0.11600510776042938, 0.17061085999011993, 0.2883719205856323, 0.2168719321489334, 0.040311750024557114...
This seems very noisy to me. Five lines of overhead is just too much. ``` m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try ``` So how would you simply this? I was thinking the same, but in C# ;-p ``` using System; using System.Threading; class Program { static void M...
[ 0.2762698233127594, -0.02652573212981224, 0.7400102615356445, -0.18717746436595917, 0.4728139340877533, -0.0653502568602562, 0.35359227657318115, -0.2679108679294586, -0.0339762382209301, -0.6212224960327148, 0.0028406186029314995, 0.8131715059280396, -0.5994275808334351, 0.245015263557434...
} } } public static class ReaderWriterExt { sealed class ReadLockToken : IDisposable { private ReaderWriterLockSlim sync; public ReadLockToken(ReaderWriterLockSlim sync) { this.sync = sync; sync.EnterReadLock(); } public void Dispose()
[ 0.0572076179087162, 0.06853650510311127, 0.2856067717075348, 0.08107366412878036, 0.5411099791526794, -0.043253134936094284, 0.5174579620361328, -0.2720191180706024, 0.4353007376194, -0.5987791419029236, -0.2886646091938019, 0.4511561989784241, -0.42878031730651855, 0.46630769968032837, ...
{ if (sync != null) { sync.ExitReadLock(); sync = null; } } } public static IDisposable Read(this ReaderWriterLockSlim obj) {
[ -0.33253762125968933, -0.014270234853029251, 0.2971815764904022, 0.10489699244499207, 0.29132482409477234, -0.04126983508467674, 0.6274420022964478, -0.109284907579422, 0.4615965783596039, -0.5458911061286926, -0.25656968355178833, 0.40856078267097473, -0.6117331385612488, 0.25996938347816...
return new ReadLockToken(obj); } } ```
[ -0.1751805990934372, 0.1701420396566391, 0.2927160859107971, -0.45866742730140686, 0.3430686295032501, -0.0772198885679245, 0.43786972761154175, 0.0774548128247261, -0.1504962146282196, -0.4912494719028473, -0.41969841718673706, 0.5727414488792419, -0.3893797695636749, 0.3095529079437256, ...
I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables. I also took a look at MicrosoftAjaxTemplates.js (from <http://www.codeplex.com/aspn...
[ 0.4527257978916168, 0.05236607789993286, -0.004378476645797491, 0.10479836165904999, -0.4555117189884186, -0.029184196144342422, 0.15790478885173798, -0.07094491273164749, -0.09985373169183731, -0.7842485904693604, 0.14837566018104553, 0.4427907466888428, -0.3059197664260864, -0.0644530504...
I was previously taught today how to set parameters in a SQL query in .NET in this answer ([click](https://stackoverflow.com/questions/169359/improving-code-readability-for-sql-commands#169369)). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the m...
[ 0.23495365679264069, -0.11411698162555695, 0.42739376425743103, 0.007406362798064947, -0.1272166520357132, -0.2907447814941406, 0.337054967880249, -0.42704764008522034, -0.5374788045883179, -0.2770242393016815, -0.048425525426864624, 0.5321319699287415, -0.3422413766384125, 0.2195902615785...
doing it wrong? you want [DBNull](http://msdn.microsoft.com/en-us/library/system.dbnull.aspx).Value. In my shared DAL code, I use a helper method that just does: ``` foreach (IDataParameter param in cmd.Parameters) { if (param.Value == null) param.Value = DBNull.Value; } ```
[ 0.344500869512558, -0.04731576144695282, 0.32004883885383606, -0.03731588274240494, -0.0756949931383133, 0.23049353063106537, 0.3011816143989563, -0.27458563446998596, -0.2445545345544815, -0.1457885354757309, 0.14709877967834473, 0.20869065821170807, -0.3949239253997803, 0.222368478775024...
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups. However, when inserting one must always check if the first index already exists in the hash. For example: ``` h = Hash.new h['x'] = Hash.new if not h.key?('x') h['x']['y'] = value_to_insert ``` It would be preferable to do the...
[ -0.03413591533899307, 0.07582710683345795, -0.020358312875032425, -0.14687351882457733, -0.2345028519630432, -0.19516614079475403, 0.21977876126766205, -0.3172105848789215, -0.12010721117258072, -0.6772137880325317, -0.25822535157203674, 0.5080665349960327, -0.4769105017185211, 0.067949987...
behavior, but is there an existing a Ruby idiom for accomplishing this task? You can pass the [`Hash.new`](http://www.ruby-doc.org/core/classes/Hash.html#M002868) function a block that is executed to yield a default value in case the queried value doesn't exist yet: ``` h = Hash.new { |h, k| h[k] = Hash.new } ``` Of...
[ -0.11716809123754501, 0.02406216971576214, -0.4145069122314453, 0.005171066615730524, -0.11782436072826385, 0.42129671573638916, 0.7516483068466187, -0.3863925337791443, -0.47848865389823914, -0.062928706407547, -0.1938096582889557, 0.6018878817558289, -0.6701822280883789, -0.1103123053908...
I am trying to set myself up on a mac to learn Ruby on Rails, however I seem to be having some problems. If I try to run commands such as ./script/server, i get this: > Rails requires RubyGems >= 0.9.4 (you have 0.9.2). Please `gem update --system` and try again. When I run "gem update.." I get this: > Updating Rub...
[ 0.07792768627405167, 0.1334003061056137, 0.3041628897190094, -0.1143038421869278, -0.09497032314538956, -0.08074139058589935, 0.9460834860801697, -0.188337042927742, -0.0670352354645729, -0.8318966627120972, -0.08220383524894714, 0.7619832754135132, -0.2063225358724594, 0.18322688341140747...
I have a class like the following: ``` public class DropDownControl<T, Key, Value> : BaseControl where Key: IComparable { private IEnumerable<T> mEnumerator; private Func<T, Key> mGetKey; private Func<T, Value> mGetValue; private Func<Key, bool> mIsKeyInCollection; public DropDownControl(strin...
[ -0.20891118049621582, -0.12314245104789734, 0.3139895498752594, -0.09567967802286148, 0.012863420881330967, 0.10093098878860474, 0.2968122065067291, -0.2698410749435425, 0.1416342705488205, -0.4913327991962433, -0.31136399507522583, 0.4348770081996918, -0.33486369252204895, 0.3003770411014...
mGetValue = getValue; mIsKeyInCollection = isKeyInCollection; } ``` And I want to add a convenience function for Dictionaries (because they support all operations efficiently on their own). But the problem is that such a constructor would only specify Key and Value but not T directly, but T is just KeyV...
[ -0.23072797060012817, -0.011557821184396744, 0.5152548551559448, -0.051413826644420624, -0.15325963497161865, -0.03159785270690918, 0.3536953032016754, -0.11813782155513763, -0.12517641484737396, -0.5880462527275085, -0.2536620497703552, 0.5783039331436157, -0.4082849621772766, 0.056558016...
static DropDownControl<KeyValuePair<DKey, DValue>, DKey, DValue> Create<DKey, DValue>(string name, IDictionary<DKey, DValue> dictionary) where DKey: IComparable { return new DropDownControl<KeyValuePair<DKey, DValue>, DKey, DValue>(name, dictionary, kvp => kvp.Key, kvp => kvp.Value, key ...
[ -0.35685229301452637, -0.5165019631385803, 0.2911425530910492, 0.06480701267719269, -0.12111114710569382, 0.1183423399925232, 0.2097986489534378, -0.17470452189445496, -0.32953619956970215, -0.10200709849596024, -0.4679703116416931, 0.5197033286094666, -0.34931680560112, 0.2134459614753723...
= DropDownControl.Create(name, dictionary); ``` C# 3.0 helps here both via "var" (very welcome here) and by the much-improved generic type inference rules. In some (more general) case, another similar option is an extension method, but an extension method to create a very specific control from a dictionary doesn't fe...
[ 0.10284832119941711, -0.37531617283821106, 0.4979425072669983, 0.16746926307678223, 0.13728263974189758, -0.23064619302749634, -0.0320565439760685, -0.2713138461112976, -0.25099554657936096, -0.3113212585449219, -0.3699927031993866, 0.6096746921539307, -0.3698202669620514, 0.04071583971381...
return new DropDownControl<KeyValuePair<TKey, TValue>, TKey, TValue> (name, value, pair => pair.Key, pair => pair.Value, key => value.ContainsKey(key) ); } } ``` Another option is inheritance, but I don't like it much... ``` public class DropDownControl<TKey, TValue> : DropDow...
[ -0.005966197699308395, -0.4351693391799927, 0.4932146966457367, 0.09893207997083664, 0.16411808133125305, -0.06125694140791893, -0.007712025195360184, -0.3891233801841736, -0.20526058971881866, -0.554211437702179, -0.41654500365257263, 0.6920450925827026, -0.2963477373123169, 0.14310835301...
pair.Key, pair => pair.Value, key => lookup.ContainsKey(key)) { } } ``` This adds complexity and reduces your flexibility... I wouldn't do this... Overall, it sounds like you *want* to be working with just IDictionary<,> - I wonder if you can't simplify your control to just use this, and force non-dictio...
[ 0.4640173316001892, -0.05166904255747795, 0.11015275865793228, -0.2797405421733856, -0.03648485243320465, -0.13550734519958496, 0.3915432095527649, -0.42946285009384155, 0.2393283098936081, -0.7154909372329712, -0.08582510054111481, 0.7373140454292297, -0.6312397122383118, 0.21628193557262...
I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would enable this setting. Thanks for any help...
[ 0.11528192460536957, 0.18733426928520203, 0.7433174848556519, 0.12583065032958984, 0.028929904103279114, -0.05066502466797829, 0.26237475872039795, 0.3355596661567688, -0.321473091840744, -0.7914845943450928, 0.10421986132860184, 0.6254441142082214, -0.16904689371585846, 0.1116890758275985...
Converting my current code project to TDD, I've noticed something. ``` class Foo { public event EventHandler Test; public void SomeFunction() { //snip... Test(this, new EventArgs()); } } ``` There are two dangers I can see when testing this code and relying on a code coverage tool to det...
[ 0.5303676128387451, -0.11181924492120743, -0.06577974557876587, -0.11748310923576355, 0.01576739363372326, -0.3201451301574707, 0.4435340464115143, -0.059379540383815765, -0.24376940727233887, -0.5834184885025024, 0.035232316702604294, 0.6330630779266357, -0.18601608276367188, 0.1188860982...
second. To this end, I added an event handler to my startup function so that it looked like this: ``` Foo test; int eventCount; [Startup] public void Init() { test = new Foo(); // snip... eventCount = 0; test.Test += MyHandler; } void MyHandler(object sender, EventArgs e) { eventCount++; } ``` Now...
[ 0.041792064905166626, -0.13141071796417236, 0.11043056845664978, -0.1971256285905838, 0.156819686293602, -0.16063381731510162, 0.38221946358680725, -0.10971321165561676, -0.14067652821540833, -0.5210485458374023, -0.11575835198163986, 0.5542550086975098, -0.31984391808509827, 0.09455109387...
any handlers before trying to call it. This will cause a null dereference, which will never be caught by any of our tests because they all have an event handler attached by default. But again, a code coverage tool will still report full coverage. This is just my "real world example" at hand, but it occurs to me that p...
[ 0.39024457335472107, -0.05966503545641899, -0.023781362920999527, 0.2422032654285431, -0.06725580245256424, -0.4527565836906433, 0.5888708233833313, 0.012705952860414982, -0.32601770758628845, -0.4227057099342346, 0.08540093153715134, 0.3499535918235779, -0.18480804562568665, -0.1977503150...
Are there other sorts of tools that would catch these holes? I wouldn't say "take it with a grain of salt" (there is a lot of utility to code coverage), but to quote myself > TDD and code coverage are not a > panacea: > > > · Even with 100% block > coverage, there still will be errors > in the conditions that cho...
[ 0.43355366587638855, 0.13007184863090515, -0.07291055470705032, 0.15000487864017487, -0.11391280591487885, 0.004868211690336466, 0.6503368020057678, -0.22280347347259521, -0.16995859146118164, -0.8669592142105103, -0.029330221936106682, 0.7254198789596558, -0.05852793529629707, -0.22022083...
100% arc coverage + 100% > error-free-for-at-least-one-path > straight-line code, there will still > be input data that executes > paths/loops in ways that exhibit more > bugs. (from [here](http://www.myspace.com/lorgonblog/blog/306380867?Mytoken=799A2828-11C7-4E3D-B241B066447F8E8E89782153)) While there may be s...
[ 0.2950618267059326, 0.019851285964250565, 0.37597671151161194, 0.012689781375229359, -0.011587628163397312, -0.3006047010421753, 0.5967029929161072, -0.2761692404747009, -0.0797056034207344, -0.6405295133590698, -0.27205634117126465, 0.6424097418785095, -0.005508091300725937, -0.4937439262...
I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons? There isn't any built in support for mod\_python logging to Apache currently. If you really want to work within the Apache logs you can che...
[ 0.4833034873008728, 0.0882582738995552, -0.09904730319976807, -0.06799051910638809, -0.33069974184036255, -0.33553004264831543, 0.5815621018409729, -0.014644834212958813, -0.5183855295181274, -0.24656347930431366, 0.3714020252227783, 0.5044850707054138, -0.12059926241636276, 0.094137921929...
complete. Aside from the Python.org docs Blair linked, here's a more in-depth look at the module's features from onLamp: * <http://www.onlamp.com/pub/a/python/2005/06/02/logging.html> And for a quickie example usage: * <http://hackmap.blogspot.com/2007/06/note-to-self-using-python-logging.html>
[ 0.27535849809646606, 0.1140328198671341, 0.21467313170433044, -0.25176337361335754, -0.0454830527305603, -0.287665992975235, 0.5768148899078369, -0.39478799700737, -0.4509320557117462, -0.06726998835802078, -0.16171184182167053, 0.639640748500824, -0.18273696303367615, -0.29506269097328186...
I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this? Í'm assuming I'll use `Application.OnTime` to periodically check if the user has been active. But what events should I handle to see if the user was "active" (...
[ 0.23645484447479248, -0.04124647006392479, 0.33288004994392395, -0.16057127714157104, 0.05566217005252838, -0.11306123435497284, 0.2669524550437927, -0.31493398547172546, -0.14748719334602356, -0.7708999514579773, -0.044988397508859634, 0.5684990286827087, -0.2938251793384552, -0.471843868...
variable thus: ``` LastActivityTime = Now ``` and the macro run by `Application.OnTime` will check this variable to see if the user has been active recently. Which events (other than `SheetChange`) would I need to handle to set this variable? I had kind of hoped there would be `KeyUp` and `MouseUp` events, these two...
[ -0.06339479237794876, -0.2212032526731491, 0.6591545939445496, -0.14153306186199188, 0.12644989788532257, -0.21551141142845154, 0.17055261135101318, -0.3056829869747162, -0.10746647417545319, -0.682537853717804, 0.08393677324056625, 0.897491455078125, -0.3967553377151489, -0.24988119304180...
I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in .jspx, or tomcat won't translate tag libraries and stuff. Both f...
[ 0.3531309962272644, 0.10455793142318726, 0.36479100584983826, -0.06453996896743774, -0.09896918386220932, -0.2547474205493927, 0.3650181293487549, -0.06128086894750595, -0.4541519284248352, -0.3124821186065674, 0.015202436596155167, 0.3916696012020111, -0.43126335740089417, 0.0924577936530...
of the default configurations for \*.jsp to use that of \*.jspx. Try adding a **jsp-property-group** definition for **\*.jsp** with **is-xml** set to true: ``` <jsp-property-group> <url-pattern>*.jsp</url-pattern> <is-xml>true</is-xml> </jsp-property-group> ``` [Some information on configuring property group](h...
[ -0.2793978750705719, -0.04436474293470383, 0.4511009156703949, 0.06172100827097893, -0.13456903398036957, -0.22811168432235718, -0.0652661919593811, -0.4764392673969269, -0.3214431405067444, -0.6474398970603943, -0.411597341299057, 0.6713293790817261, -0.17380525171756744, 0.06338594853878...
On a question of just performance, how does Python 3 compare to Python 2.x? 3.0 is slower than 2.5 on official benchmarks. From ["What’s New in Python 3.0"](http://docs.python.org/3.0/whatsnew/3.0.html#performance): > The net result of the 3.0 > generalizations is that Python 3.0 > runs the pystone benchmark around ...
[ -0.05190519616007805, 0.1469402015209198, 0.39956343173980713, 0.12813211977481842, -0.27625373005867004, -0.06500813364982605, 0.5250312685966492, -0.30732861161231995, -0.2520841658115387, -0.5088320374488831, -0.040358953177928925, 0.48670583963394165, -0.20005245506763458, -0.223998740...
PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation? Regarding the IIS caching behaviour, it seems from reading [here](http://lb1.www.ms.a...
[ 0.12895682454109192, 0.3132355213165283, 0.3063353896141052, -0.14740824699401855, -0.3327402174472809, -0.03989684581756592, 0.16204531490802765, -0.27377745509147644, -0.3422948718070984, -0.23776084184646606, 0.21437852084636688, 0.28754743933677673, -0.20021910965442657, 0.214062228798...
talking about. * Opcode or Template caching * Output caching **Opcode or Template caching** is the caching that takes place when a raw script file which is merely a text file is transformed to an in memory set of opcodes that can be executed by the script engine. PHP has some additional tools which allow such a set o...
[ 0.4070906639099121, 0.25717976689338684, 0.05353222414851189, -0.23830817639827728, -0.14711543917655945, -0.06830105185508728, -0.05116145312786102, -0.1347542256116867, -0.17960229516029358, -0.577650249004364, -0.1718640774488449, 0.3407999277114868, -0.4773699641227722, -0.006685064639...
where the generated output of script that is sent to a response buffer is cached so that subsequent requests for an identical URL (and possible matching other headers as well) would not re-run the script at all but resend the previously cached output. ASP has no facility for output caching whereas ASP.NET does. I'm no...
[ 0.09226848930120468, -0.0630558580160141, 0.27389219403266907, -0.14759278297424316, 0.015088259242475033, -0.04866202548146248, 0.15427365899085999, -0.2853088974952698, -0.3855040669441223, -0.8294998407363892, -0.12959283590316772, 0.2928776741027832, -0.2876370847225189, 0.091348707675...
tab and click Configuration... then select the cache options tab. By default 500 'compilied' pages will be cached in memory and 2000 will be cached on disk. In a comment to my original version of this answer you seem to asking whether PHP hosted by IIS would also benefit from template caching. That would depend how PH...
[ 0.12190965563058853, 0.037974417209625244, 0.3052661716938019, 0.23351621627807617, -0.15251046419143677, -0.12838509678840637, -0.005609854590147734, -0.04574301093816757, -0.23316442966461182, -0.7043731808662415, 0.12557505071163177, 0.4330900013446808, -0.05287774279713631, 0.277255088...
probably fiction but just to try to round out the picture:- Another unlikely possiblity would be if PHP were some how added as ASP Script language. In this case files with PHP extension would be mapped to the ASP.DLL and the files would either contain <%@ language="PHP" or the default language in the application confi...
[ 0.40352150797843933, 0.038975007832050323, 0.2119537889957428, 0.3349689841270447, 0.009136623702943325, -0.2752818763256073, 0.22560279071331024, 0.190135657787323, -0.22779209911823273, -0.3782716691493988, -0.07068189233541489, 0.3557841181755066, -0.3637078106403351, 0.1636146008968353...
I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you You can use the *Berkeley DB* `PersistentMap` class to save your (`Se...
[ 0.21161603927612305, 0.04634447395801544, -0.007361142430454493, 0.1115814596414566, -0.05524984002113342, 0.09920269250869751, 0.4164745807647705, 0.17444513738155365, -0.6185071468353271, -0.8237926363945007, 0.17165988683700562, 0.6660617589950562, -0.1984018236398697, 0.178880482912063...
schema changes (i.e. changing what data your classes consist of - adding a new field for example) 2. What happens if your file(s) become corrupted? Depending on how reliable your program's storage needs to be will affect your decision of how you save the data which your objects implicitly contain. Remember, you can alw...
[ 0.22749634087085724, -0.24708521366119385, 0.015808729454874992, 0.48078152537345886, -0.11823524534702301, -0.16614368557929993, 0.44823387265205383, -0.202837735414505, -0.3073740303516388, -0.8184804320335388, -0.1335628777742386, 0.3443509638309479, -0.4356369376182556, 0.2070523053407...
Easy to do if you've used a (relational) database; not so easy if you've serialized stuff to files!
[ 0.03222775086760521, 0.06727336347103119, -0.24735037982463837, 0.43057334423065186, -0.023555636405944824, -0.34134843945503235, 0.217469722032547, 0.10496445745229721, -0.4447743594646454, -0.46654677391052246, -0.21431222558021545, 0.6973856687545776, 0.14767368137836456, -0.34280067682...
Does anyone know how to resize images proportionally using JavaScript? I have tried to modify the DOM by adding attributes `height` and `width` on the fly, but seems did not work on IE6. To modify an image proportionally, simply only alter one of the width/height css properties, leave the other set to auto. ``` image...
[ 0.3366543650627136, 0.1284037083387375, 0.5496647953987122, -0.1937752366065979, -0.3456782400608063, 0.1404600441455841, 0.24745699763298035, -0.250479131937027, -0.1103752925992012, -0.6458550691604614, 0.1260106861591339, 0.931456983089447, 0.08196583390235901, -0.08556976169347763, -...
I would like to update a Windows Forms application to provide the following features: * spell checking * limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't support the formatting, but could also be rendered ...
[ 0.5106685757637024, -0.1376018077135086, 0.344779372215271, 0.17193369567394257, -0.07948532700538635, -0.4739345908164978, 0.14972783625125885, -0.10431386530399323, -0.10383594036102295, -0.8118644952774048, -0.03333095833659172, 0.4578031301498413, -0.15151536464691162, -0.3063100278377...
[richtextbox](http://www.c-sharpcorner.com/UploadFile/scottlysle/SpellCheckCC05152007084528AM/SpellCheckCC.aspx) custom control with spell checking. An app for [checking spelling](http://www.codeproject.com/KB/string/netspell.aspx) that could be easily integrated Also [here](http://www.c-sharpcorner.com/UploadFile/ma...
[ 0.15340052545070648, -0.12886275351047516, 0.29736873507499695, 0.17126065492630005, -0.22979407012462616, -0.041987188160419464, 0.4196375608444214, -0.23538987338542938, -0.27745383977890015, -0.39048874378204346, -0.10123822838068008, 0.4188825190067291, -0.21158601343631744, -0.2685678...
I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool a...
[ 0.03241103142499924, 0.013477986678481102, 0.3597835898399353, 0.4305737316608429, -0.032610904425382614, 0.0008695278083905578, -0.03288975730538368, 0.19503812491893768, -0.25373154878616333, -0.39010530710220337, 0.23391158878803253, 0.4781568944454193, -0.25471732020378113, 0.296037971...
it. The important thing to do is to block direct access to the object context (preventing users from building their own ObjectQuery), and instead give the client a narrower gateway within which to access and mutate entities. We do it with the [Entity Repository pattern](http://www.martinfowler.com/eaaCatalog/repository...
[ 0.14317157864570618, -0.11500895023345947, 0.36234357953071594, 0.0619158037006855, 0.06674341857433319, -0.28380995988845825, 0.2472677230834961, 0.09163328260183334, -0.44869062304496765, -0.4386196732521057, -0.26960664987564087, 0.5070083737373352, -0.2632395327091217, 0.28621587157249...
assembly. However, there are subtleties to consider. If you implement row-level view security on a certain entity type via the repository pattern, then you must consider other means by which a client could access the same entities. For example, via navigational relationships. You may need to make some of those relatio...
[ 0.24761302769184113, 0.03379124030470848, -0.01896519772708416, -0.10122121870517731, -0.0883701965212822, -0.11626600474119186, 0.31508493423461914, -0.6063430905342102, -0.545647382736206, -0.3922315239906311, -0.2891252934932709, 0.5149351358413696, -0.5810117721557617, -0.0282068289816...
agree that this cannot be done with the Entity Framework, I do agree with the "do it on the DB server" comments insofar as you should implement [defense in depth](http://en.wikipedia.org/wiki/Defense_in_Depth_(computing)).
[ 0.6016571521759033, 0.21912077069282532, 0.01022905483841896, -0.10799632221460342, -0.2320694476366043, -0.48149821162223816, 0.47809872031211853, -0.31877511739730835, 0.3456677496433258, -0.20090632140636444, 0.047147683799266815, 0.719477117061615, 0.08164411783218384, -0.1917287260293...
I've been working with sessions, MVC design and object oriented PHP. Where should I save or retrieve data from a session? I would like to retrieve it from within methods so I don't have to pass the data to the methods. Whats the best practice? I typically put this inside the controller. It just makes sense.. The contro...
[ 0.2241760790348053, -0.0725511908531189, 0.39198553562164307, 0.16957686841487885, -0.17915496230125427, -0.06546317040920258, 0.04433561488986015, -0.3119557201862335, -0.3319052755832672, -0.4991682171821594, -0.10877826809883118, 0.6306487321853638, -0.28228163719177246, 0.1356388628482...
session handing here - this could be abstract). If you have for example different user types, you may want to polymorph this controller ones such as: AdminController, UserController, Etc.
[ 0.1484101116657257, -0.6330840587615967, 0.328551322221756, 0.7088379859924316, -0.3766242563724518, -0.33457151055336, 0.03180263563990593, -0.15512268245220184, -0.5213620662689209, -0.3975639045238495, -0.11385788768529892, 0.6124578714370728, -0.3662649393081665, 0.2932555675506592, ...
With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend? Is it time to try Merb? What was downside for you when you switched to Merb from Rails? Yes. Downsides: * Lack of documentation, although this is getting better (not really a problem for some, as the code is very well document...
[ 0.10865754634141922, -0.1446865200996399, 0.34920474886894226, -0.2595770061016083, -0.1814662516117096, -0.2709089517593384, 0.44560304284095764, 0.0402241051197052, -0.016471700742840767, -0.8735590577125549, -0.03867204859852791, 0.7022226452827454, -0.42283058166503906, 0.0032876369077...
or Sequel as they are thread-safe too) * Modular (can pick what you need along with your fav ORM, JS Lib, Templating Lang) * Less Magic * Good for green field projects or exposing your API * Merb has a stable API (1.0 comes out in a few weeks) Overall, if you're comfortable with Rails switching to Merb isn't hard at a...
[ 0.09435062855482101, -0.2233877331018448, 0.5126673579216003, -0.3702630400657654, -0.32610154151916504, -0.2527194619178772, 0.5470637679100037, -0.08070793747901917, -0.18479181826114655, -0.8639622330665588, -0.10817316919565201, 0.6730793118476868, -0.13864688575267792, -0.180761873722...
It seems that C# 3 hit me without me even noticing, could you guys tell me about good in depth guides to C# 3? from lambda to linq to everything else that was introduced with the third version of the language. Printed books would be nice, but online guides would be even better! [ScottGu](http://weblogs.asp.net/scottgu...
[ -0.01961502432823181, 0.19404785335063934, 0.19944597780704498, -0.04438761994242668, -0.4628913402557373, -0.0711924284696579, 0.2522285580635071, -0.056404195725917816, -0.5334228873252869, -0.24012921750545502, -0.21485094726085663, 0.6040801405906677, -0.11192243546247482, -0.340544253...
[Extension Methods](http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx) * [Lambda Expressions](http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx) * [Query Syntax](http://weblogs.asp.net/scottgu/archive/2007/04/21/new-orc...
[ -0.21978600323200226, 0.1861969232559204, 0.1623654067516327, -0.15480564534664154, -0.008864463306963444, 0.3170086443424225, 0.018356118351221085, -0.12576012313365936, -0.5071420669555664, -0.19230395555496216, -0.3123757243156433, 0.42945095896720886, -0.3486191928386688, -0.0113376742...