text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
From a strictly implementation and computer science point of view how would you classify the Php array datastructure? Is it an associative array? a hash? a dictionary? ... ? From the [PHP manual](http://uk3.php.net/manual/en/language.types.array.php): > An array in PHP is actually an ordered > map. A map is a type th...
[ -0.16192086040973663, -0.05032975971698761, 0.21524208784103394, 0.283210426568985, -0.3536454141139984, -0.10321851819753647, -0.03329109400510788, -0.45482876896858215, -0.33084988594055176, -0.6754716634750366, -0.0767650380730629, 0.13459795713424683, -0.4658550024032593, -0.0761816576...
I am new to Swing. I am trying to develop an application using Swing. I have managed to create the first page of my application. Now what I want to do is to traverse to a new page, using the next button. But am not able to find a way to do it using Swing. Also, if I click the previous button, would I be able to get the...
[ 0.5648438334465027, 0.19025491178035736, 0.3734342157840729, 0.05037369579076767, -0.22028328478336334, -0.2601858973503113, 0.1358935683965683, -0.46278730034828186, -0.37667983770370483, -0.6793590784072876, 0.31051790714263916, 0.3984896242618561, -0.05693209916353226, 0.003223676467314...
this to be achieved using Swing. Please do help. Thanks a lot. This one is old but might just get you started: <http://java.sun.com/developer/technicalArticles/GUI/swing/wizard/>
[ 0.43227890133857727, -0.0768033042550087, 0.09146212041378021, 0.10195641964673996, -0.02960025705397129, -0.5999919772148132, 0.21947962045669556, -0.3589521646499634, -0.3345023989677429, -0.57243412733078, 0.23781557381153107, 0.2596854865550995, 0.13982084393501282, -0.368149995803833,...
Is it possible to know whether a Java class has been loaded, *without* attempting to load it? `Class.forName` attempts to load the class, but I don't want this side effect. Is there another way? (I don't want to override the class loader. I'm looking for a relatively simple method.) (Thanks to Aleksi) This code: ``` ...
[ 0.16084900498390198, -0.03473827615380287, -0.19516198337078094, -0.12470737844705582, -0.014510735869407654, -0.1895427107810974, 0.5535832047462463, -0.3546822965145111, -0.12484875321388245, -0.3337206244468689, -0.09074654430150986, 0.5656640529632568, -0.45499175786972046, -0.01061147...
ClassLoader cl = ClassLoader.getSystemClassLoader(); Object test1 = m.invoke(cl, "TestLoaded$ClassToTest"); System.out.println(test1 != null); ClassToTest.reportLoaded(); Object test2 = m.invoke(cl, "TestLoaded$ClassToTest"); System.out.println(test2 != null); } ...
[ -0.19512417912483215, -0.4074302315711975, 0.22004052996635437, -0.18128791451454163, -0.04692472144961357, 0.009661278687417507, 0.35756978392601013, -0.31020402908325195, -0.002806984819471836, -0.24493049085140228, -0.4785277545452118, 0.820929765701294, -0.4391312897205353, 0.120396792...
System.out.println("Loading " + ClassToTest.class.getName()); } static void reportLoaded() { System.out.println("Loaded"); } } } ``` Produces: > ``` > false > Loading TestLoaded$ClassToTest > Loaded > true > > ``` Note that the example classes are not in a package....
[ 0.031409427523612976, 0.04018504545092583, 0.130870059132576, -0.3786042630672455, -0.03979498893022537, -0.09626137465238571, 0.2555888891220093, -0.3457280397415161, -0.20634567737579346, -0.4915277361869812, -0.4630240797996521, 0.4684557020664215, -0.39506256580352783, 0.20110149681568...
Most references I've seen, and my IDE's code completion all have my specifying a Generic type on both a variables type and its implementation eg. ``` List<String> string = new ArrayList<String>(); ``` Recently I've started skipping the generic type on the implementation eg. ``` List<String> strings = new ArrayList(...
[ 0.30828920006752014, 0.34045571088790894, 0.21926620602607727, -0.011679020710289478, -0.34847208857536316, -0.0957474336028099, 0.606907844543457, -0.2334829568862915, -0.3699406385421753, -0.4580621123313904, 0.33914679288864136, 0.6336202025413513, -0.594143271446228, 0.2924242615699768...
the generic type on the implementation? It's required as it won't necessarily be the same: ``` List<? extends Number> numbers = new ArrayList<Integer>(); ``` One way of avoiding it for common cases is to have static utility methods, and let the compiler's type inference do the rest: ``` class CollectionUtilities {...
[ -0.04121572896838188, -0.2303982973098755, 0.14589697122573853, 0.06593151390552521, -0.2647603154182434, -0.2003260850906372, 0.28867173194885254, -0.4220525920391083, -0.28361213207244873, -0.2751327157020569, -0.16528992354869843, 0.5936346054077148, -0.6650859117507935, 0.0980435386300...
to specify generic type on both the variable's type and the implementation.)
[ 0.07107258588075638, -0.17080895602703094, 0.19265183806419373, 0.07326171547174454, 0.010426957160234451, 0.09876949340105057, 0.3519732356071472, -0.3976539075374603, 0.04276333004236221, 0.05234932899475098, -0.09836235642433167, 0.6026736497879028, -0.5763225555419922, 0.07439089566469...
I want to capture the errors from a script into a file instead of to the screen. In \*nix, this is done with stderr redirection, usually ``` echo "Error" 2> errorfile.log ``` How do I do it in a CMD script under Windows? For example: ``` PSKILL NOTEPAD >output.txt 2>&1 ``` This will direct stdout and stderr to a...
[ 0.4498661458492279, 0.2098175436258316, 0.306839257478714, -0.25044211745262146, 0.15016992390155792, -0.026509547606110573, 0.43803465366363525, -0.1266511231660843, -0.15251225233078003, -0.7630566358566284, 0.04587337374687195, 0.6697016954421997, -0.07984665781259537, -0.02739684656262...
Anyone know of a Linux/D-Bus sort of mechanism for Windows? Thanks Choose your poison: <http://msdn.microsoft.com/en-us/library/aa365574%28VS.85%29.aspx> > The following IPC mechanisms are > supported by Windows: > > > * Clipboard > * COM > * Data Copy > * DDE > * File Mapping > * Mailslots > * Pipes > * RPC > * ...
[ 0.23341253399848938, -0.06973349303007126, 0.4097185730934143, 0.20498497784137726, -0.27212679386138916, 0.04490372911095619, 0.20558574795722961, 0.030807947739958763, -0.15194684267044067, -1.0304235219955444, 0.14582152664661407, 0.23098905384540558, -0.26777952909469604, 0.26127907633...
I overloaded the 6 signals listed on this site <http://www.cplusplus.com/reference/clibrary/csignal/signal.html> Then i ran my app (double click not ran through IDE) and tried 1) end task 2) X on topright and 3) kill process. I expected the first two to cause some kind of signal (i am on XP) but alas i got nothing. Am...
[ 0.13759411871433258, 0.20565155148506165, 0.8435022830963135, 0.03855530172586441, -0.23028910160064697, 0.05740815028548241, 0.5586479902267456, -0.3095568120479584, -0.4727650582790375, -0.46593403816223145, 0.019130254164338112, 0.4744081497192383, -0.3685007691383362, 0.120799265801906...
it do that on a signal/crash? my main question is what signal can i use to catch kill process Win32 does not provide an option to intercept your program being killed with `TerminateProcess` (which is what will happen when you "End Task" from Task Manager or click on the [X]). You can catch the SIGSEGV signal because ...
[ 0.1811133623123169, -0.2624134421348572, 0.06652746349573135, 0.07521940022706985, -0.13284802436828613, -0.2894662022590637, 0.24099689722061157, 0.026566021144390106, -0.3464471697807312, -0.29222744703292847, -0.029316719621419907, 0.5058554410934448, -0.4352085292339325, 0.167769208550...
best way to handle such an exception. If you are writing a Win32 program, you shouldn't generally try to use Unix style services.
[ -0.0060762385837733746, 0.06548159569501877, -0.12495925277471542, 0.23555678129196167, 0.02480069175362587, -0.5971841216087341, 0.18135429918766022, 0.5326910614967346, -0.20377548038959503, -0.6076109409332275, -0.19696134328842163, 0.6276199221611023, -0.09318862110376358, 0.0972164049...
i have a function like ``` void printMe (void *i) { printf("%d", i); } ``` where i want to pass a void pointer and print it to screen. The above example is fine if the i is integer, float or double but crashes if i is a char. There is no overloading in C like i usually use in C++. So the question is this, can we...
[ 0.04644080623984337, 0.03733181953430176, 0.1860048770904541, -0.05845453217625618, -0.15406803786754608, -0.025818340480327606, 0.18500231206417084, -0.09767991304397583, 0.07353255152702332, -0.8787786960601807, 0.05321246013045311, 0.5542586445808411, -0.40314507484436035, 0.04490641131...
function in C that will print the element that is it's parameter* A: Not in the way you want. You will have to pass information to the function, telling it the type of data you're passing. Q2: *and if yes how is this possible because it totally eludes me at this moment.* A: It's eluding you because it can't be done....
[ -0.04781492426991463, -0.10828892886638641, 0.16494518518447876, -0.055248189717531204, -0.16123519837856293, -0.22219786047935486, 0.18414150178432465, -0.11883021146059036, 0.08164028078317642, -0.4348534941673279, -0.33317577838897705, 0.46451127529144287, -0.5487580299377441, -0.164989...
points to (e.g. an enum). 2. pass an extra parameter with information about what the pointer points to As the code stands the only thing you can print here is the address that i points to. A void pointer points to raw data, printf assumes you know what data type you're printing, it has no intelligence and cannot "fig...
[ 0.0018250957364216447, 0.13607865571975708, 0.44647812843322754, 0.05990569666028023, -0.3512845039367676, 0.0514199361205101, -0.21523720026016235, -0.17043793201446533, 0.12817789614200592, -0.7095865607261658, 0.18025629222393036, 0.23891837894916534, -0.484757661819458, 0.0770511478185...
. . "*There is no overloading in C like i usually use in C++*" Even in c++ the overloading happens at compile time, and here there's no way for the compiler to know what data will be passed to that function, so even though you're used to overloading, it would never work like this (e.g. try this same thing using printf...
[ -0.040799520909786224, 0.226892352104187, 0.17431014776229858, -0.09641865640878677, 0.009998772293329239, -0.32103314995765686, 0.3322705030441284, -0.08626383543014526, -0.04830485209822655, -0.6326936483383179, -0.2722923159599304, 0.3738017678260803, -0.4204866588115692, 0.158857583999...
derference it before you could get it's value ``` cout << *(int*)i; ``` So, to get the above working in C++ you'd need to have lots of overloaded functions (or a template function, which is really the same thing, except the compiler rolls the functions for you) e.g. overloaded functions ``` printMe(int i){...} prin...
[ 0.025208620354533195, 0.041541945189237595, 0.2124437838792801, -0.2507532835006714, -0.1473521739244461, -0.11702543497085571, 0.0845702737569809, -0.35923659801483154, 0.20338068902492523, -0.5938344597816467, -0.13967953622341156, 0.9548450112342834, -0.28317296504974365, -0.02457173541...
**Clarification**: Thanks for the suggestions of tools for validating XHTML. I'm primarily looking for a solution that will run server side (or on the client with jQuery) so i can set it and forget it during development - and get told when I have issues without having to run a tool all the time. --- All this [tag so...
[ 0.4251023232936859, -0.1341901421546936, 0.3440704941749573, 0.016106190159916878, -0.21573305130004883, -0.29280927777290344, 0.4908595383167267, -0.015062898397445679, -0.4278238117694855, -0.33397239446640015, 0.01127187255769968, 0.5217409729957581, -0.23040646314620972, 0.084282837808...
dont want to spend hours debugging something just to find out I had an unclosed tag somewhere that prevented a selector from working. What options are there for this. Off the top of my head I'm looking for solutions like the following, but not sure which of these are practical: * JQuery XHTML checker * IIS filter * B...
[ 0.5410653948783875, 0.1712218075990677, 0.37154316902160645, -0.21818247437477112, -0.12497767806053162, -0.12271396815776825, 0.6062973737716675, 0.039538804441690445, -0.29067766666412354, -0.7264298796653748, 0.0754084438085556, 0.516801655292511, -0.3582550883293152, -0.243535950779914...
not XHTML. * ASP.NET configuration option I'm not aware of to validate the page. All options welcome answers ! I'd prefer a server side technology so during debugging I can throw a hard exception, and in production I can log any errors. It must validate the full page after the master page has been applied. Looking fo...
[ 0.49433568120002747, 0.2548849284648895, 0.504249095916748, 0.06684563308954239, -0.22095057368278503, -0.4028443396091461, 0.43243300914764404, -0.13900861144065857, -0.2766680121421814, -0.43720129132270813, -0.45889315009117126, 0.39134088158607483, -0.4174937307834625, -0.0445987433195...
To include another file in JSP, we use the @include tag *<%@ include file="NameOfFile"%>* In my case i want to include a html file whose name will known during the run-time - i,e from Database. How can I do this in JSP? simply using jsp:include : ``` <jsp:include page="<%= htmlFileName %>" /> ``` It works in my...
[ 0.28802862763404846, 0.10526438802480698, 0.16143490374088287, -0.09730212390422821, -0.21639437973499298, -0.42717334628105164, 0.33589547872543335, -0.1547766625881195, -0.12034173309803009, -0.6811048984527588, -0.1367611587047577, 0.6044217944145203, -0.2937893271446228, -0.27115574479...
I have been finding myself using the [Chain of Responsibility](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) pattern often (3 times is often for me) in my current project and I'm wondering if I have become a little over-enthusiastic about the solution. Specifically, I have been using the Apache Commons ...
[ 0.34822773933410645, 0.19260843098163605, 0.08160252124071121, -0.10865405946969986, -0.1917819082736969, -0.05130945146083832, 0.18572404980659485, -0.14348874986171722, -0.565184473991394, -0.43664389848709106, -0.05913272872567177, 0.4368133246898651, -0.3328041136264801, 0.116308271884...
in its implementation? So far, the only problem I have noticed that it is when you are trying to deal with objects that need to be closed. Having those objects stored in your Context class makes for a pain when you have completed the execution of your chain. I was able to work around this using Filters instead of Comm...
[ 0.16403889656066895, -0.1956922560930252, 0.011883742175996304, 0.033588919788599014, -0.23207391798496246, -0.13119012117385864, 0.5401834845542908, 0.021102504804730415, -0.2607460916042328, -0.32073062658309937, 0.06435868889093399, 0.33780843019485474, -0.2196108102798462, 0.0519156344...
advance. I'm tempted to say it works well for an *unspecific* problem (e.g. framework code) but works less well for *specific* problems. Frameworks are written for other people to use, and you want to give the client total freedom of implementation. Once you know exactly what you are going to do to solve the problem, I...
[ 0.3570728600025177, -0.13374130427837372, 0.06692604720592499, 0.24752597510814667, -0.028207434341311455, -0.11434350907802582, 0.17087362706661224, -0.36079591512680054, 0.009561656974256039, -0.7578299045562744, 0.11499029397964478, 0.8769435286521912, -0.10736218839883804, -0.264685332...
and processing objects really just hide the logic of your application behind a processing chain instead of putting it right up front where your most important code is. It is much easier to understand and maintain this if you just program a method (or several methods) that represents the full processing chain without th...
[ 0.17131207883358002, 0.4084000289440155, -0.06335084140300751, 0.4422132968902588, -0.04489918053150177, -0.0027655549347400665, 0.19200944900512695, 0.01607634872198105, -0.3756242096424103, -0.35030415654182434, -0.07134409248828888, 0.5640227794647217, -0.3032298684120178, 0.24127140641...
more abstract processing chains. You are doing meta-programming. Personally I never do any meta-programming any more, so I'd tend to agree with those colleagues that dislike it. ;)
[ 0.28695327043533325, -0.10192637890577316, -0.145126610994339, 0.19637130200862885, -0.3224146366119385, -0.07688473910093307, 0.0023957849480211735, 0.2290762960910797, -0.34209874272346497, -0.5948126912117004, 0.06645848602056503, 0.535050094127655, -0.36546510457992554, -0.075447440147...
I have a system consisting of a server accepting remoting calls from clients with TCP as the underlying transportlayer. It normally works like a charm, but if I increase the no. of clients, the server starts at random to close the TCP connections in the middle of the calls. Not all calls are interrupted this way. That...
[ 0.17990589141845703, -0.17938150465488434, 0.4014401137828827, -0.003378693712875247, -0.22541742026805878, 0.07284281402826309, 0.12775595486164093, -0.009982475079596043, -0.3789896070957184, -0.6729617118835449, -0.1087568923830986, 0.3488900363445282, -0.387854665517807, 0.572849869728...
System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 size) ved System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffer, Int32 offset, Int32 count) ved System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 offset, Int32 count) ved System.Ru...
[ -0.15297383069992065, -0.23764412105083466, 0.7058196663856506, 0.037445612251758575, 0.04739402234554291, 0.2556653618812561, 0.4664129614830017, -0.3159275949001312, -0.4178754389286041, -0.8868808746337891, -0.2737351059913635, 0.3957068622112274, -0.4792866110801697, 0.3067017495632171...
less well for *specific* problems. Frameworks are written for other people to use, and you want to give the client total freedom of implementation. Once you know exactly what you are going to do to solve the problem, I think other solutions are better. The danger of the Chain of Responsibility pattern is much the same...
[ 0.22166195511817932, 0.08815862983465195, -0.11732862144708633, 0.2667654752731323, -0.39982837438583374, -0.0304882749915123, 0.5484805107116699, -0.172530397772789, -0.31716474890708923, -0.4633643627166748, 0.1994965821504593, 0.7727866172790527, -0.13510248064994812, -0.162683770060539...
of putting it right up front where your most important code is. It is much easier to understand and maintain this if you just program a method (or several methods) that represents the full processing chain without the abstractions of the processing chain. The processing chain can really hide the business logic of your ...
[ 0.3890465199947357, 0.27153095602989197, -0.1327415257692337, 0.335012286901474, 0.001248215208761394, -0.09287567436695099, 0.2907482087612152, -0.014358448795974255, -0.3359946608543396, -0.46234631538391113, 0.07363924384117126, 0.7968620657920837, -0.46605801582336426, 0.04668824374675...
so I'd tend to agree with those colleagues that dislike it. ;)
[ 0.6230641007423401, 0.5373697280883789, 0.05533139780163765, -0.13679751753807068, 0.00761303398758173, -0.03511175140738487, 0.0432693213224411, 0.3673013150691986, 0.08671658486127853, -0.23843036592006683, -0.13350826501846313, 0.5306119322776794, 0.13830196857452393, 0.268397718667984,...
This question is more or less programming language agnostic. However as I'm mostly into Java these days that's where I'll draw my examples from. I'm also thinking about the OOP case, so if you want to test a method you need an instance of that methods class. A *core rule* for **[unit tests](http://en.wikipedia.org/wik...
[ 0.37068840861320496, -0.05257565900683403, -0.23424775898456573, 0.32686784863471985, -0.13953061401844025, -0.22103729844093323, 0.05839378014206886, -0.472754567861557, -0.06838475912809372, -0.3714442253112793, 0.08881082385778427, 0.3993314802646637, -0.14626923203468323, 0.14598897099...
provide injection capabilities) and/or if you mock objects (for Java you have [JMock](http://www.jmock.org/) and [EasyMock](http://www.easymock.org/)) to separate a class being tested from its dependencies. If we need to test groups of methods in different classes\* and see that they are well integration, we write **[...
[ 0.47126296162605286, 0.03298448771238327, -0.3067132830619812, 0.08779488503932953, 0.02619222179055214, 0.04863136634230614, 0.5110400915145874, -0.6133852601051331, 0.026076175272464752, -0.6226016283035278, 0.20958825945854187, 0.4966769814491272, -0.4058387577533722, 0.0851317718625068...
much (but feel free to disagree; not using a database at all, ever, is also a valid answer as it makes the question irrelevant). * **When you use a database for integration tests, how do you fill that database with data?** I can see two approaches: + Store the database contents for the integration test and load it bef...
[ 0.6284053921699524, 0.09855905920267105, -0.22708521783351898, 0.3589300811290741, 0.1727350354194641, -0.012892648577690125, 0.28099676966667175, -0.43445509672164917, 0.1794639378786087, -0.632840633392334, 0.2496744990348816, 0.6702083945274353, -0.0020355184096843004, -0.12574489414691...
and each of these methods *may* fail. It could be seen as your integration test having dependencies on other tests. How are you making certain that database data needed for tests is there when you need it? And why did you choose the method you choose? **Please provide an answer with a motivation**, as it's in the mot...
[ 0.39364326000213623, 0.04753974825143814, -0.18469490110874176, 0.5015501976013184, 0.03522909805178642, -0.1560828983783722, 0.4208158254623413, -0.36977940797805786, -0.03243621438741684, -0.45155757665634155, 0.18843397498130798, 0.7141364812850952, -0.08965132385492325, -0.127372771501...
other) instances of the same class in my definition of unit test, even though it might technically not be correct. Feel free to correct me, but let's keep it as a side issue. I prefer creating the test data using API calls. In the beginning of the test, you create an empty database (in-memory or the same that is used ...
[ 0.8396152257919312, -0.12635166943073273, -0.018655123189091682, 0.10197485983371735, 0.26660847663879395, 0.0052728052251040936, 0.4106357991695404, -0.4349220097064972, -0.06849824637174606, -0.5585727095603943, -0.08460165560245514, 0.7828570008277893, -0.0362568162381649, 0.16431801021...
in many tests, possibly with minor variations. You want to have the database in a known state before every test, in order to have reproducable tests without side effects. So when a test ends, you should drop the test database or roll back the transaction, so that the next test could recreate the test data always the s...
[ 0.5133678913116455, 0.2613216042518616, -0.03867650032043457, 0.416922003030777, 0.2331000715494156, -0.3062429130077362, 0.22741226851940155, -0.10573834925889969, 0.013315672054886818, -0.3503115475177765, 0.12090332806110382, 0.26317307353019714, -0.19307926297187805, 0.4173755347728729...
or recreate the test data, which may require manual work. If the test data is specified in code, you will have the power of your IDE's refactoring tools at your hand. When you make a change which affects the database schema, it will probably also affect the API calls, so you will anyways need to refactor the code usin...
[ 0.8580815196037292, 0.07374987006187439, 0.07892601937055588, 0.5010930299758911, 0.10274726152420044, -0.11753623187541962, 0.2176152914762497, -0.5557270646095276, 0.021789221093058586, -0.6072219610214233, 0.036637239158153534, 0.8241232633590698, -0.10124310851097107, 0.119265832006931...
manually refactor the database dump in addition to refactoring the code which uses the API. Another thing related to integration testing the database, is testing that upgrading from a previous database schema works right. For that you might want to read the book [Refactoring Databases: Evolutionary Database Design](ht...
[ 0.3387832045555115, 0.1521155834197998, 0.08958320319652557, 0.18324609100818634, 0.09200260043144226, -0.008232970722019672, 0.3868211507797241, -0.5889723896980286, -0.19338643550872803, -0.25097420811653137, 0.22612592577934265, 1.0555585622787476, -0.17582285404205322, -0.0151581764221...
I have a specific requirement to remove all client WCF configuration (<system.serviceModel>) out of the main app.config file, and into a separate XML file. The behaviour I would like to see is similar to that available in the appSettings section using the File="" directive. In fact, I'd ideally like to be able to speci...
[ 0.5743653774261475, 0.350389689207077, 0.6537350416183472, -0.2975718677043915, 0.12693123519420624, -0.04854889214038849, 0.2860526144504547, 0.08034031093120575, -0.23637691140174866, -0.6733709573745728, -0.4101625084877014, 0.687711775302887, -0.5180968642234802, 0.059502482414245605, ...
seem to suggest this is not possible, but I wanted to get the view from SO - does anyone here know something I haven't been able to find? :) > Edit :: > > > Tim Scott and davogones both came up with a possible suggestion, but one which relies on splitting the component sections of the system.serviceModel section out...
[ 0.6712245941162109, 0.03893103078007698, -0.1114867776632309, -0.05304615572094917, 0.2593553364276886, 0.01613721251487732, 0.27648013830184937, -0.18859612941741943, -0.5762971043586731, -0.5370655059814453, -0.12515000998973846, 0.18420195579528809, -0.1978338211774826, 0.17094112932682...
to programatically configure all my service settings. My clients aren't really the type to understand XML and have asked me make configuration files more like the old INI style. This is easy to do (reading INI file code not included): ``` // create the URI which is used as the service endpoint Uri t...
[ 0.18688960373401642, -0.0015036386903375387, 0.5797722339630127, -0.13115093111991882, 0.07106009870767593, -0.06571072340011597, 0.20607812702655792, 0.12746258080005646, 0.12900152802467346, -0.9264544248580933, -0.022542910650372505, 0.3510495722293854, -0.3960953950881958, 0.5943667888...
LocalIPAddress.ToString(), GeneralPortNumber)); // create the net.tcp binding for the service endpoint NetTcpBinding ntcBinding = new NetTcpBinding(); ntcBinding.Security.Mode = SecurityMode.None; System.ServiceModel.Channels.Binding tcpBinding = ntcBinding; // create the servi...
[ 0.00333874742500484, -0.2587343454360962, 0.8289351463317871, -0.05201970785856247, -0.044165950268507004, -0.14670483767986298, 0.5990186333656311, 0.023747188970446587, -0.3107108771800995, -0.9080889821052551, -0.23730745911598206, 0.3936651647090912, -0.3712272047996521, 0.565229713916...
supplying the settings in any manner you choose (database, xml, crazy text file, etc).
[ 0.43477171659469604, -0.046108681708574295, 0.40319016575813293, 0.4999096095561981, 0.29310885071754456, -0.07001154124736786, -0.3432476222515106, 0.1420719027519226, -0.1715172827243805, -0.8288626670837402, -0.37798619270324707, 0.5948693156242371, -0.1287297010421753, -0.3385916352272...
I'm aware that in WPF you want to keep the sizes of controls as flexible as possible so that they can flow and expand depending on their context (like in CSS). But most of the code examples I come across are hard-coding sizes like the heights in this example: ``` <Grid.ColumnDefinitions> <ColumnDefinition Width="...
[ -0.06793802231550217, -0.16118431091308594, 0.2918080687522888, 0.027573633939027786, 0.012997736223042011, 0.18031811714172363, -0.2682730257511139, -0.7062049508094788, -0.4243961274623871, -0.8073222041130066, 0.08590226620435715, 0.5353530049324036, -0.24244681000709534, -0.29286032915...
that authors create these examples in design view and just don't clean up the hard coded heights. Does anyone have any best practices regarding element sizing (especially with respect to using the \* syntax) that people starting out with XAML can follow to develop good habits from the beginning? Generally speaking, it...
[ 0.43527841567993164, -0.07369838654994965, 0.0558534637093544, 0.12585894763469696, 0.051043279469013214, -0.13337266445159912, -0.03937375545501709, -0.5111445188522339, -0.4681667685508728, -0.4350312650203705, 0.054506730288267136, 0.22590892016887665, -0.02952837012708187, -0.304730623...
menu bar or a panel you want to keep consistent in it's size). The notation "2\*" means that the value will be twice the value of other columns and thus, using the star notation in each column is not very usefull. If you're looking for some examples, i can address you to these [two](http://learnwpf.com/Posts/Post.aspx...
[ 0.2921888530254364, 0.026147330179810524, 0.3545688986778259, -0.1750432550907135, -0.21404658257961273, -0.004118006210774183, 0.32400190830230713, -0.024215271696448326, -0.5371418595314026, -0.7178159356117249, -0.04639428108930588, 0.5107585191726685, 0.11676982045173645, -0.1018204465...
written, full of coloured examples and covers every single aspect of WPF.
[ 0.4954467713832855, 0.14051371812820435, -0.3011727035045624, -0.12947781383991241, -0.04403834789991379, -0.009307431988418102, 0.024645350873470306, -0.14680665731430054, -0.14521650969982147, -0.6191099286079407, -0.3022730350494385, -0.09517749398946762, 0.006226753816008568, -0.144023...
I can drop a table if it exists using the following code but do not know how to do the same with a constraint: ``` IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'TableName') AND type = (N'U')) DROP TABLE TableName go ``` I also add the constraint using this code: ``` ALTER TABLE [dbo].[TableName...
[ -0.10476130992174149, 0.1025686040520668, 0.40521255135536194, -0.03889542073011398, 0.015548731200397015, 0.012600806541740894, 0.0435514934360981, -0.4548516273498535, -0.5403397083282471, -0.3060280978679657, -0.16145913302898407, 0.13603802025318146, -0.7482987642288208, 0.036668375134...
FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'FK_TableName_TableName2') AND parent_object_id = OBJECT_ID(N'dbo.TableName') ) ALTER TABLE [dbo].[TableName] DROP CONSTRAINT [FK_TableName_TableName2] ```
[ -0.29656532406806946, 0.1247650608420372, 0.4671633541584015, -0.2706057131290436, 0.09767013043165207, 0.10561002790927887, -0.07915634661912918, -0.28185325860977173, -0.24419446289539337, -0.2820514738559723, -0.43749964237213135, 0.29423755407333374, -0.33847296237945557, 0.49721723794...
i am looking for a basic example that shows how i could call a webservice with the client side javascript that comes with the ASP.NET Ajax Toolkit. i already found some example that shows how you do it with ASP.NET WebForms but i am using ASP.NET MVC so no fancy ScriptManager for me :( does somebody know a insightful...
[ 0.48283180594444275, -0.13314808905124664, 0.07164746522903442, 0.23609280586242676, -0.08650568127632141, -0.2958081066608429, 0.29276585578918457, -0.14037302136421204, -0.14308033883571625, -0.7994539737701416, 0.09354355186223984, 0.8248859643936157, -0.006022132001817226, 0.0346063226...
via WebHttpBinding and WCF. Then use jQuery to query the service.
[ 0.28817832469940186, -0.23865662515163422, 0.1330736130475998, 0.20385704934597015, -0.1801414042711258, -0.40371447801589966, 0.3054652512073517, 0.10748446732759476, -0.1728159636259079, -0.6780645251274109, -0.4575648605823517, 0.2119377702474594, -0.1814601719379425, 0.3062799870967865...
Is there any way to convert a string to Title case, using JSTL tags? Thanks in Advance. An alternative to transforming the string on the server is to [let CSS do the work](http://www.w3.org/TR/CSS2/text.html#caps-prop): ``` text-transform: capitalize ```
[ 0.16021005809307098, -0.08211245387792587, 0.41414976119995117, 0.09405927360057831, -0.025336978957057, -0.1069106012582779, -0.02682851068675518, 0.011598213575780392, -0.24130161106586456, -0.638271152973175, -0.31517136096954346, 0.5595851540565491, -0.2065611332654953, 0.0895658209919...
I know this has been discussed many times, but I am not sure I really understand *why* Java and C# designers chose to omit this feature from these languages. I am not interested in how I can make workarounds (using interfaces, cloning, or any other alternative), but rather in the rationale behind the decision. *From a...
[ 0.44098901748657227, 0.266132116317749, -0.05599486827850342, -0.22936631739139557, -0.08840684592723846, 0.048720650374889374, 0.3208884596824646, 0.19908981025218964, -0.3686733543872833, -0.1470072716474533, -0.21154041588306427, 0.44524508714675903, -0.4263511896133423, -0.053564235568...
these languages were designed, so it is omitted in the sense of being removed from a programmer's toolbox. In [this](http://www.artima.com/intv/choicesP.html) interview, Anders said: > Anders Hejlsberg: Yes. With respect to > const, it's interesting, because we > hear that complaint all the time too: > "Why don't y...
[ 0.15053299069404602, 0.20549283921718597, 0.03533490374684334, -0.08032552897930145, -0.18658500909805298, -0.11516138166189194, 0.3816938102245331, 0.1603194624185562, -0.1740836203098297, -0.30805301666259766, -0.1570122241973877, 0.5785941481590271, -0.6742799282073975, -0.3498315513134...
cast it away. If you > couldn't cast it away, then your world > would suck. If you declare a method > that takes a const Bla, you could pass > it a non-const Bla. But if it's the > other way around you can't. If you > declare a method that takes a > non-const Bla, you can't pass it a > const Bla. So now you're ...
[ 0.2267080843448639, -0.07891324162483215, 0.2614786922931671, -0.11827816814184189, -0.044132523238658905, -0.05297758802771568, 0.25483259558677673, 0.0781860202550888, -0.09499980509281158, -0.2875291705131531, -0.22211085259914398, 0.08522486686706543, -0.4881862699985504, 0.51965284347...
because as with > anything in C++ it is purely optional > whether you want this check or not. > You can just whack the constness away > if you don't like it.
[ 0.30765143036842346, -0.09931237250566483, -0.197869211435318, -0.004932689014822245, -0.12746085226535797, -0.5094211101531982, 0.15113118290901184, 0.0011912498157471418, -0.03709619119763374, -0.20982974767684937, -0.1989092081785202, 0.4611019492149353, -0.4308905303478241, -0.44479712...
Digital commercial products that customers pay for download link. I have put all the zipped files (products) outside of web document root and buyers download them via a php script which is integrated with paypal IPN to make sure the downloader is a paying buyer. Sort of like: <http://www.mysite.com/download.php?buye...
[ 0.4866299629211426, 0.13403309881687164, 0.6387616395950317, 0.14429405331611633, 0.1641068458557129, 0.095473513007164, -0.2578243613243103, -0.026213999837636948, -0.27366915345191956, -0.459987074136734, -0.4136549234390259, 0.6135355234146118, -0.16783548891544342, 0.30953672528266907,...
= @fopen($path,"rb"); if ($fp) { while(!feof($fp)) { print(fread($fp, 1024*8)); flush(); if (connection_status()!=0) { @fclose($fp); die(); } } @fclose($fp); } ``` What could be wrong? Thanks! Problem solved: Thank you all for the tips. It turns out that the downloaded packages cont...
[ 0.40854576230049133, -0.0005060414550825953, 0.7104312777519226, -0.038562435656785965, 0.3631848096847534, -0.3705065846443176, 0.580599844455719, 0.005788472946733236, -0.17269735038280487, -0.46448230743408203, -0.5168877243995667, 0.8242924809455872, -0.4035325348377228, 0.046095132827...
up in a hex editor and compare the first few characters and the last few characters.
[ 0.3297003507614136, 0.10941381752490997, 0.29802632331848145, 0.3498159945011139, 0.1457587033510208, -0.08275946974754333, -0.10866360366344452, -0.09071759879589081, 0.14154238998889923, -0.8690257668495178, -0.013499238528311253, 0.30355510115623474, -0.06507046520709991, -0.14508369565...
**bpp** = bits per pixel, so 32bpp means 8/8/8/8 for R/G/B/A. Like .NET has an enum for these "System.Drawing.Imaging.PixelFormat". Now once I have a **Bitmap** or **Image** object with my graphics, **how would I save it** to a file / what format would I use? What image file format (JPEG/GIF/PNG) supports low bit-de...
[ 0.2783747911453247, -0.21562600135803223, 0.8128678798675537, -0.14486970007419586, -0.06974097341299057, 0.30782392621040344, 0.20209355652332306, -0.6880506277084351, -0.35262107849121094, -0.6972387433052063, 0.015848422423005104, 0.4906632602214813, -0.22717639803886414, -0.08310107141...
On my previous machine I had IIS6 installed and created a web project using IIS as the host. This project was completed, published to an internal hosting server and checked in to source control. I now need to go back and make a minor change to the project, however in the meantime I have acquired a new machine. On my ...
[ 0.2868894040584564, 0.23326827585697174, 0.14214135706424713, -0.14808984100818634, -0.27922454476356506, -0.05354122444987297, 0.3572079539299011, 0.07192922383546829, -0.20827430486679077, -0.8694682121276855, 0.06885243952274323, 0.5274026393890381, -0.2293027937412262, 0.33203995227813...
becoming an Administrator and installing IIS 6. Is there some way I can modify the project and solution files to make it play nicely and use the ASP.Net development server instead? **EDIT:** additional info, this was created as a **web site** not a **web project** so there is no .csproj file. Version info: Visual Stu...
[ 0.6082413196563721, -0.07382065057754517, 0.2643464505672455, 0.1564575433731079, -0.34960752725601196, -0.43577730655670166, 0.35406622290611267, 0.035242993384599686, -0.41158202290534973, -0.67180335521698, 0.2972794473171234, 0.7194218039512634, -0.05699655041098595, 0.0517047941684722...
and whilst you only need to make a minor change now you may well need to make more minor changes in the future so having quick and ready access to the source will likely be useful.
[ 0.6148049831390381, 0.04270526021718979, 0.23675578832626343, 0.22811587154865265, 0.261271595954895, -0.05835878476500511, 0.19334425032138824, 0.4643822908401489, -0.26802298426628113, -0.5912636518478394, -0.03351372107863426, 0.5686188340187073, 0.3552989363670349, 0.11248979717493057,...
I need a library that allows me to do email operations(e.g Sent/Receive mail) in Gmail using Java. Have you seen [g4j - GMail API for Java](http://g4j.sourceforge.net/)? > GMailer API for Java (g4j) is set of > API that allows Java programmer to > communicate to GMail. With G4J > programmers can made Java based > ...
[ 0.2746258080005646, 0.17792731523513794, 0.42516154050827026, -0.000546263821888715, -0.12795577943325043, -0.07587537169456482, 0.5564276576042175, -0.021479299291968346, 0.10985783487558365, -0.8646134734153748, 0.1955978274345398, 0.6853733658790588, -0.2748695909976959, 0.0141176059842...
I unsuccessfully searched Google for a good definition and understanding of streaming data and its characteristics. My questions are: 1. What is streaming data? 2. How can it be detected? **Correction:** "How can it be detected" is not an appropriate question. Instead my question is: How is it different from buffer...
[ 0.39424535632133484, -0.37262579798698425, 0.19009684026241302, 0.18367744982242584, -0.2591637969017029, -0.06092197448015213, 0.05526861175894737, 0.08136890083551407, -0.31311172246932983, -0.3962104320526123, 0.025337230414152145, 0.44513311982154846, -0.42641955614089966, 0.0419752039...
kind). HTTP doesn't natively support the ability for servers to push content to clients. There are a number of ways this can be faked, including: * **Polling:** forcing the client to make repeated requests, typically inconspicuously (as far as the client is concerned); * **Long-lived connections:** this is where the ...
[ 0.1686747819185257, -0.14640532433986664, 0.5344880819320679, 0.11689982563257217, -0.273804247379303, -0.024733254685997963, 0.3418439030647278, 0.03154291957616806, -0.0586204007267952, -0.5495043992996216, -0.1454867124557495, 0.3737809360027313, -0.29031988978385925, 0.1388030946254730...
others can be used to achieve this. Anything where the server effectively sends data to the client (rather than the client asking for it)--regardless of the mechanism and whether or not the client is polling for that data--can be characterised as *streaming data*. With non-HTTP transports (eg vanilla TCP) server push...
[ 0.34536972641944885, -0.41899019479751587, 0.21534356474876404, 0.22367924451828003, -0.33467212319374084, -0.12592175602912903, -0.05152410268783569, -0.012117184698581696, -0.3414948582649231, -0.47399505972862244, -0.006615647114813328, 0.3585021495819092, -0.29084643721580505, -0.05238...
i have a module (a single .py file, actually), with a class called HashedDir. when i import the file and instanciate 2 instances of that class, when i check the object's fields they're always the same, even if the two objects should be different. Eg: ``` h1 = HashedDir('/path/to/dir') print h1.getList()['files'] #...
[ 0.023435696959495544, 0.014566551893949509, 0.44245031476020813, -0.24449299275875092, -0.10485556721687317, -0.08727450668811798, 0.09229160100221634, -0.7151238322257996, 0.04174790903925896, -0.6298922896385193, -0.29852044582366943, 0.5504111051559448, -0.45231613516807556, -0.15151624...
walk in the directory tree starting from a provided root directory. Also stores the dirs in each dir """ # {'files': [ # ('/path/to/file1', '52bc309e11259af15e4623c7a0abc28c'), # ('/path/to/file2', '52bc309e11259af15e4623c7a0abc28c'), # ('/path/to/dir/file3', '52bc309e11259af15e4623c7...
[ -0.20100776851177216, -0.2752251625061035, 0.5404409170150757, -0.18252494931221008, 0.06131425499916077, 0.26439180970191956, 0.4415737986564636, -0.5126738548278809, -0.40231356024742126, -0.6619242429733276, -0.37930724024772644, 0.08009353280067444, -0.5030133128166199, -0.108312755823...
__init__(self, rootDir, ignoreList=[]): """ ignoreList is a list of regular expressions. If a file or a dir matches that regular expression, don't count it """ self.ignoreList = ignoreList for dirpath, dirnames, filenames in walk(rootDir): for fileName in fil...
[ 0.015373834408819675, -0.1565568745136261, 0.20956502854824066, -0.25649765133857727, -0.07544730603694916, 0.07800499349832535, 0.5521007776260376, -0.19275470077991486, -0.2806522846221924, -0.49161744117736816, -0.01988392136991024, 0.6568124890327454, -0.7654787302017212, -0.1744817495...
completeName = path.join(dirpath,fileName) hash = md5(open(completeName).read()).hexdigest() relativePath = self._relativePath(completeName, rootDir) if not self._toBeIgnored(relativePath): self.fileList['files'].append((relativePath, hash)) ...
[ -0.5438918471336365, -0.37349945306777954, 0.4287238121032715, -0.4941360652446747, -0.09693130850791931, 0.2930920720100403, 0.32126882672309875, -0.3270299434661865, 0.021937690675258636, -0.5677734613418579, -0.05075817182660103, 0.8733258843421936, -0.3024079501628876, 0.24465890228748...
completeName = path.join(dirpath, dirName) relativePath = self._relativePath(completeName, rootDir) if not self._toBeIgnored(relativePath): self.fileList['dirs'].append(relativePath) def _relativePath(self, path, base): return path.replace(base, '') ...
[ -0.5073221921920776, -0.4735478162765503, 0.6138381958007812, -0.514752209186554, 0.07350623607635498, 0.31422579288482666, 0.444052129983902, -0.26913583278656006, -0.024180175736546516, -0.6403946876525879, -0.14933636784553528, 0.9703495502471924, -0.38812679052352905, 0.076817005872726...
for regex in self.ignoreList: if re.compile(regex).search(path) != None: return True return False def getList(self): return self.fileList ``` Thanks in advance There are two kinds of variables in a class: * class variables, defined at the class level, and common to al...
[ -0.008187794126570225, -0.24817945063114166, 0.1591935008764267, 0.04622466862201691, 0.08571374416351318, 0.057611916214227676, 0.28376051783561707, -0.20192724466323853, -0.1524146944284439, -0.4731456935405731, -0.26320314407348633, 0.5649357438087463, -0.3632645010948181, -0.0052414350...
instance (usually `self.`). Example ``` class SomeClass( object ): classVariable = 0 def __init__( self ): self.instanceVariable= 0 ``` The variable named `classVariable` is part of the class, common to all instances. Because of the way Python does search, it's available as a member of `self.classVa...
[ -0.4764975309371948, 0.2975723445415497, -0.004725830163806677, 0.010382030159235, -0.37634551525115967, 0.0785716101527214, 0.2189614325761795, 0.23121117055416107, -0.35322245955467224, -0.5981518030166626, -0.00999296922236681, 0.377920538187027, -0.5033102035522461, 0.3817536234855652,...
I've just started playing with Guice, and a use-case I can think of is that in a test I just want to override a single binding. I think I'd like to use the rest of the production level bindings to ensure everything is setup correctly and to avoid duplication. So imagine I have the following Module ``` public class Pr...
[ 0.5555931925773621, 0.07136785238981247, 0.10441005229949951, -0.3821452856063843, 0.01421986985951662, -0.06625726073980331, 0.2669268548488617, -0.2597329020500183, 0.05465252697467804, -0.6186606884002686, -0.0835857018828392, 0.807780385017395, -0.5587445497512817, 0.1529162973165512, ...
only want to override InterfaceC, while keeping InterfaceA and InterfaceB in tact, so I'd want something like: ``` Module testModule = new Module() { public void configure(Binder binder) { binder.bind(InterfaceC.class).to(MockC.class); } }; Guice.createInjector(new ProductionModule(), testModule); ```...
[ 0.4435052275657654, 0.08794763684272766, 0.3782005310058594, -0.18716390430927277, 0.12248819321393967, -0.14292289316654205, 0.5433406829833984, -0.30162668228149414, 0.1241680160164833, -0.5925765037536621, -0.28595536947250366, 0.784803569316864, -0.5911319851875305, 0.14962616562843323...
the wrong tree?? --- Follow up: It would seem I can achieve what I want if I make use of the @ImplementedBy tag on the interface and then just provide a binding in the test case, which works nicely when there is a 1-1 mapping between the interface and implementation. Also, after discussing this with a colleague it wo...
[ 0.4600639343261719, -0.06669192761182785, 0.10194841027259827, 0.028227781876921654, -0.17555859684944153, -0.2002209573984146, 0.5249729156494141, -0.4818587899208069, -0.2635047137737274, -0.5273678302764893, 0.14138595759868622, 0.6223548054695129, -0.27456462383270264, 0.02811008319258...
a load of tests as bindings may no longer be available to be overriden. This might not be the answer you're looking for, but if you're writing unit tests, you probably shouldn't be using an injector and rather be injecting mock or fake objects by hand. On the other hand, if you really want to replace a single binding,...
[ 0.7002736926078796, -0.1554299145936966, 0.06873971223831177, -0.09700654447078705, -0.1296759694814682, -0.19091156125068665, 0.3718802034854889, -0.48209348320961, -0.09492949396371841, -0.4888739585876465, -0.2773485481739044, 0.438467413187027, -0.6532596945762634, 0.35718846321105957,...
} } public class TestModule implements Module { public void configure(Binder binder) { binder.bind(InterfaceC.class).to(MockC.class); } } Guice.createInjector(Modules.override(new ProductionModule()).with(new TestModule())); ``` See details in the [Modules documentation](https://google.github.io/guice...
[ 0.38094329833984375, -0.12135464698076248, 0.19637922942638397, -0.09723885357379913, 0.1973608136177063, -0.08661750704050064, 0.23191626369953156, -0.5311901569366455, 0.05975547805428505, -0.8498489856719971, -0.24232542514801025, 0.5826209783554077, -0.5070483684539795, 0.0831014886498...
I want to output two different views (one as a string that will be sent as an email), and the other the page displayed to a user. Is this possible in ASP.NET MVC beta? I've tried multiple examples: **1.** [RenderPartial to String in ASP.NET MVC Beta](http://brightmix.com/blog/how-to-renderpartial-to-string-in-asp-ne...
[ 0.12544739246368408, -0.2968391180038452, 0.6051709651947021, -0.42409712076187134, -0.3385476768016815, 0.12370317429304123, 0.22124657034873962, -0.09945912659168243, -0.17465712130069733, -0.8013431429862976, 0.007428131531924009, 0.5876849889755249, -0.2547900974750519, 0.2189826518297...
return the view, it > is completely messed up and doesn't look right at all. Does anyone have any ideas/solutions to these issues i have, or have any suggestions for better ones? Many thanks! Below is an example. What I'm trying to do is create the **GetViewForEmail method**: ``` public ActionResult OrderResult(st...
[ 0.046631745994091034, -0.050602611154317856, 0.30611538887023926, -0.25574132800102234, -0.2000335454940796, 0.14600592851638794, 0.33800986409187317, -0.14336185157299042, 0.029001856222748756, -0.6286049485206604, -0.19509753584861755, 0.8111719489097595, -0.32178688049316406, 0.05633169...
//Email the order out EmailHelper(order, emailView); return View("OrderResult", order); } ``` **Accepted answer from Tim Scott (changed and formatted a little by me):** ``` public virtual string RenderViewToString( ControllerContext controllerContext, string viewPath, string masterPath, ViewD...
[ 0.0165322944521904, -0.4372873902320862, 0.9073256254196167, -0.0523919016122818, 0.047654204070568085, 0.27035191655158997, 0.3083019256591797, -0.3241737484931946, -0.08771882206201553, -0.7704527974128723, -0.31392255425453186, 0.5737241506576538, -0.40636080503463745, 0.099646873772144...
and get the response filter. var response = viewPage.ViewContext.HttpContext.Response; response.Flush(); var oldFilter = response.Filter; try { //Put a new filter into the response filter = new MemoryStream(); response.Filter = filter; //Now render the view into the...
[ -0.24637237191200256, -0.3712756633758545, 0.865055501461029, -0.31076499819755554, 0.07163140922784805, 0.3214564919471741, 0.275461345911026, -0.48474517464637756, -0.02646753005683422, -0.9051130414009094, -0.5396427512168884, 0.7343693375587463, -0.3323878049850464, -0.0046527106314897...
response.Flush(); //Now read the rendered view. filter.Position = 0; var reader = new StreamReader(filter, response.ContentEncoding); return reader.ReadToEnd(); } finally { //Clean up. if (filter != null) { filter.Dispose();
[ -0.14979355037212372, -0.5940616726875305, 0.6967249512672424, -0.2852417230606079, 0.07130065560340881, 0.10189896821975708, 0.24399350583553314, -0.32353681325912476, -0.05067596212029457, -0.9694333672523499, -0.3260928690433502, 0.42733216285705566, -0.40494853258132935, 0.268151998519...
} //Now replace the response filter response.Filter = oldFilter; } } ``` **Example usage** Assuming a call from the controller to get the order confirmation email, passing the Site.Master location. ``` string myString = RenderViewToString(this.ControllerContext, "~/Views/Order/OrderResultEmail....
[ -0.19823141396045685, -0.42814844846725464, 0.8490391373634338, -0.1963559240102768, -0.057183828204870224, -0.08399871736764908, 0.1176469698548317, -0.17034485936164856, -0.38204607367515564, -0.8117833733558655, -0.13526928424835205, 0.7526180744171143, -0.2995488941669464, 0.1235320791...
ViewData.Model = model; using (var writer = new StringWriter()) { var view = new WebFormView(ControllerContext, viewPath); var vdd = new ViewDataDictionary<T>(model); var viewCxt = new ViewContext(ControllerContext, view, vdd, new TempDataDictionary(), writer); viewCxt....
[ -0.10913218557834625, -0.4799554944038391, 0.9011586308479309, -0.19581186771392822, -0.0872548371553421, 0.40237733721733093, 0.44395628571510315, -0.3970997631549835, -0.057605236768722534, -0.6731627583503723, -0.2661304771900177, 0.7760657072067261, -0.330115407705307, 0.30458506941795...
= new StringWriter()) { var viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName); var viewContext = new ViewContext(ControllerContext, viewResult.View,
[ -0.36219438910484314, -0.43956640362739563, 0.9654393792152405, -0.06793877482414246, 0.1973990648984909, 0.28904321789741516, 0.43428269028663635, -0.3773605525493622, -0.03719565272331238, -0.6052682995796204, -0.16994169354438782, 0.6798288822174072, -0.29043692350387573, 0.239538446068...
ViewData, TempData, sw); viewResult.View.Render(viewContext, sw); viewResult.ViewEngine.ReleaseView(ControllerContext, viewResult.View); return sw.GetStringBuilder().ToString(); } } ``` Edit: added Razor code.
[ 0.06927351653575897, -0.5587818622589111, 0.7628672122955322, -0.06706217676401138, -0.15002553164958954, 0.14789962768554688, 0.5563245415687561, -0.41862696409225464, 0.04324306920170784, -0.6238758563995361, -0.35426509380340576, 0.7262201905250549, -0.24932672083377838, 0.3080550432205...
I want to cancel this operation if the user selects a specific item because I don't want to force the user to open the dropdown again. Can this be done? Why are you putting that item into the drop down list if you will not allow the user to select it? Can you modify your design to provide a more useful user interface?
[ 0.4875483810901642, -0.06329430639743805, 0.18579143285751343, 0.20794904232025146, 0.27643725275993347, -0.3013720214366913, 0.1807563304901123, -0.04683835059404373, -0.37996727228164673, -0.15624171495437622, 0.14515618979930878, 0.3321635127067566, -0.6042457818984985, 0.42802622914314...
I have a large varbinary field in one of my tables, and I would like to download in parts for show a download progress indicator in my application. How can I split the data sent in a SELECT query? Thanks You can do this with just the SQLGetData ODBC call. If the buffer size you provide is smaller than the total varbi...
[ 0.32052212953567505, -0.33342626690864563, 0.2921585142612457, 0.14104865491390228, -0.21094484627246857, -0.15573059022426605, -0.025143077597022057, -0.03401714563369751, -0.48132264614105225, -0.6272753477096558, 0.37961137294769287, 0.6850432753562927, -0.03152814880013466, 0.335648804...
percentage, you may be able to select the length as another column. See here for lots of tips for [getting long data](http://msdn.microsoft.com/en-us/library/ms712426(VS.85).aspx).
[ 0.25099408626556396, -0.19257286190986633, 0.15137360990047455, 0.22037827968597412, 0.07808459550142288, -0.05459148436784744, -0.15637455880641937, -0.24254384636878967, -0.4699710011482239, -0.29008087515830994, 0.07728955149650574, 0.42746856808662415, 0.3228665888309479, 0.18286070227...
I am in the process of converting a VS 2008 Web Site to a Web Application Project. I have followed the instructions on the [MSDN](http://msdn.microsoft.com/en-us/library/bb907624.aspx) site but am now getting a whole bunch of weird errors. I should mention that I did this for another project about a week ago and didn't...
[ 0.44319698214530945, 0.3557327091693878, -0.15176784992218018, -0.04264571890234947, -0.2682235538959503, 0.00817880593240261, 0.6141178011894226, 0.19652053713798523, -0.25711193680763245, -0.7311051487922668, 0.2215135246515274, 0.46149784326553345, -0.3309454619884491, 0.349930882453918...
see [this ASP.NET Forum post](http://forums.asp.net/t/1361511.aspx) regarding a similar issue and their way of fixing it was to push all the code-behinds to a seperate class library. While I am sure this would work, it would be a considerable amount of work when it seems to me that it might just be an simple setting so...
[ 0.4587215185165405, 0.0858527272939682, -0.3507513403892517, 0.11230965703725815, -0.15987077355384827, -0.07882878184318542, 0.24577276408672333, 0.22933028638362885, -0.49968504905700684, -0.5897390842437744, 0.13848650455474854, 0.08962284028530121, 0.038339171558618546, 0.2932860255241...
in the same namespace and so these partial classes are trying to "combine" into one major class and hence the collisions. Always figure out the answer to your problem AFTER asking for help. Thanks anyway. So, to clarify, I just needed to wrap all my code-behinds with appropriate namespaces.
[ -0.08906150609254837, 0.16892725229263306, -0.17008782923221588, 0.18414467573165894, -0.2712169587612152, 0.048468057066202164, 0.4340408146381378, 0.26677799224853516, -0.027057958766818047, -0.42153385281562805, 0.09605060517787933, 0.3399941325187683, -0.16871574521064758, -0.149461910...
I've just learnt (the hard way) that databinding doesn't work with fields. This isn't a problem given how easy automatic properties are, but I was wondering why this is the case. Can anyone explain? I found a good explanation [here](http://www.nikhilk.net/DataBindingToPublicFields.aspx): > ... because public > fields...
[ 0.33021438121795654, -0.021109625697135925, -0.011223990470170975, 0.34573614597320557, -0.478854775428772, -0.4025018513202667, 0.4266985356807709, -0.2996726930141449, -0.2950378358364105, -0.2888306975364685, -0.1441190093755722, 0.4540375769138336, -0.33442142605781555, 0.2681140005588...
feels pretty much the same, > and do not have any performance > overhead.
[ 0.291032612323761, 0.3554314970970154, 0.5436534285545349, 0.20018011331558228, 0.17547395825386047, -0.22998423874378204, 0.24675995111465454, -0.04639485105872154, 0.10201571881771088, -0.6956583261489868, 0.11572544276714325, 0.567665159702301, 0.26023125648498535, -0.23746256530284882,...
Some loading routines in my program takes to long to complete. I want a quick small snippet for checking how long a function took to execute. By small I mean "preferably without 3rd party libraries". Maybe something as simple as taking the system time? ``` start = current_system_time() load_something() delta = curren...
[ 0.11296296864748001, 0.04036647081375122, 0.20579445362091064, 0.0058388784527778625, 0.19831201434135437, -0.14140020310878754, 0.07241842150688171, 0.14376448094844818, -0.4581752419471741, -0.7784892916679382, -0.19636289775371552, 0.5818097591400146, -0.2391880601644516, -0.10113423317...