text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
cache[n] = mult(cache[n_2], cache[n_2]); if(n & 1) cache[n] = mult(cache[1], cache[n]); } } fib.matrix_cached = function(n) { if(n == 0) return 0; compute(--n); return
[ -0.12138573080301285, -0.32809650897979736, 0.5392091870307922, -0.4171797037124634, 0.31211650371551514, 0.2500034272670746, 0.24047544598579407, -0.4878632426261902, 0.08852608501911163, -0.5099851489067078, -0.3652855455875397, 0.6452864408493042, -0.4036313593387604, 0.0553035885095596...
cache[n][0][0]; }; })(); function test(name, func, n, count) { var value; var start = Number(new Date); while(count--) value = func(n); var end = Number(new Date); return 'fib.' + name + '(' + n + ') = ' + value + ' [' + (end - start) + 'ms]'; } for(var func in fib) docum...
[ -0.07808828353881836, -0.07509838044643402, 0.5705807209014893, -0.3255237340927124, 0.17445917427539825, 0.48275676369667053, 0.3743591010570526, -0.7851828932762146, -0.34505942463874817, -0.3470081090927124, -0.1673852652311325, 0.4191535711288452, -0.26211684942245483, 0.13947369158267...
= 4.814967502500113e+302 [585ms] fib.matrix_cached(1450) = 4.814967502500113e+302 [12ms] ``` Your algorithm is nearly as bad as uncached looping. Caching is your best bet, closely followed by the rounding algorithm - which yields incorrect results for big `n` (as does your matrix algorithm). For smaller `n`, your al...
[ -0.3842160701751709, 0.23182141780853271, -0.10600144416093826, -0.2354094386100769, -0.18655619025230408, 0.510485053062439, 0.3467932343482971, -0.6202310919761658, -0.4961550533771515, -0.22878225147724152, 0.014761442318558693, 0.4839978516101837, -0.39813748002052307, 0.09517116099596...
I have a huge tab separated file which I want to sort on its 2nd column. I need to use the tab character as the field delimiter in cygwin sort. So I need something like this: ``` sort -t \t -k 2,2 in.txt > out.txt ``` But the command prompt evaluates '\t' literally and not as the tab character. Note that I need to d...
[ -0.1759977787733078, 0.06795111298561096, 0.25068601965904236, -0.29608631134033203, -0.09370246529579163, 0.06733177602291107, 0.16858461499214172, -0.017658036202192307, -0.06362072378396988, -0.8649128079414368, -0.24938805401325226, 0.5442128777503967, -0.458368718624115, 0.05959567427...
DOS shell or the Cygwin bash shell is fine. On my machine (Mac bash prompt, GNU sort ...) this works: ``` sort -t ' ' -k 2,2 in.txt > out.txt ``` (A "real" tab between the quotes.) To get the tab there I type `CTRL`-`V`, `TAB` (`CTRL`-`V` followed by `TAB`). EDIT: I've now tested it on a Windows machine from the...
[ 0.08165092021226883, -0.004532748367637396, 0.42570269107818604, -0.26184383034706116, -0.013038198463618755, -0.25028616189956665, 0.2353084534406662, -0.2381466180086136, 0.06376167386770248, -0.805686354637146, 0.09979183971881866, 1.3268132209777832, -0.1701582372188568, 0.036369219422...
I am constantly forgetting what the special little codes are for formatting .NET strings. Either through ToString() or using String.Format(). Alignment, padding, month vs. minute (month is uppercase M?), abbreviation vs. full word, etc. I can never remember. I have the same problem with regexes, but luckily there's [E...
[ 0.32369470596313477, -0.4843063950538635, 0.43511804938316345, 0.43481919169425964, -0.2806823253631592, -0.30808839201927185, -0.010929116047918797, 0.25478288531303406, -0.3115468919277191, -0.6468299627304077, 0.2186441272497177, 0.38306814432144165, -0.06864701956510544, -0.00746961263...
also just create a string on the command line and test out different formatting options. You can use the static method from the string class: ``` $teststring = 'Currency - {0:c}. And a date - {1:ddd d MMM}. And a plain string - {2}' [string]::Format($teststring, 160.45, Get-Date, 'Test String') ``` Or PowerShell ...
[ 0.2102544754743576, 0.1281280517578125, 0.12709474563598633, 0.06608074903488159, 0.24796190857887268, -0.2316463142633438, 0.02131626568734646, -0.054136741906404495, 0.006413846276700497, -0.5597444176673889, -0.18647019565105438, 0.5662025213241577, -0.17130491137504578, 0.0261628627777...
When I create a constructor with parameters using Resharper's 'Generate code' feature, I get something like this: ``` public class Example{ private int _x; private int _y; public Example(int _x, int _y){ this._x = _x; this._y = _y; } } ``` I would like to use this naming conven...
[ 0.5707083940505981, 0.032617464661598206, -0.08023713529109955, 0.034632448107004166, -0.03056243062019348, -0.007448793854564428, 0.21496707201004028, -0.2589923143386841, 0.011534103192389011, -0.4680512845516205, -0.08616402000188828, 0.641281008720398, -0.31437620520591736, 0.529195070...
int y){ _x = x; _y = y; } } ``` but I don't know if it's possible to edit this constructor template and where. Options / Languages / Common / Naming Style You should set your field prefix to underscore.
[ 0.2771746814250946, 0.3230997323989868, 0.22098830342292786, -0.2610398530960083, -0.03972669318318367, -0.18014314770698547, 0.21049095690250397, -0.14112989604473114, 0.06768959015607834, -0.557442307472229, -0.18888460099697113, 0.4549036920070648, -0.39785027503967285, 0.19570966064929...
I am currently putting together a rails-based web application which will only serve and receive data via json and xml. However, some requirements contain the ability to upload binary data (images). Now to my understanding JSON is not entirely meant for that... but how do you in general tackle the problem of receiving ...
[ 0.49817442893981934, 0.07244675606489182, -0.26731786131858826, 0.09091344475746155, -0.18956004083156586, -0.00359625113196671, -0.01954076625406742, 0.05100107565522194, -0.08642734587192535, -0.667498767375946, -0.004771179519593716, 0.37373703718185425, -0.26539522409439087, 0.01873644...
Is there an easy way to compile c code in visual studio 2005? Its been a while(2-3 years) since I've done any coding in either c or c++, but I remember that you used to be able ti, in vs 2003, compile c code in visual studio. I thought it was just a matter of using an empty project(rather than, say a c++ project or a C...
[ 0.15350116789340973, 0.20378679037094116, -0.14668992161750793, 0.11367826908826828, -0.30366262793540955, -0.20579104125499725, 0.06828875839710236, 0.23452912271022797, -0.27559298276901245, -0.4555915296077728, 0.32545003294944763, 0.6131343841552734, -0.1494084596633911, -0.20722600817...
really makes me appreciate eclipse's auto compile that much more, which is my normal IDE since I use java for work on the day to day basis. You can start with a C++ project, and just delete the default .cpp files and make your own .c files. The project defaults to compiling according to the file's extension.
[ 0.6452992558479309, 0.024386681616306305, -0.23759549856185913, 0.0004556563508231193, -0.4470688998699188, -0.03824874386191368, 0.04804183542728424, 0.24629119038581848, -0.09967036545276642, -0.6828807592391968, 0.011995135806500912, 0.6766871213912964, -0.08483568578958511, -0.00455243...
I've run across an interesting PHP/SOAP error that has me stymied. After searching I have not found a plausible explanation, and I'd appreciate your help. Here's the background: I have a site built in PHP/[CodeIgniter](http://codeigniter.com/) which uses SOAP to communicate over SSL with a back-end system provided by ...
[ 0.4204080402851105, 0.39715877175331116, 0.07706349343061447, -0.14876095950603485, -0.06296885758638382, 0.03600384667515755, 0.4282437562942505, 0.28755781054496765, -0.08159100264310837, -0.676945149898529, 0.17259067296981812, 0.2930781841278076, -0.1566144824028015, 0.1099821180105209...
relatively smooth through testing and development; including calling Company X's web service over SSL. I should probably mention that their web service had strange WSDL that PHP 5's SOAP didn't like. Things like required parameters that were not there. It's been a little odd to call SOAP methods very explicitly, but I ...
[ 0.19629280269145966, 0.016567358747124672, 0.14040915668010712, 0.006916581653058529, -0.05587344989180565, -0.3189469873905182, 0.28978681564331055, 0.18535125255584717, -0.051894526928663254, -0.5119011998176575, 0.4160767197608948, 0.29682058095932007, 0.07882089912891388, -0.1591552942...
A PHP Error was encountered Severity: Warning Message: SoapClient::__doRequest() [soapclient.--dorequest]: WARNING: URL fopen access Filename: models/company_x.php Line Number: 86 ``` The error logs didn't give any more information other than the full path to the model file on the server. It work...
[ -0.07060538977384567, 0.27228063344955444, 0.43399983644485474, -0.11386707425117493, -0.16679048538208008, -0.002094420837238431, 0.9297791719436646, 0.17346349358558655, -0.285788357257843, -0.4778881072998047, 0.1613682061433792, 0.5367220044136047, -0.2852993905544281, 0.08837802708148...
certificate. After all, it's a GoDaddy \*.domain.com cert, maybe `fopen` is having trouble getting through. I whipped up a test file to connect over SSL, and put it on Mosso and it worked. I'm wondering why is `fopen` access suddenly a problem for SOAP? What is it about Mosso that is making this difficult suddenly? Do...
[ -0.1972556710243225, 0.26633426547050476, 0.4326167106628418, 0.15113353729248047, -0.32764732837677, -0.33386754989624023, 0.49389705061912537, -0.20084688067436218, -0.13517209887504578, -0.6613394021987915, -0.10200640559196472, 0.4545777142047882, -0.26868459582328796, 0.34905889630317...
'--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr...
[ -0.24546171724796295, 0.16363516449928284, 0.679313600063324, 0.039214931428432465, 0.06400515139102936, -0.0021973871625959873, 0.09793323278427124, -0.45112624764442444, -0.12130652368068695, -0.8052990436553955, -0.5977155566215515, 0.5978229641914368, -0.46101924777030945, -0.265486925...
error on Mosso that was silently fixed. It is also remotely possible that there was a problem with Company X's setup. That is the worst kind of fix IMO! Thanks anyway to everyone who looked in on this.
[ 0.17337460815906525, 0.16707588732242584, 0.30595317482948303, 0.26116812229156494, -0.14797770977020264, -0.07341858744621277, 0.21295300126075745, 0.5933048129081726, -0.16688166558742523, -0.4469348192214966, -0.027991775423288345, 0.467324435710907, -0.25085917115211487, -0.00703862542...
I have a thread that needs to be executed every 10 seconds. This thread contains several calls (12 - 15) to a database on another server. Additionally, it also accesses around 3 files. Consequently, there will be quite a lot of IO and network overhead. What is the best strategy to perform the above? One way would b...
[ 0.7714173793792725, 0.0358213447034359, 0.27660229802131653, 0.07490251958370209, 0.14363878965377808, -0.06941383332014084, 0.24956370890140533, -0.23244507610797882, -0.2290785163640976, -0.7464757561683655, 0.34177228808403015, 0.3745947778224945, -0.05241304263472557, 0.255177468061447...
IO and one for JDBC), instead of having them run in one thread? I find that a [ScheduledExecutorService](http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html) is an excellent way to do this. It is arguably slightly more complex than a `Timer`, but gives more flexibility in exchange (...
[ 0.4280657172203064, -0.40888434648513794, 0.4343966841697693, -0.017983809113502502, 0.03138208016753197, -0.13753056526184082, -0.09809889644384384, -0.2514340281486511, -0.31635433435440063, -0.579002320766449, 0.05043294280767441, 0.5613700151443481, -0.3837133049964905, -0.004190578591...
} }; executor.scheduleAtFixedRate(periodicTask, 0, 10, TimeUnit.SECONDS); ```
[ 0.183650404214859, -0.37780240178108215, 0.2474309802055359, -0.06939731538295746, 0.8858121037483215, -0.07060632109642029, -0.05400094389915466, 0.07052221149206161, -0.2154284119606018, -0.3310062885284424, -0.19310379028320312, 0.6108161807060242, -0.4271852970123291, 0.212465628981590...
How can I retrieve the information shown in the Mac's System Profiler app programatically? I'm actually interested in the USB section if that matters. Take a look at the [system\_profiler(8)](http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/system_profiler.8.html) command.
[ 0.14904803037643433, 0.08539506047964096, 0.09945090115070343, 0.2074974775314331, 0.26248928904533386, -0.05827631428837776, 0.23059652745723724, 0.26191407442092896, -0.27272000908851624, -0.6448798775672913, 0.03092181123793125, 0.6541815400123596, -0.08264760673046112, -0.0251748617738...
I wonder if it is possible to use KVC to generate SQL. I'm doing a light ORM; I wanna do something like this (pseudocode): ``` for key in object.getKeys sql = sql + formatField(key,objet.value[key]); ``` and get: ``` INSERT INTO Table (Field1) VALUES (1); ``` Is this possible in Objective-C? * [GNU make](http...
[ 0.2548440992832184, 0.062389060854911804, 0.24665459990501404, -0.11281311511993408, -0.09039381891489029, -0.19996283948421478, 0.26893070340156555, -0.27543869614601135, -0.04692012816667557, -0.42243313789367676, 0.09230693429708481, 0.7664119005203247, -0.07275426387786865, 0.070142008...
projects (thousands of files and upwards), but that was a couple of years ago. * [CMake](http://cmake.org) is an excellent tool if you want to work in Visual Studio but still stay crossplatform and allow other development tools on other platform. Can also generate makefiles for windows, so you're not bound to Visual St...
[ 0.8593684434890747, -0.1193682923913002, -0.14363788068294525, 0.3293454051017761, -0.12155710905790329, 0.1509254276752472, -0.16928575932979584, 0.15513670444488525, -0.43002986907958984, -0.5253394842147827, 0.33916667103767395, 0.1500609666109085, 0.11175785213708878, 0.146787151694297...
called [premake](http://premake.sourceforge.net/) which you may want to investigate. It looked promisiing when I looked, but I haven't checked it out in any detail.
[ 0.6276122331619263, -0.005623562727123499, -0.1878572255373001, 0.19120018184185028, -0.2775965631008148, -0.240789532661438, 0.1522088348865509, 0.5980512499809265, -0.43371105194091797, -0.23194220662117004, -0.07961483299732208, -0.18791796267032623, 0.13323219120502472, 0.1827132254838...
I am using VIM in Windows. The problem is that I want to use `Ctrl``V` as a visual mode. However, this key has conflict with Windows paste. How can I reset this key back to VIM visual mode instead of pasting. I prefer to set this in my \_vimrc configuration file. From [the VIM documentation](http://vimdoc.sourceforge.n...
[ 0.44461509585380554, 0.048215001821517944, 0.6996472477912903, -0.2236260324716568, -0.15260563790798187, 0.11979544162750244, 0.5065556764602661, -0.1222500130534172, -0.10594993084669113, -0.9947111010551453, 0.0196321252733469, 0.907054603099823, -0.3580187261104584, 0.3904842734336853,...
for terminals when it's used for control flow.
[ -0.15222859382629395, -0.22553282976150513, 0.44710230827331543, 0.20541663467884064, 0.25953689217567444, -0.03697848692536354, -0.5133163332939148, 0.3907708525657654, -0.49413466453552246, -0.43356049060821533, -0.41038668155670166, 0.3528130054473877, -0.19587576389312744, -0.076332040...
I would like to convert tab to spaces in gVim. I added the following line to my `_vimrc`: ``` set tabstop=2 ``` It works to stop at two spaces but it still looks like one tab key is inserted (I tried to use the h key to count spaces afterwards). I'm not sure what should I do to make gVim convert tabs to spaces? IIR...
[ -0.011254385113716125, -0.040521040558815, 0.5879216194152832, -0.19681832194328308, -0.047903165221214294, 0.11154558509588242, 0.09981577098369598, -0.1847081035375595, -0.4840521812438965, -0.7221468687057495, -0.2650139331817627, 0.5955002903938293, -0.4402073621749878, 0.0344704315066...
I am presently studying the topic of encrypting and signing SOAP messages via WSE 3.0 or WCF. Since I have not participated in distributed application development involving the public Internet, I find my knowledge on X.509 ceritificates lacking and how it works in the Windows certificate store mechanism. It is not abou...
[ 0.6271077394485474, 0.3876729905605316, 0.0036318888887763023, 0.05130529776215553, -0.13263578712940216, -0.3189387321472168, 0.2840421795845032, -0.03174318000674248, 0.05684996768832207, -0.5357171893119812, -0.04723920673131943, 0.4846607446670532, -0.09687063843011856, 0.0392352603375...
and make use of certificates. Recommendations? I think the base starting point to understanding the Windows implementation of PKI has to come from TechNet PKI segment <http://technet.microsoft.com/en-us/library/cc757327(WS.10).aspx> Certificates overview <http://technet.microsoft.com/en-us/library/cc784662(WS.10).asp...
[ 0.36231112480163574, 0.11760088801383972, 0.13154999911785126, 0.24323837459087372, -0.06233375892043114, -0.18627023696899414, -0.10340962558984756, 0.023166585713624954, -0.1527058333158493, -0.6827670931816101, -0.5043320059776306, 0.21981500089168549, 0.09893155097961426, -0.0372582748...
Recently I [asked](https://stackoverflow.com/questions/267628/scripting-fruityloops-or-propellerheads-reason-from-vb-or-python) about scripting FruityLoops or Reason from Python, which didn't turn up much. Today I found [LMMS](http://lmms.sourceforge.net/), a free-software FruityLoops clone. So, similarly. Has anyone ...
[ 0.25880739092826843, 0.039495497941970825, 0.028459293767809868, 0.053360555320978165, -0.2020076960325241, -0.024871455505490303, 0.1924324333667755, 0.20459997653961182, -0.3382747769355774, -0.4946228265762329, -0.04811688885092735, 0.6291624307632446, -0.36245089769363403, -0.146070152...
I started getting this error when posting the form back with Model Binder. To test the problem I reduced the postback to one string property of the model but i still get the overflow error. Can anyone suggest what would cause this? UPDATE The problem appears to be related to the property in the model that is a foreig...
[ 0.12722323834896088, -0.010353180579841137, 0.19234323501586914, -0.13500520586967468, -0.005888844840228558, -0.275102436542511, 0.2807387709617615, -0.2977062463760376, -0.19649022817611694, -0.43161919713020325, -0.027317587286233902, 0.6597168445587158, -0.5510081052780151, 0.370043128...
tells the model binder to not try to bind the Category (FK property). This is a known issue and the MVC team has already fixed it for RC. You can also pass in an exclusion list into UpdateModel/TryUpdateModel and any place you add a Bind attribute.
[ 0.015270358882844448, 0.07936585694551468, 0.4509712755680084, 0.1382671594619751, 0.00939906109124422, -0.31840187311172485, 0.3392823040485382, -0.3805510997772217, -0.4055812358856201, -0.16325461864471436, -0.21399882435798645, 0.1991245150566101, -0.4041898548603058, 0.256717026233673...
Of late, I've been hearing many good things about functional programming languages such as F#. Additionally [and unrelated], I'm also noticing MVC is starting to get a lot of exposure - perhaps since the introduction of Silverlight/WPF. I've never been one for jumping on a bandwagon without first doing my research - i...
[ 0.5562345385551453, 0.09054582566022873, 0.1324930638074875, 0.06802456825971603, -0.43114444613456726, -0.6659724712371826, 0.07029390335083008, 0.0658290684223175, -0.5915102362632751, -0.461980402469635, 0.16559068858623505, 0.515019416809082, -0.35622259974479675, 0.009532884694635868,...
to wonder if that's the way to go. Are languages such as F#, and the MVC programming model here to stay or are they just the next fad? Or do people really see these as becoming a potential replacement for C#/VB and OOP? Most of my development is on in house applications either in the form of rich web applications for ...
[ 0.6533957123756409, 0.2735334634780884, -0.004827810917049646, 0.1071104183793068, 0.02238953486084938, 0.1758727878332138, -0.04327451065182686, 0.5577027797698975, -0.1967788189649582, -0.8154432773590088, 0.030252084136009216, 0.5940191149711609, -0.04684366285800934, -0.014824063517153...
would be the most productive/useful to have in my toolbox in the near future? Neither is a fad, and neither is going away any time soon, but in reality I only expect to see one of those two in regular usage by most .NET devs... There's a big difference between F# and ASP.NET MVC; F# is a functional language - this has...
[ 0.36133959889411926, 0.0313599668443203, 0.19902056455612183, 0.004731832072138786, 0.03911834955215454, -0.18646962940692902, -0.025227153673768044, 0.3371652364730835, -0.3457513451576233, -0.5309519171714783, -0.15092530846595764, 0.7017755508422852, 0.08221400529146194, -0.140303313732...
programming (especially re immutability). I looked at F#, and I hope it improves my C# even if I never write any production code in F#. Fortunately, thanks to delegates and lambdas, C# can be used in a functional way, even if it isn't formally FP. ASP.NET MVC, however, is a very different beast; MVC (more generally) i...
[ 0.4024132788181305, 0.05888741835951805, 0.2340218722820282, 0.02571628987789154, -0.45914503931999207, -0.2504618763923645, 0.14324656128883362, 0.13579319417476654, -0.5109267830848694, -0.6362266540527344, -0.38384300470352173, 0.7365326881408691, -0.28269413113594055, -0.15449289977550...
etc) Or another way: to a lot of people, it makes ASP.NET finally make sense; I fully expect to make a **lot** of use of ASP.NET MVC in the coming year.
[ 0.3681863248348236, -0.16909641027450562, 0.6421565413475037, -0.09164857119321823, -0.0032446766272187233, -0.3474149703979492, 0.175503209233284, 0.2665221691131592, -0.6259718537330627, -0.540862500667572, -0.2031964659690857, 0.5215007066726685, 0.057322222739458084, -0.049867346882820...
This is closely related to an [earlier question](https://stackoverflow.com/questions/419776/modal-operation-using-imessagefilter-and-doevents). In the managed world: * How do I check if the current thread has messages in its message queue? * How do I yield to the OS and wait for a message in the current thread (like ...
[ -0.008363990113139153, -0.310161292552948, 0.32898443937301636, -0.04745205119252205, -0.12503977119922638, -0.17498619854450226, 0.41569408774375916, -0.09137741476297379, -0.4382975101470947, -0.6852849721908569, -0.1390298455953598, 0.23995459079742432, -0.3844127655029297, 0.0761873796...
The last question I asked concerned how to bin data by x co-ordinate. The solution was simple and elegant, and I'm ashamed I didn't see it. This question may be harder (or I may just be blind). I started out with about 140000 data points and split them into 70 groups equally spaced along the x axis I then took the ave...
[ 0.06377317011356354, 0.03698660060763359, 0.282589852809906, 0.386758953332901, -0.6643120050430298, 0.4655277729034424, 0.12689466774463654, -0.4384755492210388, -0.13053575158119202, -0.40888363122940063, 0.3161064088344574, -0.11305174976587296, -0.1498255431652069, 0.1351710855960846, ...
more than others and thus need a better resolution. I thus have two specific questions and a general invitation to throw suggestions: Does matlab have a builtin way of splitting a matrix into either a fixed number of smaller matricies or smaller matricies of a fixed size? Is there an algorithm (or a matlab function,...
[ 0.22483767569065094, -0.3920859098434448, 0.3495977520942688, 0.535160481929779, -0.2540070414543152, 0.022007349878549576, -0.3586527109146118, -0.1990354359149933, -0.5057628154754639, -0.44019845128059387, 0.13306355476379395, 0.03207506984472275, 0.13599368929862976, 0.3800555765628814...
the density of x values. I think you can still use the function HISTC like in the answer to your previous post, but you would just have to give it a different set of edges. I don't know if this is exactly want you want, but here's one suggestion: instead of splitting the x axis into 70 equally spaced groups, split the...
[ 0.12273169308900833, -0.32240110635757446, 0.43877339363098145, 0.14575202763080597, -0.2196246236562729, 0.23517437279224396, -0.05630117654800415, -0.5438010692596436, -0.2274102121591568, -0.8212522268295288, 0.08590580523014069, 0.2263016402721405, -0.2955458462238312, 0.22664934396743...
ascending order ysort = y(index); % Sort y the same way as x binEdges = [xsort(1:ceil(nValues/nBins):nValues) xsort(nValues)+1]; % Bin the data and get the averages as in previous post (using ysort instead of y): [h,whichBin] = histc(xsort,binEdges); for i = 1:nBins flagBinMembers = (whichBin == i); ...
[ -0.08458525687456131, -0.49390870332717896, 0.6676238775253296, 0.20908458530902863, -0.049512773752212524, -0.020887093618512154, 0.3042660653591156, -0.43466833233833313, -0.22364860773086548, -0.678785502910614, -0.09256653487682343, 0.32661694288253784, -0.10779833793640137, 0.16098710...
neighboring data points in x. Any x values that differ from their larger neighbor by an amount greater than or equal to maxDelta are forced to be in their own bin (all by their lonesome). You still choose a value for nBins, but the final number of bins will be larger than this value when spread-out points are relegated...
[ -0.06505592167377472, -0.5005170702934265, 0.5101423859596252, 0.12628573179244995, 0.0174496378749609, 0.1164684146642685, 0.12519747018814087, -0.4080234169960022, -0.1503061205148697, -0.5568827986717224, -0.2891579568386078, 0.13306733965873718, -0.31289732456207275, 0.3082745671272278...
% Sort y the same way as x % Create bin edges: edgeIndex = false(1,nValues); edgeIndex(1:ceil(nValues/nBins):nValues) = true; edgeIndex = edgeIndex | ([0 diff(xsort)] >= maxDelta); nBins = sum(edgeIndex); binEdges = [xsort(edgeIndex) xsort(nValues)+1]; % Bin the data and get the y averages: [h,whichBin] = histc(xso...
[ 0.07345215976238251, -0.4149795472621918, 0.7065486311912537, 0.11918140947818756, -0.150420144200325, 0.16825498640537262, 0.5470668077468872, -0.30623459815979004, 0.05966454744338989, -0.778207004070282, -0.04769503325223923, 0.2819870412349701, -0.1459285467863083, 0.121762715280056, ...
Am I allowed to add whatever attributes I want to HTML tags such that I can retrieve their value later on using javascript? For example: ``` <a href="something.html" hastooltip="yes" tipcolour="yellow">...</a> ``` If that's not going to work, how would you store arbitrary pieces of information like this? **Edit:** ...
[ 0.4766239523887634, 0.20361953973770142, 0.446105033159256, -0.03941483050584793, 0.11792075634002686, -0.3913959264755249, 0.13058771193027496, -0.699250340461731, -0.2226748764514923, -0.2805019021034241, -0.1084013283252716, 0.41645368933677673, -0.08566021919250488, -0.1907829344272613...
html>`), even though browsers don't care.
[ 0.22623831033706665, 0.03964414820075035, 0.5111967325210571, 0.07321154326200485, -0.43244773149490356, -0.381898432970047, 0.5572199821472168, 0.4684654772281647, -0.30067142844200134, -0.843231737613678, -0.3873552978038788, 0.2695375680923462, -0.3152182996273041, -0.010176027193665504...
Seem to be having an issue with std::auto\_ptr and assignment, such that the object referenced seems to get trashed for some reason. ``` std::auto_ptr<AClass> someVar = new AClass(); // should work, but mangles content std::auto_ptr<AClass> someVar( new AClass() ); // works fine. std::auto_ptr<AClass> someVar = std::...
[ 0.12711980938911438, 0.2852573096752167, 0.5664093494415283, -0.1682436317205429, 0.2326968014240265, -0.16448673605918884, 0.6654787063598633, -0.3381374776363373, -0.40076854825019836, -0.5732845664024353, -0.34037694334983826, 0.7700809836387634, -0.29078343510627747, -0.100055590271949...
\_Right) function is correct, but the value in \_Myptr on leaving is junk. ``` template<class _Ty> struct auto_ptr_ref { // proxy reference for auto_ptr copying auto_ptr_ref(void *_Right) : _Ref(_Right) { // construct from generic pointer to auto_ptr ptr } void *_Ref; /...
[ 0.14799509942531586, 0.2597816586494446, 0.5190668106079102, -0.18193863332271576, 0.23236913979053497, -0.010985280387103558, 0.1501591056585312, -0.2071579396724701, -0.14305822551250458, -0.5231160521507263, -0.14975710213184357, 0.6313745379447937, -0.16567771136760712, 0.2668987512588...
an object pointer to ensure destruction public: typedef _Ty element_type; explicit auto_ptr(_Ty *_Ptr = 0) _THROW0() : _Myptr(_Ptr) { // construct from object pointer } auto_ptr(auto_ptr<_Ty>& _Right) _THROW0() : _Myptr(_Right.release()) { // construct by assuming pointer from _Right auto_ptr ...
[ -0.0456169992685318, 0.33918479084968567, 0.2362627387046814, -0.19879135489463806, 0.11131983995437622, 0.08414476364850998, 0.35775595903396606, -0.57920902967453, -0.0009182365611195564, -0.41145938634872437, -0.3678230345249176, 0.7397299408912659, -0.4585011303424835, 0.12817066907882...
_Myptr = _Ptr; // reset this } auto_ptr<_Ty>& operator=(auto_ptr_ref<_Ty> _Right) _THROW0() { // assign compatible _Right._Ref (assume pointer) _Ty **_Pptr = (_Ty **)_Right._Ref; _Ty *_Ptr = *_Pptr; *_Pptr = 0; // release old reset(_Ptr); // set new return (*this); } ``` At first I thought it was messing up...
[ 0.07848037779331207, -0.06402916461229324, 0.5803133845329285, -0.23771826922893524, 0.07429520785808563, -0.09887204319238663, 0.38959476351737976, -0.3581523299217224, -0.2525513768196106, -0.7851727604866028, 0.07266488671302795, 0.8271592259407043, -0.382563978433609, 0.106843151152133...
of the library being broken, or some underlying thing I'm just not getting? We also noticed a similar issue with assigning a std::auto\_ptr to a boot::shared\_ptr though we removed that entirely now and I don't recall which syntax caused the issue. The first line: ``` std::auto_ptr<AClass> someVar = new AClass(); //...
[ 0.2929953336715698, 0.1483241617679596, 0.06911761313676834, -0.05510649457573891, 0.050704725086688995, -0.07404033094644547, 0.5308560729026794, -0.2622302174568176, -0.19568990170955658, -0.3044511377811432, -0.46491169929504395, 0.7680839896202087, -0.43934303522109985, 0.0529441647231...
error C2440: 'initializing' : cannot convert from 'AClass *' to 'std::auto_ptr<_Ty>' ``` Other compilers I've tried (GCC 3.4.5, Comeau C/C++ 4.3.10.1, Digital Mars) give a similar error. EDIT: It looks like this is in fact a bug in VS2005's implementation of `auto_ptr<>` (not sure if it was introduced in SP1 or was...
[ 0.10141665488481522, -0.054051559418439865, 0.3039623498916626, -0.05950399488210678, -0.08614116907119751, 0.2443571239709854, 0.3659152090549469, -0.047816045582294464, -0.2793428301811218, -0.5886300206184387, -0.2594979703426361, 0.6702625155448914, -0.541815996170044, 0.05471702292561...
How do I use a free library, such as Html Agility in my Visual Studio Express C# programs? Obviously I have downloaded it. What I need to know is how do I set it up so I can simply use a "using" statement to link up with the classes. Html Agility does not come with any .dll's so do I need to compile it to dll, and then...
[ 0.09887555986642838, 0.05721146613359451, -0.014734587632119656, 0.30389994382858276, -0.45882871747016907, -0.23384559154510498, 0.2623451352119446, -0.10837821662425995, -0.1433594971895218, -0.633532702922821, 0.19122521579265594, 0.553372323513031, -0.3691630959510803, -0.2856050431728...
the source code. So, you should know that which type of code is this. Is this a .NET code? (if it is so, it should have a .csproj or a .vbproj etc file with it.) Then again it depends that with which development environment it was built with. If it is a project of Visusl Studio Express than you can build the project in...
[ 0.3591839075088501, 0.12253664433956146, -0.03524785861372948, 0.16036906838417053, -0.2158461958169937, -0.38087642192840576, 0.1338246464729309, 0.07437633723020554, -0.05673399195075035, -0.7237085103988647, -0.21940907835960388, 0.5332943797111511, -0.4123113453388214, -0.0804086774587...
by adding reference as you mentioned. Otherwise, you are left with two options. Either to build the code and make a binary or to use the code directly but for that you need to have a thorough understanding of the code.
[ 0.7306457757949829, 0.39030882716178894, -0.19760087132453918, 0.3466326892375946, 0.11890015006065369, 0.07770296931266785, 0.17307479679584503, -0.05259896069765091, -0.05418722704052925, -0.5066532492637634, -0.1779673546552658, 0.6869838237762451, -0.17806346714496613, 0.21312738955020...
Certain methods in Java will block until they can do something, like ServerSocket.accept() and InputStream.read(), but how it does this is not easy for me to find. The closest thing I can think of is a while() loop with a Thread.sleep() each time through, but the longer the sleep period, the less responsive the blockin...
[ 0.33701545000076294, -0.40768471360206604, -0.027471985667943954, 0.03097623400390148, -0.21852727234363556, -0.31988874077796936, 0.35579371452331543, -0.2710033655166626, -0.36406466364860535, -0.5961677432060242, 0.2513326406478882, 0.1845356971025467, -0.30399924516677856, -0.077392444...
it -- the OS handles it". Calls to things like reading from input streams are essentially wrappers around operating system calls. Under the hood inside the OS, what I think is usually happening when a call "blocks" in these cases is that the OS "knows" that it is waiting for a hardware interrupt from, say, the disk con...
[ 0.002006606198847294, -0.10557923465967178, 0.30394676327705383, 0.32826435565948486, 0.04033048078417778, -0.3563108444213867, -0.2518448829650879, 0.19417919218540192, -0.22007660567760468, -0.35628029704093933, -0.34229135513305664, 0.5620037913322449, -0.2616157829761505, -0.0358795933...
error" etc). (And part of the thread scheduling algorithm is then doing things like giving the waiting thread a temporary "boost" of some kind when that waited-for data becomes available. Again, usually you don't need to worry too much about this.) Or put another way: whatever the exact details of this mechanism, it's ...
[ 0.1267877221107483, -0.14152292907238007, -0.01343290414661169, -0.04050125926733017, -0.04938928782939911, -0.3175560235977173, 0.2936340570449829, 0.07132142782211304, -0.275655061006546, -0.4601747393608093, -0.03216545656323433, 0.3058164417743683, -0.38029664754867554, -0.041634961962...
there's probably a library method/class that will do it for you. For example (links include some material I've written on these subjects): * if you want to take the next message/job when it becomes available from some queue/provider, look at [blocking queues](http://www.javamex.com/tutorials/synchronization_producer_c...
[ 0.4066218435764313, -0.18357187509536743, 0.206717386841774, -0.023989075794816017, -0.024656103923916817, 0.021235410124063492, -0.04930270090699196, 0.12628242373466492, -0.49748560786247253, -0.4494154751300812, 0.1255652904510498, 0.48700931668281555, -0.19730304181575775, 0.1623020172...
with the Java 5 concurrency API. And whatever you're doing, spinlocking is usually the very very last resort.
[ 0.3086293637752533, -0.07919596880674362, 0.12848225235939026, 0.22283455729484558, -0.14601562917232513, -0.4470538794994354, 0.38336923718452454, -0.005124968942254782, -0.4968356192111969, -0.11891195178031921, -0.04781181365251541, 0.4436698257923126, -0.3663345277309418, -0.0909237787...
Coming from a Perl background, I have to say I prefer `cpan Foo::Bar` to the having to start sbcl, `(require :asdf-install)` and finally `(asdf-install:install :foo-bar)`. Is there anything more convenient than this around? There is clbuild: ``` http://common-lisp.net/project/clbuild/ ``` But I add this to my .bashr...
[ -0.02046826109290123, 0.23440229892730713, 0.7018737196922302, -0.346587598323822, -0.010503370314836502, -0.3999355733394623, 0.2217465341091156, -0.33427438139915466, -0.13237155973911285, -0.23952239751815796, -0.3294795751571655, 0.7113757133483887, -0.39753207564353943, -0.12449292093...
If I have two objects on the heap referring to each other but they are not linking to any reference variable then are those objects eligible for garbage collection? Yes, they are. Basically the GC walks from "known roots" (static variables, local variables from all stack frames in alll threads) to find objects which ca...
[ 0.04327618330717087, -0.09873182326555252, -0.007589846383780241, 0.18186359107494354, -0.2929641902446747, -0.16662243008613586, 0.15856654942035675, 0.16451551020145416, -0.298586368560791, -0.32852163910865784, -0.03599996492266655, 0.10419193655252457, -0.5019801259040833, 0.3427218496...
which are referenced by class loaders > which are referenced by classes which > are referenced by object which are > referenced by root references. The difference is likely to be irrelevant *most* of the time, but it's good to know :)
[ 0.12441407144069672, 0.10815279185771942, 0.08370250463485718, 0.2482927441596985, 0.006909058429300785, -0.1017586961388588, 0.30364108085632324, -0.1030479371547699, -0.13477396965026855, -0.5496118664741516, -0.017417987808585167, 0.6356645226478577, -0.10429497808218002, -0.01213333103...
my Python program can be launched with a range of different options (or subcommands) like: ``` $ myProgram doSomething $ myProgram doSomethingElse $ myProgram nowDoSomethingDifferent ``` I want it to use auto-completion with so that if i type "myProgram d" it returns "myProgram doSomething" and if i type "myProgram ...
[ 0.2578176259994507, 0.145882248878479, 0.2540390193462372, -0.389177531003952, -0.03634479269385338, 0.04040268808603287, 0.34207093715667725, -0.03544360399246216, -0.20635010302066803, -0.3768090605735779, 0.08063524961471558, 0.6728915572166443, -0.2414342761039734, -0.04595648869872093...
(that should point to a file I don't know how to write). As a working example, django-admin (from the django package) has the same exact feature i'm looking for Create a file "myprog-completion.bash" and source it in your .bashrc file. Something like this to get you started... ``` _myProgram() { cur=${COMP_WORDS[CO...
[ 0.3106432855129242, 0.3080703616142273, 0.602956235408783, -0.38385897874832153, 0.06708372384309769, -0.20487765967845917, 0.2144506871700287, -0.2643473744392395, -0.11201160401105881, -0.6278929710388184, -0.06159095838665962, 0.718403697013855, -0.12848810851573944, 0.24787427484989166...
Is there a more efficient way to clamp real numbers than using if statements or ternary operators? I want to do this both for doubles and for a 32-bit fixpoint implementation (16.16). I'm **not** asking for code that can handle both cases; they will be handled in separate functions. Obviously, I can do something like:...
[ -0.08153478056192398, -0.14107029139995575, 0.2964615523815155, -0.27107882499694824, -0.1925620138645172, 0.5124054551124573, -0.07426253706216812, -0.21385256946086884, -0.26306742429733276, -0.13260652124881744, -0.013960209675133228, 0.6125062108039856, -0.7222943902015686, -0.26119661...
functions/macros for comparisons. This is done in a performance-critical part of the code, so I'm looking for an as efficient way to do it as possible (which I suspect would involve bit-manipulation) EDIT: It has to be standard/portable C, platform-specific functionality is not of any interest here. Also, `MY_MIN` a...
[ 0.16278880834579468, -0.021619264036417007, 0.19074493646621704, 0.045350581407547, 0.018367910757660866, 0.2756117582321167, 0.003593535628169775, 0.09814993292093277, -0.38602930307388306, -0.3183504343032837, -0.16104134917259216, 0.8308600187301636, -0.3124566674232483, -0.188234448432...
doubt), you'd be relying on the binary representation of doubles. THIS (and their size) IS IMPLEMENTATION-DEPENDENT. Possibly you could "guess" this using sizeof(double) and then comparing the layout of various double values against their common binary representations, but I think you're on a hiding to nothing. The b...
[ 0.626488447189331, 0.10549602657556534, 0.04658979922533035, 0.15021109580993652, 0.035173412412405014, -0.02397727780044079, 0.6282334923744202, -0.2738627791404724, -0.05159584805369377, -0.6359343528747559, 0.012469442561268806, 0.8771871328353882, -0.1121739000082016, -0.39240890741348...
standardised way of asking your compiler if it uses IEEE754 float formats with a #IF...? ``` double FMIN = 3.13; double FMAX = 300.44; double FVAL[10] = {-100, 0.23, 1.24, 3.00, 3.5, 30.5, 50 ,100.22 ,200.22, 30000}; uint64 Lfmin = *(uint64 *)&FMIN; uint64 Lfmax = *(uint64 *)&FMAX; DWORD start = GetT...
[ 0.18552790582180023, -0.05431264638900757, 0.6949174404144287, -0.13807940483093262, 0.3028036952018738, 0.17529937624931335, 0.23840546607971191, -0.7007169127464294, -0.09117568284273148, -0.4850046634674072, -0.5576061010360718, 0.5355404019355774, -0.24595096707344055, -0.4240812659263...
*pfvalue++ = (*pfvalue < Lfmin) ? Lfmin : (*pfvalue > Lfmax) ? Lfmax : *pfvalue; } volatile DWORD hacktime = GetTickCount() - start; for (int j=0; j<10000000; ++j) { double * pfvalue = &FVAL[0]; for (int i=0; i<10; ++i) *pfvalue++ = (*pfvalue < FMIN) ? FMIN : (*pfvalue > FM...
[ -0.18080978095531464, -0.21379080414772034, 0.9839433431625366, -0.4793024957180023, 0.3068523406982422, 0.4965256154537201, 0.41186559200286865, -0.8432328701019287, 0.12771786749362946, -0.4289860129356384, -0.6294152736663818, 0.984272837638855, -0.35762912034988403, -0.3791181743144989...
} volatile DWORD normaltime = GetTickCount() - (start + hacktime); ```
[ -0.07284657657146454, -0.3875090777873993, 0.3045819103717804, -0.04767543822526932, 0.388189435005188, -0.27784743905067444, 0.5251588225364685, -0.11534028500318527, 0.2849922478199005, -0.13809749484062195, -0.5001704692840576, 1.058218002319336, -0.4366564154624939, -0.0264915432780981...
I have this simple Jsp page: ``` <%@ page language="java" import="java.awt.Color"%> <% Color background = Color.white; %> ``` Which fails with following error: ``` java.lang.NoClassDefFoundError at _text__jsp._jspService(/text.jsp:3) at com.caucho.jsp.JavaPage.service(JavaPage.java:75) at com.caucho.jsp...
[ 0.23895762860774994, 0.3891792893409729, 0.45546114444732666, -0.12478324770927429, -0.033069711178541183, 0.2256809026002884, 0.5539302229881287, -0.4368669092655182, -0.17108188569545746, -0.5625494718551636, 0.21404266357421875, 0.4156871736049652, -0.41686809062957764, 0.00933111459016...
by Dave, may be a headless issue. Your best bet is to convert the image in some POJO and then spit that to the browser, or may be save it somewhere on the disk and then link it in your JSP. If problem persists, try running in headless mode, as Dave pointed out. Moreover, its important to understand that JSP is a view...
[ 0.40075457096099854, 0.011892744340002537, 0.2801527678966522, 0.21515291929244995, -0.1315704882144928, -0.3165074586868286, 0.1534247100353241, 0.4840949773788452, -0.04180654510855675, -0.4574945271015167, -0.06619950383901596, 0.6025432348251343, -0.28695550560951233, -0.06721653789281...
I'm using the new CompositeScript feature that's available in the ASP.NET 3.5 SP1 for the ScriptManager. When I test this with the ASP.NET Development Server it works fine but when I publish the site to my IIS webserver the combined files cannot be downloaded, I always get the following error: Invalid ViewState. The...
[ -0.38805118203163147, 0.2761489450931549, 0.6853906512260437, 0.08816765993833542, 0.013979093171656132, -0.0994376540184021, 0.486451655626297, -0.26956790685653687, -0.348079651594162, -0.7934921383857727, 0.194586381316185, 0.496898353099823, -0.06869148463010788, 0.2860923409461975, ...
email to Computer B, with a hyperlink to the EXE file Computer B runs the EXE file on own computer, or make Computer A run the EXE file Sorry, but that is not possible. If you need to make a EXE file run on a email, just must send it as a attachment, and the user must save the exe file, and run it - you can't do anyth...
[ 0.17630505561828613, -0.03024410270154476, 0.3109745681285858, 0.06421094387769699, -0.22263820469379425, -0.056382372975349426, 0.18276667594909668, 0.2158454805612564, -0.1167372539639473, -0.4644932746887207, -0.23205354809761047, 0.38318881392478943, -0.7079334259033203, 0.158402174711...
I've two tables: TableA and TableB, joined by TableA.TableA\_Id->1..n<-TableB.TableA\_Id. A simple PK-FK. I need to extract **distinct** TableA records given a certain condition on TableB. Here's my 1st approach: SELECT \* FROM TableA A INNER JOIN TableB B ON A.idA = B.IdA AND B.Date = '2009-01-10' ORDER BY A.Id; Th...
[ -0.5333693623542786, 0.10405553132295609, 0.3406049311161041, -0.07897026091814041, -0.20927117764949799, 0.2627957761287689, -0.03092026896774769, -0.3236125409603119, -0.27214479446411133, -0.6244942545890808, 0.2594900131225586, 0.03251838684082031, 0.05466439574956894, 0.51506119966506...
TableA WHERE TableA.Id IN ( SELECT DISTINCT IdA FROM TableB WHERE Date = '20090110' ) ORDER BY TableA.IdA; This works fine. Now the question is: how can I use the Inner Join and still get the distinct values? Is this possible in one pass or the nested query is a must? What am I missing? use a derived table ``` SELEC...
[ -0.2544807195663452, 0.1609686315059662, 0.07303241640329361, -0.0379825234413147, -0.3035143315792084, 0.22121059894561768, 0.2238583117723465, -0.4625126123428345, 0.07675009965896606, -0.42582985758781433, 0.08453017473220825, 0.4534085690975189, -0.07493706792593002, 0.3232764303684234...
Can anyone please provide me a sample build file demostrating the use of the task of nant-contrib for creating an installer of a web application project. This one :) ``` <?xml version="1.0"?> <project name="Scanner" xmlns="http://nant.sf.net/release/0.85/nant.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
[ 0.3685566186904907, 0.29013413190841675, 0.007073989138007164, 0.10126569867134094, -0.05163377523422241, 0.09188247472047806, -0.004703663755208254, -0.6093618273735046, -0.14751414954662323, -0.6022979617118835, 0.10590405017137527, 0.44921642541885376, 0.16363927721977234, 0.13515540957...
<property name="ProductCode" value="{F86BC501-47EB-4A14-BB01-2CC2CB8D1232}"/> <property name="UpgradeCode" value="{B095E2D1-B9D1-412B-8B1D-A914E8876DD5}"/> <property name="TARGETDIR" value="c:\"/> </properties> <directories> <directory name="USR" foldername="usr12" root="TARGETDIR"> <d...
[ 0.3410404622554779, 0.328702837228775, 0.4669328033924103, -0.15365953743457794, 0.13487114012241364, 0.1215960904955864, 0.0077712805941700935, -0.48624759912490845, -0.2602890729904175, -0.40075188875198364, -0.5132016539573669, 0.8601300120353699, 0.1344352811574936, 0.330986887216568, ...
</directory> </directory> <directory name="SERVICEROOT" foldername="service.root"> <directory name="RELI" foldername="reli"/> </directory> <directory name="DIAMONDDATA" foldername="diamond.data"> <directory name="PHYSICSLOG" foldername="Physics_log"/> <...
[ 0.34801414608955383, 0.03265564516186714, 0.28909239172935486, -0.22799529135227203, 0.0982753336429596, 0.0655837208032608, 0.15175895392894745, -0.13969279825687408, -0.5585174560546875, -0.20551879703998566, -0.5459616780281067, 0.5373997092247009, -0.05567656084895134, 0.21430149674415...
<components> <component name="DiamondRootBinFiles" id="{9904C798-B9F7-450D-902A-1C92D7008014}" attr="2" directory="BIN" feature="FilesFeature" keepsubdirs="true"> <key file="cmd.exe"/> <fileset basedir="c:\Windows\system32"> <include name="cmd.exe" /> </fileset> </component> <...
[ 0.3294196128845215, 0.10267944633960724, 0.6609273552894592, 0.010357161052525043, -0.19457358121871948, -0.029159249737858772, 0.038963109254837036, -0.7673923969268799, -0.19786371290683746, -0.4269062876701355, -0.24924710392951965, 0.8156598210334778, -0.010649570263922215, 0.361486673...
My Controller class is decorated with an AuthorizeAttribute to protect the actions: ``` [Authorize(Roles = "User Level 2")] public class BuyController : Controller { ... } ``` Anytime an action is invoked, but the user is not in at least the role "User Level 2", the user is automatically redirected to the login ...
[ 0.08934486657381058, -0.49350571632385254, 0.46250665187835693, 0.19379571080207825, 0.16262087225914001, -0.3578249514102936, 0.1451457142829895, -0.22471073269844055, -0.3828655779361725, -0.5991303324699402, -0.15149913728237152, 0.5653105974197388, -0.15958821773529053, 0.3886459469795...
to customize this behavior? Is it possible to pass the required user level to the Login action somehow? You can build your own authorize attribute like this: ``` public class ClubAuthorizeAttribute : AuthorizeAttribute { public override void OnAuthorization(AuthorizationContext filterContext) { base.OnAuthorization...
[ 0.07133423537015915, -0.6560661196708679, 0.641037106513977, 0.054978080093860626, 0.21936510503292084, -0.10942176729440689, 0.39134278893470764, -0.565186083316803, -0.28057241439819336, -0.6947336196899414, -0.0008741465862840414, 0.45262810587882996, -0.5265288949012756, 0.021008314564...
}); } } } ``` I used this to redirect to a specific club in a club membership site I am building. You could adapt this to your need. BTW, in my case I do redirect to the login page, but I check to see if the user is authorized and if so, display a message that they don't have the correct permissions. No doubt you c...
[ 0.31456539034843445, -0.16367140412330627, 0.3481381833553314, 0.12162284553050995, -0.01738729514181614, -0.4532255232334137, 0.14388148486614227, -0.09839746356010437, -0.5041292905807495, -0.4121335744857788, -0.08019561320543289, 0.47784557938575745, -0.5776429772377014, 0.207331806421...
[Mono](http://www.mono-project.com/) claims to be compatible with .NET. Have you tried it? Can you share any tips or guidelines for making a running .NET application compatible with mono? Might be [MoMA](http://www.mono-project.com/MoMA) helps you
[ 0.8966209292411804, 0.018632281571626663, -0.09278340637683868, 0.14775343239307404, -0.12137342244386673, -0.3830625116825104, 0.29418009519577026, -0.27083247900009155, -0.24951545894145966, 0.2102513313293457, -0.08153059333562851, 0.46291857957839966, -0.20070597529411316, 0.0616895444...
For example: I'm on MS DOS, I have a source code in the folder C:\Documents and Settings\Programs. Can i make my source code use a program (for example gnuplot) that is in a random folder? Here are some options: 1. Search in the system PATH for the executable you want to run 2. Allow the user to specify the location o...
[ 0.4560205042362213, 0.0072691235691308975, 0.11580562591552734, 0.1369248479604721, 0.4182676076889038, -0.26542234420776367, 0.23533865809440613, -0.04239419475197792, -0.044211238622665405, -0.8338733315467834, -0.24703457951545715, 0.8159934282302856, -0.2138235867023468, 0.047381725162...
I have a table that's generated by a normal PHP loop. What I want to do is create a form in the first column of each row that's hidden by default but appears when you click a toggle link in that row. I can make a normal toggle-able div by creating a CSS id called hidden and setting `display: none;`. Unfortunately I c...
[ 0.342682421207428, 0.14557458460330963, 0.2553248703479767, -0.09408560395240784, -0.12783028185367584, -0.11817701160907745, 0.30273088812828064, 0.063991479575634, -0.18183746933937073, -0.8414725065231323, 0.12945565581321716, 0.409114271402359, -0.40188780426979065, 0.1551022082567215,...
empty. I've read in some places that you can't put divs inside of a table, so maybe I'm going about this all wrong. Here's an example of what the code does and how I wish it worked, but of course it does not. ``` <script language="JavaScript" type="text/javascript"> function toggle(id) { var state = docu...
[ 0.22872942686080933, 0.3171008229255676, 0.5667949914932251, -0.3846140503883362, 0.2715661823749542, -0.15452790260314941, 0.3953615128993988, -0.1963760107755661, -0.2298470139503479, -0.6208980083465576, -0.30077239871025085, 0.4099893867969513, -0.36436915397644043, 0.22218945622444153...
} else { document.getElementById(id).style.display = 'block'; } } </script> <?php while($array = mysql_fetch_array($sql)) { ?> <tr> <td> <?php echo $array['some_data']; ?> <a href="#" onclick="toggle('hidden');">Toggle</a> <div id="hidden"><?php echo...
[ 0.16675786674022675, -0.25889262557029724, 0.08904462307691574, -0.14931116998195648, 0.1733710914850235, 0.002688049105927348, 0.5213227868080139, -0.5867945551872253, -0.19857490062713623, -0.1127922311425209, -0.18250449001789093, 0.46185800433158875, -0.26229673624038696, 0.07845008373...
<?php echo $array['some_other_data']; ?> </td> </tr> <?php } ?> ``` Just use a different ID for each row: ``` <?php $count = 0; while($array = mysql_fetch_array($sql)) { $id = 'hidden' . $count++; $data = $array['some_data']; $hidden = $array['hidden_thing']; $other_data = $array['other_data']; echo...
[ 0.028883857652544975, -0.11291123926639557, 0.30096641182899475, -0.26409387588500977, 0.020940015092492104, -0.01462523639202118, 0.340839147567749, -0.736612856388092, -0.2578904628753662, -0.08297723531723022, -0.14283166825771332, 0.2345828413963318, -0.40716317296028137, -0.0463467277...
Does anyone have a suggestion for creating paragraph-type line spaces within a `<li>` tag that includes a hovered pop-up pseudo-class? I have a `<span>` that pops up on `a:hover` and I want the text that pops up to be broken into 2 paragraphs. It works with `<br>` in FF but I want to do the right thing (now that I've ...
[ 0.1889294683933258, 0.13015587627887726, 0.5453973412513733, 0.09151706099510193, -0.321078896522522, 0.1357293576002121, 0.13496112823486328, 0.1420459896326065, -0.3337741494178772, -0.7400846481323242, -0.02731058932840824, 0.45474913716316223, -0.015983467921614647, -0.1206345185637474...
are "paragraph" 1 of List item <br><br> different words that make up "paragraph" 2 of List item </span></a></li> ``` css: ``` #rightlist { margin-top: 10px; margin-right: 5px; width: 387px ; height: 239px ; background-color: #7EBB11 ; display: table-cell; z-index: 100 ; float...
[ -0.5806549787521362, 0.002031346084550023, 1.0328717231750488, 0.13094568252563477, -0.23071381449699402, 0.4314170479774475, 0.06328988075256348, -0.39157602190971375, -0.29524651169776917, -0.5859442353248596, -0.6927376985549927, 0.49405327439308167, -0.2507094144821167, -0.160201817750...
; } /*appearance of the <a> item (but before the <span> tag) on hover*/ #rightlist a:hover { color: white; } /*appearance of the spanned content within <a></a> tags when not hovered */ /* %%%%% important - keep position:absolute in this div %%%%% */ #rightlist a span { display: none; position: absolute ; margin-left...
[ -0.29514947533607483, -0.0905081033706665, 1.1335395574569702, 0.11584196984767914, -0.19815663993358612, 0.4405067563056946, -0.21306395530700684, -0.22663404047489166, -0.574698805809021, -0.263078510761261, -0.32123053073883057, 0.3688824772834778, -0.3719032406806946, -0.22254082560539...
elements and you're styling it as though it were a block element. Admittedly you can force a span to behave as a block element by adding the right style, but this may not always be honoured by the various browsers out there. Ideally you should be using a div instead. You can then use either p tags or further div tags ...
[ 0.3782351315021515, -0.034684762358665466, 0.3817705810070038, 0.12257273495197296, -0.42943495512008667, -0.17354518175125122, 0.2199832797050476, -0.21083097159862518, -0.3260054886341095, -0.5388509631156921, -0.5981692671775818, 0.10066032409667969, -0.15949776768684387, -0.21369057893...
I am trying to show the current date in my JSP page using JSTL. below is the code I am using. ``` <jsp:useBean id="now" class="java.util.Date" scope="request" /> <fmt:formatDate value="${now}" pattern="MM.dd.yyyy" /> ``` But the above code is not producing any results? Am I missing anything here or is there any bett...
[ 0.2415841817855835, -0.029667729511857033, 0.6685187816619873, -0.2336563616991043, 0.12987999618053436, -0.2944108843803406, 0.18952395021915436, 0.04482386261224747, -0.19349420070648193, -0.8024346232414246, -0.0131208011880517, 0.3009752631187439, -0.06841961294412613, 0.25755369663238...
to make the things clear.
[ 0.22805653512477875, 0.2759736180305481, 0.06270837783813477, 0.055188652127981186, -0.14315789937973022, -0.04308590665459633, 0.12756092846393585, -0.05155106261372566, 0.06986453384160995, -0.14304350316524506, -0.20417509973049164, 0.38882577419281006, -0.2824941873550415, -0.032844766...
In my application (Main form is TTntForm, C++Builder 2006): ``` void __fastcall TForm1::Button1Click(TObject *Sender) { Caption=L"1st caption"; // This works. Form1->Caption=L"2nd caption"; // But this doesn't work, // Caption of the form remains "1st caption". } ``` What ...
[ -0.09707565605640411, 0.13442569971084595, 0.5929662585258484, -0.047529350966215134, -0.034886907786130905, -0.05814262107014656, 0.6427654027938843, -0.05695519596338272, -0.044947825372219086, -0.7527823448181152, -0.3079400956630707, 0.3790050446987152, -0.185977041721344, -0.072279691...
you all for your answers. I found the bug. There was a twice form creation in project file: ``` Application->CreateForm(__classid(TForm1), &Form1); Application->CreateForm(__classid(TForm1), &Form1); ```
[ 0.5432199835777283, -0.15766321122646332, 0.4469359219074249, 0.23307737708091736, -0.07614430040121078, 0.12880784273147583, 0.1825621873140335, -0.2810124456882477, -0.004986853804439306, -0.6083981990814209, -0.05082343518733978, 0.4373893141746521, -0.2687062621116638, 0.03270285204052...
I want cscope to open files in MacVim instead of vim, so I'm trying to have the path to MacVim as the Value of the EDITOR environment variable which is used by cscope: ``` $ export EDITOR=/Applications/MacVim.app/Contents/MacOS/MacVim ``` If I'm now trying to edit a file from within ctags, it won't work and throws th...
[ -0.26331278681755066, 0.05989357456564903, 0.8650320172309875, -0.02710183709859848, -0.03139256685972214, -0.122312992811203, 0.35887035727500916, -0.0463540218770504, -0.2974652647972107, -0.900399386882782, -0.07148553431034088, 0.6276227831840515, -0.6921737790107727, 0.089654795825481...