text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I'm perverted in the sense that I hate exploring code and database structures in a tree view and I'd much prefer using something like the Powershell for that. Most of the stuff I need to do in SQL is exploring, i.e. looking at what columns does a table have or what does a particular stored procedure do. Looking at ta...
[ 0.49955400824546814, 0.14910727739334106, 0.5963788032531738, 0.1803985983133316, -0.05737532675266266, -0.2905287742614746, 0.35925716161727905, -0.26585882902145386, -0.2857426702976227, -0.38947078585624695, 0.6264572739601135, 0.34795457124710083, -0.25354284048080444, 0.09603800624608...
you with it. If you are using Sql Server 2005 then here is a [page with a script](http://www.powergui.org/thread.jspa?threadID=8042&tstart=0) to help you with this. [EDIT] You may use the SP sp\_helptext to see the contents of the required stored procedure.
[ 0.034832701086997986, -0.1016213521361351, 0.41778069734573364, 0.06301882863044739, -0.20427078008651733, -0.2953803241252899, 0.1696651130914688, -0.012904535047709942, -0.5357200503349304, -0.40453633666038513, 0.06104767322540283, 0.5088967680931091, -0.12006484717130661, -0.0867900326...
I was going to use jQuery to clone the input field when I click a button to make another field, but I was thinking of doing: `Page One, Page Two, Page Three` <- then send that as one `$_POST` to the server and have it take each page and break on the "," comma then for each insert in to my POSTS table. Any idea on how...
[ 0.31905800104141235, 0.18106678128242493, 0.42246538400650024, 0.06984341889619827, -0.14707747101783752, 0.20363809168338776, -0.11348643153905869, -0.09695077687501907, -0.16551734507083893, -0.4121270775794983, -0.0552692711353302, 0.23504900932312012, -0.1457607001066208, -0.0101620750...
times using the `foreach()`. ``` for each(){ EXECUTE SQL HERE } ``` Does that sound like it would be the best way of going about it? If you set the `name` attribute of the `input` element to the name of an array, e.g. `foo[]`, you'll be able to access it as such when processing the `$_POST` vars, e.g. ``` <input ...
[ 0.19403864443302155, 0.03728199005126953, 0.26987385749816895, -0.3851517140865326, -0.04945890232920647, 0.3104653060436249, 0.13660429418087006, -0.44725459814071655, -0.046552788466215134, -0.6856551170349121, 0.010801883414387703, 0.5279501676559448, -0.2862408757209778, 0.128986477851...
I need to have a `static void* array[1024];` in a library and i need to have it set to NULL for every entries. My question is about the best way to set the entire array to NULL, is a `memset (array, NULL, sizeof (void*) * 1024)` the best solution? `static` pointers are automatically initialized to `NULL`. See C99:TC3 ...
[ -0.16018526256084442, -0.132389634847641, 0.0533733144402504, 0.029850972816348076, 0.06376411765813828, -0.0713905394077301, 0.283829927444458, -0.11891194432973862, -0.28737619519233704, -0.31746241450309753, -0.2936474084854126, 0.5753020644187927, -0.3446280360221863, 0.033225648105144...
null pointer; > * if it has arithmetic type, it is initialized to (positive or unsigned) zero; > * if it is an aggregate, every member is initialized (recursively) according to these rules; > * if it is a union, the first named member is initialized (recursively) according to these rules. --- Also, contrary to what o...
[ -0.1495620310306549, 0.26347798109054565, -0.020347150042653084, 0.22609122097492218, -0.17410679161548615, 0.0014666515635326505, 0.3682517409324646, -0.10203393548727036, -0.1815943568944931, -0.3918818533420563, -0.1087556928396225, 0.07917240262031555, -0.36021286249160767, 0.181303799...
null pointer is to either loop over the entries yourself and set them to `NULL`, or to use an uninitialized `static` array which you can `memcpy()` over the array you want to set to `NULL`.
[ -0.04842289164662361, -0.29594743251800537, 0.05323310196399689, 0.11503107100725174, -0.057277217507362366, -0.013965305872261524, 0.22586055099964142, 0.12876681983470917, -0.10231661051511765, -0.37300905585289, -0.10806435346603394, 0.19013646245002747, -0.421010822057724, 0.0192548073...
Anyone know what is the project home site of the RSS4J. I found several reference on Maven repositories, but can't find the original project site. Also is this project alive? It was on www.churchillobjects.com, but that domain has now been tranferred to a domain parking site. The Wayback Machine has [this page](http://...
[ 0.3715803027153015, -0.17692260444164276, 0.022230273112654686, -0.08805675804615021, -0.1243230402469635, -0.19976119697093964, 0.07901564240455627, 0.2802797853946686, -0.34213200211524963, 0.12400923669338226, -0.02475556544959545, 0.17604485154151917, 0.06312897056341171, 0.45612308382...
Learning Common Lisp (using GNU CLISP 2.43) .. so might be a noob mistake. Example is the 'print prime numbers between x and y' ``` (defun is-prime (n) (if (< n 2) (return-from is-prime NIL)) (do ((i 2 (1+ i))) ((= i n) T) (if (= (mod n i) 0) (return NIL)))) (defun next-prime-after (n) (do ...
[ -0.40673694014549255, -0.2549194097518921, 0.3964884281158447, 0.2060490995645523, 0.17605134844779968, -0.5587297677993774, 0.4908123016357422, -0.11555010080337524, 0.2093481868505478, -0.8034993410110474, -0.12446694821119308, 0.6009661555290222, -0.3038673996925354, -0.3395624160766601...
,start (next-prime-after ,start)) (next-prime-after ,var))) ((> ,var ,end)) ,@body)) (defmacro do-primes-v3 ((var start end) &body body) (let ((loop-start (gensym)) (loop-end (gensym))) `(do ((,loop-start ,start) (,loop-end
[ -0.06984702497720718, -0.17847934365272522, 0.5723701119422913, -0.2979213297367096, 0.4398026168346405, 0.04334862157702446, 0.3994620144367218, -0.8813943266868591, -0.06712952256202698, -0.33728379011154175, -0.2922332286834717, 0.7078132629394531, -0.4370695948600769, 0.057941943407058...
,end) (,var (if (is-prime ,loop-start) ,loop-start (next-prime-after ,loop-start)) (next-prime-after ,var))) ((> ,var ,loop-end)) ,@body ))) ``` do-primes-v2 works perfectly. ``` [13]> (do-primes-v2 (p 10 25) (format t "~d
[ 0.16620318591594696, -0.028385434299707413, 0.607065737247467, -0.42383795976638794, 0.38211458921432495, -0.05428574979305267, 0.47641122341156006, -0.780372679233551, 0.019016742706298828, -0.3518938720226288, -0.26961398124694824, 0.7767285108566284, -0.263582319021225, -0.1102167963981...
" p)) 11 13 17 19 23 ``` Next I tried using gensym to avoid naming clashes in macro expansion - do-primes-v3. However I'm stuck with a ``` *** - EVAL: variable #:G3498 has no value ``` Tried using macro-expand to see if i could spot the mistake but I can't. ``` [16]> (macroexpand-1 `(do-primes-v3 (p 10 25) (fo...
[ -0.11115215718746185, 0.2679217457771301, 0.6688053011894226, -0.24213595688343048, 0.18634846806526184, 0.009646736085414886, 0.32003700733184814, -0.5807176828384399, -0.29365575313568115, -0.48322969675064087, -0.38879305124282837, 0.46513065695762634, -0.5083653330802917, -0.0322282724...
the bindings in a scope where they *are* visible. In this particular case `var` needs to reference the other binding `loop-start`.
[ 0.2756490707397461, -0.03672757372260094, 0.11288026720285416, -0.1388356238603592, -0.12398383021354675, -0.5170989036560059, 0.2750346064567566, -0.23448067903518677, -0.19770734012126923, -0.5462326407432556, -0.4911459684371948, 0.22757597267627716, -0.541056215763092, 0.36645108461380...
Having seen how [NInject can do it](http://codeclimber.net.nz/archive/2009/02/10/how-to-use-ninject-to-inject-dependencies-into-asp.net-mvc.aspx) and [AutoFac can do it](http://www.jeremyskinner.co.uk/2008/11/08/dependency-injection-with-aspnet-mvc-action-filters/) I'm trying to figure out how to inject dependencies in...
[ 0.1709192842245102, -0.19978287816047668, 0.30379852652549744, -0.21306569874286652, 0.027489401400089264, -0.22202707827091217, 0.40698933601379395, -0.2942245602607727, -0.15199445188045502, -0.47300902009010315, -0.112070731818676, 0.5987312197685242, -0.52040034532547, -0.0746731907129...
doing that with Castle Windsor? And no, changing DI framework is not an option. Make a generic attribute: MyFilterAttribute with ctor taking a Type as argument - i.e. something like this: ``` public class MyFilterAttribute : ActionFilterAttribute { public MyFilterAttribute(Type serviceType) { this.service...
[ 0.1356186866760254, -0.3221246898174286, 0.26307186484336853, -0.21644094586372375, 0.07639269530773163, 0.05812652036547661, 0.3729309141635895, -0.48320767283439636, -0.05236629396677017, -0.321439653635025, -0.2639448046684265, 0.4301092028617859, -0.3901275396347046, -0.090872801840305...
implemented analogously public Type ServiceType { get { return serviceType; } } public IWindsorContainer Container { set; get; } } ``` Then use the same approach as the two articles you are referring to, in order to take control of how actions are invoked, and do a manual injection of your WindsorContainer i...
[ 0.18341945111751556, -0.3310142159461975, 0.33706146478652954, -0.15397216379642487, -0.15431281924247742, 0.03650275245308876, 0.2544248402118683, -0.45756226778030396, -0.17670847475528717, -0.7704885601997375, -0.11858413368463516, 0.5686808228492737, -0.7242059111595154, -0.23212502896...
not even be tied to ASP.NET MVC, and your attribute is merely a piece of metadata - the way it is actually supposed to be! :-)
[ 0.49725106358528137, -0.05838194862008095, 0.43359240889549255, 0.4613170623779297, 0.12653115391731262, -0.5041836500167847, 0.06850840896368027, -0.15706799924373627, -0.3098742663860321, -0.1757703572511673, -0.11726624518632889, 0.5308133959770203, -0.2434508055448532, 0.06536838412284...
I need a dialog tool similar to cdialog (or whiptail), but one that will work on Windows. I have MinGW and compiling something from source is no problem, but both cdialog and whiptail, the only ones that I know of, contain code that is UNIX-specific, and so they will not compile on Windows. Are there any alternative...
[ 0.29651448130607605, 0.008287530392408371, 0.16088847815990448, 0.07458430528640747, -0.14406774938106537, -0.22577407956123352, 0.012063445523381233, 0.2929951846599579, -0.145460307598114, -0.786904513835907, 0.18948310613632202, 0.5415551662445068, -0.37090423703193665, 0.06755481660366...
common GUI controls such as file selectors, text input, progress bars, yes/no confirmations and more with a command-line application. It is ideal for use in shell and Perl scripts (or Ruby, or Python, or... etc).
[ -0.15948940813541412, -0.20261365175247192, 0.15474973618984222, 0.08078475296497345, 0.04662299156188965, -0.19595494866371155, -0.20358945429325104, 0.3361695110797882, -0.055521972477436066, -0.6690487861633301, -0.4111849069595337, 1.019766092300415, -0.29137593507766724, -0.2420183718...
I have a MySQL script which is executed automatically under certain conditions. That script executes an `ALTER TABLE` command, because that column is needed in the database, but it may or may not have it... Is it possible to make MySQL 4 execute the `ALTER TABLE` statement if the column doesn't exist or ignore the *du...
[ 0.3779832124710083, 0.26492559909820557, 0.3764638900756836, 0.023520011454820633, 0.08340509980916977, -0.07034792006015778, 0.24915339052677155, -0.30456259846687317, -0.15745660662651062, -0.5826975107192993, 0.16963133215904236, 0.5594870448112488, -0.3563501536846161, 0.06097199022769...
the question. In python for example, the error would raise an exception which could then be caught and dealt with or ignored. [EDIT] From the comment below, seems like you're looking for the mysql -f command line option.
[ 0.1833619773387909, -0.0020206253975629807, -0.061433590948581696, 0.07106974720954895, 0.08702617138624191, -0.15282751619815826, 0.1283729374408722, 0.11573906987905502, -0.23032262921333313, -0.2930217683315277, -0.38993632793426514, 0.6885632872581482, -0.2906959056854248, -0.235634461...
When I talk to an developer from the Microsoft ASP.NET world and he uses the word "Webservice", does that word in every case imply a specific data format (XML? SOAP?)? Or is it just anything you can call via http(s)? In my view, it can be anything that's over http/https, and intended for calling by an application rath...
[ 0.31418493390083313, -0.10039236396551132, 0.03501902520656586, 0.18338847160339355, -0.22951571643352509, 0.11119627207517624, 0.030532004311680794, -0.11919626593589783, 0.15946193039417267, -0.669451117515564, -0.07889450341463089, 0.5687214732170105, -0.12924449145793915, 0.06825069338...
I am programming a list of recent network messages communicated to/from a client. Basically I just want a list that stores up to X number of my message objects. Once the list reaches the desired size, the oldest (first) item in the list should be removed. The collection needs to maintain its order, and all I will need ...
[ 0.2712811827659607, 0.013614055700600147, 0.5009760856628418, -0.25307372212409973, -0.10666581243276596, -0.02290329337120056, 0.009566008113324642, -0.17728987336158752, -0.47726139426231384, -0.6483481526374817, -0.031035330146551132, 0.22350557148456573, -0.34079816937446594, 0.3468044...
I use [Lucene.net](http://incubator.apache.org/lucene.net/) for indexing content & documents etc.. on websites. The index is very simple and has this format: ``` LuceneId - unique id for Lucene (TypeId + ItemId) TypeId - the type of text (eg. page content, product, public doc etc..) ItemId - the web page id, docu...
[ 0.15282811224460602, 0.16926437616348267, 0.6231059432029724, 0.05857301503419876, -0.3557409942150116, -0.12436919659376144, -0.14276838302612305, 0.0148546127602458, 0.02076372131705284, -0.9897239208221436, -0.20605532824993134, 0.1784270852804184, -0.0020760679617524147, 0.221940636634...
index and add an additional 'language' field to it to filter the results. Which is the best option - or is there another? I've not used multiple indexes before so I'm leaning toward the second. I do [2], but one problem I have is that I cannot use different analyzers depending on the language. I've combined the stopwo...
[ -0.02545926347374916, 0.08043544739484787, 0.10123294591903687, 0.1718580573797226, -0.4577060043811798, -0.07579769194126129, 0.1596456915140152, -0.04532100632786751, 0.19034560024738312, -0.5249233245849609, -0.020954955369234085, 0.4845436215400696, -0.23441806435585022, -0.39590200781...
We have a string processing service (c++, uses stdin/out for in/output) that has different layouts, each layout runs separately (eventually will run on separate machines), each layout takes time to load, thats why it must keep running after first run. I must implement a system with client that will ask the master ser...
[ 0.3588199019432068, -0.05824924632906914, 0.3957536220550537, -0.0020952702034264803, 0.20465141534805298, 0.007443878334015608, -0.09108179062604904, -0.12684306502342224, -0.16520869731903076, -0.8230743408203125, 0.010227665305137634, 0.29058656096458435, -0.4783758521080017, 0.38176515...
the best way to go about implementing the servers? Should I keep an open connection between slave/master until the process is complete to notify the master that the connection is over or keep some sort of var in a synchronized function to check that? Any other important inputs (or other designs) I have overlooked are ...
[ 0.6581414341926575, -0.11457261443138123, 0.5367588996887207, 0.10914359986782074, 0.2025810182094574, -0.10256458073854446, 0.05307220667600632, 0.0869411826133728, -0.1244557797908783, -0.6929993033409119, 0.1640661507844925, 0.5364720821380615, -0.22524666786193848, 0.2013077735900879, ...
advantageous for them to start using it. From a business perspective, it is a lot easier to justify an expense than you already have than to try and add an additional one.
[ 0.36167222261428833, 0.09500089287757874, -0.1059083566069603, 0.3850348889827728, 0.2905190885066986, 0.19690264761447906, -0.33697590231895447, 0.22900281846523285, -0.11608429998159409, -0.6518834233283997, 0.3991595506668091, 0.43067628145217896, 0.3443136215209961, -0.0222009681165218...
This is has been bugging me for quite some time. ``` >> nil.id (irb):2: warning: Object#id will be deprecated; use Object#object_id => 4 ``` Why would nil.id be 4? (or nil.object\_id if you want to be picky about deprecations) This is because nil is an object created when the language initializes, and that object's ...
[ 0.5132338404655457, 0.1650102138519287, 0.24818655848503113, -0.20881924033164978, -0.3725273013114929, -0.08474761247634888, 0.4689447581768036, -0.05426444858312607, -0.40497228503227234, -0.36917874217033386, -0.3753247857093811, 0.4451318383216858, -0.3569364547729492, 0.54787224531173...
I'm currently coding a French website. There's a schedule page, where a link on the side can be used to load another day's schedule. Here's the JS I'm using to do this: ``` <script type="text/javascript"> function load(y) { $.get(y,function(d) { $("#replace").html(d); mod(); ...
[ 0.7831619381904602, 0.04940811172127724, 0.3868086338043213, -0.26058611273765564, -0.0794903114438057, 0.0701952800154686, 0.2975675165653229, -0.004587057512253523, -0.013133984059095383, -0.7232052087783813, -0.0707436352968216, 0.4347204267978668, -0.2789166569709778, -0.02414846234023...
$("#dates a").click(function() { y = $(this).attr("href"); load(y); return false; }); } mod(); </script> ``` The actual AJAX works like a charm. My problem lies with the response to the request. Because it is a French website, there are many accented letters. I...
[ 0.08407770842313766, 0.04409104958176613, 0.541117250919342, -0.06121399626135826, -0.2932080924510956, -0.28943878412246704, 0.36657750606536865, 0.34829071164131165, 0.07484599202871323, -0.5212467312812805, -0.21048139035701752, 0.6204298138618469, -0.027125932276248932, -0.042969968169...
to my AJAX request, the accents are becoming ?'s because the character encoding seems to be changed back to UTF-8. How do I avoid this? I've already tried adding some PHP at the top of the requested documents to set the character set: ``` <?php header('Content-Type: text/html; charset=ISO-8859-15'); ?> ``` But that...
[ -0.02958778105676174, 0.48073428869247437, 0.7015118598937988, -0.22576391696929932, -0.29735803604125977, 0.11675618588924408, 0.26038891077041626, 0.3814978301525116, -0.042323481291532516, -0.8130972981452942, -0.2317584604024887, 0.5511684417724609, 0.10004313290119171, -0.168514236807...
chars - why not use it on your data source? **EDIT** [[Archive copy of the test file.](https://web.archive.org/web/20090220110811/http://blog.yoavfarhi.com/test.html)] with your data Everything should be UTF-8 in the first place. I loaded the files in notepad++, converted to utf-8 and manually changed the charac...
[ 0.29484933614730835, 0.3110446631908417, 0.14905545115470886, -0.2541053593158722, -0.21351970732212067, 0.39473816752433777, 0.3529863953590393, 0.019632862880825996, 0.04321778193116188, -0.41549015045166016, -0.03304677456617355, 0.5506096482276917, -0.11241456121206284, -0.204564869403...
the file itself)
[ 0.08268746733665466, 0.24013514816761017, 0.1935068815946579, 0.06550419330596924, 0.23719285428524017, 0.2730933129787445, 0.09680134803056717, -0.1704479604959488, -0.1872958391904831, 0.011802056804299355, -0.3230854868888855, 0.2922865152359009, -0.25700247287750244, 0.3570131957530975...
I'm making a website that will have to render correctly on FF/IE6/IE7/Opera/Safari. IE6 came as a late requirement (when I had done all the other browsers) and it just has to be useable, not necessarily the same as on the other browsers. Now I'm tweaking it so that it's useable on IE6 as well. To this end I've created...
[ 0.41361838579177856, 0.16593483090400696, 0.3835187554359436, -0.16737601161003113, -0.344918817281723, -0.20387977361679077, 0.39060524106025696, 0.1430530995130539, -0.05693690851330757, -0.9683261513710022, -0.21298182010650635, 0.5623257160186768, -0.24147742986679077, -0.0626925081014...
file that is in the theme's folder, thus including this file unconditionally on all browsers. I would like to stick to themes because it's completely feasible that we might create more skins for our application later (if the customers desire that). Is there any way how I can make ASP.NET exclude this specific .CSS fi...
[ 0.39897894859313965, -0.06158158555626869, 0.5196167826652527, -0.002890713745728135, -0.27161696553230286, -0.3261146545410156, 0.34181785583496094, -0.3380819261074066, -0.40598347783088684, -0.4642097055912018, -0.14722628891468048, 0.39551302790641785, -0.1840173304080963, 0.0177720356...
then removed it in JS upon page loading. :) I don't think you can. We stopped using the App\_Themes folder for exactly that reason. This also saved us having to prefix every css file with a number so they load in the right order.
[ 0.2145605981349945, 0.18665263056755066, 0.43274542689323425, 0.008904881775379181, 0.03241507336497307, 0.08656898140907288, 0.4849528670310974, 0.3999176621437073, -0.34839317202568054, -0.46225568652153015, -0.27524441480636597, 0.24336473643779755, -0.539825439453125, 0.244768083095550...
I have an application which embeds a `xulrunner` based browser. I have to load some flash content in it which talks to some javascript to update the browser title. The flash content works fine when launched from Firefox but not inside my app. I tried a sample html file which has some javascript and they work fine....
[ 0.4760892689228058, 0.5302624702453613, 0.2159513533115387, -0.022882968187332153, -0.2360813021659851, -0.2063208967447281, 0.3318519592285156, 0.1320667415857315, -0.10528768599033356, -0.740897536277771, -0.023376088589429855, 0.6034597754478455, -0.23345737159252167, 0.1250916719436645...
settings in `xulrunner`. Could somebody help me figure out what the problem might be? I don't think you can. We stopped using the App\_Themes folder for exactly that reason. This also saved us having to prefix every css file with a number so they load in the right order.
[ 0.23357413709163666, 0.12697528302669525, 0.43327194452285767, 0.060499656945466995, -0.1671833097934723, 0.05058477818965912, 0.35214030742645264, 0.6070381999015808, -0.37975865602493286, -0.7799386978149414, -0.053906798362731934, 0.4726686477661133, -0.4260508716106415, 0.2414440661668...
Coming from many years of asp.net development back to a winforms application. Looking for advice and tips on how to "style" winforms similar to how I would do with CSS/Master Pages in asp.net. I am interested on how to update font/colors for certain types of controls in one place. How to maintain consistency for la...
[ 0.6220719814300537, -0.17756813764572144, 0.378251314163208, 0.3980851173400879, -0.19754840433597565, 0.06105624511837959, -0.193843811750412, -0.10872390866279602, -0.18442703783512115, -0.7463369369506836, 0.3997320830821991, 0.3243732750415802, -0.22229866683483124, -0.0689495429396629...
styling of a component type. You could also have each of the controls take a style object as a parameter for system-wide styles.
[ 0.34811416268348694, -0.2437625229358673, 0.434410035610199, 0.5294652581214905, -0.2482479214668274, -0.023087799549102783, 0.03337239474058151, -0.35823380947113037, 0.03002014383673668, -0.5969151854515076, 0.19452612102031708, 0.6533663272857666, -0.18137209117412567, 0.109824366867542...
I'm using a custom attribute inherited from an attribute class. I'm using it like this: ``` [MyCustomAttribute("CONTROL")] [MyCustomAttribute("ALT")] [MyCustomAttribute("SHIFT")] [MyCustomAttribute("D")] public void setColor() { } ``` But the "Duplicate 'MyCustomAttribute' attribute" error is shown. How can I cr...
[ 0.36721503734588623, 0.12182915210723877, 0.5995604395866394, 0.03722408041357994, 0.27417904138565063, 0.10485880076885223, 0.042057037353515625, 0.03452840447425842, 0.07847527414560318, -0.5225327014923096, -0.009688515216112137, 0.7526220679283142, -0.3086801767349243, 0.36549201607704...
Can I have nested try-catch blocks? For example: ``` void f() { try { //Some code try { //Some code } catch(ExceptionA a) { //Some specific exception handling
[ 0.19109944999217987, -0.0408889576792717, -0.21117977797985077, -0.11036987602710724, 0.09608501195907593, -0.27996498346328735, 0.35913321375846863, -0.3007523715496063, -0.03352116048336029, -0.3848905563354492, -0.09680800884962082, 0.12754279375076294, -0.4877135753631592, 0.0168360043...
} //Some code } catch(...) { //Some exception handling } }//f ``` Yes perfectly legal. Though it would be best to move inner ones into another method so it looks cleaner and your method(s) are smaller
[ 0.3334149420261383, 0.02566804736852646, 0.24924178421497345, 0.05944538116455078, 0.24607577919960022, -0.31658560037612915, 0.21608737111091614, -0.38871487975120544, -0.23326927423477173, -0.4108138084411621, -0.1606179177761078, 0.3714568614959717, -0.3279578685760498, -0.0663784295320...
I would like to be able to get a list of all Spring application contexts from the web applications running in my servlet container. This so so that I can re-initialise the contexts without restarting or reloading my container or webapps. Is this possible? If so, how? Is there anyway to get a list of all the servlet co...
[ 0.2756730020046234, 0.24796421825885773, 0.4556643068790436, -0.09048967808485031, -0.15869097411632538, -0.042225610464811325, 0.18782898783683777, -0.5051126480102539, -0.26254281401634216, -0.43618836998939514, 0.04437289759516716, 0.45490050315856934, -0.1134217157959938, 0.11771547049...
centralised monitor? Not tested: ``` public class SpringWACListener implements ServletContextAttributeListener { public void attributeAdded(ServletContextAttributeEvent scab) { if (WebApplicationContext. ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE. equals(scab.getName()) { m...
[ -0.1647794097661972, -0.41417714953422546, 0.5666259527206421, 0.28669482469558716, 0.02268758974969387, -0.11615212261676788, 0.18977084755897522, 0.17329692840576172, -0.12030251324176788, -0.5610367059707642, -0.28572624921798706, 0.38451969623565674, -0.2943955659866333, 0.156739458441...
Visual Studio occasionally tells me: > The line endings in the following files are not consistent. Do you want to normalize the line endings? It then gives me a drop down with different standards or something, such as Windows, Mac, Unix, and a couple of Unicode ones. What does this mean and what is going to happen i...
[ 0.3627912104129791, -0.13599641621112823, 0.3301035165786743, 0.14162883162498474, -0.16915611922740936, -0.2167253941297531, 0.21123506128787994, 0.20773456990718842, -0.24245169758796692, -0.6757087707519531, -0.03682347387075424, 0.5425800681114197, -0.3677583634853363, 0.11518003791570...
all of the line ending characters are consistent. It prevents one line from ending in `\r\n` and another ending with `\r` or `\n`; the first is the Windows line end pair, while the others are typically used for Mac or Linux files. Since you're developing in Visual Studio, you'll obviously want to choose "Windows" from...
[ -0.20275819301605225, -0.04256518557667732, 0.44371527433395386, 0.015802918002009392, 0.14950264990329742, -0.014410877600312233, 0.36543038487434387, 0.214371457695961, 0.12731625139713287, -0.541739284992218, -0.6489277482032776, 0.3863466680049896, -0.19639571011066437, 0.2288877815008...
We have a stock control system which manages the flow of certain items in and out of the business or given location. We have records in the db representing the movement of stock and the inbound and outbound deliveries. If you were to add up all the inbound deliveries and then the outbound deliveries and subtract one f...
[ 0.38321027159690857, -0.06262513250112534, 0.24815848469734192, 0.13922284543514252, 0.33079493045806885, 0.42478522658348083, -0.20093083381652832, -0.014526130631566048, -0.09741166979074478, -0.3300372362136841, 0.2105049341917038, 0.301834374666214, -0.023767203092575073, 0.28794446587...
JPA which can't handle all this in QL so we end up having to use native queries or query large result sets and process the results in the application. Clearly, adding a quantity field would make life much easier, but is technically redundant, and would have to be updated for every stock movement. Which way would you ...
[ 0.4109172224998474, 0.03664411976933479, 0.031752537935972214, 0.17577789723873138, -0.29676002264022827, 0.016577713191509247, 0.011594082228839397, -0.1792784184217453, -0.1596164107322693, -0.3998034596443176, 0.2052057981491089, 0.5116320848464966, -0.25820979475975037, 0.2128044068813...
can ensure that the data in the column can be kept consistent whenever local stock levels change, be it by triggers in the database or additional code in your application that takes care of this. Spec out the work needed to ensure consistency and if it still looks like its impact is less than running the potentially la...
[ 0.6107404828071594, 0.21783578395843506, 0.23271924257278442, 0.35479897260665894, 0.24858644604682922, 0.06654495745897293, 0.050813332200050354, -0.057274527847766876, -0.21172672510147095, -0.5329903960227966, 0.34837806224823, 0.6956757307052612, -0.24011778831481934, -0.23208145797252...
I can see here (and that's why I said I'm leaning towards adding the column and didn't say "Nike") is that the effort required to ensure data consistency might be higher than people think it is and you end up with a half-baked implementation and data consistency issues three months down the line.
[ 0.4488120675086975, 0.1678989976644516, 0.08756830543279648, 0.29887762665748596, -0.08743532001972198, -0.07329395413398743, 0.3540904223918915, 0.4778689742088318, -0.21299491822719574, -0.3510899245738983, 0.5613800883293152, 0.05368686467409134, 0.17795884609222412, -0.0616767555475235...
I have a method that gets a nested array as parameter: ``` Number[][] data ``` where Number is my very simple class that inherits from INotifyPropertyChange. And then i have a statement like this: ``` double[] max = (double[])data.Select(crArray => crArray.Select( cr => cr.ValueNorm ).Max()); ``` When I'm tryin...
[ 0.4393245279788971, 0.09233878552913666, 0.3145408630371094, -0.03135190159082413, -0.002026387955993414, -0.14593157172203064, 0.12969689071178436, -0.3066648542881012, -0.4601747989654541, -0.3017708361148834, 0.2123861014842987, 0.45580145716667175, -0.3423786461353302, 0.22797025740146...
an array? Casting + generics = code smell Try this: ``` double[] max = data .Select(crArray => crArray.Select( cr => cr.ValueNorm ).Max()) .ToArray(); ``` --- Conversion Method - (ToArray) allocates a new array and populates it. Bound by the restrictions of methods. Down Casting - Allows you to change the typ...
[ 0.2737014591693878, -0.03658091276884079, 0.29300498962402344, -0.06233000010251999, -0.35657253861427307, 0.07230427861213684, 0.1498432457447052, -0.590128481388092, -0.12007147818803787, -0.47844091057777405, 0.0408342182636261, 0.4788046181201935, -0.6492457389831543, 0.178163155913352...
confusion for people trying to understand casting. Consider this code: ``` // reference type is IEnumerable<string>, instance type is string[] IEnumerable<string> myArray = new string[3] { "abc", "def", "ghi" }; // reference type is IEnumerable<string>, instance type is ??? IEnumerable<string> myQuery = myArray ....
[ 0.14487740397453308, 0.13320091366767883, 0.2880707085132599, -0.08828689157962799, -0.07644633948802948, 0.2260439395904541, 0.21086572110652924, -0.4806253910064697, 0.037474051117897034, -0.7233996987342834, 0.30475232005119324, 0.532751202583313, -0.3628464341163635, 0.3710964620113373...
I'm trying to convert from `System.Windows.Controls.Image` to `byte[]` and I didnt know which method from Image class could help in this scenary, by the way I really dont know what should I do, cause in my LINQ model the field appears as `Binary` type, I have to change this if I want to save it like a `byte[]` type? I...
[ 0.428280770778656, -0.115363709628582, 0.7677558660507202, 0.04657808691263199, -0.05985633656382561, -0.0025872907135635614, 0.08143146336078644, -0.37437671422958374, -0.3006334602832794, -0.6533030271530151, -0.022594314068555832, 0.47395268082618713, -0.44267791509628296, 0.00154228380...
OrderDate = DateTime.Now, ProjectPhotoCaption = ProjectPhotoCaptionTextBox.Text, ProjectId = selectedProjectId }; ``` Real Solution... if want to save jpg images from an System.Windows.Control.Image when your database mapped field on your ORM is Byte[] / byte[] / Bynary ``` public byte[] getJPGFromImageContr...
[ -0.09061089158058167, -0.43204933404922485, 0.8381279706954956, -0.10919661819934845, 0.07757976651191711, 0.18994095921516418, 0.2661069929599762, -0.5957631468772888, -0.23185086250305176, -0.734779953956604, -0.19493409991264343, 0.4573582112789154, -0.3557693660259247, 0.03978813812136...
return memStream.ToArray(); } ``` call as : ``` getJPGFromImageControl(firmaUno.Source as BitmapImage) ``` Hopes helps :)
[ -0.3940889537334442, -0.2105545699596405, 0.6093913316726685, -0.05554264038801193, 0.41512617468833923, -0.04793017357587814, 0.44005945324897766, -0.14621900022029877, 0.08604327589273453, -0.8334276080131531, -0.3850284218788147, 0.6039042472839355, -0.0015155182918533683, 0.01832873001...
I am a bit of a beginner with javascript and I can't think of a way around the folowing problem. I am using Mootools in this example, though this is not a Mootools question: ``` for (var i = 0; i < 5; i++) { myElement[i].addEvent('click', function () { otherFunction(i); }); } ``` Whenever someone clicks on myEle...
[ 0.22799479961395264, 0.16757972538471222, 0.3691750764846802, -0.3963486850261688, 0.29060471057891846, -0.19642899930477142, 0.39805328845977783, -0.1483282595872879, -0.06949687004089355, -0.6585744023323059, -0.2185332179069519, 0.5166707038879395, -0.28597956895828247, 0.09240259230136...
case 1: myElement[i].addEvent('click', function () { otherFunction(1); }); break; case 2: myElement[i].addEvent('click', function () { otherFunction(2); }); break; // ... } ``` There's got to be a better way... I feel I'm missing something obvious UPDATE: Added [i] index to myElement (oops) Thanks, Cameron ...
[ 0.2410716861486435, -0.04517368972301483, 0.4736553728580475, 0.05187647044658661, 0.29009345173835754, -0.07483292371034622, 0.23768597841262817, 0.106292225420475, -0.036123357713222504, -0.5779918432235718, -0.293084055185318, 0.546714723110199, -0.49731025099754333, 0.22954222559928894...
< 5; i++) { myElement.addEvent('click', getClickHandler(i)); } ``` This moves the creation of the closure to another scope which will "preserve" each value of *i* Another way would be to simply have a single click handler which can be assigned to each element and figures out which was clicked from the event obje...
[ 0.09705306589603424, -0.07874693721532822, 0.4788159728050232, -0.33275604248046875, 0.12114155292510986, -0.11012014746665955, 0.3634412884712219, -0.1674419641494751, -0.18990355730056763, -0.6548360586166382, -0.3060115873813629, 0.42787966132164, -0.48750653862953186, 0.274575144052505...
I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file: Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ? Put yourself in the compiler's position: when you forward declare a ...
[ 0.11880271136760712, 0.13924410939216614, -0.13401949405670166, -0.20030324161052704, -0.4851517677307129, -0.10148326307535172, 0.3869260847568512, -0.16634325683116913, -0.17357636988162994, -0.15802665054798126, -0.148015558719635, 0.1045510470867157, -0.21255874633789062, 0.33569765090...
class, since the compiler would need to know the layout of the type. Assuming the following forward declaration. ``` class X; ``` Here's what you can and cannot do. **What you can do with an incomplete type:** * Declare a member to be a pointer or a reference to the incomplete type: ``` class Foo { X *p; ...
[ -0.1437607705593109, 0.21400579810142517, -0.0402955561876297, 0.12888947129249573, -0.1423029899597168, 0.044933613389730453, 0.46729201078414917, -0.21326136589050293, -0.10026385635137558, -0.3424544632434845, -0.3621809184551239, 0.34717267751693726, -0.5308029651641846, 0.396598756313...
f5() {} ``` **What you cannot do with an incomplete type:** * Use it as a base class ``` class Foo : X {} // compiler error! ``` * Use it to declare a member: ``` class Foo { X m; // compiler error! }; ``` * *Define* functions or methods using this type ``` void f1(X x) {} // compiler error! X f2()...
[ -0.26362699270248413, 0.19098727405071259, -0.016378823667764664, -0.29127830266952515, -0.2500782608985901, -0.09636633843183517, 0.35114189982414246, -0.27583178877830505, -0.2045762538909912, -0.28039321303367615, -0.4283745288848877, 0.2867594361305237, -0.5045822262763977, 0.333313196...
void method() { m->someMethod(); // compiler error! int i = m->someField; // compiler error! } }; ``` --- When it comes to templates, there is no absolute rule: whether you can use an incomplete type as a template parameter is dependent on the way the type is used in the temp...
[ 0.25926998257637024, -0.09767680615186691, -0.11031223833560944, 0.042996473610401154, -0.13075730204582214, -0.19903965294361115, 0.292382150888443, -0.34223535656929016, -0.10889831930398941, -0.3570025861263275, -0.12729358673095703, 0.30766093730926514, -0.5285773277282715, 0.084149412...
while `boost::container::vector<T>` does not. Sometimes, a complete type is required only if you use certain member functions; [this is the case for `std::unique_ptr<T>`](https://stackoverflow.com/questions/6012157/is-stdunique-ptrt-required-to-know-the-full-definition-of-t), for example. A well-documented template sh...
[ 0.15389883518218994, -0.255761057138443, 0.0742095559835434, 0.09935151040554047, 0.0030809424351900816, -0.2672918438911438, 0.23314303159713745, -0.24274155497550964, -0.062090903520584106, -0.20386236906051636, -0.5401414632797241, 0.582683265209198, -0.14597712457180023, -0.28301328420...
TL;DR version: I have two threads. One of them might need to Interrupt() the other, but only if the other thread is in th middle of processing data that is related to the object that is affected by the first thread. How can I only Interrupt() the second thread based on certain conditions. I have been working on a prog...
[ 0.22751672565937042, -0.4191915690898895, 0.62610924243927, 0.00714494101703167, -0.12783683836460114, -0.12950466573238373, -0.12302248179912567, 0.15106360614299774, -0.25079742074012756, -0.8378433585166931, -0.1977100968360901, 0.7631131410598755, -0.37255507707595825, 0.26104798913002...
for receiving and processing data from the wireless sensor network. When data is coming into the dataThread, it's possible that the network member that the data packet represents has already been removed by the topologyThread and as such should not be processed. So, I was thinking that using the Thread.Interrupt() met...
[ 0.2553712725639343, -0.16484162211418152, 0.4134007692337036, 0.14317528903484344, 0.38806241750717163, -0.30278274416923523, 0.07558578997850418, -0.3300723731517792, -0.3388572931289673, -0.6799876689910889, 0.006965324282646179, 0.6744357347488403, -0.1613183319568634, 0.059385277330875...
needs to be interrupted? I don't want it to throw an exception while it's processing data for a network member that is still connected, but I want it to be interrupted if it's in the middle of processing data for a network member that is then disconnected. Scenario 1: * Data comes in on dataThread. * dataThread make...
[ 0.005183336324989796, -0.13015180826187134, 0.5567061305046082, 0.04847617447376251, 0.4313364624977112, -0.10130835324525833, 0.006040673702955246, 0.14048029482364655, -0.5045672655105591, -0.6064438819885254, -0.1550760716199875, 0.8236182928085327, -0.34582892060279846, -0.077515035867...
place. Scenario 3: * Data comes in on dataThread. * dataThread makes sure network member is still part of the network. * dataThread begins processing data * topologyThread receives notice that the network member is disconnected and removes it from topology. * dataThread tries to update GUI for a network member that i...
[ -0.07638180255889893, 0.19778089225292206, 0.2458779662847519, -0.0930953100323677, 0.3772422969341278, -0.041401106864213943, 0.4139591157436371, -0.27691033482551575, -0.2435123771429062, -0.7778636813163757, -0.12179144471883774, 0.08313664048910141, -0.4847676157951355, 0.3418676853179...
one that the dataThread is currently acting on. Thanks for reading. :) > dataThread tries to update GUI for a network member that is no longer connected. What if you have topologyThread set a flag when the network member is no longer connected, and have dataThread check that flag before attempting to update the GUI?
[ -0.036383915692567825, -0.2880377471446991, 0.4419391453266144, 0.2820574641227722, 0.06337528675794601, -0.3949213922023773, 0.4051315486431122, 0.26034197211265564, -0.2115958034992218, -0.7952301502227783, -0.03609563782811165, 0.5940436720848083, -0.5513008236885071, 0.1745213121175766...
I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously I stored the paths to common images in class Common: ``` public final static String IMG_BREADCRUMBS_NEXT = "/shared/images/famfam/bullet_arrow_right.png"; ``` Then I would use this class in jsp to get the image src like ```...
[ 0.26335710287094116, -0.01932748407125473, 0.6466704607009888, -0.012683896347880363, -0.2736344039440155, 0.10760725289583206, -0.07313011586666107, -0.30938923358917236, -0.41345617175102234, -0.6121929883956909, 0.08002743870019913, 0.32035258412361145, -0.17258155345916748, 0.193879604...
`<spring:theme code=""/>` tag to get the path to image file: ``` <img src="<spring:theme code="theme.images.actions.edit.link"/>" /> ``` This tag behaves like any `<fmt:message>` or `<spring:message>` tag, but it has its own "message bundles". The necessary configurations in my applicationContext are: ``` <!-- ...
[ -0.3251841068267822, 0.06918834149837494, 1.046614170074463, -0.20939716696739197, 0.06892992556095123, 0.1617916375398636, -0.07157459110021591, -0.3768366277217865, -0.6671382188796997, -0.677127480506897, -0.24788126349449158, 0.5985098481178284, -0.31394344568252563, 0.1330711543560028...
a ThemeChangeInterceptor (in applicationContext) ``` <!-- ========================================================= Theme resolving ========================================================= --> <bean id="themeChangeInterceptor" class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"> <property name=...
[ -0.19799946248531342, 0.015390370041131973, 0.9635158777236938, 0.09945902973413467, -0.04174640029668808, -0.15291020274162292, -0.1262996792793274, -0.198103666305542, -0.3590034544467926, -0.852493405342102, -0.32739782333374023, 0.48990127444267273, -0.025382790714502335, 0.40347400307...
<filterchain> <replacetokens> <token key="contextPath" value="${setup.contextPath}"/> </replacetokens> </filterchain> </copy> ``` I hope this gives you a "running start" on Spring web app themes. In my opinion this setup makes it quite easy to alter the look and feel...
[ 0.14876164495944977, -0.2109353244304657, 0.48641237616539, -0.11957187205553055, -0.3900407552719116, -0.08394055813550949, 0.09900523722171783, -0.4125424027442932, -0.40908074378967285, -0.5019899010658264, 0.028345519676804543, 0.13394102454185486, -0.3708803653717041, -0.3393220305442...
I've created a (System.Windows.Controls.Primitives.)Popup that contains a Treeview that I'm populating with data read in from a file. The Popup is created in code rather than in xaml. I want to add checkboxes to the treeview in a similar way to the CheckedTreeViewItemSample.xaml that comes in the Silverlight Toolkit. ...
[ 0.3282460570335388, 0.05625871196389198, 0.5439589023590088, 0.01833023875951767, -0.06976589560508728, -0.1246258094906807, 0.04639805480837822, -0.057858411222696304, -0.1658821552991867, -0.7900629043579102, 0.021034419536590576, 0.21673165261745453, -0.3927825689315796, 0.0855142995715...
need to define the xaml and use the XamlReader? Thanks in advance... You need to put the controls into the header property of the treeviewitems you're adding: ``` var myTreeViewItem = new TreeViewItem(); var myContentHolder = new StackPanel(); var myCheckBox = new CheckBox(); TextBloc...
[ 0.13310453295707703, 0.04560836777091026, 0.8352559804916382, 0.029338615015149117, 0.2414156049489975, -0.26590996980667114, 0.3738012909889221, -0.4013853371143341, -0.42780905961990356, -0.6333150863647461, -0.2766469419002533, 0.7459080219268799, -0.4713614881038666, -0.138301253318786...
myContentHolder.Children.Add(myCheckBox); myContentHolder.Children.Add(myTextBlock); myTreeViewItem.Header = myContentHolder; ``` Voila. To be honest, you do this the first time you use Silverlight, then try doing it with xaml and never go back to doing it in code. Also it's much easier if you wrap th...
[ 0.08239907026290894, 0.1724618375301361, 0.4760231077671051, 0.19338566064834595, 0.21359513700008392, -0.0858931839466095, 0.3660859763622284, 0.09877870976924896, -0.19732002913951874, -0.8627228736877441, -0.24938327074050903, 0.14968200027942657, -0.3119826912879944, 0.2304275780916214...
The first normal form says that row ordering should not matter. Does this mean that a table with date as part of the key is not 1NF? e.g. Consider a table of ticker prices where date/time is part of the PK. In this case, you get the last price by ordering the data by date and selecting the top 1 row. Does this mean tha...
[ 0.07530246675014496, -0.3293718993663788, 0.6808030605316162, 0.24088215827941895, -0.020851952955126762, 0.060133203864097595, -0.3761287033557892, -0.28290489315986633, -0.10355910658836365, -0.6252648830413818, -0.1433141529560089, 0.45122402906417847, -0.12793363630771637, 0.3298171460...
a `1NF` violation, as you cannot determine if a `ticket` `HAS` or `HAS NOT` the `price` by looking on a single record. You'll need to fetch all prices on this ticket and select last of them, which violates the `non-ordering rule` of the `1NF`. If your relation says `ticket HAD BEGUN TO COST price ON date`, then it's i...
[ 0.04398978874087334, -0.3703080415725708, 0.4512786269187927, 0.1517450362443924, 0.05051818862557411, -0.14054319262504578, -0.2921842634677887, -0.24745900928974152, -0.39371946454048157, -0.6176427006721497, -0.2111043483018875, 0.44039100408554077, -0.31420451402664185, 0.6667265295982...
one. The table itself remains the same, of course. It doesn't necessary mean though that you need to split your tables. The whole point of `relational databases` is that you can use `relational operators` to convert one relation to another. What is a `relation` in terms of the `RDBMS`? It's a table showing **all** ...
[ -0.007730043493211269, 0.2847701907157898, -0.08843401819467545, 0.20378172397613525, -0.0011046212166547775, -0.05877986550331116, -0.42363741993904114, -0.22938817739486694, -0.30973759293556213, -0.5708081722259521, -0.052857305854558945, 0.3971111476421356, -0.33538585901260376, 0.2395...
appear, are not. We don't see `(2, 3)` here, or `(4, 5)`, as they are not equal. But you don't need to keep the whole pair in the database. You keep single values instead and write a query: ``` SELECT n1.number, n2.number FROM number n1, number n2 WHERE n1.number = n2.number ``` , which gives you the same result. ...
[ -0.06733731925487518, -0.27197983860969543, 0.43257027864456177, 0.24257105588912964, -0.11556977033615112, 0.244317889213562, -0.06728485971689224, -0.1705150604248047, -0.1836146116256714, -1.102363109588623, -0.05762128904461861, 0.3719640374183655, -0.5649451613426208, 0.35272243618965...
FROM mytable GROUP BY ticket ) ``` , you get relation (`ticket HAS price`) from (`ticket HAD BEGUN TO COST price ON date`) exactly as if you were keeping the whole table in the database.
[ 0.14504395425319672, -0.3012145459651947, 0.5417577624320984, 0.3411981165409088, -0.1767108291387558, 0.1077815368771553, -0.5134215354919434, -0.052786972373723984, -0.19546112418174744, -0.7772413492202759, -0.0005608703941106796, 0.3447582721710205, 0.1372414082288742, 0.72661948204040...
I'm trying to generate the [morris sequence](http://www.ocf.berkeley.edu/~stoll/answer.html) in python. My current solution is below, but I feel like I just wrote c in python. Can anyone provide a more pythonic solution? ``` def morris(x): a = ['1', '11'] yield a[0] yield a[1] while len(a) <= x: ...
[ 0.5032340884208679, 0.07266736775636673, 0.27987533807754517, -0.39837390184402466, -0.13187426328659058, 0.08852805942296982, 0.2926855683326721, -0.6772777438163757, -0.11410808563232422, -0.33262237906455994, -0.20726999640464783, 0.4874431788921356, -0.13239340484142303, 0.153870552778...
if i+1 < len(al) and al[i] == al[i+1]: count += 1 else: s += '%s%s' % (count, al[i]) count = 1 a.append(s)
[ -0.08803626894950867, -0.15618398785591125, 0.47168058156967163, -0.5784692168235779, -0.4029979109764099, 0.47944188117980957, 0.43168944120407104, -0.6827300786972046, 0.07449501752853394, -0.22493107616901398, -0.25833114981651306, 0.3776223659515381, -0.5580180287361145, -0.00361414393...
yield s a = [i for i in morris(30)] ``` [`itertools.groupby`](http://docs.python.org/library/itertools.html#itertools.groupby) seems to fit perfectly! Just define a `next_morris` function as follows: ``` def next_morris(number): return ''.join('%s%s' % (len(list(group)), digit) for digit, group...
[ -0.27492424845695496, -0.3559764325618744, 0.6737673282623291, -0.33815282583236694, 0.18439173698425293, 0.19730216264724731, 0.06446125358343124, -0.5746182203292847, -0.21719157695770264, -0.5601618885993958, -0.3842213451862335, 0.3130474388599396, -0.016351914033293724, 0.012509047053...
print n ``` results: ``` 1 11 21 1211 111221 312211 13112221 ```
[ -0.21696744859218597, 0.4045603275299072, 0.46356913447380066, -0.2580171823501587, 0.15303005278110504, 0.29470741748809814, 0.36023446917533875, -0.4731426239013672, -0.33855462074279785, -0.47426363825798035, -0.27752983570098877, 0.6820011138916016, -0.4314453601837158, 0.0860796272754...
How does one open a semicolon delimited CSV file with VBA in Excel 2000? **Sample data** ``` An ID;TEST20090222 A Name;Firstname Surname A Date;11.05.2000 Country:;SomeCountryName Currency;EUR CostA; CostB; CostC; Part1;10;20;30 Part2;;;; Part3;34;56;87 ``` **Code** In Excel **2003** 11.8231.8221 SP3 with VBA 6.5...
[ -0.41692599654197693, 0.1960562765598297, 0.5619686245918274, -0.18038572371006012, -0.2609499394893646, -0.14194248616695404, 0.4668852388858795, -0.07279025763273239, -0.29739120602607727, -0.5326405763626099, -0.4221046268939972, 0.302432119846344, -0.21400706470012665, 0.23311638832092...
file is written into one cell instead of being split up into the separate semicolon delimited parts. I have searched the Internet for a solution, but did not find anything useful and concise. Any ideas? **[Update 17.02.2009]** I tried the suggestion from *[user lc](https://stackoverflow.com/users/44853/lc)* with th...
[ 0.10412520170211792, 0.22924646735191345, 0.3276471197605133, -0.01303842756897211, 0.2663455605506897, 0.063520647585392, -0.1571367084980011, -0.13455593585968018, -0.4159074127674103, -0.7561198472976685, -0.24198594689369202, 0.08124816417694092, -0.36947008967399597, 0.051521435379981...
that VBA code in my macro, each line ends up in one cell again. According to the suggestion from *[user barrowc](https://stackoverflow.com/users/53614/barrowc)*, I also changed the The Windows "Regional and Language Options" settings from "German (Switzerland)" to "English (United States)". Even after restarting Excel...
[ 0.09712421149015427, 0.17213410139083862, 0.43682560324668884, -0.3256493806838989, -0.39577993750572205, 0.21002207696437836, 0.6786946654319763, 0.18617790937423706, -0.4770970642566681, -0.4402051270008087, -0.18464955687522888, 0.1512564718723297, -0.39882227778434753, 0.09653218835592...
elements and write each element into a cell. ``` Sub ImportCSVFile(filepath As String) Dim line As String Dim arrayOfElements Dim linenumber As Integer Dim elementnumber As Integer Dim element As Variant linenumber = 0 elementnumber = 0 Open filepath For Input As #1 ' Open file for in...
[ 0.009448904544115067, -0.21320706605911255, 0.7615786790847778, -0.47887998819351196, -0.03715066984295845, 0.22910234332084656, 0.17523141205310822, -0.9160512685775757, -0.10692773759365082, -0.33288201689720154, -0.28541380167007446, 0.10776780545711517, -0.49752986431121826, -0.0288688...
linenumber + 1 Line Input #1, line arrayOfElements = Split(line, ";") elementnumber = 0 For Each element In arrayOfElements elementnumber = elementnumber + 1 Cells(linenumber, elementnumber).Value
[ 0.14545035362243652, -0.5566678047180176, 0.5526199340820312, -0.4719221293926239, -0.12358387559652328, 0.48493528366088867, -0.07326547801494598, -1.0238323211669922, -0.1136903315782547, -0.2287106066942215, -0.22867140173912048, -0.006898758467286825, -0.36085161566734314, -0.116486430...
= element Next Loop Close #1 ' Close file. End Sub ``` Got the inspiration from Shasur: <http://vbadud.blogspot.com/2007/06/vba-read-text-files-with-leading.html> I still do not know why `Workbooks.OpenText` does not work on my system even though it seems to work on *[user Remou](https://stac...
[ 0.1984294354915619, -0.04452937841415405, 0.41882142424583435, -0.2844690978527069, -0.49378517270088196, -0.32556095719337463, 0.7862513661384583, -0.37562334537506104, -0.06391577422618866, -0.3622383773326874, -0.2647281587123871, 0.10208018869161606, -0.32378044724464417, 0.09611210227...
I'm trying EF out and I do a lot of filtering based on many to many relationships. For instance I have persons, locations and a personlocation table to link the two. I also have a role and personrole table. ``` EDIT: Tables: Person (personid, name) Personlocation (personid, locationid) Location (locationid, descri...
[ -0.30848658084869385, 0.04934985190629959, 0.4582464396953583, 0.20521345734596252, -0.08029056340456009, 0.20037536323070526, -0.20965491235256195, -0.14205466210842133, -0.02366744913160801, -0.9299168586730957, -0.04791920259594917, 0.48359763622283936, -0.32997584342956543, 0.033075105...
would be ``` select p.* from persons as p join personlocations as pl on p.personid=pl.personid join locations as l on pl.locationid=l.locationid join personroles as pr on p.personid=pr.personid join roles as r on pr.roleid=r.roleid where r.description='Student' and l.description='Amsterdam' ``` ...
[ -0.6580765843391418, -0.22262439131736755, 0.3681207597255707, -0.0008799427887424827, 0.18343783915042877, 0.6218210458755493, -0.20262910425662994, -0.5717718601226807, -0.06150249391794205, -0.6608169078826904, -0.47565263509750366, 0.32161587476730347, -0.04173741862177849, -0.18366096...
SELECT COUNT(*) FROM [personlocations] AS [t1] INNER JOIN [Locations] AS [t2] ON [t2].[locationid] = [t1].[locationid] WHERE ([t2].[description] = @p0) AND ([t1].[personid] = [t0].[personId]) )) > @p1) AND ((( SELECT COUNT(*) FROM [PersonRoles] AS [t3] INNER JOIN [Roles] AS [t4] ON [t4].[rol...
[ -0.7148907780647278, -0.39733627438545227, 0.47892147302627563, -0.011427418328821659, 0.1522088199853897, 0.5298091173171997, 0.17446182668209076, -0.6755507588386536, -0.09255421161651611, -0.58063805103302, -0.5028223991394043, 0.491167813539505, -0.17265388369560242, -0.377535074949264...
.Select(l=>l.Description).Contains("Amsterdam")) && (p.PersonRoles.Select(pr=>pr.Role) .Select(r=>r.Description).Contains("Student"))); ``` **query result:** ``` SELECT [t0].[personId] AS [PersonId], [t0].[description] AS [Description] FROM [Persons] AS [t0] WHERE (EXISTS( SELECT NULL AS...
[ -0.5917233228683472, -0.20563234388828278, 0.5385998487472534, 0.09157998859882355, 0.5108205080032349, 0.4286637604236603, 0.052381277084350586, -0.6038490533828735, 0.0133461719378829, -0.7107384204864502, -0.5950137972831726, 0.37119320034980774, 0.05882871150970459, -0.0967555120587349...
FROM [PersonRoles] AS [t3] INNER JOIN [Roles] AS [t4] ON [t4].[roleid] = [t3].[roleid] WHERE ([t4].[description] = @p1) AND ([t3].[personid] = [t0].[personId]) )) ``` **using join():** ``` var persons = Persons .Join(Personlocations, p=>p.PersonId, ps=>ps.Personid, (p,ps) => new {p,ps}) .Where(a ...
[ -0.7303582429885864, -0.22456130385398865, 0.4563312828540802, -0.005782598629593849, 0.042035430669784546, 0.7137588858604431, 0.0820830911397934, -0.5187253952026367, -0.23041202127933502, -0.749356746673584, -0.6341521739959717, 0.45020759105682373, 0.05077223852276802, -0.1164282187819...
= [t1].[locationid] INNER JOIN [PersonRoles] AS [t3] ON [t0].[personId] = [t3].[personid] INNER JOIN [Roles] AS [t4] ON [t4].[roleid] = [t3].[roleid] WHERE ([t4].[description] = @p0) AND ([t2].[description] = @p1) ``` You may want test wich one is faster with large data. Good luck. Giuliano Lemes
[ -0.11700699478387833, -0.399641215801239, 0.318490207195282, 0.1657567024230957, 0.21417321264743805, 0.03423250839114189, 0.28056684136390686, -0.272861510515213, -0.06336670368909836, -0.5754380226135254, -0.065985307097435, 0.4407176375389099, 0.06345414370298386, -0.30677470564842224, ...
i have a datagrid and for one of the columns im using an item renderer to display content. Im wondering is it possible to access the dataprovider content of the datagrid inside a script block in the itemRenderer. Currently I can access the dataprovider in a component in the item renderer using data.variableName. I wa...
[ 0.11370404809713364, 0.07721646875143051, 0.4597141444683075, 0.22426818311214447, -0.12192470580339432, 0.24749375879764557, 0.047837357968091965, -0.11925434321165085, -0.15924598276615143, -0.7496463656425476, 0.20462985336780548, 0.6114431023597717, -0.25478395819664, 0.346462726593017...