text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
{ return false; } } ``` The custom component just extends Button (or whatever other button-type control is the culprit -- I've created a half-dozen or so of these myself, one for each type of control), but uses a `NonTruncatingTextField` as its label, where specified by the component user: ``` public cla...
[ -0.08966575562953949, -0.4712725281715393, 0.7678259611129761, -0.15083295106887817, 0.19756515324115753, 0.07887239754199982, 0.33790984749794006, -0.3408549726009369, -0.1883232295513153, -0.23049333691596985, -0.44935184717178345, 0.9145793914794922, -0.5263488292694092, 0.0742000713944...
override protected function createChildren():void { if (!textField) { if (!_truncateLabel) textField = new NonTruncatingUITextField(); else textField = new UITextField();
[ -0.06698635220527649, -0.08271699398756027, 0.561416745185852, -0.23681676387786865, 0.3765801191329956, -0.22428002953529358, 0.410491406917572, -0.32758697867393494, 0.25953155755996704, -0.41827136278152466, -0.6450110077857971, 0.7484753727912903, -0.20141209661960602, 0.29845151305198...
textField.styleName = this; addChild(DisplayObject(textField)); } super.createChildren(); } [Inspectable] public function get truncateLabel():Boolean { return this._truncateLabel; } public function set truncateLabel(value:Boolean):void { this._...
[ -0.07500242441892624, 0.005873036105185747, 0.5793347358703613, -0.14980463683605194, 0.07583556324243546, -0.1427166759967804, 0.26974886655807495, -0.09874168783426285, 0.09521668404340744, -0.613288402557373, -0.5252219438552856, 0.800550103187561, -0.24278530478477478, 0.19181956350803...
in your MXML code, you'd reference the custom component thusly (in this case, I'm telling the control never to truncate its labels): ``` <components:NonTruncatingButton id="btn" label="Click This" truncateLabel="false" /> ``` I agree it feels like a workaround, that the component architecture ought to handle all thi...
[ 0.37106025218963623, 0.27264145016670227, 0.6151046752929688, 0.17283281683921814, 0.14262425899505615, -0.048703812062740326, 0.4101506173610687, 0.285430908203125, -0.16215601563453674, -0.6172325611114502, -0.12776443362236023, 0.7991153597831726, -0.213790625333786, -0.1297852843999862...
I added an XML file as an embedded resource in my class library by using the accessing the project properties in Visual Studio and then Resources | Add Resource | Add Existing File... I've tried to access the file using the following code, but I keep getting a null reference returned. Anyone have any ideas? ``` var p...
[ 0.3196190297603607, -0.05793246254324913, 0.4107408821582794, -0.021357811987400055, -0.09109838306903839, -0.1162576973438263, 0.3786048889160156, -0.24526363611221313, -0.2810669541358948, -0.8657854795455933, 0.006258681882172823, 0.5658421516418457, -0.32052305340766907, 0.282747209072...
with the > ReflectionPermissionFlag.MemberAccess > flag. Have you marked the resource as "public" in your assembly?
[ 0.473646879196167, -0.16377286612987518, -0.06594598293304443, 0.012779662385582924, -0.18680733442306519, -0.3262079358100891, 0.3300158977508545, 0.14421385526657104, -0.3965347409248352, -0.32397225499153137, -0.0730738565325737, 0.175270676612854, -0.08314479142427444, 0.02505421079695...
I know you can specify fieldsets in django for Admin helpers. However, I cannot find anything useful for ModelForms. Just some patches which I cannot use. Am I missing something? Is there a way I could achieve something like fieldsets without manually writing out each field on my template in the appropriate tag. I wou...
[ 0.4440862238407135, 0.03900777921080589, 0.2600763142108917, -0.05817117542028427, -0.04181994870305061, -0.24207937717437744, 0.26877105236053467, -0.029994884505867958, -0.10403501987457275, -0.5888069868087769, 0.13745273649692535, 0.568207859992981, -0.4346733093261719, 0.0257635712623...
[username,password,password2,first_name,last_name,email]),) # add a 2 element tuple of string and list of fields fieldsets.append(('Terms &amp; Conditions', [acceptterms,acceptprivacy]),) # add a 2 element tuple of string and list of fields ``` fails as the items contained in my data structu...
[ 0.17510493099689484, -0.0189957395195961, 0.44385531544685364, 0.05932261422276497, -0.19491420686244965, -0.06062300503253937, 0.5928633809089661, -0.44662678241729736, 0.19146728515625, -0.6850929260253906, -0.39202097058296204, 0.6041103601455688, -0.37016844749450684, 0.218010649085044...
fieldsets (even a rough one that is not backward compatible... this is just for my own project) and if so, can you give any pointer? I do not want to mess with the django code. Fieldsets in modelforms are still in "design" stage. There's a [ticket](http://code.djangoproject.com/ticket/6630) in Django trac with low acti...
[ 0.3894215226173401, -0.08169609308242798, 0.27678388357162476, 0.14952971041202545, -0.3396311402320862, -0.28007417917251587, -0.12013380229473114, -0.00947160180658102, -0.4057748317718506, -0.5821534991264343, 0.15945489704608917, 0.31150582432746887, -0.3126496374607086, -0.17962265014...
point out Carl's project [django-form-utils](http://bitbucket.org/carljm/django-form-utils/src/) which contains a BetterForm class which can contain fieldsets. If you like this project give him a +1 for his answer below :)
[ -0.119850292801857, 0.11817197501659393, 0.31848952174186707, -0.06585275381803513, -0.32498347759246826, -0.3165983557701111, 0.12213417887687683, -0.03581327572464943, -0.23116976022720337, -0.13397946953773499, -0.05991455540060997, 0.014840685762465, -0.3142649531364441, -0.02559449709...
Is there a #define compiler (nvcc) macro of CUDA which I can use? (Like \_WIN32 for Windows and so on.) I need this for header code that will be common between nvcc and VC++ compilers. I know I can go ahead and define my own and pass it as an argument to the nvcc compiler (-D), but it would be great if there is one al...
[ 0.2725766599178314, 0.1948365867137909, 0.17407912015914917, -0.006188489962369204, -0.09103146195411682, -0.08651398122310638, -0.22115996479988098, -0.09341412782669067, -0.23892459273338318, -0.6761616468429565, 0.15702958405017853, 0.46310946345329285, -0.3521110415458679, 0.1577221751...
I have a server hosting a remoting application using .NET 3.5. It has been running fine. In the last couple of days I have had numerous reports of users not being able to access the application after running the "Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86" update. I...
[ 0.35593628883361816, 0.1823759526014328, 0.4916522204875946, -0.08754344284534454, -0.17195315659046173, -0.34803298115730286, 0.6615080833435059, -0.08189994096755981, -0.2790629267692566, -0.6022544503211975, -0.019784731790423393, 0.6660085320472717, -0.18602707982063293, 0.368244051933...
issue - as my dev machine does not have SP1 on it, so the app is not using anything that is dependent on SP1. Any thoughts on what might be happening? It may be a coincidence - but several users had errors with our application following this Windows Update. Our app is a click-once distributed app. The app would not up...
[ 0.22795335948467255, 0.2536807060241699, 0.6382501721382141, 0.14059945940971375, -0.030628157779574394, -0.2883603274822235, 0.5387710332870483, -0.06162703037261963, -0.3208910822868347, -0.5840580463409424, -0.19808538258075714, 0.7593938112258911, -0.631267249584198, 0.1066890060901641...
this problem. I hope this might save someone else a huge waste of time!
[ 0.031097015365958214, 0.15771189332008362, 0.23465079069137573, 0.3017871379852295, 0.3695259690284729, -0.1616542786359787, 0.27446478605270386, 0.30161499977111816, -0.23889175057411194, -0.4265083074569702, 0.12607868015766144, 0.36522018909454346, 0.017220046371221542, 0.20167002081871...
So I have ASP.NET running on the server in IIS7. I think I'm going to use MVC for some static pages and basic dynamic forms - but the majority of the client side is written in Flash/ActionScript. What's the simplest, most succint, most DRY way of building/generating proxies between client and server? Which format sh...
[ 0.17413032054901123, -0.1282232254743576, 0.6286571621894836, -0.042545441538095474, -0.5111843347549438, -0.08394602686166763, 0.24986088275909424, -0.01253367681056261, -0.23022320866584778, -0.870521068572998, -0.10039819031953812, 0.49124613404273987, -0.267589807510376, -0.19821582734...
to consume in Flash and simple to create in .NET. I'd also suggest you at least look into AMF, which is Adobe's proprietary binary format for exchanging data between client and server. There are a couple of implementations for .NET, including amf.net and weborb. I've never used it, but I've heard really great things ...
[ 0.6912171244621277, -0.0546502061188221, 0.2281579077243805, 0.17655178904533386, -0.16541463136672974, 0.04725968465209007, -0.20737630128860474, -0.08280154317617416, -0.1723833531141281, -0.6760490536689758, 0.2797105610370636, 0.7119260430335999, -0.17320747673511505, -0.16052320599555...
I wrote a couple of Java classes—`SingleThreadedCompute` and `MultithreadedCompute`—to demonstrate the fact (or what I always thought was a fact!) that if you parallelize a compute-centric (no I/O) task on a single core machine, you don't get a speedup. Indeed my understanding is that parallelizing such tasks actually ...
[ -0.07624775916337967, -0.007052455563098192, -0.03248095139861107, 0.14558327198028564, -0.13804960250854492, 0.20474648475646973, 0.13107824325561523, 0.15154311060905457, -0.3469438850879669, -0.545762836933136, 0.29001539945602417, 0.5022088289260864, -0.35256680846214294, 0.09155017882...
machine. Can anybody explain how this is possible? Here are the classes if anybody wants to look or try it for themselves. ``` public final class SingleThreadedCompute { private static final long _1B = 1000000000L; // one billion public static void main(String[] args) { long startMs = System.currentT...
[ 0.0954124704003334, -0.11793433874845505, 0.555512547492981, -0.22049754858016968, 0.20674782991409302, 0.2047913372516632, 0.3462974727153778, -0.07393074780702591, -0.37047144770622253, -0.48382383584976196, -0.18774095177650452, 0.43197891116142273, -0.26822516322135925, 0.6788378953933...
long elapsedMs = System.currentTimeMillis() - startMs; System.out.println("Elapsed time: " + elapsedMs + " ms"); } } ``` Here's the multithreaded version: ``` public final class MultithreadedCompute { private static final long _1B = 1000000000L; // one billion private static final long _100M = _1...
[ -0.060867536813020706, -0.13595201075077057, 0.8368152379989624, -0.3662474751472473, 0.27628085017204285, 0.5190590620040894, 0.060482002794742584, -0.23550625145435333, -0.4215247333049774, -0.3839987516403198, -0.27579593658447266, 0.3229353725910187, -0.2852303385734558, 0.549666225910...
Worker[] workers = new Worker[10]; for (int i = 0; i < 10; i++) { workers[i] = new Worker(i * _100M, (i+1) * _100M); } System.out.println("Starting workers"); for (int i = 0; i < 10; i++) { workers[i].start(); } for (int i = 0; i < 10; i++) {
[ -0.16763874888420105, -0.0038157792296260595, 0.35444357991218567, -0.5610582828521729, 0.02870882675051689, 0.7075613737106323, 0.1978449672460556, -0.38998693227767944, -0.4288165271282196, -0.8788668513298035, -0.34078237414360046, 0.15497346222400665, -0.3579792380332947, 0.19505339860...
try { workers[i].join(); System.out.println("Joined with thread " + i); } catch (InterruptedException e) { /* can't happen */ } } System.out.println("Summing worker totals"); long total = 0;
[ 0.20682208240032196, -0.5160302519798279, 0.38847658038139343, -0.35954809188842773, 0.2221013307571411, 0.20145249366760254, 0.3957887291908264, -0.17536476254463196, -0.4431406557559967, -0.3400692939758301, -0.06032146140933037, 0.30984562635421753, -0.5123679041862488, 0.37693652510643...
for (int i = 0; i < 10; i++) { total += workers[i].getTotal(); } System.out.println("total=" + total); long elapsedMs = System.currentTimeMillis() - startMs; System.out.println("Elapsed time: " + elapsedMs + " ms"); } private static class Worker extends Thread { private long st...
[ -0.13572099804878235, -0.35498103499412537, 0.5283807516098022, -0.3328797519207001, 0.23437024652957916, 0.5448577404022217, 0.4255591630935669, -0.3265290856361389, -0.36313822865486145, -0.33624908328056335, -0.2705816626548767, 0.35283923149108887, -0.42776140570640564, 0.4316583275794...
end) { this.start = start; this.end = end; } public void run() { System.out.println("Computing sum " + start + " + ... + (" + end + " - 1)"); for (long i = start; i < end; i++) { total +=
[ 0.08715309947729111, -0.3762371242046356, 0.4717389643192291, -0.25640279054641724, 0.016326654702425003, 0.10695388168096542, 0.44542884826660156, -0.4918632209300995, -0.30748942494392395, 0.050960250198841095, -0.2175224870443344, 0.45499685406684875, -0.2696543037891388, 0.298482537269...
i; } } public long getTotal() { return total; } } } ``` Here's the output from running the single-threaded version: ``` total=499999999500000000 Elapsed time: 7031 ms ``` And here's the output from running the multithreaded version: ``` Creating workers Starting workers Computing sum 0 + ... ...
[ -0.05937911197543144, -0.05930568277835846, 0.4318906366825104, -0.27882346510887146, -0.23615363240242004, 0.6286537647247314, 0.27143579721450806, -0.4271591901779175, -0.19041308760643005, -0.28014662861824036, 0.006065816152840853, 0.4212169051170349, -0.17784135043621063, 0.4096869528...
+ (700000000 - 1) Computing sum 700000000 + ... + (800000000 - 1) Computing sum 800000000 + ... + (900000000 - 1) Computing sum 900000000 + ... + (1000000000 - 1) Joined with thread 0 Joined with thread 1 Joined with thread 2 Joined with thread 3 Joined with thread 4 Joined with thread 5 Joined with thread 6 Joined wit...
[ -0.06299713999032974, 0.27058637142181396, 0.7473852634429932, -0.039763856679201126, -0.38854551315307617, 0.6169049143791199, 0.28135359287261963, -0.5285743474960327, -0.36804109811782837, -0.30087727308273315, 0.30084720253944397, 0.29883912205696106, 0.05583374947309494, 0.20226314663...
above and by noting that back when I bought the machine (Aug 2005), single cores were the standard and I didn't upgrade to multicore (if that was even an option... I don't remember). If there's somewhere in Windows I can check other than System Properties (which shows the info above) let me know and I'll check. --- H...
[ -0.1331411600112915, 0.011384835466742516, 0.4483431577682495, 0.06758180260658264, -0.16767817735671997, 0.49279940128326416, 0.730649471282959, -0.3338431119918823, -0.5953354835510254, -0.5246433019638062, 0.1371324062347412, 0.7689235806465149, 0.11060695350170135, 0.2233743816614151, ...
the JIT as Pax suggested in the comment above. Pax, if you want to post a quick "Turn off the JIT" answer I'll credit your solution. Anyway turning off the JIT worked (meaning that it brought the actual results in line with the expected results). I had to back away from one billion as it was taking forever, so I went ...
[ -0.18878567218780518, 0.07909413427114487, 0.12287788838148117, -0.07947695255279541, -0.6192745566368103, 0.7870111465454102, 0.47901374101638794, -0.00921216793358326, -0.6808664202690125, -0.16481120884418488, 0.09330428391695023, 0.38893935084342957, -0.25503358244895935, 0.32128190994...
time: 18719 ms total=4999999950000000 Elapsed time: 18750 ms total=4999999950000000 Elapsed time: 18610 ms total=4999999950000000 Elapsed time: 18890 ms total=4999999950000000 Elapsed time: 18719 ms --- Thanks guys for the ideas and help.
[ -0.10650895535945892, 0.1650620549917221, 0.37938904762268066, -0.05072007328271866, -0.559102475643158, 0.5116226673126221, 0.9329082369804382, -0.13801953196525574, -0.42130541801452637, -0.8219001293182373, 0.12167854607105255, 0.21600283682346344, -0.043267637491226196, 0.2153545320034...
Based on information in Chapter 7 of [3D Programming For Windows (Charles Petzold)](http://www.charlespetzold.com/3D/), I've attempted to write as helper function that projects a Point3D to a standard 2D Point that contains the corresponding screen coordinates (x,y): ``` public Point Point3DToScreen2D(Point3D point3D,...
[ 0.08510466665029526, 0.19470688700675964, 0.8769974112510681, -0.290531724691391, -0.12475904822349548, 0.17280995845794678, -0.060115355998277664, -0.1482117772102356, -0.1998043954372406, -0.5660892128944397, 0.059206921607255936, 0.30821239948272705, -0.227862149477005, 0.04702154546976...
</Viewport3D.Camera> PerspectiveCamera cam = viewPort.Camera as PerspectiveCamera; // Translate input point using camera position double inputX = point3D.X - cam.Position.X; double inputY = point3D.Y - cam.Position.Y; double inputZ = point3D.Z - cam.Position.Z; double aspectRatio = viewPort.A...
[ -0.04304944723844528, -0.08468892425298691, 0.8440268039703369, -0.12788808345794678, -0.25864267349243164, 0.7626261711120605, 0.1085967868566513, -0.39807307720184326, -0.007224809844046831, -0.4353386163711548, 0.06455780565738678, 0.8924174904823303, -0.06598475575447083, -0.1884773671...
Convert to screen coordinates screenX = screenX * viewPort.ActualWidth; screenY = screenY * viewPort.ActualHeight; // Additional, currently unused, projection scaling factors /* double xScale = 1 / Math.Tan(Math.PI * cam.FieldOfView / 360); double yScale = aspectRatio * xScale; double zFa...
[ 0.14139649271965027, -0.3084774315357208, 1.2287989854812622, 0.05863555893301964, 0.16701292991638184, 0.1889447569847107, -0.2389158308506012, -0.24589335918426514, 0.042658958584070206, -0.8852420449256897, 0.06089574471116066, 0.7586086392402649, -0.18181772530078888, -0.15875679254531...
return new Point(screenX, screenY); } ``` On testing however this function returns incorrect screen coordinates (checked by comparing 2D mouse coordinates against a simple 3D shape). Due to my lack of 3D programming experience I am confused as to why. The block commented section contains scaling calculations that ma...
[ -0.0026633532252162695, 0.17592673003673553, 0.6559085845947266, -0.23622654378414154, 0.121603824198246, 0.12464591860771179, -0.16575387120246887, -0.388170063495636, -0.16155704855918884, -0.7487891912460327, 0.23843325674533844, 0.5837750434875488, -0.07534322887659073, 0.0163166131824...
screen (x cross y), I would use something like ``` screenY = viewPort.ActualHeight * (1 - screenY); ``` instead of ``` screenY = screenY * viewPort.ActualHeight; ``` to correct screenY to accomodate Windows. Alternately, you could use OpenGL. When you set the viewport x/y/z range, you could leave it in "native"...
[ 0.26359501481056213, -0.1297025978565216, 0.9526606202125549, 0.02598927728831768, -0.015980564057826996, 0.11545658111572266, -0.04411892592906952, 0.0349491611123085, 0.12119174003601074, -0.8511412739753723, 0.07866275310516357, 0.41398710012435913, -0.27516305446624756, 0.3054078817367...
multiply. To account for Windows y being flipped from Cartesian y, you convert from [1.0, 0.0] (upper left to lower left), to [0.0, 1.0] (upper to lower) by subtracting the previous screen from 1.0. Then, you can scale to the ActualHeight.
[ 0.05492794141173363, -0.2147018015384674, 0.633429765701294, -0.03761657699942589, -0.3013342618942261, 0.3409305512905121, 0.047341130673885345, -0.06805649399757385, -0.36343100666999817, -0.5607457160949707, 0.149739071726799, 0.3043572008609772, -0.02812887914478779, 0.1711395531892776...
What are the best guides / tutorials / books / websites for someone with minimal experience (or none) in the world of 3D graphics programming? I realize that the fundamentals of 3D graphics and mathematics apply across platform specific 3D library implementations such as OpenGL, DirectX, WPF etc.. Therefore it would ...
[ 0.35885143280029297, 0.1934785097837448, -0.02135070599615574, 0.37074801325798035, -0.1617155224084854, -0.3168260157108307, -0.13085411489009857, 0.02875089831650257, -0.3197137117385864, -0.5958575010299683, -0.05677744746208191, 0.7170095443725586, 0.09244932234287262, -0.0324041061103...
have been almost impossible even a few years ago. I'm sure there are many programmers out there, like me, who find the leap from 2D to 3D a very big one. Petzold's [3D Programming for Windows](http://www.charlespetzold.com/3D/) is an obvious start if you are doing WPF. For Opengl the book is available free [online](...
[ 0.6770415902137756, -0.10677894949913025, 0.33849015831947327, 0.06255509704351425, 0.019967172294855118, -0.11272802203893661, 0.0249771811068058, 0.06459688395261765, -0.22985446453094482, -0.6624234318733215, -0.19664371013641357, 0.6686434149742126, 0.18368707597255707, 0.3589126765727...
I'm trying to implement routing such as the following: posts/535434/This-is-a-post-title ``` posts/tagged/tags+here // Matches {controller}/{action}/{id} - Default // Displays all posts with the specified tags // uses PostsController : ActionTagged(string tags) posts?pageSize=50&pageIndex=4 // Matches {controller}/{...
[ 0.18762721121311188, -0.12008921056985855, 0.41345271468162537, 0.01449042372405529, -0.1516781449317932, -0.32713550329208374, 0.24918939173221588, -0.41285476088523865, -0.4656616151332855, -0.7783104181289673, 0.24469828605651855, 0.25484809279441833, -0.5258653163909912, 0.094915382564...
things: First, you should always order your routes in decreasing specificity (e.g. most specific case first, least specific case last) so that routes will "fall through", if one doesn't match it will try the next. So we want to define {controller}/{postid}/... (must be a postid) before we define {controller}/{action}...
[ -0.1541416496038437, -0.45431607961654663, 0.2677774131298065, 0.3044835329055786, 0.06643258780241013, -0.14964912831783295, 0.31185412406921387, -0.14695118367671967, -0.21287453174591064, -0.8459931015968323, -0.06924689561128616, 0.2211049199104309, -0.3625563085079193, 0.1191013678908...
Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) { //if input looks like a post id, return true. //otherwise, false } } ``` We can add it to the route definition like so: ``` routes.MapRoute( "Default",...
[ -0.13062220811843872, -0.5451857447624207, 0.8863013982772827, -0.03521892428398132, -0.10210137069225311, -0.09825671464204788, 0.0052460855804383755, -0.2235628068447113, 0.09716421365737915, -1.204609751701355, 0.025965828448534012, 0.3456849753856659, -0.46250152587890625, -0.080495357...
I know that accessing and manipulating the DOM can be very costly, so I want to do this as efficiently as possible. My situation is that a certain div will always contain a list of items, however sometimes I want to refresh that list with a completely different set of items. In this case, I can build the new list and a...
[ 0.25151970982551575, -0.14056771993637085, 0.33300137519836426, -0.005745626986026764, 0.1419588029384613, 0.2127799093723297, 0.1413269191980362, -0.25161847472190857, -0.11224444210529327, -0.6723500490188599, -0.04550706222653389, 0.6332655549049377, -0.12770289182662964, 0.502006947994...
[QuirksMode](http://quirksmode.org/). It may take some digging, but there are times for just this operation in various browsers. Although the tests were done more than a year ago, setting `innerHTML` to `""` was the fastest in most browsers. P.S. [here](http://quirksmode.org/dom/innerhtml.html) is the page.
[ -0.15280424058437347, -0.29467615485191345, 0.8252592086791992, 0.03649603947997093, 0.002306409180164337, -0.4278128743171692, 0.3577030599117279, 0.03094753623008728, -0.4976058900356293, -0.43692463636398315, 0.11229714006185532, 0.3707183003425598, 0.005762255284935236, -0.018961027264...
First of all, am I the only person using JSONML? And second of all, would you recommend using JSONML for inserting dynamic HTML or is InnerHTML more efficient? Bare in mind that (in IE) not every innerHTML is writable (innerHTML isn't standar compilant anyway). So closer you come to appending nodes rather then insertin...
[ 0.06405472755432129, -0.45363590121269226, 0.207341268658638, 0.11463531851768494, -0.36053934693336487, -0.1654801070690155, 0.1415311098098755, 0.0057312981225550175, -0.2646048665046692, -0.6285161375999451, -0.09184963256120682, 0.8072487115859985, -0.2166583091020584, -0.1319777667522...
What am I missing here? I want to do a simple call to Select() like this: ``` List<int> list = new List<int>(); //fill the list List<int> selections = (List<int>)list.Select(i => i*i); //for example ``` And I keep having trouble casting it. What am I missing? Select() will return you an IEnumerable<int> type, you...
[ 0.3294350206851959, -0.3187655508518219, 0.17043326795101166, -0.24502377212047577, 0.09819083660840988, -0.08235324919223785, 0.13377362489700317, -0.3584097623825073, -0.4130537807941437, -0.31598901748657227, 0.23212525248527527, 0.6761468648910522, -0.5584549903869629, 0.44501879811286...
I'm looking for a tool to enforce coding styles, validation check for T-SQL script. And it recommends best-practice when appliable. In .net code domain, the tool for this purpose is FxCop. Is there a counterpart for T-SQL? It will be best it is free or open source tool. Anyone can shed some light? [Power Tools](htt...
[ 0.3275865316390991, -0.16803565621376038, 0.18659608066082, 0.2918219268321991, -0.010793447494506836, -0.10318879038095474, -0.11230232566595078, -0.36009448766708374, -0.12960921227931976, -0.5184199213981628, 0.30043166875839233, 0.6513791084289551, 0.009598301723599434, -0.168822675943...
I'm developing an ecommerce search engine that allows you to search for products in a lot of ecommerce websites. How do I approach the matter? I need an application that will be able to scan websites, parse their HTML and determine which of the images in the website are product images, which are product descriptions,...
[ 0.7119025588035583, 0.149889275431633, 0.3341987729072571, 0.18958894908428192, 0.033324744552373886, -0.08340971171855927, -0.23663188517093658, 0.09235744923353195, -0.2356734722852707, -0.6247324347496033, 0.23110906779766083, 0.36927276849746704, -0.0297988448292017, 0.0671706423163414...
am looking for, and which is not. You may find [this thread](http://groups.google.com/group/DotNetDevelopment/browse_thread/thread/a7198eac90110ee/) helpful in your quest. I had outlined the basic steps there. Here's the link to all questions tagged as "[Screen-scraping](https://stackoverflow.com/questions/tagged/scree...
[ 0.47713515162467957, 0.05342036858201027, 0.48338937759399414, 0.22425875067710876, 0.19478511810302734, -0.13092339038848877, 0.05075003206729889, 0.05547171086072922, -0.2045273631811142, -0.8164055347442627, 0.058340538293123245, 0.4622369706630707, 0.0978059321641922, 0.144082948565483...
Can someone help explain the following: If I type: ``` a=`ls -l` ``` Then the output of the ls command is saved in the variable `a` but if I try: ``` a=`sh ./somefile` ``` The result is outputed to the shell (`stdout`) rather than the variable `a` What I expected was the result operation of the shell trying to...
[ 0.43789175152778625, 0.09827712923288345, -0.0024223660584539175, -0.20865321159362793, -0.06724166125059128, -0.12479464709758759, 0.18064041435718536, 0.303366482257843, -0.15416480600833893, -0.5123371481895447, 0.0005305966478772461, 0.6805535554885864, -0.2388344705104828, 0.090974912...
not, I want the error message "no such file or dir" stored in '`a`' I think because the shell probably attaches itself to /dev/tty but I may be wrong. Why wouldn't you just set execute permissions on the script and use: ``` a=`./somefile` ``` If you want to capture stderr **and** stdout to a, just use: ``` a=`./som...
[ 0.3924621045589447, 0.05999806150794029, 0.13052962720394135, -0.09380070865154266, 0.1502337008714676, -0.0843929648399353, 0.4700397849082947, -0.13653892278671265, -0.05725549906492233, -0.4930269420146942, -0.23087924718856812, 0.7485232353210449, -0.26391303539276123, -0.0148756932467...
2 + 3))`").
[ -0.10897643864154816, 0.3098786771297455, 0.49772244691848755, -0.3415622413158417, -0.2453060746192932, -0.37580186128616333, 0.2678103446960449, -0.7196099162101746, -0.01812608540058136, -0.15530100464820862, -0.5068087577819824, 0.4987238645553589, -0.6473722457885742, 0.19605387747287...
Im looking for a way to delete Windows restore points using C# perhaps by invoking WMI. Any code snippet would be very helpful. Touching on what Morten said you can use that API. WMI doesn't provide a method to delete a Restore Point as far as I can tell. The SRRemoveRestorePoint can remove a restore point, provided y...
[ 0.11384071409702301, -0.01158984936773777, 0.7035920023918152, -0.2723563015460968, -0.05061110854148865, 0.07706646621227264, 0.4649192988872528, -0.32423901557922363, -0.054906852543354034, -0.5964770913124084, -0.17352019250392914, 0.6733978986740112, -0.34061551094055176, 0.46550360321...
threw in 335 since that was the farthest one back as I could find on my system. Its likely that the count starts at 1 and keeps incrementing. so it isn't as simple as just having an index like you would in an array. As for getting the sequence numbers, I converted the code from [Microsoft](http://support.microsoft.com...
[ -0.30236753821372986, 0.10206644982099533, 0.3072156012058258, -0.0009021855075843632, -0.051040638238191605, 0.3869433104991913, 0.21581493318080902, -0.24507541954517365, -0.4274026155471802, -0.4709034264087677, 0.1931518018245697, 0.22250716388225555, -0.10957741737365723, 0.5811262130...
new System.Management.ObjectGetOptions()); System.Management.ManagementObjectCollection objCol = objClass.GetInstances(); StringBuilder Results = new StringBuilder(); foreach (System.Management.ManagementObject objItem in objCol) { Results.AppendLine((string)objItem["descrip...
[ -0.35490745306015015, -0.25789758563041687, 0.9985814690589905, -0.14451484382152557, 0.23883964121341705, 0.19581066071987152, 0.5602551698684692, -0.36257830262184143, -0.37860843539237976, -0.6592378616333008, -0.38938289880752563, 0.5690202116966248, -0.28493696451187134, 0.14138659834...
as Admin, but I think you figured that.
[ 0.41697514057159424, 0.33560365438461304, 0.2146151214838028, -0.15239927172660828, 0.0146386893466115, -0.042420875281095505, -0.06230881065130234, 0.1134028360247612, -0.16988995671272278, -0.0952150970697403, 0.18318964540958405, 0.5049803256988525, 0.3313252627849579, -0.00493166875094...
i'm pretty sure it's not possible, but i'll throw this out there anyways. I have about 10 asp:checkbox controls on the page, and I need to go and update the database every time any of them gets checked/unchecked. Right now i have all of them tied to one event handler that fires on CheckedChanged, then i cast the se...
[ 0.27198928594589233, 0.03881694748997688, 0.6200425028800964, 0.2746729552745819, 0.1128181591629982, 0.02346356213092804, 0.2624830901622772, -0.27433526515960693, -0.26526597142219543, -0.5089482069015503, 0.17482388019561768, 0.29409053921699524, -0.25948232412338257, -0.049148526042699...
their IDs to sproc parameter values. Thank you. **p.s. static Dictionary<> seems to be the way to go, however i can't get examples from [this post](https://stackoverflow.com/questions/313324/declare-a-dictionary-inside-a-static-class) to work in .net 2.0** Why not make your own custom server checkbox control. ``` na...
[ 0.11862032115459442, -0.04831250011920929, 0.4672761559486389, 0.17356164753437042, 0.024514388293027878, 0.059497736394405365, 0.2913797199726105, -0.06218988448381424, -0.2458680421113968, -0.7057700157165527, -0.13323180377483368, 0.5676614046096802, -0.11927060037851334, 0.134131312370...
{ _myValue = value; } } public CustomCheckBox() { } } } <%@ Register TagPrefix="MyControls" Namespace="CustomControls"%> <MyControls:CustomCheckBox id="chkBox" runat="server" MyValue="value"></MyControls:CustomTextBox> ```
[ -0.24830155074596405, -0.11141658574342728, 0.5658221244812012, -0.004082723055034876, 0.1744009107351303, 0.165883868932724, 0.34564119577407837, -0.055051323026418686, -0.05991848558187485, -0.7680922150611877, -0.2648691236972809, 0.45014050602912903, -0.21581046283245087, 0.28694599866...
This question is motivated by something I've lately started to see a bit too often, the `if..else if..else` structure. While it's simple and has its uses, something about it keeps telling me again and again that it could be substituted with something that's more fine-grained, elegant and just generally easier to keep u...
[ 0.36125099658966064, 0.026863008737564087, 0.3470412790775299, -0.2855580747127533, 0.24734660983085632, 0.009326362051069736, -0.008751846849918365, -0.6028777360916138, 0.05321768671274185, -0.6397744417190552, -0.026285575702786446, 0.37658604979515076, -0.2817108631134033, 0.1712933629...
two simple ways to rewrite that, either by ternary (which is just another way of writing the same structure): ``` (i == 1) ? doOne() : (i == 2) ? doTwo() : (i == 3) ? doThree() : doNone(); ``` or using Map (in Java and I think in C# too) or Dictionary or any other K/V structure like this: ``` public interface IFun...
[ -0.032120078802108765, -0.2627638876438141, 0.4066295027732849, -0.34690192341804504, -0.05403487756848335, 0.08618389070034027, 0.11256761103868484, -0.45350396633148193, -0.23413245379924774, -0.6868121027946472, -0.29320812225341797, 0.7860280275344849, -0.6864954233169556, -0.134072661...
new TwoFunctor()); methods.put(3, new ThreeFunctor()); /* .. */ (methods.get(i) != null) ? methods.get(i).call() : doNone(); ``` In fact the Map method above is what I ended up doing last time but now I can't stop thinking that there has to be better alternatives in general for this exact issue. So, which other -and...
[ -0.01758614182472229, -0.45713895559310913, 0.32133692502975464, -0.25246870517730713, -0.31203094124794006, 0.03832146152853966, 0.1327270120382309, -0.13522516191005707, -0.21096588671207428, -0.8316944241523743, 0.07230334728956223, 0.7062984108924866, -0.45240333676338196, -0.126267537...
case 3: doThree(); break; default: doNone(); break; } ``` That only works for values which can be used in switches, which at least in Java is quite a limiting a factor. Acceptable for simple cases though, naturally. The other and perhaps a bit fancier way you seem to sugges is to do it using polymorphism. The Y...
[ 0.40358707308769226, -0.08025156706571579, 0.12052668631076813, -0.23493331670761108, 0.15351614356040955, -0.40503719449043274, 0.4460411071777344, -0.2965678870677948, -0.11467096954584122, -0.497864305973053, -0.12586230039596558, 0.6008731126785278, -0.5597445964813232, 0.0628080144524...
class OneDoer implements Doer { public void do() { doOne(); } } /* etc. */ /* some method of dependency injection like Factory: */ public class DoerFactory() { public static Doer getDoer(int i) { switch (i) { case 1: return new OneDoer(); case 2: return new TwoDoer()...
[ 0.46556714177131653, -0.6630612015724182, -0.0417228564620018, -0.22477677464485168, -0.024729905650019646, -0.062113262712955475, 0.010600963607430458, -0.3253037929534912, -0.02378302998840809, -0.4615424871444702, -0.24672295153141022, 0.6197109222412109, -0.7955028414726257, 0.08361943...
3: return new ThreeDoer(); default: return new NoneDoer(); } } } /* in actual code */ Doer operation = DoerFactory.getDoer(i); operation.do(); ``` Two interesting points from the Google talk: * Use Null Objects instead of returning nulls (and please throw only Runtime Exceptions) * Try to w...
[ 0.37547504901885986, 0.15866373479366302, 0.08473231643438339, 0.2002609223127365, -0.3166365921497345, -0.4580669403076172, 0.6629473567008972, -0.06689474731683731, -0.1054219901561737, -0.5958200097084045, 0.012210505083203316, 0.6086269021034241, -0.3517160713672638, 0.1455982625484466...
answers (so far), I think I might have learned something today! These constructs can often be replaced by polymorphism. This will give you shorter and less brittle code.
[ 0.44592195749282837, 0.1952856481075287, -0.2733229100704193, 0.6246358156204224, 0.025812383741140366, -0.14909227192401886, 0.4690472483634949, 0.13256551325321198, -0.19069470465183258, -0.49113214015960693, 0.09856817871332169, 0.4230462908744812, -0.1138068437576294, 0.113912872970104...
Any idea regarding the usual storage capacity of a magnetic swipe card ( like the ones that are used in ATM's ) ? (PS : Tried googling but didn't get anything satisfactory and point on) From <http://en.wikipedia.org/wiki/Magnetic_stripe>, it appears that the card is composed of three tracks (as previously mentioned b...
[ 0.216253399848938, -0.3559277653694153, 0.609770655632019, 0.4669037163257599, 0.12385085225105286, 0.24901680648326874, -0.42372649908065796, -0.19091792404651642, -0.44366225600242615, -0.33188796043395996, -0.035993799567222595, 0.2561686933040619, 0.04683484882116318, -0.00801009591668...
2.
[ -0.36183419823646545, 0.09747365117073059, -0.038743410259485245, 0.009815368801355362, 0.041720494627952576, 0.13243257999420166, -0.005676879547536373, -0.36344286799430847, 0.06539127230644226, -0.5338919758796692, -0.5487653613090515, 0.12780068814754486, 0.02807634323835373, -0.129056...
I'm building a portal that will allow users to upload files. I need to make sure that these files do not contain viruses. My ideal solution would be to have the host OS AV keep a watch on temporary folders and scan any incoming files. When a file is uploaded in ASP.Net 2, does it get written to disk in a temp folder, ...
[ 0.3599431812763214, 0.09308397769927979, 0.2489883303642273, 0.12165046483278275, 0.035256993025541306, -0.33047130703926086, 0.20338718593120575, 0.1762186586856842, -0.5896856784820557, -0.9622035622596741, -0.06213068962097168, 0.4628698527812958, -0.21969790756702423, 0.332768559455871...
an "Incoming" folder that has been given the necessary permissions for ASP.NET to save files. I have never encountered a situation where files remain locked even after you call `SaveAs` on the FileUpload control. Note that the FileUpload control does not upload the file until you call `SaveAs` and this is when the fil...
[ 0.19833172857761383, -0.04308394715189934, 0.6284662485122681, 0.058851756155490875, 0.07116203755140305, -0.25343215465545654, 0.3648521602153778, 0.17955318093299866, -0.3557317852973938, -0.701043426990509, -0.33294469118118286, 0.6187286376953125, -0.07123982161283493, 0.01604550145566...
give relevant feedback to the user.
[ 0.37705814838409424, 0.6107301712036133, -0.11918403208255768, 0.06621690839529037, -0.33564773201942444, -0.5192856192588806, 0.3163856863975525, 0.5450865030288696, 0.34475094079971313, -0.3952426016330719, -0.726737380027771, 0.16192904114723206, 0.28447049856185913, -0.0550206862390041...
I'm trying to generate a new button item when I click on a button generator. It is able to generate but it will only show up on the screen after I relaunch the application. But I want it to be generated instantly and show up in the current view. Any suggestions? I know it's related to the `viewDidLoad` function. Anyway...
[ 0.46925088763237, -0.2603157162666321, 0.7020789980888367, -0.13536792993545532, -0.06752406060695648, 0.13417935371398926, -0.05320494994521141, -0.3114912807941437, -0.32536038756370544, -0.6832622289657593, 0.14651420712471008, 0.6099545359611511, -0.47422268986701965, 0.174991860985755...
a subview of a current showing view. In this case I am adding it to the main root level view for this view controller.
[ 0.12880681455135345, -0.38992583751678467, 0.8386897444725037, 0.07435937225818634, -0.2147456854581833, -0.08111818134784698, -0.0716555118560791, 0.2191295325756073, -0.13433612883090973, -0.5036740303039551, 0.009137020446360111, 0.3990327715873718, -0.07569189369678497, 0.4177032411098...
I have a method that varies by a single method call inside, and I'd like to pass the method/signature of the method that it varies by as an argument... is this possible in Objective C or is that too much to hope for? NSInvocation is a class for wrapping up a method calls in an object. You can set a selector (method sig...
[ 0.23503723740577698, -0.3363323211669922, -0.205205500125885, 0.017696421593427658, -0.18233191967010498, -0.2767583727836609, 0.043886054307222366, -0.04973981902003288, -0.12193728238344193, -0.3682565689086914, 0.1479215919971466, 0.6363336443901062, -0.4023536741733551, 0.0085338791832...
it works a little like this: ``` NSInvocation *inv = [[NSInvocation alloc] init]; [inv setSelector:@selector(foo:bar:)]; [inv setArgument:123 atIndex:0]; [inv setArgument:456 atIndex:1]; for (MyClass *myObj in myObjects) { [inv invokeWithTarget:myObj]; } ``` Or if you dont want to pass invocation objects into thi...
[ -0.04087010398507118, -0.02696756273508072, 0.24427424371242523, -0.2587638199329376, -0.1074938252568245, -0.20089277625083923, 0.2578452229499817, -0.26716992259025574, 0.09219884872436523, -0.5229639410972595, -0.10328571498394012, 0.3741095960140228, -0.26613810658454895, 0.21893280744...
I have admin access to a Windows 2003 server. The trust level is set to medium trust with allowOverride=false. I was wondering if there's a way to add an exception in the configuration files so that one site can run in full trust. By using the location tag? What if the AppPool has an identity in the admin group or th...
[ 0.006764459889382124, 0.338037371635437, 0.4788464307785034, 0.06892634928226471, -0.12919975817203522, -0.33943450450897217, 0.38422948122024536, -0.16594231128692627, 0.0019971695728600025, -0.415823370218277, 0.017142530530691147, 0.7747684121131897, -0.34008604288101196, 0.104072041809...
added in the machine.config file.
[ 0.21654078364372253, -0.014166787266731262, 0.3298499882221222, 0.09906378388404846, 0.19843922555446625, 0.0909087210893631, -0.12656541168689728, 0.12154340744018555, -0.16667670011520386, -0.5924584865570068, -0.034932997077703476, 0.36774417757987976, -0.13687275350093842, 0.1352809518...
As I understand it, a mock object created with RhinoMocks enter the recording state directly when it is created, and then you call Replay() to enter the replay state. I would like to manually decide when the mock object starts recording, or be able to pause the recording. Would that be possible in RhinoMocks? Thanks /...
[ 0.49015870690345764, 0.37317684292793274, 0.14542745053768158, 0.09596920758485794, -0.2809063494205475, 0.27600228786468506, 0.5134770274162292, -0.2735859751701355, -0.34209784865379333, -0.38836032152175903, 0.2645544111728668, 0.9011085033416748, -0.0403883159160614, -0.001087584882043...
mock. Use the mockRepository.BackToRecord(mock,option) method to put the mock back in record mode. Use the BackToRecordOptions.None option to prevent the clearing of any expectations you have already set.
[ 0.3412223160266876, 0.14609448611736298, 0.20509760081768036, 0.2912956178188324, 0.13530033826828003, 0.13963139057159424, 0.4452608525753021, 0.019150419160723686, -0.2729225754737854, -0.6341965198516846, -0.10972242802381516, 0.89763343334198, -0.14482858777046204, -0.16550202667713165...
I need to maintain a legacy VB.NET web application. Data typing is, I would say, inconsistent. Especially, there are data that is stored sometimes as integers and sometimes as strings, and I have to parse strings to integers reliably. If parsing goes wrong it should always return 0. The problem is, I can't use any of ...
[ 0.07206186652183533, 0.42869845032691956, -0.036336515098810196, 0.025272704660892487, -0.1522703766822815, -0.07441732287406921, 0.3047342896461487, -0.10437607020139694, -0.314628005027771, -0.48959770798683167, 0.1927131712436676, 0.5307239294052124, -0.2187955379486084, 0.1474929749965...
or contain something else. I have tried these with an **empty input string ""**: ``` CType(string, Integer) -> Conversion from string "" to type 'Integer' is not valid. Convert.ToInt32(string) -> Input string was not in a correct format. Integer.Parse(string) -> Input string was not in a correct format. CInt(string) ...
[ 0.0044874208979308605, -0.07553739100694656, 0.33591756224632263, -0.21483378112316132, -0.2040143460035324, 0.17154207825660706, 0.3526075780391693, -0.5640594363212585, -0.09974454343318939, -0.5186983942985535, -0.288628488779068, 0.8071553111076355, -0.3595293164253235, 0.2279637604951...
Integer Try i = Val(s) Catch ex As Exception i = 0 End Try Return i End Function ``` I think this sucks. This is bad because: * I'm trying to parse strings to integers! This is not rocket science, even if semantics are involved * Self-made standards do n...
[ 0.2565792500972748, 0.1644406020641327, 0.1454477310180664, 0.03250284865498543, -0.14974276721477509, -0.4058917164802551, 0.6864967346191406, -0.036893460899591446, -0.06385751813650131, -0.14416970312595367, -0.1305793970823288, 0.4836869537830353, -0.3554767668247223, -0.03619243577122...
very well. Somewhere in the code you will always find broken standard framework solutions As a result there are unnecessary bugs in the software. And I accuse the standard framework for this. Unless, of course a better solution is found :) --- Thanks for all the answers. Int32.TryParse is perfect here. But if you ...
[ 0.0345466285943985, 0.1137980967760086, 0.11115173250436783, -0.018249714747071266, -0.10881892591714859, -0.1624508798122406, 0.5913902521133423, -0.2325243502855301, 0.05655428767204285, -0.6943234205245972, -0.1698668748140335, 0.6645711064338684, -0.24195778369903564, -0.19628392159938...
I found that after setting the ``` [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO] ``` at `viewDidLoad`, then if I want to align an image to the top, I will need to set its position as .y = -20; Is there anyway to make the y coordinate of the *top position* to *0* ? or is it doomed to be -20 ...
[ -0.1308424174785614, -0.17800535261631012, 0.8672811985015869, -0.028163762763142586, 0.15428362786769867, -0.04886538162827492, -0.0031413547694683075, -0.256287157535553, -0.33202147483825684, -0.6659173369407654, -0.1209527850151062, 0.5892705917358398, -0.013810193166136742, -0.0696964...
I'm curious whether many of us who do design or take design decisions have ever heard of this problem. I'm aware there are dangerous color combinations, like green + red. This is probably one of the most popular cases of color blindness. If you have green text on a red background and vice versa some people won't see a...
[ 0.38692405819892883, 0.07317902147769928, -0.3393169045448303, 0.18026016652584076, 0.10264003276824951, -0.3201400637626648, 0.21668227016925812, 0.3438810408115387, -0.48796525597572327, -0.6076051592826843, -0.008033913560211658, 0.67558354139328, -0.4202654957771301, -0.085177473723888...
numbers. Addition: I've just remembered one very bad example that causes problems to just about everyone - blue text on a black background. It's unreadable for all intents and purposes. Never could understand what could possibly compel a web master to use this color combination... I think it must be pretty common, and...
[ 0.412800133228302, 0.2714473009109497, -0.03683144971728325, 0.044778238981962204, 0.3309001624584198, 0.2286476492881775, 0.3725660443305969, 0.4817391037940979, -0.4354707598686218, -0.4447522759437561, -0.36955422163009644, 0.3017442226409912, -0.3122919499874115, 0.16753610968589783, ...
use the windows "High Contrast" colour scheme to get any work done. A good test is to run your app in the various high contrast schemes. If you haven't done it I can pretty much guarantee it will be unreadable. You need to be able to handle schemes like this for better accessibility.
[ 0.4138656258583069, 0.0744834691286087, 0.24235856533050537, 0.09524740278720856, 0.12250317633152008, -0.2620936334133148, 0.4448546767234802, 0.0950387492775917, -0.2229355275630951, -0.7253572344779968, -0.10492062568664551, 0.749215304851532, -0.024755189195275307, -0.11596126109361649...
I have 4 small tiff images and I would like to generate a big one by merging the 4 single one. Does anyone know how to do it directly with Delphi or some good component that could do it? [ImageMagick](http://www.imagemagick.org/script/index.php) is a command line application that can do such kind of operations on diffe...
[ 0.4721451997756958, -0.12441049516201019, 0.29546698927879333, -0.08562357723712921, -0.10608217120170593, 0.13766150176525116, -0.03079596906900406, 0.08108717948198318, -0.34211304783821106, -0.5103148221969604, 0.14165708422660828, 0.7529005408287048, -0.43546026945114136, -0.1779152899...
I embed a youtube video in my air application. It loaded and played well, but I cannot play more than one video at the time, only one video is played at the time, do you know why? The code is: ``` url:String = "http://in.youtube.com/v/fVGk5qm6Mac&hl=en&fs=1"; //texturl.text=url; swfloader....
[ 0.4442816972732544, 0.24473156034946442, 0.7368066906929016, -0.054999008774757385, -0.06332109868526459, -0.10206723213195801, -0.02658367156982422, -0.21675044298171997, 0.032162461429834366, -0.5088613033294678, 0.07797220349311829, 0.6635498404502869, -0.6119576096534729, -0.0874241292...
I'm writing a Swing application, and further to [my previous question](https://stackoverflow.com/questions/496233/what-are-your-best-swing-design-patterns-and-tips), have settled on using the [Model-View-Presenter](http://en.wikipedia.org/wiki/Model_View_Presenter) pattern to separate the user interface from the busine...
[ 0.38590580224990845, 0.24076756834983826, 0.8844565749168396, -0.3920913636684418, -0.1120658814907074, -0.05789030343294144, 0.11996648460626602, -0.6313881278038025, -0.16649143397808075, -0.4045039713382721, -0.2269076704978943, 0.456962525844574, -0.24431422352790833, -0.18514782190322...
the Swing view to spawn a new `JDialog` window. One line of thinking makes me feel this might be appropriate code in the orignal `Presenter`: ``` public void handlePreferences() { Preferences prefs = view.getPreferences(); model.setPreferences(prefs); } ``` That is, the contents of each `JDialog` should rep...
[ 0.3068961799144745, -0.03218710795044899, 0.5967893600463867, -0.09563104808330536, -0.267179399728775, -0.19678270816802979, -0.10616825520992279, -0.32080918550491333, -0.23952917754650116, -0.5526086091995239, -0.027921553701162338, 0.7177603840827942, -0.3837457597255707, 0.03123364783...
original `View` forces me to do a lot of work that would be harder to port if I wanted to change the UI to use JSF, for example. Please feel free to add comments for clarification. Although it is not uncommon to have "nested" design patterns it is not necessary in your case. Drawing on the other answers: **Model** ...
[ 0.11046484857797623, -0.24828855693340302, 0.5050176978111267, 0.07517049461603165, -0.22524100542068481, 0.07735985517501831, -0.07598020136356354, -0.18104438483715057, -0.227298304438591, -0.5927029848098755, 0.027512865141034126, 0.532139778137207, -0.5104929208755493, -0.1431861668825...
application, just output and input  - it can only work on its self, on its state  - it maintains local variables and objects, eg. it has JButtons, JMenus, int counters ...  - it is knows how to inform the Presenter of State Change  - its state is visible to the Presenter, or revealed by method call  - re...
[ -0.04302142933011055, -0.11265597492456436, 0.5871837735176086, 0.14723770320415497, 0.04315319284796715, 0.028366412967443466, 0.21124015748500824, -0.3299223780632019, -0.1629101186990738, -0.5844025611877441, -0.2354755699634552, 0.43768155574798584, -0.2780753970146179, -0.138794839382...
deciding, it tells the other objects what to do (not how to do it)  - knows when preferences are needed  - knows where to get new preferences and where to put them  - has method newPrefsAvailable(); > ... to obtain further information from the user. In the case of these events, I believe it is appropriate f...
[ 0.3781927227973938, -0.3507504463195801, 0.7166467905044556, -0.19396987557411194, -0.12527480721473694, 0.013522353023290634, -0.04333048313856125, -0.37309110164642334, -0.2638474702835083, -0.6769407391548157, -0.054472699761390686, 0.3551270067691803, -0.2828120291233063, -0.2264421135...
stored in the view as a state change View - this.myPresenter.newPrefsAvailable(); Presenter - responds with this.myModel.setPreferences (this.myView.getPrefState()); Model.setPreferences - changes the stored values to View.getPrefState() Presenter - checks the Model - determines preferences are good Pre...
[ -0.0695444867014885, -0.18715134263038635, 0.655924379825592, -0.17591561377048492, -0.20569778978824615, 0.38454288244247437, 0.06371752917766571, -0.09451752156019211, -0.2294837236404419, -0.8058062791824341, -0.4661606252193451, 0.4721193313598633, -0.21947787702083588, 0.1314202696084...
Is there a way to use the same session on different user-agents. I have a flash app that is generating a new session id on posting data to myHandler.ashx ( same happens on aspx ). Am i missing a trick here? You'll need to use VBA to do this, but it's pretty straight-forward. There's an [MS knowledge base article](http...
[ 0.6551022529602051, -0.16314202547073364, -0.0019738986156880856, 0.27144721150398254, -0.12845821678638458, -0.31624162197113037, 0.5643694996833801, 0.16396136581897736, -0.36364954710006714, -0.4688533842563629, 0.23302359879016876, 0.45405101776123047, 0.04765634983778, -0.101049065589...
I have a 'complex item' that is in XML, Then a 'workitem' (in xml) that contains lots of other info, and i would like this to contain a string that contains the complex item in xml. for example: ``` <inouts name="ClaimType" type="complex" value="<xml string here>"/> ``` However, trying SAX and other java parsers I ...
[ 0.35061880946159363, 0.15925772488117218, 0.20573243498802185, -0.09376449137926102, 0.029620517045259476, -0.16976778209209442, 0.13517670333385468, -0.08854976296424866, -0.007870710454881191, -0.6723125576972961, 0.010194264352321625, 0.7148196697235107, -0.17635996639728546, 0.08932271...
dealing with won't parse with a lot of parsers since it's invalid. If you have control over the XML, you'll at a bare minimum need to escape the attribute so it's something like: ``` <inouts name="ClaimType" type="complex" value="&lt;xml string here&gt;" /> ``` Then, once you've extracted the attribute you can possi...
[ 0.4452292025089264, 0.1204523891210556, 0.29398033022880554, -0.20329368114471436, -0.060246311128139496, -0.47629514336586, 0.14887650310993195, -0.24933569133281708, -0.07967358082532883, -0.9517331123352051, -0.32392993569374084, 0.778359055519104, -0.4035927951335907, 0.075463242828845...
I have no idea how it'd go with non-HTML content) (The tag soup site actually appears down ATM, but you should be able to find enough doco on the web, and downloads via the [maven repository](http://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/))
[ 0.39275553822517395, 0.036242078989744186, 0.38651731610298157, 0.06016235798597336, 0.0664961189031601, 0.06283022463321686, 0.312290221452713, -0.05623646080493927, -0.572185218334198, -0.49494993686676025, 0.11095650494098663, 0.3944278657436371, -0.06918824464082718, -0.106933690607547...
I have a list of objects and I would like to access the objects in a random order continuously. I was wondering if there was a way of ensuring that the random value were not always similar. Example. My list is a list of Queues, and I am trying to interleave the values to produce a real-world scenario for testing. I...
[ 0.6022403240203857, 0.001855266629718244, 0.12071274220943451, 0.3844318389892578, -0.013617102056741714, 0.061677999794483185, 0.11294759064912796, 0.3089698851108551, -0.4397754669189453, -0.6064136624336243, 0.2537279427051544, 0.3630112111568451, -0.28653252124786377, 0.381876647472381...
webservice. Files need to be in a certain order hence the Queues. So I have Queue1 = "set1\_1.xml", set1\_2.xml", ... "set1\_n.xml" Queue2 ... ... QueueN While each file needs to be transmitted in order in terms of the other files in its queue, I would like to simulate a real world simulation where files would be re...
[ 0.20140160620212555, -0.24696387350559235, 0.386386901140213, 0.1759573370218277, -0.08159786462783813, -0.12571024894714355, -0.08095648884773254, 0.04976193606853485, -0.4920751750469208, -0.9983091950416565, 0.0220634825527668, 0.11716891825199127, -0.321618914604187, 0.3338156044483185...
more uniformity rather than having 50 files from Queue 1 and 2 and then 5 files from Queue 3. I do realise though that altering the randomness no longer makes it random. Thank you for all your answers. Well, it isn't entire clear what the scenario is, but the thing with random is *you never can tell ;-p*. Anything yo...
[ 0.19179925322532654, -0.8907164931297302, 0.1813204139471054, 0.248452290892601, -0.09762834012508392, -0.15379668772220612, 0.04696839302778244, -0.0911821499466896, -0.5645948052406311, -0.9550853371620178, 0.15722279250621796, 0.3843330144882202, -0.2928948700428009, 0.2403775155544281,...
while (remaining > 0) { int index = rand.Next(remaining); foreach (Queue<T> q in queues) { if (index < q.Count) { yield return q.Dequeue(); remaining--;
[ -0.18459835648536682, -0.4750613868236542, 0.33366456627845764, -0.1597946137189865, 0.2965088188648224, 0.3838631808757782, 0.1994420737028122, -0.32836827635765076, -0.17706932127475739, -0.3586907386779785, -0.23280350863933563, 0.27976179122924805, -0.05150165408849716, 0.4226911067962...