text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
"make" to invoke the build process. 5. Type "sudo make install", and enter an administrator password when prompted. You will need `ImageMagick` what can be installed from [macports](http://www.macports.org). After installing the ZBar, you can nicely decode qrcode with a command ``` zbarimg qrcode_file.png ``` Test...
[ 0.4686671495437622, -0.0997682586312294, 0.6906511783599854, -0.18818090856075287, -0.032015468925237656, -0.3357488811016083, 0.34244799613952637, -0.17141661047935486, 0.1244187280535698, -0.7660865187644958, -0.25336405634880066, 0.8124732375144958, -0.342351496219635, 0.196987152099609...
I saw this question asked about C# I would like an answer for PHP. I have some old code that has 4 pages of foreach loops and conditions which just makes it hard to read and follow. How would I make this more OO? I was thinking of using SPL Functions but don't fully understand whats involved yet. This code can probably...
[ 0.2843431830406189, 0.08879243582487106, 0.35204946994781494, 0.11912304908037186, -0.29780274629592896, 0.032468900084495544, 0.3499368131160736, 0.008044561371207237, -0.31248173117637634, -0.3927323520183563, 0.17678861320018768, 0.4530637264251709, -0.3583395481109619, -0.1953859031200...
access funcitons (both operator [] and functions like key(), next() etc). Cleanup suggestions:* If the same action is performed several (more than 1 or 2) times in the code, break it out into a function. If this action is to be performed on all elements in a array, consider using [array\_walk](http://php.net/array_wal...
[ -0.18384136259555817, -0.36257001757621765, -0.10467550903558731, 0.29994431138038635, -0.09205847978591919, -0.11785554140806198, 0.16448922455310822, -0.18970529735088348, -0.5048334002494812, -0.6034746170043945, -0.24606037139892578, 0.5045347213745117, -0.35723352432250977, -0.2410858...
Depends on your style, and on the type of data. The important thing here is the structuring of methods working on th data, and the documentation. Doesn't really matter if you make it a class or not. - After you have done the above steps, break the newly written functions and objects out into separate include files. I ...
[ 0.6381756067276001, -0.007513939402997494, -0.015978993847966194, 0.4571121335029602, -0.011773445643484592, -0.03982149064540863, 0.015764310956001282, -0.07072704285383224, -0.16218358278274536, -0.5799827575683594, -0.03894897177815437, 0.4623855948448181, 0.24536296725273132, 0.1230320...
Assume a table with the following columns: `pri_id`, `item_id`, `comment`, `date` What I want to have is a SQL query that will delete any records, for a specific `item_id` that are older than a given date, BUT only as long as there are more than 15 rows for that `item_id`. This will be used to purge out comment reco...
[ 0.12985418736934662, 0.17176887392997742, 0.52349454164505, 0.15962007641792297, 0.13676783442497253, 0.2610718309879303, -0.22958756983280182, -0.0699046403169632, -0.2624332904815674, -0.7496137022972107, 0.006128000561147928, -0.029375405982136726, -0.17541851103305817, 0.40249642729759...
last 5 days I'd only keep the newest 15 records. These are of course arbitrary record counts and date timeframes for this example. I'd like to find a very generic way of doing this that would work in mysql, oracle, postgres etc. I'm using phps adodb library for DB abstraction so I'd like it to work well with that if p...
[ 0.38966837525367737, 0.12084310501813889, 0.47102347016334534, 0.07454203069210052, -0.05015222728252411, -0.18234488368034363, 0.324563592672348, -0.1760544329881668, -0.35030922293663025, -0.7074386477470398, 0.11844534426927567, 0.553461492061615, 0.002639923244714737, 0.472114354372024...
item_id having count(item_id) > 15 ) and Date < @tDate ```
[ 0.15117499232292175, -0.20566067099571228, 0.7309666275978088, -0.08817274868488312, 0.09960836917161942, 0.09810355305671692, -0.06292859464883804, -0.21943557262420654, -0.4025131165981293, -0.39990440011024475, -0.17232373356819153, 0.04944634065032005, 0.003136315615847707, 0.593122005...
In C#, what is the best way to access a property of the derived class when the generic list contains just the base class. ``` public class ClassA : BaseClass { public object PropertyA { get; set; } } public class ClassB: BaseClass { public object PropertyB { get; set; } } public class BaseClass { } public vo...
[ 0.08035538345575333, -0.13817498087882996, 0.2542183995246887, -0.3023865520954132, 0.12206442654132843, -0.19414474070072174, 0.18506085872650146, -0.4174100458621979, -0.11956391483545303, -0.4368898570537567, -0.5210915803909302, 0.5799649357795715, -0.3450494706630707, 0.12257968634366...
{ //I would like to access PropertyA abd PropertyB from the derived classes } } ``` Certainly you can downcast, like so: ``` for (int i = 0; i < MyList.Count; i++) { if (MyList[i] is ClassA) { var a = ((ClassA)MyList[i]).PropertyA; // do stuff with a } if (MyList[i...
[ 0.3303907513618469, 0.08217030763626099, 0.060694511979818344, -0.2800815999507904, 0.07490511238574982, -0.29243984818458557, 0.46541088819503784, -0.32713794708251953, -0.0038458886556327343, -0.3627975285053253, -0.4663246273994446, 0.5725463032722473, -0.28380149602890015, 0.2428134381...
var b = ((ClassB)MyList[i]).PropertyB; // do stuff with b } } ``` ... However, you should take another look at what you're trying to accomplish. If you have common code that needs to get to properties of ClassA and ClassB, then you may be better off wrapping access to those properties up into a shared, vi...
[ 0.34724289178848267, -0.18022796511650085, -0.09075520932674408, -0.1640639305114746, 0.1231071874499321, -0.18503965437412262, 0.42419126629829407, -0.36610496044158936, 0.002233571372926235, -0.5936785340309143, -0.17265762388706207, 0.5448912382125854, -0.4293471574783325, 0.23730488121...
public override void DoStuff() { // do stuff with PropertyA } } public class ClassB : BaseClass { public object PropertyB { get; set; } public override void DoStuff() { // do stuff with PropertyB } } ```
[ 0.29276371002197266, -0.12104446440935135, 0.05222821235656738, 0.11330214887857437, 0.18695645034313202, -0.4726382791996002, 0.32708939909935, -0.34813615679740906, 0.06395506113767624, -0.25136902928352356, -0.5549456477165222, 0.6867409348487854, -0.486532986164093, 0.21858040988445282...
I have a CircleButton class in Actionscript. I want to know when someone externally has changed the 'on' property. I try listening to 'onChange' but it never hits that event handler. I know I can write the 'on' property as a get/setter but I like the simplicity of just using [Bindable] Can an object not listen to its...
[ 0.31359750032424927, -0.23769721388816833, 0.5574226975440979, -0.3487871587276459, -0.16142046451568604, -0.2110590636730194, 0.3467622399330139, -0.43094515800476074, -0.06508037447929382, -0.5227468609809875, -0.2946428954601288, 0.731796145439148, -0.3915207087993622, 0.078425996005535...
graphics.beginFill(0xff6600, 1); graphics.drawCircle(width/2, height/2, width/2); graphics.endFill(); this.addEventListener(MouseEvent.ROLL_OVER, rollover); this.addEventListener(MouseEvent.ROLL_OUT, rollout); this.addEventListener('onChange', onOnChange); } ...
[ -0.21685974299907684, -0.14248010516166687, 0.45840704441070557, -0.31855645775794983, 0.16579623520374298, 0.2581689655780792, -0.05590054765343666, -0.3610753118991852, -0.1532975435256958, -0.6876178979873657, -0.3864201009273529, 0.8028503656387329, -0.19537825882434845, 0.017819242551...
event of type: PropertyChangeEvent.PROPERTY\_CHANGE, which is the string 'propertyChange', will be dispatched. Therefore, to be able to register to listen to that event, you need to say: ``` this.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, onOnChange); ``` The reason why your listener function was never ...
[ -0.14770664274692535, -0.1365663707256317, 0.2539985775947571, -0.09539887309074402, -0.161066472530365, -0.0561552494764328, 0.1964585930109024, -0.25745078921318054, -0.08275224268436432, -0.4390794634819031, -0.26228657364845276, 0.7391214370727539, -0.4000891447067261, 0.20514282584190...
event manually when you consider that the property is changing (ie: in the setter), though that didn't seem to be what you wanted to do.
[ -0.1376098096370697, -0.5999326109886169, -0.010182074271142483, 0.08810068666934967, -0.14339879155158997, 0.030903145670890808, -0.05948541685938835, -0.20534096658229828, -0.2698233127593994, -0.4311710596084595, -0.024927223101258278, 0.5715264678001404, -0.14440591633319855, 0.0474210...
How can I modify the `NSDatePickerElementFlags` for the `NSDatePicker` in row templates for `NSDate` properties returned by `[NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:]`? I would like the `NSDatePicker` to show hrs:minutes as well as the date. **Update** I've added an answer belo...
[ 0.640705406665802, -0.21158148348331451, 0.4328785240650177, 0.21817171573638916, -0.022048218175768852, -0.31024453043937683, 0.01904309168457985, -0.035383228212594986, -0.166054829955101, -0.5341330170631409, 0.10675910115242004, 0.5222514271736145, 0.061547283083200455, 0.1800438165664...
on the NetworkStream (BeginRead, etc.). I don't like this one as the wrapper doesn't provide that much and it tends to be a little more awkward than using the socket directly. ### Socket - Select This provides the classic Select technique for multiplexing multiple socket IO onto a single thread. Not recommended any l...
[ 0.3640580177307129, -0.257384717464447, 0.312083899974823, 0.1554681807756424, -0.2588038444519043, -0.04380561411380768, -0.011837526224553585, 0.1386115849018097, -0.19877593219280243, -0.7001922130584717, -0.1941940188407898, 0.4404434561729431, -0.24425818026065826, 0.10903345048427582...
used). 2. Use the WaitHandle from the IAsyncResult to wait for the method to complete. 3. Pass the BeginXXX method a callback method that will be executed when the method completes. The best way is #3 as it is the usually the most convenient. When in doubt, use this method. Some links: * [MSDN Magazine Article on So...
[ 0.1377149224281311, -0.11317363381385803, 0.2888658940792084, -0.16675545275211334, -0.26805582642555237, -0.22208675742149353, 0.2739304304122925, -0.2105945199728012, -0.09318939596414566, -0.4246712327003479, -0.5678018927574158, 0.5225807428359985, -0.5491548776626587, 0.00752848852425...
of an IAsyncResult, you get SocketAsyncEventArgs. The idea is that you can reuse the SocketAsyncEventArgs and pre-allocate memory for socket IO. In high performance scenarios this can be much more efficient that using the APM style. In addition, if you do pre-allocate the memory, you get a stable memory footprint, redu...
[ 0.22832335531711578, 0.09029905498027802, -0.043626006692647934, 0.22901366651058197, -0.10180113464593887, -0.022507112473249435, 0.33137455582618713, -0.09281943738460541, -0.12418698519468307, -0.7490223050117493, -0.1736220419406891, 0.6589590907096863, -0.20743507146835327, 0.15323849...
style unless you prefer the style of the SocketAsyncEventArgs / Async method. If you've used CompletionPorts in WinSock, you should know that both of these methods use CompletionPorts under the hood.
[ 0.29440146684646606, -0.026730164885520935, 0.33474627137184143, 0.10473578423261642, -0.1040717288851738, -0.3608757257461548, 0.1892136037349701, -0.06639540940523148, -0.17841587960720062, -0.5585429668426514, -0.15896955132484436, 0.8784384727478027, 0.12086381018161774, -0.21815493702...
I would like to create a javascript modal pop up window to get some values from a user in a ASP.Net 2.0 webpage. The basic idea is this. When a user clicks a button, a modal window will come up and ask 3 or 4 questions. The asp.net page will not be able to be changed while this window is up. Once the questions have be...
[ 0.4124568700790405, -0.07651102542877197, 0.24036836624145508, 0.3446751832962036, -0.15528538823127747, -0.16146938502788544, 0.14389929175376892, -0.29155322909355164, -0.2381056249141693, -0.5946913957595825, 0.10277184844017029, 0.47530463337898254, -0.48788419365882874, -0.11981492489...
implement this scenario. Have you looked at the ModalPopupExtender? <http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx>
[ -0.1164693832397461, -0.44222766160964966, 0.09830141067504883, 0.19682283699512482, 0.08327830582857132, -0.4558395743370056, 0.3783229887485504, -0.12121643126010895, -0.24083924293518066, -0.5609682202339172, -0.2049764096736908, 0.5110652446746826, -0.26942887902259827, -0.567797601222...
What is an NP-complete problem? Why is it such an important topic in computer science? **NP** stands for ***Non-deterministic* Polynomial** time. This means that the problem can be solved in Polynomial time using a Non-deterministic Turing machine (like a regular Turing machine but also including a non-deterministic "...
[ -0.29146599769592285, -0.030911464244127274, -0.33144691586494446, 0.47231659293174744, -0.3273625671863556, 0.08515923470258713, 0.07404552400112152, 0.10239540785551071, -0.3384804427623749, -0.47701385617256165, -0.4661273658275604, 0.23324444890022278, -0.48063355684280396, 0.124551653...
problem is that it cannot be solved in polynomial time in any known way. NP-Hard/NP-Complete is a way of showing that certain classes of problems are not solvable in realistic time. Edit: As others have noted, there are often approximate solutions for NP-Complete problems. In this case, the approximate solution usuall...
[ -0.5864675045013428, 0.11220628768205643, 0.030900998041033745, 0.2886119484901428, 0.024058539420366287, -0.1637316793203354, 0.006569283548742533, -0.019394323229789734, -0.15433895587921143, -0.6296772360801697, -0.39082199335098267, 0.46308133006095886, -0.3523459732532501, -0.08373064...
I accidentally added a binary file to SVN with the add command, and now I want to remove it from being version controlled, but not delete the file. How do I do this? svn rm --keep-local
[ 0.45443496108055115, 0.06243108958005905, 0.46938860416412354, -0.0378333143889904, 0.07895641028881073, -0.35387322306632996, 0.43479883670806885, 0.13014443218708038, -0.4006980061531067, -0.22272539138793945, 0.021148301661014557, 0.9203091263771057, -0.36601319909095764, 0.358705699443...
I've been developing a GUI library for Windows (as a personal side project, no aspirations of usefulness). For my main window class, I've set up a hierarchy of option classes (using the [Named Parameter Idiom](http://www.parashift.com/c++-faq-lite/named-parameter-idiom.html)), because some options are shared and others...
[ 0.2830647826194763, -0.03445113077759743, 0.22731952369213104, -0.04716899245977402, -0.21301597356796265, 0.3752371072769165, 0.013324631378054619, -0.09806763380765915, -0.108382947742939, -0.6033490896224976, -0.03582020476460457, 0.44811108708381653, -0.19609445333480835, 0.24811792373...
like. I've dealt with that by making all the option classes templates. Here's an example: ``` template <class T> class _sharedWindowOpts: public detail::_baseCreateWindowOpts { public: /////////////////////////////////////////////////////////////// // No required parameters in this case. _sharedWindowOpts(...
[ 0.3409249186515808, -0.40708106756210327, 0.6505518555641174, -0.04636247083544731, 0.32341405749320984, 0.19482462108135223, -0.02272607758641243, -0.09373948723077774, -0.16085386276245117, -0.8844021558761597, -0.14640484750270844, 0.5833441019058228, -0.5662265419960022, -0.05371226742...
int height) { mX=x; mY=y; mWidth=width; mHeight=height; return static_cast<optType&>(*this); }; // Sets the position and size of the window in a single call optType& background(HBRUSH b) { mBackground=b; return static_cast<optType&>(*this); }; // Sets the default background to this brush optType& background(INT...
[ 0.1870553344488144, -0.2403153032064438, 0.8095557689666748, -0.4662666618824005, 0.0042273192666471004, 0.5841633081436157, 0.4467182159423828, -0.5706309080123901, -0.07639260590076447, -0.5316395163536072, -0.17157910764217377, 0.5986111164093018, -0.4857293963432312, -0.093148067593574...
static_cast<optType&>(*this); }; // Windows are visible by default optType& icon(HICON iconLarge, HICON iconSmall=0) { mIcon=iconLarge; mSmallIcon=iconSmall; return static_cast<optType&>(*this); }; // Specifies the icon, and optionally a small icon // ...Many others removed... }; template <class T> class _crea...
[ -0.18587760627269745, -0.3738033175468445, 0.9130562543869019, -0.29716190695762634, 0.2890661954879761, 0.4928845167160034, 0.04081638529896736, -0.22676201164722443, -0.1612001359462738, -0.7741961479187012, -0.43013906478881836, 0.48004037141799927, -0.44666406512260437, 0.0342975966632...
optional parent/owner }; class createWindowOpts: public _createWindowOpts<createWindowOpts> { public: /////////////////////////////////////////////////////////////// createWindowOpts() { }; }; ``` It works, but as you can see, it requires a noticeable amount of extra work: a type-cast on the return type for ...
[ 0.26860806345939636, -0.007379375398159027, 0.11455408483743668, 0.09059955179691315, -0.0794181078672409, -0.05554136261343956, 0.17198897898197174, 0.11949776113033295, -0.07985271513462067, -0.6807921528816223, -0.06898346543312073, 0.7129371166229248, -0.44902709126472473, 0.0099421683...
*as long as* it is safe *and* makes the life of the client a lot easier. The beauty in library code is not in the code itself, but in the code it enables the clients to write. Take STL for example. I've also developed a small GUI-library as a personal project with basically the same aspirations as you and some of the ...
[ 0.5580021142959595, 0.18981321156024933, -0.05396431311964989, 0.11446620523929596, -0.2171584516763687, -0.06176414340734482, 0.29372408986091614, 0.4467295706272125, -0.40152519941329956, -0.7438544631004333, 0.17649246752262115, 0.598705530166626, -0.002626989968121052, 0.05099476501345...
I need to present a wizard once, the first time my windows forms application is run after install. I could use a user setting like firstrun = false I suppose. But I also need handle the case where the program is uninstalled, then reinstalled. How will that user setting be reset? It's already present in the config file ...
[ 0.17181603610515594, -0.28211459517478943, 0.3483692705631256, -0.16359488666057587, 0.04355892539024353, -0.317188024520874, 0.3735070824623108, -0.2330445945262909, -0.07746361941099167, -1.031899333000183, -0.06948163360357285, 0.8107333779335022, -0.3189060389995575, 0.0623440779745578...
in the registry and set it to true (or 1 or whatever), and make sure your uninstaller deletes this key entirely. Then just have your application read this key when it starts, and set it to false (or 0 or whatever). If the user uninstalls and then reinstalls your application, they'll see the wizard again the first time...
[ 0.17977605760097504, -0.056004513055086136, 0.5409603118896484, 0.11419255286455154, 0.36319324374198914, -0.4591600298881531, 0.5832872986793518, 0.05408550053834915, -0.0726793110370636, -0.6285736560821533, -0.4354791045188904, 0.886058509349823, -0.012816300615668297, 0.062613062560558...
In a normal web app w/ login and secure data, what is an easy way to secure that data and prevent it from being seen by using the browser's back button, once a user logs out? [Here's a useful browser caching guide](http://www.mnot.net/cache_docs/). You want to set the cache-control and expiration date headers (setting...
[ -0.07569926232099533, 0.46695345640182495, 1.1298706531524658, -0.1474248319864273, 0.18178586661815643, -0.23175625503063202, 0.49463173747062683, 0.23795467615127563, -0.3302271366119385, -0.08256443589925766, -0.4163963794708252, 0.43431320786476135, -0.1353723555803299, 0.4021295905113...
Today is officially my first day with C++ :P I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source [Enso Project](http://code.google.com/p/enso). So, after installing scons I went to the console and tried to compile i...
[ -0.21105258166790009, 0.13919074833393097, 0.635794997215271, -0.08303242921829224, -0.1300726979970932, -0.32614681124687195, 0.45557793974876404, -0.11330332607030869, -0.23454362154006958, -0.6543563604354858, -0.2733774781227112, 0.6331660151481628, -0.17229412496089935, -0.05015046149...
![alt text](https://i.stack.imgur.com/1rB1L.png) And I managed to compile the file below in the IDE. ``` // Test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { return 0; } ``` But I still get that exception in the c...
[ 0.08268111199140549, 0.06330681592226028, 0.5225911140441895, -0.2606523633003235, -0.3186796009540558, -0.020186271518468857, 0.35348597168922424, -0.3468872308731079, -0.19493399560451508, -0.5338430404663086, -0.0575144998729229, 0.5266485214233398, -0.12159489840269089, -0.028220323845...
file: ``` set PATH=%PATH%;"C:\Program Files\Microsoft Platform SDK\Bin" set INCLUDE=%INCLUDE%;"C:\ Program Files\Microsoft Platform SDK\Include" set LIB=%LIB%;"C:\ Program Files\Microsoft Platform SDK\Lib" ``` Still, scons seeems not to take the vars... :( Using the above recommendations will not work with scons: sc...
[ 0.14644719660282135, 0.1467856764793396, 0.5079749226570129, -0.21802754700183868, -0.17290198802947998, -0.058059222996234894, 0.5328777432441711, -0.16651202738285065, -0.09919706732034683, -0.9115369319915771, -0.26001280546188354, 0.6551735401153564, -0.34366461634635925, -0.0681220665...
MS does not get it right, some of their .bat files are broken), so I can't give you a date. I hope it will be included in 1.2 (to be released in approximatively one month).
[ 0.1640252321958542, -0.2678864896297455, 0.7860779166221619, 0.2704005539417267, 0.12170891463756561, -0.29356643557548523, 0.3040003180503845, -0.16862940788269043, -0.10040796548128128, -0.6004140377044678, 0.08669683337211609, 0.08462000638246536, -0.34558597207069397, 0.067061066627502...
Similar question as [this one](https://stackoverflow.com/questions/56722/automated-processing-of-an-email-in-java) but for a Microsoft Environment. Email --> Exchange Server -->[something] For the [something] I was using Outlook 2003 & C# but it *feels* messy (A program is trying to access outlook, this could be a vi...
[ -0.10827165096998215, -0.12710708379745483, 0.3949408233165741, 0.07161558419466019, -0.030524296686053276, -0.06703103333711624, 0.313116192817688, -0.1957760453224182, -0.2694198191165924, -0.828021764755249, -0.10061552375555038, 0.2479058802127838, -0.5097715258598328, -0.1308539807796...
your needs. Here is [another library](http://www.codeproject.com/KB/IP/imaplibrary.aspx), this one is for the IMAP protocol, it's very basic but also allows you to fetch complete messages, including attachments...
[ 0.33073917031288147, -0.07944411784410477, 0.2560086250305176, 0.1926405429840088, 0.03729213774204254, 0.03432759270071983, 0.054975271224975586, -0.09908400475978851, -0.29544079303741455, -0.7902745008468628, -0.1271265298128128, 0.15165561437606812, -0.22792978584766388, 0.017025340348...
The IntelliJ IDEA short-cut to reformat source code is `Ctrl`+`Alt`+`L`. This happens to lock the screen in KDE (Gnome too?). How can I disable this so IntelliJ receives the key sequence? Under the K menu, go to the Control Center. Regional & Accessibility | Keyboard Shortcuts | Shortcut Schemes tab, Global Shortcuts ...
[ -0.23844589293003082, -0.2713124752044678, 0.808032214641571, 0.14911626279354095, 0.1360999196767807, -0.034464363008737564, 0.3301355242729187, 0.09983102232217789, -0.024083342403173447, -0.8768457174301147, -0.4476867914199829, 0.7035700082778931, -0.2728044390678406, 0.003864861791953...
What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource... Something like this: ``` if os.path.isfile(self.icon): icon_flags = win32con.LR_LOADFROMFILE | win32con...
[ -0.2876160740852356, 0.26182612776756287, 0.5702888369560242, 0.0039341384544968605, 0.31829461455345154, -0.0024027421604841948, 0.10463051497936249, -0.02284301444888115, -0.4583308696746826, -0.7892209887504578, 0.058064334094524384, 0.5641782879829407, -0.30633702874183655, 0.038229513...
self.icon, win32con.IMAGE_ICON, 0,
[ -0.07210561633110046, 0.20755667984485626, 0.2353697568178177, 0.006303191650658846, -0.10731935501098633, 0.33552998304367065, 0.45016995072364807, -0.23273307085037231, 0.13322517275810242, -0.7075913548469543, 0.23834380507469177, 0.8246729969978333, -0.20141184329986572, -0.02011791430...
0, icon_flags) ``` ...where self.icon is the filename of the icon I created. Is there any way to do this in memory? EDIT: All I want to do is create an icon with a 2-digit number displayed on it (weather-taskbar style. You can use [wxPython](http://wxpython.org/) for this. ``` fro...
[ 0.1212184950709343, 0.12080562859773636, 0.4816403388977051, -0.03976663947105408, 0.060006920248270035, 0.11305525153875351, 0.42362430691719055, -0.12474590539932251, -0.3323127031326294, -0.640366792678833, 0.026044506579637527, 0.4981955289840698, -0.37678423523902893, 0.03108963556587...
[wxMemoryDC](http://docs.wxwidgets.org/stable/wx_wxmemorydc.html#wxmemorydc), look [here](http://docs.wxwidgets.org/stable/wx_wxdc.html) for operations you can do on a DC. This icon can then be applied to a wxFrame (a window) or a wxTaskBarIcon using: ``` frame.SetIcon(icon) ```
[ 0.5320048332214355, -0.39115703105926514, 0.6807785630226135, 0.1098078191280365, 0.20352447032928467, -0.14274267852306366, 0.01035186368972063, -0.3010849058628082, -0.4756619930267334, -0.5746829509735107, -0.2975321412086487, 0.6103248596191406, -0.5014234185218811, 0.08103802800178528...
Because Canvas3D doesn't have the ability to resize dynamically with the parent frame, I would like to be able to track when a user resizes a window and then resize it manually myself. (If this ends up crashing Canvas3D, as some docs suggest, I will simply destroy and recreate it when the user resizes their window). Pa...
[ 0.14529474079608917, -0.051944300532341, 0.4529465138912201, -0.12247021496295929, -0.22181062400341034, -0.07199866324663162, 0.21129395067691803, -0.2740325927734375, -0.21109633147716522, -0.781975269317627, 0.004479963798075914, 0.5911234617233276, -0.08033174276351929, 0.0208706874400...
the actual size of the panel. Any ideas? **Edit**: So, I took a debugger to the panel object and manually inspected the non-object properties and I didn't see anything that resembled width/height. Granted, there are sub-objects that I didn't look at. Also, maybe the window has to be visible (it isn't, at the point I'...
[ 0.38459885120391846, -0.34055450558662415, 0.1488289088010788, 0.028087379410862923, -0.40011098980903625, 0.2819177806377411, -0.019967932254076004, -0.2683214843273163, -0.39070993661880493, -0.609066367149353, 0.1390560269355774, 0.4829435348510742, 0.213723823428154, -0.146710783243179...
either: * have set it manually at some point * run the layout manager responsible for layouting the component Generally, you get the exact size of a component via the getSize() method, which returns a Dimension object containing width and height, but getWidth/Height() should work too. But this can only work, if one o...
[ 0.22360216081142426, -0.2459273338317871, 0.5881235599517822, 0.2515523135662079, 0.08603724837303162, 0.07584384828805923, -0.020010657608509064, -0.10919390618801117, -0.47893616557121277, -0.8740808367729187, -0.1856454759836197, 0.453127920627594, 0.01665007881820202, 0.097242310643196...
to make the container/frame visible (after you have added the component) or call validate() or doLayout() on the container to recalculate the layout, if you added the component after the last layout was done. Another thing to keep in mind is setting and probably configuring a layout manager on the container. If no layo...
[ 0.1697588860988617, -0.22242487967014313, 0.22053270041942596, 0.1880989372730255, -0.12188159674406052, -0.14528338611125946, -0.028470201417803764, -0.16375286877155304, -0.49711886048316956, -0.8066895604133606, -0.11567013710737228, 0.3638294041156769, 0.004548062104731798, 0.155213668...
2:** After I read [your other question](https://stackoverflow.com/questions/210998/canvas3d-not-appearing-in-swing-window) about the same subject, I think you should read [Using Layout Managers](http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html) from The Java Tutorials **Edit:** I don't know if you alr...
[ 0.21304883062839508, -0.08356231451034546, 0.36087286472320557, -0.23715774714946747, -0.3144015967845917, -0.20742569863796234, 0.233753502368927, -0.46199464797973633, -0.2348194122314453, -0.8493815660476685, -0.2658010721206665, 0.5027262568473816, -0.24734389781951904, -0.228130534291...
JPanel(); panel.setBackground(Color.RED); this.add(panel); this.addComponentListener(new ComponentListener() { public void componentResized(ComponentEvent e) { System.out.println(e.getComponent().getSize()); } public void componentHidden(Com...
[ 0.12958821654319763, -0.4959622323513031, 0.7569876909255981, -0.011939853429794312, 0.04551735892891884, 0.33625528216362, 0.3221985101699829, -0.41069090366363525, -0.19703464210033417, -0.37931329011917114, -0.4021025598049164, 0.6577374339103699, -0.5100501775741577, 0.2672860026359558...
componentMoved(ComponentEvent e) {} public void componentShown(ComponentEvent e) {} }); this.setVisible(true); } } ```
[ 0.11635477095842361, -0.284217894077301, 0.598205029964447, 0.1225058063864708, 0.053717970848083496, -0.10237425565719604, 0.4607304334640503, -0.22196133434772491, 0.049023836851119995, -0.3313499391078949, -0.29110780358314514, 0.8140644431114197, -0.5245854258537292, 0.2661009430885315...
So I'm in Des Moines, Iowa and we have a good number of user groups in our area considering our size. Ruby, .Net, Java, Agile, \*nix, etc... Well, tonight a good number of us "leaders" of said user groups got together for a couple drinks and to talk about how we can work together to help make the "DeMo" (I keep seeing ...
[ 1.0139390230178833, 0.37265685200691223, -0.07985755801200867, -0.022070586681365967, 0.06298276036977768, -0.12298325449228287, 0.5612223148345947, 0.703565776348114, -0.1838672012090683, -0.7401140928268433, 0.3227917551994324, 0.1631080061197281, 0.22199678421020508, 0.2610729932785034,...
or the give aways. But I'm more interested to know about things out side of the freebie stuff. I know of 3 different types of events around here for local user groups where each has its own pull: 1) Presentations/Talks - Where someone comes in and talks for an hour or two on a subject to either introduce or advance th...
[ 0.6016210913658142, -0.2598222494125366, -0.12398339807987213, 0.4922123849391937, -0.02313988097012043, -0.31943532824516296, -0.1810241937637329, 0.2527593672275543, -0.256682425737381, -0.3013213872909546, -0.10858921706676483, 0.6163235902786255, 0.41841763257980347, -0.085382878780364...
tricks and try to improve how all of us develop software well. There are times where Microsoft will rent a movie theater screen for a day and have a series of 4 presentations about their latest technologies would be another example here. This can also include things like the Agile Project Leadership Network. 2) [Code ...
[ 1.15277099609375, 0.08585705608129501, -0.09683909267187119, 0.6127685308456421, -0.012657196260988712, -0.1804901361465454, 0.1683526337146759, 0.19772444665431976, -0.2901339530944824, -0.5040770769119263, 0.21559736132621765, 0.3840583860874176, 0.31092560291290283, -0.4107449948787689,...
to get the code to be that way, e.g. a dozen files of code that took a dozen hours to get from nothing to this state that in a demo may seem like this should just come out within a few hours which isn't realistic. Here they have taken a few rooms at a local university to do it. [One blogger's view of one a couple of ye...
[ 0.7423227429389954, 0.20358744263648987, 0.18084977567195892, 0.14664462208747864, -0.29041895270347595, -0.4131823480129242, 0.5246592164039612, -0.03326698765158653, -0.309592068195343, -0.5589283108711243, -0.015493801794946194, 0.1751403659582138, 0.11314034461975098, -0.03061412274837...
a sense. The discussions had were varied and in some cases the results weren't great, like how do we get others to take their off time and come to these things or other ways to volunteer our skills beyond open source projects. [What was going on the first day link.](http://weblogs.asp.net/bsimser/archive/2008/08/16/alt...
[ 0.6360177993774414, -0.17797420918941498, -0.02313176542520523, 0.19704213738441467, -0.5131508708000183, -0.507004976272583, 0.680672824382782, 0.31877660751342773, -0.4833817183971405, -0.5538759231567383, -0.02759973704814911, 0.04478280991315842, 0.25764429569244385, -0.051897168159484...
these things as the Open Spaces had a few people from other countries present which added a nice diversity dimension to things. Are there other local user group type events?
[ 0.7073139548301697, -0.28793296217918396, -0.1476762443780899, 0.1969737857580185, -0.16559314727783203, -0.30738365650177, 0.17131078243255615, 0.46312493085861206, -0.8945556282997131, -0.2609272301197052, -0.11092212051153183, -0.17359629273414612, -0.08473334461450577, -0.0177224278450...
Is there a free DayView Calendar for WPF like this one? <http://www.codeproject.com/KB/selection/Calendardayview.aspx> Thanks in advance! Cheers from Argentina! Have a look at these articles on Code Project * [Creating an Outlook Calendar Using WPF (Part 1)](http://www.codeproject.com/Articles/30329/Creating-an-Outl...
[ 0.3589993119239807, 0.05610205605626106, 0.5241069197654724, 0.16159352660179138, -0.4029805064201355, -0.24161396920681, -0.00813380815088749, 0.36773571372032166, -0.4072493016719818, -0.48306939005851746, 0.09664036333560944, 0.24597184360027313, -0.030362576246261597, -0.30533465743064...
I've recently gotten my hobby java project embedded into a page [thanks to this very site](https://stackoverflow.com/questions/138157/java-console-like-web-applet), but now I'm having some security issues. I have the include: ``` import java.sql.*; ``` and the line: ``` Class.forName("com.mysql.jdbc.Driver").newIn...
[ -0.07597216218709946, 0.27433598041534424, 0.4149278700351715, -0.14661148190498352, 0.24035638570785522, -0.020111430436372757, 0.37294861674308777, -0.22725386917591095, -0.23227691650390625, -0.582756519317627, -0.09599179029464722, 0.7219622135162354, -0.14233903586864471, 0.2992496490...
at java.lang.SecurityManager.checkExit(Unknown Source) at java.lang.Runtime.exit(Unknown Source) at java.lang.System.exit(Unknown Source) at applet.Database.connectDB(Database.java:80) etc... ``` I think I may be able to fix it with a client.policy file, otherwise I might need to write an abstraction ...
[ -0.19939260184764862, 0.288027822971344, 0.11866307258605957, -0.286295622587204, 0.18345636129379272, -0.2373322993516922, 0.554364800453186, 0.07602433860301971, -0.4802047908306122, -0.7644258737564087, -0.30408167839050293, 0.39965391159057617, -0.49031704664230347, 0.16708402335643768...
the whole JVM down. Have you checked if line 80 is actually the Class.forName() line, or does line 80 have some kind of exception handler which tries to call System.exit() if the driver does not load? Anyway, in order to load the mysql jar file in your applet, you need to include it in an ARCHIVE attribute like this: ...
[ -0.0681062862277031, 0.19167959690093994, 0.44659551978111267, -0.21303297579288483, -0.034993574023246765, -0.14651256799697876, 0.3276093006134033, 0.008009199984371662, -0.3983120620250702, -0.5251989960670471, -0.10371454060077667, 0.6273711323738098, -0.2839089632034302, 0.26203173398...
isn't how people normally do it, for security reasons. Better to write something on the server side, if you have control of the app server, and use XML or some other data exchange method to get the data out to the applet. Of course if you are just experimenting to learn about applets, then it's probably fine - but do t...
[ 0.37208375334739685, 0.16506752371788025, 0.1792851984500885, 0.2815987765789032, 0.11800572276115417, -0.007864058017730713, 0.19609606266021729, 0.42873498797416687, -0.15420891344547272, -0.4433055520057678, -0.07667633891105652, 0.3815377950668335, -0.23333969712257385, -0.377770155668...
I thought I understood Java generics pretty well, but then I came across the following in java.lang.Enum: ``` class Enum<E extends Enum<E>> ``` Could someone explain how to interpret this type parameter? Bonus points for providing other examples of where a similar type parameter could be used. It means that the type...
[ 0.21843010187149048, 0.008281927555799484, 0.0604558065533638, -0.17212869226932526, 0.006226818077266216, -0.12148392200469971, 0.04062541574239731, -0.1652979999780655, -0.25649935007095337, -0.581965982913971, 0.033680159598588943, 0.4350031018257141, -0.5615174770355225, 0.209648668766...
`Enum<StatusCode>` - so `E=StatusCode`. Let's check: does `E` extend `Enum<StatusCode>`? Yes! We're okay. You may well be asking yourself what the point of this is :) Well, it means that the API for Enum can refer to itself - for instance, being able to say that `Enum<E>` implements `Comparable<E>`. The base class is ...
[ 0.3875543475151062, 0.037431664764881134, 0.21245595812797546, -0.017528371885418892, -0.25978270173072815, -0.21116705238819122, 0.24858957529067993, -0.12445508688688278, -0.1261729598045349, -0.9525601863861084, -0.04789101332426071, 0.43482160568237305, -0.31940627098083496, 0.05865854...
"messages" (immutable) and "builders" (mutable, used to build a message) - and they come as pairs of types. The interfaces involved are: ``` public interface IBuilder<TMessage, TBuilder> where TMessage : IMessage<TMessage, TBuilder> where TBuilder : IBuilder<TMessage, TBuilder> public interface IMessage<TMessage...
[ 0.19422896206378937, 0.0634906068444252, 0.18367283046245575, 0.021416272968053818, -0.09866967797279358, 0.375731498003006, 0.11612770706415176, -0.16141872107982635, -0.12917521595954895, -0.8893140554428101, -0.2789972424507141, 0.4278673529624939, -0.5218696594238281, 0.073057390749454...
don't need to actually care about this though - it's horrendously complicated, and took several iterations to get to where it is. EDIT: Note that this doesn't stop you from creating odd types which use a type argument which itself is okay, but which isn't the same type. The purpose is to give benefits in the *right* c...
[ 0.05842919647693634, -0.12189124524593353, -0.09267809987068176, -0.0869562029838562, -0.2703983187675476, -0.19799785315990448, 0.13811996579170227, -0.31627577543258667, -0.04149163141846657, -0.8085933327674866, -0.11358814686536789, 0.4282687306404114, -0.36109161376953125, -0.10937846...
`First` itself would be fine.
[ 0.4801884889602661, 0.13044598698616028, 0.15100841224193573, -0.023508761078119278, -0.19123424589633942, -0.19038259983062744, -0.17469680309295654, -0.09456057846546173, 0.26647016406059265, -0.293163537979126, 0.1380687952041626, 0.5812202095985413, -0.09126889705657959, -0.15996421873...
The published code for Palm OS applications doesn't include standard headers, but instead uses Palm OS APIs for things like StrCopy and MemMove. Can I use standard headers and functions or do I need to convert my code to use the Palm OS versions? From a program size point of view its better to use the Palm OS API whene...
[ 0.3886750638484955, 0.27962836623191833, 0.33115154504776, 0.22546422481536865, 0.02137535996735096, -0.23509223759174347, -0.10209254175424576, 0.02482675202190876, -0.08607712388038635, -0.6328684687614441, -0.12331753224134445, 0.5370902419090271, -0.37998658418655396, -0.08456731587648...
their sizes.
[ 0.20507806539535522, 0.24360080063343048, -0.264590322971344, -0.054481323808431625, -0.3470405340194702, 0.4551946520805359, -0.2924603521823883, 0.2434818297624588, -0.5027676224708557, -0.36578574776649475, 0.3800697326660156, 0.22866714000701904, 0.1425493210554123, 0.1294032782316208,...
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it. You should have a look at [numpy](http://www.scipy.org/Tentative_NumPy_Tutorial) if you do matrix manipulation. This is a module mainly written in C, which will be...
[ 0.4078638553619385, -0.051856521517038345, 0.31843101978302, -0.31811878085136414, -0.35734835267066956, 0.24885638058185577, 0.026620808988809586, -0.4518345892429352, 0.004027681890875101, -0.3436402678489685, 0.3052734136581421, 0.43034422397613525, -0.47982683777809143, -0.237626016139...
# Creates a matrix (like a column vector). y = matrix( [[1,2,3]] ) # Creates a matrix (like a row vector). print A.T # Transpose of A. print A*x
[ 0.16496065258979797, -0.30848920345306396, 0.29818516969680786, -0.07342282682657242, -0.3374740481376648, 0.29998984932899475, 0.1943001002073288, -0.41720569133758545, -0.10090261697769165, -0.23746569454669952, -0.21316422522068024, 0.19099237024784088, -0.911706268787384, -0.1223953366...
# Matrix multiplication of A and x. print A.I # Inverse of A. print linalg.solve(A, x) # Solve the linear equation system. ``` You can also have a look at the [array](https://docs.python.org/3.4/library/array.html) module, which is a much more efficient
[ 0.4189169704914093, 0.05325821042060852, 0.24774613976478577, -0.1808963418006897, -0.33782094717025757, 0.07276321947574615, 0.23841701447963715, -0.5081732273101807, -0.4000072479248047, -0.01571710966527462, 0.012164796702563763, 0.5849613547325134, -0.673466145992279, -0.23217774927616...
implementation of lists when you have to deal with only one data type.
[ 0.21613271534442902, -0.2610104978084564, 0.004123652819544077, 0.2994912564754486, -0.08361688256263733, -0.08327040076255798, 0.11338543146848679, -0.4984241724014282, -0.6653547883033752, -0.7883721590042114, -0.34600839018821716, 0.26301515102386475, -0.5843456983566284, -0.49481752514...
What's the best way to implement user controls that require AJAX callbacks? I want to accomplish a few things: * Have events done in the browser (eg, drag and drop) trigger an AJAX notification that can raise a control event, which causes code on the page using the control to do whatever it needs to do (eg, change a...
[ 0.21273541450500488, -0.10387840867042542, 0.11532095074653625, 0.3340485095977783, -0.11030861735343933, -0.2464907020330429, 0.19741082191467285, 0.0902460515499115, -0.1945338249206543, -0.7459301948547363, 0.09694277495145798, 0.546176552772522, -0.22046799957752228, -0.276396870613098...
logic on the page itself that passes events back to the control, because that is repetitive and hard to maintain I'm using jQuery for most of the client side stuff, but for the actual AJAX calls I don't really care if it's jQuery or the ASP AJAX libraries. Effectively what would be perfect is PageMethods on the user...
[ -0.1834079772233963, -0.13889361917972565, 0.19419094920158386, 0.31216636300086975, -0.27601054310798645, -0.23078766465187073, 0.20895886421203613, 0.07580000907182693, -0.15701909363269806, -0.6154705882072449, 0.04204445332288742, 0.815449059009552, -0.2872958183288574, -0.209170743823...
in the page code, have eg: ``` Public Sub HandleLookup(ByVal input As String, ByRef list As List(Of String) Handles MyControl.LookupEntries list = New List(Of String) ' Query database for list of items.. For Each item as String in FullItemList If item.StartsWith(input) then list.Add(item) Next Return li...
[ -0.2111874520778656, 0.14824455976486206, 0.7519893646240234, -0.04012307524681091, -0.31103578209877014, -0.048074591904878616, 0.2854890525341034, -0.2179955095052719, -0.23448047041893005, -0.7865465879440308, -0.34550610184669495, 0.49702689051628113, -0.4794304668903351, 0.28784367442...
them myself. Look into implementing ICallbackEventHandler in your Page -- it's a simple way to make a call back to a page function from JavaScript. Here's a good tutorial: <http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=119>
[ 0.22538891434669495, -0.010010898113250732, 0.3847285509109497, 0.3949653208255768, -0.2421063631772995, 0.20682120323181152, 0.2697955369949341, -0.1409054547548294, -0.2846596837043762, -0.5076595544815063, 0.2053966522216797, 0.5183454155921936, 0.08623180538415909, -0.19214890897274017...
C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separately (I mean static variables outside of classes). But, the order of initialization of variables, is undefined across different compilation units. ...
[ 0.2017749547958374, 0.028757967054843903, 0.027524035423994064, 0.03312663361430168, -0.1751295030117035, -0.12842044234275818, -0.019269095733761787, -0.31874600052833557, -0.4765397608280182, -0.12752124667167664, -0.2728104591369629, 0.45119425654411316, -0.469942569732666, -0.124538041...
across different compilation units. Within the same compilation unit the order is well defined: The same order as definition. This is because this is not resolved at the language level but at the linker level. So you really need to check out the linker documentation. Though I really doubt this will help in any useful...
[ 0.5145750641822815, 0.06495659053325653, 0.1601637303829193, 0.04571479931473732, -0.21076349914073944, -0.5355526208877563, 0.0019291535718366504, -0.2394571453332901, -0.4781809151172638, -0.6279455423355103, -0.19821704924106598, 0.5579469799995422, -0.47983062267303467, 0.1328214555978...
to solve the problem is practically a non starter. This is generally only a problem when initializing globals that reference each other during their own initialization (so only affects objects with constructors). ### There are techniques to get around the problem. * Lazy initialization. * [Schwarz Counter](http://en...
[ -0.3685868978500366, -0.0242600254714489, 0.019967151805758476, 0.02300645411014557, -0.2314480096101761, -0.1646803617477417, 0.35388073325157166, -0.17251206934452057, -0.4339969754219055, -0.4567210078239441, -0.37500816583633423, 0.4368244409561157, -0.4934733510017395, 0.1359989941120...
I have built a MS Access 2007 application that can create reports files in various formats (PDF, XLS, CSV, XML). I would like to allow the creation of these reports to be accessible from a web page where users would just click on a link and get a download of the report produced by my Access application. I would lik...
[ 0.2362137734889984, 0.30840152502059937, 0.3092092275619507, 0.2906268537044525, -0.07696834951639175, -0.222307488322258, -0.03875710815191269, 0.23423951864242554, -0.34384143352508545, -0.5303073525428772, 0.14177082479000092, 0.508545994758606, -0.18329724669456482, 0.3398151695728302,...
downloaded. In essence, my Access application would act as a web service of some kind. The web server is IIS on Windows 2003. Any pointers or ideas would be welcome. I'm not well versed in IIS administration or ASP pages. The first quick and dirty method i could think of would be to call Access from a shell and pa...
[ -0.24330897629261017, 0.3478626608848572, 0.6263278126716614, 0.2814238369464874, 0.06111731752753258, -0.09711335599422455, -0.19991207122802734, 0.33028510212898254, -0.3157837986946106, -0.6718957424163818, 0.10845068842172623, 0.7245522737503052, -0.05561264976859093, 0.372745156288147...
To du this you'll need to pass the report name, a unique request id, and a param array to handle multiple (or none) parameters. Last but not least your Access macro / VBA Sub will need to shut access down. This isnt a good solution as starting one copy of Access per request isn't really advisable though. Another opt...
[ 0.4047504961490631, -0.26459646224975586, 0.43346717953681946, 0.22800953686237335, -0.3275090157985687, -0.18430648744106293, 0.10559073835611343, -0.4670874774456024, -0.23981206119060516, -0.7106942534446716, 0.2809779942035675, 0.6082442402839661, -0.3263712227344513, 0.500445961952209...
Again you'd have to base this around a unique request ID. I'm not really sure which "solution" would be better.... Access as a command line report generator or Access as a batch reporting service. Both would be nasty, but would get you over the hump until you can migrate to a reporting service.
[ 0.4010404944419861, 0.0685737133026123, 0.14763130247592926, 0.3175228536128998, -0.013852224685251713, 0.03899388015270233, -0.027647582814097404, 0.05326416343450546, -0.3335050344467163, -0.5406690239906311, 0.20437423884868622, 0.5212478041648865, -0.0011263801716268063, 0.257659196853...
I want to find out if length property for Java arrays is an int/long or something else. It is an int. See the [Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/arrays.html#10.7), section 10.7.
[ 0.36371859908103943, -0.036476925015449524, 0.01667756773531437, -0.2040010243654251, -0.20737020671367645, -0.1530681550502777, -0.039359886199235916, -0.1853911578655243, -0.4435555934906006, -0.3185449540615082, 0.11709970235824585, 0.43457287549972534, -0.14352260529994965, 0.009669582...
To use [modular exponentiation](http://en.wikipedia.org/wiki/Modular_exponentiation) as you would require when using the [Fermat Primality Test](http://en.wikipedia.org/wiki/Fermat_primality_test) with large numbers (100,000+), it calls for some very large calculations. When I multiply two large numbers (eg: 62574 and...
[ 0.016262738034129143, 0.25007590651512146, 0.3055415749549866, -0.05399128794670105, -0.2363448292016983, 0.27875590324401855, 0.1215396374464035, -0.4796958565711975, -0.3706064224243164, -0.276824027299881, 0.1635378897190094, 0.27386027574539185, -0.24394702911376953, 0.3763542771339416...
numbers? For some reason, there are two standard libraries in PHP handling the arbitrary length/precision numbers: [BC Math](http://www.php.net/manual/en/book.bc.php) and [GMP](http://www.php.net/manual/en/book.gmp.php). I personally prefer GMP, as it's fresher and has richer API. Based on GMP I've implemented [Decima...
[ 0.44615817070007324, 0.30760303139686584, 0.2584522068500519, 0.33782142400741577, -0.4719407558441162, 0.2756241261959076, -0.327025443315506, -0.15478087961673737, -0.5592054128646851, -0.21646322309970856, 0.25899338722229004, 0.27355653047561646, 0.15279100835323334, 0.1132473200559616...
A while ago I had a query that I ran quite a lot for one of my users. It was still being evolved and tweaked but eventually it stablised and ran quite quickly, so we created a stored procedure from it. So far, so normal. The stored procedure, though, was dog slow. No material difference between the query and the pr...
[ 0.1995125263929367, 0.16535942256450653, 0.21603207290172577, -0.01644185744225979, -0.08307293057441711, -0.1338246911764145, 0.4087286591529846, 0.30409950017929077, -0.3103742301464081, -0.20256337523460388, 0.29361167550086975, 0.6357139945030212, -0.4811873137950897, 0.218778312206268...
also known as 'parameter sniffing', which might explain the paucity of Google hits when I tried to search it out.) We abstracted some of the stored procedure to a second one, wrapped the call to this new inner proc into the pre-existing outer one, called the outer one and, hey presto, it was as quick as the original ...
[ 0.25150173902511597, -0.18534567952156067, 0.42203113436698914, 0.4093993902206421, -0.22004801034927368, -0.22046615183353424, 0.34181511402130127, -0.006738625001162291, -0.026763705536723137, -0.1553315967321396, 0.18169264495372772, 0.6543168425559998, -0.12711626291275024, -0.10358601...
something else when you're working with SQL 2005 and stored procs with parameters. SQL Server will compile the stored proc's execution plan with the first parameter that's used. So if you run this: ``` usp_QueryMyDataByState 'Rhode Island' ``` The execution plan will work best with a small state's data. But if some...
[ 0.14165405929088593, -0.28616827726364136, 0.1561007797718048, 0.05527998507022858, 0.03294440731406212, -0.091026172041893, 0.22310061752796173, 0.16360341012477875, -0.4598655700683594, -0.4448533058166504, 0.13188770413398743, 0.6428259015083313, -0.4017795920372009, -0.0555839501321315...
be recompiled until there's a big reason to do it, like if statistics are rebuilt. This is where query plans come in, and SQL Server 2008 offers a lot of new features that help DBAs pin a particular query plan in place long-term no matter what parameters get called first. My concern is that when you rebuilt your stor...
[ -0.16718408465385437, -0.07843169569969177, 0.33467820286750793, 0.1419920176267624, -0.1620987504720688, -0.10245732963085175, 0.2549944519996643, -0.12088465690612793, -0.3919123709201813, -0.2384088635444641, -0.150126650929451, 0.6064541935920715, -0.35334035754203796, -0.0760831162333...
at some point with an unusual set of parameters and thus, an inefficient query plan. You might not have fixed anything, and you might face the same problem the next time the server restarts or the query plan gets recompiled.
[ 0.07566812634468079, -0.14888453483581543, 0.2370978146791458, 0.41183850169181824, 0.2396247833967209, -0.17971569299697876, 0.14166100323200226, 0.12237678468227386, -0.43515944480895996, -0.37789422273635864, -0.20933672785758972, 0.35416343808174133, -0.26905742287635803, 0.28681811690...
I've got a big big code base that includes two main namespaces: the engine and the application. The engine defines a vector3 class as a typedef of another vector3 class, with equality operators that sit in the engine namespace, not in the vector3 class. I added a class to the application that also had equality operat...
[ 0.11068418622016907, 0.04178094118833542, 0.02474883571267128, 0.05746503919363022, -0.1673549860715866, 0.3973791003227234, -0.008638880215585232, -0.11225041002035141, -0.009310519322752953, -0.5847802758216858, 0.22625546157360077, 0.3884924352169037, -0.5462198257446289, 0.055352758616...
engine.h namespace Engine { class Vector3Impl { ... }; typedef Vector3Impl Vector3; bool operator==(Vector3 const &lhs, Vector3 const &rhs) { ... } } // myfile.cpp #include "engine.h" namespace application { class MyClass { ... }; bool operator==(MyClass const &lhs, MyClass const &rhs) { ... } ...
[ -0.3932187855243683, -0.2819787263870239, 0.5248754620552063, -0.23726551234722137, 0.07009568810462952, 0.23410801589488983, 0.17060065269470215, -0.4841938018798828, -0.05787084251642227, -0.7390998601913452, -0.12882713973522186, 0.8483633399009705, -0.39720287919044495, 0.0214775763452...
Engine::Vector3 a, b; ... if ( a == b ) { ... } // fails } } ``` However after thinking about it I can't see why the compile failed. There are no implicit conversions from vector3s to my class or vice-versa, and argument-dependent look-up should be pulling in the equality operator from the engine ...
[ -0.1860286444425583, -0.08297242969274521, 0.2656249403953552, -0.33069664239883423, -0.3790363371372223, 0.21962189674377441, 0.22823725640773773, -0.30185407400131226, -0.19623950123786926, -0.6243401169776917, 0.34858718514442444, 0.9006004333496094, -0.6722232699394226, -0.065480977296...
this problem, but I'm not sure where to start looking. Something like the opposite of a rogue "using Engine"? Anyone got any ideas? C++ Standard, 3.4.4.2 declares: > For each argument type T in the function call, there is a set of zero or more associated namespaces and a set of zero > or more associated classes to be...
[ 0.21979071199893951, -0.019893642514944077, 0.1522030085325241, -0.08454412966966629, -0.07728945463895798, -0.037126317620277405, 0.1765621155500412, -0.22158199548721313, 0.015079142525792122, -0.387867271900177, -0.13408686220645905, 0.5905908346176147, -0.5002745389938354, 0.1840621381...
work with typedef's.
[ 0.59126877784729, -0.023103047162294388, -0.03082476742565632, 0.05803580582141876, 0.02330166846513748, -0.0797848030924797, -0.0020122267305850983, 0.12703052163124084, -0.26336097717285156, -0.3813478648662567, 0.08980592340230942, 0.26904138922691345, -0.1019933670759201, -0.2520530819...
I have been tasked to implement a WCF service that makes use of NetMsmqBinding. I wrote the service and it works fine. The problem is that in the last minute they told me that there will be no Active Directory integration. So I don't know how to configure the security of the service. There is a VPN tunnel between the s...
[ 0.40349775552749634, 0.09602441638708115, 0.3899879455566406, 0.08670079708099365, -0.043509647250175476, -0.3168691098690033, 0.47107812762260437, 0.0032538599334657192, -0.07348079979419708, -0.8122237920761108, 0.0733385756611824, 0.5522438883781433, -0.21086202561855316, 0.292889505624...
MSMQ is preferred for this scenario. So I am sending one way messages through MSMQ - which works fine. My only problem is that I am new to WCF and am not familiar with WCF security. I would like to be able to sign and encrypt the messages since the information to be sent to the service is confidential. I would like to ...
[ 0.4022802710533142, -0.07837382704019547, 0.501787006855011, 0.09785077720880508, -0.012319741770625114, -0.09918395429849625, 0.4571082293987274, 0.1452867090702057, -0.341930627822876, -0.7736640572547913, 0.19198989868164062, 0.4477720260620117, -0.22942204773426056, 0.21097368001937866...