text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
return m_cmd; } // Gets updated from a timer (not direct user interaction) public bool EnableButton { get; set; } ``` Calling [`System.Windows.Input.CommandManager.InvalidateRequerySuggested()`](http://msdn.microsoft.com/en-us/library/system.windows.input.commandmanager.invalidaterequerysuggested.aspx) forces the Com...
[ -0.12650293111801147, 0.015945419669151306, 0.4947599172592163, -0.33813196420669556, -0.0578150637447834, 0.1669747531414032, 0.2611251771450043, -0.3211614489555359, -0.5079358816146851, -0.5582942366600037, -0.579343855381012, 0.6734546422958374, -0.3167684078216553, 0.28089413046836853...
I am reusing a curl function from a long time ago that is now acting differently than I remember. In this particular case, I'm authenticating a user's Twitter credentials. Here's the code as it stands now: ``` $cred = $_POST['twitter_username'].':'.$_POST['twitter_password']; $url = "http://twitter.com/account/verify_...
[ 0.22464314103126526, 0.2748545706272125, 0.8605342507362366, -0.2583410143852234, -0.2061508297920227, -0.1914285123348236, 0.5011269450187683, 0.0014342565555125475, 0.05337538197636604, -0.4540006220340729, -0.1166481152176857, 0.44427502155303955, -0.4293467104434967, -0.141499266028404...
I'm lose on what it is. Thanks You need this option: ``` curl_setopt(CURLOPT_RETURNTRANSFER, true); ``` From the [curl docs](http://www.php.net/curl_setopt): > `CURLOPT_RETURNTRANSFER`: TRUE to return > the transfer as a string of the return > value of curl\_exec() instead of > outputting it out directly.
[ 0.21360358595848083, -0.04270382970571518, 0.5995096564292908, 0.06092306599020958, -0.034057505428791046, -0.25990158319473267, 0.07952609658241272, 0.053176045417785645, 0.22270585596561432, -0.43600136041641235, -0.1691671758890152, 0.690559983253479, -0.20370107889175415, 0.13085554540...
I created a widget that users of my site will embed on their web sites. I want to track the amount of times a widget renders as well as the referring URL. The widget was written in flex and my back end is Rails. One obvious way to do this would be to have my widget make a service call to the back end to register a hit...
[ 0.33373379707336426, -0.006284521427005529, 0.6413662433624268, -0.1885858178138733, -0.5930432677268982, 0.17649006843566895, 0.23720619082450867, -0.12076346576213837, 0.06206536665558815, -0.9122702479362488, 0.3813244104385376, 0.4241122603416443, -0.043066199868917465, 0.1238143667578...
the config, one to render). I could make the config.xml dynamic and just process a render there, and then return the XML...but could this be bad for scaling? Another would be to make the embed source URL point to a script that processes a hit and then returns a swf...i am pretty sure this is possible. But I am also no...
[ -0.05897238105535507, -0.25900396704673767, 0.7726913094520569, 0.03143423795700073, -0.37333664298057556, 0.3079180419445038, 0.04242429509758949, 0.01351534016430378, -0.12498990446329117, -0.6455142498016357, -0.05684962123632431, 0.7756270170211792, -0.5121957063674927, -0.283827960491...
key is the first item and so forth, it'll be reasonably efficient. The mapping from a list of tuples to a tree is not clear from what you're describing. Please draw it out, or explain it more thoroughly. For example, your example appears to be: [![tree diagram](https://i.stack.imgur.com/SWPUZ.png)](https://i.stack.im...
[ -0.2348925620317459, -0.44706541299819946, 0.39438286423683167, 0.17047160863876343, 0.05153041332960129, -0.18314021825790405, 0.03760167956352234, -0.09493439644575119, -0.4822731018066406, -0.5599457025527954, -0.48433420062065125, 0.18286104500293732, -0.14773882925510406, 0.1932807415...
I'm having trouble writing a query. I have a support tabled called 'MYTABLE' and it has a column called 'TABLENAME' that can have one or many table names in it. Multiple Tables are separated with commas. Example: ``` TBLUSER TBLUSER, TBLACCOUNT ``` I'm trying to write an query that will identify any entries in the ...
[ -0.0323706679046154, 0.3860788345336914, 0.23688392341136932, -0.13708673417568207, -0.07761713117361069, 0.08599025756120682, 0.19477465748786926, 0.11380761861801147, -0.18410152196884155, -0.6671234965324402, 0.12731491029262543, 0.03231543302536011, -0.4344903230667114, 0.2779908180236...
FROM MYTABLE T1 LEFT outer JOIN ALL_TAB_COLS T2 ON ( upper(T1.TABLENAME) = upper(t2.Table_Name) AND T2.Owner = 'ME'
[ -0.5794103741645813, 0.31409019231796265, 0.710772693157196, -0.15456987917423248, 0.03439801558852196, 0.20390143990516663, -0.16238811612129211, 0.04511268436908722, -0.217971533536911, -0.48913076519966125, -0.2437063604593277, 0.2514611482620239, -0.2193022221326828, 0.304333359003067,...
) WHERE TABLE_NAME IS NULL; ``` And it works exactly how I want - but it only works when the entry in MYTABLE contains a single table. When there are multiple tables separated by commas - it fails. My SQL skills are somewhat lacking and my natural instinct is to 'Do a For Each' but I feel that'...
[ -0.16751302778720856, 0.5013834238052368, 0.3267519772052765, -0.18644139170646667, -0.16820745170116425, 0.052945900708436966, 0.4049493968486786, -0.12044504284858704, -0.08221083134412766, -0.5333558917045593, 0.0009882919257506728, 0.09974835067987442, -0.32901501655578613, 0.209444761...
not the right approach (and I have no idea how to do that in SQL). You're storing a string in MYTABLE.TABLENAME and trying to match it against a string in ALL\_TAB\_COLS.TABLE\_NAME (which btw, I don't see any reason you would use ALL\_TAB\_COLS instead of ALL\_TABLES in this case). If your string is 'TBLUSER, TBLACCO...
[ -0.0013298271223902702, 0.1540672332048416, 0.23720712959766388, 0.20707207918167114, -0.030010446906089783, -0.0917658731341362, -0.04009247198700905, -0.3413083553314209, -0.16120487451553345, -0.6370580792427063, 0.1379295438528061, 0.5625556111335754, -0.24512915313243866, 0.1024384349...
table names. The brute-force method to make what you have work using string comparisons is to change the condition to `','||upper(T1.TABLENAME)||',' LIKE '%,'||upper(t2.Table_Name)||',%`. So you basically would be looking at whether TABLE\_NAME is a substring of your TABLENAME column value. However, the real point is...
[ -0.24458448588848114, 0.20054854452610016, 0.2655014097690582, 0.09493987262248993, -0.27927669882774353, -0.2066723257303238, 0.05167525261640549, -0.055572472512722015, -0.31998175382614136, -0.7154967188835144, -0.013244169764220715, 0.3385361433029175, -0.4452567994594574, 0.2911468148...
the way we do things in relational databases. If your MYTABLE looks like this: ``` ID TABLENAME 1 TBLUSER 2 TBLUSER, TBLACCOUNT ``` then a more proper relational way to design the table would be: ``` ID TBL_NUM TABLENAME 1 1 TBLUSER 2 1 TBLUSER 2
[ 0.13934433460235596, 0.4125821590423584, 0.15592049062252045, -0.020763035863637924, -0.14850161969661713, -0.07111427187919617, -0.3958171606063843, 0.0307366531342268, -0.28434860706329346, -0.6864030957221985, 0.2370986044406891, 0.25415173172950745, -0.47062936425209045, 0.288345903158...
2 TBLACCOUNT ``` Then your query would work as-is, more or less, because the TABLENAME column would always contain the name of a single table.
[ -0.1891677975654602, 0.14530734717845917, 0.3286236822605133, 0.031800948083400726, -0.1490125209093094, -0.3090633749961853, -0.1029990017414093, -0.3039807379245758, -0.07943964004516602, -0.5791864395141602, -0.2820388674736023, 0.33812054991722107, -0.647590696811676, 0.029221162199974...
I can't seem to figure out how to make a resize drag handle in Java Swing. If you're not sure what I mean, open up the "Ask Question" page on this website and look at the bottom of the text area. It has a bar which you can drag in order to change the size of the area. I'm looking for a way to do this in Java Swing. I d...
[ 0.5210477709770203, -0.11515400558710098, 0.37935635447502136, 0.014195756055414677, -0.36865368485450745, 0.006798130460083485, -0.09966326504945755, -0.30830711126327515, -0.3131316900253296, -0.4050329327583313, 0.41060858964920044, 0.6126140356063843, -0.1842368096113205, -0.1778986752...
of a vertical [JSplitPane](http://java.sun.com/javase/6/docs/api/javax/swing/JSplitPane.html), both in appearance and functionality.
[ 0.18497596681118011, -0.23187261819839478, 0.591683566570282, -0.2343507707118988, -0.26142826676368713, 0.08586927503347397, 0.013446071185171604, -0.20051079988479614, -0.6147463321685791, -0.2986072599887848, -0.19218531250953674, 0.025288118049502373, -0.29855096340179443, -0.217389509...
Anyone out there using YAML as a data DSL in .NET? I'd like to use YAML because it's more lightweight than XML. I intend to use this DSL as a "power user" configuration tool for one of my existing applications. My concerns: * How is the support for YAML using one of the .NET community libraries? * Does YAML have sta...
[ 0.6547294855117798, 0.026000112295150757, 0.43642187118530273, 0.12600386142730713, -0.1457594484090805, -0.6652098298072815, 0.14260798692703247, 0.1687963455915451, -0.4107728600502014, -0.39049747586250305, 0.0021352239418774843, 0.33947136998176575, -0.10040655732154846, 0.147284701466...
or maintain JSON or XML documents. If it's a user-facing document, don't worry about the 'staying power' of YAML. Worry about making the users happy with some DSL. That being said, I would choose YAML over XML. Outside of the user-facing portion, I wouldn't use YAML for much. XML has so much more going for it \*that I...
[ 0.5832375288009644, 0.16029812395572662, 0.22867710888385773, 0.10154690593481064, -0.33590975403785706, -0.24913187325000763, 0.3775940537452698, 0.374792218208313, -0.15275095403194427, -0.4540243148803711, -0.3325790762901306, 0.7725073099136353, -0.17256000638008118, -0.289828479290008...
look at XML.
[ 0.2774946689605713, 0.14606890082359314, -0.21903938055038452, 0.16090162098407745, -0.18324746191501617, -0.15025289356708527, -0.25622421503067017, 0.03325319662690163, -0.15357272326946259, -0.25476154685020447, -0.10776488482952118, 0.17163415253162384, -0.2685072422027588, -0.13882490...
I currently have 4 textboxes which will be used to store an ip address. What i need help with is a function that will allow a user to input a "." and have the textbox change focus from the current textbox to the next textbox. Thanks in advance Assuming your textboxes are named ip0, ip1, ip2, ip3: ``` $(document).read...
[ 0.038599614053964615, 0.08989445865154266, 0.7597580552101135, 0.1127864271402359, 0.2590287923812866, 0.05799778178334236, 0.1517622321844101, -0.24375872313976288, -0.05955178290605545, -0.8914502263069153, -0.3063458502292633, 0.37232205271720886, -0.0062899817712605, 0.336544930934906,...
var i = Number(this.id.replace(/ip/,'')) +1; $('#ip'+i).focus(); } }); }); ```
[ 0.19781635701656342, -0.08388298749923706, 0.5126053690910339, -0.2805021107196808, 0.24647843837738037, -0.017703257501125336, 0.25155511498451233, -0.20215272903442383, -0.061162203550338745, -0.45598411560058594, -0.4428524971008301, 0.6375358700752258, -0.48861411213874817, 0.276484012...
From inside of the `fireAlert()` function, how can I reference the element that called it, without having to pass `this` as an argument through the link? ``` <script type="text/javascript"> //function function fireAlert(){ alert(); } </script> <a href="javascript:;" onclick="fireAlert();">Fire</a> ``` There ar...
[ 0.16913259029388428, 0.0698232427239418, 0.705540120601654, -0.25906234979629517, -0.15101070702075958, -0.34976041316986084, 0.13854815065860748, -0.48111867904663086, -0.0245872363448143, -0.5301305055618286, -0.225081205368042, 0.6075438857078552, -0.23498882353305817, -0.30716958642005...
one. ``` <html> <head> <script language="javascript"> function fireAlert(e) { var whoCalled = e ? e.target : event.srcElement; alert(whoCalled.innerHTML); } window.onload=function() { var allHrefs =
[ 0.06631540507078171, -0.20341701805591583, 0.46036669611930847, -0.2184266746044159, 0.034904204308986664, 0.018282361328601837, 0.3838809132575989, -0.3118675649166107, 0.003578957635909319, -0.6509584188461304, -0.32600393891334534, 0.7024694681167603, -0.5377177000045776, -0.18937996029...
document.getElementsByTagName("a"); for(i=0;i<allHrefs.length;i++) { allHrefs[i].onclick=fireAlert; } } </script> </head> <body> <a href="#">Hello #1</a> <a href="#">Hello #2</a>
[ 0.13984692096710205, 0.0429072305560112, 0.6947659850120544, -0.25719153881073, -0.02360762655735016, -0.15132136642932892, 0.5409457087516785, -0.7379341721534729, 0.05713026598095894, -0.6305911540985107, -0.4934883713722229, 0.2403242141008377, -0.28065356612205505, 0.03745902329683304,...
<a href="#">Hello #3</a> <a href="#">Hello #4</a> </body> </html> ```
[ 0.11585822701454163, 0.39222320914268494, 0.5838078260421753, -0.32061415910720825, -0.3229575753211975, 0.1895308941602707, 0.19127380847930908, -0.4764682948589325, -0.1524650603532791, -0.43143230676651, -0.7821044325828552, 0.34074661135673523, -0.2013349086046219, -0.19021722674369812...
I need to get all the objects whose id matches a specific pattern . How can I do it? Thanks! Current Browsers: ```js // DOM collection as proper array const matches = Array.from(document.querySelectorAll('[id^=log_]')); ``` --- Older Browsers: (IE9+) ```js // Use Array.prototype.slice to turn the DOM collection i...
[ -0.08984429389238358, -0.0956190824508667, 0.787358820438385, -0.14877912402153015, -0.07657226175069809, -0.05595885217189789, 0.4901493489742279, -0.6704273223876953, -0.15006299316883087, -0.7476041913032532, -0.21219398081302643, 0.6430490016937256, -0.35033118724823, 0.115529239177703...
I am looking to start working on a personal site using C#. I work as a web developer and have used VBScript previously and am using Coldfusion now at work. I use Dreamweaver for development in these languages. I have read a lot of people recommending that you should use a MS IDE to develop in .net and that C# is the w...
[ 0.6125485897064209, 0.24319666624069214, -0.05047710984945297, -0.008475737646222115, -0.029349373653531075, -0.13532207906246185, 0.08874394744634628, 0.44270461797714233, -0.043345917016267776, -0.808455228805542, 0.10717571526765823, 0.33522987365722656, -0.21771658957004547, 0.26880285...
at the same time. Will using something like Visual Studio help with developing in .net so much that it is worth the effort of changing from Dreamweaver? If so which IDE would be best to learn with? If I choose to stick with Dreamweaver is there any recommendations you can make as to how to best setup Dreamweaver for...
[ 0.23219896852970123, -0.17731589078903198, 0.033138614147901535, 0.408491849899292, -0.13348475098609924, -0.3649705648422241, -0.14780117571353912, 0.3248225450515747, -0.19690273702144623, -0.9124259352684021, 0.0400475412607193, 0.6977401971817017, 0.0067213051952421665, 0.0898756384849...
[Visual Studio Express 2013 for Web](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-web) (which is free) and enjoy. It's a Windows app, like many other Windows apps! You don't need professional training to use it.
[ 0.30939820408821106, -0.244445338845253, 0.5225430130958557, 0.03715522587299347, -0.5791087746620178, -0.03116689808666706, 0.22777174413204193, 0.2840385437011719, -0.24628634750843048, -0.45799604058265686, -0.21960441768169403, 0.30525532364845276, 0.3658350706100464, -0.05846850201487...
I want to develop a web application, like an online scheduler. (Yes I know it's been done a million times.) Most of my experience is in Java, so I want to leverage that when considering technologies. I've primarily been a systems developer with little exposure to UI programming, so I think this is where I will need to...
[ 0.47933220863342285, 0.2075498253107071, -0.0670040026307106, 0.07996522635221481, 0.21029354631900787, -0.21621957421302795, 0.21464252471923828, 0.1379229575395584, -0.24247069656848907, -0.9691908359527588, 0.1439601182937622, 0.5714795589447021, 0.111318439245224, 0.07444893568754196, ...
up): * Database (likely MySQL or PostgreSQL) - SQL, JDBC * Back end server - Java * Web server (Tomcat) - JSP, Servlets * Web Framework - Tapestry (weak on this, any better alternatives?) * Browser technologies - HTML, Javascript, CSS (need to learn) I've heard about "Rich internet application" development tools such...
[ 0.5171977281570435, 0.010443332605063915, 0.24590745568275452, 0.3707704544067383, -0.2684507668018341, 0.059555456042289734, 0.0162513367831707, -0.0246539618819952, -0.5858064889907837, -0.5054500699043274, -0.28513768315315247, 0.09996142238378525, -0.11719278246164322, -0.0952593907713...
on you. Web Framework - Wicket / Stripes / JSF / Tapestry (component vs request based frameworks) Javascript Library - JQuery / YUI / Dojo As for your template language you could use JSP / Velocity / Freemarker. Just study up on the frameworks and tools maybe try a few out and see which ones work best for you. Jus...
[ 0.5209363102912903, -0.38252314925193787, 0.24945564568042755, 0.3721767067909241, -0.27821826934814453, 0.019441459327936172, 0.030500369146466255, 0.2505170404911041, -0.4881190359592438, -0.8288366794586182, -0.24951975047588348, 0.47684693336486816, -0.14203518629074097, -0.32518735527...
I have been unable to find any documentation on the .build method in Rails (i am currently using 2.0.2). Through experimentation it seems you can use the build method to add a record into a `has_many` relationship before either record has been saved. For example: ``` class Dog < ActiveRecord::Base has_many :tags ...
[ 0.16033464670181274, 0.1697515845298767, 0.040706150233745575, -0.21398714184761047, -0.01094330009073019, -0.22400398552417755, 0.34381890296936035, -0.3126557469367981, -0.09689997136592865, -0.7717325687408447, 0.29274991154670715, 0.545719563961029, -0.17503802478313446, 0.406246453523...
= Dog.new d.person = Person.new d.save # => true ``` The foreign key in `Dog` is not set in this case due to the fact that at the time it is saved, the new person does not have an id because it has not been saved yet. My questions are: 1. How does build work so that Rails is smart enough to figure out how to save t...
[ 0.5402095913887024, 0.1940724104642868, -0.14125055074691772, -0.045207347720861435, 0.10075145959854126, -0.11205616593360901, 0.4622647762298584, -0.578986406326294, -0.059259649366140366, -0.6452639698982239, 0.22036069631576538, 0.4330134391784668, -0.5824673175811768, 0.02633334882557...
ActiveRecord::Associations::ClassMethods](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html)" > collection.build(attributes = {}, …) > Returns one or more new objects of the > collection type that have been > instantiated with attributes and > linked to this object through a > foreign...
[ -0.04835659638047218, -0.22846300899982452, 0.3259417712688446, -0.10026973485946655, -0.08177878707647324, -0.15242871642112732, 0.5033660531044006, -0.49188804626464844, -0.17972953617572784, -0.6495911478996277, -0.25546374917030334, 0.6536020636558533, -0.4503006935119629, 0.0383544117...
Tag.new t.build_dog(:name => "Rover", :breed => "Maltese") ``` You can also use create\_dog to have it saved instantly (much like the corresponding "create" method you can call on the collection) How is rails smart enough? It's magic (or more accurately, I just don't know, would love to find out!)
[ 0.4159310460090637, -0.511182963848114, 0.23654282093048096, 0.15294671058654785, 0.2330729067325592, -0.2065209001302719, 0.37940728664398193, -0.14207984507083893, -0.09845792502164841, -0.9889264702796936, 0.07177585363388062, 0.6361051201820374, -0.176443949341774, -0.18009814620018005...
I have an ASP.NET application. I want users to be able to upload documents. Where in the file system should I store those documents? Users should be able to upload them and see the hyperlinks to them on the site, but UserA should not be able to see UserB's documents, but the administrator role should be able to see all...
[ 0.417024701833725, 0.29445773363113403, 0.27353528141975403, -0.07210192829370499, -0.03236456587910652, -0.1722220629453659, 0.1098637804389, -0.20805534720420837, -0.5609532594680786, -0.6992045640945435, -0.07435255497694016, 0.3001452088356018, -0.05973243713378906, 0.12550866603851318...
file paths in the database. Somebody please give me some best practices. Thanks! Depending on the size of the files, one options would be to store the files outside the web root so no one could hot-link to them, then, as has been suggested, produce a page that takes some arguments and [Response.WriteFile()](http://msd...
[ 0.405223548412323, 0.06679036468267441, 0.43997126817703247, 0.21545299887657166, -0.06452714651823044, -0.15671896934509277, 0.3613286316394806, -0.19855232536792755, -0.3481627404689789, -0.8172134757041931, 0.056643497198820114, 0.5908838510513306, -0.1473216414451599, 0.112855441868305...
renamed to something like a GUID or just an integer ID taken from the database table. Then when you write the file to the output stream you can use a [content disposition header](http://support.microsoft.com/kb/260519) to rename the file back to the original name. HTH!
[ 0.48062750697135925, -0.07632093876600266, 0.45546823740005493, 0.16933830082416534, -0.00041109180892817676, -0.09017390757799149, 0.1627650260925293, 0.08979501575231552, -0.4214548170566559, -0.61240154504776, -0.408127099275589, 0.13088293373584747, -0.15722505748271942, 0.583919823169...
I have the following situation. Im getting data from an external system in the form ``` UserId Group Value 1 Abc ..... 1 Abc ..... 1 Bcd ..... 2 Abc ..... ``` I need to massage this data into my schema, i.e. ``` Parent Table ID UserID Group Name 1 1 Abc
[ 0.19134323298931122, 0.43377524614334106, 0.3627683222293854, -0.09887981414794922, 0.10429326444864273, 0.03888589143753052, -0.057065125554800034, -0.43072816729545593, 0.000728512299247086, -0.6427668929100037, -0.026359645649790764, 0.3206743896007538, -0.5642289519309998, 0.1491240113...
User 1 - Abc data 2 1 Bcd User 1 - Bcd data 3 2 Abc User 2 - Abc data Child Table ParentID Value 1 ..... 1 ..... 2 ..... 3 ..... ``` So there is a 1 to
[ -0.031499121338129044, 0.35911551117897034, 0.2537696957588196, -0.08612514287233353, 0.05236808583140373, 0.3104441463947296, -0.21462009847164154, -0.3959391415119171, 0.08655600249767303, -0.49522683024406433, -0.026332098990678787, 0.040050894021987915, -0.4330665171146393, 0.180991381...
1 between the child data and the data from the external system. The issue is that I am starting with the child data and need to write a query that can create a parent record based on distinct combinations of UserID and Group ``` insert parent (userId, group, name) select distinct userId, group, concat("user ", userId, ...
[ -0.07860219478607178, 0.14938661456108093, 0.07563351839780807, 0.05973782762885094, 0.430656373500824, 0.4801919758319855, -0.34149253368377686, -0.317417711019516, 0.07951468974351883, -0.6741123199462891, -0.11518716812133789, 0.34227052330970764, -0.25492435693740845, 0.210563555359840...
Is it possible to add messages to the built-in error console of Firefox from JavaScript code running in web pages? I know that I there's Firebug, which provides a `console` object and its own error console, but I was looking for a quick fix earlier on and couldn't find anything. I guess it might not be possible at al...
[ 0.32511934638023376, 0.324392169713974, 0.21103614568710327, -0.0625680536031723, -0.12231497466564178, -0.27590352296829224, 0.5564640164375305, 0.15129171311855316, -0.02398267388343811, -0.5687668323516846, -0.09975623339414597, 0.643796443939209, -0.6740173697471619, -0.255781680345535...
installation into the browser (nor, in fact, does it even require Firefox). It's a script which you can include into any web page (even dynamically), which will give you some basic Firebug functionality (such as `console.log()`).
[ 0.27576303482055664, -0.07315858453512192, 0.34917017817497253, -0.02151862159371376, 0.4642940163612366, -0.5712899565696716, 0.03615022078156471, 0.1859665960073471, 0.0204133540391922, -0.8401315212249756, -0.4936467707157135, 0.6385457515716553, -0.16202256083488464, -0.246598884463310...
Will Java code built and compiled against a 32-bit JDK into 32-bit byte code work in a 64-bit JVM? Or does a 64-bit JVM require 64-bit byte code? To give a little more detail, I have code that was working in a Solaris environment running a 32-bit JVM, but now I'm getting issues after upgrading the JDK and Weblogic Ser...
[ 0.16220895946025848, 0.1621236950159073, -0.21485967934131622, 0.05233778432011604, -0.19617508351802826, -0.148818701505661, -0.12683339416980743, -0.13740262389183044, -0.2401176244020462, -0.6081154942512512, 0.15214869379997253, 0.7561913132667542, -0.46652311086654663, -0.156472310423...
This question is a derivative of a previous question: [How to version resources that are shared across projects](https://stackoverflow.com/questions/761885/source-control-how-to-version-resources-that-are-shared-across-projects) I have a project that contains code that is consumed by many other projects. Specifically,...
[ 0.32317301630973816, -0.17009951174259186, 0.28773146867752075, 0.19779640436172485, 0.2518005967140198, -0.28052306175231934, -0.06335075199604034, 0.08518041670322418, -0.2840202748775482, -0.7779823541641235, -0.07990953326225281, 0.4665898084640503, -0.0023028235882520676, 0.2855896949...
me "There are no changes to merge." From my perspective, this isn't true, since the recently updated files are clearly different. Is there a fundamental misunderstanding of the merge process in TFS here? What do I need to do differently? The TFS merge engine relies almost entirely on history, not file contents. This...
[ 0.38598012924194336, -0.03859240934252739, 0.2745898365974426, 0.06971849501132965, -0.07557446509599686, -0.14375220239162445, 0.42408958077430725, -0.3107464015483856, -0.011717002838850021, -0.9690729379653931, -0.18248620629310608, 0.5002884268760681, -0.3362260162830353, 0.08609473705...
new to branching & merging in TFS then your history is probably not very complex. I think it's likely you'll find your answer with one quick call to *tf merges*. However, tracing merge history can become extremely convoluted in the general case, so if you have trouble feel free to post back with more details.
[ 0.6381853818893433, -0.32268673181533813, 0.04859646037220955, 0.1995709240436554, -0.061509571969509125, -0.4024096131324768, 0.22752046585083008, 0.14087721705436707, -0.294782817363739, -0.7650800347328186, 0.10611963272094727, 0.2206648588180542, 0.007286461535841227, 0.296705245971679...
In Monorail there's a transform filter concept, where a rendered view can then have further processing applied to it. Use cases: * Process markdown * Remove whitespace * Strip unwanted characters I suspect there is no out-of-the-box method of doing this in ASP.NET MVC but does anyone have a suggested approach? I'm us...
[ 0.07694915682077408, -0.40126341581344604, 0.3591132164001465, 0.2122877538204193, -0.17191541194915771, 0.17638587951660156, 0.24867777526378632, -0.11400485783815384, -0.17137308418750763, -0.7184315323829651, 0.03423428535461426, 0.35269591212272644, -0.2862558960914612, -0.270920693874...
Is it possible to completely negate a web.config in a subfolder? Obviously, I have a web.config in the root. If I have a subfolder called "MyApp", can I write a bunch of code in there and have it run without any reference to the web.config at root? It would have its own web.config, and wouldn't even reference the "hi...
[ 0.23566262423992157, 0.1429889053106308, 0.21465693414211273, 0.2071589082479477, 0.05260705575346947, 0.09211872518062592, 0.34921595454216003, 0.01117820292711258, -0.3704107105731964, -0.48220473527908325, 0.07060293108224869, 0.322501003742218, -0.5223563313484192, 0.041333604604005814...
know I can use the "clear" element, but is that the best way? Just put a "clear" under every top level element? Just wondering if there's another way. Duplicate of [Will a child application inherit from its parent web.config?](https://stackoverflow.com/questions/778635/will-a-child-application-inherit-from-its-parent-...
[ 0.402517169713974, -0.01149092148989439, 0.26763302087783813, 0.15635260939598083, 0.48622769117355347, -0.3706754446029663, 0.34148257970809937, 0.08316686749458313, -0.39438560605049133, -0.4189906716346741, -0.2075444757938385, 0.2973857522010803, -0.10693661123514175, 0.394185543060302...
also lose access to the /bin folder, /app\_code folder, etc. This may or may not be what you want. Whether you can create sub-applications with your host is another matter to consider as well.
[ 0.1375332772731781, 0.07412317395210266, 0.09988848119974136, 0.3134673237800598, 0.25631237030029297, -0.29959380626678467, 0.6040632128715515, 0.23483893275260925, -0.34743309020996094, -0.7823518514633179, -0.37316402792930603, 0.5238127708435059, -0.25076186656951904, 0.320944994688034...
Greetings, I am trying to learn pointers in C, I simply want my "addtwo" function to add 2 to every element of the input integer array, yet I get odd compilation errors, here is the non-pointer version which indeed won't properly compile. ``` addtwo(int *arr[]) { int i=0; for(;i< sizeof(arr)/sizeof(int);i++) {...
[ -0.29765915870666504, 0.3570786416530609, 0.5625671744346619, -0.4358639121055603, -0.22569480538368225, 0.23267121613025665, 0.5146700143814087, -0.32890796661376953, -0.09097220003604889, -0.5435142517089844, -0.17536661028862, 0.5496124029159546, -0.5360053777694702, 0.04614725336432457...
Typically you would either pass the size of the array as a separate arg or have some special value marking the last element.
[ 0.2272901087999344, -0.1740042269229889, 0.1026926189661026, -0.09780237823724747, -0.24321521818637848, -0.041497502475976944, 0.07858861237764359, -0.28979602456092834, -0.23052920401096344, -0.23173412680625916, -0.37820127606391907, 0.027480686083436012, -0.0074810669757425785, 0.00098...
Let's say I have Plans and Documents ``` Dim myPlans = _context.Plans.Where(predicate1) Dim myDocuments = _context.Documents.Where(predicate2) ``` I have structured the where clause for each using PredicateBuilder. So, myPlans and myDocuments have a correct SQL statement. What I'd like to do is join these two table...
[ 0.3091183602809906, 0.3693320155143738, 0.6050261855125427, -0.09748587757349014, 0.28898632526397705, -0.0029521938413381577, -0.17904435098171234, -0.34481534361839294, 0.07862461358308792, -0.7567601203918457, 0.005627279169857502, 0.485996812582016, 0.13520896434783936, 0.1907224357128...
the **desired** result Where clause is: Where (d.ID = p.ID) AND (myplans where clause above) **OR** (mydocument where clause above). Meaning, I'd like the two where clauses in each of the tables to be "or" instead of "And". The current result where clause is: Where (d.ID = p.ID) AND (myplans where clause above) ...
[ 0.08169986307621002, 0.038692668080329895, 0.9308193922042847, -0.22033435106277466, 0.21976423263549805, 0.30144423246383667, -0.23230303823947906, -0.4535799026489258, -0.05912293866276741, -0.6105146408081055, -0.13277873396873474, 0.5754165053367615, 0.16691546142101288, 0.078687816858...
in MyPlans on d.ID Equals p.ID _ Select d.Name, p.Name ``` In order to achieve your desired result, you need to do the predicate filterings and joins in on single statement. ``` Dim myCriteria() = {"test", "bed"} Dim test = from d in _context.Documents _ join p in _context.Plans on d.ID Equals p...
[ 0.20289067924022675, -0.033313099294900894, 0.6801565885543823, 0.14663073420524597, 0.3002234697341919, 0.20378068089485168, -0.15063273906707764, -0.4670969545841217, -0.01691209338605404, -0.7950447797775269, -0.31198978424072266, 0.12580008804798126, -0.06491093337535858, 0.07838086783...
myCriteria.Contains(d.Descrition)) _ OR (myCriteria.Contains(p.Name) OR _ myCriteria.Contains(p.Description)) _ select Document = d.Name, Plan = p.Name ```
[ -0.05189965292811394, 0.04042348265647888, 0.4412669539451599, 0.3584628999233246, 0.6305280327796936, -0.08960594981908798, 0.018904801458120346, -0.33018484711647034, -0.22623202204704285, -0.9300660490989685, -0.5811256170272827, 0.21723073720932007, -0.18796083331108093, 0.291132181882...
I have installed a xampp (apache + mysql + php) stack on a portable volume (truecrypt volume on a usb drive) that I use on different linux machines, for webapp development. This volume is formatted in ext3, so I run into permissions problems as I can't be the same user on each machine. For example I tried to check the...
[ -0.0066407970152795315, 0.2753697335720062, 0.34951576590538025, 0.14281289279460907, -0.12774741649627686, -0.1658644676208496, 0.08511532098054886, -0.08886511623859406, -0.2542026937007904, -0.5646558403968811, 0.07912024855613708, 0.27270352840423584, -0.2603779435157776, 0.24328118562...
files is messy. This time I am also worried about special cases like git files and the symfony web framework I installed lately. How should I deal with this situation? I would love to set this permission issue properly. Thanks a lot for your attention. --- Edit : I may need to write a script to locally "sudo chown ...
[ 0.40242403745651245, 0.2794189453125, 0.583526611328125, 0.11947065591812134, -0.2709757089614868, -0.28756555914878845, 0.2602876126766205, 0.07926420867443085, -0.5324836373329163, -0.7256870865821838, -0.17330974340438843, 0.5722305178642273, -0.3410327732563019, 0.2291446328163147, 0...
local group. * polypheme is a username * lamppusers is a groupname * webdir is the directory containing all my web development files Note that on computer 1 my username is polypheme and I belong to the group lamppusers, and on computer 2 my username is polypheme and I belong to the group lamppusers. The usernames and...
[ 0.08909577876329422, 0.30600857734680176, 0.36790767312049866, -0.034716006368398666, -0.15861313045024872, 0.04547161981463432, 0.2194456160068512, 0.10852698236703873, -0.1818867027759552, -0.8875081539154053, -0.2560787498950958, 0.185236394405365, -0.3255232274532318, 0.029270639643073...
``` It would be the wrong thing to do with protected files in the symfony framework. And .git/ files too I guess. (gbjbaanb was right about this) At this point, I have recovered the same configuration I used to have on the other machine, which is what I was looking for. I can work again. Knowing this, my question su...
[ 0.26982054114341736, 0.4233566224575043, 0.24480386078357697, 0.07367774844169617, 0.1646793782711029, -0.23687124252319336, 0.3084823191165924, -0.1931273341178894, -0.41974955797195435, -0.7762366533279419, -0.22602321207523346, 0.7344159483909607, 0.13726770877838135, 0.0161435995250940...
I am working on an SDK that is targeting both the Full/Desktop .Net Framework and the Compact .Net Framework. As such I have a solution that has projects for the Compact Framework and the full framework. The project files contain the same source files, or thay should. Some of the developers that are working on this SDK...
[ 0.599403977394104, 0.21853481233119965, 0.0828307569026947, -0.04613684490323067, -0.040641117841005325, -0.16091279685497284, -0.0020511699840426445, 0.03159284219145775, -0.048200853168964386, -0.9023122191429138, -0.034509122371673584, 0.47148674726486206, -0.18610645830631256, 0.041075...
references this new type. Then the build fails that evening because the compact framework project does not include the new file. Does anyone know of a tool or trick to verify that two project files are in sync? Remember that the files are not identical (one is for the compact framework and the other for the full framew...
[ 0.5177400708198547, 0.01317952573299408, -0.17204676568508148, 0.18606404960155487, -0.17125166952610016, -0.3869093358516693, 0.5367345809936523, -0.06192661076784134, -0.043974436819553375, -0.6448432207107544, 0.35277488827705383, 0.6974503993988037, -0.41422203183174133, 0.145859628915...
possible. If you don't, please check out JetBrains Team City, Cruise Control, or Microsoft Team Systems Team Build. Depending on your source control server, you might be able to setup check-in policies as well. So if a particular file is checked in, and alert is generated. But typically I share as much code as I can...
[ 0.23188167810440063, -0.13968829810619354, 0.24934810400009155, 0.572516679763794, 0.3302421271800995, -0.2442016303539276, -0.11725518852472305, 0.2912229299545288, -0.16824492812156677, -0.8864343166351318, 0.03984447568655014, 0.45901352167129517, -0.2553251087665558, -0.481607735157012...
I've set up an example of what I'm running into here: <http://studiozion.com/cssproblem/fix_it.htm>. Relevant code blocks... ```css <style type="text/css"> body { background: transparent url(Grade300_Color1.png) repeat-x } .RowMaker { overflow: auto; } .ColumnMaker { float: left; } .Colu...
[ -0.018993331119418144, -0.20528022944927216, 0.9237003922462463, 0.12899059057235718, 0.15629208087921143, 0.3201161026954651, 0.18242815136909485, -0.3272136151790619, -0.25644904375076294, -0.6364206075668335, -0.2000184953212738, 0.5413786768913269, -0.14684297144412994, -0.137074425816...
} .ControlCurveLeft1 { height: 6px; width: 6px; background: transparent url(ControlCurve1.png) no-repeat bottom left } </style> ``` ```html <div class="RowMaker"> <div class="ColumnMaker ControlCurveLeft1"><span></span></div> <div class="ColumnMaker ControlCurve1"> <div class...
[ -0.42079609632492065, -0.24632546305656433, 0.8910537958145142, 0.006192552391439676, -0.0259252842515707, 0.151185542345047, -0.2377151995897293, -0.2670150101184845, -0.33048009872436523, -0.542448878288269, -0.17926883697509766, 0.4005407691001892, -0.2516515254974365, 0.208393201231956...
with class "RowMaker" in IE creating a nice little beveled cap for a div. But in Firefox the "ColumnMaker ControlCurve1" div truncates causing the right side of the beveled cap to be left aligned. So who is right? And more importantly how do I go about fixing this while retaining the flexibilty of a visual element th...
[ 0.1378900110721588, 0.01541384682059288, 0.661375880241394, -0.0009750418830662966, -0.03344712033867836, -0.355027973651886, -0.07404971867799759, -0.1698046773672104, -0.18522252142429352, -0.4855693578720093, 0.06373410671949387, 0.8430866599082947, -0.3857737183570862, -0.1302740275859...
as soon as possible. If you don't, please check out JetBrains Team City, Cruise Control, or Microsoft Team Systems Team Build. Depending on your source control server, you might be able to setup check-in policies as well. So if a particular file is checked in, and alert is generated. But typically I share as much co...
[ 0.34696149826049805, -0.13965900242328644, 0.2973666787147522, 0.4145726263523102, 0.29146817326545715, -0.4490758180618286, 0.016636276617646217, 0.42776480317115784, -0.06033778935670853, -0.9173538088798523, -0.1572941541671753, 0.5070111155509949, -0.2210511416196823, -0.59295815229415...
[compact](http://www.php.net/compact)() and [extract](http://www.php.net/extract)() are functions in PHP I find tremendously handy. compact() takes a list of names in the symbol table and creates a hashtable with just their values. extract does the opposite. e.g., ``` $foo = 'what'; $bar = 'ever'; $a = compact('foo', ...
[ -0.26707664132118225, 0.06915132701396942, 0.4184190332889557, -0.1778739094734192, -0.11422789841890335, -0.14285415410995483, 0.028523389250040054, -0.11878226697444916, -0.21920432150363922, -0.3569822609424591, -0.32161852717399597, 0.5184186100959778, -0.3526909351348877, -0.199294373...
this? It's not very Pythonic, but if you really must, you can implement `compact()` like this: ``` import inspect def compact(*names): caller = inspect.stack()[1][0] # caller of compact() vars = {} for n in names: if n in caller.f_locals: vars[n] = caller.f_locals[n] elif n in ...
[ -0.08839235454797745, -0.1104782447218895, 0.2545154392719269, -0.2062937170267105, -0.028555093333125114, -0.28571319580078125, 0.1730327308177948, -0.3396822214126587, -0.3164765536785126, -0.3831131160259247, -0.06800610572099686, 0.710870623588562, -0.6012455224990845, -0.1484396159648...
implement `extract()` like this, but in modern Python interpreters this doesn't appear to work anymore (not that it was ever "supposed" to work, really, but there were quirks of the implementation in 2009 that let you get away with it): ``` def extract(vars): caller = inspect.stack()[1][0] # caller of extract() ...
[ 0.04545428976416588, -0.1437215954065323, 0.4205020070075989, -0.33138835430145264, -0.008265330456197262, -0.3951955735683441, 0.5941572189331055, -0.14030776917934418, -0.18112480640411377, -0.27405527234077454, -0.1695329248905182, 0.7960278987884521, -0.566903293132782, 0.0377039425075...
to run against [Python's philosophy](https://www.python.org/dev/peps/pep-0020/) on at least three counts: "explicit is better than implicit", "simple is better than complex", "if the implementation is hard to explain, it's a bad idea", maybe more (and really, if you have enough experience in Python you know that stuff ...
[ 0.5379326343536377, 0.17699408531188965, -0.1997443586587906, -0.2205887734889984, -0.2547728419303894, -0.19116851687431335, 1.0431920289993286, -0.10822625458240509, 0.01867770403623581, -0.036101821810007095, 0.00703033059835434, 0.8606259822845459, -0.5566799640655518, -0.1198498606681...
I'm wondering if it's bad practice to use log4net directly on my domain object... I'll be using ELMAH for my exceptions on the ASP.NET MVC application side, but for some informational purposes I'd like to log some data about the domain model itself. Given the following domain object: ``` public class Buyer { p...
[ 0.47290992736816406, -0.03480568528175354, 0.1735464483499527, 0.1778869926929474, -0.11154293268918991, -0.35232922434806824, -0.0344700813293457, -0.10411906987428665, -0.12155474722385406, -0.5993203520774841, -0.2665248215198517, 0.6012366414070129, -0.16873237490653992, 0.409278035163...
_ID = value; } } private IList<SupportTicket> _SupportTickets=new List<SupportTicket>(); public IList<SupportTicket> SupportTickets { get { return _SupportTickets.ToList<SupportTicket>().AsReadOnly(); } } public void AddSupportTicket(SupportTicket ti...
[ 0.4531249701976776, -0.2153347134590149, 0.8565726280212402, 0.12205305695533752, 0.2483675181865692, 0.28672412037849426, 0.13852517306804657, -0.423982709646225, -0.20663228631019592, -0.5342023372650146, -0.26333674788475037, 0.45775294303894043, -0.4315171539783478, -0.1139603778719902...
{ _SupportTickets.Add(ticket); } } } ``` Is adding logging behavior in the AddSupportTicketMethod a bad idea...so essentialy it'd look like this: ``` public class Buyer { protected static readonly ILog log = LogManager.GetLogger(typeof(SupportTicket)); public Buyer() { ...
[ 0.34768325090408325, -0.494124174118042, 0.5052804350852966, 0.1616644412279129, 0.28366151452064514, -0.05967915058135986, 0.12340664118528366, -0.41910257935523987, -0.22662630677223206, -0.5031138062477112, -0.39031925797462463, 0.9261875748634338, -0.4987362027168274, -0.15277098119258...
{ get { return _ID; } set { _ID = value; } } private IList<SupportTicket> _SupportTickets=new List<SupportTicket>(); public IList<SupportTicket> SupportTickets { get { return
[ 0.2535940408706665, -0.4602922201156616, 0.7048540711402893, -0.07915078103542328, 0.1527385115623474, 0.37691953778266907, 0.08287364989519119, -0.42756980657577515, -0.07714398950338364, -0.5169060230255127, -0.4813975393772125, 0.7809332013130188, -0.40520405769348145, -0.43911519646644...
_SupportTickets.ToList<SupportTicket>().AsReadOnly(); } } public void AddSupportTicket(SupportTicket ticket) { if (!SupportTickets.Contains(ticket)) { _SupportTickets.Add(ticket); } else { log.Warn("Duplicate Ticket Not Added."); } } } ```...
[ 0.5796740651130676, -0.14965315163135529, 0.7779226899147034, 0.1791219711303711, 0.20272161066532135, 0.054331112653017044, 0.23258574306964874, -0.3178197145462036, -0.45377010107040405, -0.5051092505455017, -0.08535438030958176, 0.35636377334594727, -0.5520572662353516, 0.11484783887863...
use an IOC container which you might want to swap out, I would recommend you use the Service Locator pattern (you could look at the Sharp# architecture for a nice implementation of a SafeServiceLocator that wraps msoft's ServiceLocator with more informative error messages). I would also like to suggest that you consi...
[ 0.3676515817642212, 0.0040190755389630795, -0.06803523004055023, 0.3123433291912079, -0.08163689076900482, -0.5591384768486023, 0.2694673240184784, -0.027010895311832428, -0.15841782093048096, -0.5943330526351929, -0.19551926851272583, 0.3011118471622467, -0.3732752799987793, -0.2130816578...
be logged) or whether that represents a situation that the caller wants to deal with in some way.
[ 0.53279048204422, -0.1379830688238144, 0.4551352262496948, 0.02808721922338009, 0.37095344066619873, -0.13696929812431335, 0.35129857063293457, -0.08210379630327225, -0.25817015767097473, -0.4329196810722351, -0.4957527816295624, 0.48446762561798096, -0.2370619922876358, -0.199955493211746...
When running the following python code: ``` >>> f = open(r"myfile.txt", "a+") >>> f.seek(-1,2) >>> f.read()
[ 0.206851989030838, 0.18626929819583893, 0.21658195555210114, -0.42158064246177673, 0.0690724104642868, 0.0700196772813797, 0.40518224239349365, -0.13339483737945557, 0.03238116577267647, -0.4263862669467926, -0.24531899392604828, 0.7106145620346069, -0.43423837423324585, -0.313387662172317...
'a' >>> f.write('\n') ``` I get the
[ -0.19955985248088837, 0.4316391944885254, 0.3438289165496826, -0.3653735816478729, 0.2168816179037094, -0.0605379194021225, 0.28886541724205017, -0.048789720982313156, 0.08295594155788422, -0.41965359449386597, -0.552443265914917, 0.3215194046497345, -0.2283354550600052, 0.0932016521692276...
following (helpful) exception: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 0] Error ``` The same thing happens when openning with "r+". Is this supposed to fail? Why? Edit: 1. Obviously, this is just an example, not what I am actually trying to e...
[ 0.0753583088517189, 0.253324955701828, 0.44343551993370056, -0.29978370666503906, -0.05734850466251373, -0.09376342594623566, 0.6648403406143188, -0.12887029349803925, -0.2370365411043167, -0.5496659874916077, -0.34601572155952454, 0.565211296081543, -0.35616084933280945, 0.074684299528598...
managed to bypass the problem by calling seek() again: > > > f = open(r"myfile.txt", "a+") > > > > > > f.seek(-1,2) > > > > > > f.read() > > > > > > 'a' > > > > > > f.seek(-10,2) > > > > > > f.write('\n') The actual parameters of the 2nd seek call don't seem to matter. This appears to be a Windows...
[ -0.33063021302223206, -0.04487083852291107, 0.5850154161453247, -0.19367119669914246, -0.007402646820992231, -0.020752493292093277, 0.4796459376811981, -0.38588789105415344, 0.12967036664485931, -0.5038425922393799, -0.029795804992318153, 0.9005231857299805, -0.23775500059127808, -0.152335...
I'm working on a project with couple others. We all have local copies of the project, which is also constantly updated via svn repo. Because we are in the early stage of the development, we often change the schema of our database. This leads to a lot of problem when we sync our code, because we don't have a great way...
[ 0.72332364320755, 0.018624797463417053, -0.006578976754099131, 0.29270973801612854, -0.10035546869039536, -0.16975054144859314, 0.16333508491516113, 0.3216674327850342, -0.21610796451568604, -0.8064624071121216, 0.33324065804481506, 0.426939457654953, 0.07050032913684845, 0.100818060338497...
in CakePHP: <http://book.cakephp.org/view/734/Schema-management-and-migrations> And here is an additional website: <http://bakery.cakephp.org/articles/view/cake-db-migrations-v2-1> Database migrations are an easy way to keep your working databases in sync. Essentially, migrations are scripts that update a database to ...
[ 0.14331094920635223, 0.18911315500736237, 0.22230863571166992, -0.13078466057777405, -0.037970755249261856, 0.08389066159725189, 0.2266598790884018, -0.11599650979042053, -0.6202561855316162, -0.8226516246795654, -0.3744288384914398, -0.05887262523174286, -0.21712401509284973, -0.047911811...
tool is usually better able to abstract the database dependent parts and make your database scripts more database independent. There are tools available for Ruby (migrations are an important part of Rails), C# and Java. Surely, other languages also. There are a number of [questions](https://stackoverflow.com/question...
[ -0.0020509997848421335, -0.07843247801065445, 0.15119901299476624, 0.29100480675697327, -0.03326613828539848, -0.10884521901607513, -0.07194255292415619, -0.033811889588832855, -0.5274096727371216, -0.5698943138122559, 0.014318198896944523, 0.48618176579475403, -0.1845243126153946, -0.0844...
For some reason it looks like constructor delegation doesn't work in the following snippet: ``` function NotImplementedError() { Error.apply(this, arguments); } NotImplementedError.prototype = new Error(); var nie = new NotImplementedError("some message"); console.log("The message is: '"+nie.message+"'") ``` Ru...
[ -0.2601138949394226, 0.30422496795654297, 0.32788798213005066, -0.06107310205698013, -0.024483511224389076, -0.038437820971012115, 0.6257795095443726, -0.33951079845428467, 0.006213556509464979, -0.6430326700210571, -0.05069682374596596, 0.5620672702789307, -0.35289034247398376, 0.31952026...
this.message = message; } NotImplementedError.prototype = Error.prototype; ``` However, I would just throw your own object and just check the name property. ``` throw {name : "NotImplementedError", message : "too lazy to implement"}; ``` **Edit based on comments** After looking at the comments and trying to reme...
[ -0.11308131366968155, 0.4331894814968109, -0.20679879188537598, -0.28895747661590576, -0.5534349679946899, -0.025315430015325546, 0.6138732433319092, -0.48632165789604187, -0.12141378223896027, -0.44780856370925903, -0.017418187111616135, 0.2702755033969879, -0.6481780409812927, 0.17798365...
throw e; } catch (ex1) { console.log(ex1.stack); console.log("ex1 instanceof NotImplementedError = " + (ex1 instanceof NotImplementedError)); console.log("ex1 instanceof Error = " + (ex1 instanceof Error)); console.log("ex1.name = " + ex1.name); console.log("ex1.message = " + ex1.message); } try { var e = ...
[ -0.21446657180786133, -0.09863808006048203, 0.2823585569858551, -0.30201393365859985, 0.12551181018352509, 0.16388483345508575, 0.6444007158279419, -0.6860316395759583, 0.011261793784797192, -0.3310452401638031, -0.466947466135025, 0.6811754107475281, -0.2757839858531952, 0.121987193822860...
NotImplementedError ex1.message = NotImplementedError message Error at window.onload (http://fiddle.jshell.net/MwMEJ/show/:29:34) ex1 instanceof NotImplementedError2 = true ex1 instanceof Error = true ex1.name = Error ex1.message = NotImplementedError2 message ``` This confirmes the "problem" I ran into was the s...
[ -0.1551799327135086, 0.3866681754589081, 0.32122236490249634, -0.133342906832695, -0.05357469990849495, 0.045672960579395294, 0.7880253195762634, -0.2532290518283844, -0.10349461436271667, -0.4665490686893463, 0.06256042420864105, 0.5132248997688293, -0.16396914422512054, 0.296155959367752...
Error()`, I could set `NotImplementedError2.prototype.name = "NotImplementedError2"` and be OK.
[ 0.005760628264397383, 0.3846864402294159, 0.1354580521583557, -0.19336368143558502, -0.005317943636327982, 0.032763153314590454, 0.6583741903305054, -0.08529616892337799, 0.09691111743450165, -0.36531347036361694, 0.0857098177075386, 0.49214160442352295, -0.1605580747127533, 0.153466522693...
I just wondered, why most Delphi examples use FillChar() to initialize records. ``` type TFoo = record i: Integer; s: string; // not safe in record, better use PChar instead end; const EmptyFoo: TFoo = (i: 0; s: ''); procedure Test; var Foo: TFoo; s2: string; begin Foo := EmptyFoo; // initialize...
[ 0.25733762979507446, 0.08314084261655807, 0.21257483959197998, -0.2764488458633423, 0.4708969295024872, -0.2037028968334198, 0.2669597268104553, -0.4890504777431488, -0.05614975094795227, -0.020991675555706024, -0.18680444359779358, 0.7442405819892883, -0.6184686422348022, -0.0400660969316...
#0); // The refcount is expected to be 1, but it is still 2 end; // After exiting the procedure, the string buffer still has 1 reference. This string buffer is regarded as a memory leak. ``` Here (<http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html>) is my note on this topic. IMO, de...
[ -0.014964896254241467, -0.1346147507429123, 0.45495253801345825, -0.3317232131958008, -0.07963357120752335, -0.13176339864730835, 0.10742426663637161, -0.05657340958714485, -0.2023501843214035, -0.2360042780637741, 0.041622359305620193, 0.5775972008705139, -0.4575408101081848, 0.3108325004...
So FillChar(Foo, SizeOf(Foo), #0) and FillChar(Foo, SizeOf(Foo), 0) are equivalent. Another source of confusion is that as of Delphi 2009, FillChar still only fills bytes even though Char is equivalent to WideChar. While looking at the most common uses for FillChar in order to determine whether most folks use FillChar ...
[ -0.29133132100105286, 0.26770132780075073, 0.6007049083709717, -0.3747134208679199, -0.18558351695537567, 0.16958026587963104, 0.0017002259846776724, 0.04638885334134102, -0.2852284908294678, -0.12180975079536438, 0.11001652479171753, 0.45253244042396545, -0.20696201920509338, 0.0998050644...
FillChar that contains a field declared using one of the "managed" types (strings, Variant, Interface, dynamic arrays) can be unsafe if not used in the proper context. In the example you gave, however, it is actually safe to call FillChar on the locally declared record variable *as long as it is the first thing you eve...
[ 0.32822248339653015, 0.03164737671613693, 0.08421681076288223, -0.28392234444618225, 0.1898442655801773, -0.2482258379459381, 0.34384655952453613, 0.02724873647093773, -0.0904836505651474, -0.32607293128967285, 0.05600960925221443, 0.6207489967346191, -0.35342279076576233, 0.24518558382987...
record with 0 bytes, including the string field which is already 0. Using FillChar on the record variable **after** a value was assigned to the string field, is not recommended. Using your initialized constant technique is a very good solution this problem because the compiler can generate the proper code to ensure the...
[ 0.05771604925394058, 0.046644505113363266, 0.07550639659166336, 0.28342798352241516, 0.032136041671037674, -0.28519847989082336, -0.0438661128282547, 0.01769748516380787, -0.37410926818847656, -0.40456584095954895, -0.07762573659420013, 0.39244532585144043, -0.266531765460968, 0.1648812294...
I want to remove digits from a float to have a fixed number of digits after the dot, like: ``` 1.923328437452 → 1.923 ``` I need to output as a string to another function, not print. Also I want to ignore the lost digits, not round them. First, the function, for those who just want some copy-and-paste code: ``` de...
[ -0.1475469321012497, 0.031224412843585014, 0.5240766406059265, -0.1208537369966507, 0.21660560369491577, 0.2635219097137451, -0.05968043580651283, -0.43915116786956787, -0.09838289022445679, -0.40191972255706787, -0.33996865153312683, 0.45215094089508057, -0.2674717605113983, -0.0784071758...
= s.partition('.') return '.'.join([i, (d+'0'*n)[:n]]) ``` This is valid in Python 2.7 and 3.1+. For older versions, it's not possible to get the same "intelligent rounding" effect (at least, not without a lot of complicated code), but rounding to 12 decimal places before truncation will work much of the time: `...
[ -0.01307904813438654, 0.10981115698814392, 0.5694549083709717, -0.35675448179244995, -0.023101860657334328, 0.274186909198761, 0.04347767308354378, -0.6069439649581909, -0.06549064069986343, -0.2928530275821686, -0.18384554982185364, 0.5167117118835449, 0.010431024245917797, -0.06429398804...
string at full precision and then just chop off everything beyond the desired number of characters. The latter step is easy; it can be done either with string manipulation ``` i, p, d = s.partition('.') '.'.join([i, (d+'0'*n)[:n]]) ``` or the `decimal` module ``` str(Decimal(s).quantize(Decimal((0, (1,), -n)), roun...
[ -0.02901165373623371, -0.07228855788707733, 0.18231718242168427, -0.2294837087392807, -0.17863860726356506, 0.06274822354316711, 0.19075699150562286, -0.20816181600093842, -0.10283809900283813, -0.3129565119743347, -0.1925746649503708, 0.5369734168052673, -0.17354272305965424, 0.0099819777...
floating-point format into the sequence of bits (assuming a 64-bit float) ``` 0011111111010011001100110011001100110011001100110011001100110011 ``` This is the closest value to 0.3 that can accurately be represented as an IEEE float. But if you write `0.29999999999999998` in a Python program, the compiler translates ...
[ 0.011334634386003017, 0.2827829420566559, 0.3812686502933502, 0.08556941896677017, 0.028775548562407494, -0.05214129388332367, -0.20063190162181854, -0.4668615162372589, 0.005527642089873552, -0.0903545394539833, 0.17178821563720703, 0.2530686855316162, -0.11375783383846283, -0.08403044193...