text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
using the flex SDK 3.2.0 and 3.3.0 under linux and windows. Have you seen this type of behavior? Can you offer any suggestions for why it might be happening, or how to determine what is wrong? ``` TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.managers::FocusManager/activ...
[ 0.2991017699241638, -0.18841318786144257, 0.3048992156982422, -0.029060063883662224, -0.10451266169548035, -0.009221818298101425, -0.08740083873271942, -0.23745717108249664, -0.5818967223167419, -0.6215492486953735, -0.3371058404445648, 0.6737340092658997, -0.42931023240089417, -0.24359220...
I'm making asynchronous web service calls from a C# app: ``` { //Put UI in 'loading' state ... //Now call web service webServiceProxy.BeginMyMethod(param, new AsyncCallback(MyCallback), null); } private void MyCallback(IAsyncResult res) { ... //process result // Put UI back in normal state (yes I'm...
[ 0.11196566373109818, 0.011443471536040306, 0.7581393122673035, -0.027918389067053795, 0.1779778003692627, 0.21655672788619995, 0.4340690076351166, -0.10871376842260361, -0.3241095244884491, -0.7394098043441772, -0.3398092985153198, 0.6854332089424133, -0.46350887417793274, 0.24004806578159...
(there's quite a bit there), but my question to the community here is this: Is "MyCallback" GUARANTEED to be called? Presuming that "BeginMyMethod" didn't throw an exception, can I be sure that MyCallback will be executed? I'm seeing a "CompletedSynchronously" and "IsCompleted" on the IAsyncResult returned by the Begi...
[ 0.08531031012535095, -0.07844734191894531, 0.4553862512111664, -0.06147342175245285, 0.04405839741230011, -0.34882625937461853, 0.36713430285453796, 0.21419663727283478, 0.082955501973629, -0.234173983335495, -0.4053601026535034, 0.7172961831092834, -0.07891827076673508, 0.0496322251856327...
callback), however. It is how the asynchronous method signals an exception that may have occurred during the call, for one thing, as well as the way to get a result out (if any). Coding the asynchronous pattern using anonymous delegates when using C# 2.0 is sometimes more elegant, and permits writing of the post-call ...
[ -0.21150092780590057, -0.2501407861709595, 0.33512794971466064, -0.05747126042842865, -0.08080023527145386, -0.22823049128055573, 0.22449369728565216, -0.3331831097602844, -0.26298364996910095, 0.05793072655797005, -0.5696201324462891, 0.601498007774353, -0.36462128162384033, 0.01001198869...
the operation completes. Use one of the following options to continue executing instructions while waiting for an asynchronous operation to complete: > > > * Use an AsyncCallback delegate to process the results of the asynchronous operation in a separate thread. This approach is demonstrated in this topic. > > > [....
[ 0.08080001175403595, -0.20429079234600067, 0.27625054121017456, 0.20179098844528198, 0.095425084233284, -0.10484597086906433, 0.432873010635376, -0.2211911827325821, -0.35343602299690247, -0.27183932065963745, -0.38850921392440796, 0.3520790934562683, -0.03198262304067612, 0.10861203074455...
I have a program where an array gets its data using string.Split(char[] delimiter). (using ';' as delimiter.) Some of the values, though, are null. I.e. the string has parts where there is no data so it does something like this: > 1 ;2 ; ; 3; This leads to my array having null values. How do I get rid of them? Try ...
[ 0.1782638430595398, -0.23092308640480042, 0.03775704279541969, -0.06823994219303131, 0.025605076923966408, -0.09693489223718643, 0.33058205246925354, -0.3219528794288635, -0.23337003588676453, -0.41449278593063354, -0.09237661212682724, 0.38745471835136414, -0.308064728975296, 0.2132569551...
I have the following settings: Web.config Authentication Mode = "Windows" Virtual Directory -> Enable anonymous access - UNCHECKED -> Integrated Windows authentication - CHECKED When a user goes to the default page on the intranet, he gets prompted to enter the user name and password even though he has already been...
[ 0.08222440630197525, 0.16964617371559143, 0.5463786721229553, 0.04766625538468361, 0.203445702791214, -0.34151461720466614, 0.5237550735473633, -0.14766618609428406, -0.08935245871543884, -0.8319178819656372, -0.06807651370763779, 0.5173190832138062, -0.09076053649187088, 0.010596022941172...
the forms username and password and lets the user log in - I am using User.Identity.Name to get the windows user name to do a mapping \*\* Also make sure that when you are viewing the site in Internet Explorer that the zone in the status bar says "Intranet Zone". Otherwise it won't log you in by default.
[ 0.14424479007720947, -0.02578071691095829, 0.6186966300010681, 0.12439246475696564, 0.3186580240726471, -0.5468608140945435, 0.1736316829919815, 0.1383465677499771, -0.12326046079397202, -1.3048244714736938, -0.03520159050822258, 0.19516621530056, -0.031176388263702393, -0.0035073391627520...
How could I integrate Spring with Hibernate using sql server 2005 and have Unicode support. I tried many different ways but I just couldn't get it to work. Column in the table is nvarchar, character set in Spring is UTF-8. I can read Unicode text (which I added myself using the sql server management tool) just fine bu...
[ -0.3893548548221588, -0.22876574099063873, 0.5743762850761414, -0.23067806661128998, -0.5321812629699707, 0.35279810428619385, 0.32454949617385864, -0.4931560754776001, -0.3580597937107086, -0.5390834808349609, -0.007782012689858675, 0.3963572382926941, -0.30541470646858215, -0.27498218417...
some good soul who succeeded in doing so, and can help? Many thanks! It seems that you need to change the **response and the request** encoding in the filter to UTF-8 and all is good!
[ 0.46458572149276733, 0.18260905146598816, 0.49501585960388184, -0.014921995811164379, -0.07070091366767883, -0.10264118015766144, 0.5303807258605957, 0.23035475611686707, -0.10465019941329956, -0.6979296207427979, -0.3271630108356476, 0.5622037053108215, 0.06133091077208519, 0.015134493820...
I am maintaining an application that has classes (written in 2005) that extend *javax.xml.messaging.JAXMServlet*. While upgrading to a new app server that implements the latest J2EE standards, I discovered that *JAXMServlet* was removed in JWSDP 2.0 (Java Web Services Developer Pack), according to [this question](http:...
[ 0.17935635149478912, 0.30210310220718384, 0.2911727726459503, -0.1878807246685028, -0.06531025469303131, -0.21046459674835205, 0.4937053322792053, -0.07981028407812119, -0.12018795311450958, -0.4561189115047455, -0.11865966767072678, 0.2868027091026306, -0.08391015231609344, 0.106809988617...
an 'easy' substitution for this class? Although Google has a lot of examples of using this code (dated from around 2003-2004), it is surprisingly mute about replacing it. Thanks. To answer my own question, found some replacement code at [http://www.java.happycodings.com/Java%5fUtil%5fPackage/code23.html](http://www.jav...
[ -0.001814199029468, 0.12370157241821289, 0.3300953507423401, -0.031031539663672447, -0.24631869792938232, 0.31721562147140503, 0.49719056487083435, -0.40264251828193665, -0.07941289991140366, -0.6634345650672913, -0.30978044867515564, 0.13828833401203156, -0.3957954943180084, -0.0341285876...
public static MimeHeaders getHeaders( HttpServletRequest req ) { Enumeration<String> en = req.getHeaderNames(); MimeHeaders headers = new MimeHeaders(); while( en.hasMoreElements() ) { String headerName = (String) en.nextElement(); String headerValue = req.getHeader( headerName ); ...
[ 0.30062273144721985, -0.185791477560997, 0.43998172879219055, -0.08479993045330048, 0.4101288318634033, 0.023383641615509987, 0.7600053548812866, -0.3574470579624176, 0.03515281528234482, -0.4708980321884155, -0.5007805824279785, 0.4462989568710327, -0.24883151054382324, 0.3752870261669159...
values.nextToken().trim() ); } } return headers; } /** * stuff the MIME headers into the HTTP response * @param headers the SAAJ MIME headers * @param res the Http servlet response */ public static void putHeaders( MimeHeaders headers, HttpServletResponse res ) { ...
[ 0.16601523756980896, -0.3033338487148285, 0.680963397026062, -0.056832052767276764, 0.10448800027370453, 0.2252379059791565, 0.5847899913787842, -0.6173221468925476, -0.37255269289016724, -0.5138458609580994, -0.5989556312561035, 0.29597383737564087, -0.003326165722683072, 0.14677467942237...
MimeHeader header = it.next(); String[] values = headers.getHeader( header.getName() ); if( values.length == 1 ) { res.setHeader( header.getName(), header.getValue() ); } else { StringBuffer concat = new StringBuffer();
[ 0.1931048482656479, -0.318989098072052, 0.5753008723258972, -0.14691050350666046, 0.5529975295066833, 0.004236164502799511, 0.7404839992523193, -0.33530136942863464, 0.1658111810684204, -0.31798866391181946, -0.40314382314682007, 0.5662893652915955, -0.355631023645401, 0.3303581476211548, ...
for( int i = 0; i < values.length; i++ ) { if( i != 0 ) { concat.append( ',' ); } concat.append( values[i] ); }
[ -0.16825486719608307, -0.06344248354434967, 0.6901068091392517, -0.46411028504371643, 0.10378611832857132, 0.4039812386035919, 0.3530374765396118, -0.549934983253479, 0.18764331936836243, -0.4825659394264221, -0.18267695605754852, 0.5229493975639343, -0.6554149389266968, 0.0722653418779373...
res.setHeader( header.getName(), concat.toString() ); } } } public static void attachBytes( SOAPMessage soapMessage, byte[] theBytes, String contentType ) throws SOAPException { AttachmentPart attachment = soapMessage.createAttachmentPart(); attachment.setContent( new ByteArrayInp...
[ -0.033185917884111404, 0.2015104442834854, 0.5118788480758667, -0.0925055518746376, 0.1471237689256668, 0.35451066493988037, 0.4837605953216553, -0.4977949857711792, 0.0017139615956693888, -0.5980262160301208, -0.35202527046203613, 0.8386606574058533, -0.34896764159202576, 0.42412725090980...
URL url = new URL( urlLocation ); AttachmentPart attachment = soapMessage.createAttachmentPart( new DataHandler( url ) ); attachment.setContentType( contentType ); soapMessage.addAttachmentPart( attachment ); } public static String getAttachmentReport( SOAPMessage soapMessage ) throws SOAPExc...
[ -0.21767042577266693, -0.04813758656382561, 0.839036762714386, -0.1900741159915924, -0.09485530108213425, 0.22778071463108063, 0.307127445936203, -0.6758692860603333, 0.09233095496892929, -0.635918140411377, -0.40005481243133545, 0.6047267913818359, -0.265065997838974, 0.34938135743141174,...
while( attachments.hasNext() ) { buf.append( "\n--------------------------------------------\n" ); AttachmentPart attachment = attachments.next(); buf.append( "\nContent Location: " + attachment.getContentLocation() ); buf.append( "\nContent Id: " + attachment.getContentId() ); b...
[ -0.42749691009521484, -0.3146919310092926, 1.3231709003448486, -0.2087983936071396, 0.3054129481315613, 0.4479564130306244, 0.08039292693138123, -0.27147048711776733, -0.5443025827407837, -0.6070899367332458, -0.643291175365448, 0.2847258150577545, -0.2625850439071655, 0.1335107982158661, ...
} } ```
[ 0.17493881285190582, 0.41805654764175415, 0.05209751054644585, -0.04864929988980293, 0.437467485666275, -0.15825650095939636, 0.13202530145645142, 0.5446501970291138, 0.35430577397346497, -0.4846813380718231, -0.2295716553926468, 0.546978771686554, -0.3188462555408478, 0.2798506021499634, ...
I'd like to figure out a way to get to the HTML result (mentioned further below) by using the following Ruby code and [Nokogiri](http://github.com/tenderlove/nokogiri/tree/master): ``` require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) "<html> <body> <p id='1'>A</p> <p i...
[ 0.13557912409305573, 0.10187585651874542, 0.5756397247314453, 0.1294514536857605, -0.15674012899398804, 0.031324487179517746, 0.0488605871796608, -0.6802877187728882, 0.03901184722781181, -0.5509406924247742, -0.13340851664543152, 0.1294434815645218, -0.2854253351688385, 0.0404052697122097...
that need to be enclosed by the <div> selected = ["2","3","4"] first_p = selected.first last_p = selected.last # # WHAT RUBY CODE DO I NEED TO INSERT HERE TO GET # THE RESULTING HTML AS SEEN BELOW? # ``` The resulting HTML should look like this (please note the inserted `<div id='XYZ'>`): ``` <html> <body> <p...
[ 0.0059468406252563, 0.11584997922182083, 0.5706889629364014, 0.10516137629747391, 0.17658428847789764, 0.124945268034935, -0.012404835782945156, -0.5100308060646057, -0.06474772095680237, -0.8185392022132874, -0.32121357321739197, 0.26745980978012085, -0.20121893286705017, -0.2168784290552...
my project (Vlad@SO & Whitelist@irc#rubyonrails: Thanks for your help and inspiration.): ``` require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) "<html> <body> <p id='1'>A</p> <p id='2'>B</p> <h1>Bla</h1> <p id='3'>C</p> <p id='4'>D</p> <p id='5'>E...
[ 0.5467684268951416, -0.005812073592096567, 0.41381487250328064, 0.2213316112756729, -0.1484987884759903, 0.06075531616806984, 0.3612349331378937, -0.5602952241897583, 0.1725369691848755, -0.6618525385856628, -0.17647136747837067, -0.02945258654654026, -0.226791113615036, -0.085798129439353...
elements, not nodesets! # .first returns Nokogiri::XML::Element instead of Nokogiri::XML::nodeset first_p = value.css("p##{selected.first}").first last_p = value.css("p##{selected.last}").first parent = value.css('body').first # build and set new div_node div_node = Nokogiri::XML::Node.new('div', value) div_node['clas...
[ -0.16999803483486176, -0.3430669903755188, 0.19428275525569916, 0.17739668488502502, 0.034913379698991776, 0.34009841084480286, -0.015986504033207893, -0.7255970239639282, -0.11136862635612488, -0.5599650740623474, -0.20930126309394836, 0.09919513761997223, -0.2250986099243164, 0.203188568...
I should have paid more attention in relational databases class, so I need some help. I have a table structured like so (there's more, but I'm only posting relevant info): ``` +------------------+-------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default ...
[ -0.2961098551750183, 0.3771795928478241, 0.10005676746368408, -0.10586056858301163, -0.015064267441630363, -0.35213178396224976, 0.5462237000465393, -0.06953801214694977, -0.24679285287857056, -0.29785820841789246, -0.07559134811162949, 0.708446204662323, -0.24103334546089172, 0.1964359283...
| | | file | varchar(30) | NO | | NULL | | | access_time | timestamp | NO | | CURRENT_TIMESTAMP | | +------------------+-------------+------+-----+-------------------+-------+` ``` I want to select the `file` field of the record with the
[ -0.10621724277734756, 0.24856558442115784, 0.24310725927352905, -0.004105936270207167, 0.4815933406352997, -0.054437216371297836, -0.06461547315120697, -0.15146999061107635, -0.23507753014564514, -0.42906472086906433, -0.06121090427041054, 0.7099865078926086, -0.31667986512184143, 0.396896...
greatest `access_time` for each `session_id`. So pretty much the last page visited in each session. I've tried countless combinations of DISTINCT and the GROUP BY clause, but I can't seem to wrap my head around it for some reason. I'm using MySQL. Help please. I know this will work in SQL Server, and it should port to...
[ -0.2343551218509674, 0.2856934368610382, 0.4865759015083313, -0.13966356217861176, -0.021116502583026886, -0.18285459280014038, 0.26171496510505676, -0.22022390365600586, -0.392535924911499, -0.9680627584457397, -0.09415628015995026, 0.6650068163871765, -0.003035765839740634, 0.32107481360...
When an object that is created within a function and the function is completed, what happens to the object if it wasn't explicitly destroyed? Do all variables need to be destroyed when they fall out of scope or are they taken care of when they fall out of scope? So for example, what happens to locallist after custom\...
[ 0.19381150603294373, -0.1263108104467392, 0.2872921824455261, -0.17212170362472534, 0.25406819581985474, -0.3366870582103729, 0.5159815549850464, -0.1387758105993271, -0.2741576135158539, -0.5488548278808594, -0.44218742847442627, 0.6029525399208069, -0.3688333034515381, 0.2601456940174103...
need to test later if the object has been freed, then use FreeAndNil(myObject). It will set the variable to nil as well, so you can test it later.
[ 0.19898800551891327, -0.3159272372722626, 0.049042098224163055, 0.09463007748126984, 0.0757124051451683, -0.41627421975135803, 0.14254873991012573, 0.10219135880470276, 0.030147381126880646, -0.6108332872390747, -0.12082125246524811, 0.5753682851791382, -0.3101721704006195, 0.2587945759296...
What is a good Perl module (or good approach) that returns all the valid calendar dates between a start date and an end date? For example, if I have 1/29/2009 as a start date and 2/3/2009 as an end date then I would like it to return an array of 1/30/2009, 1/31/2009, 2/1/2009, and 2/2/2009. There must be a good Perl m...
[ 0.032784972339868546, -0.17795364558696747, 0.8226078152656555, 0.09743548929691315, -0.27836498618125916, 0.16137389838695526, 0.26019635796546936, 0.03337117284536362, -0.4729945957660675, -0.07176483422517776, 0.09719419479370117, 0.11575305461883545, -0.06240728870034218, 0.12192468345...
using the ParseRecur function to do what you want: ``` #!/usr/bin/perl use warnings; use strict; use Date::Manip; use Data::Dumper; my ($start, $end) = qw(2009-01-29 2009-02-03); # Exclude start date $start = DateCalc($start, "+1 day"); # y:m:w:d:h:m:s my @dates = ParseRecur('0:0:0:1:0:0:0', $start, $start, $end);...
[ -0.00593092106282711, 0.11687631905078888, 0.8100038766860962, -0.38797247409820557, 0.1914946287870407, 0.0001543076359666884, 0.3490638732910156, 0.10388346761465073, 0.022927317768335342, -0.308343768119812, -0.4340898096561432, 0.3098045885562897, -0.2607397139072418, 0.352153182029724...
I have a variable containing html string. This string has this particular code ``` <a href="http://www.pheedo.com/click.phdo?s=xxxxxxxx&amp;p=1"><img border="0" src="http://www.pheedo.com/img.phdo?s=xxxxxxxxxx&amp;p=1" style="border: 0pt none ;" alt=""/></a> ``` Using regex, how can I remove that. Basically looking ...
[ 0.1384284645318985, 0.22853203117847443, 0.7866314053535461, -0.12772968411445618, -0.12747162580490112, -0.019984835758805275, 0.06898300349712372, -0.2623611390590668, 0.036361631006002426, -0.49792271852493286, 0.1291763335466385, 0.1646924912929535, -0.2768910825252533, 0.5064783096313...
There's a name for this, but I don't know what it is so it's hard to google. What I'm looking for is something in the java concurrency utilities, which is a pair of queues, an "pending" queue used by a producer, and a "processing" queue used by a consumer, where the consumer can swap the queues atomically. If used in ...
[ 0.6098899841308594, -0.23345667123794556, 0.13723239302635193, 0.20127487182617188, -0.011985781602561474, 0.2573504149913788, -0.2843227982521057, 0.11734792590141296, -0.4500325918197632, -0.46764689683914185, 0.30613046884536743, 0.19800926744937897, -0.28360939025878906, 0.553517520427...
it exists already I'd rather use that. **edit:** I guess the primitive I'm looking for is a pair of atomic references that can be atomically swapped. (& I can add the queues myself.) --- **edit 2:** @Alex Miller answered the nagging question of what it was that I was thinking of but couldn't remember. However that d...
[ 0.8185454607009888, 0.12602448463439941, -0.12615866959095, 0.31388455629348755, 0.025455713272094727, 0.023010728880763054, 0.0015479993307963014, 0.15035510063171387, -0.3835327625274658, -0.4313763678073883, 0.3562844395637512, 0.3852047622203827, -0.33796995878219604, 0.094169393181800...
those queue items have to be complete and the producer can't add any items afterwards; the producer now has to add items to the other queue. So the paired/swapped set of atomic references won't work. (It's sort of like if there are 2 school buses, one of which is always waiting for passengers and the other is always d...
[ 0.5420140027999878, -0.0010981862433254719, 0.33296194672584534, 0.5787933468818665, 0.03926371783018112, 0.19225485622882843, -0.17432960867881775, 0.08899565786123276, -0.44482678174972534, -0.4188655614852905, 0.2768877148628235, 0.01462361216545105, -0.29049697518348694, 0.587731003761...
a single [ConcurrentLinkedQueue](http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html) and have a sentinel value that the consumer adds to the queue. This allows there to be multiple producers, not just 1. In order for the consumer to process batches of items on the queue, the consume...
[ 0.3965161442756653, -0.23987315595149994, 0.5323398113250732, 0.23680368065834045, -0.29404181241989136, 0.41044881939888, -0.012027055025100708, 0.043064042925834656, -0.642471432685852, -0.4444694221019745, 0.13550397753715515, -0.05628430098295212, -0.267838716506958, 0.8350586295127869...
options), but if there's an easy way to architect it so that it is, that's preferred in my application. [Exchanger](http://java.sun.com/javase/6/docs/api/java/util/concurrent/Exchanger.html)?
[ 0.16305528581142426, 0.016051936894655228, 0.5728886723518372, -0.13533847033977509, 0.050040774047374725, 0.1653001457452774, 0.1320216804742813, 0.023678483441472054, -0.3065415918827057, -0.3206661343574524, -0.1295720487833023, 0.2680182158946991, -0.3934483528137207, -0.05115045234560...
I removed 777 files which were in Git's branch *newFeature* by ``` rm !(example) ``` I would like to commit. Git ask me to manually remove each of the removed files by ``` git rm file ``` It would take a lot of time to write the above command for all 777 files which names are not similar. **How can I remove the...
[ 0.3641034662723541, 0.13076531887054443, 0.636711835861206, -0.28671976923942566, -0.005916887894272804, -0.15316663682460785, 0.17701396346092224, -0.18048129975795746, -0.43631112575531006, -0.4622693359851837, -0.4052967429161072, 0.7265531420707703, -0.46709322929382324, 0.195156723260...
modified content for commit and marking deleted files for removal. This is similar to what "`git commit -a`" does in preparation for making a commit, except that the update is limited to paths specified on the command line. If no paths are specified, all tracked files in the current directory and its subdirectori...
[ 0.12147581577301025, -0.08630158752202988, 0.6575946807861328, -0.26380932331085205, -0.04872899129986763, 0.01874518021941185, 0.42762893438339233, -0.12589162588119507, -0.30283036828041077, -0.40865859389305115, -0.3498382568359375, 0.39704272150993347, -0.5225535035133362, 0.1997246444...
| cmd ``` But `git add -u` is the main porcelain way to do it.
[ -0.043916020542383194, 0.5609800219535828, 0.43419575691223145, -0.04940442740917206, -0.08911216259002686, 0.37360987067222595, 0.00833089742809534, 0.18112824857234955, -0.11797777563333511, -0.4383451044559479, -0.25777468085289, 0.05798311531543732, 0.21097472310066223, 0.4355679452419...
I know asp.net and winform development. I am not the type of developer who jumps into a new technology just because it's new. It needs to give me extra benefits like higher productivity. What are the advantages of WPF over Winforms for pure business apps? I am not interested in the extra eye candy, animation, gradient...
[ 0.6371924877166748, -0.019984526559710503, 0.41570281982421875, 0.2380148321390152, -0.21193477511405945, -0.19722722470760345, 0.013726752251386642, -0.1356726586818695, -0.20457051694393158, -0.7692845463752747, 0.18001310527324677, 0.5819681882858276, 0.04751090705394745, -0.07653252780...
like the fact I can do everything in Visual Studio vs multiple IDE's for WPF (VS & Blend family). Plus I think WPF doesn't have as rich data binding controls like their Winform counterparts (DataGridView..etc). AFAIK, Microsoft will still support Winforms for many years. Try to convince someone like me to switch. > I ...
[ 0.5982675552368164, -0.23436802625656128, 0.31097760796546936, 0.2224959135055542, -0.2857763469219208, -0.38330405950546265, -0.006440315395593643, -0.16797462105751038, -0.17667922377586365, -0.9146286845207214, 0.23942071199417114, 0.691994309425354, 0.013255327939987183, 0.070091016590...
recently released a mid-sized app in 32 man days. We had the advantage of an experienced WPF developer on the team, and inexperienced guys who were eager to learn the technology. There was great morale, and productivity was impressive. > WinForm is a mature proven technology and I like the fact I can do everything in...
[ 0.5210170745849609, -0.3554043769836426, 0.47618088126182556, 0.11268682777881622, -0.10637984424829483, 0.03517132252454758, -0.08237578719854355, -0.23109100759029388, -0.13653309643268585, -0.7867233157157898, 0.16941222548484802, 0.6925495266914368, 0.17067381739616394, -0.112223722040...
2010? I work almost exclusively in XAML. Most WPF'ers will probably agree that this is the most effective way of creating WPF applications at the moment. But then, I also craft my HTML by hand, so it feels natural to me... > What are the advantages of WPF over Winforms for pure business apps? I am not interested in th...
[ 0.5105182528495789, 0.148469015955925, 0.3944258987903595, 0.18819372355937958, -0.31503087282180786, 0.09453185647726059, 0.15492098033428192, 0.10076585412025452, -0.1975928395986557, -0.5388291478157043, 0.09530805051326752, 0.38353297114372253, -0.17846542596817017, -0.2235522568225860...
the user experience. Why should business apps be Battleship Grey? Why should they be unusable? Granted, it isn't color, gradients, animation that makes a business app usable, but using these effects can help the user experience, and this is what is important to me. I could have done everything I did in the WPF app in W...
[ 0.47505801916122437, -0.00662991963326931, 0.273721843957901, 0.2846262753009796, 0.06046750396490097, -0.13782452046871185, 0.12096015363931656, 0.014488550834357738, -0.18751688301563263, -0.6508963704109192, 0.10269588977098465, 0.7574704885482788, -0.08369673043489456, 0.08889261633157...
I am not going to try and convince anyone else to switch to WPF. The developers I have tried to "convince" (all experienced Winforms developers) usually have struggled with the platform. They are not invested in the technology. They don't "get it". I encourage people to check out the technology to see if it is right fo...
[ 0.6793201565742493, 0.12182644754648209, 0.2040272206068039, -0.0033219975885003805, -0.040535811334848404, -0.5165280103683472, 0.3371640145778656, -0.08859719336032867, -0.04094664007425308, -0.7105014324188232, -0.1207200363278389, 0.7372047901153564, 0.08425074070692062, -0.02281583845...
or [this](https://stackoverflow.com/questions/7837/what-real-world-wpf-applications-are-out-there) post. Forget everything you know about WinForms. WPF really seems closer to ASP than WinForms. Create some sample applications. See if it works for you and your team. As you are multi-skilled (asp.net/winform skills), yo...
[ 0.6239680647850037, -0.17395706474781036, 0.30137327313423157, 0.10650382190942764, -0.1525610387325287, -0.39931052923202515, 0.006067938171327114, -0.24741271138191223, -0.28567495942115784, -0.6614354848861694, 0.14103758335113525, 0.5888769626617432, 0.2451404184103012, -0.202211812138...
Code styling question here. I looked at [this](https://stackoverflow.com/questions/268393/initializing-field-by-default-value-is-redundent) question which asks if the .NET CLR will really always initialize field values. (The answer is *yes*.) But it strikes me that I'm not sure that it's always a good idea to have it...
[ 0.022783370688557625, -0.003419032320380211, 0.26619747281074524, -0.15172159671783447, -0.13845078647136688, -0.07889451831579208, 0.1090344488620758, -0.17745952308177948, -0.12239494919776917, -0.3368821442127228, -0.1282702088356018, 0.7993953824043274, 0.03695102408528328, -0.26149967...
is a legal or reasonable value. And if the programmer just starts reading and modifying it, I don't know whether the programmer meant to start using it before they set a value to it, or if they were expecting it to be zero, etc. On the other hand, some fairly smart people, and the Visual Studio code cleanup utility, t...
[ 0.546668291091919, 0.5451400876045227, -0.11273236572742462, 0.13252103328704834, 0.014415840618312359, -0.3705328702926636, 0.3632628917694092, 0.05640597268939018, -0.17120932042598724, -0.0025535165332257748, -0.12018731981515884, 0.6972288489341736, -0.11057054996490479, -0.11503972858...
grain for a particular language, that's probably worth pointing out. **EDIT**: While I did put that this question was language agnostic, it obviously doesn't apply to languages like C, where no value initialization is done. **EDIT**: I appreciate John's answer, but it is exactly what I'm **not** looking for. I unders...
[ 0.35838133096694946, 0.5057786107063293, -0.10373331606388092, 0.03471915051341057, -0.1862763911485672, 0.1861516833305359, 0.3024776875972748, 0.07249424606561661, -0.121724434196949, -0.5085907578468323, 0.42783623933792114, 0.5302518606185913, 0.018002701923251152, -0.10084103792905807...
it to be the default value, or just forgot to set the value, or was expecting it to be set somewhere else, etc. Think long term maintenance. * Keep the code as explicit as possible. * Don't rely on language specific ways to initialize if you don't have to. Maybe a newer version of the language will work differently? *...
[ 0.3836096525192261, 0.2003306746482849, -0.004767542704939842, 0.21111595630645752, 0.06701206415891647, -0.12264665216207504, 0.6395237445831299, 0.3116001486778259, 0.08349324762821198, -0.6507569551467896, -0.24050380289554596, 0.8735843896865845, 0.0529918298125267, -0.2782954275608063...
I have an Access application with a SQL server back-end, mixed with quite a few DB objects local to the Access app. I've tried running SQL Profiler, but I got very little except a cryptic sp\_execute 2,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297. I would like a trace tool that is local to the Access DB, so I als...
[ 0.2706219255924225, 0.42710065841674805, 0.0675850361585617, 0.0935642346739769, 0.04173402860760689, 0.17285415530204773, 0.34413713216781616, 0.38916927576065063, -0.32854217290878296, -0.5307851433753967, 0.1494724154472351, 0.36039695143699646, -0.39382675290107727, 0.3606574833393097,...
`OpenRecordset` etc within your VBA to an alternative version that would log the query. This isn't going to catch everything obviously but it could help. * Move your local tables to another database and use ODBC to relink them to your original Access application. You can then use [ODBC's logging facilities](http://p...
[ 0.1546568125486374, 0.15654116868972778, 0.4037404954433441, 0.07900699973106384, -0.22616185247898102, -0.32270437479019165, 0.4090808629989624, 0.0341949462890625, -0.4975297749042511, -0.6403157711029053, -0.10596445202827454, 0.2860044240951538, -0.5384722948074341, 0.23745815455913544...
and ISAMStats](http://msdn.microsoft.com/en-us/library/aa188211.aspx#odc_4009c15_topic4) to [view how Jet/ACE interprets](https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5064388.html) your queries and get other database activity stats. It's easy to setup by writing a key to the r...
[ 0.3523607850074768, -0.13045677542686462, 0.5043267011642456, 0.5523164868354797, 0.16425222158432007, -0.3259110152721405, 0.07656988501548767, -0.3051690459251404, -0.2004309743642807, -0.5381691455841064, -0.04177669808268547, 0.611576497554779, -0.395097553730011, 0.03792261704802513, ...
I'm planning on taking the time to actually learn Ruby on Rails in-depth (I've previously done some very minor dabbling with it) so I can hopefully reinvent myself as a Rails developer. The issue I run into though is that there are a fair bit of related technologies that are currently used in the Rails community, and ...
[ 0.6955956816673279, -0.07063060253858566, -0.32692644000053406, 0.13553418219089508, -0.23534457385540009, -0.07484491169452667, 0.4132690131664276, 0.22669246792793274, -0.34707340598106384, -0.3884133994579315, 0.3391294479370117, 0.6510739326477051, 0.3060029447078705, 0.058002065867185...
learn either). * Testing. I've wanted to learn test driven development for a while now, but the "next big thing" in Rails-land seems to be behavior driven development with **RSpec** * Javascript. I'm not sure if I should stick with **RJS** or use something like **jQuery** which seems to be converting people. * I've nev...
[ 0.3907582759857178, -0.14466936886310577, 0.055805809795856476, 0.23852218687534332, -0.2617587149143219, -0.2547835111618042, 0.5521914958953857, 0.2680263817310333, -0.052836522459983826, -0.9118075966835022, 0.23444166779518127, 0.7722063064575195, -0.029870707541704178, -0.040647868067...
I've written an application or three (e.g. core, unmodified Rails; RJS w/Prototype and Scriptaculous for Ajax, regular Test::Unit for testing, ERB for templating, Git for version control), or should I try to pick up some of the variants along the way? I've been a full time rails developer for over a year now and what y...
[ 0.49672260880470276, 0.15405209362506866, 0.011298878118395805, -0.08953887224197388, -0.2006317526102066, 0.02702232263982296, 0.32682326436042786, 0.20151293277740479, -0.14882290363311768, -0.8217878937721252, 0.1796373426914215, 0.5299656987190247, 0.15913669764995575, -0.3160413503646...
in the framework alone. I would consider ignoring RJS as I feel like it's going out of "fashion" as developers trend towards jQuery. Regular Test::Unit is great, although I like to add thoughtbot's Shoulda to provide some testing macros that save a whole lot of time (consider ignoring all the Shoulda context stuff tho...
[ 0.3834322988986969, -0.26890575885772705, -0.01710604690015316, 0.24110540747642517, -0.5363540649414062, -0.47995659708976746, 0.47386857867240906, -0.1660463958978653, 0.06294077634811401, -0.7112482786178589, -0.0054720561020076275, 0.6604415774345398, 0.1250275820493698, -0.18101966381...
I'm building a custom control in Silverlight by deriving from ContentControl and doing some special formatting to put a dropshadow behind the contents. I've nearly got it working but have recently ran into a bizarre error. It works fine if it contains anything besides a Border, or a Grid/Stackpanel/etc that does not ...
[ 0.4062712788581848, -0.006570002995431423, 0.5631691813468933, 0.12373203039169312, 0.17387641966342926, -0.16695168614387512, 0.23760275542736053, -0.15004608035087585, -0.05225721001625061, -0.6777125000953674, 0.23191405832767487, 0.2049589306116104, -0.34601354598999023, 0.145645335316...
web about this error when too many textboxes are used (over 250), but I'm able to reproduce my error with a single button in a grid. I have no textboxes at all on the page. The error has to do with a detected infinite loop. I set a few breakpoints in the code and it seems that the "SizeChanged" event is getting calle...
[ 0.3479740023612976, 0.07398124784231186, 0.3252425789833069, 0.057266369462013245, 0.039717160165309906, 0.01143733598291874, 0.6806266903877258, 0.3099779486656189, -0.5821371078491211, -0.7268639206886292, 0.23328396677970886, 0.16972710192203522, -0.2040349543094635, 0.13446836173534393...
happening. Has anyone ran into this or have any ideas? There is a [good blog post on this error here](http://blog.jeffhandley.com/archive/2008/09/26/silverlight-2-post-beta2-gotcha---layout-cycle-detected.aspx). Bascially what can happen is you're changing some size in a `MeasureOverride` somewhere which causes anoth...
[ 0.13158632814884186, 0.19506889581680298, 0.28142720460891724, -0.12986129522323608, 0.17824609577655792, -0.2701294422149658, 0.41179126501083374, -0.09002114832401276, -0.6104706525802612, -0.7361761927604675, 0.20473907887935638, 0.14965473115444183, -0.4473189413547516, 0.1031871289014...
people are seeing. This error is something new that you might see when moving code from Beta 2 to the Release Candidate or later. In Beta 2, if the layout engine detected a cycle, it didn't throw any errors; as I understand it, the layout was just aborted. But with post Beta2 bits, an error is thrown. > > > The error...
[ 0.5429180860519409, 0.08328955620527267, 0.18664048612117767, -0.15748631954193115, -0.08277226239442825, -0.0561097115278244, 0.38318783044815063, 0.2327466756105423, -0.4741216003894806, -0.8408032655715942, 0.1816329061985016, 0.51738440990448, -0.47030335664749146, 0.3249525725841522, ...
> The biggest culprit that leads to this error is code within the LayoutUpdated event handler. If your LayoutUpdated event handler does anything to alter the layout of your control, then that will cause the LayoutUpdated event to fire again, and again, and again... :-) > > > Sometimes you need to have layout altering...
[ 0.15100570023059845, -0.013634096831083298, 0.31227561831474304, -0.027971455827355385, 0.046252425760030746, -0.2046051323413849, 0.37975308299064636, -0.23086382448673248, -0.1549542397260666, -0.8221116065979004, 0.28651162981987, 0.7045361399650574, -0.48747390508651733, 0.127526894211...
Between these two events, you'll get notified when the control is loaded into the visual tree, and you'll get notified any time the host is resized, which could cause you to need to change your layout again. Scenarios like modal dialogs should fall into this category. > > > Second, if you really do need to use Layout...
[ 0.37160757184028625, -0.3703407049179077, 0.5025038719177246, 0.0543287917971611, 0.10340329259634018, -0.25344523787498474, 0.14533624053001404, -0.08990305662155151, -0.4795018136501312, -0.9611806869506836, 0.10855042189359665, 0.5617039799690247, -0.15929949283599854, 0.170862779021263...
what you calculated. This will allow the first LayoutUpdated event to resize your control, which triggers another LayoutUpdated event, but that event will recognize that there's no work to do, and the cycle will end. > > > These same rules will apply when you're handling the SizeChanged event, or if you're doing any ...
[ 0.24112702906131744, -0.3798215389251709, 0.42059218883514404, -0.03593572974205017, 0.21717578172683716, -0.005503250285983086, -0.035852670669555664, -0.4550693929195404, -0.5220334529876709, -0.5461382269859314, 0.20509910583496094, 0.454203724861145, -0.37286055088043213, 0.08566582947...
I am using the .alphanumeric plugin for jQuery which is certainly doing what I would expect as users type directly into the textbox. But, if a user were to copy and paste a value into the text box, all bets are off. ``` $("#<%= txtNumber.ClientID %>").alphanumeric({allow:"-"}); ``` I can certainly do this: ``` $(do...
[ -0.02675013057887554, 0.06491658836603165, 0.8006572723388672, -0.3450907766819, 0.13413414359092712, -0.14167213439941406, 0.15451917052268982, -0.12436661869287491, -0.020590204745531082, -0.8841283321380615, -0.2670549750328064, 0.776128888130188, -0.3999388813972473, 0.2130597531795501...
) ); }); }); //FUNCTION REMOVES ANY ; IN TEXT TO PREVENT SQL INJECTION function RemoveInvalidCharacters(text) { return text.replace(';', ''); } ``` But... I'd rather not have to kluge up my code even further with .blur() functions. Are there any other ways around this? Handling the paste event is fa...
[ -0.01326772291213274, -0.26850688457489014, 0.4568628668785095, -0.16368278861045837, 0.03429713100194931, -0.07810322195291519, 0.4403805136680603, -0.027088096365332603, -0.011308318004012108, -0.5831469893455505, -0.19737811386585236, 0.860262393951416, -0.41258659958839417, 0.038780614...
$.browser.msie ? 'paste' : 'input'; $("#<%= txtNumber.ClientID %>").bind(pasteEventName, function() { setTimeout(function() { RemoveInvalidCharacters( $("#<%= txtNumber.ClientID %>").val() ); }, 0); }); ```
[ -0.12611600756645203, -0.21334852278232574, 0.7652918100357056, -0.5536608695983887, 0.21690160036087036, 0.2784925401210785, 0.6450695991516113, -0.09757204353809357, -0.07961242645978928, -0.9312992691993713, -0.44980084896087646, 0.6167316436767578, -0.6203455924987793, 0.49476075172424...
I'm using [msys Git](http://code.google.com/p/msysgit/) for source control on a Windows machine and I'm trying to figure out how to get my merge tool, [WinMerge](http://winmerge.org/), to work with Git. I've followed [the instructions on this blog](http://davesquared.blogspot.com/2009/02/setting-up-diff-and-merge-tool...
[ 0.2159927934408188, 0.1952192783355713, 0.28233450651168823, -0.26965218782424927, 0.13976392149925232, -0.20046429336071014, 0.3654910922050476, 0.014969565905630589, 0.057890884578228, -0.6486610174179077, -0.18827205896377563, 0.7087658047676086, -0.3423611521720886, 0.14895255863666534...
= false ``` This is almost working. When I try to run the merge tool from Git, WinMerge gives me an error saying it can't find the paths of the files, which makes complete sense since the paths it is looking for are: ``` C:\MY\WORKING\DIRECTORY\-e C:\MY\WORKING\DIRECTORY\-ub ``` It looks like Git is passing optio...
[ 0.2087402641773224, 0.15499763190746307, 0.18113239109516144, -0.18402260541915894, 0.10558261722326279, -0.17652137577533722, 0.5809186100959778, -0.1477881222963333, -0.05878254398703575, -0.9473369717597961, -0.0712326318025589, 0.39873969554901123, -0.4298393130302429, 0.12483396381139...
of the following: 1. Change the `$LOCAL` & `$REMOTE` variables to the correct values, assuming `$LOCAL` & `$REMOTE` are incorrect. 2. Write a `.bat` script to call WinMergeU, and handle the arguments Git sends to the merge tool within the logic of my `.bat` script. From [WinMerge Command line manual](http://winmerge.o...
[ -0.10775025188922882, -0.013086280785501003, 0.487810879945755, -0.36048999428749084, -0.0712491050362587, 0.019690196961164474, 0.10175585746765137, -0.41182941198349, -0.09549616277217865, -0.686451256275177, -0.3871031403541565, 0.6936628818511963, -0.3939412236213684, -0.09441522508859...
`mergetool` with your custom `diff` tool: ``` C:\myGitRepo>git config --global merge.tool winmerge C:\myGitRepo>git config --global mergetool.winmerge.cmd "winmerge.sh \"$LOCAL\" \"$REMOTE\"" C:\myGitRepo>git config --global mergetool.prompt false ``` With `winmerge.sh` stored in a directory part of your `PATH`: ``...
[ -0.040306977927684784, -0.09010598063468933, 0.4578925371170044, -0.28695574402809143, 0.08848647773265839, -0.06087714806199074, 0.15514302253723145, -0.09713943302631378, 0.07458670437335968, -0.9629878401756287, -0.4440460801124573, 0.7505246996879578, -0.30360108613967896, 0.0931131243...
When I'm writing a function in a utility module to be used again, I tend to leave lots of comments at the top of functions and some simple input checks to throw up a message in the debugger if a function is used inappropriately, w/o simply using a throw command. What's the best methodology of handling such situations?...
[ 0.44587647914886475, 0.27781248092651367, -0.39664313197135925, -0.2926385998725891, -0.5533455610275269, -0.21747764945030212, 0.38020002841949463, -0.3439975082874298, -0.05523116514086723, -0.49233928322792053, 0.05530828610062599, 0.641059160232544, -0.15254105627536774, -0.11975519359...
methods, throwing up a MessageBox.Show("...") to clarify why a function is returning prematurely or a Console.WriteLine("...") to have it explained only in the debug console. I'm currently leaning toward writing a custom ErrorMessage function that would check the build type and possibly a #define master toggle before ...
[ 0.23116660118103027, 0.06706102937459946, -0.1653166115283966, -0.0817645862698555, -0.22645536065101624, -0.16209007799625397, 0.48971739411354065, -0.32602009177207947, -0.14970096945762634, -0.48937395215034485, 0.004748952575027943, 0.49266791343688965, -0.43828895688056946, 0.18220505...
currently due to the state of the object then it should throw an InvalidOperationException. Other people calling your library will not thank you for doing things in a non-standard or a non-obvious manner. Such as showing message boxes. Especially if they are calling your library from a web site or a windows service th...
[ 0.5076062679290771, -0.011733205057680607, 0.33337053656578064, 0.36377283930778503, -0.4356178939342499, -0.5422394871711731, 0.505216121673584, 0.08386269956827164, -0.3396517336368561, -0.5375701785087585, -0.2585963010787964, 0.04176363721489906, -0.1488599330186844, 0.4899249374866485...
Can anyone tell me why this isn't working? ``` function changeBG(element_id){ document.getElementById(element_id).className= "arrowActive"; setTimeout("document.getElementById("+element_id+").className= 'arrow'", 300); } ``` In firebug I get an error saying that the element\_id passed to setTimeout()...
[ -0.03959548473358154, 0.21581028401851654, 0.6000899076461792, -0.34857067465782166, 0.1767285019159317, -0.14770449697971344, 0.522124707698822, -0.5222145915031433, 0.11622223258018494, -0.5864812135696411, -0.22651205956935883, 0.6591196656227112, -0.3325463831424713, 0.0764706358313560...
setTimeout(function() { elm.className= 'arrow'; }, 300); } ``` It should be noted that passing the code in a a string is [not recommended](https://developer.mozilla.org/En/DOM/window.setTimeout).
[ 0.4035148620605469, -0.39742833375930786, 0.5376901030540466, -0.22849972546100616, 0.23239392042160034, -0.17402209341526031, 0.4954330623149872, -0.3566112220287323, 0.05101785808801651, -0.5358205437660217, -0.5227242708206177, 0.5918152332305908, -0.5594637393951416, -0.055281944572925...
Since I've started using rspec, I've had a problem with the notion of fixtures. My primary concerns are this: 1. I use testing to reveal surprising behavior. I'm not always clever enough to enumerate every possible edge case for the examples I'm testing. Using hard-coded fixtures seems limiting because it only tests m...
[ 0.8308512568473816, 0.388027161359787, 0.11603367328643799, -0.1024060845375061, 0.18396435678005219, -0.23230309784412384, 0.11496944725513458, -0.2688613533973694, 0.025557486340403557, -0.4586336612701416, 0.3388313949108124, 0.605877161026001, -0.1548011749982834, 0.04410219192504883, ...
is trying to demonstrate. For example: ``` describe Item do describe '#most_expensive' do it 'should return the most expensive item' do Item.most_expensive.price.should == 100 # OR #Item.most_expensive.price.should == Item.find(:expensive).price # OR #Item.most_expensive.id.should =...
[ 0.0773562639951706, 0.1910446137189865, 0.279146671295166, 0.07691819220781326, -0.04904603585600853, -0.031308613717556, 0.09537211805582047, -0.3266194462776184, 0.2963430881500244, -0.6145238876342773, -0.13319024443626404, 0.8965001702308655, -0.25101613998413086, 0.396353542804718, ...
fixture `:expensive` is the most expensive one listed in `fixtures/items.yml`. A careless programmer could break tests by creating an `Item` in `before(:all)`, or by inserting another fixture into `fixtures/items.yml`. If that is a large file, it could take a long time to figure out what the problem is. One thing I've...
[ 0.5506866574287415, -0.07424694299697876, 0.4684220552444458, 0.20080657303333282, 0.14701567590236664, -0.12740039825439453, -0.1923677921295166, -0.4166269898414612, -0.017824383452534676, -0.49314603209495544, 0.37246450781822205, 0.7259510159492493, -0.3042072653770447, 0.5554378032684...
=> params[:price] || rand(100) ) end end ``` (The specific details of how I do this are actually a bit cleaner. I have a class that handles the generation and cleanup of all models, but this code is clear enough for my example.) So in the above example, I might test as follows. A warning for the feint of heart:...
[ 0.19939978420734406, -0.03353874757885933, 0.34874382615089417, 0.04798584431409836, 0.006309716496616602, -0.046531014144420624, 0.15365242958068848, -0.7388637661933899, -0.14816083014011383, -0.6360282897949219, 0.18144898116588593, 0.7294907569885254, -0.01808188110589981, 0.4203040897...
@items << Item.generate_random({:price => 50}) end it 'should return the most expensive item' do sorted = @items.sort { |a, b| b.price <=> a.price } expensive = Item.most_expensive expensive.should be(sorted[0]) expensive.price.should >= 50 end end end ``` This way, my tes...
[ 0.08412761241197586, -0.18116049468517303, 0.2508131265640259, 0.1556629091501236, -0.1803627908229828, -0.2058023065328598, 0.3925277888774872, -0.40544891357421875, -0.1262178272008896, -0.5298864245414734, -0.0988086462020874, 0.617318868637085, -0.036708634346723557, 0.3329513669013977...
as expected, but which I wouldn't have caught if I were only using fixtures. For example, in the case of `#most_expensive`, if I forgot to handle the special case where multiple items share the most expensive price, my test would occasionally fail at the first `should`. Seeing the non-deterministic failures in AutoSpec...
[ 0.5517230033874512, -0.14780975878238678, 0.10668598860502243, 0.26793137192726135, -0.001867571729235351, -0.3255504071712494, 0.020353036001324654, -0.11116362363100052, -0.5406485199928284, -0.6565324068069458, 0.14274542033672333, 0.5855564475059509, -0.12714329361915588, 0.18874794244...
an array of items sorted in descending order by price. Since I expect `#most_expensive` to be equal to the first element of that array, it's even more obvious what the expected behavior of `most_expensive` is. So, is this a bad practice? Is my fear of fixtures an irrational one? Is writing a `generate_random` method f...
[ 0.8090388178825378, 0.030696233734488487, 0.11080528050661087, 0.24213849008083344, 0.1305607259273529, -0.15737244486808777, 0.06723377853631973, -0.4650701582431793, -0.15620239078998566, -0.44785335659980774, 0.3015136122703552, 0.8270177841186523, -0.22575150430202484, 0.17036405205726...
demonstrate. I agree. Ideally spec examples should be understandable by themselves. Using fixtures is problematic, because it splits the pre-conditions of the example from its expected results. Because of this, many RSpec users have stopped using fixtures altogether. Instead, construct the needed objects in the spec ...
[ 0.7185365557670593, 0.2989291548728943, 0.2965620458126068, 0.18895654380321503, -0.03148192539811134, -0.17254111170768738, 0.035844866186380386, -0.6923288702964783, 0.11607810109853745, -0.5265133380889893, -0.03262428939342499, 0.8319709300994873, -0.18618027865886688, 0.16098912060260...
for object creation, you should take a look at some of the many test object factory libraries, such as [factory\_girl](http://github.com/thoughtbot/factory_girl/), [Machinist](http://github.com/notahat/machinist/tree/master), or [FixtureReplacement](http://replacefixtures.rubyforge.org/).
[ 0.5671786069869995, -0.2846144139766693, -0.00855541042983532, 0.18351690471172333, 0.04157218337059021, 0.3299802541732788, 0.23863232135772705, -0.0929795354604721, -0.2958090305328369, -0.508441150188446, -0.04818282276391983, 0.21943756937980652, -0.3924531936645508, 0.0147355012595653...
How can I find out what caused equals() to return false? I'm not asking about a sure-way, always right approach, but of something to aid in the development process. Currently I have to step into the equals() calls (usually a tree of them) until one of them is false, then step into it, ad nauseam. I thought about usin...
[ 0.288729727268219, 0.1143445372581482, 0.0898301899433136, 0.05137970671057701, -0.22743302583694458, -0.10665373504161835, 0.34582486748695374, -0.18438422679901123, 0.09073447436094284, -0.7216689586639404, 0.18936389684677124, 0.39431896805763245, -0.22896067798137665, 0.141242429614067...
test area and using it there, but importing a whole jar for this just isn't going to happen. I also thought about building an object graph traverser myself, and I might still do it, but I'd hate to start dealing with special cases (ordered collections, non-ordered collections, maps...) Any idea how to go about it? E...
[ 0.5643619298934937, 0.17857128381729126, 0.07654782384634018, 0.24117350578308105, -0.2210700809955597, 0.1895698755979538, 0.23987054824829102, -0.01856015995144844, -0.42040541768074036, -0.6992635130882263, 0.2928609251976013, 0.08768996596336365, -0.02973610907793045, 0.109365545213222...
include every property in each class ... (you could try == :)) Try [hamcrest matchers](http://code.google.com/p/hamcrest/) - you can compose each matcher in an "all of" matcher: ``` Matcher<MyClass> matcher = CoreMatchers.allOf( HasPropertyWithValue.hasProperty("myField1", getMyField1()), HasPropertyWithValue.has...
[ 0.03170006722211838, -0.02273101918399334, 0.45482924580574036, -0.2444286048412323, -0.04184315353631973, 0.03915167227387428, 0.3165014386177063, -0.6706332564353943, 0.13748036324977875, -0.5395108461380005, -0.018070079386234283, 0.4425066411495209, -0.49188199639320374, -0.00442818971...
wise to copy [apache-commons EqualsBuilder](http://commons.apache.org/lang/api/org/apache/commons/lang/builder/EqualsBuilder.html) here. BTW, the hamcrest basic jar is 32K (including source!) giving you the option of reviewing the code and saying to your bosses "I'll stand by this as my own code" (which I presume is y...
[ -0.009302333928644657, 0.39166635274887085, 0.3464168906211853, -0.09241322427988052, -0.2908133268356323, -0.2878915071487427, 0.3741770386695862, -0.29822564125061035, 0.17198288440704346, -0.5505874752998352, -0.04843205586075783, 0.6904029846191406, -0.05258513242006302, -0.42057049274...
I need to search a WPF control hierarchy for controls that match a given name or type. How can I do this? I combined the template format used by John Myczek and Tri Q's algorithm above to create a findChild Algorithm that can be used on any parent. Keep in mind that recursively searching a tree downwards could be a len...
[ 0.4865313172340393, 0.08652520924806595, 0.08998027443885803, 0.14815939962863922, -0.025611381977796555, -0.23569349944591522, 0.18649178743362427, -0.4077507555484772, -0.23142121732234955, -0.50136399269104, 0.13821814954280853, 0.27425527572631836, -0.32198193669319153, 0.0411065630614...
while testing or using this algorithm to check your work. **There is a small error in Tri Q's Algorithm.** After the child is found, if childrenCount is > 1 and we iterate again we can overwrite the properly found child. Therefore I added a `if (foundChild != null) break;` into my code to deal with this condition. ...
[ 0.12124262005090714, 0.0781208723783493, -0.030468780547380447, 0.07224130630493164, -0.10328036546707153, 0.4333406388759613, 0.2568261921405792, -0.5080898404121399, 0.05022339150309563, -0.7871308326721191, -0.021231751888990402, 0.022266065701842308, -0.09767056256532669, 0.22048084437...
the submitted type parameter. /// If not matching item can be found, /// a null parent is being returned.</returns> public static T FindChild<T>(DependencyObject parent, string childName) where T : DependencyObject { // Confirm parent and childName are valid. if (parent == null) return null; T foundChi...
[ 0.16138608753681183, -0.15296602249145508, 0.4860200881958008, 0.052841778844594955, 0.10679810494184494, 0.38741621375083923, 0.09130261838436127, -0.46278563141822815, 0.2423311024904251, -0.48955556750297546, -0.312930703163147, 0.24820475280284882, -0.1140468493103981, 0.26630094647407...
childType = child as T; if (childType == null) { // recursively drill down the tree foundChild = FindChild<T>(child, childName); // If the child is found, break so we do not overwrite the found child. if (foundChild != null) break; } else if (!string.IsNullOrEmpty(childName)) ...
[ 0.029547739773988724, -0.03792969137430191, 0.28284505009651184, -0.2029455602169037, 0.4647306501865387, 0.3389500081539154, 0.75860196352005, -0.5876724123954773, -0.06087455898523331, -0.46959584951400757, -0.15101614594459534, 0.11336147040128708, -0.24881099164485931, 0.34805402159690...
child's name is set for search if (frameworkElement != null && frameworkElement.Name == childName) { // if the child's name is of the request name foundChild = (T)child; break; } } else { // child element found. foundChild = (T)child;
[ -0.214291051030159, 0.012684567831456661, 0.27461278438568115, -0.12124079465866089, 0.5265119075775146, 0.2848380208015442, 0.28047773241996765, -0.2651631832122803, 0.10354427248239517, -0.5680667757987976, -0.3432193398475647, 0.11969759315252304, -0.1596451997756958, 0.3368973135948181...
break; } } return foundChild; } ``` Call it like this: ``` TextBox foundTextBox = UIHelper.FindChild<TextBox>(Application.Current.MainWindow, "myTextBoxName"); ``` Note `Application.Current.MainWindow` can be any parent window.
[ -0.26874691247940063, -0.07093004882335663, 0.3772600591182709, -0.2867054045200348, 0.03638981655240059, -0.23868340253829956, 0.2688652276992798, 0.3072706460952759, 0.005022857803851366, -0.7370275855064392, -0.44971799850463867, 0.018887391313910484, -0.3647795021533966, 0.442815214395...
I have a blog, [www.realcanadianenglish.blogspot.com](http://www.realcanadianenglish.blogspot.com). I use Firefox to write it. Sometimes I check the blog using Internet Explorer. With the later it shows a gap between the picture and the text sometimes. Can I change the HTML code to fix this? Why is there a difference b...
[ 0.3780215084552765, 0.17433905601501465, 0.4523499011993408, -0.043028492480516434, -0.027680322527885437, 0.08109749108552933, 0.12969891726970673, 0.15577606856822968, 0.04767154902219772, -0.8202357888221741, 0.32378482818603516, 0.21451611816883087, 0.1489797830581665, 0.13590314984321...
please comment on any errors you might find and I'll correct my code. [WPF Snoop](https://github.com/cplotts/snoopwpf) is a useful tool in looking at the visual tree - I'd strongly recommend using it while testing or using this algorithm to check your work. **There is a small error in Tri Q's Algorithm.** After the...
[ 0.40254926681518555, -0.008682454004883766, 0.014415713958442211, 0.15660817921161652, 0.20183174312114716, 0.12646369636058807, 0.11369500309228897, -0.11192947626113892, -0.17206993699073792, -0.7565988898277283, -0.017177291214466095, 0.3314032256603241, -0.08462739735841751, 0.08899740...
tree. /// </summary> /// <param name="parent">A direct parent of the queried item.</param> /// <typeparam name="T">The type of the queried item.</typeparam> /// <param name="childName">x:Name or Name of child. </param> /// <returns>The first parent item that matches the submitted type parameter. /// If not matching i...
[ 0.003830172121524811, -0.10083401203155518, 0.2984447479248047, 0.12633121013641357, -0.15633343160152435, 0.5274048447608948, 0.23025153577327728, -0.5422778725624084, -0.16380076110363007, -0.4418199956417084, -0.30203312635421753, -0.008852294646203518, -0.2696862518787384, 0.0699867382...
childrenCount; i++) { var child = VisualTreeHelper.GetChild(parent, i); // If the child is not of the request child type child T childType = child as T; if (childType == null) { // recursively drill down the tree foundChild = FindChild<T>(child, childName); // If the child is fo...
[ 0.04613477736711502, -0.08209308236837387, 0.2848692834377289, -0.10412457585334778, 0.4617505371570587, 0.4604123532772064, 0.4838729798793793, -0.42883118987083435, -0.007588875945657492, -0.685357928276062, -0.40734416246414185, 0.37809523940086365, -0.14963431656360626, 0.2008975446224...