text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
the necessary migrations, in the right order. See my article here: <http://marksverbiage.blogspot.com/2008/07/versioning-your-schema.html>
[ -0.006173888687044382, -0.20911924540996552, 0.3656561076641083, -0.13320502638816833, 0.3383907675743103, 0.08079838007688522, 0.11280999332666397, -0.27013978362083435, -0.7019851207733154, -0.6520704030990601, -0.37529483437538147, 0.05910002067685127, -0.0028333470690995455, -0.2110882...
I have a side project I do = in Java. It's a pretty straight-forward webapp. It runs in Tomcat on a Linux Server and uses a MySQL database. The majority of the code was written with the Spring Framework. It has a lot of Unit Tests in place. When I'm coding it's in Eclipse. When I deploy the application I run a few shel...
[ 0.7055103778839111, 0.19076243042945862, 0.022305790334939957, -0.11774971336126328, -0.3550795912742615, 0.1348278522491455, 0.13290144503116608, -0.04697052389383316, 0.15462541580200195, -0.4464099109172821, 0.2158362716436386, 0.2996022701263428, 0.05107622593641281, 0.0390359982848167...
some day I might want to have a testing or staging environment as well. I use SVN version control, via the Eclipse plug-in. I'm always hearing about people using Maven for their projects. Since so many people are using it, I'm saying to myself it must be good. I'd like to learn it in my spare time. The only thing is I...
[ 0.6350519061088562, 0.2078658938407898, -0.09479790925979614, 0.33016183972358704, -0.11918283998966217, -0.3143554925918579, 0.10752583295106888, 0.2647829055786133, -0.07485168427228928, -0.5159285664558411, 0.2558344006538391, 0.5218632221221924, 0.06013333797454834, -0.1020692810416221...
like a project appropriate for Maven. You seem to have a working development environment. Why set up another one? It will just give you one more project file to maintain which breaks the good ol' [DRY](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself) principle.
[ 0.7176132202148438, 0.031796421855688095, -0.11246179789304733, 0.02763267606496811, -0.03351173922419548, -0.2730489671230316, 0.7485641241073608, 0.1944311559200287, -0.28277286887168884, -0.14316411316394806, 0.0412236750125885, 0.41656309366226196, -0.10783542692661285, 0.4028967916965...
I want to take the url: <http://www.mydomain.com/signup-12345> And actually give them: <http://www.mydomain.com/signup/?aff=12345> I have NO history with mod\_rewrite, HELP! Something that I found relatively hard to find out was how to do the reverse of what you are doing, whereby you need to find out the value of pa...
[ 0.35180631279945374, 0.0457262359559536, 1.048309326171875, -0.014580265618860722, -0.05527429282665253, -0.28825217485427856, 0.17357349395751953, -0.15884487330913544, -0.017770156264305115, -0.5841402411460876, 0.09645339846611023, 0.2637646794319153, -0.006952514871954918, -0.034895908...
to ".cfm" files with an ID in the query string.
[ 0.3356837034225464, 0.13245873153209686, 0.4885721802711487, 0.08905065059661865, 0.42305949330329895, -0.38544803857803345, -0.10003545880317688, -0.05394977331161499, -0.3683004081249237, -0.3287716805934906, -0.6299646496772766, 0.4602818787097931, -0.18498189747333527, 0.28456830978393...
Can anyone recommend a good 3rd party control(s) for MS SQL 2005 Reporting Services. If you know some open library or implementation of such controls that could be very useful too. Dundas do great RS add-ins if you have the budget: <http://www.dundas.com/index.aspx>
[ 0.37077796459198, 0.1788821667432785, 0.023662324994802475, 0.30906355381011963, -0.2533351182937622, -0.40091070532798767, 0.021596653386950493, -0.021509137004613876, -0.45044752955436707, 0.05669742450118065, 0.40450361371040344, 0.3647775650024414, -0.00150192528963089, -0.186343491077...
I want to be able to figure out what port a particular program is using. Are there any programs available online or that come with windows that will tell me which processes are using which ports on my computer? PS - before you downmod this for not being a programming question, I'm looking for the program to test some ...
[ 0.5836767554283142, 0.21102653443813324, 0.161080002784729, 0.2332201600074768, 0.3317287862300873, -0.25343215465545654, -0.030149100348353386, 0.23402370512485504, -0.36800721287727356, -0.9195663332939148, 0.12091916054487228, 0.6367166042327881, -0.07808910310268402, 0.1983585357666015...
usually add `-n` as well to make it a little faster, but adding `-b` can make it quite slow. *Edit*: If you need more functionality than netstat provides, [vasac suggests](https://stackoverflow.com/questions/105418/what-port-is-a-given-program-using#105487) that you try [TCPView](http://technet.microsoft.com/en-us/sys...
[ 0.30427712202072144, -0.21602652966976166, 0.23233023285865784, -0.10041004419326782, 0.1930815577507019, -0.2776361405849457, 0.03709350898861885, -0.004354769829660654, -0.5297377109527588, -0.6872614622116089, -0.359157532453537, 0.5180794596672058, -0.3075213134288788, 0.13770742714405...
We have got loads of options for `php + MySQL + Apache` combo... Which is the best pack among these ? Lets confine our ideas to `WAMP vs XAMPP`, is there a better option to go for? I created an online programming contest web app called `CodeFire` on `XAMPP`, later I had to switch to `WAMP`, where none of the `php` sc...
[ 0.6813468337059021, 0.025483671575784683, 0.187409445643425, 0.231387659907341, -0.25001007318496704, -0.20705385506153107, 0.0386027954518795, -0.21634547412395477, 0.01957654021680355, -0.7891039848327637, 0.17151425778865814, 0.7296808362007141, -0.4322803318500519, -0.04815496131777763...
(I'm mostly on Windows client machines). Small, fully-functional, and stable - works really well for my needs.
[ 0.24123315513134003, 0.23092609643936157, 0.22795507311820984, 0.20118118822574615, 0.2295798510313034, 0.2118278294801712, 0.030159851536154747, 0.4259643852710724, -0.14733156561851501, -0.7155992984771729, 0.0044355313293635845, 0.5147887468338013, 0.2758970260620117, 0.1116778329014778...
I have an enum that looks as follows: ``` public enum TransactionStatus { Open = 'O', Closed = 'C'}; ``` and I'm pulling data from the database with a single character indicating - you guessed it - whether 'O' the transaction is open or 'C' the transaction is closed. now because the data comes out of the database a...
[ -0.3444794714450836, 0.3410179913043976, 0.32199975848197937, -0.21273750066757202, 0.054806340485811234, 0.3109474182128906, 0.03814113512635231, -0.07402259111404419, -0.253222793340683, -0.5759478211402893, -0.07481115311384201, 0.5622851252555847, -0.3043007254600525, 0.487897425889968...
I have 5 or 6 and writting the same method for them is annoying to say the least. [Supposedly all enums inherit from System.Enum](http://blogs.msdn.com/abhinaba/archive/2006/01/14/enumerting-all-values-of-an-enum.aspx) but if I try to set that as the input type I get compilation errors. This is also in .NET 1.1 so gene...
[ 0.13896191120147705, 0.17664799094200134, 0.3412385880947113, -0.2768920660018921, -0.1642126888036728, -0.10027074813842773, 0.6082913875579834, -0.200046569108963, -0.157744362950325, -0.7597903609275818, -0.1528373509645462, 0.3364894390106201, -0.2507634460926056, 0.686678409576416, ...
val = 'R'; Console.WriteLine(EnumEqual(DirectionStatus.Left, val)); Console.ReadLine(); } public static bool EnumEqual(Enum e, object boxedValue) { return e.Equals(Enum.ToObject(e.GetType(), (char)boxedValue)); } public enum TransactionStatus { Open = 'O', Closed = 'C' }; public e...
[ -0.25708791613578796, -0.2091115266084671, 0.8334782123565674, -0.19624106585979462, 0.2622224688529968, 0.37116411328315735, 0.2899573743343353, -0.1268947571516037, 0.2224760502576828, -0.512151837348938, -0.5158400535583496, 0.8196439743041992, -0.27208998799324036, 0.02795165404677391,...
I have an application with a REST style interface that takes XML documents via POST from clients. This application is written in Java and uses XML beans to process the posted message. The XML schema definition for a field in the message looks like this: ``` <xs:element name="value" type="xs:string" nillable="true" /...
[ 0.1582624316215515, 0.2995837330818176, 0.34184154868125916, -0.2236042469739914, -0.39657825231552124, -0.17718440294265747, 0.16872556507587433, -0.041248761117458344, -0.011092736385762691, -0.5023056864738464, 0.0972098857164383, 0.11765605211257935, -0.15641818940639496, 0.31070098280...
like you might have come up against a bug in the CML parser you're using. What's the error message? You might try using `xsi:nil="1"` or using separate open and close tags (`<value xsi:nil="true"></value>`) to try working around the bug.
[ 0.4727553725242615, 0.034111909568309784, -0.34302058815956116, 0.3154468834400177, 0.003355274209752679, -0.3504139482975006, 0.31447428464889526, 0.20416849851608276, -0.44256874918937683, -0.35482466220855713, -0.008679871447384357, 0.49994170665740967, -0.39377111196517944, -0.18505002...
I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the command to jump to the end of the line that I am currently on? Just the `$` *(dollar sign)* key. You can use `A` to move to the end of the line and switch to editing mode (Append). To jump the last non-blank charac...
[ 0.16048306226730347, -0.03412407636642456, 0.5778158903121948, 0.02408308908343315, -0.15816310048103333, 0.022132007405161858, 0.11471451818943024, 0.05394842103123665, -0.11588229984045029, -0.3635009527206421, -0.22876892983913422, 0.3218038082122803, -0.11653058975934982, -0.0772210285...
I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine. I tried using MySQL Administrator, but I got the following error: > The selected file was generated by > mysqldump and cannot be restored by > this application. How do I get this working? It should be as simpl...
[ -0.020205337554216385, 0.31822142004966736, 0.2896648645401001, 0.027603967115283012, -0.12383949756622314, -0.15121404826641083, 0.46909794211387634, 0.05324497073888779, -0.29143625497817993, -0.6301428079605103, 0.013878040947020054, 0.6690366864204407, -0.30286306142807007, 0.308364897...
run these commands, open up a command prompt (in Windows) and `cd` to the directory where the `mysql.exe` executable is (you may have to look around a bit for it, it'll depend on how you installed mysql, i.e. standalone or as part of a package like WAMP). Once you're in that directory, you should be able to just type t...
[ 0.5111998915672302, -0.02009475789964199, 0.28352856636047363, 0.12747856974601746, 0.21773453056812286, -0.506466269493103, 0.10148437321186066, 0.37727487087249756, 0.006427811458706856, -0.6740469336509705, -0.2730141580104828, 0.7839156985282898, -0.14425697922706604, 0.164545014500617...
coming back to postgresql after several years of oracle ... what are the state-of-the art postgresql administrative/ddl generating/data inserting frontends on windows? it would be nice if it had integration for postgis as well. it should be standalone or alternatively a plugin for intellij idea thinking back, all th...
[ 0.34263381361961365, -0.12894615530967712, 0.18010568618774414, 0.0693931058049202, -0.4219454526901245, -0.44287633895874023, -0.14465199410915375, 0.3833983540534973, -0.37173140048980713, -0.6373092532157898, 0.12309958785772324, 0.5157052278518677, -0.05967113375663757, 0.1925336718559...
I saw this quote on the question: [What is a good functional language on which to build a web service?](https://stackoverflow.com/questions/105710) > Scala in particular doesn't support tail-call elimination except in self-recursive functions, which limits the kinds of composition you can do (this is a fundamental lim...
[ -0.07171742618083954, -0.023612115532159805, -0.0409107580780983, 0.04432251304388046, -0.022267557680606842, -0.08347698301076889, 0.28861814737319946, -0.292083740234375, -0.3484487235546112, -0.23557157814502716, 0.06920891255140305, 0.5956392884254456, -0.357352077960968, -0.2065985649...
be supported, but it would probably require a new bytecode (see [John Rose's informal proposal](https://blogs.oracle.com/jrose/entry/tail_calls_in_the_vm)). There is also more discussion in [Sun bug #4726340](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4726340), where the evaluation (from 2002) ends: > I belie...
[ 0.4045494496822357, -0.1643431931734085, 0.5500923991203308, -0.007660865318030119, 0.3081215023994446, -0.364719033241272, 0.24696551263332367, -0.12730012834072113, -0.1413770467042923, -0.45591700077056885, -0.1466098427772522, 0.5525986552238464, -0.42182669043540955, -0.21945999562740...
After reading "[What’s your/a good limit for cyclomatic complexity?](http://web.archive.org/web/20090117062700/http://stackoverflow.com:80/questions/20702/whats-youra-good-limit-for-cyclomatic-complexity)", I realize many of my colleagues were quite annoyed with this new [QA](http://en.wikipedia.org/wiki/Quality_assura...
[ 0.012115337885916233, 0.2428015023469925, 0.35551443696022034, -0.018190748989582062, 0.14077851176261902, -0.08373993635177612, 0.23239070177078247, -0.09386525303125381, -0.43970173597335815, -0.2606339752674103, -0.36143168807029724, 0.8437372446060181, -0.22123271226882935, 0.209410861...
String"); ... ``` And when the first versions of our System went live, we experienced huge memory problem not because of the logging (which was at one point turned off), but because of the *log parameters* (the strings), which are always calculated, then passed to the 'info()' or 'fine()' functions, only to discover ...
[ 0.21135102212429047, -0.20593683421611786, 0.527960479259491, -0.08909633010625839, 0.2682022154331207, -0.21522840857505798, 0.27947619557380676, -0.16275730729103088, -0.4830656349658966, -0.43512600660324097, -0.05131952464580536, 0.8234272003173828, -0.5454502701759338, 0.1130373105406...
logs they put in their function is felt as a burden, because each "if(isLoggable())" is counted as +1 cyclomatic complexity! So if a function has 8 'if', 'else' and so on, in one tightly-coupled not-easily-shareable algorithm, and 3 critical log actions... they breach the limit even though the conditional logs may not...
[ 0.26459890604019165, -0.024870669469237328, -0.05303186550736427, 0.34355902671813965, 0.1841348558664322, 0.03561209887266159, 0.33899441361427307, -0.2057877480983734, -0.2579629421234131, -0.44303038716316223, -0.15209607779979706, 0.43801742792129517, -0.22392594814300537, 0.0843598097...
insist that the problem is not 'formatting' related, but 'argument evaluation' related (evaluation that can be very costly to do, just before calling a method which will do nothing) So when a wrote above "A String", I actually meant aFunction(), with aFunction() returning a String, and being a call to a complicated ...
[ 0.28582170605659485, 0.14700202643871307, 0.38301464915275574, -0.18141692876815796, -0.24775925278663635, -0.10463549196720123, 0.42568516731262207, -0.18872642517089844, -0.3313426673412323, -0.11067475378513336, -0.11208643019199371, 0.5278066992759705, -0.3237203061580658, 0.2014408856...
you (thank you John). Note: a quick test in java6 shows that my [varargs function](http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html) does evaluate its arguments before being called, so it can not be applied for function call, but for 'Log retriever object' (or 'function wrapper'), on which the toStrin...
[ -0.03999904543161392, 0.22913770377635956, 0.6000828146934509, -0.093620665371418, -0.16902971267700195, 0.047721002250909805, 0.38383740186691284, -0.1879090815782547, -0.39405038952827454, -0.1041538193821907, -0.11556132137775421, 0.7664325833320618, -0.24382570385932922, -0.35447278618...
String formatting is only applied if logging is enabled. There's still the overhead of a function call, but that's minuscule compared to formatting. ``` log.info ("a = %s, b = %s", a, b) ``` You can do something like this for any language with variadic arguments (C/C++, C#/Java, etc). --- This isn't really intende...
[ 0.23437899351119995, 0.06068545579910278, 0.4812113642692566, -0.13999097049236298, -0.3721521496772766, -0.3150671124458313, 0.12446246296167374, -0.09019280970096588, -0.3398730754852295, -0.4626666009426117, -0.06363647431135178, 0.6174910664558411, -0.49418917298316956, 0.0061297114007...
be thrown away. So you pass `mylist` as a parameter to the logging function, and let it handle string formatting. That way, formatting will only be performed if needed. --- Since the OP's question specifically mentions Java, here's how the above can be used: > I must insist that the problem is not 'formatting' relat...
[ 0.17526084184646606, 0.29212379455566406, 0.1461990922689438, 0.03973683342337608, -0.23712660372257233, -0.2506166696548462, -0.06740496307611465, -0.2591060698032379, -0.2572396695613861, -0.34628111124038696, -0.13202400505542755, 0.549050509929657, -0.39261260628700256, -0.383717834949...
closures, but is still doable in Java with a bit of imagination. Say you have a function `get_everything()`. It will retrieve every object from your database into a list. You don't want to call this if the result will be discarded, obviously. So instead of using a call to that function directly, you define an inner cl...
[ -0.16905173659324646, -0.21726252138614655, 0.32833734154701233, 0.04026878997683525, -0.02995486371219158, -0.27313023805618286, 0.12499435991048813, 0.1372746229171753, -0.5206395387649536, -0.3854832053184509, -0.28281256556510925, 0.43513280153274536, -0.6598349213600159, 0.25947782397...
return getEverything().toString(); } } private Object getEverything() { /* returns what you want to .toString() in the inner class */ } public void logEverything() { log.info(new LazyGetEverything()); } } ``` In this code, the call to `getEverything()` is wrapped so that...
[ 0.07864681631326675, -0.31821414828300476, 0.5749579668045044, -0.0978642925620079, 0.3199097812175751, -0.08720861375331879, 0.4043597877025604, -0.17085282504558563, -0.23623526096343994, -0.2754386365413666, -0.45251229405403137, 0.7789654731750488, -0.5147774815559387, -0.0652881488204...
code will suffer only the overhead of a function call instead of the full `getEverything()` call.
[ -0.011047125793993473, -0.15052732825279236, -0.012848720885813236, 0.2647913992404938, -0.19027414917945862, -0.08625925332307816, 0.6263234615325928, -0.24584081768989563, 0.2362934798002243, -0.4784277081489563, -0.5766653418540955, 0.6038346290588379, -0.33153387904167175, -0.106191240...
I have an .Net MVC application which runs fine if I use the build in Visual Studio Webserver. If I use the projects property pages to switch to IIS as the webserver and create a virtual directory for my project, any request I send to the server results in a "Directory listing denied" failure. Does anyone know a soluti...
[ 0.6089204549789429, 0.22582387924194336, 0.2571104168891907, -0.208974689245224, -0.005118923727422953, -0.17674845457077026, 0.47480282187461853, -0.07187313586473465, -0.2522186040878296, -0.6124951839447021, -0.1571623980998993, 0.7254141569137573, -0.2631176710128784, 0.047760825604200...
%s", a, b) ``` You can do something like this for any language with variadic arguments (C/C++, C#/Java, etc). --- This isn't really intended for when the arguments are difficult to retrieve, but for when formatting them to strings is expensive. For example, if your code already has a list of numbers in it, you migh...
[ 0.3700425922870636, 0.07895717024803162, 0.4322536289691925, -0.09269952028989792, -0.17569835484027863, -0.11838234961032867, 0.011693282052874565, -0.14005421102046967, -0.21046243607997894, -0.4689692556858063, -0.15304429829120636, 0.3876905143260956, -0.3432602882385254, 0.03164075687...
needed. --- Since the OP's question specifically mentions Java, here's how the above can be used: > I must insist that the problem is not 'formatting' related, but 'argument evaluation' related (evaluation that can be very costly to do, just before calling a method which will do nothing) The trick is to have object...
[ 0.027909381315112114, -0.17297889292240143, 0.180389404296875, 0.22890661656856537, -0.08704254031181335, -0.2956201732158661, 0.0797910988330841, -0.27584022283554077, -0.2772906422615051, -0.6459896564483643, -0.2968612015247345, 0.7475186586380005, -0.41096609830856323, -0.3745117783546...
You don't want to call this if the result will be discarded, obviously. So instead of using a call to that function directly, you define an inner class called `LazyGetEverything`: ``` public class MainClass { private class LazyGetEverything { @Override public String toString() { retur...
[ -0.00639770133420825, -0.38587749004364014, 0.2535843253135681, -0.01859275810420513, 0.14352881908416748, -0.19367097318172455, 0.20396961271762848, -0.004488569684326649, -0.1493510603904724, -0.3164832592010498, -0.2262299507856369, 0.7243214249610901, -0.49861523509025574, 0.1592814028...
/* returns what you want to .toString() in the inner class */ } public void logEverything() { log.info(new LazyGetEverything()); } } ``` In this code, the call to `getEverything()` is wrapped so that it won't actually be executed until it's needed. The logging function will execute `toString()` o...
[ 0.16687807440757751, -0.2775722146034241, 0.44167447090148926, -0.15008093416690826, 0.3468256890773773, -0.0705682709813118, 0.40782061219215393, -0.11473426222801208, -0.2793073058128357, -0.2805898189544678, -0.4447067975997925, 0.7232062816619873, -0.4230306148529053, 0.014578314498066...
I can't seem to figure out how to set the default database in Sql Server from code. This can be either .Net code or T-Sql (T-Sql would be nice since it would be easy to use in any language). I searched Google and could only find how to do it in Sql Server Management Studio. from: <http://doc.ddart.net/mssql/sql70/sp_da...
[ 0.25190266966819763, 0.10437311232089996, 0.4757600426673889, 0.020213549956679344, 0.041903793811798096, -0.07472609728574753, 0.24889351427555084, -0.08470851182937622, -0.21169927716255188, -0.8166703581809998, -0.04228482395410538, 0.5553863644599915, -0.1937735229730606, 0.07642553001...
According to what I have found so far, I can use the following code: ``` LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean)super.getApplicationContext().getBean("&sessionFactory"); System.out.println(sessionFactory.getConfiguration().buildSettings().getJdbcBatchSize()); ``` but then I get a ...
[ 0.18825438618659973, 0.12115265429019928, 0.5394911766052246, -0.4001830518245697, -0.03509824350476265, -0.10557691752910614, 0.610177755355835, -0.16947512328624725, -0.2755710482597351, -0.8932052850723267, -0.06387551128864288, 0.47699350118637085, -0.25844520330429077, 0.2861664295196...
I have been tasked with coming up with a compatibility guide for SharePoint 2007 comparing Office 2003 and Office 2007. Does anyone know where to find such a list? I have been searching for awhile but I cannot seem to find a comprehensive list. Thanks :) Try the following (I can't test it since I don't use Spring): ...
[ 0.13513560593128204, 0.06986992061138153, 0.2515467405319214, -0.22559188306331635, -0.1787189245223999, -0.2816886603832245, 0.4130318760871887, -0.13613951206207275, -0.10455052554607391, -0.5231679677963257, -0.0054483842104673386, 0.6995877027511597, -0.24918097257614136, 0.06519758701...
Suppose I am writing an application in C++ and C#. I want to write the low level parts in C++ and write the high level logic in C#. How can I load a .NET assembly from my C++ program and start calling methods and accessing the properties of my C# classes? ``` [Guid("123565C4-C5FA-4512-A560-1D47F9FDFA20")] public interf...
[ -0.19592152535915375, 0.008653112687170506, 0.49173837900161743, -0.01598368212580681, 0.17220339179039001, 0.14779295027256012, 0.21977241337299347, -0.2873372435569763, -0.09689149260520935, -0.7613158822059631, -0.3782884478569031, 0.5426771640777588, -0.37420564889907837, -0.1843994408...
public string Destination { get { return ""; } } public void Serialize() { } public void Unserialize() { } } ``` After that, you need to regasm your assembly. Regasm will add the necessary registry entries to allow your .NET component to be see as a COM Component. After, you ...
[ 0.039858534932136536, -0.07583153992891312, 0.5667609572410583, -0.13810211420059204, 0.18451587855815887, -0.0745805874466896, 0.12187526375055313, -0.0528767965734005, -0.27180737257003784, -0.6949787735939026, -0.3031309247016907, 0.5829859972000122, -0.3366409242153168, 0.4114105403423...
for e.g from command prompt I need to launch the exe with some switch flags under debugger. How do I do it? This is an exe from c/c++ and built using VS2005 environment that I need debug. I pass some flags to this exe to perform some stuff. You'll need to give more information about your development environment to ge...
[ 0.49468377232551575, -0.16628651320934296, 0.057377152144908905, 0.12959446012973785, 0.06706100702285767, -0.20597602427005768, 0.04299239441752434, -0.11879029870033264, 0.16264842450618744, -0.51127690076828, -0.16031938791275024, 0.7266525626182556, -0.3363650143146515, -0.015039154328...
Does anyone know of any tools capable of defining a declarative mapping from T-Box structures from one ontology to another, which when executed can effect translation of A-Box instance data from one ontology's form to another's? I have recently written such a tool to meet my needs, but I was wondering if I reinvented...
[ 0.0783337950706482, -0.0671057254076004, 0.2034989595413208, 0.2813933491706848, -0.07711993902921677, -0.24789822101593018, -0.027121463790535927, -0.01953135058283806, -0.07806776463985443, -0.6739087104797363, -0.13196121156215668, 0.29256224632263184, -0.17023397982120514, 0.2831557393...
22 read: `1();` or `();`, which is causing the complaint.
[ 0.14938297867774963, 0.5079820156097412, 0.0590834841132164, -0.430764764547348, 0.008004330098628998, 0.1464923471212387, 0.1566925197839737, -0.15370744466781616, -0.251463383436203, -0.025627819821238518, -0.33574050664901733, 0.1609484851360321, -0.38911253213882446, 0.2586852610111236...
When you want to add whitespace between HTML elements (using CSS), to which element do you attach it? I'm regularly in situations along these lines: ``` <body> <h1>This is the heading</h1> <p>This is a paragraph</p> <h1>Here's another heading</h1> <div>This is a footer</div> </body> ``` Now, say I wanted 1e...
[ -0.049618903547525406, 0.1920335441827774, 0.49915948510169983, 0.00279595865868032, -0.2098531723022461, 0.2914901375770569, -0.1734219491481781, -0.3183090090751648, -0.2041281908750534, -0.9356061816215515, -0.06426680833101273, 0.008216059766709805, -0.1058901995420456, -0.255582004785...
1. Consistency 2. Applicability to all situations 3. Ease / Simplicity 4. Ease of making changes For example: in this particular scenario, I'd say that the first solution is better than the second, as it's simpler; you're only attaching a margin-bottom to two elements in a single property definition. However, I'm look...
[ -0.04414897412061691, 0.1267874389886856, 0.09492301940917969, 0.265489786863327, 0.008748367428779602, -0.05982137843966484, 0.24927379190921783, -0.2900235950946808, -0.42322269082069397, -0.6653115153312683, 0.0631789118051529, 0.40894147753715515, -0.02662782371044159, -0.0269761215895...
before the next element, and then to use a ".last" class in the css to remove the margin from the last element. ``` <body> <h1>This is the heading</h1> <p>This is a paragraph</p> <h1>Here's another heading</h1> <div class="last">This is a footer</div> </body> ``` ```css div { margin-bottom: 1em; } p { margin...
[ -0.10444992780685425, 0.09181046485900879, 0.6892963647842407, -0.045793358236551285, -0.248480424284935, 0.07369303703308105, -0.14330413937568665, -0.28502342104911804, -0.2340908795595169, -0.9137061238288879, -0.14459535479545593, 0.1047094315290451, -0.012001948431134224, -0.013862921...
course, I cherry-picked the technique from the "Elements" CSS framework.
[ 0.3008424937725067, 0.13038986921310425, -0.4436761438846588, -0.017265034839510918, 0.04173073545098305, -0.02937069721519947, 0.05644974857568741, 0.0514841265976429, 0.1270565241575241, -0.18854013085365295, 0.11947301775217056, 0.3353606164455414, 0.061914797872304916, -0.2149896621704...
I have an application where a Hilbert R-Tree [(wikipedia)](http://en.wikipedia.org/wiki/Hilbert_R-tree) [(citeseer)](http://citeseer.comp.nus.edu.sg/84580.html) would seem to be an appropriate data structure. Specifically, it requires reasonably fast spatial queries over a data set that will experience a lot of updates...
[ 0.007911778055131435, 0.08133407682180405, 0.2622266709804535, 0.1682611107826233, -0.029627924785017967, -0.10205376893281937, -0.06213725358247757, -0.015227103605866432, -0.2726162075996399, -0.6529356241226196, -0.07205092906951904, 0.20563706755638123, 0.10532373189926147, 0.155089735...
Hilbert Value. The potentially bad news is, it's in Haskell... <http://www.serpentine.com/blog/2007/01/11/two-dimensional-spatial-hashing-with-space-filling-curves/> It also proposes a Lebesgue distance metric you might be able to compute more easily.
[ -0.5072743892669678, -0.5344383120536804, 0.05591001361608505, 0.18284709751605988, -0.20677106082439423, -0.17977400124073029, -0.10370821505784988, 0.0217647235840559, 0.03981924429535866, -0.5706254243850708, 0.11700413376092911, 0.21436935663223267, -0.06971767544746399, 0.197967559099...
Anyone have a good set of sqlplus configuration directives to help transform a given sql query into nicely tab separated output for pulling into a spreadsheet or further processing? Check out the Oracle documentation: * [Formatting SQLPlus Reports](http://68.142.116.68/docs/cd/B19306_01/server.102/b14357/ch6.htm#i1081...
[ 0.1308629810810089, 0.13903853297233582, 0.22986657917499542, 0.2896387279033661, -0.01243550330400467, 0.005889897234737873, 0.06431043893098831, 0.069147989153862, -0.13434600830078125, -0.5055896639823914, 0.04051825776696205, 0.4973742365837097, -0.0732513964176178, -0.1592717617750167...
What is the best way to secure the use/loading of a DLL with a license file? A couple of things you might want to consider: Check sum the DLL. Using a [cryptographic hash function](http://en.wikipedia.org/wiki/Cryptographic_hash_function), you can store this inside the license file or inside the DLL. This provides a v...
[ 0.47979840636253357, -0.1443483531475067, 0.14853954315185547, 0.2152353972196579, -0.004705541301518679, -0.5462853908538818, -0.06179768592119217, -0.30599334836006165, -0.23682650923728943, -0.395828515291214, 1.755660861135766e-7, 0.6693134903907776, -0.14227306842803955, 0.15496934950...
shorts in different places. As Larry said, a MAC address is fairly common. There are lots of examples of how to get that on [The Code Project](http://en.wikipedia.org/wiki/The_Code_Project), but be aware it's easy to fake these days. My suggestion, should be use [private/public](http://en.wikipedia.org/wiki/Public-ke...
[ 0.8819504380226135, -0.13669654726982117, -0.19017404317855835, 0.2737778127193451, 0.07537806779146194, -0.2024402916431427, -0.0242125503718853, 0.167717844247818, -0.035856228321790695, -0.6063342094421387, -0.28973662853240967, 0.5887220501899719, -0.089413121342659, -0.139250546693801...
I have a stateless bean something like: ``` @Stateless public class MyStatelessBean implements MyStatelessLocal, MyStatelessRemote { @PersistenceContext(unitName="myPC") private EntityManager mgr; @TransationAttribute(TransactionAttributeType.SUPPORTED) public void processObjects(List<Object> objs) { ...
[ 0.1782153993844986, 0.13973656296730042, 0.4784724712371826, -0.20415450632572174, 0.18522587418556213, -0.038104794919490814, 0.32493165135383606, 0.272233784198761, -0.1696992814540863, -0.8371771574020386, -0.26928362250328064, 0.39288023114204407, -0.7854858636856079, 0.584928512573242...
obj) { // do some work with obj that must be in the scope of a transaction this.mgr.merge(obj); // ... this.mgr.merge(obj); // ... this.mgr.flush(); } } ``` The typically usage then is the client would call processObjects(...), which doesn't actually interact with ...
[ -0.30479151010513306, 0.12163718044757843, 0.5761836767196655, -0.4019424617290497, -0.02512025460600853, 0.2579945921897888, 0.07295513898134232, -0.2885628938674927, -0.6600645780563354, -0.47449254989624023, -0.2636597156524658, 0.356927752494812, -0.7390225529670715, 0.3544164896011352...
object to process. The duration of process(...) is relatively short, but processObjects(...) could take a very long time to run through everything. Therefore I don't want it to maintain an open transaction. I *do* need the individual process(...) operations to operate within their own transaction. This should be a new ...
[ -0.09893863648176193, 0.024085210636258125, 0.10236860811710358, 0.017367135733366013, -0.19770005345344543, 0.14814575016498566, 0.38638320565223694, -0.04954156279563904, -0.4429911673069, -0.5339735150337219, 0.10056038945913315, 0.5529043674468994, -0.35520538687705994, 0.4694039821624...
make it work by splitting up the methods into two different beans: ``` @Stateless @TransationAttribute(TransactionAttributeType.NOT_SUPPORTED) public class MyStatelessBean1 implements MyStatelessLocal1, MyStatelessRemote1 { @EJB private MyStatelessBean2 myBean2; public void processObjects(List<Object> obj...
[ 0.3560510575771332, -0.21826539933681488, 0.4137316048145294, -0.1719251573085785, 0.5714283585548401, 0.1065121442079544, 0.36098185181617737, -0.03322388231754303, -0.022019607946276665, -0.4338305592536926, -0.22116591036319733, 0.5156100392341614, -0.7104215025901794, 0.405823528766632...
@PersistenceContext(unitName="myPC") private EntityManager mgr; @TransationAttribute(TransactionAttributeType.REQUIRES_NEW) public void process(Object obj) { // do some work with obj that must be in the scope of a transaction this.mgr.merge(obj); // ... this.mgr.merge(obj);...
[ 0.005017482675611973, 0.03994743898510933, 0.5245780348777771, -0.16048409044742584, 0.21611934900283813, -0.17765681445598602, 0.5636983513832092, 0.07596908509731293, -0.4209037125110626, -0.614333987236023, 0.009428662247955799, 0.7223939895629883, -0.5637245774269104, 0.457598328590393...
looks to me like the transaction manager only operates at the bean level, even when individual methods are given more specific annotations. So if I mark one method in a way to prevent the transaction from starting calling other methods within that same instance will also not create a transaction, no matter how they're ...
[ 0.036771927028894424, 0.2829764187335968, 0.28161191940307617, -0.10041676461696625, -0.21086078882217407, -0.2737894356250763, 0.13680046796798706, -0.010954368859529495, -0.5259085297584534, -0.5938947200775146, 0.09779758751392365, 0.33684319257736206, -0.3729074001312256, 0.13745969533...
MyStatelessLocal1 @Stateless @TransationAttribute(TransactionAttributeType.NOT_SUPPORTED) public class MyStatelessBean1 implements MyStatelessLocal1, MyStatelessRemote1 { @EJB private MyStatelessLocal1 myBean2; public void processObjects(List<Object> objs) { // this method just processes the data; ...
[ -0.13203909993171692, -0.0764501541852951, 0.7299560308456421, -0.007618354167789221, 0.32982879877090454, 0.1321735680103302, 0.37688469886779785, 0.15171261131763458, -0.0426047183573246, -0.7001067399978638, -0.2269114851951599, 0.40967217087745667, -0.6590194702148438, 0.56975376605987...
do some work with obj that must be in the scope of a transaction this.mgr.merge(obj); // ... this.mgr.merge(obj); // ... this.mgr.flush(); } } ``` This way you actually 'force' the `process()` method to be accessed via the ejb stack of proxies, therefore taking the `@Trans...
[ -0.01611824333667755, -0.08826719224452972, 0.37927407026290894, -0.11994607001543045, 0.09601548314094543, -0.1441100686788559, 0.3386586308479309, -0.345787912607193, -0.2447281777858734, -0.5674681067466736, -0.22558267414569855, 0.5517235398292542, -0.5540539026260376, 0.03945596888661...
I'm working on some production software, using C# on the .NET framework. I really would like to be able to use LINQ on the project. I believe it requires .NET version 3.5 (correct me if I'm wrong). This application is a commercial software app, required to run on a client's work PC. Is it reasonable to assume they have...
[ 0.772232711315155, 0.28575068712234497, 0.28611767292022705, -0.026050539687275887, 0.2966156303882599, -0.3166505992412567, 0.06904485076665878, -0.0015486690681427717, -0.09511285275220871, -0.5345993638038635, 0.07486460357904434, 0.7231644988059998, 0.00035192258656024933, -0.110145285...
.NET 3.5. Just to confirm this, the Wikipedia page for LINQ says: > Language Integrated Query (LINQ, > pronounced "link") is a Microsoft .NET > Framework component that adds native > data querying capabilities to .NET > languages using a syntax reminiscent > of SQL. Many of the concepts that LINQ > has introduce...
[ 0.02780868671834469, 0.15099193155765533, 0.8666270971298218, -0.048494305461645126, -0.3165181577205658, -0.5704163312911987, 0.20748955011367798, 0.013262246735394001, 0.058507952839136124, -0.43196073174476624, -0.19223272800445557, 0.46952396631240845, -0.727716326713562, -0.1694395393...
[Smallest Dot NET](http://www.hanselman.com/smallestdotnet/) by Scott Hanselman (Microsoft employee) is useful. It works out the smallest updates you need to get up to date (currently 3.5 SP1). As for whether it is reasonable to expect it on the client's machine, I guess it depends upon what you're creating. My feelin...
[ 0.18604059517383575, -0.1669599413871765, 0.6906929016113281, 0.13929736614227295, 0.2265520840883255, 0.05952619016170502, 0.16098223626613617, 0.08603820949792862, -0.3004666566848755, -0.8041688799858093, 0.21591880917549133, 0.2339693307876587, -0.16056746244430542, -0.0779423788189888...
(your baseline specifications are already WInXP or newer running on .NET 2.0), I don't think the customer would care. Put the redistributable on the installer disk! Remember that adopting any new technology should be done for a number of reasons. What is your need to use LINQ, is it something that would be tough to r...
[ 0.4455023407936096, 0.1472165435552597, 0.34881460666656494, 0.3245381712913513, 0.3535888195037842, -0.4784792959690094, -0.013291088864207268, -0.21645143628120422, -0.29865169525146484, -0.5423839688301086, -0.20121769607067108, 0.6123595833778381, -0.10403656214475632, -0.0243250280618...
all you need is Linq to Objects (eg. you don't need Linq to SQL or Linq to XML) then [LinqBridge](http://www.albahari.com/nutshell/linqbridge.aspx) may be an option.
[ 0.23136010766029358, -0.17254190146923065, 0.4486245810985565, 0.17941337823867798, -0.04871130362153053, -0.281853049993515, -0.32258325815200806, -0.0041148969903588295, -0.2560685873031616, -0.47213947772979736, -0.1581019163131714, 0.35428106784820557, -0.30078229308128357, -0.09406222...
If you have a table with a compound primary key that is composed of a foreign key and other table columns, how do you get ASP.NET Dynamic Data to allow the non-foreign primary key table columns to be editable? LINQ to SQL does not support changing the primary key of an entity even without using Dynamic Data.
[ 0.03307124227285385, -0.16483581066131592, 0.4340713620185852, 0.3498854637145996, 0.09021568298339844, -0.24675258994102478, -0.06299623847007751, -0.14884518086910248, -0.499481737613678, -0.10777492821216583, -0.039696063846349716, 0.4588518440723419, -0.36348146200180054, -0.0418524704...
I would prefer that a console app would default to multithreaded debug. warning level 4. build browse information. no resource folder. Does anyone know of any technique that would allow me to create a console app, with my desired options, without manually setting it. Yes, you can do that. What you want is to create ...
[ 0.08607401698827744, 0.05524538457393646, 0.3402877449989319, 0.039299141615629196, -0.1263059824705124, -0.13752378523349762, 0.254833459854126, -0.14337991178035736, -0.09314139187335968, -0.49447059631347656, -0.08537083119153976, 0.8818749785423279, -0.1851310431957245, -0.019256684929...
sufficiently similar.
[ 0.1309291273355484, 0.20671984553337097, 0.20242489874362946, 0.06392624229192734, -0.003526357701048255, 0.13790732622146606, 0.08968154340982437, -0.21361656486988068, 0.11924543976783752, -0.5486246943473816, 0.14433081448078156, 0.28208550810813904, -0.1829300820827484, 0.0681253671646...
I have a button that I would like to disable when the form submits to prevent the user submitting multiple times. I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled. How do I disable the button when the form successfully submit...
[ 0.21997718513011932, -0.0012718717334792018, 0.3673626184463501, 0.041228197515010834, -0.11952441185712814, -0.2767924666404724, 0.33566632866859436, -0.1413610875606537, -0.12935443222522736, -0.8863378763198853, -0.05899561569094658, 0.5410657525062561, -0.42095619440078735, 0.175766900...
Page_Load(object sender, EventArgs e) { // Identify button as a "disabled-when-clicked" button... WebHelpers.DisableButtonOnClick( buttonTest, "showPleaseWait" ); } protected void buttonTest_Click( object sender, EventArgs e ) { // Emulate a server-side process to demo the d...
[ -0.032519496977329254, -0.005019089672714472, 0.45384618639945984, -0.17986467480659485, 0.13440071046352386, 0.11357799917459488, 0.4685964584350586, -0.08317451924085617, -0.3649992048740387, -1.031848430633545, -0.5259546041488647, 0.5303382277488708, -0.6493095755577087, 0.376195728778...
class WebHelpers { // // Disable button with no secondary JavaScript function call. // public static void DisableButtonOnClick( Button ButtonControl ) { DisableButtonOnClick( ButtonControl, string.Empty ); } // // Disable button with a JavaScript function call. // pu...
[ 0.19622647762298584, -0.39347410202026367, -0.0451958030462265, 0.06804726272821426, 0.04701656848192215, 0.24232161045074463, 0.4078206717967987, 0.040103521198034286, -0.22575795650482178, -0.5880028605461121, -0.2713220715522766, 0.5276351571083069, -0.8665193319320679, 0.01189699489623...
StringBuilder sb = new StringBuilder( 128 ); // If the page has ASP.NET validators on it, this code ensures the // page validates before continuing. sb.Append( "if ( typeof( Page_ClientValidate ) == 'function' ) { " ); sb.Append( "if ( ! Page_ClientValidate() ) { return false; } } " ); ...
[ -0.14994412660598755, -0.2293599247932434, 0.8696129322052002, -0.37774544954299927, -0.054973963648080826, 0.11922047287225723, 0.7792559862136841, -0.7328883409500122, -0.30370354652404785, -0.7735234498977661, -0.3634142577648163, 0.2032233029603958, -0.5671118497848511, 0.1532876938581...
); // If a secondary JavaScript function has been provided, and if it can be found, // call it. Note the name of the JavaScript function to call should be passed without // parens. if ( ! String.IsNullOrEmpty( ClientFunction ) ) { sb.AppendFormat( "if ( typeof( {0}...
[ 0.0892430767416954, -0.164536252617836, 0.5594320893287659, -0.5839283466339111, 0.24847780168056488, 0.04371850565075874, 0.6142316460609436, -0.41990360617637634, -0.060206908732652664, -0.40033087134361267, -0.2882600724697113, 0.4257243573665619, -0.6052594780921936, 0.1085601523518562...
{0}() }};", ClientFunction ); } // GetPostBackEventReference() obtains a reference to a client-side script function // that causes the server to post back to the page (ie this causes the server-side part // of the "click" to be performed). sb.Append( ButtonControl.Page.Clien...
[ -0.163351371884346, -0.09694300591945648, 0.4462411105632782, -0.4226311147212982, -0.024477962404489517, -0.13180962204933167, 0.6658530831336975, -0.341237872838974, -0.08463902026414871, -0.689660906791687, -0.39622199535369873, 0.14520852267742157, -0.6061345338821411, 0.04175917431712...
be executed when the button is clicked. ButtonControl.Attributes.Add( "onclick", sb.ToString() ); } } ```
[ 0.11583872884511948, -0.1622980684041977, 0.2849673330783844, -0.38786938786506653, 0.32629579305648804, -0.20801463723182678, 0.5488969087600708, -0.23701520264148712, -0.08098763227462769, -0.562432587146759, -0.5758970379829407, 0.5770858526229858, -0.38438838720321655, -0.0701893642544...
I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the openssh package). Any advice on how to fix/workaround it? ``` bash...
[ 0.0295517947524786, 0.3636528551578522, 0.4775218069553375, -0.20842903852462769, 0.07424929738044739, -0.21179798245429993, 0.7248826622962952, -0.13066928088665009, -0.23302580416202545, -0.6965441703796387, -0.1787838637828827, 0.7715283036231995, -0.3824833035469055, 0.2107546925544738...
but I've found [Delta Copy](http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp) to be a much better option than messing around with Cygwin. It connects to regular rsync daemons too.
[ 0.4741213023662567, -0.29776597023010254, 0.1637910157442093, 0.34879517555236816, 0.11138653010129929, -0.3982665538787842, 0.10298573970794678, 0.3732761740684509, -0.3043086528778076, -0.6903814077377319, 0.01999884657561779, 0.2202833741903305, -0.34937089681625366, 0.20857438445091248...
And why don't they change it? Edit: The reason ask is because I'm new to emacs and I would like to use Emacs as a "programmer calculator". So, I can manipulate 32-bit & 64-bit integers and have them behave as they would on the native machine. Emacs-Lisp is a dynamically-typed language. This means that you need type ta...
[ 0.0023314079735428095, 0.13381031155586243, 0.33213645219802856, 0.11145555227994919, 0.04425822198390961, -0.03361174464225769, -0.0711231529712677, -0.01865135319530964, -0.26455429196357727, -0.4547363221645355, 0.01901603862643242, 0.5399054288864136, -0.7099747061729431, -0.2184066474...
runtime without some kind of tagging scheme. For efficiency reasons, most Lisp implementations do therefore not use raw pointers but what I think is called descriptors. These descriptors are usually a single machine word that may represent a pointer, an unboxed number (a so-called *fixnum*), or one of various other ha...
[ 0.09171944111585617, -0.13924652338027954, 0.32253825664520264, 0.05020387843251228, 0.07202109694480896, -0.15997432172298431, 0.5925430059432983, 0.05308261513710022, -0.18324153125286102, -0.6188362836837769, -0.2683642506599426, 0.41101107001304626, -0.6079109907150269, -0.269742935895...
other number of bits that you didn't use up for tagging. Some implementations of various dynamic languages reserve multiple tags for fixnums so that they can give you 30-bit or even 31-bit fixnums. SBCL is one implementation of Common Lisp that [does this](http://sbcl-internals.cliki.net/tag%20bit). I don't think the ...
[ 0.2211739718914032, -0.03310822322964668, 0.13397449254989624, 0.27123528718948364, -0.07210081815719604, -0.2661936581134796, 0.1308063566684723, 0.17605581879615784, -0.45105940103530884, -0.45276910066604614, 0.1715516895055771, 0.6616588830947876, -0.6284536719322205, -0.45333060622215...
Better switch to Common Lisp, then! ;)
[ -0.13419120013713837, -0.030678685754537582, 0.4276088774204254, -0.11333070695400238, 0.17819470167160034, -0.32083988189697266, 0.3711114227771759, 0.15395402908325195, -0.28830739855766296, -0.8031291961669922, -0.31350064277648926, 0.6893940567970276, -0.369443416595459, -0.53306418657...
I would like to serialize and deserialize objects without having to worry about the entire class graph. Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph. > That means that Binary Serialization > is not an option as ...
[ 0.13644395768642426, -0.011611332185566425, -0.06680412590503693, 0.2331237941980362, -0.19780683517456055, -0.12438704073429108, 0.38536337018013, 0.22545471787452698, -0.1933421939611435, -0.9718608260154724, -0.13464432954788208, 0.5036453008651733, -0.2372816503047943, 0.18830153346061...
around Serialization of Lists/Dictionaries (i.e. [XML Serializable Generic Dictionary](http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx)). * "Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types...
[ 0.19832828640937805, -0.01251845620572567, 0.4000537097454071, 0.290241003036499, -0.1979861706495285, -0.11616034805774689, 0.039422232657670975, -0.02978450618684292, -0.4502886235713959, -0.38359829783439636, 0.1923825740814209, 0.25489774346351624, -0.3953304886817932, 0.09617494791746...
to override how a type is serialized by creating a JsonConverter for it. In my opinion JSON is more human readable than XML and Json.NET gives the option to write nicely formatted JSON. Finally the project is open source so you can step into the code and make modifications if you need to.
[ 0.5501988530158997, -0.011607653461396694, -0.10103924572467804, 0.1455293893814087, -0.563278317451477, -0.4181453585624695, 0.04883924126625061, 0.20715895295143127, -0.07147082686424255, -0.6534942984580994, 0.019147196784615517, 0.3944113552570343, -0.2110503911972046, -0.0095825353637...
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop. I've read about unit t...
[ 0.5202136039733887, 0.3851783871650696, -0.17444153130054474, 0.17789232730865479, -0.05904727429151535, -0.012479756027460098, 0.2656755745410919, 0.05598001927137375, -0.24583092331886292, -0.583511471748352, -0.04933488368988037, 0.7483701705932617, 0.14177869260311127, -0.1973688006401...
program PRINTS the right thing, you just need to verify that the functions are returning the right output to a given input. In my case, however, we need to test that the program is modifying its environment correctly. Here's what I've come up with: 1) Create the "original" file in a standard location, perhaps /tmp. ...
[ 0.556739866733551, -0.013370190747082233, 0.29336386919021606, 0.2796556353569031, 0.2598285675048828, 0.0007035888265818357, 0.036311160773038864, -0.33600836992263794, -0.19922006130218506, -0.5626221299171448, -0.01840299926698208, 0.7918450832366943, -0.10968436300754547, -0.2390737533...
are created properly, etc.) Has anyone come up with a better way? You're talking about testing too much at once. If you start trying to attack a testing problem by saying "Let's verify that it modifies its environment correctly", you're doomed to failure. Environments have dozens, maybe even millions of potential varia...
[ 0.8297406435012817, 0.1811637580394745, -0.00034883676562458277, 0.6815277338027954, 0.22022272646427155, 0.04004170745611191, 0.48654705286026, -0.3552931845188141, -0.161686971783638, -0.6133654713630676, -0.11833217740058899, 0.49948859214782715, -0.24141326546669006, 0.0638297274708747...
function, and don't actually do anything that modifies the filesystem. Don't pass it "realistic" values, pass it values that are easy to verify against. Make a temporary directory, populate it with files in your test's `setUp` method. Then test the code that writes the files. Just make sure it's writing the right cont...
[ 0.4226330518722534, -0.0176636204123497, 0.1634873002767563, 0.1733589768409729, 0.05942540243268013, -0.4176494777202606, 0.5928972959518433, 0.04973110184073448, -0.11130296438932419, -0.2648555636405945, -0.18051734566688538, 0.7922693490982056, -0.4001207649707794, -0.2807646691799164,...
will have to test the final, everything-is-actually-hooked-up-for-real top-level function that passes the real environment variable and the real config file and puts everything together. But don't worry about that to get started. For one thing, you will start picking up tricks as you write individual tests for smaller ...
[ 0.7299443483352661, -0.08696069568395615, 0.040758222341537476, 0.5081590414047241, 0.08529871702194214, -0.35561081767082214, 0.32766273617744446, -0.13781259953975677, -0.021257197484374046, -0.3000413775444031, -0.02954994887113571, 0.6730002760887146, -0.15368050336837769, -0.185789033...
development forces you to make your APIs clearer and more flexible. For example: it's much easier to test something that calls an `open()` method on an object that came from somewhere abstract, than to test something that calls `os.open` on a string that you pass it. The `open` method is flexible; it can be faked, it c...
[ 0.600192129611969, -0.15522490441799164, -0.07521791756153107, 0.2965555191040039, -0.14805477857589722, -0.16698874533176422, 0.14711199700832367, -0.1430283784866333, -0.31450119614601135, -0.6982366442680359, 0.05674594268202782, 0.42538556456565857, -0.27767738699913025, 0.315620124340...
for testing [built right into its testing tool](http://twistedmatrix.com/documents/8.1.0/api/twisted.trial.unittest.TestCase.html#mktemp). It's not uncommon for testing tools or larger projects with their own test libraries to have functionality like this.
[ 0.5764598846435547, -0.5143642425537109, 0.3738005459308624, 0.20602726936340332, -0.08319040387868881, -0.11988990008831024, 0.14615823328495026, -0.36405670642852783, -0.272132009267807, -0.4133645296096802, 0.20532721281051636, 0.13248251378536224, -0.07971567660570145, 0.21733036637306...
Intel's [Threading Building Blocks (TBB)](http://www.threadingbuildingblocks.org/) open source library looks really interesting. Even though there's even an [O'Reilly Book](http://oreilly.com/catalog/9780596514808/) about the subject I don't hear about a lot of people using it. I'm interested in using it for some multi...
[ 0.4793356955051422, -0.0222148634493351, -0.43697589635849, 0.2638098895549774, -0.32371121644973755, -0.14514188468456268, -0.14735713601112366, 0.2918568253517151, -0.19913873076438904, -0.49985378980636597, 0.1003575399518013, 0.3439600467681885, -0.1906522959470749, 0.15956087410449982...
into? I've introduced it into our code base because we needed a bettor malloc to use when we moved to a 16 core machine. With 8 and under it wasn't a significant issue. It has worked well for us. We plan on using the fine grained concurrent containers next. Ideally we can make use of the real meat of the product, but t...
[ 0.8670865297317505, -0.14980074763298035, -0.14797788858413696, -0.034995533525943756, -0.08833783864974976, 0.149613156914711, 0.110622838139534, 0.06493277847766876, 0.005380233749747276, -0.6861296892166138, 0.16399452090263367, 0.309675395488739, -0.27076685428619385, 0.218988925218582...
that really sits on top of threads and abstracts the threads away. You learn to think in task, parallel\_for type operations and pipelines. If I were to build a new project I would probably try to model it in this fashion. We work in Visual Studio and it works just fine. It was originally written for linux/pthreads s...
[ 0.32379233837127686, -0.16470623016357422, 0.12333573400974274, 0.1738077849149704, -0.007407500874251127, -0.09775001555681229, -0.2494271844625473, 0.34172341227531433, -0.21918007731437683, -0.9154331684112549, 0.35815635323524475, 0.7762708067893982, -0.12346446514129639, 0.17238293588...
We put all of our unit tests in their own projects. We find that we have to make certain classes public instead of internal just for the unit tests. Is there anyway to avoid having to do this. What are the memory implication by making classes public instead of sealed? If you're using .NET, the [InternalsVisibleTo](http...
[ 0.04197395220398903, 0.027494601905345917, -0.26806724071502686, 0.40260934829711914, 0.17909061908721924, -0.18567802011966705, 0.46324390172958374, 0.10353557765483856, -0.2406032830476761, -0.540796160697937, -0.260067880153656, 0.13977846503257751, -0.03130854666233063, 0.2458193004131...
is for unit testing projects. It's probably not a good choice for use in your actual application assemblies, for the reason stated above. **Example:** ``` [assembly: InternalsVisibleTo("NameAssemblyYouWantToPermitAccess")] namespace NameOfYourNameSpace { ```
[ 0.18829676508903503, 0.0002694140130188316, -0.06339365243911743, -0.015370715409517288, 0.376615047454834, -0.10948310047388077, 0.21307621896266937, -0.21193021535873413, 0.0653618574142456, -0.43655794858932495, -0.1284097284078598, 0.3803349733352661, -0.06667699664831161, 0.2781921327...
I'm a pretty new C# and .NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++. I pretty much went through the whole project at some point and ma...
[ 0.5087653994560242, 0.3021511137485504, -0.060088157653808594, -0.18020276725292206, -0.2161508947610855, -0.10696312040090561, 0.025607215240597725, 0.3698956370353699, -0.3884217143058777, -0.4247848093509674, -0.12416202574968338, 0.7817829847335815, -0.08956968784332275, -0.03452665731...
blackboxes where possible. As a programmer, I want a well defined blackbox which I can easily drop into my systems, and have it work. I give it values, call the appropriate methods, and then get my results back out of it. To that end, give me only the functionality that the class needs to expose to work. Consider an...
[ 0.19826017320156097, -0.15677252411842346, 0.19873222708702087, 0.24621640145778656, 0.2945176362991333, 0.1425914764404297, 0.014703611843287945, -0.0007536672637797892, -0.2942711412906647, -0.7999685406684875, -0.2390635758638382, 0.26076698303222656, -0.5049479603767395, -0.06161363422...