text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
sb.Append(item); } return sb.ToString(); } } ```
[ -0.14314357936382294, 0.002317710081115365, 0.37241125106811523, -0.5165882706642151, -0.16744272410869598, 0.3316662609577179, 0.5049036741256714, -0.6651710867881775, -0.2461426705121994, -0.5711140632629395, -0.5113162398338318, 0.32102468609809875, -0.7473300099372864, 0.22340442240238...
I have a COM Callable Wrapper that I'm using from a VB6 program, but the program won't receive COM events unless the CCW is registered. Otherwise, the CCW works fine, just no events until I remove the program's manifest file and register the CCW using "regasm /tlb /codebase theccw.dll". This is in WinXP SP3. What coul...
[ 0.30226683616638184, 0.024035312235355377, 0.5049799680709839, 0.06479465961456299, 0.15599822998046875, -0.12912243604660034, 0.23394690454006195, -0.36416199803352356, -0.12863388657569885, -0.5378599762916565, 0.017365777865052223, 0.8082938194274902, -0.3877110779285431, 0.405335277318...
Implicit implementation of IComContract. // Implicit implementation of IComEvents. // // eg. public event AnEventDelegate AnEvent; } [ ComVisible(true), Guid("ZZZZ-ZZZZ-ZZZZ-ZZZZ") ] public interface IComContract { [ComVisible(true)] string AProp{ get; set; } [ComVisible(true)] void AMeth...
[ -0.14570453763008118, -0.04698452726006508, 0.29039546847343445, 0.009460892528295517, 0.10997291654348373, 0.11268600076436996, 0.3969217538833618, -0.42722997069358826, 0.0038043938111513853, -0.6343886852264404, 0.1207098439335823, 0.8071303963661194, -0.39513957500457764, -0.1321178227...
your different assets on different frames, you should add them all as layers using addChild(assetToAdd) and set all but one to visible = false. Then add a simple function like this: ``` function showFrame(num:int):void { for (var i:int = 0; i < numChildren; i++) { if (i == num) { getChi...
[ 0.5069825649261475, -0.14502449333667755, 0.2963639795780182, -0.05714011564850807, 0.11955403536558151, -0.02406381070613861, 0.2770703434944153, -0.5383356809616089, 0.031667936593294144, -0.7235262393951416, 0.051605649292469025, 0.5109162926673889, -0.1175055056810379, 0.16741447150707...
getChildAt(i).visible = false; } } } ```
[ 0.11048487573862076, -0.20314161479473114, 0.15900862216949463, -0.09649448841810226, 0.1743190437555313, -0.18586276471614838, 0.56146240234375, 0.05123976245522499, 0.09464453905820847, -0.7620018720626831, -0.288802832365036, 0.6720146536827087, -0.4651713967323303, 0.24857226014137268,...
I need to execute aspnet\_compiler from a bat file that I maintain to automate the publishing of a ASP.NET application from within CruiseControl.NET. aspnet\_compiler runs fine if I manually open the Visual Studio Command Prompt, but doesn't run if I open a normal cmd.exe. What steps should I take to make aspnet\_com...
[ -0.06904861330986023, -0.020142490044236183, 0.5055267810821533, -0.13962863385677338, -0.12058217078447342, -0.09149067848920822, 0.5716890692710876, -0.06714034080505371, -0.20201510190963745, -0.6956390142440796, 0.14646539092063904, 0.810380756855011, -0.08957803249359131, -0.254584461...
I am wondering what the popular or best way to organise your build assets and source code within a project is? Personaly I use ``` /client/projectname/trunk/source/Solution Name.sln /client/projectname/trunk/source/Project.One /client/projectname/trunk/source/Project.Two /client/projectname/trunk/source/Project.Three ...
[ 0.5908554792404175, 0.30877912044525146, 0.033966269344091415, -0.09966500103473663, -0.19286082684993744, 0.027997050434350967, 0.16100208461284637, -0.1813695728778839, -0.5197035074234009, -0.5904781818389893, -0.02591012418270111, 0.3567279279232025, 0.3768990635871887, -0.059513919055...
any of the above answers is 'yes', then you'll like Tree Surgeon! > > > Tree Surgeon is a .NET development tree generator. Just give it the name of your project, and it will set up a development tree for you in seconds. More than that, your new tree has years worth of accumulated build engineering experience built ri...
[ 0.2552008032798767, 0.06032201275229454, 0.15076039731502533, 0.16372904181480408, 0.06336848437786102, 0.14396962523460388, -0.09899507462978363, 0.19917644560337067, 0.10845790803432465, -0.8282142877578735, 0.056097015738487244, 0.48775801062583923, 0.3391456604003906, 0.090575248003005...
Is their any IoC controllers available that will work on .NET Compact Framework? * <http://code.google.com/p/compactcontainer/> * <http://ninject.org/>
[ -0.024830777198076248, -0.3555620014667511, 0.18457649648189545, 0.5551049113273621, 0.22234684228897095, -0.4866704046726227, -0.3734981119632721, -0.07854682952165604, -0.36282047629356384, -0.6005181670188904, -0.25930434465408325, 0.18578536808490753, -0.03590664640069008, -0.170327350...
If I have a Python script that requires at least a particular version of Python, what is the correct way to fail gracefully when an earlier version of Python is used to launch the script? How do I get control early enough to issue an error message and exit? For example, I have a program that uses the ternery operator...
[ 0.13380731642246246, 0.3424576222896576, 0.05017617717385292, -0.29841890931129456, 0.1113329827785492, -0.3029329180717468, 0.682722806930542, -0.19887979328632355, -0.053777601569890976, -0.49389705061912537, 0.03415703773498535, 0.5467497110366821, -0.2898358106613159, 0.060737259685993...
the script sees some very obscure synax error tracebacks - which pretty much require an expert to deduce that it is simply the case of running the wrong version of Python. I know how to check the version of Python. The issue is that some syntax is illegal in older versions of Python. Consider this program: ``` import...
[ 0.327066034078598, 0.43572017550468445, 0.21351876854896545, -0.17027896642684937, 0.020140696316957474, -0.3814682364463806, 0.5428740978240967, 0.0934128612279892, -0.12198158353567123, -0.533717155456543, -0.1584888994693756, 0.7660136818885803, -0.28138071298599243, 0.05642640590667724...
~/bin/python2.4 tern.py must use python 2.5 or greater ``` and not this result: ``` $ ~/bin/python2.4 tern.py File "tern.py", line 5 x = 1 if True else 2 ^ SyntaxError: invalid syntax ``` (Channeling for a coworker.) You can test using `eval`: ``` try: eval("1 if True else 2") except SyntaxEr...
[ 0.03581210970878601, -0.21409061551094055, 0.36658746004104614, 0.010027717798948288, 0.06133024021983147, 0.034551531076431274, 0.6634988188743591, -0.3268931806087494, 0.10189536958932877, -0.2879529595375061, -0.23154069483280182, 0.6625481843948364, -0.2302297055721283, -0.160146534442...
package): ``` # __init__.py # Check compatibility try: eval("1 if True else 2") except SyntaxError: raise ImportError("requires ternary support") # import from another module from impl import * ```
[ -0.021472536027431488, -0.03966996818780899, 0.3153141140937805, -0.32448235154151917, -0.10010403394699097, -0.08496387302875519, 0.44203752279281616, -0.7040531039237976, -0.00479151913896203, -0.227640762925148, -0.6399181485176086, 0.7953256964683533, -0.6327676177024841, -0.4499543905...
I want to put two `<div>`s next to each other. The right `<div>` is about 200px; and the left `<div>` must fill up the rest of the screen width? How can I do this? You can use **[flexbox](https://devdocs.io/css/css_flexible_box_layout)** to lay out your items: ```css #parent { display: flex; } #narrow { width:...
[ 0.34469538927078247, -0.3327771723270416, 0.5725390315055847, -0.2884117364883423, -0.013558846898376942, 0.1007901281118393, -0.42237964272499084, -0.1654597967863083, -0.3705455958843231, -1.1536625623703003, 0.03864919766783714, 0.17941482365131378, -0.09022431075572968, 0.1162112206220...
flexbox. Flexbox can do pretty amazing things. --- For older browser support, you can use CSS **float** and a **width** properties to solve it. ```css #narrow { float: right; width: 200px; background: lightblue; } #wide { float: left; width: calc(100% - 200px); background: lightgreen; } ``` ```...
[ 0.019590364769101143, -0.44527000188827515, 0.5944315791130066, -0.17314238846302032, -0.07407797873020172, 0.06773511320352554, -0.020762301981449127, -0.16107700765132904, -0.5076310634613037, -1.1108529567718506, -0.209859699010849, 0.32750967144966125, -0.31739869713783264, -0.09925217...
I have a little problem and I'm hopping that you can help me solve this annoying issue. I need to use an iFrame in an administration panel to let users use the selection service, and in the HTML I have: ``` <iframe scrolling="yes" runat="server" title="Par Selection" id="iFrame" frameborder="0" enableviewstate="t...
[ 0.04786888509988785, 0.24855418503284454, 0.8045803904533386, 0.019437653943896294, 0.2036377638578415, 0.22010210156440735, 0.309826523065567, -0.48705407977104187, -0.13985906541347504, -0.7495552897453308, -0.07119380682706833, 0.6335369944572449, -0.27618396282196045, 0.020337637513875...
scrolling="yes" title="Par Selection" frameborder="0" width="100%" height="490" src="https://www.parurval.se/urval/?username=myUsername&amp;password=myPassword"> </iframe> ``` Please **note** the **`&amp;`** instead **`&`** sign in the src address when passing username and password How can I prevent this? I...
[ -0.3401595950126648, 0.2026747316122055, 0.995935320854187, 0.05785662680864334, -0.04928999021649361, 0.1655884087085724, 0.34715011715888977, -0.1643819361925125, -0.3010808527469635, -0.7514076232910156, 0.04104559123516083, 0.8471214175224304, 0.13880135118961334, 0.04749998822808266, ...
the user add the username and password in order that entering the Administration page, I will jump directly to the service in the iFrame so the user does not need to enter user/pwd to login every time, that is way I'm trying to add those values dynamically. Any ideas? **Added:** If I put the correct URL address (with...
[ 0.17134201526641846, 0.21551352739334106, 0.7134968638420105, 0.001828339183703065, -0.03455338254570961, -0.2075669765472412, 0.3584563136100769, 0.12331942468881607, -0.19737884402275085, -0.6587169170379639, -0.12456588447093964, 0.6088983416557312, -0.11871486902236938, -0.126823037862...
does anyone know a pure-php implementation of rrdtool? I googled this question, but only found answers about interfacing PHP & rrd... I think it probably defeats the purpose. While I see the attraction to having such a useful tool in a language you can tweak/edit, I think RRDtool's incredible usefulness came from it be...
[ 0.44864630699157715, -0.006324335467070341, 0.050913166254758835, 0.3818317949771881, -0.3576563894748688, -0.13333116471767426, 0.20650142431259155, 0.2208629846572876, 0.014161115512251854, -0.5162512063980103, 0.3875352740287781, 0.7991712093353271, -0.29747968912124634, 0.0047763669863...
In my Global.asax.cs file in RegisterRoutes method, I put ``` routes.MapRoute("messages", "Message/{id}", new { controller = "Archive", action = "Message", id = 0 }); ``` Then I created this controller: ``` namespace TestingApp.Controllers { public class ArchiveController : Controller { p...
[ 0.006114202551543713, -0.35512876510620117, 0.2930101752281189, 0.18359315395355225, 0.12093900889158249, -0.021470623090863228, 0.2702040374279022, -0.16546978056430817, -0.23868988454341888, -0.8702160120010376, 0.20851747691631317, 0.007093880325555801, -0.5693271160125732, 0.2026997655...
in my browsser when I go to: ``` http://.../Message/34 ``` I get a 404. What else do I need to define so that the routing finds my controller? Try defining your specific route before the Default one: ``` routes.MapRoute( "messages", "Message/{id}", new { controller = "Archive", action = "Message", id...
[ -0.18998640775680542, -0.1353451907634735, 0.7139421105384827, 0.10555516183376312, 0.12443739920854568, -0.16707265377044678, 0.10144900530576706, 0.05822829157114029, -0.5772533416748047, -1.2936959266662598, -0.14498984813690186, 0.17241685092449188, -0.37265753746032715, 0.144226118922...
What is the most preferred and easiest way to do pagination in ASP.NET MVC? I.e. what is the easiest way to break up a list into several browsable pages. As an example lets say I get a list of elements from a database/gateway/repository like this: ``` public ActionResult ListMyItems() { List<Item> list = ItemDB.G...
[ 0.044794101268053055, -0.1847941130399704, 0.31639739871025085, 0.0016016075387597084, -0.2836548686027527, 0.10473733395338058, 0.17880605161190033, -0.4618948698043823, -0.6083757877349854, -0.5181795954704285, -0.18332329392433167, 0.53851717710495, -0.376017302274704, -0.10475303232669...
i.e. ``` ActionResult Search(string query, int startIndex, int pageSize) {...} ``` defaulted in the routes setup so that startIndex is 0 and pageSize is (say) 20: ``` routes.MapRoute("Search", "Search/{query}/{startIndex}", new {
[ -0.5764700174331665, -0.27236026525497437, 0.6025651693344116, -0.06463044881820679, 0.03733637556433678, 0.0595792755484581, 0.14182421565055847, -0.2669215798377991, -0.3527490496635437, -0.8735393285751343, -0.42251405119895935, 0.1872168779373169, -0.3832983374595642, -0.14287012815475...
controller = "Home", action = "Search", startIndex = 0, pageSize = 20 }); ``` To split the feed, you can use LINQ quite easily: ``` var page = source.Skip(startIndex).Take(pageSize); ``` (or do a multiplication if you use "pageNumber" rather than "startIndex") W...
[ -0.011229031719267368, -0.6491357684135437, 0.7031692862510681, 0.12986090779304504, 0.13826516270637512, -0.20068775117397308, -0.3409852087497711, -0.18178533017635345, -0.48477089405059814, -0.3538874685764313, -0.02518991008400917, 0.3327866196632385, -0.4815584123134613, 0.10904128104...
the database, too. You should then be able to use action-links to the next page (etc): ``` <%=Html.ActionLink("next page", "Search", new { query, startIndex = startIndex + pageSize, pageSize }) %> ```
[ -0.029637522995471954, -0.16346752643585205, 0.7279086709022522, 0.1210426539182663, 0.023480478674173355, 0.07378903031349182, -0.05184831842780113, -0.0988164097070694, -0.472618967294693, -0.6803675889968872, -0.1699477583169937, 0.48296719789505005, -0.24517086148262024, -0.19816778600...
is there a way to compile java files into executable with high quality free software and without going through using executable JAR files? There's a nice page on [Javalobby](http://www.javalobby.org/articles/java2exe/) that discusses this in some detail, as well as going through several different styles you might want ...
[ 0.3517778813838959, 0.09556444734334946, -0.0510021410882473, 0.02094455435872078, -0.2275962084531784, -0.29395776987075806, 0.08251333981752396, 0.04626486077904701, -0.2458084374666214, -0.5160578489303589, -0.055396679788827896, 0.672497570514679, -0.05921458080410957, -0.4019038677215...
Say if my code is always going to be run on a particular processor and if I have this information during installation - is there a chance I can avoid JIT? You don't have to avoid JIT if you have CPU information at installation. If you compile your modules using the /platform:[x86/x64/IA64] switch, the compiler will i...
[ 0.38621363043785095, 0.2403227537870407, 0.15040700137615204, 0.10037360340356827, 0.0672544315457344, 0.027456972748041153, 0.08422058075666428, 0.058195810765028, -0.3700386881828308, -0.6992422342300415, 0.03011697717010975, 0.7612240314483643, -0.22893476486206055, -0.08641055226325989...
a result of the reduced working set in the processes running not becuase you would have avoided JITting. And you need to actually compare the NGEN'd files' performance against that of the non-NGEN'd files' to make sure that the NGEN'd one is faster. NGEN can't make as many assumptions about the execution environment a...
[ -0.01391666941344738, -0.029546039178967476, -0.10963929444551468, 0.07083821296691895, -0.35244491696357727, -0.026331385597586632, 0.2680019736289978, -0.0639147013425827, -0.059138063341379166, -0.5068701505661011, 0.1427890956401825, 0.5947223901748657, -0.30811864137649536, 0.05135123...
Using Python 2.5, I have some text in stored in a unicode object: > Dinis e Isabel, uma difı´cil relac¸a˜o > conjugal e polı´tica This appears to be [decomposed Unicode](http://www.unicode.org/reports/tr15/#Decomposition). Is there a generic way in Python to reverse the decomposition, so I end up with: > Dinis e Is...
[ 0.039904527366161346, 0.38217437267303467, 0.3501971364021301, -0.11019013822078705, 0.09218854457139969, 0.2656618654727936, -0.019588742405176163, -0.23065632581710815, -0.1065230593085289, -0.3088659644126892, -0.14579890668392181, 0.500068724155426, -0.5389533638954163, -0.387039959430...
I have a Git repository (originally CVS, then SVN, now Git) containing a Rails project that has been deployed on Linux for a while now. Everything seems to run fine. Now that I've converted to git, I see that **many of my files in the repository contain [`CRLF`](http://en.wikipedia.org/wiki/Newline) line endings**. I'...
[ 0.5234929919242859, 0.13578106462955475, 0.3006373941898346, -0.20815514028072357, 0.005092166364192963, -0.14790396392345428, 0.14804118871688843, 0.42321813106536865, -0.15980468690395355, -0.8271404504776001, -0.0327485017478466, 0.6045222282409668, 0.10771161317825317, 0.16639029979705...
or cron files or something that didn't respond to `CRLF` very well. Also, I know all about the Git options `core.autocrlf` and `core.safecrlf`, But is there some way to have it **convert all text files from `CRLF` to `LF` on checkout (for the linux side)** ... i.e. a core.autolf option or something similar? If it is o...
[ 0.028507860377430916, 0.10237213969230652, 0.5430935025215149, -0.09168687462806702, -0.13997919857501984, 0.016125235706567764, 0.03384869918227196, -0.041776470839977264, -0.27520716190338135, -0.7928988337516785, -0.25505203008651733, 0.722869336605072, -0.3267202377319336, 0.2368524074...
repository you will have to refine the find command to exclude them.
[ 0.2926521897315979, 0.07794112712144852, -0.20793181657791138, 0.5022115707397461, 0.28373244404792786, -0.2700837552547455, -0.027341589331626892, 0.11556024849414825, -0.2424210011959076, -0.49498793482780457, -0.1535670906305313, 0.37804704904556274, -0.10839217901229858, 0.378106653690...
I am sorting a GridView bind to a ananymous type. ``` protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { List<object> lb = (List<object>)ReturnAnony(); // Not working // ?? What to write here } object ReturnAnony() { var anony = // I create the ananymous type and return ret...
[ 0.26120251417160034, -0.19908514618873596, 0.41688260436058044, -0.39081937074661255, 0.02578718215227127, 0.07518269121646881, 0.10395823419094086, -0.4018315076828003, -0.18159328401088715, -0.8831139802932739, -0.2180168181657791, 0.14715133607387543, -0.4544290006160736, 0.294698327779...
return l; } ``` Is that what you want? Otherwise, you cannot reference the anonymous type outside of its scope unless you create a *path* to bridge the type information over to your code... which... in the end you should just made a new class.
[ 0.25080180168151855, 0.03492860868573189, 0.16407588124275208, -0.2348584085702896, 0.018100880086421967, -0.1310492902994156, 0.27014321088790894, 0.21380135416984558, 0.2307870239019394, -0.7557367086410522, -0.13835658133029938, 0.5128138065338135, -0.4392220675945282, 0.244085371494293...
From <http://items.sjbach.com/319/configuring-vim-right> I got that you were supposed to be able to use `Space` as the mapleader in vim. I've tried but it does not seem to work. Anyone who have made it work? Tried: ``` let mapleader = <space> ``` Try the following instead: ``` let mapleader=" " ``` And remember ...
[ 0.37201738357543945, 0.33399391174316406, 0.7531704306602478, 0.1699674129486084, -0.30217719078063965, -0.04898286610841751, 0.10042848438024521, 0.1496298611164093, -0.5500621795654297, -0.42929917573928833, 0.11454887688159943, 0.036916583776474, 0.017270121723413467, 0.1700442731380462...
The following PL/SQL will not execute and simply returns 'Invalid Argument' as an error. I've gone as far as commenting out eavery line one by one and I can vary the error I receive but I cannot get the proc to run as I cannot identify where the error lies and it may well lie in permissions or the executing user but an...
[ 0.1750226765871048, 0.324962317943573, 0.38610485196113586, -0.14665721356868744, -0.15627719461917877, -0.04843578115105629, 0.2366686761379242, 0.03191997855901718, 0.1846982091665268, -0.3310913145542145, -0.11412156373262405, 0.44653838872909546, -0.34446194767951965, 0.099990934133529...
-- Data Pump job handle percent_done NUMBER; -- Percentage of job complete job_state VARCHAR2(30); -- To keep track of job state le ku$_LogEntry; -- For WIP and error messages js ku$_JobStatus; -- The job status from get_status jd ku$_JobDesc; -- The job description from...
[ -0.22787633538246155, 0.05949566513299942, 0.24867412447929382, -0.18439434468746185, -0.0329938642680645, 0.4627928137779236, 0.4088936150074005, -0.3024008572101593, -0.06835547834634781, -0.4941628575325012, -0.3695627748966217, 0.7876863479614258, 0.00039238654426299036, 0.057192206382...
sts ku$_Status; -- The status object returned by get_status BEGIN h1 := DBMS_DATAPUMP.OPEN('EXPORT','SCHEMA',NULL,'SQL_INSTALLER_01152009_1014','LATEST'); DBMS_DATAPUMP.ADD_FILE(h1,'SQL_INSTALLER_01152009_1014.dmp','ORACLE_SCRIPT_RUNNER_BACKUP',NULL,1); DBMS_DATAPUMP.ADD_FILE(h1,'SQL_INSTALLER_0115...
[ -0.26511049270629883, -0.10478778183460236, 0.8227725028991699, -0.04720579460263252, -0.1216033473610878, 0.24066907167434692, 0.3682720363140106, -0.2125886082649231, 0.01294117420911789, -0.4896845519542694, -0.5972462892532349, 0.44681599736213684, -0.056568946689367294, 0.117480836808...
dbms_datapump.ku$_status_job_error + dbms_datapump.ku$_status_job_status + dbms_datapump.ku$_status_wip, -1, job_state, sts); js := sts.job_status; if js.percent_done != percent_done then percent_done
[ -0.3381105363368988, 0.05929666385054588, 0.14112137258052826, -0.2015588879585266, -0.15054620802402496, 0.28096503019332886, 0.5182295441627502, -0.11709865927696228, 0.062341004610061646, -0.6939365267753601, -0.46350497007369995, 0.38779863715171814, -0.023333486169576645, 0.2730226814...
:= js.percent_done; end if; if (bitand(sts.mask,dbms_datapump.ku$_status_wip) != 0) then le := sts.wip; else if (bitand(sts.mask,dbms_datapump.ku$_status_job_error) != 0) then le := sts.error; else
[ -0.18126869201660156, -0.1394253820180893, 0.39429956674575806, -0.2788134813308716, 0.01893852837383747, 0.3758492171764374, 0.4522235691547394, -0.2195931375026703, -0.061612509191036224, -0.6315807700157166, -0.5818377137184143, 0.5497499704360962, -0.0009059348958544433, 0.154741823673...
le := null; end if; end if; if le is not null then ind := le.FIRST; while ind is not null loop ind := le.NEXT(ind);
[ -0.05487105995416641, -0.45754024386405945, 0.030318008735775948, -0.4681438207626343, -0.1549805998802185, 0.250836580991745, 0.6602983474731445, -0.4325695037841797, -0.23274728655815125, -0.5728098154067993, -0.5242341756820679, -0.19235576689243317, -0.4194968044757843, 0.1708377748727...
end loop; end if; end loop; dbms_datapump.detach(h1); END; ``` For this particular problem it is because the schema\_name speccs\_web\_test is not in upper case. SPECCS\_WEB\_TEST is fine and the proc is now running ;)
[ -0.2097986489534378, -0.09348311275243759, 0.588101863861084, -0.33313316106796265, 0.3680087924003601, -0.08190304785966873, 0.47475314140319824, -0.21058033406734467, -0.17634369432926178, -0.42390176653862, -0.5424193739891052, 0.38777223229408264, -0.47259876132011414, 0.21970061957836...
I have an input field where both regular text and sprintf tags can be entered. Example: `some text here. %1$s done %2$d times` How do I validate the sprintf parts so its not possible them wrong like `%$1s` ? The text is utf-8 and as far as I know regex only match latin-1 characters. www.regular-expressions.info does...
[ 0.24479691684246063, 0.15013237297534943, 0.31517553329467773, -0.020196320489048958, -0.0734022930264473, 0.0027389831375330687, 0.3127411901950836, 0.021216802299022675, 0.013719477690756321, -0.5004706978797913, -0.11886407434940338, 0.4381675124168396, -0.22329853475093842, -0.00534677...
be: `/%\d\$(s|d|u|f)/u` This is what I ended up with, and its working. ``` // Always use server validation even if you have JS validation if (!isset($_POST['input']) || empty($_POST['input'])) { // Do stuff } else { $matches = explode(' ',$_POST['input']); $validInput = true; foreach ($matches as $m) { //...
[ 0.19398854672908783, -0.14374235272407532, 0.44937682151794434, -0.25333577394485474, 0.02879146859049797, -0.13120754063129425, 0.3808659017086029, -0.5124525427818298, 0.2210099697113037, -0.5809708833694458, -0.5123488903045654, 0.48283061385154724, -0.39076319336891174, -0.139777094125...
// no match found $validInput = false; break; // Invalid sprintf format found. Abort } } } if ($validInput === false) { // Do stuff when input is NOT valid } } ``` Thank you Gumbo for the regex pattern that matches both with and without order marking. **Edit**: I realized that se...
[ 0.21772971749305725, 0.35786959528923035, -0.08105991780757904, -0.0961386114358902, -0.009610451757907867, -0.058577023446559906, 0.6055970191955566, -0.08027531206607819, -0.17796975374221802, -0.5590400695800781, -0.006700105965137482, 0.8334081172943115, -0.4041096866130829, 0.00856038...
the last if-statement, but I included it for completeness.
[ -0.11142891645431519, 0.06019483506679535, -0.08711199462413788, -0.008974749594926834, -0.30535343289375305, 0.06821388751268387, 0.1774803251028061, -0.002874682890251279, 0.35351136326789856, 0.03461703285574913, 0.07540280371904373, 0.19953906536102295, -0.14112186431884766, 0.06800273...
I'd like to know if there is any personal source controller, I'd like to have a repository on my machine without going through setting up a server, also I work with TeX files not any particular language and I'd like to have backups of my files the way sub version does [Git](http://git.or.cz/) creates repositories that ...
[ 0.30622249841690063, 0.016983209177851677, 0.3497929275035858, 0.34160691499710083, -0.12284478545188904, -0.15407311916351318, 0.06774183362722397, 0.25836381316185, -0.4310213625431061, -0.5521893501281738, -0.1723494976758957, 0.72341388463974, -0.08852595835924149, 0.28594496846199036,...
less exactly the same features so it’s mostly a matter of personal taste.
[ 0.6494179368019104, 0.29829102754592896, -0.23429438471794128, -0.04225737601518631, 0.13522110879421234, 0.4130282700061798, 0.134103924036026, 0.28362053632736206, -0.0179233830422163, -0.4662546217441559, 0.1868876814842224, 0.5120429396629333, 0.27004000544548035, -0.06676259636878967,...
**EDIT:** Oops - as rightly pointed out, there'd be no way to know whether the constructor for the class in question is sensitive to when or how many times it is called, or whether the object's state is changed during the method, so it would have to be created from scratch each time. Ignore the Dictionary and just cons...
[ 0.2744579613208771, -0.1655362844467163, 0.09264717251062393, -0.15717563033103943, 0.05380037799477577, 0.031078236177563667, 0.16304618120193481, -0.41249027848243713, -0.1858053356409073, -0.452631413936615, 0.1039663553237915, 0.5614592432975769, -0.41934823989868164, -0.08437655121088...
Dictionary<Type, Action>() { {typeof(StringBuilder), () => { // .. }}, {typeof(DateTime), () => { // ..
[ 0.07988275587558746, -0.3027734160423279, 0.5308281183242798, -0.219472736120224, 0.22081175446510315, 0.3689803183078766, 0.26503419876098633, 0.0020920231472700834, 0.13596674799919128, -0.49264976382255554, -0.22441641986370087, 0.3293207287788391, -0.1519874483346939, -0.00857552606612...
}} }; actions[type].Invoke(); } ``` The Dictionary will always be the same when the method is called. Can the C# compiler notice this, only create it once and cache it somewhere for use in future calls to the method? Or will it simply be created from scratch each time? I know it could be a field of the conta...
[ 0.29689842462539673, 0.1347128003835678, 0.1333831548690796, -0.3162916302680969, 0.090468630194664, -0.1665889322757721, 0.22817954421043396, -0.009261256083846092, -0.09412644803524017, -0.4643760621547699, -0.03496570140123367, 0.8177281022071838, -0.44141528010368347, 0.100949384272098...
dictionary every time? You explicitly create a new dictionary every time. C# does not support static local variables, so you have to use a field. There's nothing wrong with that, even if no other method uses the field. It would be bad if the C# compiler did things like that. What if the constructor of the variable use...
[ 0.17843393981456757, 0.09103972464799881, 0.10473257303237915, 0.15156279504299164, -0.16878554224967957, -0.05459495261311531, 0.3271876573562622, 0.2177506983280182, -0.03803113475441933, -0.5363959074020386, 0.0874623954296112, 0.6485109925270081, -0.37262409925460815, -0.19510701298713...
I need to prevent user from selecting text (select all or select a portion of text) in the browser Mozilla Firefox, using java script. I have done this using Internet Explorer, but it seems doesn't work with Mozilla. Any hints? URL? Sample? TIA. EDIT: Actually, this ridiculous problem was requested by our client. A...
[ 0.32672318816185, 0.2542971074581146, 0.34969258308410645, -0.03558073192834854, -0.031830545514822006, -0.3530702590942383, 0.5802961587905884, -0.13588333129882812, -0.17166440188884735, -0.7394976019859314, -0.10806726664304733, 0.761773943901062, -0.5407785773277283, 0.0415126197040081...
protect content you publish, short of DRM schemes which are not widespread enough to be useful for a website. But to prevent simple copy-and-paste there are several approaches, each of which is very annoying to your users. A simple way would be to cover the text with another element, such as a `DIV`, using CSS positio...
[ 0.5470201969146729, 0.11197337508201599, 0.10000494867563248, 0.13890321552753448, 0.08705121278762817, -0.6445887088775635, 0.22334124147891998, 0.027837498113512993, -0.1318088173866272, -0.33275938034057617, -0.16579876840114594, 0.8051969408988953, -0.2916574478149414, 0.07657514512538...
the page and hitting `CTRL`+`A` (or some other shortcut key) may select the text anyway, and it may be impossible to block all key and mouse events that can get at the text. But this `DIV` "lid" approach is at least unobtrusive and easy to generalize. However, this is trivially defeated by looking at the HTML source. I...
[ 0.00725126825273037, 0.04645602032542229, 0.7159197926521301, 0.014156456105411053, -0.3985990285873413, -0.30099600553512573, 0.4085802137851715, -0.09898004680871964, -0.12497670948505402, -0.7336928248405457, -0.47642621397972107, 0.44178837537765503, -0.3536740839481354, 0.001175932353...
something like a PDF. However graphics can be OCR'ed. There are free tools for this. Finally you could put your text in a Flash or Java applet, which would download the text from the server. Someone could steal your applet but would have difficulty making it talk to your webserver due to the same-origin security polic...
[ 0.1810656636953354, -0.25433218479156494, 0.3834740221500397, 0.47293391823768616, -0.13897763192653656, -0.38857200741767883, 0.15405923128128052, 0.21402525901794434, -0.2564387917518616, -0.7511588335037231, -0.11783408373594284, 0.5102661848068237, -0.11062730103731155, 0.0169871877878...
using OCR the attacker has to take screen-captures. Or they could reverse-engineer your applet and make a new applet (or even a regular program) which downloads all the content from your server. All those approaches are only of the most basic use and I suspect you'll find that they don't help at all. You'd probably ge...
[ 0.12010134011507034, 0.27040520310401917, 0.08982694149017334, 0.08404223620891571, 0.061696819961071014, 0.07674962282180786, 0.0325210876762867, 0.4489130675792694, -0.18738363683223724, -0.5606304407119751, 0.004691697657108307, 0.5908887386322021, -0.3089449107646942, -0.23897933959960...
I'm passing in a bunch of key-value pairs as parameters to a XSL (date -> "20th January", author -> "Dominic Rodger", ...). These are referenced in some XML I'm parsing - the XML looks like this: ``` <element datasource="date" /> ``` At present, I can't work out how to get 20th January out of these except with a ho...
[ 0.10878508538007736, 0.06380854547023773, 0.5033119916915894, -0.049245644360780716, -0.3857026994228363, 0.09557913988828659, 0.3829456865787506, -0.34900516271591187, -0.17256635427474976, -0.1862753927707672, -0.09907972812652588, -0.31664055585861206, -0.43611469864845276, 0.4192098677...
... </xsl:choose> </xsl:template> ``` I'd like to use something like: ``` <xsl:template match="element"> <xsl:value-of select="${@datasource}" /> </xsl:template> ``` But I suspect this isn't possible. I'm opening to using external function calls, but want to avoid having to enumerate all possible map keys in m...
[ -0.0007163580739870667, -0.0009425297612324357, 0.7182300090789795, 0.21389026939868927, -0.08618602156639099, 0.18453679978847504, 0.0706663727760315, -0.7647765874862671, -0.4448067545890808, -0.27008557319641113, -0.007494403515011072, 0.18148227035999298, -0.3094116449356079, 0.2520211...
<time><xsl:value-of select="$time"/></time> </xsl:variable> <xsl:variable name="vParams" select="ext:node-set($vrtfParams)"/> <xsl:template match="element"> <xsl:value-of select= "concat('&#xA;', @datasource, ' = ', $vParams/*[name() = current()/@datasource] )" ...
[ -0.07157887518405914, -0.05021906644105911, 0.7868115901947021, -0.06754438579082489, 0.2998078763484955, 0.07822658121585846, 0.08568581938743591, -0.32662972807884216, -0.42567095160484314, -0.5493882894515991, -0.44799840450286865, 0.31674402952194214, 0.11513729393482208, 0.36480057239...
of the [**`xxx:node-set()`**](http://dpawson.co.uk/xsl/sect2/nodeset.html) function ([**the EXSLT one**](http://exslt.org/exsl/functions/node-set/index.html) is used here) to convert an RTF ([**Result Tree Fragment**](http://www.w3.org/TR/xslt#section-Result-Tree-Fragments)) to a regular xml document (temporary tree).
[ -0.29177725315093994, -0.13408498466014862, 0.34784913063049316, 0.03013555519282818, -0.08621491491794586, -0.14630624651908875, 0.06750614196062088, -0.3405385911464691, -0.31380409002304077, -0.5093096494674683, -0.8642802834510803, 0.0031920515466481447, -0.34270045161247253, 0.2759181...
When trying to replace the content of an XML file in C#.NET with a snippet like this: ``` string file = Path.GetTempFileName(); // pretend this is a real file string tmpFile = Path.GetTempFileName(); using (var writer = XmlWriter.Create(File.Create(tmpFile))) { writer.WriteStartElement("root"); for (int i = 0...
[ 0.4059908092021942, 0.1377328783273697, 0.3584023118019104, -0.13876648247241974, 0.28906139731407166, 0.017865119501948357, 0.3585018217563629, -0.23859082162380219, -0.10221833735704422, -0.5407568216323853, -0.3041391670703888, 0.566094160079956, -0.39311230182647705, 0.3630032539367676...
the file is already opened by another process. For some reason the XmlWriter class evidently does not dispose the underlying stream for the temporary file. Putting the stream in a "using" clause of its own makes sure the stream is closed correctly. Changing the code to ``` string file = Path.GetTempFileName(); // pret...
[ 0.30529770255088806, 0.09852632135152817, 0.6634794473648071, -0.22923927009105682, 0.39027437567710876, -0.10794242471456528, 0.6096453666687012, -0.33841556310653687, -0.04059430584311485, -0.6183930039405823, -0.2770121097564697, 0.45824697613716125, -0.29629063606262207, 0.267688632011...
"All work and no play makes Jack a dull boy"); } writer.WriteEndElement(); } File.Delete(file); File.Move(tmpFile,file); ``` ... makes the IOException disappear and it works as intended.
[ 0.067192442715168, 0.11047579348087311, 0.20828105509281158, -0.23518022894859314, 0.43881651759147644, -0.06155793368816376, 0.11389771848917007, 0.15971748530864716, 0.01681303046643734, -0.45398351550102234, -0.3435233533382416, 0.8021215796470642, -0.4995620548725128, 0.288568079471588...
How can I access dynamically properties from a generated LINQ class ? Cause I would like to be able to customize the displayed table columns where Partner is the LINQ Class generated from a SQL Server Database Table. ``` <table class="grid"> <thead> <tr> <% foreach (Column c in (IEnumerable)ViewData["column...
[ -0.10807619988918304, -0.015104183927178383, 0.4881364107131958, 0.1175161674618721, 0.015703275799751282, 0.05257205292582512, 0.01196069922298193, -0.4126134514808655, -0.20954886078834534, -0.6818382740020752, 0.17472688853740692, 0.5491454005241394, -0.2963961064815521, 0.2103868722915...
</tr> </thead> <tbody> <% foreach (Partner p in (IEnumerable)ViewData.Model) { %> <tr> <% foreach (Column c in (IEnumerable)ViewData["columns"]) { %> ????? <th> <%= p.GetProperty(c.Name) %> </th> ????? <% } %> </tr> <% } %> </tbody> </table> ``` Any idea how the code of the `...
[ 0.12254465371370316, 0.11600903421640396, 0.4504004120826721, -0.12302790582180023, 0.022186772897839546, 0.2739826440811157, 0.22552743554115295, -0.3116956949234009, -0.05466708913445473, -0.6709346771240234, -0.25676652789115906, 0.5445390343666077, -0.3463415801525116, 0.21879318356513...
really couldn't figure it out. Reflection is a pretty good fit here, but really - everything is known at compile time. So it's possible to specify everything at design time. ``` public class DataItem { string Title {get;set;} object Value {get;set;} } public interface IDataItems { IEnumerable<DataItem> Items() ...
[ 0.44268837571144104, 0.22267504036426544, 0.30512383580207825, -0.04423213750123978, -0.15996669232845306, 0.18450945615768433, 0.03336470574140549, -0.36861976981163025, -0.009911797009408474, -0.3977968096733093, 0.03661561384797096, 0.46883565187454224, 0.03752899914979935, 0.2421061992...
new DataItem() {"Name", Name}; yield return new DataItem() {"Address", Address}; yield return new DataItem() {"Age", Age}; } } //and the foreach loops look like this: foreach(DataItem d in ViewData.OfType<IDataItems>().First().Items()) { d.Title; } foreach(IDataItems container in ViewData.OfType<IDataItem...
[ 0.048184510320425034, -0.061176884919404984, 0.42784616351127625, -0.10096713155508041, 0.24534417688846588, 0.30747848749160767, 0.04198833182454109, -0.3502505421638489, -0.21101176738739014, -0.523885190486908, -0.36881116032600403, 0.07441695779561996, -0.16125799715518951, 0.715858459...
I have the bad luck of having to downport some ActionScript 3 code to ActionScript 2 and I have a problem with detecting when the mouse leaves the stage. In ActionScript 3 there is an event called `Event.MOUSE_LEAVE`, which can be used to detect when the mouse leaves the stage, but there is no equivalent in ActionScri...
[ -0.3225117623806, 0.06608141958713531, 0.20868328213691711, -0.4783690273761749, -0.08848822861909866, -0.2769189178943634, 0.4717642366886139, -0.22291776537895203, -0.08717565983533859, -0.5995792746543884, 0.09265980124473572, 0.2721985876560211, -0.3068147897720337, -0.2280506938695907...
estimate when the mouse *will be* out of bounds: -------------------------------------------------------------- (An implementation along the lines of Theo's 3rd option.) ``` // Stage rollout detection: private var mouse_dx:Number; private var mouse_dy:Number; private function detectMouseOutOfBounds ():Void { mou...
[ -0.09940283000469208, -0.24444480240345, 0.22719618678092957, -0.2009332776069641, 0.6201647520065308, 0.2040235698223114, 0.42219632863998413, -0.4585568904876709, 0.05916161090135574, -0.5905270576477051, -0.1616903841495514, 0.639664888381958, -0.1512410044670105, -0.06502272188663483, ...
var speed:Number = Math.max(mouse_dx, mouse_dy) + 5; // Precautionary buffer added. var willBeOutOfBounds:Boolean = ( _xmouse - speed < 0 || _xmouse + speed > Stage.width || _ymouse - speed < 0 ||
[ -0.34192225337028503, -0.3163900375366211, 0.7585083246231079, -0.13197411596775055, 0.40793144702911377, 0.09409672021865845, 0.39012908935546875, -0.28053832054138184, -0.06671313941478729, -0.5467901825904846, -0.04036949947476387, 0.7018788456916809, 0.02308807522058487, -0.21801267564...
_ymouse + speed > Stage.height ); if (willBeOutOfBounds) { _display._alpha = 10; } else { _display._alpha = 100;
[ 0.07816847413778305, -0.13754749298095703, 0.8295812010765076, -0.3423704504966736, 0.3835490047931671, 0.07832705974578857, 0.4337605834007263, -0.2123611718416214, 0.033443696796894073, -0.5942269563674927, -0.3595755100250244, 0.4595256745815277, -0.2655607759952545, 0.1310727596282959,...
} mouse_dx=_xmouse; mouse_dy = _ymouse; } ); Mouse.addListener(mouseListener); } ```
[ -0.2758266031742096, -0.03398656100034714, 0.4244101941585541, -0.6327020525932312, 0.5404120087623596, -0.26661941409111023, 0.3642818331718445, -0.061238501220941544, -0.13839484751224518, -0.4435904920101166, -0.43369951844215393, 0.9704156517982483, -0.5254024863243103, 0.1237899139523...
I have kind of hypothetical question (at least for now :)) Let's say I create list based on some custom content-type. I add some 1000 items into that list (in production). Then customer comes and he say that he need to modify that custom content type. What happens to list if I modify custom content type? Will it be u...
[ 0.8338761925697327, 0.05192965641617775, 0.3846278190612793, 0.2122139036655426, -0.2035156488418579, 0.02051062323153019, -0.06449964642524719, -0.004786836914718151, -0.7221867442131042, -0.5984616279602051, 0.1455858200788498, 0.5121482014656067, -0.11124573647975922, 0.4714308381080627...
content types are "templates" that reside in a gallery. When a site content type is used in a list, the content type is instantiated as a list content type on the given list. Secondly, your content types could be created and modified in several ways, which would decide in what of three modes your data is present in th...
[ 0.6084684729576111, -0.09345174580812454, 0.42579779028892517, 0.3929077386856079, -0.1278119683265686, -0.17949633300304413, -0.11009803414344788, -0.07338847219944, -0.43519970774650574, -0.7284482717514038, -0.003052725689485669, 0.30336976051330566, -0.358314573764801, 0.29458361864089...
the database for the definitions of the content type. If you have created the content type as a feature in [CAML](http://en.wikipedia.org/wiki/Collaborative_Application_Markup_Language), your *site* content type is ghosted (or un-customized as we are supposed to call it in v3) in the database. That basicly means that ...
[ 0.4830881357192993, 0.1283717155456543, 0.39935538172721863, 0.21637949347496033, -0.04182973876595497, -0.4092416763305664, 0.0897950828075409, 0.09431695938110352, -0.47656774520874023, -0.3637581467628479, -0.10309606790542603, 0.47549065947532654, -0.22694848477840424, 0.22650183737277...
here is, that these list content types are instantiated using code, so they are in the "database-only" state. It means your changes would only be seen in your site content types, but not in existing lists using that content type! There are several approaches to fixing this issue, the solution depends on what your need...
[ 0.38470926880836487, -0.09471188485622406, 0.44205281138420105, 0.35214024782180786, 0.036233045160770416, 0.13354052603244781, 0.22660264372825623, -0.26603102684020996, -0.6320725083351135, -0.5524274110794067, -0.014862848445773125, 0.4849493205547333, -0.32212430238723755, 0.3154387772...
type through code, you would lose the data stored in the changed/deleted fields. A solution to this would be to add a completely new content type based on the old one but with the changed fields. You would add the new content type (through code or using feature XML) and use a feature receiver or similar to propegate th...
[ 0.44356635212898254, -0.210364431142807, 0.3490407168865204, 0.298166424036026, -0.12764549255371094, 0.019549865275621414, 0.2808939814567566, -0.2573258876800537, -0.18705488741397858, -0.6267018914222717, -0.21306374669075012, 0.3209715783596039, -0.5291187167167664, 0.12530018389225006...
new meta data. The approach mentioned in the other answer to this question would be preferred if you have direct access to the production environment, and if your customers governance plan allows it. As with other artifacts in SharePoint however, it would be recommended to deploy content types in a structured manner. ...
[ 0.46194615960121155, -0.018265128135681152, 0.4048275649547577, 0.2649332582950592, -0.08472907543182373, -0.16523826122283936, 0.2268727421760559, -0.3285735845565796, -0.29513996839523315, -0.7272735834121704, -0.08460313826799393, 0.5183842182159424, -0.2985128164291382, 0.3377312719821...
it! That leads me to the final approach that is the one I would reccomend, at least for future content types: Create your content types programmatically from the beginning using a feature receiver! That way you always know the true state of your content types (database-only) and you can have a structured approach for ...
[ 0.4672825336456299, -0.5182522535324097, 0.570855975151062, 0.25121554732322693, -0.10709043592214584, -0.2915394604206085, 0.18936441838741302, 0.0085733812302351, -0.11869429051876068, -0.5480523109436035, -0.3334175944328308, 0.6332489252090454, -0.1702263057231903, 0.10685078799724579,...
but that it has been disconnected from the original XML source in the 12 hive. My friend Søren Nielsen has some good points on Content Types in *[Audit your Content Type Hierarchy](http://soerennielsen.wordpress.com/category/content-types/)*. Some of the issues described above can be found briefly mentioned in an MSD...
[ 0.46440404653549194, 0.17664138972759247, 0.08286307007074356, 0.27931106090545654, -0.4662427604198456, -0.17618484795093536, 0.35766732692718506, -0.19394919276237488, -0.3843773901462555, -0.519850492477417, -0.02180343307554722, 0.4510541260242462, -0.41830822825431824, -0.091275677084...
I am updating the code on a daily basis and commit all changes in each case so there is the new code available on server all the time. What I would like to simplify is build automation and version control. Currently I build a project and edit it's name version (Project Name vx.x.x) each time the the boss needs it whi...
[ 0.5431758165359497, 0.3377338647842407, 0.3712022602558136, -0.3350156545639038, -0.27448007464408875, -0.18307285010814667, 0.4189389944076538, 0.20970036089420319, -0.42286795377731323, -0.5910998582839966, 0.02263035625219345, 0.6677553653717041, -0.08805865794420242, 0.3968009650707245...
for buid automation but don't have any experience with it and don't know how could I edit version number in VS or pass the Tortoise's revison number to nant so it could generate project name with release number. Thanks! First, don't try to use [SVN keyword substitution](http://svnbook.red-bean.com/en/1.5/svn.advanced....
[ -0.23757736384868622, -0.23206904530525208, 0.9576624631881714, -0.03428059071302414, 0.11669077724218369, 0.017791835591197014, 0.27702608704566956, -0.2074562907218933, -0.31961044669151306, -0.5871641039848328, -0.18681184947490692, 0.9905272126197815, -0.21401068568229675, 0.1386910974...
to do this is to use the output of the **svnversion** command. You will probably need to write a little script that invokes this command, captures the output and then uses the revision number to update a project file or source code file somewhere. If you can rely on TortoiseSVN being installed, an easier alternative i...
[ 0.1780110001564026, -0.12618288397789001, 0.552699089050293, -0.17025239765644073, -0.01358458399772644, 0.09285934269428253, 0.562569260597229, -0.18864543735980988, -0.5913268327713013, -0.5424795746803284, -0.2152741402387619, 0.612153947353363, -0.12859541177749634, 0.2751253843307495,...
I have a table containing cells with text of various lengths. It is essential that all of the table cells are of the same width. If this means truncating long words or forcing a break in long words then that's OK. I cannot figure out any way of getting this to work. This is for an internal client application so needs...
[ 0.24210835993289948, 0.1666402369737625, 0.38191139698028564, -0.29494526982307434, -0.358119398355484, -0.06079770252108574, 0.07039695233106613, -0.3799833357334137, -0.18668273091316223, -0.7171785831451416, -0.22653193771839142, 0.26768532395362854, -0.24321536719799042, 0.139238730072...
width: 30px; } </style> </head> <body> <table border="2"> <tr> <td>word</td> <td>two words</td> <td>onereallylongword</td> </tr> </table> </body> </html> ``` Stack Overflow has solved a similar problem with long lines of code by using a DIV and having `ov...
[ 0.005979371722787619, -0.293409526348114, 0.33028435707092285, -0.07062079757452011, -0.3334241211414337, -0.02611948922276497, 0.19923609495162964, -0.4388437271118164, -0.21253769099712372, -0.7019701600074768, -0.2584385275840759, 0.31837698817253113, 0.07810033112764359, -0.03068341128...
I'm building a webpage on which I display the *n* newest newsposts on the front page, and this is the method that gets the posts and returns them to the .aspx-file. I use a asp:substitution-control to insert the string into the webpage. I think my way of doing this i kind of messy and ugly, and not very flexible if i ...
[ 0.9395994544029236, 0.25093427300453186, 0.2830110490322113, -0.026811063289642334, -0.02977166324853897, -0.007435595616698265, -0.0022049674298614264, 0.13352376222610474, -0.11768169701099396, -0.6768432259559631, 0.18776310980319977, 0.21186570823192596, -0.21220983564853668, 0.0868994...
way of handing the data onto the template-file. Plus, when (if?) i've put the template in a separate file - how do i repeat it within another .aspx-file (within a contentplaceholder, if that matters. The layout is controlled by a master-page) with different values for each instance? ``` public static string getShortP...
[ 0.3350710868835449, -0.05673915147781372, 0.5502515435218811, 0.07164481282234192, -0.031211087480187416, 0.0955757200717926, 0.2443758100271225, -0.3995366394519806, -0.0325399748980999, -0.7938274145126343, -0.23335152864456177, 0.3528730273246765, -0.26893216371536255, 0.379286050796508...
"news.isPublished, users.firstName, users.lastName FROM news INNER JOIN users ON news.userid = users.userid " + "ORDER BY id DESC;"); DataTableReader r = tbl.CreateDataReader(); StringBuilder s = new StringBuilder(""); while (r.Read()) { /*
[ 0.14676102995872498, -0.21894791722297668, 0.5134913921356201, -0.1116768941283226, 0.005972308572381735, 0.13797882199287415, 0.26727423071861267, -0.19384153187274933, -0.37936651706695557, -0.5637782216072083, -0.4485507309436798, 0.3490431606769562, -0.22847311198711395, 0.594255268573...
THIS */ s.Append( "<div class=\"newsBox\">" + System.Environment.NewLine + "<h2>" + r["title"]+ "</h2>" + System.Environment.NewLine + "<p>" + r["excerpt"] + "</p>" + System.Environment.NewLine + "</div>" +System.Environment.NewLine+System.Environment.NewLine ...
[ -0.30942967534065247, -0.2830970585346222, 0.7306979298591614, -0.11674971133470535, 0.3460003733634949, 0.12538300454616547, 0.23687998950481415, -0.6163063049316406, -0.006369428243488073, -0.5932697653770447, -0.6661503911018372, 0.20825828611850739, -0.39024674892425537, 0.182929381728...
(you can use either of these statements to achieve this): ``` [NSThread detachNewThreadSelector:@selector(myThreadMainMethod:) toTarget:self withObject:nil]; ``` OR ``` NSThread *myThread = [[NSThread alloc] initWithTarget:self selector:@selector(myThreadMainMethod:) obje...
[ -0.21453189849853516, 0.03124205395579338, 0.08994267880916595, 0.0477687269449234, -0.1917700171470642, 0.30501437187194824, 0.5018499493598938, 0.010655519552528858, -0.2226325273513794, -0.4882014989852905, -0.4249221682548523, 0.7421069741249084, 0.13012336194515228, -0.031113181263208...
I am writing a web service in Java, and I am **trying to figure out the best way to define error codes and their associated error strings**. I need to have a numerical error code and an error string grouped together. Both the error code and error string will be sent to the client accessing the web service. For example,...
[ 0.2395840734243393, 0.5444076061248779, 0.04607945680618286, -0.27712759375572205, -0.08216947317123413, -0.08618944883346558, 0.5169921517372131, -0.05682831630110741, 0.14739061892032623, -0.9161301255226135, 0.06608816981315613, 0.48452305793762207, -0.32149219512939453, 0.0103789987042...
be shown the message: > "Error #1 has occured: There was a > problem accessing the database." My first thought was to used an `Enum` of the error codes and override the `toString` methods to return the error strings. Here is what I came up with: ``` public enum Errors { DATABASE { @Override public String ...
[ 0.17385812103748322, 0.27109771966934204, -0.027362274006009102, 0.07983431965112686, 0.43384236097335815, 0.08046689629554749, 0.3839483857154846, 0.1699315905570984, -0.304099440574646, -0.5509504079818726, 0.34846559166908264, 0.5729127526283264, -0.6053392887115479, 0.37978386878967285...
already exists."; } }, // more errors follow } ``` **My question is:** Is there a better way to do this? I would prefer an solution in code, rather than reading from an external file. I am using Javadoc for this project, and being able to document the error codes in-line and have them automatically update in...
[ 0.21274572610855103, 0.3425682783126831, 0.16429513692855835, 0.09822986274957657, 0.2919442057609558, -0.06835776567459106, 0.3443572521209717, 0.12780970335006714, -0.09694375842809677, -0.6703380346298218, 0.09033148735761642, 0.5208634734153748, -0.34344932436943054, 0.3121613562107086...
private final String description; private Error(int code, String description) { this.code = code; this.description = description; } public String getDescription() { return description; } public int getCode() { return code; } @Override public String toString() { return code + ":...
[ -0.15420016646385193, -0.04724478721618652, 0.2999507486820221, -0.11037381738424301, 0.003857370000332594, -0.13573391735553741, 0.5980353951454163, -0.3251074254512787, 0.0168620552867651, -0.42843663692474365, -0.37280964851379395, 0.8304511308670044, -0.2458408921957016, 0.274346828460...
Also note that I've explicitly specified the code instead of using the ordinal value - this makes it easier to change the order and add/remove errors later. Don't forget that this isn't internationalised at all - but unless your web service client sends you a locale description, you can't easily internationalise it yo...
[ 0.3235906660556793, 0.15391521155834198, 0.1285872459411621, 0.011949467472732067, -0.1001744270324707, -0.3573952615261078, 0.6158114075660706, 0.3640937805175781, -0.45584776997566223, -0.36342528462409973, -0.11751794815063477, 0.15951748192310333, -0.15953217446804047, 0.19245462119579...
I am using `enum` keyword to define set of values which I read from database tables. I am not confident that these values will remain constant in the database and in `switch` `case` statement we need to give constant values. How can I solve this problem? Well there's certainly a better implementation of the enum solut...
[ 0.3312097489833832, 0.5354533791542053, -0.017788302153348923, 0.11332356184720993, 0.3687320947647095, 0.08929181843996048, 0.5572627186775208, 0.09471438080072403, -0.215071901679039, -0.4181208312511444, 0.2588406503200531, 0.3539784252643585, -0.4243921637535095, 0.6727622747421265, ...
this.description = description; } public String getDescription() { return description; } public int getCode() { return code; } @Override public String toString() { return code + ": " + description; } } ``` You may want to override toString() to just return the description instead - no...
[ 0.13953731954097748, 0.17875733971595764, 0.12396629899740219, 0.010697425343096256, 0.13599936664104462, -0.24092648923397064, 0.5617184042930603, -0.42615950107574463, -0.2025432288646698, -0.5069012641906738, -0.28583404421806335, 0.8422446250915527, -0.5033528208732605, 0.2043476104736...
to change the order and add/remove errors later. Don't forget that this isn't internationalised at all - but unless your web service client sends you a locale description, you can't easily internationalise it yourself anyway. At least they'll have the error code to use for i18n at the client side...
[ 0.372424840927124, 0.22643980383872986, 0.03104320727288723, 0.04213881492614746, 0.039148107171058655, -0.3476831018924713, 0.6487184166908264, 0.34729722142219543, -0.4302093982696533, -0.33411088585853577, -0.2927880585193634, 0.11352958530187607, -0.22100350260734558, 0.175811901688575...
In C#/ASP.NET 3.5, I have a DataTable which pulls rows from the database. I want to dynamically apply a sort filter to the datatable (could be a dataview), and then do a loop through the "rows" of the sorted data to use each row for some metrics. I would greatly prefer not to hit the database each time to do custom so...
[ 0.0849376693367958, -0.038300465792417526, 0.3908373713493347, -0.08693451434373856, -0.1470986306667328, -0.2584856450557709, -0.013966179452836514, -0.16948162019252777, -0.3491683602333069, -0.6786476373672485, -0.2280823141336441, 0.47101840376853943, -0.4690513014793396, -0.0481385886...