text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
to use to the activate and deactivate events can be seen at [blog.flexaxamples.com](http://blog.flexexamples.com/2008/02/29/determining-if-a-flex-application-has-focus-using-the-activate-and-deactivate-events/). Also, it looks like the activate and deactivate events have trouble in some browsers. [Colin Moock has mor...
[ 0.18678563833236694, -0.23790507018566132, 0.2044595181941986, -0.14508360624313354, 0.13592366874217987, -0.17403213679790497, 0.248107448220253, -0.4417140781879425, -0.6276674866676331, -0.5704702734947205, -0.4800666570663452, 0.6921901106834412, -0.36527758836746216, -0.42362985014915...
Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first given a list of keyword, and must then answer if another given word was in the list. In an imperative language, I would store the keywords in a tree (one node per character). Then, when receiving a word to test, I would ...
[ -0.12491778284311295, 0.14261744916439056, -0.18123024702072144, -0.10819325596094131, -0.11495576798915863, 0.4110874831676483, 0.3080064356327057, -0.14584089815616608, -0.03619638457894325, -0.6646075248718262, -0.34743747115135193, 0.2593441605567932, -0.3844858705997467, -0.1388013362...
to store the tree somewhere between the lookups if you don't want to rebuild it each time? I think what you mean is a character per node... sort of like a simple hash tree scheme for keyword lookup. Assuming this or even another kind of tree... imagine doing something like this (in pseudo-LISP): ``` (defun buildtree (...
[ -0.2407926619052887, 0.011254804208874702, 0.010411268100142479, -0.1874953806400299, 0.12253326922655106, 0.11335239559412003, 0.49211880564689636, -0.17055118083953857, -0.08202075213193893, -0.6688346266746521, -0.3103790581226349, 0.6034722328186035, -0.43373215198516846, -0.1290337294...
tree (car querylist)) (lookupmany tree (cdr querylist)) ) ) (defun main (wordlist querylist) ; the main entry point (lookupmany (buildtree wordlist) querylist) ) ``` if this is what you mean, this is fairly straight-forward functional programming. Is it really stateless? That's a matter of debate. Some people ...
[ -0.17180690169334412, 0.27150794863700867, 0.08244303613901138, -0.1825651079416275, -0.15098124742507935, 0.04131143540143967, 0.1772712916135788, 0.04054335132241249, -0.15344886481761932, -0.4947981834411621, -0.3220455050468445, 0.604520857334137, -0.45780226588249207, 0.08991711586713...
the idea shown here. I think the above is something like the arrangement you mean.
[ 0.5263300538063049, -0.004013779107481241, 0.1555771380662918, -0.052910320460796356, 0.1500675231218338, -0.03995884582400322, -0.11600977927446365, -0.011450987309217453, -0.41638681292533875, -0.4128080904483795, 0.233064666390419, 0.43563851714134216, -0.05232904478907585, 0.2411109954...
I have a project where a .master page was created without a code behind page. Now I want to add a code behind page for this .master page and move the "in page" code to the code behind file. What is the best/easiest way to go about doing this? I'm using Visual Studio 2008. Create new class file, name it yourmaster.maste...
[ 0.4870726764202118, 0.01968516781926155, 0.1902623176574707, 0.07068163901567459, -0.37046387791633606, -0.034810200333595276, 0.191471129655838, -0.016754744574427605, -0.3373101055622101, -1.1642059087753296, 0.20360590517520905, 0.2214382439851761, -0.17453837394714355, 0.31830224394798...
I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ODBC.NET allows for easy integration of these two components. Has anyone had experience actually setting C# and PostgreSQ...
[ 0.5016706585884094, 0.23921091854572296, -0.23855754733085632, 0.05179614946246147, -0.12847431004047394, -0.3602900207042694, 0.0629412978887558, 0.5197743773460388, -0.13566069304943085, -0.8029364943504333, -0.17960555851459503, 0.5970733165740967, -0.13126377761363983, 0.02564631961286...
with any database you can use the **DbProviderFactory** class and make your queries using **IDbConnection**, **IDbCommand**, **IDataReader** and/or **IDbTransaction** interfaces.
[ 0.2914832830429077, 0.09074622392654419, -0.022471752017736435, 0.32957494258880615, -0.19498418271541595, -0.10642816871404648, 0.07500459253787994, 0.08425135910511017, 0.22354504466056824, -1.002192497253418, 0.1681073158979416, 0.3729194104671478, -0.31474530696868896, 0.22494550049304...
Does anyone have any tips or gotcha moments to look out for when trying to migrate MySQL tables from the the default case-insenstive swedish or ascii charsets to utf-8? Some of the projects that I'm involved in are striving for better internationalization and the database is going to be a significant part of this chang...
[ 0.4032336473464966, 0.24637995660305023, 0.1927194595336914, 0.028149468824267387, -0.22601868212223053, 0.04756304249167442, 0.4768998622894287, 0.4319668114185333, -0.3618839383125305, -0.7655627131462097, -0.11380093544721603, 0.3276429772377014, -0.14191360771656036, -0.003317038295790...
up to 3 times more disk space. (You probably won't get much disk space grow for Swedish words.) * Use `SET NAMES utf8` before reading or writing to the database. If you don't this then you will get partially garbled characters.
[ 0.37259039282798767, 0.17857666313648224, 0.2149694412946701, 0.1927613914012909, -0.21089103817939758, -0.07808668911457062, 0.7384730577468872, 0.31625238060951233, -0.19844156503677368, -0.8133577704429626, -0.2692347466945648, 0.11331591755151749, 0.0449926033616066, 0.0685873478651046...
A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system. I recommend the opposite for automatic build systems: you should first g...
[ 0.13706420361995697, 0.1723760962486267, 0.9818271398544312, -0.03717326372861862, -0.014349912293255329, 0.19191120564937592, -0.09122812002897263, -0.302533894777298, -0.41194045543670654, -0.5873744487762451, -0.047718506306409836, 0.47130948305130005, 0.05245385691523552, 0.05131912231...
few gotchas: * This only works if you have not submitted anything from the workspace in question. * It is also possible that a client workspace is not synced to any specific changelist. and there's an additional gotcha they don't mention: * If the highest changelist to which the sync occured strictly deleted files f...
[ 0.22985200583934784, 0.04483228921890259, 0.38057443499565125, 0.07175076752901077, -0.1295316070318222, 0.006798590067774057, 0.4957594573497772, 0.10369298607110977, -0.42449069023132324, -0.6486579775810242, 0.007412300445139408, 0.44945064187049866, -0.3022674024105072, 0.1142718493938...
I originally asked [this question](https://stackoverflow.com/questions/46933/why-doesnt-inheritance-work-the-way-i-think-it-should-work), but in finding an answer, discovered that my original problem was a lack of support in C# for covariance on inherited methods' return types. After discovering that, I became curious ...
[ 0.12887051701545715, -0.08645882457494736, -0.051376037299633026, -0.06643657386302948, -0.28339123725891113, -0.18098825216293335, 0.3041174113750458, -0.4144119620323181, -0.15322071313858032, -0.14677047729492188, -0.25624117255210876, 0.5521203875541687, -0.6610459089279175, -0.2236052...
Here are a few possibilities to get the conversation started: 1. Escape all input upon initialization. 2. Escape each value, preferably when generating the SQL. The first solution is suboptimal, because you then need to unescape each value if you want to use it in anything other than SQL, like outputting it on a web ...
[ -0.44273853302001953, -0.006718900986015797, 0.12047670036554337, 0.1538064181804657, -0.22552867233753204, 0.07026686519384384, 0.23826900124549866, -0.4587397575378418, -0.026056502014398575, -0.42822256684303284, -0.3169357478618622, 0.3741407096385956, -0.5547651648521423, 0.0781494900...
and thus write the wrong data to the wrong fields. as @Rob Walker states, parameterized queries are your best bet. If you're using the latest and greatest PHP, I'd highly recommend taking a look at [PDO](http://us3.php.net/pdo) (PHP Data Objects). This is a native database abstraction library that has support for a wid...
[ 0.25151264667510986, -0.01983775943517685, -0.10788358002901077, 0.21187110245227814, -0.16575577855110168, -0.023744871839880943, 0.23280839622020721, -0.12845109403133392, -0.15380582213401794, -0.4906401038169861, 0.09663961082696915, 0.532569408416748, -0.2992391586303711, -0.081667758...
In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments, i...
[ 0.2929912507534027, 0.18025976419448853, 0.04745372757315636, -0.10743973404169083, 0.32639646530151367, -0.0472700409591198, 0.43652814626693726, 0.11638495326042175, -0.11682142317295074, -0.43629297614097595, -0.15509940683841705, 0.5547448396682739, -0.26083502173423767, 0.083200223743...
fear TAE. Locks don't provide a solution for this, and, although finally blocks do, I don't find it elegant to wrap important code in the following manner: ``` try { } finally { // vital code } ``` However, I didn't find any other solution. Is this another way to delay the interference of `ThreadAbortException` u...
[ 0.47493550181388855, 0.06694190949201584, 0.13979661464691162, 0.07945553213357925, -0.07900094985961914, -0.2792591154575348, 0.5939109921455383, -0.2976427972316742, -0.29040735960006714, -0.48678311705589294, 0.1477317065000534, 0.16949933767318726, -0.3530581593513489, 0.14808703958988...
then test the flag regularly while it is working. If it is set you can throw an exception at that point if you want. With this pattern you are totally in control of when the thread will act on the abort, and don't have to worry about the critical operations being interrupted.
[ 0.8327092528343201, -0.4008543789386749, -0.1274956315755844, 0.10996237397193909, 0.07706743478775024, -0.4871315360069275, 0.35212430357933044, -0.09423582255840302, -0.2801903188228607, -0.5169634222984314, 0.27274399995803833, 0.4395286738872528, -0.22330567240715027, -0.06440135091543...
I want to build my own custom log4j (network) adapter to solve my problem [that I posted here.](https://stackoverflow.com/questions/29505/deserialize-in-a-different-language) I have looked at the documentation on the log4j and I cant see where/if the developers go into how to do this. Can anyone point me in the right...
[ 0.20751503109931946, 0.2224695086479187, -0.045040566474199295, -0.11403453350067139, -0.16019204258918762, -0.06681488454341888, 0.602155327796936, -0.15473785996437073, -0.4739874303340912, -0.5703620314598083, -0.07994376122951508, 0.5642727613449097, -0.3319605886936188, -0.26171267032...
There are thousands of `vi` tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality. But does anyone know of a vi tutorial which focuses on the **needs of programmers**? For example when I program in **Perl** with `vi`, moving to the "n...
[ 0.7251258492469788, 0.04274236783385277, 0.14239932596683502, 0.1972498595714569, -0.37902724742889404, -0.024172484874725342, 0.39645206928253174, -0.17476101219654083, -0.08649422973394394, -0.6269234418869019, -0.0683196634054184, 0.9942191243171692, -0.2045592963695526, 0.1413002312183...
of files for template code, regular expression search, jumping to functions, perhaps minimal code completion, or other features that emulate what programmers have gotten used to in Visual Studio and Eclipse, etc. A nice collection of [vimtips](http://rayninfo.co.uk/vimtips.html). And the best Vim [cheatsheet](http://w...
[ 0.4929267168045044, -0.12272629141807556, 0.3673166036605835, 0.4379541575908661, -0.005257700104266405, -0.3020956516265869, 0.036372072994709015, -0.07351575791835785, -0.30889424681663513, -0.28535154461860657, -0.028251541778445244, 0.5901826024055481, -0.02446036972105503, -0.18201008...
If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current vers...
[ 0.4657851457595825, 0.257486492395401, -0.134806290268898, -0.15749645233154297, -0.19654737412929535, -0.3313755691051483, 0.43188783526420593, 0.23222844302654266, -0.22535842657089233, -0.38688233494758606, 0.03897731378674507, 0.8715776801109314, -0.2481108456850052, -0.150824308395385...
I don't think it is a good idea to go python 3 only. Based on the [time line](http://www.python.org/dev/peps/pep-3000/#timeline) there will be at least one or two following releases of the 2.x series after 2.6/3.0 in october. Beside not having python 3 available on your target platforms, it will take some time until i...
[ 0.3357265591621399, 0.034831732511520386, 0.33809706568717957, -0.1041199117898941, -0.3202202022075653, -0.3171526789665222, 0.42391812801361084, -0.11341264843940735, -0.05135267227888107, -0.5074151158332825, -0.18176525831222534, 0.7509483695030212, -0.31454092264175415, -0.21886622905...
When should I choose one or the other? What are the implications regarding space and (full-text) indexing? BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months. Thanks The new (max) fields make it a lot easier to deal with the data from .NET code. With `varbinary(max)`, you simp...
[ 0.21048273146152496, -0.09301018714904785, 0.6629695296287537, -0.010087976232171059, -0.2827894389629364, -0.057573843747377396, 0.13229615986347198, -0.24137485027313232, -0.2817092835903168, -0.4195184111595154, 0.24834762513637543, 0.734727144241333, -0.0026849627029150724, 0.078042998...
`varchar(max)`, and future versions of Sql Server will discontinue support for them.
[ 0.2039874941110611, -0.05774015560746193, 0.5886958241462708, -0.03612051531672478, -0.12290792912244797, 0.021852858364582062, 0.2959693670272827, 0.010486992076039314, -0.1384206861257553, -0.1641845852136612, -0.22629927098751068, 0.73552405834198, -0.3249630928039551, 0.398234903812408...
I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from `System.Int32` to `System.Decimal`. When I try to change the datatype in the `DataSet Designer` I receive the following error: > Property value is not valid. Cannot change DataType of a column once > it ha...
[ 0.028088582679629326, 0.0691971480846405, 0.6655827164649963, -0.04350418969988823, -0.5350840091705322, 0.3121318221092224, 0.16285693645477295, 0.13092857599258423, -0.3593498170375824, -0.7768949270248413, 0.4643338918685913, 0.5373053550720215, -0.23098449409008026, 0.11257891356945038...
set to any value (except the default `<DBNull>`). So the way I got around this issue was: 1. Column DefaultValue : Type in `<DBNull>` 2. Save and reopen the dataset
[ 0.0007252074428834021, -0.17269301414489746, 0.45684659481048584, -0.23896227777004242, -0.07276564836502075, -0.025128981098532677, 0.053059231489896774, -0.037525590509176254, -0.033991456031799316, -0.5530931949615479, -0.17037184536457062, 0.6049635410308838, -0.5424944758415222, 0.152...
I've noticed a lot of Microsoft sites have the \*.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies? A few internet searches led me to <http://www.microsoft.com/backstage/bkst_column_46.mspx>, but it was a dead link. Fortunately, it was arc...
[ 0.4412948787212372, -0.20413309335708618, 0.20903970301151276, 0.0938020646572113, 0.026255201548337936, -0.14061839878559113, -0.0022677923552691936, 0.6240992546081543, -0.38297340273857117, -0.7139130234718323, -0.1785820871591568, -0.07292038202285767, -0.23510795831680298, 0.167787134...
presentation framework includes a custom Web handler built in ASP.NET. Pages that use the presentation framework have the .mspx filename extension, which is registered in Microsoft Internet Information Services (IIS) on the Web servers. When one of the Microsoft.com Web servers receives a request for an .mspx page, thi...
[ 0.14998126029968262, 0.02362561784684658, 0.4966108798980713, 0.01695604994893074, -0.2735408842563629, -0.16307242214679718, 0.2460341453552246, 0.03433043882250786, -0.17302313446998596, -0.8144726753234863, -0.425009161233902, 0.03967473655939102, -0.40058186650276184, 0.307372629642486...
the table of contents provided by the site owner (see below) to determine where the XML content for the page is stored. The framework then checks to see if the XML is cached, and either returns the cached content or retrieves the XML from the data store identified in the table of contents file. > > > Within the file ...
[ 0.16739507019519806, 0.43497246503829956, 0.8783329129219055, 0.13457649946212769, -0.08948875963687897, -0.15631259977817535, 0.10067661106586456, -0.17962099611759186, -0.13032476603984833, -0.697650134563446, -0.36953604221343994, 0.1323162019252777, -0.2173977792263031, -0.022033153101...
column, finally rendering the content within the content pane.
[ -0.16514138877391815, 0.09595084935426712, 0.7455930113792419, 0.0683373212814331, -0.03242951259016991, 0.09706023335456848, -0.015898851677775383, 0.21880151331424713, 0.007450358476489782, -0.5638319849967957, -0.6890051960945129, 0.010907227173447609, -0.08566202968358994, 0.2055863291...
I'm trying to install [GODI](http://godi.camlcity.org/godi/index.html) on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing. ``` $ ./bootstrap...
[ 0.023434260860085487, 0.32570981979370117, 0.3878289759159088, -0.20383647084236145, 0.06318842619657516, 0.04704892262816429, 0.4776016175746918, 0.05541681870818138, -0.127431258559227, -0.9098449349403381, -0.04971303045749664, 0.6725962162017822, -0.4280206859111786, 0.0981887206435203...
just figured it out. Silly mistake. It was just a permission issue, running everything from `/tmp/` worked fine --well after enabling `GODI_BASEPKG_PCRE` in `godi.conf`. I had been running it from my home directory, you forget simple things like that at 3:00am. -- Actually I'm having another problem. Installing `con...
[ -0.020788848400115967, 0.23144695162773132, 0.4914586544036865, 0.05428643152117729, 0.10894028842449188, -0.34876978397369385, 0.541793942451477, -0.15491518378257751, -0.23922622203826904, -0.6513757109642029, -0.13703016936779022, 0.7635875344276428, -0.27185574173927307, -0.03395638614...
Exec error: File /home/nlucaroni/godi/build/conf/conf-opengl/./../../mk/bsd.pkg.mk, line 1022: Command returned with non-zero exit code > Error: Exec error: File /home/nlucaroni/godi/build/conf/conf-opengl/./../../mk/bsd.pkg.mk, line 1375: Command returned with non-zero exit code ### Error: Command fails with code 1: ...
[ -0.2297811657190323, 0.21833042800426483, 0.6358076333999634, 0.03435058891773224, -0.004908823408186436, 0.21398676931858063, 0.6440423727035522, -0.09874721616506577, -0.20690084993839264, -0.46791785955429077, -0.19709105789661407, 0.7358990907669067, -0.2463056445121765, 0.208436980843...
I have a problem with a sample routing with the preview 5 of asp.net mvc. In the AccountController I have 2 actions: ``` public ActionResult Delete() public ActionResult Delete(string username) ``` While trying to look for Account/Delete or Account/Delete?username=davide the ControllerActionInvoker throws a exce...
[ -0.2539498507976532, -0.352340430021286, 0.39898842573165894, -0.03987593203783035, -0.20353642106056213, 0.09946896135807037, 0.47171035408973694, -0.10535936057567596, -0.40547457337379456, -0.6469942331314087, 0.19501779973506927, 0.6866175532341003, -0.4291536808013916, 0.0537128597497...
which method to call depending on the request. This is done by the ActionSelectionAttribute. Full explanation here: <http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx>
[ 0.00033578285365365446, -0.32048144936561584, 0.11060748994350433, -0.1527947336435318, 0.0455268956720829, 0.10543641448020935, 0.26632028818130493, -0.4520259499549866, -0.43400996923446655, -0.07602666318416595, -0.32440754771232605, 0.38672298192977905, -0.18608331680297852, -0.0602706...
We're a .NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development. Now, if a developer forgets to check-in his scr...
[ 0.5463895797729492, 0.35124078392982483, -0.08993670344352722, 0.06287436932325363, 0.022724810987710953, -0.3143726587295532, 0.34475430846214294, 0.17257808148860931, 0.06824575364589691, -0.5130437016487122, 0.2478487640619278, 0.5728077292442322, 0.0366598479449749, 0.03226685151457786...
issues, but it only has SQL Server support. Anybody knows of a similar tool for Oracle? I've been unable to find one. Red Gate Schema Compare for Oracle has now been released! <http://www.red-gate.com/products/schema_compare_for_oracle/index.htm> There is a 28-day fully functional free trial. Please give it a go and ...
[ 0.0413781963288784, -0.13836617767810822, 0.3272132873535156, 0.04852324724197388, -0.17947980761528015, -0.2841912806034088, 0.430372953414917, -0.31354478001594543, 0.04714677482843399, -0.4809098541736603, 0.10763967782258987, 0.5388530492782593, -0.050785310566425323, -0.00946844369173...
I've been hearing about triggers, and I have a few questions. What are triggers? How do I set them up? Are there any precautions, aside from typical SQL stuff, that should be taken? Triggers allow you to perform a function in the database as certain events happen (eg, an insert into a table). I can't comment...
[ 0.7433751821517944, -0.04760641232132912, -0.035617977380752563, 0.3039177358150482, 0.16689205169677734, -0.31782323122024536, 0.12540556490421295, 0.02321563847362995, -0.2047770619392395, -0.1826685220003128, 0.20400501787662506, 0.3634723424911499, 0.04774034395813942, 0.07215720415115...
like really strange things happen (such as inserts into other tables, input data changing, etc). Before implementing things as a trigger I'd seriously consider instead enforcing the use of an API around the schema (preferably in the database, but outside if you can't). Some things I'd still use triggers for * Keeping...
[ 0.6484519243240356, -0.11047278344631195, 0.18261456489562988, 0.22715860605239868, 0.3255918025970459, -0.6091794967651367, 0.24267391860485077, 0.08327890932559967, -0.5376923084259033, -0.4469181299209595, 0.0514117032289505, 0.18195711076259613, -0.21119540929794312, 0.1488963663578033...
in the trigger MUST be able to rollback with the transaction )
[ -0.03617480397224426, -0.11737042665481567, 0.6459861993789673, 0.013915042392909527, 0.22020700573921204, -0.08635225147008896, -0.033667054027318954, -0.6047560572624207, -0.14704667031764984, 0.14071616530418396, -0.362326979637146, 0.5408973693847656, -0.24748682975769043, 0.0310407374...
With the code, forms and data inside the same database I am wondering what are the best practices to design a suite of tests for a Microsoft Access application (say for Access 2007). One of the main issues with testing forms is that only a few controls have a `hwnd` handle and other controls only get one they have foc...
[ 0.5713472366333008, 0.37271326780319214, 0.10167355090379715, 0.31752148270606995, 0.04296373948454857, -0.41961345076560974, 0.32878032326698303, -0.42629870772361755, 0.1256697177886963, -0.5993069410324097, 0.40298688411712646, 0.42446988821029663, -0.07760399580001831, -0.1322168856859...
can't be properly tested there. In fact, you really shouldn't have to test your form itself at all. It should be a dead dumb simple view that responds to User Interaction and then delegates responsibility for responding to those actions to another class that ***is*** testable. How do you do that? Familiarizing yoursel...
[ 0.25200361013412476, -0.14988401532173157, 0.24214322865009308, 0.23428332805633545, -0.27599960565567017, -0.291644811630249, 0.2105390578508377, -0.4525567591190338, -0.1509615033864975, -0.5091693997383118, 0.1872241497039795, 0.40160849690437317, -0.24339908361434937, -0.04844919964671...
button. ![simple form with text box and button](https://i.stack.imgur.com/ts6jl.png) In the form's code behind, we'll wrap the TextBox's value in a public property and re-raise any events we're interested in. ``` Public Event OnSayHello() Public Event AfterTextUpdate() Public Property Let Text(value As String) ...
[ 0.08499353379011154, 0.07894326001405716, 0.9934659600257874, -0.13024784624576569, -0.05334245041012764, -0.21869483590126038, 0.11162086576223373, -0.3798150420188904, -0.09565725922584534, -0.5780720114707947, -0.350536048412323, 0.41680797934532166, -0.22388097643852234, 0.161749452352...
a similar structure as our view. ``` Private mText As String Public Property Let Text(value As String) mText = value End Property Public Property Get Text() As String Text = mText End Property Public Function Reversed() As String Dim result As String Dim length As Long length = Len(mText) D...
[ -0.12974408268928528, -0.15428611636161804, 0.7509355545043945, -0.3436570465564728, -0.07161720842123032, 0.012317344546318054, 0.0097349863499403, -0.40685901045799255, -0.08426380902528763, 0.04279964789748192, -0.428897887468338, 0.7173357605934143, -0.2476198822259903, 0.4695329070091...
= result End Function Public Sub SayHello() MsgBox Reversed() End Sub ``` Finally, our controller wires it all together. The controller listens for form events and communicates changes to the model and triggers the model's routines. ``` Private WithEvents view As Form_Form1 Private model As MyModel Public Sub ...
[ 0.24999123811721802, -0.3620544970035553, 0.9252974390983582, 0.023127587512135506, 0.10111729800701141, 0.0016329219797626138, 0.2701975405216217, -0.44811347126960754, -0.1794499158859253, -0.43102410435676575, -0.13748683035373688, 0.43258529901504517, -0.5371168255805969, 0.24716156721...
of this example, I've used a standard module. I highly encourage you to build this yourself using the code I've provided and see it function. ``` Private controller As FormController Public Sub Run() Set controller = New FormController controller.Run End Sub ``` --- So, that's great and all ***but what doe...
[ 0.29956886172294617, 0.04310189560055733, 0.33164548873901367, 0.2054700255393982, 0.08040135353803635, -0.5684798359870911, 0.3279035985469818, 0.017643867060542107, -0.2733882665634155, -0.7168625593185425, -0.045460205525159836, 0.69991534948349, -0.3289955258369446, 0.14224281907081604...
That's where all of the real logic is. So, on to step two. 2. Choose a Unit Testing Framework ================================== There aren't a lot of options here. Most frameworks require installing COM Add-ins, lots of boiler plate, weird syntax, writing tests as comments, etc. That's why I got involved in [build...
[ 0.3715639114379883, -0.10982862114906311, 0.015872541815042496, 0.35657453536987305, -0.14715631306171417, -0.06745709478855133, 0.036287322640419006, -0.2643878161907196, -0.04348734766244888, -0.6701450347900391, 0.2251366376876831, 0.6483497023582458, -0.10065644979476929, -0.0417729839...
you write those strange looking tests though. * The project has not seen any updates since 2013. 2. [VB Lite Unit](http://vb-lite-unit.sourceforge.net/) I can't say I've personally used it. It's out there, but hasn't seen an update since 2005. 3. [xlUnit](http://xlvbadevtools.codeplex.com/) xlUnit isn't awful, but it'...
[ 0.6342942118644714, 0.277275413274765, 0.2026699036359787, -0.10778751969337463, -0.36712026596069336, -0.08497701585292816, 0.5258635878562927, -0.028122195973992348, -0.181612029671669, -0.6216797828674316, 0.3599889278411865, 0.525386393070221, -0.16711752116680145, 0.10730301588773727,...
code. 5. [Rubberduck VBE Add-In's Unit Testing Framework](https://github.com/rubberduck-vba/Rubberduck/wiki/Unit-Testing) *Disclaimer: I'm one of the co-devs*. I'm biased, but this is by far my favorite of the bunch. * Little to no boiler plate code. * Intellisense is available. * The project is active. * More...
[ 0.5909058451652527, 0.015325289219617844, 0.39057618379592896, 0.22847789525985718, 0.15135067701339722, -0.10407629609107971, 0.28288546204566956, -0.13883192837238312, -0.10643583536148071, -0.7032849788665771, 0.1323590725660324, 0.538750171661377, 0.05501893162727356, 0.180362239480018...
at what that test could look like. (Example given uses Rubberduck, but it's a simple test and could translate into the framework of your choice.) ``` '@TestModule Private Assert As New Rubberduck.AssertClass '@TestMethod Public Sub ReversedReversesCorrectly() Arrange: Dim model As New MyModel Const original ...
[ -0.042373575270175934, -0.29578614234924316, 0.7037970423698425, 0.12747670710086823, 0.16037021577358246, 0.23105870187282562, 0.4624057114124298, -0.24988354742527008, -0.0660472884774208, -0.35360896587371826, -0.11547006666660309, 0.8011876940727234, 0.017986271530389786, 0.00224397587...
is a bug introduced into the system or the requirements have changed. 3. Don't include external dependencies such as databases and file systems. These external dependencies can make tests fail for reasons outside of your control. Secondly, they slow your tests down. If your tests are slow, you won't run them. 4. Use te...
[ 0.5842471718788147, 0.21713916957378387, -0.21605104207992554, 0.30876675248146057, -0.043831970542669296, -0.08333831280469894, 0.4734172821044922, 0.10213950276374817, 0.019021613523364067, -0.4256322979927063, 0.09603428840637207, 0.3107113242149353, -0.09357146918773651, 0.139833822846...
Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Example input and output: ``` >>> reverse_words("this is a string") 'string a is this' ``` It should be O(N) time and O(1) space (`split()` and pushing on / popping off...
[ -0.2182784229516983, 0.07087691128253937, 0.12279186397790909, -0.35557645559310913, 0.1258636713027954, 0.5240161418914795, 0.32499897480010986, -0.41456106305122375, 0.15662549436092377, -0.18787680566310883, -0.2650863826274872, 0.35227295756340027, -0.08968599885702133, -0.123027734458...
i<length/2; i++){ swap(str, i, length-i-1); } } void reverse_words(char* str){ int l = strlen(str); //Reverse string reverse_string(str,strlen(str)); int p=0; //Find word boundaries and reverse word by word for(int i=0; i<l; i++){ if(str[i] == ' '){ reverse_string...
[ -0.26629123091697693, 0.002757458249107003, 0.4954302906990051, -0.7084222435951233, -0.06348922103643417, 0.6060735583305359, 0.551601767539978, -0.5378078818321228, 0.2999347448348999, -0.3828239440917969, -0.3810247778892517, 0.24060872197151184, -0.27231892943382263, 0.1976092308759689...
} } //Finally reverse the last word. reverse_string(&str[p], l-p); } ``` This should be O(n) in time and O(1) in space. Edit: Cleaned it up a bit. The first pass over the string is obviously O(n/2) = O(n). The second pass is O(n + combined length of all words / 2) = O(n + n/2) = O(n), which makes this a...
[ -0.1573656052350998, 0.014297611080110073, 0.5443701148033142, -0.48202231526374817, 0.08996235579252243, 0.15584339201450348, 0.5322034358978271, -0.22741344571113586, -0.1668921560049057, -0.6338299512863159, -0.14604604244232178, 0.38993164896965027, -0.14097879827022552, 0.100427210330...
I am trying to create a horizontal menu with the elements represented by `<span>`'s. The menu itself (parent `<div>`) has a fixed width, but the elements number is always different. I would like to have child `<span>`'s of the same width, independently of how many of them are there. What I've done so far: added a `fl...
[ 0.35378584265708923, 0.09973594546318054, 0.6147774457931519, 0.08695930987596512, -0.15921056270599365, 0.5257765054702759, -0.09936939179897308, -0.10779522359371185, -0.08840513229370117, -0.9125190377235413, 0.11713709682226181, 0.33271706104278564, 0.097815603017807, 0.120629161596298...
case when we have a division remainder (like for 3 elements), in this case I have a one-pixel hole to the right of the parent `<div>`, and if I rounding the percents up, the last menu element is wrapped. I also don't really like style generation on the fly, but if there's no other solution, it's fine. What else could ...
[ 0.3310755789279938, 0.06809131801128387, -0.0557282492518425, 0.05558641999959946, -0.01500185951590538, 0.36097246408462524, 0.12125512957572937, -0.054098084568977356, -0.2286071479320526, -0.6803861260414124, 0.35362234711647034, 0.21881631016731262, 0.0791517049074173, 0.24009606242179...
cell contents. ```css table.ClassName { table-layout: fixed } ```
[ -0.31431126594543457, 0.4069051444530487, 0.1003340482711792, -0.10496462136507034, 0.36539241671562195, 0.08366625010967255, -0.19529269635677338, 0.34590229392051697, -0.32749953866004944, -0.5741598010063171, -0.4150431156158447, 0.05845095217227936, -0.441400408744812, 0.21529416739940...
If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names? ie ``` [Test] public void ShouldValidateUserNameIsLessThan100Characters() {} ``` verse ``` [Test] public void UserNameTestValidation1() {} ``` Th...
[ 0.35669225454330444, 0.190538689494133, 0.13072960078716278, 0.053766608238220215, 0.24140673875808716, -0.1437237709760666, 0.3731076121330261, -0.31256017088890076, 0.31303414702415466, -0.710464358329773, 0.004956658463925123, 0.5557535886764526, 0.06196403130888939, 0.15370307862758636...
I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it. I also tried embedding a keyword in the script name, but *Xcode* copies the script to a g...
[ 0.2739051878452301, 0.04504105821251869, 0.11562035232782364, 0.10477995127439499, -0.1196972206234932, 0.11096356809139252, 0.3558191955089569, 0.24144095182418823, 0.08991494029760361, -0.7459891438484192, 0.08621437102556229, 0.6384824514389038, -0.39776700735092163, 0.1491793692111969,...
menubar (between the Window and Help menus). My question is not about "run script" build phase scripts. My apologies for leaving that somewhat ambiguous. You can't pass parameters to user scripts — instead, user scripts operate on the context you're working in (e.g. the selected file, the selected text, etc.). You sho...
[ 0.24512460827827454, 0.010861963033676147, 0.2141873985528946, -0.09248431771993637, 0.015150937251746655, 0.1698163002729416, 0.2589026689529419, 0.18504498898983002, 0.20034629106521606, -0.6922245025634766, -0.28271928429603577, 0.7909713387489319, -0.14293624460697174, -0.1946239024400...
Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is a strategy game (browser based, just text) t...
[ 0.3435053825378418, -0.1219349130988121, 0.08117017894983292, 0.2896791994571686, 0.3248159885406494, -0.18522410094738007, -0.0708124116063118, 0.10623946785926819, -0.3811798393726349, -0.329271137714386, 0.06580779701471329, 0.6133209466934204, -0.1299765408039093, -0.3973427712917328, ...
Django database engine: I was thinking of using MySQL (unless there's a big advantage in using another) the schema: all I have now are some Django models, and that's far too much detail to post here. And if I start posting schemas this becomes too specific, and I was looking for general tips. For example, consider th...
[ 0.3668350875377655, 0.2907660901546478, -0.02800576202571392, -0.056817010045051575, -0.24952034652233124, -0.49881449341773987, -0.03940514475107193, -0.16654512286186218, -0.3209049105644226, -0.3740741014480591, 0.24177934229373932, 0.6599621772766113, -0.22057700157165527, -0.213914141...
and the result? I guess I could cache the "history" table, but this would take more space in the database and also more database operations because I would have to constantly create new rows instead of just altering them in the aggregate table. You have probably touched on a much larger issue of designing for high scal...
[ 0.24105964601039886, 0.2761586308479309, 0.036539021879434586, 0.24693705141544342, 0.32460445165634155, 0.027581099420785904, -0.036649130284786224, -0.20178118348121643, -0.35138171911239624, -0.5182734131813049, 0.1237613782286644, 0.3992735743522644, -0.13181142508983612, 0.41522482037...
read frequently and which is to be written frequently and optimise. Much more important than your database design for high performance web applications, is your effective use of caching both at the client level through HTML page caching and at the server level through cached data or serving up static files in place of...
[ 0.08873286098241806, 0.240091472864151, 0.11216384172439575, 0.27305978536605835, -0.09668411314487457, -0.2881958484649658, 0.09950977563858032, 0.11902087926864624, -0.3518604636192322, -0.7643395066261292, -0.09278614073991776, 0.3728385865688324, -0.3309003412723541, 0.1785230338573455...
it to change frequently. If you wish to produce regular and fairly intensive reports from your data, then it is good practise to put this data into another database so as not to bring your web application to a halt whilst they run. Of course this kind of optimisation really isn't necessary unless you think your applic...
[ 0.30455082654953003, -0.18491998314857483, 0.4560549259185791, 0.16753458976745605, 0.2830296456813812, -0.08801394701004028, 0.028889264911413193, 0.09709371626377106, -0.40972864627838135, -0.6034714579582214, 0.0649990364909172, 0.6252492666244507, -0.3457702100276947, 0.020075198262929...
I've been trying to implement unit testing and currently have some code that does the following: 1. query external database, loading into a feed table 2. query a view, which is a delta of my feed and data tables, updating data table to match feed table my unit testing strategy is this: I have a testing database that...
[ 0.9513676166534424, 0.3396652042865753, -0.05020718276500702, -0.14148443937301636, -0.21210382878780365, 0.030149394646286964, 0.40526267886161804, -0.4742978811264038, 0.20429269969463348, -0.6835254430770874, 0.2830684185028076, 0.5276365876197815, -0.009233232587575912, 0.2102628946304...
again 6. inspect data table again Obviously I have the data sets that I load into the source db set up such that I know certain records should be added,deleted,updated, etc. It seems like this is a bit cumbersome and there should be an easier way? any suggestions? Is it your intent to test the view which generates th...
[ 0.7087348699569702, -0.16742372512817383, 0.1479962170124054, 0.08286210894584656, -0.39289334416389465, -0.17211836576461792, 0.25126057863235474, -0.20769034326076508, -0.22302484512329102, -0.5896719694137573, 0.3000328242778778, 0.751618504524231, -0.3853350579738617, 0.249664783477783...
Then, for each test you would verify that the view returns a matching set. If you want to test how your code responds to diffs detected by the view, I would try to abstract away database access. I imagine an java method to which you can pass a result set (or list of POJO/DTO's) and returns a list of parameter Object a...
[ 0.39323052763938904, -0.05777672678232193, 0.15602384507656097, 0.13667841255664825, -0.38213682174682617, 0.2885127067565918, 0.15345871448516846, -0.44894519448280334, -0.003221304388716817, -0.524071216583252, 0.1471729278564453, 0.6563735008239746, -0.34441015124320984, -0.027087414637...
parameters are returned. All without touching a database. I think the key is to break your process into parts and test each of those as independently as possible.
[ 0.45988714694976807, 0.015200799331068993, 0.04477708041667938, 0.4252714514732361, 0.16188299655914307, 0.15268047153949738, 0.14411590993404388, -0.48593559861183167, 0.014635119587182999, -0.3650112748146057, 0.07049623876810074, 0.535258412361145, -0.24549280107021332, 0.22576202452182...
Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done. **UPDATE** Well, it only took about 200 lines, but I wrote a simple one...It works a lot like osql. You enter command...
[ 0.24135547876358032, -0.17830294370651245, 0.30248814821243286, 0.323664128780365, -0.3529675006866455, 0.05182376503944397, 0.4942142963409424, 0.19090132415294647, 0.048342738300561905, -0.5643001794815063, 0.1490895003080368, 0.8547621369361877, 0.04668164253234863, -0.42189541459083557...
of interacting with an existing, compiled application currently running as a process. In the former case: * **Windows PowerShell** might be your friend * Another candidate would be the [**C# shell**](http://michael.susens-schurter.com/blog/2006/12/20/cssh-c-shell/) * Finally, [**CSI**](http://www.codeproject.com/KB/c...
[ -0.24965369701385498, 0.10630804300308228, 0.25936251878738403, 0.03681361675262451, 0.021052632480859756, -0.008353600278496742, 0.5628111958503723, 0.20310747623443604, -0.17354059219360352, -0.779324471950531, -0.17828579246997833, 0.5121490359306335, -0.30182820558547974, -0.0289856605...
I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropriately. Ide...
[ 0.40730562806129456, 0.41341671347618103, -0.06550372391939163, -0.07620970904827118, -0.21221113204956055, -0.06154765188694, 0.027534743770956993, 0.023785265162587166, -0.4442112445831299, -0.5959900617599487, 0.24754075706005096, 0.2529407739639282, -0.14908920228481293, 0.368068784475...
both? For warnings to be "flagged" to PHP natively would require changes to the mysql/mysqli driver, which is obviously beyond the scope of this question. Instead you're going to have to basically check every query you make on the database for warnings: ``` $warningCountResult = mysql_query("SELECT @@warning_count"); ...
[ 0.4205804169178009, 0.2523552477359772, 0.2789955139160156, -0.2516622841358185, -0.05762941762804985, -0.11235629767179489, 0.4999261498451233, -0.3544101417064667, -0.3615487813949585, -0.2662523090839386, 0.22086121141910553, 0.5577878952026367, -0.6159707903862, 0.13659588992595673, ...
while ($warning = mysql_fetch_assoc($warningDetailResult) { //Process it } } }//Else no warnings } ``` Obviously this is going to be hideously expensive to apply en-mass, so you might need to carefully think about when and how warnings may arise (which may lead you to refactor ...
[ 0.356998473405838, 0.20402181148529053, 0.3553003966808319, -0.31285107135772705, 0.03465870022773743, -0.3700089752674103, 0.4947400987148285, -0.13142819702625275, -0.23166026175022125, -0.38302916288375854, -0.1987178772687912, 0.5937876105308533, -0.3289644718170166, 0.1742879152297973...
@@warning_count`, which would save you a query per execution, but I included it for pedantic completeness.
[ 0.8198713064193726, 0.3112931549549103, 0.10689739882946014, -0.29320624470710754, -0.2791585624217987, -0.18311214447021484, 0.7909271717071533, -0.022186245769262314, 0.10017243027687073, -0.06699979305267334, 0.14279362559318542, 0.37947604060173035, -0.3540055751800537, -0.028484370559...
Assuming String a and b: ``` a += b a = a.concat(b) ``` Under the hood, are they the same thing? Here is concat decompiled as reference. I'd like to be able to decompile the `+` operator as well to see what that does. ``` public String concat(String s) { int i = s.length(); if (i == 0) { return th...
[ 0.3347872793674469, -0.08878767490386963, 0.35037341713905334, -0.10451827198266983, 0.23807118833065033, -0.20697572827339172, 0.20324786007404327, -0.31713590025901794, 0.17198964953422546, -0.228926882147789, -0.21449047327041626, 0.7372829914093018, -0.44537556171417236, 0.254638671875...
s.getChars(0, i, ac, count); return new String(0, count + i, ac); } } ``` No, not quite. Firstly, there's a slight difference in semantics. If `a` is `null`, then `a.concat(b)` throws a `NullPointerException` but `a+=b` will treat the original value of `a` as if it were `null`. Furthermore, the `concat()`...
[ -0.027219071984291077, -0.11421141773462296, 0.2806488275527954, -0.12995685636997223, -0.19070330262184143, -0.06600552052259445, 0.2911418676376343, -0.2148769348859787, -0.05655857175588608, -0.4859932065010071, -0.6450306177139282, 0.32343050837516785, -0.4452652931213379, 0.1931636035...
hood, write a simple class with `a += b;` ``` public class Concat { String cat(String a, String b) { a += b; return a; } } ``` Now disassemble with `javap -c` (included in the Sun JDK). You should see a listing including: ``` java.lang.String cat(java.lang.String, java.lang.String); Code: ...
[ 0.4382627308368683, 0.06715893745422363, 0.4762442708015442, 0.025654500350356102, 0.1344148963689804, -0.38593465089797974, 0.2934202551841736, -0.5838281512260437, 0.021573638543486595, -0.09285974502563477, -0.02908761240541935, 0.7370854616165161, -0.510927140712738, 0.1139750629663467...
8: invokevirtual #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 11: aload_2 12: invokevirtual #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 15: invokevirtual #5; //Method java/lang/StringBuilder.toString:()Ljava/l...
[ -0.19540536403656006, -0.19363322854042053, 0.7860116362571716, -0.4413697123527527, 0.16409771144390106, 0.19660203158855438, -0.008329846896231174, -0.7145093083381653, -0.21706503629684448, -0.3322552442550659, -0.43446800112724304, 0.7804409265518188, -0.41368159651756287, -0.249578759...
`StringBuilder` (and its package-private base class) is available in src.zip of the Sun JDK. You can see that you are building up a char array (resizing as necessary) and then throwing it away when you create the final `String`. In practice memory allocation is surprisingly fast. **Update:** As Pawel Adamski notes, pe...
[ -0.1117691844701767, 0.11790787428617477, 0.17253480851650238, -0.29001346230506897, -0.2413562685251236, -0.21972864866256714, 0.2826796770095825, -0.3595971167087555, -0.20340584218502045, -0.8015310764312744, -0.1103271096944809, 0.39936381578445435, -0.2570751905441284, -0.011852262541...
update is released, or if you use a different JVM. From [@lukaseder](https://twitter.com/lukaseder), [a list of HotSpot JVM intrinsics](https://gist.github.com/apangin/7a9b7062a4bd0cd41fcc).
[ -0.40412434935569763, -0.29648733139038086, 0.7762868404388428, 0.17135006189346313, -0.20078253746032715, -0.23915502429008484, 0.08765244483947754, 0.06155366078019142, -0.383980393409729, -0.7627473473548889, -0.7099720239639282, 0.3763870298862457, -0.1802878975868225, -0.1613955944776...
I would like to do full-text searching of data in my Ruby on Rails application. What options exist? There are several options available and each have different strengths and weaknesses. If you would like to add full-text searching, it would be prudent to investigate each a little bit and try them out to see how well it...
[ 0.3274218738079071, 0.08471761643886566, 0.13810749351978302, 0.17146530747413635, -0.34547701478004456, 0.0864136666059494, 0.45008811354637146, -0.02395470067858696, -0.2613776922225952, -0.5653370022773743, -0.07803892344236374, 0.28378012776374817, -0.0709557831287384, 0.00409868778660...
a wrapper for similar built-in functionality for recent versions of [PostgreSQL](http://www.postgresql.org/docs/8.3/static/textsearch.html) For other databases you will have to use other software. [Lucene](http://lucene.apache.org/) is a popular search provider written in Java. You can use Lucene through its search s...
[ 0.10247369855642319, -0.2596589922904968, 0.17764802277088165, -0.004073599353432655, -0.4562259614467621, 0.0899617001414299, 0.3928774297237396, 0.2045711874961853, -0.2201782912015915, -0.9443029165267944, -0.399269700050354, 0.08883688598871231, -0.3601274788379669, -0.0229778438806533...
and search your databases, but is no longer being actively maintained. Another plugin for Sphinx is [Thinking Sphinx](http://ts.freelancing-gods.com/) which has a lot of positive [feedback](http://www.williambharding.com/blog/rails/rails-thinking-sphinx-plugin-full-text-searching-thats-cooler-than-a-polar-bears-toenai...
[ 0.35008350014686584, -0.16713403165340424, -0.020274991169571877, 0.4697990417480469, -0.3058401346206665, -0.3274818956851959, 0.5656573176383972, 0.30770668387413025, -0.6069554090499878, -0.5023756623268127, 0.07111956924200058, -0.10328097641468048, -0.20596884191036224, -0.02582930400...
I am writing a coding standards document for a team of about 15 developers with a project load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it is wise that, for whatever reason, we establish som...
[ 0.9628980159759521, 0.5770076513290405, 0.009319604374468327, -0.24268968403339386, -0.07547755539417267, 0.17443299293518066, 0.22047758102416992, 0.10757361352443695, -0.18034878373146057, -0.7591979503631592, -0.02506447210907936, 0.5126023888587952, 0.25166043639183044, -0.076274655759...
and sometimes even double the team size. I am looking for a few suggestions for code formatting and naming standards that have really paid off ... but that can also really be justified. I think consistency and shared-patterns go a long way to making the code more maintainable ... but, are there other things I ought to...
[ 0.6344148516654968, -0.04257175326347351, -0.4033270478248596, 0.32528945803642273, -0.3230747878551483, 0.007172047160565853, 0.26477035880088806, -0.1427922546863556, -0.4325881600379944, -0.586370050907135, 0.030845750123262405, 0.34632501006126404, -0.004935136996209621, -0.36563259363...
with an underscore? Do you follow any naming conventions to make it easier to find particulars in a file? How do you order the members of your class? What about suggestions for namespaces, packaging or source code folder/organization standards? I tend to start with something like: ``` <com|org|...>.<company>.<app>.<l...
[ 0.5843385457992554, 0.3622952699661255, 0.022265464067459106, 0.05536668375134468, -0.22682121396064758, 0.048765964806079865, -0.04642434045672417, -0.038881342858076096, -0.17701798677444458, -0.4499710202217102, -0.04274725914001465, 0.2652224004268646, -0.26605623960494995, 0.210565447...
the document says, people will inevitably break the rules. It's much easier to run code through a formatter than to nit-pick in a code review. If you're using a language with an existing standard (e.g. Java, C#), it's easiest to use it, or at least start with it as a first draft. Sun put a lot of thought into their fo...
[ 0.7252516746520996, 0.12019278109073639, 0.018473953008651733, 0.11662698537111282, -0.08698708564043045, -0.47162067890167236, 0.028266070410609245, -0.2195616513490677, -0.16855239868164062, -0.5993891954421997, -0.04336180537939072, 0.4065806567668915, -0.027614010497927666, -0.35106760...
*any* standard is the key.
[ 0.5467194318771362, 0.3286706507205963, 0.07720553129911423, 0.05672337859869003, -0.19057103991508484, -0.29018211364746094, 0.022139620035886765, 0.24231398105621338, -0.09875009208917618, -0.49813705682754517, -0.36105775833129883, 0.40452131628990173, 0.13988687098026276, 0.29486709833...
The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/\*" in the JNDI tree. **Problem:** in Weblogic,...
[ 0.2864104211330414, -0.21385438740253448, 0.622735321521759, 0.08071622252464294, -0.13171756267547607, -0.13859184086322784, 0.0009027962223626673, -0.14313948154449463, -0.4870063066482544, -0.5047287344932556, -0.07749006152153015, 0.3373687267303467, -0.512097954750061, -0.044866934418...
environments. Is there an elegant way to address this. Can I look JNDI names up directly in Tomcat? Can Spring take a name and look in both places? Google searches or suggestions would be great. `JndiLocatorSupport` has a property `resourceRef`. When setting this true, "java:comp/env/" prefix will be prepended automat...
[ 0.2162194550037384, -0.055855754762887955, 0.2938179075717926, 0.04123019799590111, 0.15832217037677765, -0.16876840591430664, 0.008789386600255966, 0.23728351294994354, -0.26206421852111816, -0.9121215343475342, -0.012274674139916897, 0.6062421202659607, -0.4048972725868225, 0.17786613106...
When you print from Google Docs (using the "print" link, not File/Print) you end up printing a nicely formated PDF file instead of relying on the print engine of the browser. Same is true for some of the reports in Google Analytics . . . the printed reports as PDF's are beautiful. How do they do that? I can't imagine t...
[ 0.6021012663841248, 0.0007328053470700979, 0.12725113332271576, 0.44651350378990173, -0.16793440282344818, -0.35057103633880615, -0.19465172290802002, 0.28822603821754456, -0.15434281527996063, -0.7151741981506348, 0.07001990079879761, 0.7135736346244812, -0.07379516959190369, -0.085117049...
does it. If you look at the [PDF Properties](http://docs.google.com/Doc?id=dd8xj6nh_2q9zprkd6 "I've embedded the image in a document here") page, they use Prince 6.0 (see [princexml.com](http://www.princexml.com/)) There are lots of other PDF generators out there. I've had great success with [PDFlib](http://www.pdflib...
[ 0.3116800785064697, -0.3058328628540039, 0.5479796528816223, 0.2908605933189392, -0.02969786711037159, -0.2472383975982666, 0.3793935179710388, -0.1381870061159134, -0.19748860597610474, -0.548149824142456, -0.037010401487350464, 0.2153284251689911, 0.19221937656402588, -0.1010361462831497...
A while ago I read the [Mocks Aren't Stubs](http://www.martinfowler.com/articles/mocksArentStubs.html) article by Martin Fowler and I must admit I'm a bit scared of external dependencies with regards to added complexity so I would like to ask: What is the best method to use when unit testing? Is it better to always u...
[ 0.47813335061073303, 0.23638379573822021, -0.2023913562297821, 0.07994625717401505, -0.1020105630159378, 0.2312663346529007, 0.7690641283988953, -0.2058258354663849, -0.12293865531682968, -0.5793077349662781, 0.079654261469841, 0.6098639965057373, -0.2256324291229248, -0.07765213400125504,...
need an interface with multiple methods to be mocked, go with a mock framework. Avoid using mocks *always* because they make tests brittle. Your tests now have intricate knowledge of the methods called by the implementation, if the mocked interface or your implementation changes... your tests break. This is bad coz yo...
[ 0.3208785653114319, 0.35003161430358887, 0.05697398632764816, 0.43143969774246216, -0.2045224905014038, 0.010342195630073547, 0.880073606967926, 0.032560795545578, 0.017457861453294754, -0.7966299653053284, 0.050853852182626724, 0.6603356599807739, 0.1698744148015976, 0.016845375299453735,...
to Toran Billups for example of a mockist test. See below) Hi Doug, Well I think we've transcended into another holy war - Classic TDDers vs Mockist TDDers. I think I'm belong to the former. * If I am on test#101 Test\_ExportProductList and I find I need to add a new param to IProductService.GetProducts(). I do th...
[ 0.6116142868995667, 0.5906437635421753, 0.3288194239139557, 0.13538849353790283, -0.36419832706451416, -0.08003005385398865, 0.6442143321037292, 0.10357259958982468, -0.32761263847351074, -0.4153600037097931, -0.11763887107372284, 0.3914935886859894, -0.03075380250811577, 0.162566334009170...
time. Why did ShouldPopulateProductsListOnViewLoadWhenPostBackIsFalse fail? Was it because the code is broken? Rather the tests are broken. I favor the *one test failure = 1 place to fix*. Mocking freq goes against that. Would stubs be better? If it I had a fake\_class.GetProducts().. sure One place to change instead o...
[ 0.5811412334442139, 0.20856130123138428, 0.16019447147846222, 0.2416807860136032, 0.17161795496940613, 0.12757991254329681, 0.7434475421905518, -0.01282992959022522, -0.13934476673603058, -0.7699809074401855, 0.1498398780822754, 0.3278485834598541, -0.0010511010186746716, 0.285068422555923...
of plumbing code for the mock framework hides the actual test being performed. * requires you to learn this particular flavor of a mocking framework
[ 0.6341710686683655, 0.4521496593952179, -0.11585011333227158, 0.15043258666992188, 0.054948896169662476, -0.03296312689781189, 0.9492470622062683, -0.004343334119766951, 0.2173880636692047, -0.45854222774505615, 0.3461008369922638, 0.4691189229488373, -0.024717381224036217, -0.447317421436...
I have a webapp development problem that I've developed one solution for, but am trying to find other ideas that might get around some performance issues I'm seeing. problem statement: * a user enters several keywords/tokens * the application searches for matches to the tokens * need one result for each token + ie,...
[ -0.05539046600461006, 0.013164374977350235, 0.30988559126853943, 0.08831709623336792, 0.01639767549932003, -0.08549286425113678, 0.3980832099914551, -0.2907783091068268, -0.3211909234523773, -0.7753661870956421, 0.006189890205860138, -0.055194392800331116, -0.04145365580916405, 0.159330427...