text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
only way is to really come up with a standard that is reasonable and stick to it and program around that.
[ 0.6531871557235718, 0.3668482005596161, -0.09843190759420395, 0.29510313272476196, 0.21309827268123627, -0.3321436643600464, 0.3449018597602844, -0.20853102207183838, 0.12980800867080688, -0.5545269250869751, 0.2978972792625427, 0.6006324887275696, 0.07054638117551804, -0.3696773946285248,...
I have a business case whereby I need to be able to specify my own calling convention when using P/Invoke. Specifically, I have a legacy dll which uses a non-standard ABI, and I need to able to specify the calling convention for each function. For example, one function in this dll accepts its first two arguments via ...
[ 0.10045183449983597, 0.12564754486083984, 0.26918989419937134, -0.20294103026390076, 0.04625128209590912, 0.29307281970977783, 0.0024789669550955296, -0.3355586528778076, 0.2389412820339203, -0.7351822257041931, 0.0007938143098726869, 0.5615007281303406, -0.4429363012313843, -0.03633360937...
access these functions. My other option would be to hand-roll my own custom P/Invoke, which is undesirable for obvious reasons. Any help is appreciated, thanks, I don't understand what you mean with custom P/Invoke, but I can't see how you could get away without non-managed C++ with inline assembly. However, since al...
[ 0.25486037135124207, 0.11779731512069702, 0.2496872991323471, 0.461386114358902, -0.2372017502784729, -0.05466437712311745, 0.3861660063266754, 0.2141828089952469, -0.09392131865024567, -0.6778275966644287, 0.023638200014829636, 0.5801143050193787, -0.16289456188678741, 0.0454421192407608,...
be really simple: ``` int RealFunction(int param1, const char * param2, char param 3); int MyFunction(int param1, int param2, int param3) { // argument types do not matter as long as they are not doubles or structures __asm { mov eax, param1 mov ebx, param2 push param3 call RealFunction ...
[ 0.16782405972480774, 0.006175093352794647, 0.5078586339950562, -0.021175576373934746, -0.05905665084719658, 0.4197098910808563, 0.5116693377494812, -0.5009716749191284, -0.2511807382106781, -0.3890884816646576, -0.3557092845439911, 0.6110376119613647, -0.29377198219299316, -0.2674544453620...
in eax, you will need to do mov eax, <wherever the return value is> here } } ```
[ 0.1237085685133934, 0.30074217915534973, 0.3460097014904022, -0.2392812967300415, 0.30276456475257874, -0.2342527210712433, 0.1953526735305786, 0.009747320786118507, -0.008958784863352776, -0.5812618732452393, -0.4359402060508728, 0.9404950737953186, -0.48521697521209717, -0.26642233133316...
Can anyone give a concise set of real-world considerations that would drive the choice of whether or not to use inetd to manage a program that acts as a network server? (If inetd is used, I think it alters the requirements around networking code in the program, so I think it's definitely programming-related and not ge...
[ 0.1622912883758545, 0.008648459799587727, -0.16321717202663422, 0.2786674499511719, -0.06133565679192543, -0.31889623403549194, -0.007869881577789783, 0.03287303447723389, -0.22715726494789124, -0.3188154399394989, 0.2487940490245819, 0.665505051612854, -0.006110954564064741, 0.08911240845...
(on-demand, infrequently used, lightweight) and got me interested in the more general question. It depends on the usage pattern for your service. If the startup time for your daemon is low, and you expect it to be used infrequently, then inted might be a good fit. It reduces or even eliminates the need to write any add...
[ 0.396271675825119, -0.19210544228553772, -0.09093085676431656, 0.10219265520572662, -0.41692811250686646, -0.22695116698741913, 0.1980142742395401, -0.08432083576917648, -0.25876274704933167, -0.6752845644950867, -0.15208740532398224, 0.47040891647338867, -0.08716723322868347, -0.006776510...
to manage. Most programming languages these days have easy to use socket libraries so in many cases the networking code may not even be that difficult. I've found in my experience that few admins these days are familiar with inetd. Most daemons just provide their own init script. In fact, of the few hundred systems wh...
[ 0.418314665555954, 0.05594642460346222, 0.05592074245214462, 0.36616286635398865, -0.3186177611351013, -0.022388868033885956, 0.47833898663520813, 0.34315890073776245, -0.36567533016204834, -0.7918736934661865, -0.1327679455280304, 0.6218904256820679, -0.08353173732757568, -0.0193429868668...
I'm looking at implementing a failover mechanism for a MySQL database using MySQL Proxy (<http://forge.mysql.com/wiki/MySQL_Proxy>) My proposed setup is as follows: One active MySQL server and one passive MySQL with two way replication enabled between the both of them. MySQL Proxy is the failover that sits in between ...
[ 0.17082519829273224, -0.06607180088758469, 0.16177178919315338, 0.0456877201795578, 0.130976602435112, 0.16585059463977814, 0.058633334934711456, 0.15609268844127655, -0.34149864315986633, -0.7678806185722351, 0.12625108659267426, 0.38353678584098816, -0.184536412358284, 0.0627785995602607...
I'm on Windows and hence the need for MySQL Proxy. MySQL Proxy is a valid solution, plenty of people have been using it for high traffic production systems. There are a few things to remember: * It's still in Alpha, so you really want to test it thoroughly before implementing it. * Your application should have a failo...
[ 0.2904900312423706, 0.1784573197364807, 0.6867154836654663, 0.10978243499994278, 0.008521541953086853, -0.28438836336135864, 0.3549724221229553, 0.3112758696079254, -0.249252051115036, -0.9832333326339722, 0.03647458180785179, 0.3123539388179779, 0.07578803598880768, 0.028257910162210464, ...
latency than a hardware load balancer, but it will allow you to customize it much more with Lua.
[ 0.05498723313212395, -0.32336434721946716, 0.3568023145198822, 0.18207725882530212, 0.11221995949745178, -0.18922093510627747, -0.20131656527519226, 0.01070548128336668, -0.1343093365430832, -0.7819259166717529, 0.04731064662337303, 0.5047119855880737, 0.021018216386437416, -0.245908319950...
There is a JavaScript parser at least in C and Java (Mozilla), in JavaScript (Mozilla again) and Ruby. Is there any currently out there for Python? I don't need a JavaScript interpreter, per se, just a parser that's up to ECMA-262 standards. A quick google search revealed no immediate answers, so I'm asking the SO co...
[ 0.05901646241545677, 0.28875109553337097, 0.03200644254684448, -0.1568027138710022, -0.5097001791000366, 0.3786255717277527, 0.4929259419441223, -0.03690064325928688, -0.3527725338935852, -0.6364851593971252, -0.027602724730968475, 0.26338282227516174, -0.34273821115493774, -0.279929071664...
[Python API](https://github.com/antlr/antlr4/blob/master/doc/python-target.md) available - so you can call the lexer (recognizer) generated from the grammar directly from Python (good luck).
[ 0.14029178023338318, 0.13150633871555328, 0.3044683337211609, -0.28320640325546265, -0.2800742983818054, -0.170247420668602, 0.13834774494171143, 0.000699070340488106, -0.15302972495555878, -0.16701002418994904, -0.09096048027276993, 0.8082023859024048, -0.18642717599868774, -0.37620803713...
I have a weird error in my C++ classes at the moment. I have an ActiveX wrapper class (as part of wxWidgets) that i added a new virtual function to. I have another class that inherits from the ActiveX one (wxIEHtmlWin) however the ActiveX class always calls its own function instead of the one in wxIEHtmlWin which overr...
[ 0.18231727182865143, -0.051853589713573456, 0.06179145351052284, 0.21889185905456543, -0.06516441702842712, -0.27573269605636597, 0.6234691739082336, 0.07396762073040009, 0.06342455744743347, -0.48744598031044006, 0.17092594504356384, 0.8170868158340454, -0.6167227029800415, 0.419843524694...
bug in Visual Studio? ActiveX class ``` protected: virtual FrameSite* getNewFrameSite()=0; ``` wxIEHtmlWin class ``` class wxIEHtmlWin : public wxActiveX { protected: FrameSite* getNewFrameSite(); } FrameSite* wxIEHtmlWin::getNewFrameSite() { return new gcFrameSite(this); } ``` Edit: I've added another ...
[ 0.26851820945739746, -0.055490583181381226, 0.27090150117874146, -0.21433471143245697, 0.20415721833705902, 0.09530121088027954, 0.39015835523605347, -0.23900218307971954, -0.06067029759287834, -0.6022844314575195, -0.07962124049663544, 0.6387947201728821, -0.9551620483398438, -0.166734650...
size, style, name); SetupBrowser(); } ``` Now i know why wxWidgets supports two part construction. You are calling the virtual method from within the class's constructor (via another call). This will call the method on the current class as the sub-class hasn't been constructed yet. The fix is to use an init() met...
[ 0.1811584234237671, -0.17736464738845825, 0.6080864667892456, -0.2602141201496124, 0.018535401672124863, 0.01606598310172558, 0.018048040568828583, -0.2580021023750305, 0.06610510498285294, -0.8635869026184082, -0.19741854071617126, 0.5157696604728699, -0.5180802345275879, 0.08935634791851...
is there a way to add the results of 2 different queries to a resultset? something like that: ``` ResultSet rs ; i=0; while(i<=l) ResultSet rs1 = select * from tablei; rs = rs + rs1; i++; } ``` I know that I can do it with union, but I have a lot queries and if I use UNION the query is too slow. Any i...
[ 0.09320652484893799, -0.18781979382038116, 0.21937251091003418, -0.06014840677380562, -0.15329046547412872, 0.03815169632434845, 0.10235385596752167, -0.41389748454093933, -0.28398290276527405, -0.5677255988121033, 0.04800143092870712, 0.19409844279289246, -0.47699639201164246, -0.02694065...
I have worked a bit with Django and I quite like its project/applications model : you can build a Django project by assembling one or more Django applications. These applications can be autonomous, or some applications can be built on top of other applications. An application can easily rely on another application's mo...
[ 0.6363834738731384, 0.2613382339477539, -0.30747437477111816, -0.022990116849541664, -0.32435449957847595, -0.39109545946121216, -0.0032082872930914164, 0.20922024548053741, -0.15831395983695984, -0.4994065463542938, 0.2763957679271698, 0.4389040470123291, -0.11451713740825653, -0.09095600...
in Rails. Basically, in Rails, one project = one application. Our project has started off as a huge monolithic app, and we are now trying to figure out how to split it into smaller chunks. For example, our current application allows us to manage partners and contracts (among other things). I would like to have a "Part...
[ 0.3263678252696991, -0.08959317207336426, -0.1397833526134491, 0.2016405463218689, 0.025091474875807762, -0.14154720306396484, -0.02555357851088047, -0.11928814649581909, -0.1352958083152771, -0.7344982028007507, 0.09649340063333511, 0.18703784048557281, -0.6229920983314514, -0.06170751154...
no knowledge of the "Contracts" app). For now, I see the following as the main options: 1. make these applications communicate through REST requests (each app would act as a Webservice): this is nice, but it seems to prohibit reusing other applications' views. For example, if the "Partners" app has a nice page to sho...
[ 0.45841923356056213, -0.07283563166856766, 0.5932243466377258, 0.12548471987247467, 0.28621619939804077, -0.36909040808677673, 0.2994857430458069, -0.08110011368989944, -0.13325588405132294, -0.6799941658973694, 0.016712110489606857, 0.6546705365180969, -0.34854957461357117, -0.20285521447...
request (it will get an object representation, not a view), then copy/paste the partner-details page's source code from the "Partners" app to the "Contracts" app. 2. turn these applications into plugins : not as nice, and a bit more difficult, but seems to allow model & views reuse 3. use svn external to share some mod...
[ 0.22675715386867523, -0.2381765991449356, 0.4851277768611908, 0.27261826395988464, -0.08659408986568451, 0.07366066426038742, 0.36780473589897156, -0.4353708326816559, -0.062233828008174896, -0.7363836169242859, 0.10925743728876114, 0.4403640627861023, -0.3098389208316803, -0.1658827215433...
2.2 now. This, to some or all extent, will likely rolled into Rails 2.3 (see below) 2. Switch to [Merb](http://merbivore.com), which has something called "slices" that might offer what you're looking for. Anyway, if [this](http://yehudakatz.com/2008/12/23/rails-and-merb-merge/) is correct (and who am I to doubt Yehuda ...
[ 0.22062915563583374, -0.15394902229309082, 0.3482859432697296, -0.2629132568836212, -0.2429153472185135, 0.08386534452438354, 0.361910343170166, -0.4834379255771637, -0.12797020375728607, -0.780387282371521, -0.18450099229812622, 0.26281121373176575, -0.14808422327041626, -0.11478865891695...
subdirectory within the relevant `app` subdirectory, although this is perhaps less clean to having a separate set of Rails directories for each "application". Of these, I have no experience of (2) because I'm tied (in infrastructure terms) to Rails, but that's OK, I like Rails. I'm planning to take look at (1) and may...
[ 0.3364852964878082, 0.03158608451485634, 0.43990176916122437, 0.04707761108875275, -0.14727166295051575, -0.016422173008322716, 0.2305436134338379, 0.14845478534698486, -0.2723832428455353, -0.5998368859291077, -0.1549394130706787, 0.6172088980674744, -0.2921261787414551, -0.06796899437904...
[This Wikipedia page](http://en.wikipedia.org/wiki/Cryptographic_hash_function) has an extensive list of hashing methods As you can see, both MD5 and Sha1 have been broken (in Cryptography, "broken" means there's an attack less complex than the brute force attack. In other words, if you need 1 million year to find a c...
[ -0.19350050389766693, 0.2793026864528656, -0.11523386090993881, 0.14564728736877441, -0.11851529777050018, -0.401483416557312, 0.3472787141799927, 0.12448185682296753, -0.6584382057189941, -0.20228508114814758, -0.05897529050707817, 0.07400546222925186, 0.030031541362404823, 0.572559773921...
that ressearchers concentrate their efforts on mainstream algorithm (that is MD5 and SHA1), so unbroken hashes may be unsecure aswell. These days most people still use SHA1 or even MD5, broken or not. Because the current state of the art in hashing is that we have some functions that we know have theoretical vulnerabil...
[ 0.20350700616836548, 0.13998177647590637, 0.1306990087032318, 0.1443682610988617, -0.10568711906671524, -0.20328840613365173, 0.4056204855442047, 0.15596410632133484, -0.41419222950935364, -0.3773893117904663, -0.09051370620727539, 0.5738996267318726, 0.019811607897281647, 0.34887778759002...
because if you care about security that much, you probably wouldn't be using passwords. Where it will matter more is if you are using digital signature, SSL, IPSEC, etc, which all rely on hash functions, and if you need the hash function to remain secure for a long time. However here you have little choice but to wait...
[ 0.44479867815971375, 0.17366580665111542, 0.1910078078508377, 0.3049349784851074, 0.3433755934238434, -0.5026775598526001, 0.3338618874549866, 0.18197014927864075, -0.4931255280971527, -0.45209237933158875, 0.009824523702263832, 0.4808579683303833, 0.006701683159917593, 0.07127024233341217...
to be in your own code, or people threats, than somebody attacking your hash function! Still, if designing a new system, the advice to design it so you can replace *any* of your crypto algorithms at any time remains valuable. Ideally via configuration / plugin, and not a recompile.
[ 0.37477636337280273, -0.06085219234228134, -0.1455879807472229, 0.11186426132917404, 0.0010696618119254708, -0.35567203164100647, 0.504396915435791, 0.03447689116001129, -0.11620552837848663, -0.4828079640865326, -0.30272379517555237, 0.4844244122505188, -0.0027512263040989637, -0.21656307...
``` Declare @BadDecimal varchar(5) Set @BadDecimal = '4.5' Declare @GoodDecimal Decimal Set @GoodDecimal = @BadDecimal Select @GoodDecimal --Outputs 5 ``` Why? Try ``` Declare @GoodDecimal Decimal(2,1) ``` edit: changed to (2,1) after request.
[ 0.01795439049601555, 0.22101061046123505, 0.3157770335674286, -0.2692456543445587, -0.18934212625026703, 0.11937914043664932, 0.17842218279838562, -0.30173787474632263, -0.11865579336881638, -0.2314852476119995, -0.159786656498909, 0.615899384021759, -0.32556524872779846, 0.166152566671371...
I have several web services I need to create for them some testing mechanism and to use it as a tool for stress testing. What's the best way to tackle this? Use a tool for the purpose, like [The Grinder](http://grinder.sourceforge.net/)
[ 0.929916262626648, 0.21844175457954407, -0.1897527575492859, 0.22543217241764069, 0.05456145480275154, -0.1742677390575409, 0.19276686012744904, 0.28533974289894104, -0.07034347951412201, -0.6574053168296814, 0.6201465129852295, 0.7511438727378845, 0.19970709085464478, 0.06605681777000427,...
A very strange thing happens to me when I try to insert Non-Latin characters (e.g. Hebrew, Arabic etc. using N'string to insert') using PHP. This thing happens with all the extensions I've tried: mssql, odbc and native driver. When inserting through PHP code, only when selecting through PHP it works fine and I can rea...
[ 0.048777058720588684, 0.28677961230278015, 0.03148627281188965, -0.050151512026786804, -0.25239017605781555, 0.25446537137031555, 0.07869689911603928, 0.37908434867858887, -0.00043615620234049857, -0.6866191029548645, 0.15503738820552826, 0.3136577010154724, -0.22834673523902893, 0.0548501...
purpose, like [The Grinder](http://grinder.sourceforge.net/)
[ 0.8200060725212097, 0.35142531991004944, -0.31414198875427246, -0.21351735293865204, -0.16039153933525085, 0.06888463348150253, 0.618492066860199, 0.18550872802734375, -0.2949922978878021, -0.2775122821331024, 0.4150427281856537, 0.646761953830719, -0.1336720585823059, 0.09708797186613083,...
I am currently working on a website that is an advertisement portal for businesses. Advertisers can create an account, select various options for listing (State, caregory, etc) and upload a graphic is measured in a multiples of an "unit". An "unit" is an image or a flash file that is `180px` wide and `120` high. An adv...
[ 1.0840142965316772, 0.08584950119256973, 0.6875962615013123, -0.03207000717520714, -0.07623470574617386, 0.19127380847930908, -0.006184339988976717, 0.11839094758033752, -0.21872586011886597, -0.7224799394607544, 0.19767601788043976, 0.0007319002761505544, 0.04749993979930878, 0.1356626003...
to lay out the "units" and display them properly, without any empty space between them. As an example, if we had 4 advertisements, a horizontal 2 unit ad, a vertical 2 unit and 2 single unit ad, like so - ``` | | 2 unit ad | 2 ------------------| unit
[ 0.4430948793888092, 0.24581623077392578, 0.36554211378097534, 0.15908151865005493, -0.04236664995551109, 0.4879075884819031, -0.07212263345718384, -0.10531973093748093, -0.07282721251249313, -0.6852620840072632, -0.004413494374603033, 0.19940894842147827, -0.13815049827098846, 0.1758513152...
| | ad 1 unit | 1 unit | | | | | ``` I am currently storing the advertisements units in a database with attributes that are used in the web form to build a table (i.e., colspan, rowspan, etc). I am not sure if this is the right approach, I fear it is not. I shall
[ 0.275912880897522, 0.7019591927528381, 0.6347344517707825, -0.04381095990538597, -0.007505249232053757, 0.265824556350708, -0.3021396994590759, -0.10933542251586914, 0.07592583447694778, -0.6328940391540527, 0.13688607513904572, 0.3496062159538269, -0.3243616223335266, 0.08296041190624237,...
be very grateful if I got some advice. Thanks, Indy That's a tough one. If you want to use divs and css you can try floating the ads. The only problem is that you can't render the divs in an arbitrary order since they won't always try to take up the available room. The same would be true if you were using tables thoug...
[ 0.4266884922981262, -0.007969873026013374, 0.4773278832435608, 0.20358175039291382, -0.3418797254562378, -0.013709736056625843, 0.021566521376371384, -0.00809214822947979, -0.0977364033460617, -0.8127254247665405, 0.17801201343536377, 0.43347951769828796, -0.24761593341827393, -0.114587754...
div.ad { float: right; margin: 0; padding: 0; width: 180px; height: 120px; background: #DDD; } div.adhorz { width: 360px; height: 120px; } div.advert {
[ 0.34495699405670166, 0.2392324060201645, 0.7796618342399597, -0.3389013111591339, -0.3529416620731354, 0.36490941047668457, 0.0639045313000679, -0.22379475831985474, 0.3836895525455475, -0.4082075357437134, -0.19030465185642242, 0.26751473546028137, -0.32353734970092773, 0.0387296117842197...
width: 180px; height: 240px; } </style> </head> <body> <div class="adcontainer"> <div class="ad advert">ad v</div> <div class="ad adhorz">ad h</div> <div class="ad">ad 1</div> <div class="ad">ad 2</div> </div> </body> </html> ```
[ 0.1351601481437683, -0.20173445343971252, 0.6845534443855286, -0.3573128581047058, -0.6684269309043884, 0.4009309411048889, 0.17827117443084717, -0.5797445178031921, -0.0022724797017872334, -0.5890878438949585, -0.015428795479238033, 0.435079425573349, -0.08860347419977188, 0.1304287612438...
Is there any way to change style of text, format the text inside a Javascript Alert box. e.g. changing its colour, making it bold, etc.? Also, if there an Alert avalaible with a 'Yes', 'No' button instead of an 'OK'/'Cancel' one? **No**, I'm afraid that is not possible. With JavaScript, you are limited to only 3 popu...
[ 0.23017899692058563, -0.06851567327976227, 0.4357551336288452, 0.09213915467262268, -0.19050203263759613, -0.22164592146873474, 0.27343758940696716, 0.10023447126150131, -0.19476138055324554, -0.7410159111022949, -0.45498335361480713, 0.41582345962524414, -0.3871600329875946, -0.4145526587...
I have an application thats going to use Active Directory for Authentication. This will be used in mnay locaitons, so I want the user to be able to input their AD domain into a settings file. So, the first time they run this app, they won't be able to login, because they haven't entered the AD Domain name, so want I wa...
[ 0.2839917540550232, 0.39685189723968506, 0.5865312814712524, 0.14350555837154388, -0.08095503598451614, -0.003759193466976285, 0.08379245549440384, -0.2278105914592743, -0.075861856341362, -0.6406121253967285, 0.1343258172273636, 0.3901285231113434, -0.23710784316062927, 0.1113050505518913...
the index page. Is this possible? In particualr what I need to know, is the best way to make it so the settings page does not require authetnication if the ADName value is empty, but does if it is not. It's absolutely possible. Using the Session\_OnStart in the global.asax check if the user's info has been set using a...
[ 0.11395913362503052, -0.0008571051876060665, 0.714358925819397, 0.147312730550766, -0.03835876286029816, -0.17286747694015503, 0.36529961228370667, 0.21966415643692017, -0.12676319479942322, -0.8126916885375977, -0.041835200041532516, 0.9209966063499451, -0.2811000943183899, 0.030799109488...
Is there a way to call Static Classes / Methods by name? Example: ``` $name = 'StaticClass'; ($name)::foo(); ``` I have classes which I keep all static methods in and I'd like to call them this way. ``` $name::foo() ``` is possible since PHP5.3. In earlier versions you have to use ``` call_user_func(array($clas...
[ -0.010552685707807541, -0.0019825573544949293, 0.298451691865921, -0.35314875841140747, -0.15989233553409576, -0.14112931489944458, 0.20421303808689117, 0.045964449644088745, -0.3908555805683136, -0.04358583316206932, -0.04177909716963768, 0.6387823820114136, -0.5299473404884338, 0.0201445...
I need to convert a flat file to DB using MS SSIS. I need a way to look into a particular folder to fetch the (only) flat file, filename is of the format "FileName-CCYYMMDD.txt". Please help me if there is way to add a file from the folder OR Get a file name of the format "Filename-CCYYMMDD.txt" where is CCYYMMDD is ...
[ 0.26460888981819153, -0.13503585755825043, 0.41740652918815613, 0.15302300453186035, -0.19162750244140625, 0.00446365587413311, 0.07920140773057938, -0.11673571169376373, -0.23060394823551178, -0.9855388402938843, 0.042306844145059586, 0.41471096873283386, -0.31339406967163086, 0.613869905...
the below expression. "D:\CC" + RIGHT((DT\_WSTR,4)YEAR(GETDATE()),2) + (DT\_WSTR,2)MONTH(GETDATE()) + (DT\_WSTR,2)DAY(GETDATE()) + ".TXT"
[ 0.5691918730735779, -0.08652601391077042, 0.7778834700584412, -0.1863388568162918, 0.15786395967006683, 0.11205457150936127, -0.04759961739182472, 0.07689642161130905, -0.14705213904380798, -0.30098956823349, -0.4151134490966797, 0.211861714720726, 0.052033133804798126, 0.40660250186920166...
We have an application that uses a dual monitor setup - User A will work with Monitor 1, and user B will work with Monitor 2 simultaneously. Monitor 2 is a touch screen device. Now, the problem is, when User A types something in his screen, if User B tries to do something, User A will end up in losing the focus from h...
[ 0.45023274421691895, -0.06972149014472961, 0.15235693752765656, 0.11022161692380905, -0.013115939684212208, 0.02396012470126152, 0.07802215218544006, -0.11821813136339188, -0.2365332543849945, -0.814683735370636, 0.1985427737236023, 0.6743097305297852, -0.5802577137947083, -0.2114159762859...
code in the form that you show on the touch screen: ``` protected override CreateParams CreateParams { get { const int WS_EX_NOACTIVATE = 0x08000000; CreateParams param = base.CreateParams; param.ExStyle |= WS_EX_NOACTIVATE; return param; } } ``` That makes sure that the form won't steal the focu...
[ 0.3137850761413574, -0.19934727251529694, 0.7127492427825928, -0.14178626239299774, 0.09805526584386826, -0.09049395471811295, 0.4260559678077698, -0.41661134362220764, -0.10685556381940842, -0.8470119833946228, -0.5029518604278564, 0.31904351711273193, -0.40025877952575684, 0.024373654276...
= true; t.SetApartmentState(ApartmentState.STA); t.Start(); } private void SecondMonitor() { Form2 f2 = new Form2(); f2.StartPosition = FormStartPosition.Manual; f2.Left = 800; // Use Screen class here... f2.ShowDialog(); } ```
[ 0.3858998119831085, -0.34441670775413513, 0.5006690621376038, -0.30292072892189026, 0.40526703000068665, 0.021961286664009094, 0.48890846967697144, -0.49679264426231384, -0.09278113394975662, -0.8846340775489807, -0.7114961743354797, 0.5568618178367615, -0.23778347671031952, 0.135586872696...
Alright, I'll preface this with the fact that I'm a GTK *and* Python newb, but I haven't been able to dig up the information I needed. Basically what I have is a list of Radio Buttons, and based on which one is checked, I need to connect a button to a different function. I tried creating all my radio buttons, and then ...
[ 0.7346175312995911, 0.41868290305137634, 0.24931854009628296, -0.06767842173576355, -0.12334014475345612, -0.2828015685081482, 0.2500172257423401, 0.06083706021308899, -0.18738491833209991, -0.6880524158477783, 0.011496876366436481, 0.9734705686569214, -0.3815382421016693, 0.10873551666736...
= gtk.VBox(False, 0) self.updatePageRadio = gtk.RadioButton(None, "Updating Page") self.updatePostRadio = gtk.RadioButton(self.updatePageRadio, "Updating Blog Post") self.pageRadio = gtk.RadioButton(self.updatePageRadio, "New Page") self.blogRadio = gtk.RadioButton(self.updatePageRadio, "New Blog Post")...
[ 0.12763674557209015, 0.14481161534786224, 0.9657096862792969, -0.1106676533818245, -0.13598041236400604, -0.023651791736483574, 0.48573440313339233, -0.5130525827407837, -0.06861875206232071, -0.8113817572593689, -0.34548142552375793, 0.869860827922821, -0.277504563331604, 0.26998025178909...
False, False, 30) self.contentProceedButton = gtk.Button(" Proceed ") self.contentManageHBoxBottom.pack_end(self.contentProceedButton, False, False, 30) if self.updatePageRadio.get_active(): self.contentProceedButton.connect("clicked", self.updatePage) elif self.updatePostRadio.get_activ...
[ 0.16760225594043732, -0.011230124160647392, 0.5534235835075378, -0.2298206388950348, -0.15813788771629333, -0.05282912030816078, 0.4577188789844513, -0.43952953815460205, -0.14403587579727173, -0.8028804063796997, -0.5889360308647156, 0.6047570705413818, -0.4492623209953308, -0.02949854731...
self.contentProceedButton.connect("clicked", self.removePage) elif self.removePostRadio.get_active(): self.contentProceedButton.connect("clicked", self.removeBlogPost) elif self.removeSpaceRadio.get_active(): self.contentProceedButton.connect("clicked", self.removeSpace) ``` Edit: (since you ...
[ 0.28645530343055725, 0.13653339445590973, 0.49607643485069275, -0.283632755279541, -0.2747829854488373, -0.39403948187828064, 0.4011324942111969, -0.4770173728466034, -0.1401863843202591, -0.6403538584709167, -0.25071072578430176, 0.75481778383255, -0.6263961791992188, -0.025965616106987, ...
in [this document](http://www.pygtk.org/docs/pygtk/class-gtkradiobutton.html), but here is a small practical example. Firstly a group is really just a RadioButton itself that is used to collect a number of other RadioButtons. You specify a group as the first argument to the constructor. ``` r1 = gtk.RadioButton(None,...
[ 0.16238071024417877, -0.18063238263130188, 0.29349562525749207, -0.16220739483833313, -0.440170019865036, -0.2512914836406708, -0.02641318179666996, -0.8174691200256348, -0.34056606888771057, -0.2273743450641632, -0.47100961208343506, 0.5358737111091614, -0.766753077507019, 0.0138382697477...
as the group argument r3 = gtk.RadioButton(r1, label='Dog') # again use r1 ``` Now all the radio buttons will be synchronised. And the matter of reading them is as easy as: ``` active_radios = [r for r in r1.get_group() if r.get_active()] ```
[ -0.07851581275463104, 0.22788342833518982, 0.6333936452865601, -0.3457254469394684, 0.056280605494976044, -0.011447058990597725, 0.43169909715652466, -0.7342444062232971, -0.016164641827344894, -0.3148466944694519, -0.33690565824508667, 0.8532620668411255, -0.603317379951477, -0.2656318247...
The customer wants us to "log" the "actions" that a user performs on our system: creation, deletion and update, mostly. I already have an aspect that logs the trace, but that works at a pretty low level logging every method call. So if a user clicked on the button "open medical file" the log would read: 1. closePrevi...
[ 0.5133213400840759, 0.0735335424542427, 0.7627068161964417, -0.009058811701834202, 0.04921235144138336, 0.21505452692508698, 0.057238586246967316, -0.21914862096309662, -0.2374901920557022, -0.5257797241210938, 0.354524701833725, 0.6089178919792175, -0.15548968315124512, -0.093765199184417...
(or a filter) and keep the logic in just one place, so that I might configure the log easily, but then I'm afraid everything will become harder to understand (i.e. "the log for this action is wrong... where the heck should I look for the trouble?"). Sounds like your client wants an audit trail of the user's actions in ...
[ 0.2635120749473572, -0.05822383984923363, 0.06818105280399323, 0.12988953292369843, 0.1596585214138031, -0.05160941183567047, 0.48866742849349976, -0.27583619952201843, -0.479475200176239, -0.3223329484462738, 0.0016629076562821865, 0.6904711127281189, -0.13133257627487183, -0.365303575992...
or failed. An example in pseudocode: ``` enum Actions { OPEN_MEDICAL_FILE ... } void handleRequest(...) { String patient = ...; Audit audit = new Audit(OPEN_MEDICAL_FILE); audit.addParameter("patient", patient); try { ... more things .. audit.addParameter("file", "#001"); ... more things .....
[ 0.29983147978782654, -0.09924248605966568, 0.23008590936660767, -0.13619950413703918, 0.013968182727694511, 0.2897522747516632, 0.5668523907661438, -0.48331281542778015, -0.2853098213672638, -0.6192335486412048, 0.1267329901456833, 0.6283003091812134, -0.3349364995956421, -0.10184308886528...
action constants and data, the presentation of the audit to the client can be seperately coded. You gain flexibility too, since a change of presentation string (eg. "opened medical file #001 for patient zero" to "patient zero #001 medical file opened) is not determined at the time of the action, but later. You don't ha...
[ 0.370111346244812, -0.13108059763908386, 0.35910964012145996, 0.12445993721485138, -0.11353076249361038, 0.21887777745723724, 0.04555636644363403, -0.268588125705719, -0.2998873293399811, -0.5801883935928345, 0.0985170379281044, 0.6083797812461853, -0.04694709554314613, -0.1297900825738906...
I am after so advice really. I have been thinking about a client server project for a while and am going to be using .NET. Originally is was just going to use 2.0 but recently got VS2008 and thought I should really explore 3.5 as well. The application will have one server and many clients connected. Both the client an...
[ 0.5329641103744507, 0.05120059847831726, 0.6111982464790344, 0.026128465309739113, -0.2796044647693634, -0.22743400931358337, 0.3614712059497833, 0.2793882489204407, -0.3492737114429474, -1.0437716245651245, 0.21466757357120514, 0.663479208946228, -0.0684082880616188, 0.23597967624664307, ...
with 3.5? I realize I may have some problems with firewalls when ports could be blocked at the client when I use remoting. Really I am looking for suggestions to be the best way to handle communications between a client and server that will work across the net using .NET (would like the client to be able to be runnin...
[ 0.3266448676586151, 0.15326040983200073, 0.5852289795875549, -0.09601057320833206, -0.3480171263217926, -0.5879735946655273, 0.6944249868392944, 0.2123119980096817, -0.10938972234725952, -0.6889525651931763, 0.23737245798110962, 0.5012397170066833, -0.1385875642299652, -0.06586800515651703...
here on SO. Some things I've learned over the past week or so: 1. This article is excellent: [MS Pub-Sub with WCF](http://msdn.microsoft.com/en-gb/magazine/cc163537.aspx) 2. WCF is the way to go. It's dynamic configuration and single programming model should make it your preferred choice over traditional web services ...
[ 0.5320518016815186, -0.3111550211906433, 0.4817023277282715, -0.08969207108020782, -0.2588779628276825, -0.528938353061676, 0.11413360387086868, -0.10905367881059647, -0.2575312852859497, -0.9880054593086243, -0.11300744116306305, 0.5632020235061646, -0.14013440907001495, 0.254823118448257...
**Problem:** how to provide a distributed, scalable and disaster resistant pub/sub service with WCF. **Details:** *Note that this approach is being considered in addition to messaging/middleware solutions such as Tibco EMS.* I've been looking into WCF, particularly how it may be used to offer pub/sub. On this subjec...
[ 0.17654186487197876, -0.04858493059873581, 0.45361849665641785, -0.01780267246067524, -0.31482282280921936, -0.14435598254203796, 0.3993273675441742, -0.05616394057869911, -0.4687049984931946, -0.5823945999145508, -0.12576693296432495, 0.1107165589928627, -0.31934159994125366, 0.2318200618...
know about client A. i.e. no one told publisher B that client A wanted to be notified about events. The author suggests a pub/sub service as a solution. The pub/sub service would centrally store subscriptions. However, if I wanted to make the pub/sub service disaster resistant by having a secondary/dual pub/sub service...
[ 0.48390910029411316, 0.02542760968208313, 0.44247424602508545, -0.00216070469468832, 0.04808661341667175, -0.12793728709220886, 0.4654071033000946, -0.04138321802020073, -0.4124577045440674, -0.46963274478912354, -0.09845831245183945, 0.23606574535369873, -0.30394160747528076, 0.3043449223...
some fantastic magical feature of WCF?) Any comments appreciated. I had the same problem and I did a lot of research on the issue. The problem is actually simple. You want to keep some centralized state, but in distributed way. I found that the best way to achieve this is by using a distributed cache. Look at velocity ...
[ 0.2859926223754883, 0.05507131665945053, 0.3034213185310364, 0.2869257628917694, 0.020409563556313515, 0.010511818341910839, 0.523669958114624, 0.09492426365613937, -0.5133747458457947, -0.7558097839355469, -0.035507023334503174, 0.3117959499359131, -0.04953504353761673, 0.3899326324462890...
to be centralized for all client connections. Storing data in a database is also an option, but the cost is the need for a database, and even with a database you can have a single point of failure if the database is not clustered accorss multiple machines. At the end, I figured it is actually expensive to implement so...
[ 0.28223302960395813, -0.08488420397043228, 0.2199237197637558, 0.5873352885246277, 0.08856485784053802, -0.2322314828634262, -0.1033959686756134, 0.19053955376148224, -0.35460352897644043, -0.85413658618927, 0.13236132264137268, 0.2761358618736267, 0.03436829894781113, 0.22655269503593445,...
I want to check when the user double click on applictaion icon that no another instance of this application is already running. I read about My.Application but i still don't know what to do. The most common pattern for doing this is to use the Singleton pattern. As you haven't indicated a language, I'm going to assume...
[ 0.42254897952079773, 0.08556444942951202, 0.027690690010786057, 0.154011532664299, 0.08025847375392914, -0.24530065059661865, 0.42169901728630066, 0.6207833886146545, -0.3922575116157532, -0.6619125604629517, -0.08872286975383759, 0.4914095997810364, 0.01117529533803463, 0.1380251049995422...
I don't know if this is too specific a question, if that is possible, but I'm having to port an app that uses Castle Windsor to Unity so that there isn't a reliance on non-microsoft approved libraries. I know I know but what are you going to do. Anyway I've managed it but I'm not happy with what I've got. In Windsor I...
[ 0.06093737483024597, 0.2947078347206116, 0.43351519107818604, -0.19631221890449524, -0.04996335506439209, 0.0106697091832757, 0.5469347834587097, -0.3255496621131897, -0.08849719166755676, -0.6665768027305603, -0.038449015468358994, 0.5292650461196899, -0.3698127269744873, 0.11946892738342...
RegisterType<IConfigureLinkView, ConfigureLinkView>(); RegisterType<IConfigureSourceView, ConfigureSourceView>(); RegisterType<IConfigureSinkView, ConfigureSinkView>(); RegisterType<MainPresenter, MainPresenter>(); RegisterType<ConfigureLinkPresenter, ConfigureLinkPresenter>(); R...
[ -0.003480591345578432, -0.07334129512310028, 0.3342306315898895, -0.038308531045913696, 0.04944692552089691, -0.026449447497725487, 0.8758724927902222, -0.0564662329852581, -0.3278682827949524, -0.8635933995246887, -0.15537475049495697, 0.5262331962585449, -0.23832635581493378, -0.17537063...
if you felt a bit ambitious you could setup your own convention based registration. Found below is a snipped that works for the executing assembly and interfaces. Good luck. P.S. This feels like a big hack, I would probably continue just registering all types by hand. ``` using System; using System.Collections.Generi...
[ 0.7098896503448486, 0.09812396764755249, 0.35992181301116943, -0.014390128664672375, -0.013842550106346607, -0.1964699625968933, 0.06669220328330994, -0.02883904241025448, -0.4660361707210541, -0.4831840693950653, 0.22777314484119415, 0.49555057287216187, -0.4372906982898712, 0.24956171214...
Assembly a = Assembly.GetExecutingAssembly(); var types = a.GetTypes(); var bindTo = from t in types where t.IsAbstract || t.IsInterface
[ 0.1569453924894333, -0.33845487236976624, 0.3910840153694153, -0.34286853671073914, -0.03243307024240494, 0.0867510437965393, 0.6036205291748047, -0.6260159015655518, -0.020610971376299858, -0.3974122703075409, -0.344524621963501, 0.4329953193664551, -0.7785075902938843, 0.1785749346017837...
select t; // apply your conventions to filter our types to be registered var interfacePairs = from t in bindTo.Where(x => x.IsInterface) let match = types.FirstOrDefault(x => x.Name == t.Name.Substring(1))
[ 0.11174537986516953, -0.5246527194976807, 0.5163102149963379, -0.20194809138774872, -0.18438318371772766, -0.17365023493766785, 0.25306180119514465, -0.5920413732528687, 0.0738333910703659, -0.8369147181510925, -0.15439316630363464, 0.4681398272514343, -0.710491418838501, -0.07152939587831...
where match != null select new Pair { To = t, From = match }; var abstractPairs = new Pair[] {};
[ -0.26664870977401733, -0.4890381693840027, 0.09852008521556854, -0.31289535760879517, -0.0631604716181755, 0.04298384487628937, 0.2461826652288437, -0.3352109491825104, 0.3426922559738159, -0.3954356908798218, -0.2811972498893738, 0.4612632691860199, -0.7184006571769714, 0.0204739701002836...
// setup the generic form of the method to register the types var thisType = typeof(Program); var bindings = BindingFlags.Static | BindingFlags.Public; MethodInfo genericMethod = thisType.GetMethod("RegisterType", bindings); // register all your types by exec...
[ 0.34486350417137146, -0.16832005977630615, 0.547765851020813, 0.08973428606987, -0.067827507853508, -0.0500233955681324, 0.47812196612358093, -0.5660247206687927, -0.17477083206176758, -0.2776176929473877, 0.049552708864212036, 0.35208749771118164, -0.7975496053695679, 0.2955576181411743, ...
// specialized generic form of the method foreach (var t in interfacePairs.Concat(abstractPairs)) { Type[] genericArguments = new Type[] { t.To, t.From }; MethodInfo method = genericMethod.MakeGenericMethod(genericArguments);
[ 0.024585528299212456, -0.35734105110168457, 0.4254857897758484, -0.048232633620500565, 0.07886539399623871, 0.09985154122114182, 0.3716544806957245, -0.3631170690059662, 0.07961800694465637, -0.3612780272960663, -0.35765135288238525, 0.507803738117218, -0.4221721291542053, 0.45001211762428...
method.Invoke(null, new object [] {}); } Console.ReadKey(); } public static void RegisterType<To, From>() { Console.WriteLine("Register { To: {0} From: {1} }", typeof(To), typeof(From)); } // Test classes that should be
[ 0.14442439377307892, -0.19438321888446808, 0.08938973397016525, 0.024237118661403656, 0.2673729956150055, 0.07728967070579529, 0.3483089208602905, -0.478338360786438, 0.44260749220848083, -0.531024158000946, -0.11218764632940292, 0.3158304691314697, -0.3399011790752411, 0.08311926573514938...
picked up interface ITest { } class Test : ITest { } class Pair { public Type To { get; set; } public Type From { get; set; } } } } ```
[ -0.24441592395305634, -0.44425901770591736, 0.5131862759590149, 0.18326087296009064, -0.22143054008483887, 0.34914618730545044, -0.08786949515342712, 0.1099935993552208, -0.009223930537700653, -0.7512450814247131, 0.051318008452653885, 0.15387588739395142, -0.19325317442417145, 0.080738052...
I've added the following code to my masterpage (Page\_Load) so once a user logs out they will not be able to use the back button to see the page they were previously at. ``` Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1); Response.Expires = -1; Response.CacheControl = "no-cache"; ``` ...
[ 0.2845715880393982, 0.42887112498283386, 0.7042561769485474, -0.39279136061668396, 0.18435855209827423, -0.06236666440963745, 0.6136568188667297, 0.05087558552622795, -0.22959297895431519, -0.883232831954956, -0.17389217019081116, 0.46786558628082275, -0.31195011734962463, 0.39497846364974...
on which causes a security risk. Does anyone have any suggestions so they can use the browser back button in the application but once they are logged out they cannot go back into the application? Is the objective to prevent an un-authenticated user from surreptitiously visiting a previously-used computer and seeing wh...
[ 0.5097807049751282, 0.10978642851114273, 0.5250008702278137, 0.020737851038575172, 0.1794850379228592, -0.19886274635791779, 0.4339486062526703, -0.24144816398620605, -0.1724368780851364, -0.49220597743988037, -0.16516950726509094, 0.6820725798606873, -0.4804164469242096, -0.27934768795967...
the window and other browsers ignore the request altogether. However, in the right kind of security environment, I think that it does provide a significant addition to your security policy - albeit of a primarily cultural variety (it helps the members of the culture abide by the rules). If you want "one-time through a...
[ 0.28859302401542664, -0.023300817236304283, 0.322099506855011, 0.16822829842567444, -0.40053245425224304, -0.46858465671539307, 0.6410733461380005, 0.38847896456718445, -0.38279715180397034, -0.8748778104782104, -0.2566514015197754, 0.4298466742038727, 0.19027766585350037, 0.16584399342536...
information on an update panel and have the page load javascript trigger an update panel refresh. Since this will always go back to the server, unauthenticated/expired users will be turned away. This is a pretty significant workload to take on but I thought I'd throw it out there.
[ 0.3142673969268799, 0.1528242826461792, 0.6006839871406555, 0.05216065049171448, -0.00032038975041359663, -0.49033915996551514, 0.3663251996040344, 0.15326005220413208, -0.1337597817182541, -0.6474117636680603, -0.08526776731014252, 0.3600523769855499, -0.09773004800081253, 0.2179268300533...
How to create a pragraph <p> tag in ASP.NET using the HtmlGenericControl class? ``` HtmlGenericControl para = new HtmlGenericControl ( "p" ); ``` Although I would leave it as a container control for the extra properties/methods. ``` HtmlContainerControl para = (HtmlContainerControl)new HtmlGenericControl ( "p" ); `...
[ 0.034429751336574554, -0.12409047782421112, 0.7528157830238342, 0.14847418665885925, -0.36692509055137634, 0.18695791065692902, 0.1611938625574112, -0.6808760166168213, -0.19182205200195312, -0.7024332284927368, -0.22363096475601196, 0.16561532020568848, -0.32805246114730835, -0.4214733839...
When I move .xaml and .xaml.vb files to a new Silverlight project, the generated .g files no longer include members for the x:Name attributes defined in the xaml file. This means the code-behind files can't refer to those members and cannot build. In Visual Studio, select the .xaml file and in the properties, set the f...
[ 0.576601505279541, 0.2765091359615326, 0.29577919840812683, -0.1823578029870987, -0.12468984723091125, -0.15416274964809418, 0.2586863338947296, -0.41075456142425537, -0.15747226774692535, -0.6727637052536011, -0.2778063714504242, 0.4806617498397827, -0.4469962418079376, 0.1370068043470382...
I am trying to send an HTTP request with the contents of a file set as the body of the HTTP request and want to get the response from a server using VC++. Any help is appreciated. Thanks. I think I was not very clear with what I wanted to do or I misunderstood the answers. Neways, what I want to accomplish is, one of...
[ 0.6249359846115112, 0.04104778543114662, 0.21693356335163116, 0.13510212302207947, -0.2404303252696991, 0.04922189563512802, 0.25527140498161316, 0.02329665794968605, -0.13187628984451294, -0.6114444732666016, 0.017086846753954887, 0.45861685276031494, -0.06991133838891983, 0.3683940172195...
the body of the HTTP request. In return I will get a response from the service which I want to get in a string variable. Thanks. You can use [cURL library](http://curl.haxx.se/libcurl/c/example.html). There is also a similar topic [Programmatically reading a web page](https://stackoverflow.com/questions/389069/program...
[ 0.3758069574832916, -0.045793645083904266, 0.4227302670478821, 0.3622186481952667, -0.4231205880641937, -0.34071728587150574, 0.13974808156490326, -0.21788544952869415, -0.3072001338005066, -0.22371439635753632, -0.17812497913837433, 0.3990309536457062, -0.042451608926057816, -0.0916414037...
My biggest hurdle with getting started with an MVC framework has to do with with the 1 model to 1 DB table concept. To me it's overly simplistic and unrealistic for anything beyond a simple app. Yet, MVC is in use everywhere, including this awesome StackOverflow site. As is typical, all of the code examples and tutoria...
[ 0.057367485016584396, 0.3135385513305664, 0.16539910435676575, 0.027149386703968048, -0.08625400811433792, -0.17448632419109344, 0.19036397337913513, 0.006475899368524551, -0.27356141805648804, -0.7490543127059937, 0.09508943557739258, 0.5824592709541321, -0.4139154255390167, 0.04530539736...
imagine a DB design with tables like Questions, Tags, Users, etc. In my DB design I may have a Question\_Tag link table to to look up all tags associated with a given question. How does MVC deal with this? I don't believe that there is anything about [the MVC design pattern](http://en.wikipedia.org/wiki/Model-view-cont...
[ 0.26802799105644226, 0.042129602283239365, 0.0694492906332016, 0.15464046597480774, -0.25427302718162537, -0.22537842392921448, 0.20607027411460876, -0.16200187802314758, -0.2979315221309662, -0.6827163100242615, 0.18805564939975739, 0.46919381618499756, -0.6267845630645752, 0.511364221572...
- maybe ASP.NET MVC too?) have taken on, for what appears to be convenience sake. But it is not a requirement of MVC. Spring MVC (for the Java world) has no inherent concept of how to map the model components to a database, in fact it's beauty is that it doesn't care - you just need to supply the model data to use, and...
[ 0.14533241093158722, -0.1828642040491104, 0.34909796714782715, 0.1027514711022377, -0.20056189596652985, -0.22796277701854706, 0.037518978118896484, -0.00022105424432083964, -0.5366682410240173, -0.4738805592060089, -0.11069536954164505, 0.28276416659355164, -0.2933811843395233, 0.03241460...
you don't even need to use a database, your model could come just as well from a flat file or web services (and what's great about MVC is that if you design your app properly, you could swap different data layer implementations in and out of your application and the View or Controller *won't even know*).
[ 0.44746115803718567, -0.051974792033433914, 0.3974502980709076, 0.4581207036972046, 0.15967467427253723, -0.07784806936979294, -0.06129907816648483, 0.06441353261470795, -0.49869123101234436, -0.484863817691803, -0.052323851734399796, 0.5873139500617981, -0.4326239824295044, 0.059522785246...
I'been doing some inheritance in js in order to understand it better, and I found something that confuses me. I know that when you call an 'constructor function' with the new keyword, you get a new object with a reference to that function's prototype. I also know that in order to make prototypal inheritance you must ...
[ 0.08054099231958389, -0.06428579241037369, -0.014137418009340763, -0.30858078598976135, -0.08146596699953079, -0.013451679609715939, 0.5043565630912781, -0.41388222575187683, -0.20130714774131775, -0.3459886908531189, -0.09684126079082489, 0.49393802881240845, -0.6856231689453125, 0.127245...
an 'Object' console.log(fido.prototype) // UNDEFINED console.log(fido.constructor.prototype == Dog.prototype) //this is true function KillerDog(){}; KillerDog.prototype.deathBite = function(){alert("AAARFFF! *bite*")} fido.prototype = new KillerDog(); console.log(fido.prototype) // no longer UNDEFINED fido.deathBit...
[ 0.2018466293811798, -0.11277452111244202, 0.5258172750473022, -0.11797825247049332, 0.21267686784267426, -0.06338541209697723, 0.40381237864494324, -0.35366684198379517, -0.10898339748382568, -0.3331371247768402, 0.09361857920885086, 0.37260884046554565, -0.6937992572784424, 0.236147552728...
undefined? All new objects do hold a reference to the prototype that was present on their constructor at the time of construction. However the property name used to store this reference is not `prototype` as it is on the constructor function itself. Some Javascript implementations do allow access to this 'hidden' prop...
[ 0.09212081134319305, -0.09197434782981873, 0.2030474692583084, -0.11861513555049896, -0.030921274796128273, 0.114879310131073, 0.021076712757349014, -0.1881433129310608, -0.31659573316574097, -0.41590118408203125, -0.11816895008087158, 0.0635899156332016, -0.4188896715641022, 0.42223826050...
alert("Second"); } function Derived() {} Derived.prototype = new Base() var x = new Derived() Derived.prototype = new Base2() x.doThis(); ``` This alerts "First" not Second. If the inheritance chain went via the constructor we would see "Second". When an object is constructed the current reference held in the Fun...
[ -0.03403080999851227, -0.38296008110046387, 0.26415449380874634, -0.01275684591382742, 0.19445623457431793, -0.057487551122903824, 0.17550216615200043, -0.31154191493988037, -0.028246808797121048, -0.582501232624054, -0.07344728708267212, 0.31912025809288025, -0.35037311911582947, 0.248228...
maintain a reference to its prototype via such a property name.
[ 0.6053493618965149, 0.45380181074142456, -0.07642320543527603, 0.1358681321144104, 0.09413828700780869, -0.24969013035297394, 0.07498813420534134, 0.3203340768814087, 0.02555481158196926, -0.34418004751205444, -0.46208298206329346, 0.05137654021382332, 0.15585224330425262, 0.16431917250156...
I was looking at Stack Overflow question *[What is the difference between abstract function and virtual function?](https://stackoverflow.com/questions/391483)*, and I was wondering whether every abstract function should be considered to be a virtual function in C# or in general? I was a bit puzzled by the "you must ov...
[ 0.09746389091014862, 0.18410028517246246, 0.20340096950531006, -0.026858510449528694, 0.05947967246174812, -0.33335450291633606, 0.018781831488013268, 0.03144523873925209, -0.28473609685897827, -0.23910881578922272, -0.10140486061573029, 0.6383143067359924, -0.13527801632881165, 0.26341295...
dimension too, in that you cannot override a non-virtual function, but they are mostly a runtime concept since it is "just" the selection of the correct method implementation based on the actual receiver. Yes. From section 10.6.6 of the [C# 3.0 spec](http://download.microsoft.com/download/3/8/8/388e7205-bc10-4226-b2a8-...
[ -0.2564965784549713, -0.1665753275156021, 0.5114701986312866, 0.437761127948761, -0.09079352021217346, -0.028985053300857544, 0.01859235391020775, -0.20592403411865234, -0.29790160059928894, -0.6409066915512085, -0.13767963647842407, 0.49843448400497437, -0.044377151876688004, 0.1842680722...
I know the rule is to NEVER throw one during a destructor, and I understand why. I would not dare do it. But even the C++ Faq Lite says that this rule is good 99% of the time. What is the other 1% that they fail to delve into? [Link to the C++ Faq Lite bullet point on throwing from ~():](http://www.parashift.com/c++-f...
[ 0.5719610452651978, 0.5315643548965454, -0.1317543387413025, -0.16568507254123688, -0.20132480561733246, -0.50376296043396, 0.6786930561065674, -0.04524077847599983, -0.2938377559185028, -0.22556883096694946, -0.184335395693779, 0.5596975088119507, -0.13949640095233917, -0.0853342190384864...
I have a method which should be delayed from running for a specified amount of time. Should I use ``` Thread thread = new Thread(() => { Thread.Sleep(millisecond); action(); }); thread.IsBackground = true; thread.Start(); ``` Or ``` Timer timer = new Timer(o => action(), null, millisecond, -1); ``` I had...
[ 0.29687485098838806, -0.05545702949166298, 0.30087438225746155, -0.37196874618530273, 0.19096344709396362, 0.13936474919319153, 0.22396953403949738, -0.23582400381565094, -0.4385231137275696, -0.5320150256156921, 0.1461997777223587, 0.22755549848079681, -0.27213871479034424, 0.391936898231...
appreciated. One difference is that `System.Threading.Timer` dispatches the callback on a thread pool thread, rather than creating a new thread every time. If you need this to happen more than once during the life of your application, this will save the overhead of creating and destroying a bunch of threads (a process ...
[ 0.3303546607494354, -0.02501177415251732, 0.029248012229800224, 0.08906769007444382, 0.10827231407165527, -0.20783407986164093, 0.2008943110704422, -0.06367720663547516, -0.5396727323532104, -0.6532068252563477, 0.10653230547904968, 0.6748824119567871, -0.18139462172985077, 0.0585205890238...
`Timer` is going to be much more efficient. It also may be more accurate, since `Thread.Sleep` is only guaranteed to wait at LEAST as long as the amount of time you specify (the OS may put it to sleep for much longer). Granted, `Timer` is still not going to be exactly accurate, but the intent is to fire the callback as...
[ 0.3235503137111664, -0.25410327315330505, 0.4907624125480652, -0.03125695884227753, 0.39561283588409424, -0.3934617340564728, 0.3622666299343109, 0.023077474907040596, -0.2507564425468445, -0.6979253888130188, -0.1885901391506195, 0.9849720001220703, -0.17405937612056732, 0.194074645638465...
and call Dispose in the callback (though I haven't tried this -- I guess it is possible that the Timer might be locked during the callback). Edit: No, I guess you can't do this, since you have to specify the callback parameter in the `Timer` constructor itself. Maybe something like this? (Again, haven't actually trie...
[ 0.11321650445461273, -0.29294803738594055, 0.449005663394928, -0.33904871344566345, 0.29892557859420776, -0.21807050704956055, 0.3083692193031311, -0.4545588791370392, -0.2610042095184326, -0.49350520968437195, -0.20447517931461334, 0.9139599800109863, -0.36965128779411316, 0.3198281526565...
}, state, millisecond, -1); } ``` The locking should prevent the timer callback from trying to free the timer prior to the `Timer` field having been set. --- Addendum: As the commenter pointed out, if `action()` does something with the UI, then using a `System.Windows.Forms.Timer` is probably a better bet, since it...
[ 0.21922527253627777, -0.3298788368701935, 0.4118289053440094, -0.26452818512916565, 0.35274678468704224, -0.34310808777809143, 0.2562727630138397, -0.15186037123203278, -0.41351383924484253, -0.5686351656913757, -0.46348056197166443, 0.6117593050003052, -0.19226932525634766, 0.295138001441...
While browsing some code I found a call to [OpenPrinter()](http://msdn.microsoft.com/en-us/library/dd162751.aspx). The code compiles and works fine. But, we are passing a `HANDLE` instead of `LPHANDLE` (as specified in MSDN). I found out that in `windef.h` the following declaration exists: ``` typedef HANDLE FAR ...
[ -0.020415689796209335, -0.020444799214601517, 0.5992764830589294, -0.0019856009166687727, -0.03905797749757767, -0.3001731336116791, -0.1948474645614624, -0.20657497644424438, -0.30169519782066345, -0.5915505290031433, -0.12793080508708954, 0.4211989939212799, -0.15655739605426788, 0.08464...