text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
process could send that window a message thru functions PostMessage and DispatchMessage.
[ -0.21156032383441925, -0.3902667164802551, 0.023815082386136055, 0.13070257008075714, -0.21420426666736603, 0.3211326599121094, 0.21745888888835907, 0.1043480932712555, -0.23973318934440613, -0.8036585450172424, -0.13763955235481262, 0.26242274045944214, -0.20317895710468292, 0.40126687288...
I want to consume a web service over https from a java client. What steps will i need to take in order to do this? Really, there shouldn't much different from consuming a web service over HTTP. The big thing is that the process calling the web service will have to trust the server's SSL certificate. If the certificate ...
[ 0.7457103133201599, 0.40988802909851074, 0.2568661868572235, 0.004933138843625784, -0.06806789338588715, -0.3200084865093231, 0.3064637780189514, 0.15243346989154816, 0.06342357397079468, -0.7422866225242615, 0.013952551409602165, 0.5473167300224304, -0.17741665244102478, 0.286329984664917...
I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete? As far as I know, there **is no way** to safely delete them exc...
[ 0.2603469789028168, 0.2211199253797531, 0.4221299886703491, -0.06204339489340782, -0.2949700355529785, -0.16049528121948242, 0.5259929299354553, -0.40277570486068726, -0.2609238922595978, -0.519132137298584, -0.15334241092205048, 0.7096335291862488, -0.09413789957761765, 0.2232048511505127...
vanish. For a category called "Inventory" you can delete the whole key at `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Inventory` ... and although *I wouldn't be willing to bet that cleans up everything*, it **will** make the category disappear. (If you run [Process Monitor](http://technet.microsoft.com/en-u...
[ 0.16420337557792664, -0.25016048550605774, 0.46922388672828674, -0.12435562163591385, 0.2133743166923523, -0.09107242524623871, 0.47415098547935486, 0.0535583570599556, -0.6500224471092224, -0.5124313235282898, -0.401155561208725, 0.5240717530250549, -0.428099662065506, 0.2797923982143402,...
to restart applications in order to get them to actually get a clean list of the available categories. You can check the full list of categories from PowerShell to see if it's listed: ``` [Diagnostics.PerformanceCounterCategory]::GetCategories() | Format-Table -auto ``` But if you check them, then delete the regist...
[ 0.10308658331632614, -0.032674480229616165, 0.4395533502101898, 0.26282867789268494, 0.3097158968448639, -0.3983895778656006, 0.42696571350097656, 0.07291417568922043, -0.6394109725952148, -0.5726162195205688, -0.44298386573791504, 0.8589007258415222, -0.42264866828918457, 0.06002355366945...
or -match for full regular expressions: ``` [Diagnostics.PerformanceCounterCategory]::GetCategories() | Where {$_.CategoryName -like "*network*" } | Format-Table -auto [Diagnostics.PerformanceCounterCategory]::GetCategories() | Where {$_.CategoryName -match "^SQL.*Stat.*" } | Format-Table -auto ```
[ -0.07749387621879578, 0.07230066508054733, 0.6793487668037415, 0.04213934391736984, -0.12903021275997162, 0.1459372341632843, -0.08918917179107666, -0.047651760280132294, -0.12160418927669525, -0.1776222288608551, -0.34162208437919617, 0.982559859752655, -0.22289587557315826, -0.4198464453...
When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... Right now I'm doing this... ``` def getExpandedText(pattern, text, replaceValue): """ One liner... really ugly but it's only used in ...
[ 0.025799430906772614, 0.16284973919391632, 0.5976601243019104, -0.1263444572687149, -0.23498503863811493, -0.013504459522664547, 0.36219269037246704, 0.04659304395318031, -0.02108350582420826, -0.3286018371582031, -0.22475719451904297, 0.8625372648239136, -0.3611069917678833, -0.3245358765...
estas?' ``` It changes the (...) with 'ooo'. Do you guys know whether with python regular expressions we can do this? thanks a lot guys!! ``` sub (replacement, string[, count = 0]) ``` [sub](https://docs.python.org/howto/regex.html#search-and-replace) returns the string obtained by replacing the leftmost non-over...
[ 0.18250301480293274, 0.15407532453536987, 0.5938898324966431, -0.2340480089187622, -0.010355900041759014, 0.4511759877204895, 0.5037242770195007, -0.2769756615161896, -0.3687075078487396, -0.4533561170101166, -0.5234178900718689, 0.532774031162262, -0.4427827000617981, -0.09157301485538483...
There's a feature that I'd like to see in issue tracking software that just doesn't seem to be all that common, and that is the ability to divide a ticket (bug, feature request, etc) into sub-tasks and view them in a hierarchical fashion, perhaps with some kind of progress bar style report of progress on a particular t...
[ 0.1448475420475006, -0.20629121363162994, -0.0592883862555027, 0.7157655954360962, 0.07856764644384384, -0.12293948978185654, -0.16678212583065033, 0.09122275561094284, -0.38179638981819153, -0.6622365713119507, 0.2114824503660202, 0.28486937284469604, -0.12017463892698288, -0.056365489959...
often need to divide a task into sub-tasks. This would also come in handy if someone put two issues into one ticket. Does anyone know of an issue tracker which does this? So far the ones I've looked at (Trac, FogzBugz, and Basecamp) all have a flat organisation of tickets, so they're either useful for the developers o...
[ 0.4299750030040741, -0.29481229186058044, 0.17095036804676056, 0.6072961688041687, 0.1367996782064438, -0.17616747319698334, -0.10217130184173584, 0.03343420848250389, -0.390507310628891, -0.7202581167221069, 0.17295415699481964, 0.11559972912073135, -0.01333778165280819, -0.04914074391126...
used it for both developers and project managers, and if so, how much success did you have with it? Alternatively, is there a better approach that can be usable by both categories of users? (**Update:** This is *not* a subjective "what is your favourite bug tracking software" question. I am asking about bug trackers w...
[ 0.5249211192131042, -0.081943579018116, 0.4769468307495117, 0.07912426441907883, -0.17686939239501953, -0.2804352641105652, 0.18724925816059113, 0.3755139410495758, -0.36629587411880493, -0.20114684104919434, 0.011306960135698318, 0.8318990468978882, -0.5753681063652039, -0.231874436140060...
hierachy and shows it in a [treeview](http://fogbugz.stackexchange.com/questions/4374/case-hierarchy-parent-cases-and-subcases/4375#4375).
[ -0.3927166163921356, 0.05506409332156181, 0.27863067388534546, -0.05680229887366295, 0.06177978217601776, 0.2613103687763214, 0.4274970591068268, -0.046589963138103485, -0.3945317566394806, -0.3388006091117859, -0.5399404168128967, -0.2215348780155182, -0.09993926435709, 0.1287746876478195...
It sounds like Mozilla is having good luck improving JavaScript performance with [TraceMonkey](http://weblogs.mozillazine.org/roadmap/archives/2008/08/tracemonkey_javascript_lightsp.html). See also Andreas Gal's [paper on Trace Trees](http://www.ics.uci.edu/~franz/Site/pubs-pdf/ICS-TR-06-16.pdf). Are these improvement...
[ 0.35742896795272827, 0.15544095635414124, -0.05434928461909294, 0.14794142544269562, -0.13684803247451782, -0.02712072804570198, 0.3711966276168823, -0.04976208508014679, -0.39298275113105774, -0.4167480170726776, 0.15997843444347382, 0.1348363608121872, -0.46833863854408264, -0.2541675269...
prototyped in Prolog) uses some kind of tracing technique, although I don't know how closely related that is to Gal/Franz style nested trace trees. The [Rubinius](http://Rubini.us/) guys are definitely aware of this work, and very open to experimentation. I wouldn't be surprised, if some advanced compilation technique...
[ 0.5413752198219299, 0.003372759558260441, 0.21671712398529053, 0.10785383731126785, 0.05066294968128204, -0.2074110209941864, 0.3046925663948059, 0.05391724780201912, -0.2009671926498413, -0.35856807231903076, -0.14435943961143494, 0.17263922095298767, -0.4277151823043823, -0.1563411802053...
What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links). FWIW, I'm not running a web farm. Exception --------- > Error Message: Unable to validate >...
[ -0.20319029688835144, 0.0428430438041687, 0.3643588423728943, 0.09907577186822891, -0.022795185446739197, -0.12805849313735962, 0.7548364400863647, 0.08681332319974899, -0.5000096559524536, -0.7971862554550171, -0.10685108602046967, 0.45059236884117126, -0.12895821034908295, 0.316862791776...
inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPer...
[ -0.11266801506280899, 0.20609092712402344, 0.40610602498054504, -0.12134872376918793, 0.30902278423309326, 0.39006009697914124, 0.5652675628662109, -0.4257957935333252, -0.2992513179779053, -0.45993903279304504, -0.21534016728401184, 0.5860666632652283, -0.2598842680454254, 0.0928029045462...
to validate and throw the error. Other potential causes: * An application pool recycling between the time the viewstate was generated and the time that the user posts it back to the server (unlikely). * A web farm where the machineKeys are not synchronized (not your issue). Update: [Microsoft article on the issue](...
[ 0.3732147514820099, 0.008943676948547363, 0.23330016434192657, 0.22883954644203186, 0.07228194922208786, -0.20771557092666626, 0.45083722472190857, 0.23087100684642792, -0.5234084725379944, -0.49616655707359314, -0.15489721298217773, 0.28728726506233215, -0.43952253460884094, 0.31572529673...
Based on a few posts I've read concerning version control, it seems people think pessimistic locking in a version control system is a bad thing. Why? I understand that it prevents one developer from submitting a change while another has the file checked out, but so what? If your code files are so big that you constantl...
[ 0.4523979127407074, 0.25378599762916565, -0.0923554003238678, 0.28689488768577576, 0.18953458964824677, -0.39437830448150635, 0.4446496367454529, -0.07285086065530777, -0.5826515555381775, -0.37883687019348145, 0.06284229457378387, 0.5493497848510742, -0.3809656798839569, 0.452117502689361...
version control system provides to make it easier. I think it should be avoided if at all possible. So, why is pessimistic locking discouraged? It depends on your project and team generally. Pessimistic locking is good because it is easy to understand - one dev at a time, and no merging required! However, the bad thin...
[ 0.3079809546470642, 0.09399460256099701, 0.24525079131126404, 0.405826598405838, 0.037966661155223846, -0.5638360977172852, 0.4205749034881592, 0.14075390994548798, -0.4849590063095093, -0.6279572248458862, -0.12344177812337875, 0.635389506816864, -0.37533846497535706, 0.29224205017089844,...
his changes in.... great for him, lousy for me and the rest of the dev team at base. If you can get around pessimistic locking in your team then its fine to use it, really, the biggest reason people hate it is because its Visual SourceSafe's default practice. If you're not confident in merging lots of changes, then yo...
[ 0.4936206340789795, 0.014950154349207878, 0.14107678830623627, 0.4392266869544983, 0.04815981164574623, -0.16826802492141724, 0.2728859782218933, -0.19181661307811737, -0.06721024960279465, -0.5391159057617188, 0.16173155605793, 0.6830453276634216, -0.20532774925231934, -0.0998575538396835...
you don't have to hand your geek card in if you don't want to use it.
[ 0.643205463886261, 0.010352743789553642, -0.05702194571495056, 0.28509408235549927, 0.23890207707881927, -0.4901145100593567, -0.22659486532211304, 0.7169586420059204, -0.2880569100379944, -0.3198399841785431, 0.02807295322418213, -0.06610078364610672, 0.25537705421447754, -0.1567457467317...
How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears. I can't even bind to perform a simple query: ``` import sys import ldap Server = "ldap://my-ldap-server" DN, Secret, un = sys.argv[1:4] Base = "dc=mydomain,dc=co,dc=uk" Scope = ldap.SC...
[ 0.025280429050326347, 0.27451273798942566, 0.6990116238594055, -0.2989184558391571, -0.05090786889195442, -0.05883124843239784, 0.7625085711479187, -0.7066993117332458, 0.30946099758148193, -0.5720932483673096, -0.07138518244028091, 0.6528465747833252, -0.5359524488449097, 0.05825607478618...
'80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 52e, vece', 'desc': 'Invalid credentials'} Or > ldap.OPERATIONS\_ERROR: {'info': '00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece', 'desc': ...
[ -0.004877445288002491, -0.05850514397025108, 0.4838932752609253, -0.008722477592527866, 0.16605639457702637, 0.00738945510238409, 0.5016360878944397, -0.2567692697048187, -0.07710955291986465, -0.7282080054283142, -0.26061275601387024, 0.84544438123703, -0.39907515048980713, 0.014733650721...
What is the longest string that can be created in .NET? The docs for the `String` class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system? [This is asked more for curiosity than for practical use - I don't ...
[ 0.1053771823644638, -0.06936708837747574, 0.2745696008205414, -0.09023924171924591, 0.0011928961612284184, -0.1225578561425209, 0.09597478061914444, -0.1245863065123558, -0.6049200296401978, -0.23665323853492737, -0.10743720084428787, 0.3134048581123352, -0.027241306379437447, 0.3223588764...
for each character), the best you could do is 1,073,741,823, but you're not likely to ever be able to allocate that on a 32-bit machine. This is one of those situations where ["If you have to ask, you're probably doing something wrong."](https://devblogs.microsoft.com/oldnewthing/20070301-00/?p=27803)
[ -0.23432861268520355, 0.33777889609336853, -0.014129085466265678, 0.04875694215297699, 0.15494610369205475, 0.43426159024238586, 0.028348801657557487, -0.1517234444618225, -0.2936675548553467, -0.24586646258831024, -0.07897582650184631, 0.15902845561504364, -0.010507460683584213, 0.0076265...
[RFC 1738](http://www.ietf.org/rfc/rfc1738.txt) specifies the syntax for URL's, and mentions that > URLs are written only with the graphic > printable characters of the > > US-ASCII coded character set. The > octets 80-FF hexadecimal are not > > used in US-ASCII, and the octets 00-1F > and 7F hexadecimal re...
[ 0.01008933037519455, 0.2475675642490387, 0.6966254115104675, 0.28816330432891846, -0.2783029079437256, -0.18226468563079834, -0.04536208137869835, -0.23554575443267822, -0.06461401283740997, -0.5643213987350464, -0.522845983505249, -0.016581986099481583, -0.2819550335407257, 0.114098422229...
difficult. Internet protocols that transmit octet sequences intended to > represent character sequences are expected to provide some way of > identifying the charset used, if there might be more than one > [RFC2277]. However, there is currently no provision within the > generic URI syntax to accomplish this identif...
[ 0.05002996698021889, 0.07988402992486954, 0.07980149984359741, 0.12314817309379578, 0.031986355781555176, -0.004806102253496647, 0.11498744785785675, -0.21639208495616913, 0.015169045887887478, -0.8210581541061401, -0.4460240304470062, 0.19042536616325378, -0.26401615142822266, -0.00132467...
any unambigous way in which a client can determine in which character set to interpret encoded octets, or in which a server can determine what a client used to encode with ? It looks to me like most servers default to UTF-8, but this seems to be a de facto choice more than a specified one. As per your quote, URLs are ...
[ 0.25182250142097473, 0.08091909438371658, 0.3253726661205292, 0.1644364893436432, -0.15431569516658783, -0.07167451828718185, 0.017756182700395584, 0.48638078570365906, -0.3472934663295746, -0.545221209526062, -0.11908840388059616, 0.2697213590145111, -0.38612857460975647, 0.31581950187683...
guess you can write an URI, and the browser should try its best to transform to an URL (which is what HTTP/1.1 support, AFAICR). For non-ASCII characters, that means hexcodes, usually coding UTF-8.
[ 0.3585609197616577, 0.00644543906673789, -0.04570087790489197, 0.08715540170669556, 0.06700048595666885, 0.11399677395820618, 0.04328061267733574, 0.2442801147699356, 0.16091033816337585, -0.5143589377403259, -0.12609487771987915, -0.15348832309246063, -0.23546427488327026, 0.1253406703472...
OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could). *This question came up because I can't, for the life of me, login with my **myopenid.com** provider. :-(* The fix is for your OpenID...
[ 0.48308801651000977, 0.1328883171081543, 0.5279765725135803, 0.03808605298399925, 0.09496848285198212, -0.37402254343032837, 0.5046379566192627, 0.3908717632293701, -0.23972681164741516, -0.7402652502059937, -0.10124479234218597, 0.543488085269928, -0.33121004700660706, 0.3044942319393158,...
The VS Database Project does not seem to have the "Show All Files" option in the Solution Explorer. Does anyone know of a way to turn the option on in VS? The "Show All Files" option on the solution explorer actually does two things. With the option selected, VS shows "hidden/nested" files within the project AND it sh...
[ 0.525837779045105, -0.2621864676475525, 0.05717235058546066, 0.12715469300746918, -0.16286900639533997, -0.20657621324062347, 0.3852839469909668, 0.08409961313009262, -0.1751428246498108, -0.7283978462219238, 0.12557010352611542, 0.4085995852947235, -0.42592087388038635, 0.3720026016235351...
of to have the solution explorer show files within the directory that are not part of the project. Also, while this action occurs within the solution explorer, it is actually a project issue. The correct answer to this issue is:- You must have the Database Project root node selected in the Solution Explorer. Select...
[ 0.18079465627670288, -0.1731720119714737, 0.13840128481388092, 0.2752881646156311, 0.185689315199852, -0.249494731426239, 0.2811974883079529, -0.05426931753754616, -0.056434277445077896, -0.7517284750938416, -0.4592472016811371, 0.12929844856262207, -0.37591737508773804, 0.4396020472049713...
I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the maintenance phases of a project. ...
[ 0.968201756477356, 0.42575061321258545, 0.21481472253799438, -0.003532168921083212, 0.13848154246807098, -0.23473574221134186, 0.22062034904956818, -0.4025741219520569, -0.126015767455101, -0.5390506386756897, 0.04661889374256134, 0.5147532224655151, -0.07409389317035675, 0.184735327959060...
makes it harder to refactor. Cleaning up as soon as I notice the mess prevents it from building up and becoming a problem later.
[ 0.38803237676620483, 0.6811870336532593, 0.43663689494132996, -0.09234506636857986, 0.15664635598659515, -0.01700226590037346, 0.3432033061981201, -0.19331589341163635, -0.08223970234394073, -0.5366961359977722, 0.3807268440723419, 0.5294066071510315, 0.07678170502185822, 0.125553876161575...
Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the console is amenable to that. Down in the lower-right corner of the FireBug UI you should see a red...
[ -0.09983494132757187, 0.08632353693246841, 0.611965537071228, -0.2343432903289795, -0.14055277407169342, 0.13551174104213715, 0.0812278538942337, -0.24770016968250275, -0.18051232397556305, -0.8882371783256531, -0.09095640480518341, 0.375676691532135, -0.29675984382629395, -0.2804095447063...
In Java you can do `File.listFiles()` and receive all of the files in a directory. You can then easily recurse through directory trees. Is there an analogous way to do this in Python? Yes, there is. The Python way is even better. There are three possibilities: **1) Like File.listFiles():** Python has the function o...
[ -0.025903087109327316, -0.22854101657867432, 0.46656009554862976, -0.2599065601825714, -0.3041410744190216, -0.10164433717727661, 0.016729936003684998, -0.1462964117527008, -0.40092507004737854, -1.0750044584274292, -0.02696770243346691, 0.5252991318702698, -0.5159328579902649, -0.26293966...
directories and files below a given starting path. An Example: ```` import os from os.path import join for root, dirs, files in os.walk('/usr'): print "Current directory", root print "Sub directories", dirs print "Files", files ```` You can even on the fly remove directories from "dirs" to avoid walking to...
[ -0.1068691685795784, -0.15090671181678772, 0.467143714427948, -0.009017463773488998, 0.12426042556762695, -0.2606901228427887, 0.14845573902130127, -0.22447185218334198, -0.46137773990631104, -0.6873992085456848, -0.595664918422699, 0.4423573315143585, -0.3425056040287018, 0.09872746467590...
I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). Lets see how stackoverflow handles this very obscure question -- answers for which, on Google, are m...
[ 0.3618161082267761, 0.24659577012062073, 0.20912034809589386, -0.036680448800325394, -0.0679219514131546, -0.0607621893286705, 0.21022173762321472, 0.14809289574623108, -0.15220865607261658, -0.6591296195983887, 0.21991762518882751, 0.49840494990348816, -0.050734587013721466, 0.06074939295...
that indicates it is done with the connection--which would allow me to close the connections sooner in most cases--instead of waiting for the timeout. Thanks If you're building your server to meet the standard, then you've got a lot of information to guide you here already. Simple spoken, *it should be based on a time...
[ 0.426385760307312, 0.16087432205677032, 0.4242122769355774, -0.12322018295526505, 0.2023211419582367, -0.4002024531364441, 0.37191131711006165, -0.05732634291052818, -0.29650235176086426, -0.49762341380119324, -0.15753857791423798, 0.2973543703556061, 0.2879893481731415, -0.013135649263858...
an inactive > connection. Proxy servers might make > this a higher value since it is likely > that the client will be making more > connections through the same server. > The use of persistent connections > places no requirements on the length > (or existence) of this time-out for > either the client or the ser...
[ -0.2645772099494934, -0.4581846296787262, 0.971810519695282, 0.00473925331607461, 0.0506773367524147, -0.2532951235771179, 0.19072149693965912, 0.10324062407016754, -0.7228298187255859, -0.7587178945541382, -0.3391646146774292, 0.26804208755493164, -0.3476932644844055, 0.25190111994743347,...
as appropriate. If a client or server > does not detect the other side's close > promptly it could cause unnecessary > resource drain on the network."
[ 0.23364682495594025, -0.1363842636346817, 0.42723965644836426, 0.04611271992325783, 0.365352988243103, -0.08072909712791443, 0.3074204921722412, -0.04113496467471123, -0.05545145273208618, -0.47216904163360596, -0.465318500995636, 0.4880770742893219, 0.05917700380086899, -0.065281108021736...
What do you think about this [build tool](http://raven.rubyforge.org/)? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first. Thanks! @andre: Thank's for writing but I was actually looking for real experiences using raven. Anyway, the fact t...
[ 0.07702851295471191, 0.005497185047715902, -0.14450161159038544, 0.045345157384872437, -0.21147628128528595, 0.007411748170852661, 0.4921172261238098, -0.07535979896783829, -0.4524586498737335, -0.5628587007522583, 0.1308482438325882, 0.3283751606941223, -0.34749624133110046, -0.0270268246...
lines of Buildr. And, even though everybody says "Ruby is slow", Buildr was 2-6x faster than Maven. Also, unlike Raven, Buildr seems to still be maintained: it is currently in the incubator stage as an official Apache project.
[ 0.1834857314825058, -0.17938114702701569, 0.3924686312675476, -0.0021661734208464622, -0.3992023468017578, -0.29366254806518555, 0.6972681879997253, 0.14269909262657166, 0.08681362867355347, -0.43928131461143494, 0.17030395567417145, 0.13919256627559662, -0.18550607562065125, 0.07016320526...
Anyone knows if is possible to have partial class definition on C++ ? Something like: file1.h: ``` class Test { public: int test1(); }; ``` file2.h: ``` class Test { public: int test2(); }; ``` For me it seems quite useful for definining multi-platform classes that have common functio...
[ 0.12746386229991913, -0.24873319268226624, -0.2415381222963333, 0.263226717710495, -0.21851518750190735, -0.20622441172599792, 0.26361092925071716, 0.021502071991562843, -0.11223811656236649, -0.7972140312194824, 0.086107537150383, 0.6503835916519165, -0.20727898180484772, -0.0424932278692...
needs but after that it won't add anything useful at runtime, just costs. Also you will have to use an ugly #ifdef to use the class because you can't make an instance from an abstract class: ``` class genericTest { public: int genericMethod(); }; ``` Then let's say for win32: ``` class win32Test: pu...
[ 0.02848570980131626, -0.215792715549469, 0.4097747504711151, 0.15428316593170166, 0.059654492884874344, 0.04515034705400467, 0.3488738238811493, -0.2325274497270584, -0.05348837003111839, -0.9323101043701172, -0.004292382393032312, 0.7476390600204468, -0.41642236709594727, 0.27757498621940...
will have to use the class like this: ``` #ifdef _WIN32 genericTest *test = new win32Test(); #elif MAC genericTest *test = new macTest(); #endif test->genericMethod(); ``` Now thinking a while the inheritance was only useful for giving them both a genericMethod() that is dependent on the platform-specific on...
[ 0.006020356435328722, -0.011122495867311954, 0.2556811571121216, 0.0490751788020134, -0.2874545454978943, -0.009046650491654873, 0.41925832629203796, -0.10965368896722794, 0.006723346654325724, -0.8523657321929932, 0.13118034601211548, 0.6752161979675293, -0.24945828318595886, 0.4830961823...
there is another ways to avoid that. This is not possible in C++, it will give you an error about redefining already-defined classes. If you'd like to share behavior, consider inheritance.
[ 0.33688774704933167, -0.18686088919639587, -0.533755898475647, 0.2272406667470932, -0.41323739290237427, -0.269265741109848, 0.09154157340526581, 0.02668137475848198, -0.15965358912944794, -0.6058759093284607, 0.30337727069854736, 0.6120348572731018, -0.45420563220977783, 0.160642489790916...
Here's what I'd like to do: I want to create a library project that contains my Resource files (ie, UI Labels and whatnot). I'd like to then use the resource library both in my UI and in my Tests. (Ie, basically have a common place for my resources that I reference from multiple projects.) Unfortunately, because the...
[ 0.49416252970695496, 0.09020437300205231, -0.3566548824310303, 0.22503706812858582, 0.028350450098514557, -0.251600980758667, 0.1287522166967392, -0.06689830124378204, -0.03503865376114845, -0.8298991918563843, 0.22884218394756317, 0.4450007975101471, -0.015279650688171387, 0.2203996479511...
described [here](http://www.codeproject.com/KB/dotnet/Localization.aspx), or writing a public wrapper class/function). Unfortunately, both those solutions remove my ability to keep the references strongly-typed. Has anyone found a straight-forward way to create strongly typed .Net resources that can be referenced fro...
[ 0.44127216935157776, 0.0616874173283577, 0.39201006293296814, -0.06559056043624878, -0.1558389663696289, -0.14275027811527252, 0.2911635637283325, -0.10294755548238754, -0.2962943911552429, -0.6528167128562927, -0.016531720757484436, 0.5420171022415161, -0.14722105860710144, 0.221394941210...
in design view, there is an option at the top beside Add Resource and Remove Resource, called Access Modifier, it is a drop down where you can change the generated code from internal to public. VS 2005 - You don't have the option to generate the code like in VS 2008. It was a feature that was added, because of this he...
[ 0.040884725749492645, -0.13191379606723785, 0.1458437591791153, 0.0517444834113121, -0.2967207431793213, 0.07096696645021439, 0.22269725799560547, -0.290209025144577, -0.28115925192832947, -0.6607389450073242, 0.10915757715702057, 0.4048144817352295, -0.24314704537391663, 0.238647624850273...
resource library.
[ -0.1908039003610611, 0.037222202867269516, -0.1473812460899353, 0.401734322309494, 0.4340536296367645, 0.1568487137556076, -0.1757197380065918, -0.23128896951675415, -0.3526459038257599, -0.77250075340271, -0.2491682916879654, -0.005782301537692547, 0.14265815913677216, 0.444595605134964, ...
I'm doing some maintenance coding on a webapp and I am getting a javascript error of the form: "[elementname] has no properties" Part of the code is being generated on the fly with an AJAX call that changes innerHTML for part of the page, after this is finished I need to copy a piece of data from a hidden input field ...
[ 0.11356610059738159, 0.05363023653626442, 0.4488690495491028, 0.13707856833934784, -0.09878731518983841, -0.18749716877937317, 0.34750089049339294, -0.1836203634738922, 0.2027171552181244, -1.037477970123291, -0.09389428794384003, 0.7243642807006836, -0.16339237987995148, 0.114382028579711...
field now reads: `<input id="source" name="source" value="2">` Ok after the javascript line that copies the ajax data to innerHTML the next line is: `document.getElementById('dest').value = document.getElementById('source').value;` I get the following error: `Error: document.getElementById("source") has no properties...
[ -0.19171327352523804, 0.13453063368797302, 0.5129277110099792, -0.25957781076431274, -0.1864509880542755, -0.3162800967693329, 0.31603115797042847, -0.2963709831237793, 0.07715825736522675, -0.5259272456169128, -0.30568063259124756, 0.7238367199897766, -0.0740288570523262, -0.0936452746391...
calls, which is not in the scope of the current maintenance cycle. Note3: the innerHTML is updated with the new data, a whole table with data and formatting is being copied, I am trying to add a boolean to the end of this big chunk, instead of creating a whole new ajax call for one boolean. It looks like that is what ...
[ 0.2644156217575073, 0.17991678416728973, 0.5419961810112, 0.29460933804512024, -0.11587727814912796, -0.2796131670475006, 0.46917831897735596, 0.12210389971733093, -0.32270359992980957, -0.3662315309047699, -0.016099954023957253, 0.8776266574859619, -0.5042569637298584, 0.03710155189037323...
I swear I had those right to begin with, but hey we live and learn... Thanks for the help guys. "[elementname] has no properties" is javascript error speak for "the element you tried to reference doesn't exist or is nil" This means you've got one or more of a few possible problems: 1. Your page hasn't rendered yet a...
[ 0.3952246606349945, 0.27180755138397217, 0.2335790991783142, 0.1769711971282959, 0.10991165786981583, -0.382894366979599, 0.6631457805633545, -0.05347101017832756, -0.06123768910765648, -0.7061673402786255, 0.12626807391643524, 0.46634021401405334, -0.15186040103435516, 0.10905781388282776...
think you're passing)
[ 0.3241182267665863, -0.005820210557430983, 0.36621397733688354, -0.09999317675828934, -0.04006665199995041, 0.2541896104812622, 0.27397146821022034, 0.2038482278585434, -0.6380558013916016, -0.3200424611568451, 0.1934930682182312, 0.12510883808135986, -0.14800545573234558, 0.32568433880805...
After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in components included with flash were pretty crappy - bloated ...
[ 0.14535287022590637, 0.14096662402153015, 0.23227715492248535, -0.12378530949354172, -0.2822665870189667, -0.09254446625709534, 0.27792423963546753, -0.06587498635053635, -0.14401519298553467, -1.0445820093154907, 0.06876887381076813, 0.7483111619949341, -0.32910263538360596, -0.5091791152...
the CS3 IDE, I'd prefer to work all from FlashDevelop only. 2. **Flex Components** - downside, I need the Flex Framework, meaning I have to start with a MXML file, plus the bloat of the framework 3. **bit101's [MinimalComps](http://code.google.com/p/minimalcomps/)** - These look like they might be a good starting point...
[ 0.3582753837108612, 0.08178423345088959, 0.2189323455095291, -0.09087313711643219, -0.5606189370155334, -0.19345661997795105, 0.1571747213602066, -0.11792979389429092, -0.44008582830429077, -0.8045068383216858, -0.10498311370611191, 0.5334379076957703, -0.3173888623714447, -0.5696795582771...
right in the Flash IDE using the drawing tools. Very helpful for those times where you have to rapidly push a skinned video player to production... On the open source side there's also Thimbault Imbert's Liquid Components (<http://www.bytearray.org/?p=137>) demo here (<http://www.bytearray.org/?p=109>)... It's pretty...
[ 0.4268954396247864, -0.07116591185331345, 0.14109420776367188, 0.12388446927070618, -0.03632132336497307, -0.045749783515930176, -0.2589893937110901, 0.32825276255607605, -0.25846678018569946, -0.6431465148925781, 0.12480353564023972, 0.582024872303009, -0.06383071094751358, -0.14675536751...
"Dirty reads", meaning reading an object's value even though it is write-locked by another thread, are [described](http://www.terracotta.org/confluence/display/howto/Recipe?recipe=dirty-read) on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might...
[ 0.5476937294006348, 0.0682281032204628, -0.10476503521203995, 0.3832068145275116, 0.2021140456199646, 0.07584378868341446, 0.11229991167783737, 0.08725318312644958, -0.3972485363483429, -0.5135088562965393, 0.3208194673061371, 0.21094737946987152, 0.04182780534029007, 0.5974790453910828, ...
you are accessing without proper synchronization. You should note that, under the memory model in Java 5, you are not guaranteed to *ever* read an updated value if you don't use proper synchronization. Terracotta may decide to take advantage of this possibility. In fact, any JVM may, at their leisure, take advantage o...
[ 0.3559134900569916, 0.3052251935005188, 0.08053391426801682, 0.14621217548847198, 0.26354503631591797, -0.19709646701812744, 0.5519638061523438, 0.42086830735206604, -0.4329881966114044, -0.49339523911476135, -0.053507041186094284, 0.5485205054283142, 0.015109357424080372, 0.38657525181770...
reads isn't safe in any JVM... Unless you don't mind the possibility that you won't ever be able to read the updates that other threads make - an unlikely situation but it could happen. Also, when you actually follow your link to Terracottas wiki, it says that the article has been removed and that the pattern is disco...
[ 0.5065693259239197, 0.10360465198755264, 0.4171109199523926, 0.38625648617744446, 0.143354132771492, -0.47289589047431946, 0.5110605359077454, 0.6166432499885559, -0.26893866062164307, -0.5437785983085632, 0.18676966428756714, 0.04522532969713211, -0.2942447066307068, 0.5448075532913208, ...
I'm trying to determine what instances of sql server/sql express I have installed (either manually or programmatically) but all of the examples are telling me to run a SQL query to determine this which assumes I'm already connected to a particular instance. At a command line: ``` SQLCMD -L ``` or ``` OSQL -L ``` ...
[ -0.008669866248965263, 0.24261678755283356, 0.4820958077907562, 0.10033472627401352, 0.002736725378781557, -0.3384915590286255, 0.17892321944236755, 0.16352148354053497, -0.19392429292201996, -0.9726714491844177, 0.008751709945499897, 0.365776002407074, -0.3387259244918823, 0.3959768414497...
'Hide server'.
[ 0.318105548620224, 0.1757635474205017, -0.12431889772415161, -0.05047875642776489, -0.08687859028577805, 0.07764595001935959, 0.29959365725517273, 0.37479615211486816, -0.10952573269605637, -0.18031278252601624, -0.38865208625793457, 0.04856444150209427, -0.20859834551811218, -0.0110823502...
I'd like the canonical way to do this. My Google searches have come up short. I have one ActiveRecord model that should map to a different database than the rest of the application. I would like to store the new configurations in the database.yml file as well. I understand that establish\_connection should be called, ...
[ 0.1885410100221634, 0.07251746207475662, 0.40270552039146423, 0.04642060399055481, 0.10015027225017548, -0.3777758777141571, 0.19059662520885468, -0.3399360477924347, 0.04772060737013817, -0.7095664143562317, 0.23785299062728882, 0.8207395076751709, -0.44770509004592896, 0.1965087801218032...
establish_connection "anotherbase_#{RAILS_ENV}" end ``` And in your model ``` class Foo < AnotherBase end ``` It is useful when you need to add subsequent models that access the same, another database.
[ 0.01910475641489029, -0.1557140052318573, 0.4560544788837433, 0.040467873215675354, 0.27597326040267944, -0.5291048884391785, -0.13065293431282043, 0.008242220617830753, -0.2564469575881958, -0.8755306601524353, 0.0723390206694603, 0.19092628359794617, -0.4895365238189697, 0.29922741651535...
I use a pattern that looks something like this often. I'm wondering if this is alright or if there is a best practice that I am not applying here. Specifically I'm wondering; in the case that an exception is thrown is the code that I have in the finally block enough to ensure that the connection is closed appropriatel...
[ 0.19519686698913574, 0.172502338886261, 0.12617811560630798, 0.04501162841916084, 0.2329922914505005, -0.2762054204940796, 0.36823350191116333, -0.022327717393636703, -0.3027661442756653, -0.6592360138893127, 0.025119679048657417, 0.5536876916885376, -0.3408929109573364, 0.2474789321422577...
try { using (SqlCommand cmd = new SqlCommand(SqlQuery.CountSomething, _SqlConnection)) { _SqlConnection.Open(); countOfSomething = Convert.ToInt32(cmd.ExecuteScalar()); } }
[ 0.015151627361774445, -0.20068258047103882, 0.4768552780151367, -0.10352674871683121, 0.24491487443447113, 0.13429129123687744, 0.5174369812011719, -0.7786498069763184, 0.10490228235721588, -0.582483172416687, 0.12305477261543274, 0.4490058422088623, -0.5540829300880432, 0.0041811638511717...
finally { //is this the best way? if (_SqlConnection.State == ConnectionState.Closed) _SqlConnection.Close(); } //some code excluded for brevity } public Dispose() { _conn.Dispose();
[ 0.011687795631587505, -0.11561687290668488, 0.4229455590248108, -0.07826065272092819, 0.3876734972000122, -0.3814064562320709, 0.1533445566892624, -0.2330535352230072, -0.08422308415174484, -0.48654648661613464, -0.2274911105632782, 0.45782458782196045, -0.3332602381706238, 0.3355520069599...
} } ``` Wrap your database handling code inside a "using" ``` using (SqlConnection conn = new SqlConnection (...)) { // Whatever happens in here, the connection is // disposed of (closed) at the end. } ```
[ 0.0231797993183136, 0.22368758916854858, 0.3074290156364441, -0.043871521949768066, 0.3388006091117859, -0.2700693607330322, 0.15356940031051636, -0.1082109585404396, -0.06892403215169907, -0.6456713676452637, -0.22917816042900085, 0.4087294936180115, -0.316371351480484, 0.2501296401023865...
I have a class that encapsulates tcp socket communications with a server. For each command message sent to the server, the server will send back a response message that invariably contains a response code (OK, Fail). Using my class, each command can be executed either sync or async. There are basically two types of ex...
[ 0.18827970325946808, -0.07663186639547348, 0.3521880507469177, 0.027050113305449486, -0.26196908950805664, -0.02914304845035076, 0.16592788696289062, 0.014774386771023273, 0.10527978092432022, -0.6099364161491394, -0.13026836514472961, 0.4509173035621643, -0.1582040637731552, 0.50452095270...
In the event of a fail response or even an exception, the command can be tried again... So, right now my sync command methods return an enum that can have the following values: OK, Fail, Fault. If an exception occurs, it is simply raised to the calling thread (in a sync command). For async commands, the Result propert...
[ 0.0018750557210296392, -0.04973200708627701, 0.2883625328540802, 0.0870024636387825, 0.11064526438713074, -0.008420177735388279, 0.3899763822555542, -0.14695905148983002, -0.305148720741272, -0.3655010163784027, -0.33065295219421387, 0.725666344165802, -0.23613430559635162, 0.1919728070497...
sync commands and just log the exception internally and return the 4th enum value instead because that's all I'll really do with exceptions in any given case anyway... Or, should I not be using result codes at all and just raise exceptions in all cases, even faults? Thanks. I think your strategy is basically sound. K...
[ -0.11023254692554474, -0.009029768407344818, 0.07978426665067673, 0.33930131793022156, 0.04261534661054611, -0.09009400755167007, 0.7738670706748962, 0.16684024035930634, 0.033242907375097275, -0.37795117497444153, -0.0414828397333622, 0.7276802659034729, -0.3574800193309784, -0.2209460884...
really raise exceptions. If dealing with a closed socket was something that required a totally different flow in your code, then maybe exceptions would make sense. From your description, that's not really the case. My philosophy on Exceptions is that they should be for exceptional conditions that you can't really dea...
[ 0.4628949761390686, 0.28244659304618835, -0.024859709665179253, 0.02548186108469963, -0.14021800458431244, -0.1568291038274765, 0.4681846797466278, 0.33850330114364624, -0.4215749502182007, -0.31539401412010193, 0.15306656062602997, 0.22052055597305298, -0.3007664978504181, 0.1726093888282...
To start, I know there are two "kinds" of JSON serialization currently built into ASP.Net: you can either use the JavaScriptSerializer class to serialize your object to JSON or the new DataContractJsonSerializer class to convert a object to JSON. If you use the JavaScriptSerializer() method, you must mark your class a...
[ 0.07735831290483475, -0.3795953691005707, 0.27283015847206116, -0.05848280340433121, -0.2293270379304886, -0.16791969537734985, -0.053291212767362595, 0.13330508768558502, -0.4263341724872589, -0.889731228351593, -0.15676116943359375, 0.38561564683914185, -0.4808919131755829, 0.48528528213...
useful to make the JSON not so "wordy". For example, instead of stating "UserID" as my property (and having it repeat throughout my JSON object), I'd like to simply use "u". Less data across the wire, etc. The two serialization engines render a bit different, and you can only use the JavaScriptSerializer with ASP.Net ...
[ 0.0834454819560051, -0.09020090848207474, 0.18788424134254456, 0.0720808357000351, -0.2821389138698578, -0.4481827914714813, 0.16246531903743744, -0.05217753350734711, -0.07455228269100189, -0.6137336492538452, 0.025009486824274063, 0.4069131314754486, -0.1590932011604309, 0.25307250022888...
This is really annoying, we've switched our client downloads page to a different site and want to send a link out with our installer. When the link is created and overwrites the existing file, the metadata in windows XP still points to the same place even though the contents of the .url shows the correct address. I can...
[ 0.38822898268699646, 0.337589293718338, 0.7618025541305542, 0.05477470904588699, 0.017571784555912018, -0.5009101629257202, 0.3333897590637207, 0.2691250145435333, -0.3204195499420166, -0.4835384786128998, -0.09026608616113663, 0.5889872312545776, -0.3590376079082489, 0.40522700548171997, ...
result in one bad link and one good link which is more confusing than it is cool. Take a look at here: <http://www.cyanwerks.com/file-format-url.html> It explains there's a Modified field you can add to the .url file. It also explains how to interpret it.
[ 0.5139306783676147, -0.10674332082271576, 0.3390161991119385, 0.24818874895572662, -0.2539438009262085, -0.22492462396621704, 0.2248590588569641, 0.1528882533311844, -0.2339056134223938, -0.36177703738212585, 0.14559048414230347, 0.26629438996315, -0.22584708034992218, 0.35576799511909485,...
What is the difference between using the `Runnable` and `Callable` interfaces when designing a concurrent thread in Java, why would you choose one over the other? See explanation [here](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html). > The Callable interface is similar to > Runnable, in ...
[ -0.038783181458711624, -0.23256494104862213, -0.07803357392549515, 0.1608736366033554, -0.14812512695789337, -0.05851016566157341, 0.29011043906211853, 0.07874197512865067, -0.35650506615638733, -0.5494002103805542, -0.08845836669206619, 0.3016940951347351, -0.7176416516304016, 0.305474042...
Are there any alternatives to [The CMU Pronouncing Dictionary](http://www.speech.cs.cmu.edu/cgi-bin/cmudict), commercial or open source? I don't believe the answer is definitively "no," but I do know that CMU is the most popular pronouncing dictionary in my anecdotal experience. I believe it is open source so if it's m...
[ 0.40223386883735657, 0.3025592267513275, 0.006127387750893831, 0.08214996010065079, -0.12248169630765915, 0.19578029215335846, 0.203134685754776, 0.48071974515914917, -0.18353460729122162, -0.48007696866989136, 0.05810374394059181, 0.5381162166595459, 0.15539610385894775, -0.25375956296920...
We currently use a hand-rolled setup and configuration script and a hand-rolled continuous integration script to build and deploy our application. I am looking at formalizing this somewhat with a third party system designed for these purposes. I have looked into Phing before, and I get that it's basically like Ant. Bu...
[ 0.3998527228832245, 0.14929161965847015, 0.16101527214050293, 0.21012182533740997, -0.004150087013840675, -0.2117665559053421, -0.005174195393919945, 0.2869220972061157, -0.28142207860946655, -0.6542963981628418, 0.30148082971572876, 0.5374815464019775, -0.2126915007829666, -0.003140874672...
with CC. So I am not clear on the overlap here. Do I need both Phing and phpUnderControl to work with CruiseControl, or are they mutually exlclusive? What I need exactly is something that can: * Check out source from SVN * Install the database from SQL file * Generate some local configuration files from a series of ...
[ 0.7739389538764954, 0.03316565975546837, 0.5454044342041016, 0.4136812090873718, -0.174765482544899, -0.4069668650627136, -0.0363638773560524, -0.17192783951759338, -0.431932270526886, -0.4829191565513611, 0.3741508424282074, 0.7165696620941162, 0.05207125097513199, 0.005352010950446129, ...
it somewhere * Run a test coverage report Now, we have just about all of this in one form or another. But, it'd be nice to have it all automated and bundled together in one process. phing is pretty much ant written in PHP where phpUnderControl adds support for PHP projects to CruiseControl and uses phing or ant on the...
[ 0.48098477721214294, 0.08291687071323395, 0.4259261190891266, 0.1932208389043808, 0.22478511929512024, -0.2477290779352188, 0.2822885811328888, 0.29414546489715576, -0.13880044221878052, -0.7607215642929077, 0.3099634647369385, 0.4804176688194275, 0.011226262897253036, -0.1920575201511383,...
off of the build.xml file you can run just about any software you want through it.
[ 0.5498794913291931, 0.18075864017009735, 0.05013219267129898, 0.03807690367102623, 0.20013129711151123, -0.2673604190349579, -0.19785076379776, 0.2448337823152542, 0.012626920826733112, -0.722460150718689, -0.08283471316099167, 0.4947957694530487, 0.059521306306123734, 0.056846071034669876...
I am working on a form widget for users to enter a time of day into a text input (for a calendar application). Using JavaScript (we are using jQuery FWIW), I want to find the best way to parse the text that the user enters into a JavaScript `Date()` object so I can easily perform comparisons and other things on it. I ...
[ 0.48025137186050415, 0.1464870125055313, 0.28896450996398926, 0.03214270994067192, 0.11330990493297577, 0.11426831781864166, -0.06799910962581635, 0.03699652850627899, 0.19286015629768372, -0.6831179857254028, 0.3302857577800751, 0.10187754780054092, 0.036908771842718124, 0.139827325940132...
same `Date()` object: * 1:00 pm * 1:00 p.m. * 1:00 p * 1:00pm * 1:00p.m. * 1:00p * 1 pm * 1 p.m. * 1 p * 1pm * 1p.m. * 1p * 13:00 * 13 I am thinking that I might use regular expressions to split up the input and extract the information I want to use to create my `Date()` object. What is the best way to do this? A qui...
[ 0.27670377492904663, -0.19232305884361267, 0.7345179319381714, -0.1608697772026062, 0.22945855557918549, 0.1307813823223114, 0.20062312483787537, -0.2427097111940384, -0.42365679144859314, -0.5979079008102417, -0.17370256781578064, 0.5340307950973511, -0.3114217519760132, 0.331958889961242...
d.setMinutes( parseInt( time[2]) || 0 ); return d; } var tests = [ '1:00 pm','1:00 p.m.','1:00 p','1:00pm','1:00p.m.','1:00p','1 pm', '1 p.m.','1 p','1pm','1p.m.', '1p', '13:00','13', '1a', '12', '12a', '12p', '12am', '12pm', '2400am', '2400pm', '2400', '1000', '100', '123', '2459', '2359', '2359am', '...
[ 0.31884193420410156, -0.11024806648492813, 0.3695443868637085, 0.016461091116070747, 0.37356531620025635, 0.437875360250473, 0.5402683615684509, -0.4614097476005554, 0.07821193337440491, -0.6820448637008667, -0.36917126178741455, 0.5082610845565796, 0.003745277877897024, 0.1953783631324768...
for example). Obviously this is pretty crude but it's also pretty lightweight (much cheaper to use that than a full library, for example). > Warning: The code doe not work with 12:00 AM, etc.
[ 0.8545385003089905, 0.11825316399335861, 0.41565772891044617, 0.046917591243982315, 0.11227549612522125, -0.9200826287269592, 0.5869296193122864, 0.06288965791463852, -0.008882343769073486, -0.8616800308227539, -0.06784570217132568, 0.6705506443977356, 0.13745665550231934, -0.1886714845895...
What is the best way to specify a property name when using INotifyPropertyChanged? Most examples hardcode the property name as an argument on the PropertyChanged Event. I was thinking about using MethodBase.GetCurrentMethod.Name.Substring(4) but am a little uneasy about the reflection overhead. Don't forget one thing...
[ 0.2612721025943756, -0.12665285170078278, 0.12298834323883057, 0.22454431653022766, -0.3289646804332733, -0.34873512387275696, 0.012750482186675072, -0.01792779192328453, -0.3824573755264282, -0.5622794032096863, 0.34577521681785583, 0.7963233590126038, -0.11066703498363495, 0.310179680585...
`GetProperty` (at least the first time if it uses a cache of `PropertyInfo`), then `GetValue`. This last call is a dynamic invocation (MethodInfo.Invoke) of the property getter method, which costs more than the `GetProperty` which only queries meta data. (Note that data binding relies on the whole [TypeDescriptor](http...
[ -0.06857229769229889, -0.2084956020116806, 0.4052315652370453, 0.2776905298233032, -0.17857562005519867, -0.20258527994155884, 0.33447566628456116, -0.33347728848457336, -0.06166493520140648, -0.5124233365058899, -0.39693111181259155, 0.9431766867637634, -0.20523576438426971, -0.0660317838...
you could benefit from some kind on strongly typed event firing mechanism. Here is what I use sometimes in C# 3.0, when performances would not be a concern : ``` public class Person : INotifyPropertyChanged { private string name; public string Name { get { return this.name; } set ...
[ -0.13407114148139954, -0.42388927936553955, -0.03547385334968567, 0.11356720328330994, -0.07174811512231827, -0.17769722640514374, 0.19978460669517517, -0.1415398120880127, -0.19884458184242249, -0.4623560607433319, -0.07798630744218826, 0.8206015229225159, -0.13041123747825623, -0.0983600...
FirePropertyChanged(p => p.Name); } } private void FirePropertyChanged<TValue>(Expression<Func<Person, TValue>> propertySelector) { if (PropertyChanged == null) return; var memberExpression = propertySelector.Body as MemberExpression; if (memberExpression == nul...
[ -0.06650422513484955, -0.08757977932691574, 0.6401354670524597, -0.08842924237251282, 0.11098314821720123, 0.19098059833049774, 0.4706205725669861, -0.8087670207023621, -0.17799140512943268, -0.2808796167373657, -0.48443135619163513, 0.6918196082115173, -0.20800533890724182, 0.114072725176...
} public event PropertyChangedEventHandler PropertyChanged; } ``` Notice the use of the expression tree to get the name of the property, and the use of the lambda expression as an `Expression` : ``` FirePropertyChanged(p => p.Name); ```
[ -0.2618670165538788, -0.1033129096031189, 0.045542359352111816, -0.006130934692919254, 0.2852376699447632, -0.2933812141418457, 0.0403805747628212, -0.08334599435329437, -0.0865471139550209, -0.17542530596256256, -0.40791693329811096, 0.8462551236152649, -0.24275021255016327, 0.01542854961...
I have created a brand new project in XCode and have the following in my AppDelegate.py file: ``` from Foundation import * from AppKit import * class MyApplicationAppDelegate(NSObject): def applicationDidFinishLaunching_(self, sender): NSLog("Application did finish launching.") statusItem = NSSta...
[ 0.14964531362056732, 0.20935457944869995, 0.7581295371055603, -0.13578632473945618, 0.18708354234695435, 0.05218319594860077, 0.5681559443473816, -0.12170810997486115, -0.1738443523645401, -0.6340056657791138, -0.23911213874816895, 0.39899390935897827, -0.09040554612874985, 0.2028831094503...
to make it work: 1. Open MainMenu.xib. Make sure the class of the app delegate is `MyApplicationAppDelegate`. I'm not sure if you will have to do this, but I did. It was wrong and so the app delegate never got called in the first place. 2. Add `statusItem.retain()` because it gets autoreleased right away.
[ 0.2545185983181, -0.05354238301515579, 0.3912816047668457, 0.18158119916915894, 0.37063363194465637, -0.2935221493244171, 0.40170133113861084, 0.05572110041975975, -0.265427827835083, -0.615622878074646, -0.11800813674926758, 0.6061404347419739, -0.06988087296485901, -0.06012991443276405, ...
How do I create a file-like object (same duck type as File) with the contents of a string? For Python 2.x, use the [StringIO](https://docs.python.org/2/library/stringio.html) module. For example: ``` >>> from cStringIO import StringIO >>> f = StringIO('foo') >>> f.read() 'foo' ``` I use cStringIO (which is faster), ...
[ -0.07663469016551971, 0.028748001903295517, 0.36283811926841736, -0.18931753933429718, 0.07483330368995667, -0.0023164707235991955, -0.03935299441218376, -0.292324036359787, -0.19451285898685455, -0.5881896018981934, -0.17514568567276, 0.5757215023040771, -0.26091891527175903, -0.206446960...
I could probably write this myself, but the specific way I'm trying to accomplish it is throwing me off. I'm trying to write a generic extension method similar to the others introduced in .NET 3.5 that will take a nested IEnumerable of IEnumerables (and so on) and flatten it into one IEnumerable. Anyone have any ideas?...
[ 0.4456248879432678, -0.07464514672756195, 0.38829025626182556, -0.00015378206444438547, 0.02815975621342659, -0.11818640679121017, -0.032664425671100616, -0.16744031012058258, -0.08244188129901886, -0.9226524233818054, -0.07266564667224884, 0.6319350600242615, -0.2070361226797104, -0.00123...
TSequence : IEnumerable<TElement> { foreach (TSequence sequence in sequences) { foreach(TElement element in sequence) { yield return element; } } } ``` If that's not what you want, could you provide the signature of what you do want? If you don't need a generic form, a...
[ 0.37808316946029663, -0.026650320738554, 0.20158015191555023, 0.07543390989303589, 0.049221985042095184, -0.20692017674446106, -0.08955000340938568, -0.21550051867961884, 0.010819478891789913, -0.4689984619617462, -0.23076048493385315, 0.2495488077402115, -0.2610117197036743, -0.1439557224...
reasonably simple - although the recursive use of iterator blocks is relatively inefficient. Something like: ``` static IEnumerable Flatten(params object[] objects) { // Can't easily get varargs behaviour with IEnumerable return Flatten((IEnumerable) objects); } static IEnumerable Flatten(IEnumerable enumerab...
[ -0.27332165837287903, -0.15997706353664398, 0.4285195767879486, -0.10964787006378174, 0.3028070330619812, 0.03937641158699989, 0.3946157693862915, -0.44458964467048645, -0.13481439650058746, -0.5362805128097534, -0.19976520538330078, 0.6931205987930298, -0.18452776968479156, -0.25940340757...
{ yield return nested; } } else { yield return element; } } } ``` Note that that will treat a string as a sequence
[ -0.09306558221578598, -0.05604768544435501, -0.05150820314884186, -0.3787882328033447, -0.14360806345939636, -0.2023484855890274, 0.20986616611480713, -0.20428401231765747, -0.023732643574476242, -0.2365950495004654, -0.19991260766983032, 0.3536618649959564, -0.359958678483963, 0.235160022...