text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
you to use traditional compiled languages to manipulate applications, eg. in Office you can now automate using .net, which I supppose means you can write Excel macros in managed C++. * languages tend to outgrow their niche. Perl was concieved as a scripting language for text manipulation, but has since grown into a ful...
[ 0.1626613885164261, -0.0651560127735138, 0.03553333133459091, 0.10474482923746109, -0.3408574163913727, 0.06219566985964775, 0.11887254565954208, 0.21430009603500366, -0.3336402177810669, -0.47900184988975525, -0.021500540897250175, 0.543546736240387, -0.3587716519832611, -0.22710521519184...
the line is being blurred by newer languages. For example, C# has high-level features like garbage-collection and dynamic types, and low-level features like pointers. For these reasons *scripting* has been seen as more accessible, where *programming* has been seen as more demanding and hard-core. Therefore the term *s...
[ 0.19006375968456268, 0.17096352577209473, -0.08117225766181946, 0.1702420711517334, -0.34891608357429504, -0.4318063259124756, 0.2395753711462021, 0.5753706097602844, -0.02400827594101429, -0.6820566058158875, -0.2405679076910019, 0.4487018883228302, -0.3782348036766052, 0.0336967967450618...
I have written a script that gets data from [solr](http://lucene.apache.org/solr/) for which date is within the specified period, and I run the script using as a daily cron. The problem is the cronjob does not complete the task. If I manually run the script (for the same time period), it works well. If I reduce the sp...
[ -0.08141856640577316, 0.2332189530134201, 0.47251397371292114, -0.08654474467039108, 0.05174313485622406, -0.017679298296570778, 0.4042860269546509, 0.10154929012060165, -0.3479014039039612, -0.7592392563819885, -0.10027217864990234, 0.41209036111831665, 0.12864220142364502, 0.000514391635...
cronjob is a bash script which runs a python script. You could try to use [ulimit](http://www.ss64.com/bash/ulimit.html) -t [number of seconds] in the cronjob before running the script.
[ -0.13678188621997833, 0.08580507338047028, 0.5874817371368408, -0.13469785451889038, -0.2243441343307495, -0.14501826465129852, 0.13438481092453003, 0.039495714008808136, -0.42026203870773315, -0.19036328792572021, 0.03423713520169258, 0.5221349596977234, -0.2372133433818817, -0.1839747577...
This will surely be an easy one but it is really bugging me. I have a script that reads in a webpage and uses [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) to parse it. From the *soup* I extract all the links as my final goal is to print out the link.contents. All of the text that I am parsing is ...
[ -0.005536120384931564, 0.27149781584739685, 0.4029042422771454, -0.1750744879245758, -0.19094118475914001, 0.1401624232530594, 0.35545507073402405, 0.11273037642240524, -0.0268362108618021, -0.863349199295044, -0.1683942824602127, 0.07617875188589096, -0.1799660176038742, 0.167558327317237...
there a simple way of getting this back into just ascii or should I write a regex to strip it? `[u'ABC']` would be a one-element list of unicode strings. [Beautiful Soup always produces Unicode](http://www.crummy.com/software/BeautifulSoup/documentation.html#Beautiful%20Soup%20Gives%20You%20Unicode,%20Dammit). So you n...
[ 0.009202956221997738, -0.12778112292289734, 0.005589393898844719, -0.062325235456228256, -0.23267419636249542, 0.1116754487156868, 0.1623333841562271, -0.144967183470726, -0.36086761951446533, -0.6622396111488342, -0.2311207801103592, -0.09262144565582275, -0.3579165041446686, 0.0277685262...
use this: ``` soup[0].encode("ascii") ``` However, please double-check that your data is really ASCII. This is pretty rare. Much more likely it's latin-1 or utf-8. ``` soup[0].encode("latin-1") soup[0].encode("utf-8") ``` Or you ask Beautiful Soup what the original encoding was and get it back in this encodin...
[ 0.12753571569919586, 0.04991746321320534, -0.04304535314440727, 0.16794586181640625, 0.054372671991586685, -0.20462436974048615, 0.31933775544166565, 0.1995595246553421, -0.21270902454853058, -0.7439046502113342, -0.4035269021987915, -0.0861424133181572, -0.7526653409004211, -0.10135246813...
I would like to convert some HTML characters back to text using Java Standard Library. I was wondering whether any library would achieve my purpose? ``` /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here // "Happy & Sad" in HTML form....
[ 0.01426630187779665, 0.20990943908691406, 0.4736095070838928, -0.36589956283569336, -0.20558293163776398, 0.6354027986526489, 0.5813432931900024, -0.1901257187128067, -0.3929896354675293, -0.532512366771698, -0.38879531621932983, 0.3432658910751343, -0.33764544129371643, -0.064134694635868...
"UTF-8"); System.out.println(s); } catch (UnsupportedEncodingException ex) { } } ``` I think the Apache Commons Lang library's `StringEscapeUtils.unescapeHtml3()` and `unescapeHtml4()` methods are what you are looking for. See <https://commons.apache.org/proper/commons-text/javadocs/api-release/org/ap...
[ -0.13839325308799744, -0.24555283784866333, 0.2983795404434204, -0.15282924473285675, -0.029748478904366493, -0.21187959611415863, 0.2677839398384094, -0.028473857790231705, -0.38983216881752014, -0.5725618004798889, -0.5081945657730103, 0.372840940952301, -0.6149404644966125, 0.1514940410...
Is there an easy way to disable a `UITextField` in code? My app has 12 `UITextField` that are all turned on by default, but when a change is detected in my Segment Control I want to disable some of the `UITextField` depending on what Segment the user picks. Just need to know how to disable it or make it non-editable?...
[ -0.004972027614712715, 0.028322473168373108, 0.4115604758262634, 0.15384754538536072, 0.07225450128316879, -0.03734913840889931, 0.5151215195655823, 0.20277902483940125, -0.3123553991317749, -0.8916678428649902, -0.40059590339660645, 0.7246240973472595, -0.46804291009902954, -0.14121814072...
A basic question I assume for someone who does JS on a daily basis. I'm helping a friend that does not use the recent sweets (JQuery, prototype and co.). How should I get a reference to a document element by name ? I would like to allow a selection user does in a `<SELECT />` element modify the value of an `<INPUT />...
[ 0.2836018204689026, 0.09203708916902542, 0.21354788541793823, 0.17522487044334412, 0.04195840284228325, 0.029529590159654617, 0.0676582008600235, -0.1707846075296402, -0.13415424525737762, -0.600466787815094, -0.1695619523525238, 0.36150261759757996, -0.21493348479270935, 0.131273388862609...
Is it possible to generate model in Propel using Schema.xml, instead of [Schema.yml](http://www.symfony-project.org/book/1_2/05-Configuring-Symfony)? There was once upon a time when xml was used for database generation in Propel, but it had been dropped in favor of yml. I should go for yml if I were handcoding my data...
[ 0.12412773072719574, -0.18001532554626465, 1.020864486694336, 0.24388305842876434, 0.004760583397001028, -0.1038079708814621, -0.15497396886348724, -0.11902272701263428, -0.39359772205352783, -0.4954025149345398, 0.11840517818927765, 0.736025333404541, -0.23027145862579346, -0.177859112620...
symfony propel:build-model ``` and you will be fine.
[ 0.6410645246505737, 0.22537411749362946, 0.909601628780365, 0.235064297914505, 0.32947927713394165, -0.17648743093013763, -0.1293592005968094, 0.010259847156703472, -0.12639902532100677, -0.5771135687828064, -0.14509782195091248, 0.7088584303855896, 0.10332392156124115, -0.0812599137425422...
I've been trying lately to implement some clean coding practices in AS3. One of these has been to not give away references to Arrays from a containing object. The point being that I control addition and removal from one Class and all other users of the Array receive read only version. At the moment that read only vers...
[ 0.3592265546321869, -0.03421974927186966, 0.07742935419082642, -0.1128685399889946, -0.28909942507743835, -0.2125815451145172, 0.5502899289131165, -0.07494379580020905, -0.38956204056739807, -0.590811550617218, 0.12924931943416595, 0.036421459168195724, -0.23716485500335693, 0.061522293835...
many languages? The ability to pass around references to read only views of collections? Also now that there is improved type safety for collections in AS3 , in the form of the *Vector* class, when I wrap a a Vector in a *VectorIterator* I lose typing for the sake of immutability. Is there a way to implement the two ...
[ 0.0663532242178917, -0.21975202858448029, 0.20737868547439575, -0.04220318794250488, -0.21675772964954376, -0.01999775320291519, 0.3973831832408905, -0.11290479451417923, -0.4985193908214569, -0.6948301196098328, -0.012947626411914825, 0.3741358816623688, -0.47853386402130127, -0.296700894...
on the Java [Iterator](http://java.sun.com/javase/6/docs/api/java/util/Iterator.html), but I do not implement the *remove()* method, as this is considered a design mistake by many in the Java community, due to it allowing the user to remove array elements. Below is my *IIterator* implemention: ``` public interface II...
[ -0.14905282855033875, -0.245553120970726, 0.5813191533088684, -0.37192419171333313, -0.23702551424503326, -0.21688495576381683, 0.017571208998560905, -0.5678727030754089, -0.22314299643039703, -0.9666517376899719, 0.10638003051280975, 0.4933623671531677, -0.3524925708770752, -0.13124270737...
Arrays does not need to change when using my *IIterator*. ``` var array:Array = ["one", "two", "three"] for each (var eachNumber:String in array) { trace(eachNumber) } var iterator:IIterator = new ArrayIterator(array) for each (var eachNumber:String in iterator) { trace(eachNumber) } ``` Only problem is....
[ -0.004541665781289339, -0.15973803400993347, 0.4706290662288666, -0.20587271451950073, -0.03254666551947594, -0.07921376079320908, 0.22639843821525574, -0.704132080078125, -0.16100485622882843, -0.8500275015830994, 0.2765049636363983, 0.652890682220459, -0.4580480456352234, -0.043421354144...
I'm currently involved in developing a product (developed in C#) that'll be available for downloading and installing for free but in a very limited version. To get access to all the features the user has to pay a license fee and receive a key. That key will then be entered into the application to "unlock" the full vers...
[ 0.499846875667572, 0.2032402902841568, 0.226729154586792, 0.2376270890235901, 0.369069367647171, -0.2938314974308014, 0.21084895730018616, -0.06560897082090378, -0.09126842767000198, -0.37262269854545593, -0.21677616238594055, 0.4442237913608551, 0.1251557469367981, 0.1314220428466797, 0...
published on the Internet and used by others that haven't paid the license (a key that basically isn't "theirs"). I guess I should also tie the key to the version of application somehow so it'll be possible to charge for new keys in feature versions. Anything else I should think about in this scenario? Caveat: you ca...
[ 0.5429986119270325, 0.30480971932411194, 0.27859583497047424, 0.2320859283208847, 0.18815657496452332, -0.36120137572288513, 0.200273796916008, -0.12332324683666229, 0.07592839747667313, -0.21259693801403046, -0.1142382100224495, 0.4974156618118286, -0.2788623869419098, -0.2138992547988891...
the secret key and hash with (for example) SHA1 * Unpack the SHA1 hash as an alphanumeric string. This is the individual user's "Product Key" * Within the program, do the same hash, and compare with the product key. If equal, OK. But, I repeat: **this won't prevent piracy** --- I have recently read that this approa...
[ 0.20454342663288116, 0.12757423520088196, 0.03160039708018303, 0.006118373479694128, 0.11322225630283356, -0.189661905169487, 0.19845621287822723, 0.0843033641576767, -0.054932452738285065, -0.5216861367225647, -0.14451028406620026, 0.4193633794784546, -0.07000542432069778, 0.1373437047004...
to derive something else from this, beware.
[ 0.34849196672439575, 0.14630986750125885, -0.38390403985977173, 0.1970631629228592, -0.035144709050655365, -0.013655642047524452, 0.15769566595554352, -0.00870675127953291, 0.054469529539346695, -0.5045956969261169, 0.07402511686086655, 0.31011489033699036, 0.015446650795638561, 0.05747876...
What do you use to minimize and compress JavaScript libraries? I use [YUI Compressor](https://github.com/yui/yuicompressor). Seems to get the job done well!
[ 0.2540224492549896, 0.14706075191497803, 0.10193999111652374, 0.11275239288806915, -0.41390082240104675, 0.04183712601661682, 0.12200690060853958, -0.0027269264683127403, -0.13213211297988892, -0.6823049187660217, 0.04591790586709976, 0.5521480441093445, -0.016272809356451035, -0.073277078...
Say I have a float in the range of [0, 1] and I want to quantize and store it in an unsigned byte. Sounds like a no-brainer, but in fact it's quite complicated: The obvious solution looks like this: ``` unsigned char QuantizeFloat(float a) { return (unsigned char)(a * 255.0f); } ``` This works in so far that I g...
[ 0.19491790235042572, 0.21093015372753143, 0.398554265499115, -0.2814413011074066, -0.058972567319869995, 0.1507566273212433, 0.028005043044686317, -0.4900372326374054, -0.12853452563285828, -0.19365966320037842, 0.10627259314060211, 0.5588015913963318, -0.17246687412261963, 0.0793957486748...
* 255.0f + 0.5f); } ``` Here the the result `0` only covers half of the float-range than any other number. How do I do a quantization with equal distribution of the floating point range? Ideally I would like to get a equal distribution of integers if I quantize equally distributed random floats. Any ideas? --- Bt...
[ 0.060378722846508026, 0.23622636497020721, 0.1912919580936432, -0.057247575372457504, -0.15300440788269043, -0.008288494311273098, 0.058586571365594864, -0.34417036175727844, 0.04535359516739845, -0.3614990711212158, 0.03386829048395157, 0.6308375597000122, -0.10771723091602325, 0.05238176...
of my range (1.0f) to the highest unsigned byte (255). How about `a * 256f` with a check to reduce 256 to 255? So something like: ``` return (unsigned char) (min(255, (int) (a * 256f))); ``` (For a suitable min function on your platform - I can't remember the C function for it.) Basically you want to divide the ran...
[ 0.07327330857515335, 0.09049959480762482, 0.229714497923851, -0.1930127739906311, -0.1260315179824829, 0.18158157169818878, 0.23973047733306885, -0.33711734414100647, 0.03586171939969063, -0.3465774357318878, 0.2054336667060852, 0.5616649389266968, -0.07501926273107529, 0.3456515967845917,...
What does it mean for a type T to be a "First Class" type? Usually it means instances of T can be * returned from functions * passed into functions * constructed at runtime Eg functions in C are not first class types as they cannot be constructed at runtime, but they are in JavaScript. In some specialised circumstan...
[ 0.2686852812767029, -0.2854195833206177, -0.17960265278816223, 0.004213482607156038, -0.2637655735015869, -0.1744939237833023, 0.08361634612083435, 0.04623465985059738, -0.05518380552530289, -0.4633132815361023, -0.6502860188484192, 0.2885289788246155, -0.47192278504371643, -0.120679125189...
I'd like to execute a .NET dll file from vbscript in a synchronous way - is this possible? if yes, is it possible to execute a GAC assembly? thanks, Ofer I think you must first make the .NET assembly COM-visible by including the ComVisible attribute in the AssemblyInfo.cs file: ``` [ComVisible(true)] ``` See this ...
[ 0.4942513704299927, 0.14867496490478516, 0.2618943154811859, -0.19409598410129547, -0.14279712736606598, -0.11188912391662598, 0.2349153608083725, -0.21302032470703125, -0.05525612831115723, -0.8442385196685791, -0.04867763817310333, 0.48296064138412476, -0.26111963391304016, 0.14563378691...
around so I'm not sure. Why would you want to do that in VBScript? Why not just make a .NET console application that would do what your VBScript was meant to do? Since the DLL is already on .NET, that shouldn't be a problem, right? --- **EDIT:** Another way to do this might be to create a console EXE instead of a DL...
[ 0.42943570017814636, -0.14211472868919373, 0.211645245552063, 0.2927027940750122, -0.18136648833751678, -0.09975451976060867, -0.04441458731889725, 0.2125386744737625, -0.11497624963521957, -0.6218003034591675, 0.06733456254005432, 0.7577678561210632, -0.3219001889228821, 0.228943347930908...
I am using a `Socket` to receive data via TCP, and `TextReader.ReadLine` to read lines from the connection. There is a problem where a full line has not been received -- `TextReader.ReadLine` returns an incomplete string. I want it to return `null`, indicating that a full line could not be read. How can I do this? Bas...
[ 0.28572410345077515, 0.04832379147410393, 0.3346925675868988, -0.03676653653383255, -0.28521350026130676, 0.08952552825212479, 0.612233579158783, -0.03468508645892143, 0.14318402111530304, -0.7985108494758606, -0.1598462015390396, 0.45055893063545227, -0.2834169864654541, 0.505983948707580...
been received. Code: ``` var endPoint = ...; var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); socket.Connect(endPoint); var stream = new NetworkStream(socket, true); var messageBuffer = new StringBuilder(); // Data received async callback (called several times). int bytesRea...
[ 0.2743997573852539, -0.35905009508132935, 0.8060289025306702, -0.33822038769721985, -0.04615066200494766, 0.1318202167749405, 0.5776588916778564, -0.4850354790687561, -0.24705614149570465, -0.4085151255130768, -0.17820794880390167, 0.3235987424850464, -0.33133500814437866, 0.47074624896049...
} messageBuffer = new StringBuilder(reader.ReadToEnd()); } // Method of Message. public static Message Read(TextReader reader) { string line = reader.ReadLine(); if(line == null) return null; return Message.FromRawString(line); } ``` Thanks. I decided to write my own ReadLine parser-ish ki...
[ -0.40360984206199646, -0.30851367115974426, 0.6583065986633301, -0.2879587709903717, -0.019677571952342987, 0.09660933911800385, 0.5943894386291504, -0.23972901701927185, -0.11576974391937256, -0.4383014142513275, -0.4535491466522217, 0.501307487487793, -0.5587100982666016, 0.2475154399871...
return null; string line = Encoding.UTF8.GetString(data.Take(end).ToArray()); data.RemoveRange(0, end + 1); if(line == "") return ReadBytes(data); if(line == null) return null; return Message.FromRawString(line); } ``` Many thanks to @Jon Skeet, @Noldorin, and @Richard for the...
[ 0.02022014930844307, -0.27856531739234924, 0.5038965940475464, -0.1258978247642517, 0.06400340050458908, 0.2452513575553894, 0.6811362504959106, -0.3991689682006836, -0.08545079082250595, -0.4034590423107147, -0.4550597071647644, 0.2833576798439026, -0.3245210647583008, 0.4248163402080536,...
I have my Git repository which, at the root, has two sub directories: ``` /finisht /static ``` When this was in [SVN](http://en.wikipedia.org/wiki/Apache_Subversion), `/finisht` was checked out in one place, while `/static` was checked out elsewhere, like so: ``` svn co svn+ssh://admin@domain.example/home/admin/rep...
[ 0.22677122056484222, 0.0897570326924324, 0.629625141620636, -0.08741714060306549, -0.2024131715297699, -0.18653026223182678, 0.1709633469581604, -0.19690006971359253, -0.25046640634536743, -0.65565025806427, -0.22136561572551727, 0.21243155002593994, -0.19066305458545685, 0.214468047022819...
implementation, so even if support shows up in the Git server, it does not automatically mean that it works on Git hosters. (OTOH, since they don't use the Git server, they could implement it faster in their own implementations before it shows up in Git server.) --- No, that's not possible in Git. Implementing somet...
[ 0.4211164712905884, 0.19854815304279327, 0.2865271270275116, 0.022838477045297623, 0.058401454240083694, -0.3878994286060333, 0.3169361352920532, -0.04979253187775612, -0.21650832891464233, -0.8002297878265381, -0.1255909949541092, 0.37807798385620117, -0.35544395446777344, 0.0667171925306...
community is that if you have several directories that are always checked out independently, then these are really two different projects and should live in two different repositories. You can glue them back together using [Git Submodules](https://book.git-scm.com/book/en/v2/Git-Tools-Submodules).
[ 0.4175665080547333, -0.22804203629493713, -0.13511544466018677, 0.21317791938781738, 0.12469565123319626, -0.26433873176574707, 0.3735322952270508, -0.0034041458275169134, -0.4199822247028351, -0.361165314912796, -0.08433418720960617, 0.00011971483763772994, 0.10103912651538849, 0.12999999...
i am using jquery library in my project.I have terrible problem with jquery tabs.Solutions is that when i was in third tab,i post back my form,tabs reloaded and goes to first tab. i am searching to solve problem long time. ``` <script type="text/javascript"> $(document).ready(function() { $("#example > ul"...
[ 0.07714018225669861, 0.13303925096988678, 0.5385586023330688, 0.06489410996437073, -0.1803852617740631, 0.12545587122440338, 0.28999605774879456, -0.12676499783992767, -0.15356114506721497, -0.771718442440033, 0.0022026554215699434, 0.60390704870224, -0.06309241056442261, 0.298424661159515...
an example of how to use cookies to store the current tab: ``` $('.selector').tabs({ cookie: { expires: 30 } }); ``` This requires the [jquery cookies plugin](http://plugins.jquery.com/project/cookie) to be included though.
[ 0.026777995750308037, -0.16654956340789795, 0.28319597244262695, 0.04017766937613487, 0.04472697898745537, -0.4235108494758606, 0.06917382031679153, 0.07268551737070084, -0.09651188552379608, -0.6150566935539246, -0.21246498823165894, 0.5485371351242065, -0.1439969390630722, 0.169726312160...
What is the correct way to split Spring's configuration to multiple xml files? At the moment I have * `/WEB-INF/foo-servlet.xml` * `/WEB-INF/foo-service.xml` * `/WEB-INF/foo-persistence.xml` My `web.xml` has the following: ``` <servlet> <description>Spring MVC Dispatcher Servlet</description> <servlet-name>...
[ 0.0785333663225174, -0.19900336861610413, 0.3644416034221649, -0.034284114837646484, -0.3306839168071747, 0.5770112872123718, -0.20963403582572937, -0.6226640939712524, -0.6425338983535767, -0.19689173996448517, 0.01981162652373314, 0.2375362068414688, -0.35803723335266113, 0.0762172266840...
<param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/foo-*.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> ``` The actual questions: * Is this approach *correct/be...
[ 0.06189284846186638, 0.43803173303604126, 0.47783976793289185, -0.17253436148166656, -0.4251486361026764, 0.2925989031791687, 0.15212152898311615, -0.70192950963974, -0.658111035823822, -0.1892513632774353, -0.11598250269889832, 0.31133490800857544, -0.20719720423221588, -0.260479509830474...
I don't need to do resource importing like this: ``` <import resource="foo-services.xml"/> ``` Is this a correct assumption? I find the following setup the easiest. Use the default config file loading mechanism of [DispatcherServlet](http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-servl...
[ 0.2574845850467682, 0.08732586354017258, 0.4651440680027008, -0.13593795895576477, -0.09145168960094452, -0.13203942775726318, 0.00883250031620264, -0.225824236869812, -0.424081027507782, -0.773325502872467, -0.28053998947143555, 0.6329634785652161, -0.46351131796836853, 0.0416773930191993...
`web.xml`. In `intrafest-servlet.xml` file you can use [import](http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-xml-import) to compose your XML configuration. ``` <beans> <bean id="bean1" class="..."/> <bean id="bean2" class="..."/> <import resource="foo-services.xml"/> ...
[ 0.22562552988529205, 0.2699759006500244, 0.3990654945373535, -0.3841143250465393, -0.08915400505065918, 0.15779101848602295, -0.13141176104545593, -0.13668681681156158, -0.6671053767204285, -0.7873562574386597, -0.039237409830093384, 0.19638463854789734, -0.47968754172325134, -0.0387844406...
I am executing an exe through my java program. The path is hardcoded in Java. I have packaged my the exe in the jar. But am stuck as I have the path name hardcoded in the Java file, so I am not able to execute my jar as a stand alone program. Any hints for packaging such jar i.e having an exe inside and able to run ...
[ 0.3023018538951874, 0.4177197515964508, 0.5128938555717468, -0.28347858786582947, -0.24436154961585999, 0.2838361859321594, 0.5820963382720947, -0.1785961091518402, 0.0668170154094696, -0.7191440463066101, -0.25035637617111206, 0.38493356108665466, -0.7663149237632751, 0.2574951648712158, ...
java.net.URL; import java.security.CodeSource; import java.security.ProtectionDomain; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { public static void main(final String[] args) throws URISyntaxException, ZipException, ...
[ -0.10904072225093842, -0.023711537942290306, 0.21814392507076263, -0.2598688304424286, 0.053686872124671936, 0.3827320635318756, 0.5056855082511902, -0.12450041621923447, -0.08212950825691223, -0.34944191575050354, -0.5292495489120483, 0.3389236032962799, -0.6664535403251648, 0.53349727392...
"Main.class"); System.out.println(exe); } private static URI getJarURI() throws URISyntaxException { final ProtectionDomain domain; final CodeSource source; final URL url; final URI
[ -0.2492196410894394, -0.1322914958000183, 0.27018797397613525, -0.11157596856355667, -0.16757643222808838, 0.012894850224256516, 0.5241522192955017, -0.09934572875499725, 0.15819841623306274, -0.24119144678115845, -0.6793107390403748, 0.4785407781600952, -0.31156402826309204, 0.63292264938...
uri; domain = Main.class.getProtectionDomain(); source = domain.getCodeSource(); url = source.getLocation(); uri = url.toURI(); return (uri); } private static URI getFile(final URI where,
[ -0.18880276381969452, -0.2834886908531189, 0.8666238188743591, -0.04299461096525192, 0.09031408280134201, -0.11973273009061813, 0.18292388319969177, 0.13287372887134552, 0.059356939047575, -0.35760655999183655, -0.6881811022758484, 0.23672059178352356, -0.3719603717327118, 0.64680761098861...
final String fileName) throws ZipException, IOException { final File location; final URI fileURI; location = new File(where); // not in a JAR, just return the path on disk if(location.isDirectory())
[ -0.1056004986166954, -0.03435176610946655, 0.6078246831893921, -0.17721804976463318, 0.2580365538597107, 0.3180668354034424, 0.21318024396896362, -0.027758482843637466, -0.022289138287305832, -0.6690374612808228, -0.22868509590625763, 0.11930257081985474, -0.08039252460002899, 0.6464208960...
{ fileURI = URI.create(where.toString() + fileName); } else { final ZipFile zipFile; zipFile = new ZipFile(location); try {
[ -0.11192645877599716, -0.3751528859138489, 0.6553623676300049, -0.057970620691776276, 0.5313523411750793, 0.204726442694664, 0.06676211208105087, -0.16130675375461578, -0.07366528362035751, -0.6988905072212219, -0.4608612060546875, 0.0897076204419136, -0.3290266990661621, 0.413763016462326...
fileURI = extract(zipFile, fileName); } finally { zipFile.close(); } } return (fileURI); }
[ -0.05360746011137962, -0.3866539001464844, 0.6316457986831665, -0.2730705440044403, 0.2852363586425781, 0.041672028601169586, -0.0012468229979276657, -0.26791080832481384, 0.011051015928387642, -0.405281662940979, -0.4923763871192932, 0.435446560382843, -0.4600224792957306, 0.1052856668829...
private static URI extract(final ZipFile zipFile, final String fileName) throws IOException { final File tempFile; final ZipEntry entry; final InputStream zipStream;
[ -0.2507910430431366, -0.21919256448745728, 0.48609742522239685, -0.10276176035404205, 0.01255760807543993, 0.4231952726840973, -0.11578018218278885, 0.09150441735982895, 0.274740993976593, -0.2390969693660736, -0.36301201581954956, 0.4022144079208374, -0.4931199252605438, 0.164652183651924...
OutputStream fileStream; tempFile = File.createTempFile(fileName, Long.toString(System.currentTimeMillis())); tempFile.deleteOnExit(); entry = zipFile.getEntry(fileName); if(entry == null) { throw new FileNotFoundException("cannot find file: " + fileName + ...
[ -0.05455939099192619, -0.3615225851535797, 0.454322874546051, -0.0786193311214447, 0.37982311844825745, 0.11752800643444061, 0.41942691802978516, -0.12862634658813477, -0.16224195063114166, -0.6371690630912781, -0.2781199812889099, 0.3369525671005249, -0.3297848403453827, 0.361237674951553...
zipStream = zipFile.getInputStream(entry); fileStream = null; try { final byte[] buf; int i; fileStream = new FileOutputStream(tempFile); buf
[ -0.16334713995456696, -0.5335173010826111, 0.6149451732635498, -0.23654097318649292, 0.26296281814575195, 0.4337771534919739, 0.3563452363014221, -0.28150227665901184, -0.15885040163993835, -0.6163614988327026, -0.3108319640159607, 0.22391845285892487, -0.5453778505325317, 0.05384573340415...
= new byte[1024]; i = 0; while((i = zipStream.read(buf)) != -1) { fileStream.write(buf, 0, i); } }
[ -0.08275116980075836, -0.22726410627365112, 0.440822035074234, -0.41271156072616577, 0.3126990795135498, 0.25411179661750793, 0.27400776743888855, -0.309326708316803, -0.3337593078613281, -0.5159441232681274, -0.3113915026187897, 0.2831895649433136, -0.3812251091003418, 0.10507901757955551...
finally { close(zipStream); close(fileStream); } return (tempFile.toURI()); } private static void close(final Closeable stream) { if(stream != null) {
[ 0.21088650822639465, -0.274331271648407, 0.797502338886261, -0.24049948155879974, 0.36636337637901306, -0.07337426394224167, 0.23911432921886444, -0.04434995353221893, 0.23836225271224976, -0.20023776590824127, -0.5502080321311951, 0.2626879811286926, -0.47166091203689575, 0.23162044584751...
try { stream.close(); } catch(final IOException ex) { ex.printStackTrace(); }
[ 0.12090013921260834, -0.46707427501678467, 0.3117118179798126, -0.2918976843357086, 0.3374718129634857, 0.1475422978401184, 0.26304635405540466, -0.15984950959682465, 0.21499314904212952, -0.3428490459918976, -0.04879365861415863, 0.5492929816246033, -0.46330025792121887, -0.07023734599351...
} } } ```
[ 0.033695679157972336, 0.4034728407859802, 0.1949702352285385, -0.15257494151592255, 0.4299153685569763, -0.20141436159610748, 0.07711705565452576, 0.4467844069004059, 0.3091506361961365, -0.5090379118919373, -0.3048633635044098, 0.5600791573524475, -0.33611243963241577, 0.3141762912273407,...
I'm developing an app for **windows mobile**. I have my own control that moves the picture inside it. I have overrided the **OnMouseDown** and **OnMouseMove** to redraw the picture where the user move it. I only test it on Windows Mobile 6.1 Professional emulator. It works but I have a problem: I click on the image, ...
[ 0.16235797107219696, 0.11011873185634613, 0.8570176362991333, -0.10338681191205978, 0.183454692363739, -0.052373405545949936, 0.33836326003074646, -0.026155680418014526, -0.286872535943985, -0.671475887298584, 0.10231633484363556, 0.7037895917892456, -0.20901355147361755, 0.132125332951545...
but I'm not sure. Thank you! Mutliple views are more flexiable clearly and if you only have 2 then that is a possibility but its still a pain. However having just 2 instead of N to worry about means you can probably take both into consideration when creating the views in the first place. Hence instead creating multip...
[ 0.12457334995269775, -0.020911484956741333, 0.313915491104126, 0.34881824254989624, -0.3478151261806488, 0.17357227206230164, 0.2232782542705536, 0.2661855220794678, -0.39565834403038025, -0.8619846105575562, 0.17368373274803162, 0.8260467648506165, -0.027606016024947166, 0.302556663751602...
In my application I have to maintain some global application state and global application wide methods like currently connected users, total number of answers, create an application config file etc. There are two options: 1. Make a separate appstate.py file with global variables with functions over them. It looks fine...
[ -0.0016697368118911982, -0.1290278285741806, 0.30027905106544495, 0.057653337717056274, 0.043786611407995224, 0.2438138723373413, 0.292386919260025, -0.16394519805908203, -0.3234158456325531, -0.819158136844635, -0.2527095377445221, 0.35182011127471924, -0.5737833976745605, -0.035477042198...
are not so much related to each other. I can create separate classes but that would be too many classes. EDIT: If I use classes I will be using classmethods. I don't think there is a need to instantiate the class to an object. The second approach seems better. I'd use the first one only for configuration files or some...
[ 0.4335704743862152, 0.03640230372548103, 0.2756817936897278, 0.07748112827539444, -0.16447676718235016, 0.05101744458079338, -0.031562965363264084, 0.30911967158317566, -0.21351589262485504, -0.8960686922073364, -0.2150745838880539, 0.7543867230415344, -0.5805981159210205, -0.0173364989459...
I understand that there are big differences in data-store, but surely since django is bundled and it abstracts data-store away from Satchmo, something can be done? Truth is that I am not a Python guy, been mostly Java/PHP thus far, but I am willing to learn. Plus, if this is not possible today, lets band together and...
[ 0.433125376701355, 0.3273930549621582, 0.1766238808631897, 0.1852148026227951, -0.046786725521087646, -0.21372780203819275, 0.32034581899642944, 0.10157510638237, -0.2598860263824463, -0.7330275177955627, -0.03687091916799545, 0.7086683511734009, -0.2906898856163025, -0.2429523468017578, ...
minimal functionality of the ORM provided by the patch project, should be either you or the Satchmo guys. * Someone hacks around a lot using the [django helper project](http://code.google.com/appengine/articles/appengine_helper_for_django.html), can only be helper project guys.
[ 0.47269582748413086, 0.2374340295791626, 0.02981697954237461, 0.12619861960411072, 0.01517531555145979, -0.29977181553840637, 0.3056296706199646, 0.43949925899505615, -0.385776549577713, -0.35491979122161865, -0.2842937707901001, 0.7209233045578003, -0.08362197130918503, -0.311916053295135...
Is there a way to get functionality similar to `mkdir -p` on the shell from within Python. I am looking for a solution other than a system call. I am sure the code is less than 20 lines, and I am wondering if someone has already written it? For Python ≥ 3.5, use [`pathlib.Path.mkdir`](https://docs.python.org/library/pa...
[ 0.11392741650342941, 0.23079225420951843, 0.5193949341773987, -0.2516339421272278, 0.2083926945924759, -0.0013527183327823877, 0.3869576156139374, -0.19835418462753296, -0.046389319002628326, -0.4589052200317383, -0.3910250961780548, 0.5114027857780457, -0.3596942722797394, -0.042173888534...
as previously: ``` import os os.makedirs("/tmp/path/to/desired/directory", exist_ok=True) ``` --- For even older versions of Python, you can use `os.makedirs` and ignore the error: ``` import errno import os def mkdir_p(path): try: os.makedirs(path) except OSError as exc: # Python ≥ 2.5 ...
[ -0.22209514677524567, -0.10690455138683319, 0.5688623785972595, -0.38273051381111145, 0.4147264063358307, 0.11213050037622452, 0.35173535346984863, -0.3510196805000305, -0.31354156136512756, -0.6267933249473572, -0.30838146805763245, 0.7916028499603271, -0.3849189579486847, -0.290383338928...
raise ```
[ 0.18874414265155792, 0.5928986668586731, 0.14262627065181732, -0.10235293954610825, -0.07094881683588028, -0.105169877409935, 0.06405125558376312, -0.36538609862327576, -0.3165154457092285, -0.31445252895355225, -0.11392885446548462, 0.5471524000167847, 0.036122098565101624, -0.15703111886...
I'm still getting to grips with Django and, in particular, Forms. I created MyForm which subclasses forms.Form in which I define a field like this : owner = forms.CharField(widget=forms.HiddenInput) When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik...
[ 0.46737566590309143, 0.09876947104930878, 0.46974289417266846, -0.24256883561611176, -0.1704034060239792, -0.04136408120393753, 0.04124036431312561, -0.30108416080474854, 0.0033036228269338608, -0.8739174008369446, 0.14170365035533905, 0.4251742362976074, -0.08544757217168808, 0.0035683703...
I try to access form.owner, but there seems to be no "owner" attribute of the form object. I also tried form.instance.owner, but similarly, no luck. What am I doing wrong? What have I misunderstood? I found the solution to this problem which resulted from my own stupidity in the first place. It all became clear to me ...
[ -0.3003067672252655, 0.4444830119609833, 0.612198531627655, -0.1942213922739029, -0.2645110785961151, -0.08092871308326721, 0.4700036644935608, -0.34190160036087036, 0.09061603993177414, -0.7352779507637024, 0.11471836268901825, 0.4900747835636139, -0.11154505610466003, 0.4022133946418762,...
<component name="Manufacturer" insert="false" update="true"> <property name="Name" length="100" type="String"> <column name="Name" /> </property> </component> </class> ``` Notice that the column for the Name property and the column for the Manufacturer component are both mapped to the same c...
[ -0.020697619765996933, -0.0010606329888105392, 0.3714539706707001, -0.048374421894550323, 0.004344208166003227, 0.16946198046207428, 0.02676243521273136, -0.7155852913856506, -0.16057062149047852, -0.5325347781181335, 0.14364244043827057, 0.801217794418335, -0.03185666725039482, 0.53108102...
I want to use something like the following command to create a tarball to deploy: ``` tar cjvf ~/deploy.tar.bz2 `git diff --name-only 0abc 1def` ``` The inner git diff command produces a list of files with relative including the relative path when i run it separately. I'm running into two problems though, I need t...
[ -0.022850029170513153, -0.058351028710603714, 0.10129515081644058, -0.1199977695941925, -0.08987905085086823, 0.025796066969633102, 0.2369418740272522, -0.04738526791334152, -0.11849044263362885, -0.6711034774780273, 0.01720537431538105, 1.100569486618042, -0.4307439923286438, -0.061274200...
noted by kch. Anyway, does anyone know of the solution to these problems, or is there just a plain easier way to script this? I settled on the following solution with sed. ``` tar cjf ~/deploy.tar.bz2 \ `git diff --name-only 0abc 1def|sed -e "s/ /\\\ /g"` ```
[ -0.3117918372154236, 0.4504903554916382, 0.28978151082992554, -0.38201141357421875, 0.06369869410991669, -0.06087634339928627, 0.2807447612285614, 0.09170764684677124, -0.010932397097349167, -0.4371127486228943, -0.3609587252140045, 0.6395349502563477, -0.3053407371044159, -0.1977432966232...
Thanks for reading. I've noticed that if I have a page that has one or more ajax requests open, and I click a link to leave a page, or refresh it, it will wait for the ajax requests to complete before unloading. This isn't usually an issue, but if the request takes a while, it can be. I'm looking for something like:...
[ 0.015614372678101063, -0.0546521320939064, 0.4026715159416199, 0.30267783999443054, -0.3682207763195038, -0.32237228751182556, 0.22416295111179352, 0.13481371104717255, -0.2541569173336029, -0.7290310859680176, -0.1623687893152237, 0.4365687072277069, 0.03605974465608597, 0.021775992587208...
abort(). To unload use the built in [unload](http://docs.jquery.com/Events/unload) jQuery event method. ``` var myajax = $.ajax(...); $(window).unload( function () { myajax.abort(); } ); ```
[ 0.02846720814704895, 0.11189925670623779, 0.12863418459892273, -0.407469242811203, 0.11207377165555954, -0.002180245006456971, 0.6168208122253418, 0.10007175803184509, -0.016317645087838173, -0.2923765778541565, -0.3498800992965698, 0.6239433884620667, -0.5939937233924866, 0.16474431753158...
I have code like this, and I find it a bit hard to read: ``` // code1 if( (expensiveOperation1() && otherOperation() && foo()) || (expensiveOperation2() && bar() && baz()) { // do something } ``` I just changed it to the following, to make it more readable: ``` // code2 const bool expr1 = expensiveOperation...
[ 0.36792951822280884, -0.008940176106989384, 0.40736231207847595, -0.2186693400144577, 0.2591923177242279, -0.1496291309595108, 0.33839988708496094, -0.4201294779777527, -0.07739901542663574, -0.5470324754714966, -0.2504294812679291, 0.9104181528091431, -0.37298229336738586, -0.018364975228...
the second one because it's already clear that the statement will be true. But in my more readable example, both `cond1` and `cond2` have to be computed. Or will the compiler be smart enough to change my `code2` into `code1` if expr2 is not used anywhere else? I would say it shouldn't, since they're not logically equ...
[ 0.5080081224441528, 0.11208876222372055, 0.04640917852520943, -0.2278069704771042, 0.053261857479810715, -0.13440459966659546, 0.34287118911743164, -0.40074604749679565, 0.08394346386194229, -0.45686352252960205, -0.12373709678649902, 0.8705645799636841, -0.43827295303344727, -0.1491507291...
bool combinedOp2() { return expensiveOperation2() && bar() && baz(); } ``` And then call it as follows: ``` if (combinedOp1() || combinedOp2()) { // do something } ```
[ 0.4541740119457245, -0.26871293783187866, 0.24263405799865723, -0.4533616900444031, 0.13732077181339264, -0.08923160284757614, 0.24981728196144104, -0.33147385716438293, -0.12688897550106049, -0.22530634701251984, -0.3310955762863159, 0.593254029750824, -0.727975070476532, -0.1878004521131...
Here is an outline of a page I'm developing. ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel="stylesheet" href=".....
[ 0.3965972661972046, 0.13375324010849, 0.6769511103630066, 0.011407426558434963, -0.2808188498020172, -0.014214931055903435, -0.2158459573984146, -0.21172793209552765, -0.11798294633626938, -0.721721887588501, -0.07343824952840805, 0.007677375804632902, -0.1018264964222908, 0.13425637781620...
</div> <div id="B2"> </div> </div> <div id="colC"> </div> <div id="colD"> </div> </div> <div id="footer"> </div> </body> </html> ``` And the CSS: ``` * { margin: 0px; padding: 0px; } div { border: 1px dotted; } #banner { height: 70px; width: 10...
[ 0.035765938460826874, -0.36703115701675415, 0.6483391523361206, -0.018516164273023605, -0.3408556878566742, 0.22199787199497223, 0.004617071244865656, -0.3166027069091797, -0.30223342776298523, -0.7384475469589233, -0.2700198292732239, 0.0332353450357914, -0.025431275367736816, 0.057997997...
background-color: #CCFFCC; width: 80%; } #colA{ float: left; height: 120px; width: 24%; } #colB{ float: left; height: 80px; width: 24%; } #colC{ float: left; height: 120px; width: 24%; } #colD{ float: left; height: 120px; width: 24%; } #B1{ float: right; height: 48px; width: 80%; } #...
[ -0.18289951980113983, -0.043938204646110535, 0.6942689418792725, -0.09572158753871918, 0.16195018589496613, 0.2093808650970459, 0.15177059173583984, 0.1400851458311081, -0.3603038191795349, -0.5295325517654419, -0.4072481393814087, 0.30324119329452515, -0.24568049609661102, -0.312215626239...
floated divs should float within their container block which is clearly not the case in Firefox 3. So if Firefox's rendering is compliant, what am I missing? Your problem is that IE7 clears the parent element so that it contains the floating child. This is not how it should be rendered. Better explanations by other p...
[ 0.3376755118370056, 0.11536119878292084, 0.7702828645706177, -0.13880856335163116, -0.11507000029087067, -0.19040268659591675, -0.06554543226957321, -0.2933054268360138, -0.22139613330364227, -0.39694204926490784, -0.01706034690141678, 0.08506801724433899, -0.3702245354652405, -0.118349760...
Consider the following Python code: ``` 30 url = "http://www.google.com/search?hl=en&safe=off&q=Monkey" 31 url_object = urllib.request.urlopen(url); 32 print(url_object.read()); ``` When this is run, an Exception is thrown: ``` File "/usr/local/lib/python3.0/urllib/request.py", line 485, in http_error_...
[ 0.13254986703395844, 0.2782573103904724, 0.3834329843521118, -0.06151960790157318, 0.025506315752863884, -0.09621044993400574, 0.3802395761013031, -0.07531896233558655, -0.5479970574378967, -0.4824652373790741, -0.3270134925842285, 0.3850772976875305, -0.4968559443950653, -0.00157869630493...
of searching Google, they are also not likely to change if Google changes their result page layout.
[ 0.19496232271194458, 0.21124997735023499, 0.39275336265563965, 0.2656155526638031, 0.1830083578824997, -0.1270381063222885, 0.5524114370346069, 0.17714695632457733, -0.3142358958721161, -0.7357081174850464, -0.11092433333396912, 0.35459744930267334, 0.016549071297049522, -0.029599623754620...
What is the difference between [IronPython](http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython) and [BOO](http://boo.codehaus.org/)? Is there a need for 2 Python-like languages? [IronPython](http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython) is designed to be a faithful implementation of Python o...
[ 0.22756405174732208, 0.19572027027606964, 0.13132858276367188, -0.3443237841129303, -0.35123375058174133, 0.06770580261945724, 0.22430716454982758, -0.2060890793800354, -0.01802748441696167, -0.23185071349143982, -0.17775577306747437, 0.5770429372787476, -0.7302123308181763, -0.14893946051...
doesn't agree with the design decisions (most notably, lack of explicit self) 3. The language is explicitly designed to be "wrist friendly" -- that is, to minimize the need for the Shift key or other multi-key combinations to be used. 4. Boo is statically typed by default, but allows optional duck typing. There are so...
[ 0.02327081933617592, -0.14255259931087494, 0.23812393844127655, -0.14345134794712067, -0.24111463129520416, -0.3001002371311188, 0.33522090315818787, -0.08370256423950195, -0.22171811759471893, -0.23817898333072662, -0.12141942232847214, 0.5172034502029419, -0.38974830508232117, -0.5340539...
Microsoft.
[ 0.10266800969839096, 0.23922131955623627, -0.13749560713768005, 0.30400392413139343, -0.07817668467760086, -0.14460855722427368, -0.16755682229995728, 0.14422845840454102, 0.11792682111263275, -0.5699630975723267, 0.0075086792930960655, 0.2889362573623657, 0.15084455907344818, 0.2949810028...
When using a UITabBarController, how do you get the size of the tab bar at the bottom ?Similarly, how do you know how much room you have inside the tabbed-view for your content? I see a lot of examples of people sizing their tab child views to [[UIScreen mainScreen] applicationFrame], which can’t be correct because the...
[ 0.3029252588748932, 0.10992182046175003, 0.6375071406364441, 0.30618777871131897, -0.21950450539588928, -0.11216545104980469, 0.0790819302201271, -0.1876489520072937, -0.31150999665260315, -0.6860426068305969, -0.09338652342557907, 0.6975740790367126, -0.10231959074735641, 0.27681007981300...
it'll all work out. You can get the size of the tab bar by accessing your tab bar controller's tabBar property and looking at its frame. The total size of the tab bar plus the area for the view can be found by looking at the tab bar controller's view property's frame, so a little subtraction will get you the number yo...
[ 0.49914446473121643, 0.21904854476451874, 1.1738766431808472, -0.2878270149230957, 0.15085996687412262, 0.1780383288860321, 0.04648467153310776, -0.4816317558288574, -0.4130072593688965, -0.5994220972061157, 0.06793173402547836, 0.6668096780776978, -0.07008674740791321, 0.18649983406066895...
Busy learning Ruby... the documentation have an example: "hello world".count("lo", "o") that return 2 how does that return 2? In my example I've: puts "Lennie".count("Le", "ie") that return 2. How does count work in this regard? `"hello world".count("lo")` returns five. It has matched the third, fourth, fifth, eigh...
[ -0.0066565219312906265, 0.04437032341957092, 0.22307972609996796, -0.13826881349086761, -0.02159741148352623, 0.23841622471809387, 0.22503520548343658, -0.1417318880558014, -0.26408207416534424, -0.5226303339004517, -0.3189884126186371, 0.2893068194389343, -0.46729663014411926, -0.10270050...
our example, both sets one and two contain the fifth and eighth characters from the string. That's two characters total. So, `count` returns two.
[ 0.05029953643679619, -0.11216709017753601, 0.012426221743226051, -0.2516508102416992, -0.16546674072742462, 0.4531870484352112, 0.25024712085723877, -0.12510144710540771, -0.10679750889539719, -0.3489823341369629, -0.09951857477426529, 0.3746272027492523, -0.26817601919174194, 0.1257937699...
I can't seem to get this working, here is my (stripped down) code: - ``` [XmlRoot("report")] public class Report { [XmlArray("sections"), XmlArrayItem("section")] public List<Section> Sections; } public class Section { public Report Report; } ``` Am I missing something? Your objects contain circular ref...
[ 0.28195348381996155, 0.020819181576371193, 0.31828659772872925, -0.14141394197940826, 0.12507934868335724, -0.18282614648342133, 0.11608114093542099, -0.19948597252368927, -0.5162072777748108, -0.09204339236021042, 0.12253929674625397, 0.2525046765804291, -0.29414650797843933, 0.6273279190...
I'm looking for an ORM that offers complete or near-complete LINQ support. LINQ to SQL - Supports about everything inside of LINQ (.Contains, Math.Log, etc) - Cannot eager load relationship properties without creating a new datacontext ADO.NET Entity Framework - Terrible LINQ support (lots of missing feature...
[ -0.1080147996544838, 0.10245200991630554, 0.44927194714546204, 0.29547497630119324, -0.054970741271972656, -0.2233145534992218, 0.3413222134113312, -0.06143992394208908, -0.1735881268978119, -0.3554507791996002, -0.007161011453717947, 0.53590327501297, -0.18857912719249725, 0.0142579413950...
and pieces from each. I personally really like ADO.NET EF except the features it is missing make it just frustrating to use. I know some people praise NHibernate up and down and I'm not knocking it but I spent today trying it out and it's ok but it's LINQ support is not that great. NHibernate with Linq to NHibernate
[ 0.3069373667240143, 0.11660142242908478, 0.14385941624641418, 0.08910644054412842, -0.8226215839385986, -0.1360321193933487, -0.023969285190105438, 0.034577641636133194, 0.022859089076519012, -0.5460765361785889, 0.18038217723369598, 0.33958759903907776, -0.40461355447769165, 0.29067716002...
I am developing my first iPhone application, and I have made it past the "machinery" and now I am wrapping up fit & finish details. I have a view that slides in from the bottom of the screen for my settings pane. The view itself has an opacity of 0, and has a UIImageView view inside of it with a PNG creating the actua...
[ -0.040272101759910583, -0.05955442041158676, 0.9390703439712524, -0.012615179643034935, 0.02378191612660885, 0.5177270174026489, 0.08342765271663666, -0.2746942341327667, 0.038387175649404526, -0.8903889656066895, 0.02288339100778103, 0.5859388113021851, -0.0844469964504242, -0.14237204194...
PNG I am using as my background is transparent only in the uppermost 30 pixels across it's width. If I use a PNG with no transparency, the animation is smooth. The application itself is highly graphical, so the view is animating out over top of a screen full of other PNGs. I would be extremely surprised if the device...
[ 0.11934106796979904, 0.003941900096833706, 0.45740988850593567, 0.1786811351776123, -0.36078348755836487, 0.4562065303325653, -0.08785422146320343, 0.04453146830201149, -0.1927122324705124, -0.7915523052215576, -0.008090116083621979, 0.4933745265007019, -0.09149623662233353, -0.10662758350...
somehow? This is new territory for me, and I know there must be ways to optimize that are considered good practice. Thanks for your time! It won't matter if you use Core Animation "directly" or animate the center property: it is choppy because the graphics hardware has to composite the transparent image with the backg...
[ 0.5730506181716919, -0.10502602905035019, 0.22588013112545013, 0.7137545347213745, 0.11490190774202347, -0.044568248093128204, 0.19706347584724426, -0.02400491200387478, -0.2976815700531006, -0.5707705616950989, 0.08596190810203552, 0.27446144819259644, 0.4643215537071228, -0.1163273900747...
your drawing. If only the top 30 pixels need to be transparent, it might be worth splitting the background into two views, one 30 pixel strip at the top (transparent) and the rest (opaque). If it is compositing the entire view every frame, that change might be enough to let it know it only has to composite only the 30...
[ 0.34796518087387085, -0.34278449416160583, 0.48683398962020874, 0.3930412530899048, -0.17059892416000366, 0.4742715060710907, 0.07258830219507217, 0.01956995390355587, -0.3015270233154297, -0.6842831373214722, 0.3589542508125305, 0.5362337231636047, -0.17760531604290009, -0.248190581798553...
I have been studying Java for a few months and am now starting to learn C. I am a little confused, I was under the impression that passing an object by reference and passing a pointer to that object were the same thing: I thought the difference was that in Java all passing of objects is done with pointers automatical...
[ 0.16038385033607483, 0.07052108645439148, 0.09954973310232162, -0.27732473611831665, -0.5826870799064636, -0.19735541939735413, 0.3631894886493683, 0.04678747430443764, -0.48322412371635437, -0.6008434295654297, 0.324606716632843, 0.16693736612796783, -0.21801134943962097, -0.1489611864089...
C has pass-by-reference. They are both strictly pass-by-value. Pass-by-reference semantics mean that when you change the value of the parameter in the method, the caller will see that change in the argument. Now, you may be thinking: "But that's the case in Java! If I change an object during the method, the caller se...
[ 0.11317279189825058, 0.04154602810740471, 0.2938564419746399, -0.1598634570837021, -0.22747641801834106, -0.33824223279953003, 0.10872885584831238, -0.22377385199069977, -0.2986159920692444, -0.19429056346416473, -0.22099316120147705, 0.5790038704872131, -0.6335155963897705, 0.316012144088...
Object(); foo(y); // y is still not null! } ``` If the parameter were *really* passed by reference, `y` would be null afterwards. Instead, the value of `y` is just a reference, and that reference is passed by value. It's confusing because the word "reference" is in both terms, but they're different things. Y...
[ 0.3307466208934784, 0.21311381459236145, 0.33425989747047424, 0.08370236307382584, -0.4088493585586548, -0.03857173025608063, 0.12171187251806259, -0.09694603830575943, -0.3096671998500824, -0.2986109256744385, -0.08770760893821716, 0.5289883017539978, -0.32501929998397827, 0.2427968084812...
[my Stack Overflow answer](https://stackoverflow.com/questions/423823/whats-your-favorite-programmer-ignorance-pet-peeve/423833#423833) related to the topic.
[ 0.05094176158308983, 0.07566486299037933, 0.30658382177352905, 0.09724453091621399, 0.12841841578483582, -0.1635710895061493, 0.058445412665605545, 0.04870012030005455, -0.37715911865234375, -0.13916833698749542, -0.0719199925661087, 0.40572571754455566, 0.04358436167240143, 0.033198837190...
I'm probably doing something stupid but I can't figure out what it is. The output I'm seeing from this program is ``` foo test ``` What I'm expecting to see is ``` foo abc test ``` Does anyone see anything obviously wrong here? ``` class Foo def initialize(l) @label = l end def label @lab...
[ 0.5139554738998413, 0.1797998994588852, -0.05739763751626015, -0.19607685506343842, 0.17887403070926666, -0.34074556827545166, 0.46461784839630127, -0.3131853938102722, 0.05823442339897156, -0.7261198163032532, 0.05827390402555466, 0.49898895621299744, -0.5441040396690369, 0.26161712408065...
look like ``` def abc=(val) @abc = val end ```
[ 0.30068671703338623, 0.05317984148859978, 0.4292841851711273, -0.2929641306400299, 0.22539986670017242, -0.21346396207809448, 0.5165937542915344, 0.1745774894952774, -0.1116141676902771, -0.9078747034072876, -0.29674258828163147, 0.684712827205658, -0.4974799156188965, 0.22792594134807587,...