text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
SqlDbType.DateTime); param.Value = new SqlDateTime(DOB.ToUniversalTime()); parameters.Add(param); parameters.Add(new SqlParameter("@Date_Of_Birth", new SqlDateTime(DOB.ToUniversalTime()).ToSqlString())); ``` **Additional EDIT** The one I thought most likely to work: ``` SqlParameter param = new SqlParameter("...
[ -0.03680211678147316, 0.16789574921131134, 0.6260868310928345, -0.18281498551368713, 0.0783960372209549, 0.4027349054813385, 0.26012611389160156, -0.6162095665931702, -0.31053781509399414, -0.34337854385375977, -0.03818065673112869, 0.3000435531139374, -0.07046599686145782, 0.2337591797113...
things here and there to be concise. Turns out my problem was in the code I left out, which I'm sure any one of you would have spotted in an instant. I had wrapped my sproc calls inside a transaction. Turns out that I was simply not doing `transaction.Commit()`!!!!! I'm ashamed to say it, but there you have it. I stil...
[ 0.20137280225753784, 0.2319987565279007, 0.1492985486984253, 0.13072963058948517, 0.03922496363520622, -0.1844688057899475, 0.260841429233551, 0.052319470793008804, -0.5354717969894409, -0.2691856026649475, 0.13367323577404022, 0.7050662636756897, -0.18487195670604706, -0.00144691450987011...
showed the incorrect syntax. It acted as a red-herring, making me believe there was a query syntax problem instead of the much more simple and true answer, which was that I need to commit the transaction! I marked an answer below as correct, and threw in some up-votes on others because they did, after all, answer the...
[ -0.02030855044722557, 0.16931647062301636, 0.5043355226516724, 0.2715870141983032, 0.14430157840251923, -0.16748592257499695, 0.02618846669793129, -0.16648933291435242, -0.3112790882587433, -0.2777670621871948, -0.05390671268105507, 0.5319378972053528, -0.13230927288532257, 0.0562188848853...
for a bunch of problems then). You should be able to get the value into the DB. If not, here is a very simple example of how to do it: ``` static void Main(string[] args) { // Create the connection. using (SqlConnection connection = new SqlConnection(@"Data Source=...")) { // Open the connection. ...
[ 0.029821278527379036, -0.0879426896572113, 0.44047582149505615, -0.03405671566724777, -0.001506629167124629, -0.2396334707736969, 0.22526346147060394, -0.10541567951440811, -0.10277137905359268, -0.5264474153518677, -0.14724105596542358, 0.3898124098777771, -0.45888006687164307, 0.49264982...
{ // Set the command type. command.CommandType = System.Data.CommandType.StoredProcedure; // Add the parameter. SqlParameter parameter = command.Parameters.Add("@dt", System.Data.SqlDbType.DateTime); // Set the value.
[ -0.01883840188384056, -0.33771073818206787, 0.5024517774581909, 0.001487869187258184, 0.28867876529693604, 0.31681323051452637, -0.03011031076312065, -0.27336156368255615, -0.0010458430042490363, -0.2640073001384735, -0.051346633583307266, 0.3589557707309723, -0.3132989704608917, 0.1778346...
parameter.Value = DateTime.Now; // Make the call. command.ExecuteNonQuery(); } } } ``` I think part of the issue here is that you are worried that the fact that the time is in UTC is not being conveyed to SQL Server. To that end, you shouldn't, because SQL Server doesn't know that...
[ 0.43020498752593994, -0.23158250749111176, 0.42068222165107727, 0.1299455165863037, 0.3387965261936188, -0.3221406936645508, 0.214909166097641, 0.09161605685949326, -0.2800891101360321, -0.5269085168838501, -0.1485401839017868, 0.40425658226013184, -0.25192299485206604, 0.26321566104888916...
the UTC value, then convert it to UTC before passing it to SQL Server (unless your server has the same time zone as the client code generating the `DateTime`, and even then, that's a risk, IMO). SQL Server will store this value and when you get it back, if you want to display it in local time, you have to do it yoursel...
[ 0.21162214875221252, -0.3525967001914978, 0.5770189166069031, 0.1793575882911682, 0.32310786843299866, -0.06094248965382576, 0.07079093903303146, 0.08698133379220963, -0.20069284737110138, -0.615756630897522, -0.3028811812400818, 0.3120177686214447, -0.14312735199928284, 0.1538094878196716...
string) to the stored procedure. And when you get the value back, call the [`ToLocalTime` method](http://msdn.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx) to get the time in the local time zone.
[ -0.03834681585431099, -0.5435090065002441, 0.7337712049484253, -0.01328720897436142, 0.565057098865509, -0.0865229070186615, 0.018098969012498856, 0.2941874861717224, -0.1777939647436142, -0.4573362469673157, -0.3171553611755371, 0.34160906076431274, -0.09445292502641678, 0.246217489242553...
We have a distributed application containing C++ and Java modules, interacting via CORBA. Are there any C++ libraries/tools for exposing "variables" and "methods" to JMX tools (to create unified management) ? So even though your application is C++ and Java, you're only looking to expose C++ module attributes to the JM...
[ 0.4643632471561432, -0.015726793557405472, -0.10574443638324738, 0.1615803986787796, -0.17620210349559784, -0.36075249314308167, -0.07785557210445404, -0.3080744743347168, -0.3597593307495117, -0.5997102856636047, 0.1400303989648819, 0.6907141804695129, -0.3975105881690979, -0.058783285319...
C++ components (and I *know* you can for Java) and you may as well stick to one protocol rather than have one for C++ and one for Java. The last piece (and probably the easiest) is to find an SNMP "bridge" for your JMX console, manager or whatever you're using.
[ 0.25909942388534546, -0.2130127251148224, 0.31806549429893494, 0.1626436412334442, -0.19050233066082, -0.26908960938453674, 0.04096978157758713, 0.02381124347448349, -0.3426806628704071, -0.9525545835494995, 0.12177925556898117, 0.34075039625167847, -0.32458192110061646, -0.395774871110916...
I have a sprite that I do some custom drawing in, but I would like the container to know where to position the sprite properly. To do this, the container needs to know how big the sprite is. UIComponents go through a measure stage, but sprites don't . How do I calculate the size that a sprite will be? **Edit:** I'm do...
[ 0.33260583877563477, -0.1928798109292984, 0.749396026134491, 0.0852472186088562, -0.19332343339920044, 0.2995997369289398, -0.023172011598944664, -0.1837081015110016, -0.2952877879142761, -0.5978522896766663, 0.08563047647476196, 0.18251334130764008, 0.13826049864292145, 0.0694309398531913...
can gather is, you can't tell ahead of time, you must actually draw into the sprite to determine it's size.
[ 0.33593815565109253, -0.15789060294628143, 0.2929462790489197, 0.5325275659561157, -0.41200920939445496, -0.004026649985462427, 0.07282093912363052, -0.34063124656677246, -0.1858690232038498, -0.3819446265697479, 0.1981644630432129, 0.17482763528823853, -0.050923049449920654, 0.17252150177...
Our I.T. dept doesn't allow connections to the SVN server from outside the physical office. (They're just kind of like that.) I need to work on projects when I'm not at the office. I could just check out the project and wait until I come in to do a check-in. Maybe that would be best. But I like to check in frequently....
[ 0.9703468680381775, -0.07696397602558136, 0.3941385746002197, 0.20423570275306702, 0.25584331154823303, -0.17334070801734924, 0.10635673999786377, 0.1712283492088318, -0.01358713023364544, -0.8919396996498108, 0.21710368990898132, 0.42503589391708374, 0.2974325120449066, 0.0062873563729226...
own repository on a VPS server that I use for personal projects. I investigated the `svn switch` command. With my current project in both repos I tried switching my working copy from personal to work SVN servers... ``` $ svn switch --relocate svn+ssh://personalvps.com/svn/project/trunk svn://worksvn/project/trunk svn...
[ 0.07546249032020569, 0.05326953902840614, 0.6141626238822937, 0.10999757051467896, 0.06500254571437836, -0.15880873799324036, 0.35894545912742615, -0.20588791370391846, -0.546377956867218, -0.44831615686416626, -0.1352626532316208, 0.36302340030670166, 0.0780695378780365, 0.183923050761222...
the table. I have to find a solution within the current setup, which is no connections from outside except our Web servers. I'll take a look at distributed version control. As a last-ditch effort, you can always poke a hole in your corporate firewall with SSH. Look into "ssh tunnels" (and also, come to think of it, "p...
[ 0.4031430780887604, 0.3769601583480835, 0.3629452884197235, 0.17503421008586884, 0.24644112586975098, -0.2502027451992035, 0.16556783020496368, 0.22646310925483704, -0.3474835455417633, -0.704626739025116, -0.016353638842701912, 0.6689777970314026, -0.10496620088815689, 0.25118425488471985...
possible to use the same exact technique if you install Cygwin first. **EDIT**: Sorry I wasn't more clear on how this works. The option you want is -R. It opens a port on the remote machine (for listening). When something connects to that port on the remote machine, the connection travels back down the SSH connection ...
[ 0.3816828429698944, -0.08046045154333115, 0.26800113916397095, 0.11794035136699677, -0.0018613114953041077, -0.04038127511739731, 0.45091524720191956, -0.09109174460172653, -0.2501537799835205, -0.8421440720558167, -0.3822286128997803, 0.5635029673576355, -0.03693082928657532, 0.2066044509...
home, you set your SVN working copy (using `svn switch --relocate`) to point at your home computer. BTW, the SVN port is 3690 by default, if you're running the svnserve daemon.
[ 0.23345671594142914, 0.1816762089729309, 0.6471073031425476, -0.21441221237182617, 0.18436847627162933, -0.03895043209195137, 0.18590356409549713, 0.18837010860443115, -0.2960345149040222, -0.6590369939804077, -0.07320987433195114, 0.3613876402378082, -0.08662627637386322, 0.35947826504707...
Currently i am working on a desktop application which consists mathematical analysiss.I am using qt for GUI and project written in c++. When user starts an analysis, i open a worker thread and start a progress bar.Everything is ok up to now, problem starts when user cancels operation.Operation is complex, i am using se...
[ 0.10130023211240768, 0.21420539915561676, -0.003786786226555705, -0.01631992869079113, 0.04333332180976868, -0.026502877473831177, 0.2360881268978119, -0.12963390350341797, -0.31435146927833557, -0.5977161526679993, 0.11851248145103455, 0.47761452198028564, -0.16537989675998688, 0.28372982...
is really complex so should i put try-catch to all of my functions or is there a more generic way, pattern.. Edit: Problem is my objects are transfered between scopes, so shared\_ptr or auto\_ptr doesnt solve my problem, Flag idea can be, but i think it requires so much code and there should be an easy way. A pretty c...
[ 0.2738451659679413, -0.038512397557497025, 0.07045493274927139, 0.09275150299072266, 0.01603587158024311, -0.23095457255840302, 0.4704023599624634, 0.09313662350177765, -0.3608379065990448, -0.5479715466499329, 0.008938267827033997, 0.1491330862045288, -0.3396126925945282, 0.29719534516334...
I am interested in getting an install of Django running on IronPython, has anyone had any success getting this running with some level of success? If so can you please tell of your experiences, performance, suggest some tips, resources and gotchas? Besides the Jeff Hardy blog post on [Django + IronPython](http://jdha...
[ 0.03783084452152252, 0.6128858327865601, -0.25435614585876465, -0.07019802182912827, -0.4076267182826996, -0.07130930572748184, 0.3703128695487976, 0.15066413581371307, -0.1043289452791214, -0.6176543235778809, 0.07181200385093689, 0.5523605346679688, -0.3098757565021515, -0.19667547941207...
ComponentAce's zlib.net. And finally, in [easy\_install on IronPython, Part Deux](http://jdhardy.blogspot.com/2008/12/easyinstall-on-ironpython-part-deux.html) Jeff discusses some final tweaks that are needed before easy\_install can be used with IronPython.
[ -0.08024216443300247, -0.005375524517148733, 0.316333144903183, 0.036635544151067734, 0.029109982773661613, -0.2580864131450653, 0.14800986647605896, -0.16507264971733093, 0.06517521291971207, -0.5675869584083557, -0.31562334299087524, 0.7771294713020325, -0.4783250391483307, -0.2560474574...
I've tried msysGit and Git on Cygwin. Both work just fine in and of themselves and both run gitk and git-gui perfectly. Now how the heck do I configure a mergetool? (Vimdiff works on Cygwin, but preferably I would like something a little more user-friendly for some of our Windows-loving coworkers.) To follow-up on Cha...
[ 0.04059680551290512, -0.051763493567705154, 0.4830617308616638, 0.06355695426464081, -0.20302075147628784, 0.04340820759534836, 0.224577397108078, 0.013311192393302917, -0.032818738371133804, -1.060451865196228, -0.06930273771286011, 0.7857617735862732, -0.4116055369377136, 0.0209731627255...
\"$LOCAL\" \"$REMOTE\" \"$MERGED\"" ``` The changes (relative to Charles Bailey): * added to global git config, i.e. valid for all git projects not just the current one * the custom tool config value resides in "mergetool.[tool].cmd", not "merge.[tool].cmd" (silly me, spent an hour troubleshooting why git kept compl...
[ 0.2379334568977356, -0.008580037392675877, 0.5506448149681091, 0.08038724958896637, -0.020405597984790802, 0.3716939091682434, 0.23356880247592926, -0.17499230802059174, -0.34167081117630005, -0.8571465015411377, -0.13198953866958618, 0.4223456382751465, -0.2820085883140564, 0.101158685982...
(Feb 2014) As pointed out by [@Gregory Pakosz](https://stackoverflow.com/users/216063/gregory-pakosz), latest [msys git](http://msysgit.github.io/) now "natively" supports **p4merge** (tested on *1.8.5.2.msysgit.0*). You can display list of supported tools by running: ``` git mergetool --tool-help ``` You should s...
[ -0.2842974364757538, 0.03719908744096756, 0.57635098695755, -0.11899802088737488, -0.06311321258544922, 0.0978579893708229, 0.3271480202674866, -0.15031243860721588, -0.24098731577396393, -0.9014842510223389, -0.4585034251213074, 0.37955141067504883, -0.3409842550754547, 0.3247032463550567...
admin rights or UAC elevation) * Although `~` should expand to current user's home directory (so in theory the path should be `~/AppData/Local/Perforce/p4merge.exe`), this did not work for me * Even better would have been to take advantage of an environment variable (e.g. `$LOCALAPPDATA/Perforce/p4merge.exe`), git does...
[ 0.07500480860471725, -0.0028013393748551607, 0.6158829927444458, 0.3831058144569397, 0.17585286498069763, -0.1850106120109558, 0.025809239596128464, -0.08763645589351654, 0.1771692931652069, -0.8682242631912231, -0.09804383665323257, 0.5511879324913025, -0.21189500391483307, 0.086396321654...
I have several servers hosted with GoGrid, and every time I reboot one of my cloud servers, the system clock is incorrect. The server isn't a member of a domain, so I just have the OS set to sync with an Internet time server. This only happens once a day, and I don't see an option to make this happen automatically upon...
[ 0.24144378304481506, -0.10639230161905289, 0.5080054998397827, 0.16728098690509796, 0.3748072385787964, -0.16099371016025543, 0.38269931077957153, 0.20095017552375793, -0.10148870199918747, -0.7710270881652832, -0.03919675201177597, 0.7614783644676208, -0.07923997193574905, 0.2597483992576...
isn't available when the batch file is run. How can I cause the time sync to start after the OS is fully loaded and the network connection is available? I need the time to be correct ASAP after the computer boots so timestamps in my database will be correct. On Windows 2008, there is an option in the Task Scheduler tha...
[ -0.021315935999155045, -0.24586834013462067, 0.4470880925655365, -0.017342424020171165, 0.15391921997070312, 0.026635508984327316, 0.4626809060573578, -0.15847983956336975, -0.3829217851161957, -0.5614192485809326, -0.049983687698841095, 0.8212631940841675, -0.2064933031797409, -0.13188710...
your batch file. Finally, add a Condition to start the task only if the network connection is available. I then asked it to restart the command up to 3 times if it failed. That seems to work great. On older versions of Windows, use the following batch file contents to retry the sync command until it is successful, or ...
[ 0.28491461277008057, -0.135864719748497, 0.9406238198280334, -0.15026850998401642, 0.1596561223268509, 0.05371569097042084, 0.6862598061561584, -0.17534011602401733, -0.07562506198883057, -0.4319068491458893, -0.30923616886138916, 0.8440760374069214, -0.09018513560295105, -0.02419661544263...
goto SyncEnd :SyncDelay REM *** If unsuccessful, delay 10 seconds, then retry choice /n /t:y,10>nul goto SyncStart :SyncEnd ```
[ -0.06134714558720589, -0.23528438806533813, 0.3389238715171814, 0.008273730054497719, 0.04553763568401337, 0.28685203194618225, 0.5590694546699524, -0.27915406227111816, 0.1748812049627304, -0.23686081171035767, -0.49531564116477966, 0.5091858506202698, -0.26379796862602234, -0.03732596337...
I have an Oracle table that contains a field of LONG RAW type that contains ASCII character data. How can I write a query or view that will convert this to a more easily consumed character string? These are always going to be single-byte characters, FWIW. Maybe `select ...., to_lob(long_raw) from old_table` (<http:...
[ 0.35673627257347107, 0.20407776534557343, -0.04798048734664917, 0.007169469725340605, 0.02036386728286743, 0.22201408445835114, -0.08716856688261032, -0.15418660640716553, 0.07114779949188232, -0.6271505355834961, -0.018730835989117622, 0.28949469327926636, -0.07569392770528793, 0.15920652...
Using Eclipse I want to view the source code for a core Java class (E.g. `java.util.concurrent.ConcurrentHashMap`) but when I navigate to the source using 'Open Declaration' it says 'Source not found' and gives me the option to attach the source. My question is; how do i attach the source? Where do i get the source .j...
[ 0.5646251440048218, 0.2762512266635895, 0.18891967833042145, -0.18963807821273804, -0.48684459924697876, -0.2352122664451599, 0.03644172474741936, 0.0956311896443367, -0.3034117817878723, -0.5736659169197083, 0.11414221674203873, 0.7280677556991577, -0.2671746015548706, 0.04222042858600616...
Some of the fellows in the office think that when they've added threads to their code that windows will assign these threads to run on different processors of a multi-core or multi-processor machine. Then when this doesn't happen everything gets blamed on the existence of these threads colliding with one another on sai...
[ 0.3069939613342285, 0.5582399964332581, -0.05867816135287285, 0.3857765197753906, 0.15722514688968658, -0.32665103673934937, 0.3925187885761261, 0.032552320510149, -0.7474004626274109, -0.431316077709198, 0.008319742977619171, 0.46218571066856384, -0.3432803452014923, 0.4730772376060486, ...
display problems on a multi-processor machine. (This happens if the code is safe in the face of time slicing but broken in the face of true concurrency.)
[ -0.23501528799533844, 0.24842233955860138, 0.08975805342197418, 0.2117118090391159, -0.0955030769109726, -0.02991408109664917, 0.4246711730957031, 0.4159996509552002, -0.6577401161193848, -0.9818755984306335, -0.24202433228492737, 0.40171733498573303, -0.589545726776123, 0.0761458128690719...
I'm writing a simplistic game to learn get some more C++ experience, and I have an idea where I feel polymorphism *almost* works, but doesn't. In this game, the `Party` moves fairly linearly through a `Map`, but can occasionally encounter a `Fork` in the road. A fork is (basically) an `std::vector<location*>`.Originall...
[ -0.21701349318027496, -0.16660243272781372, 0.3626084625720978, -0.1100124791264534, 0.022403882816433907, 0.0057287635281682014, -0.06974989920854568, 0.009488673880696297, -0.28316736221313477, -0.35493096709251404, 0.11145375669002533, 0.23362845182418823, -0.34461790323257446, 0.226813...
being derived from Location, and overloading some new function `getNext()`. But in the latter case, the `location` (a low level structure) would have to be the one to present the message to the user instead of "passing this back up", which I don't feel is elegant as it couples `location` to `UserInterface::*`. Your op...
[ 0.03314799815416336, -0.2948668599128723, 0.22882802784442902, 0.12094996124505997, -0.08192209899425507, 0.07357529550790787, 0.24540716409683228, -0.07355188578367233, 0.19660323858261108, -0.5385310649871826, -0.10395166277885437, 0.3965579569339752, -0.30247974395751953, 0.079729281365...
0; }; class Location { public: virtual Location * GetNext(IDirectionChooser & chooser) { return nextLocation; } virtual Describe(); private: Location * nextLocation; }; class Fork : public Location { public: virtual Location * GetNext(IDirectionChooser & chooser) { for (int i = 0; i < locations...
[ -0.19675089418888092, -0.5198864340782166, 0.6125267148017883, -0.07808386534452438, 0.5965353846549988, 0.11148283630609512, 0.03507532924413681, -0.16242732107639313, -0.0016221643891185522, -0.7086599469184875, -0.3672345280647278, 0.44193968176841736, -0.09793101996183395, 0.4334385395...
} virtual bool ShouldIGoThisWay(Location & way) { way.Describe(); cout << "Do you want to go that way? y/n" << endl; char ans; cin >> ans; return ans == 'y'; } }; ```
[ 0.12460318952798843, -0.1799861490726471, 0.5938866138458252, 0.07445729523897171, 0.6110833883285522, 0.0035537562798708677, 0.562742292881012, 0.23616936802864075, 0.03356806933879852, -0.33648622035980225, -0.23025847971439362, 0.3770802915096283, -0.06089447811245918, 0.492498844861984...
I've read a couple of blog post mentioning that for public APIs we should always return ICollection (or IEnumerable) instead of List. What is the real advantage of returning ICollection instead of a List? Thanks! Duplicate: [What is the difference between List (of T) and Collection(of T)?](https://stackoverflow.com/q...
[ 0.13306576013565063, -0.18133856356143951, -0.027883077040314674, 0.39217761158943176, -0.22346697747707367, -0.016977371647953987, 0.07237274944782257, -0.11812356114387512, -0.32714179158210754, -0.5227903127670288, -0.11230308562517166, 0.3149991035461426, -0.29371026158332825, 0.174427...
Pardon the dumb newbie question here; web programming isn't my forte... (blush) I have an aspx page running on a web server. I have a blob (byte array) containing any kind of binary file, plus a file name. I would like to push this file to be downloaded through the browser onto the client, and opened using whatever a...
[ 0.5897842049598694, 0.351545512676239, 0.27852559089660645, 0.07411820441484451, 0.277957558631897, 0.05898289754986763, 0.010202188976109028, 0.48328888416290283, -0.37177136540412903, -0.6229646801948547, -0.03630697354674339, 0.09007152915000916, -0.10652618110179901, 0.0439932197332382...
I'm using the wrong keywords. This really should be obvious how to do it, but I'm having no joy. What is the trick? Thanks! ``` Response.BinaryWrite(byteArray); ``` You should also set the content type ``` Response.ContentType = "application/pdf"; ``` But that will be based on your file type. And the file name...
[ 0.025653058663010597, 0.2257959544658661, 0.8524497747421265, -0.11991648375988007, -0.10486951470375061, -0.0748354122042656, 0.12230774760246277, -0.3768702447414398, -0.10171986371278763, -0.608498752117157, -0.6602880954742432, 0.7222645878791809, -0.2810584306716919, 0.119015775620937...
I have a query like this: ``` SELECT t1.id, (SELECT COUNT(t2.id) FROM t2 WHERE t2.id = t1.id ) as num_things FROM t1 WHERE num_things = 5; ``` The goal is to get the id of all the elements that appear 5 times in the other table. However, I get this error: ``` ERROR: column "num_things" does ...
[ -0.12587183713912964, 0.035147346556186676, -0.022010095417499542, -0.04884329065680504, -0.01555680762976408, -0.06919555366039276, 0.16275539994239807, -0.29258906841278076, -0.35387155413627625, -0.45488977432250977, 0.1759157031774521, 0.1925242394208908, -0.16490940749645233, 0.378760...
there any other way of achieving this result? I think you could just rewrite your query like so: ``` SELECT t1.id FROM t1 WHERE (SELECT COUNT(t2.id) FROM t2 WHERE t2.id = t1.id ) = 5; ```
[ 0.17330604791641235, -0.122560515999794, 0.29223358631134033, -0.039052288979291916, 0.14249780774116516, -0.07629885524511337, 0.1685105264186859, -0.6423971652984619, -0.03045293316245079, -0.3574506640434265, 0.09069457650184631, 0.4384602904319763, -0.42282095551490784, 0.0771871507167...
Is there a x64 or ia64 version of SQL Server Management Studio (SSMS) 2005? All the information I'm seeing leads me to believe there is only a x86 version. This link is my evidence that a 64-bit version doesn't exist - <http://support.microsoft.com/?id=906892> Nope the management studio (and Visual studio for that mat...
[ 0.10728944092988968, 0.3276519477367401, 0.00931987538933754, 0.13627564907073975, -0.11181333661079407, -0.3587161600589752, 0.3420141935348511, 0.3506299555301666, -0.28670910000801086, -0.27055618166923523, 0.08872274309396744, 0.6561779379844666, -0.001702300738543272, 0.11266657710075...
If I use /clr:oldSyntax the following should work: ``` public __value enum IceCreamFlavors { Vanilla, Chocolate, Sardine, }; ``` what is the equivalent in non-oldSyntax? How do I declare a "managed" enum in Managed C++ for .NET 2.0? **Edit:** when I follow JaredPar's [advice](https://stackoverflow.com/ques...
[ -0.04511220008134842, 0.480715811252594, 0.3737998902797699, -0.20149414241313934, -0.025841442868113518, -0.008958184160292149, 0.4178345501422882, 0.10230798274278641, -0.17103856801986694, -0.26886266469955444, -0.3381779193878174, 0.43865126371383667, -0.22014525532722473, 0.1200043931...
What I'd like to do is provide a link on an intranet web page that will launch a telnet session and pass context information to a shell script that will take the user to a specific "green screen." This "pseudolink" might help show what I'm looking for: ``` <a href="telnet://<user>:<password>@<host>?showdetail%20123"...
[ 0.4449707567691803, 0.10791181027889252, 0.27933844923973083, 0.3043115437030792, 0.1305650919675827, -0.36687684059143066, 0.1744149625301361, -0.047019995748996735, -0.3241802453994751, -0.8875550031661987, 0.16627788543701172, 0.5316834449768066, 0.04443591833114624, -0.0140774473547935...
a bitmap with some header data. I'd use Irfanview if you do not use Visual Studio or what not. If you use Visual Studio, just create a new cursor, and copy and paste the image data right into the editor... I'm sure I could whip up a tool that does this for you on a file basis, but I'm sure they are many tools out there...
[ 0.3501930236816406, -0.4157570004463196, 0.5261688232421875, 0.44642624258995056, -0.35223639011383057, -0.28861141204833984, 0.008724125102162361, 0.12210321426391602, -0.10455548763275146, -0.7495055794715881, 0.2679201364517212, 0.7302504181861877, -0.22770461440086365, -0.0347745567560...
I quite like Rails' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example. So I am wondering, what database mig...
[ 0.11156432330608368, 0.08794762194156647, 0.02377067133784294, 0.038961172103881836, 0.05238955840468407, -0.20877449214458466, 0.03270361199975014, 0.4438595473766327, -0.22090652585029602, -0.6454735398292542, 0.49359211325645447, 0.23574158549308777, -0.2111019641160965, 0.0456227846443...
I'm developing an application which currently have hundreds of objects created. Is it possible to determine (or approximate) the memory allocated by an object (class instance)? You could use a memory profiler like .NET Memory Profiler (<http://memprofiler.com/>) or CLR Profiler (free) (<http://clrprofiler.codeplex...
[ 0.4258151352405548, -0.052890464663505554, 0.13330893218517303, 0.3550684154033661, 0.2089797407388687, 0.060425132513046265, -0.23926611244678497, 0.016369592398405075, -0.5813245177268982, -0.5125221014022827, 0.06504645198583603, 0.31926429271698, -0.17379896342754364, 0.217768847942352...
I have an HTML table that looks like this: ``` ------------------------------------------------- |Column 1 |Column 2 | ------------------------------------------------- |this is the text in column |this is the column | |one which wraps |two test | ----------------------...
[ -0.10539714992046356, 0.12877272069454193, 0.5457088947296143, -0.16171932220458984, -0.171052947640419, 0.01312253624200821, 0.3191406726837158, -0.16213296353816986, -0.15106941759586334, -0.6186908483505249, 0.0883546769618988, 0.2991005480289459, -0.23474980890750885, 0.007930700667202...
"wrapping" wastes lots of space in my layout. It should like this (without increasing the widths of the columns or the table, because they'll go off the screen/create a horizontal scrollbar otherwise): ``` ------------------------------------------------- |Column 1 |Column 2 | -------------...
[ -0.04307839646935463, 0.17335666716098785, 0.4193459749221802, 0.01002634409815073, -0.1750650703907013, 0.23436316847801208, 0.10084271430969238, 0.11376085877418518, -0.17414043843746185, -0.5507981181144714, -0.01938958838582039, 0.5760320425033569, -0.060477614402770996, 0.137611612677...
found that does this: <http://joomlicious.com/mootable/>, but I can't figure out how they do it. Does anyone know how I can do this with my own table using CSS and/or Javascript, or how Mootables does it? Sample HTML: ``` <html><body> <table width="300px"> <tr> <td>Column 1</td><td>Column 2</td> </tr> <tr> <td...
[ -0.048754166811704636, 0.0578572042286396, 0.20488983392715454, 0.07672764360904694, -0.16481617093086243, -0.08315109461545944, -0.07857247442007065, -0.5153534412384033, 0.07925719767808914, -0.6713491082191467, 0.09556613117456436, 0.49731507897377014, -0.0023007711861282587, -0.2711597...
in most browsers for me... rather than trying to constrain the td, I use a div inside the td that will handle the overflow instance. This has a nice side effect of being able to add your padding, margins, background colors, etc. to your div rather than trying to style the td. ``` <html> <head> <style> .hideextra { whi...
[ 0.355602502822876, -0.28091031312942505, 0.5166682004928589, -0.2503904402256012, -0.39030125737190247, 0.03109511360526085, 0.25114697217941284, -0.4037313461303711, 0.11505769193172455, -0.706922709941864, -0.14971604943275452, 0.28381770849227905, -0.29788458347320557, -0.18438509106636...
style="width:100px"> this is the column two test</div></td> </tr> </table> </body> </html> ``` As a bonus, IE will place an ellipsis in the case of an overflow using the browser-specific text-overflow:ellipsis style. There is a way to [do the same in FireFox](http://www.jide.fr/emulate-text-overflowellipsis-i...
[ 0.12913303077220917, -0.02400861866772175, 0.7522757053375244, 0.2133476734161377, -0.33489757776260376, 0.18342375755310059, 0.037491895258426666, -0.08293508738279343, -0.2267754077911377, -0.6369423866271973, -0.060940951108932495, 0.24469271302223206, -0.19229090213775635, -0.606168508...
Sometimes I create some quick personal projects using [C#](http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29) with [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms) or [WPF](http://en.wikipedia.org/wiki/Windows_Presentation_Foundation). I have noticed that managed applications can take 2x or 3x ...
[ 0.33275043964385986, -0.1195259764790535, 0.3532522916793823, 0.21789909899234772, -0.24313035607337952, -0.22802400588989258, 0.06008213385939598, 0.0012577996822074056, -0.4231913387775421, -0.9834209084510803, 0.01794949546456337, 0.25704333186149597, 0.1677848994731903, -0.331018596887...
data to load.
[ 0.04079451039433479, -0.1649409383535385, 0.07891377061605453, 0.3962300717830658, -0.1569746434688568, 0.09850526601076126, -0.2865377366542816, -0.04613200202584267, -0.41014668345451355, -0.3364998996257782, -0.31221631169319153, 0.7176398634910583, -0.25392478704452515, 0.0688781961798...
I'm not familiar with ASP, but am helping someone out with their website as a side project. I am trying to call Apache FOP (a java application) from ASP using VB. I have seen simple examples using the GetObject('java:...') constuct, but I don't know how to pass and retrieve binary data from a java object. Ideally, I w...
[ 0.39928582310676575, 0.16735517978668213, 0.11389778554439545, 0.010422417894005775, -0.08592014759778976, -0.19620607793331146, 0.04782584682106972, 0.08225318789482117, -0.3907355070114136, -0.5193080902099609, -0.03081345185637474, 0.4096366763114929, -0.1533985286951065, 0.035066351294...
so I could do this, but it just doesn't seem efficient. I figured out a workaround. This is for IIS running on a Win 2k3 Server--older versions will be much easier. First I created a subdirectory off the main site (for security purposes) and attached a new application pool to that directory. The new application pool n...
[ 0.13354335725307465, -0.15375180542469025, 0.26387345790863037, -0.22228337824344635, -0.16562336683273315, -0.06189437583088875, 0.2561989426612854, -0.2956200838088989, -0.0735759288072586, -0.8763229846954346, -0.028503647074103355, 0.5079957246780396, -0.48693209886550903, -0.225619524...
Server.MapPath("/tmp/") shell.CurrentDirectory = foppath Dim commandline commandline = "java -Denv.windir=C:\WINDOWS -cp """ 'set classpath commandline = commandline & foppath & "\build\fop.jar;" commandline = commandline & foppath & "\build\fop-sandbox.jar;" commandline = commandline & foppath & "\build\fop-hyph.ja...
[ -0.5066883563995361, -0.03733234480023384, 0.808785617351532, -0.2940111756324768, -0.2403835505247116, 0.31587931513786316, 0.34174445271492004, -0.16524802148342133, -0.2704898715019226, -1.1097946166992188, -0.15161803364753723, 0.34730979800224304, -0.4854475259780884, 0.04536640644073...
& "\lib\fop-hyph.jar;" commandline = commandline & """ org.apache.fop.cli.Main " commandline = commandline & workpath & "/file.fo " commandline = commandline & workpath & "/file.pdf " Dim ResultCode ResultCode = Shell.Run(commandline,,True) ' True = Wait for FOP to finish ``` Afterwards, I make sure I cleanup my tem...
[ 0.5575304627418518, 0.07230907678604126, 0.6964144110679626, -0.19804666936397552, 0.25175172090530396, -0.2778603434562683, 0.6418257355690002, -0.45092231035232544, -0.2690182328224182, -0.31883078813552856, -0.229574516415596, 0.690018892288208, -0.1021396592259407, -0.10658995062112808...
How do you rename a table in [SQLite](http://en.wikipedia.org/wiki/SQLite) 3.0? ``` ALTER TABLE `foo` RENAME TO `bar` ``` [SQLite Query Language: ALTER TABLE](http://www.sqlite.org/lang_altertable.html)
[ 0.16758689284324646, 0.5477805733680725, 0.774573564529419, -0.4296624958515167, 0.0776728093624115, 0.02331549860537052, -0.1687382012605667, -0.45152172446250916, -0.3273751735687256, -0.45121899247169495, -0.234325110912323, 0.2007158100605011, -0.617647111415863, 0.09628812968730927, ...
I created a Winforms AutoComplete combobox control inheriting from ComboBox with the following method: ``` Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs) MyBase.OnKeyPress(e) Dim text As String = Me.Text If Char.IsLetter(e.KeyChar) Then text = ...
[ -0.29349228739738464, -0.19573219120502472, 0.7063660621643066, -0.16096623241901398, 0.1804019808769226, -0.08854486793279648, 0.3959795832633972, -0.5288922786712646, 0.26192644238471985, -0.5277183651924133, -0.19133934378623962, 0.6991763710975647, -0.40963950753211975, 0.1324910521507...
SetAutoCompleteMethod.Invoke(text) Me.AutoCompleteSource = AutoCompleteSource.ListItems Me.Text = text Me.SelectionStart = text.Length Me.SelectionLength = 0 If Me.Items.Count > 0 Then Me.SelectedIndex = 0
[ 0.04310326278209686, -0.4058329463005066, 0.28387168049812317, 0.08561509102582932, -0.14874061942100525, 0.07820344716310501, 0.028520390391349792, -0.5026792287826538, -0.34763917326927185, -0.6403935551643372, -0.4145941436290741, 0.3166593015193939, -0.3088824152946472, 0.0623494870960...
End If e.Handled = True End If End Sub ``` The "SetAutoCompleteMethod" is a delegate pointing to a method that populates the combobox items based on using the current text in the combo box as the prefix for a wildcard search. This provides similar functionality to the ajax autocomplete combobo...
[ 0.2743547558784485, -0.3888809382915497, 0.39359408617019653, 0.3750835955142975, 0.002974878763779998, -0.41969722509384155, 0.024132249876856804, -0.39795246720314026, 0.007764716632664204, -0.4552900195121765, -0.37500831484794617, 0.26766183972358704, -0.08476944267749786, 0.0415042638...
indication that other memory has been corrupted" error. The error appears after all the code to update the combobox is completed. I get the following stack trace: > at > System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& > msg) at > System.Windows.Forms.Application.ComponentManager.System.Windows.Forms....
[ -0.26392030715942383, 0.06608007848262787, 0.69086092710495, -0.08878686279058456, 0.2444656640291214, 0.28166648745536804, 0.5796200037002563, -0.693874716758728, -0.19816677272319794, -0.715110719203949, -0.24325917661190033, 0.6381735801696777, -0.19984278082847595, 0.12851957976818085,...
args) at > System.AppDomain.ExecuteAssembly(String > assemblyFile, Evidence > assemblySecurity, String[] args) at > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at > System.Threading.ThreadHelper.ThreadStart\_Context(Object > state) at > System.Threading.ExecutionContext.Run(ExecutionCont...
[ -0.028540221974253654, 0.10012225061655045, 0.40527859330177307, -0.03283699229359627, 0.0026647092308849096, 0.13963571190834045, 0.40908536314964294, -0.1928774118423462, -0.6299030780792236, -0.6969922184944153, 0.3448823094367981, 0.38452354073524475, -0.3544859290122986, 0.15291064977...
died in a native call somewhere. If that's the case, you might be running into the same issue in which case I'd recommend you double check those pointers, not just where it crashes, but a couple levels up too.
[ 0.3725261092185974, 0.17453724145889282, -0.24805790185928345, 0.29054346680641174, 0.13019321858882904, 0.09963107854127884, 0.1587752252817154, 0.6180955767631531, -0.21396034955978394, -0.6193803548812866, 0.42331069707870483, 0.3666520118713379, -0.005930595099925995, 0.217885851860046...
I'm trying to unit test some code that looks like this: ``` def main(): parser = optparse.OptionParser(description='This tool is cool', prog='cool-tool') parser.add_option('--foo', action='store', help='The foo option is self-explanatory') options, arguments = parser.parse_args() if not options.foo: ...
[ 0.3084590435028076, 0.19438770413398743, 0.1864960789680481, -0.41609448194503784, 0.17545069754123688, 0.10602787137031555, 0.4074578583240509, -0.09458714723587036, -0.04220474511384964, -0.6227132678031921, -0.20018556714057922, 0.7244040966033936, -0.3970477879047394, -0.17153900861740...
optionparser_mock = Mock() mock_optionparser.return_value = optionparser_mock options_stub = Mock() options_stub.foo = None optionparser_mock.parse_args.return_value = (options_stub, sentinel.arguments) def parser_error_mock(message): self.assertEquals(message, '--foo option is required') ...
[ -0.028128739446401596, 0.262297123670578, 0.2954694628715515, -0.30357834696769714, -0.03790685534477234, 0.6512134671211243, 0.6049904227256775, -0.512337863445282, -0.011699771508574486, -0.4926578998565674, -0.2503453195095062, 0.6151808500289917, -0.3202831745147705, -0.248249441385269...
in parser_error_mock sys.exit(2) SystemExit: 2 ---------------------------------------------------------------------- Ran 1 test in 0.012s FAILED (errors=1) ``` The problem is that OptionParser.error does a sys.exit(2), and so main() naturally relies on that. But nose or unittest detects the (expected) sys.exit...
[ -0.3244701325893402, 0.2571682631969452, 0.30204617977142334, -0.36626455187797546, 0.08810253441333771, 0.023917119950056076, 0.6881318092346191, -0.36041828989982605, 0.1258540153503418, -0.5737593770027161, -0.40621140599250793, 0.7125915288925171, -0.30752336978912354, -0.1687781959772...
in the sys.exit() in parser\_error\_mock(). Is there any way to test for the exit code? BTW, the test is more robust if I add: ``` self.assertEquals(optionparser_mock.method_calls, [('add_option', ('--foo',), {'action': 'store', 'help': 'The foo option is self-explanatory'}), ('parse_args', (), {})]) ``` at the end...
[ -0.4447312355041504, 0.17720922827720642, 0.31620052456855774, -0.30093351006507874, 0.09943850338459015, 0.3311406373977661, 0.536807119846344, -0.44049665331840515, 0.10331160575151443, -0.5058826804161072, -0.27344921231269836, 0.6586546897888184, -0.09102991223335266, -0.18591423332691...
up with a few longer snippet to test for the exit code. [Note: I accepted my own answer, but I will delete this answer and accept [dF](https://stackoverflow.com/users/3002/df)'s if he updates his.]
[ 0.33506739139556885, 0.10971537232398987, 0.5574584603309631, 0.32155701518058777, 0.2813592553138733, -0.1481536477804184, 0.25985440611839294, -0.39519548416137695, -0.4634789228439331, -0.42434170842170715, -0.23915742337703705, 0.3271671235561371, -0.264823853969574, 0.0601870566606521...
My problem is that I have a user that is having a problem displaying a portion of website I am creating, but I am unable to reproduce it on any of my browsers, even with the same version of the browser. What I'm looking for is probably a website that I can send the user to which will tell me what version of the browse...
[ 0.623297929763794, 0.43400856852531433, 0.0579286627471447, 0.06986746191978455, -0.3153631091117859, -0.21628649532794952, 0.23315086960792542, 0.5709260106086731, -0.48366525769233704, -0.7172608971595764, 0.045848000794649124, 0.4442506432533264, -0.2594972252845764, 0.25806093215942383...
image around all the text inputs, but on the users computer the text input displays partially outside of the image which is setup as a background. I need more user specific information than Google Analytics as you can't separate out a specific user. I also suspect that it's more complicated than just the user agent. ...
[ 0.6693814992904663, 0.04599754512310028, 0.3876907229423523, -0.0023381130304187536, -0.3803647756576538, -0.179975226521492, 0.2829820513725281, 0.10394306480884552, -0.2907145917415619, -0.4774744510650635, 0.06782564520835876, 0.4706709384918213, -0.2957306504249573, -0.1231171116232872...
you to test you design in **a lot** of different browsers very easily. EDIT: ... unfortunately restricted to the initial design on page load, since it simply takes a screenshot for you.
[ 0.4991280436515808, 0.10893159359693527, 0.08689569681882858, 0.3070559799671173, -0.17635266482830048, -0.29874327778816223, 0.34421756863594055, -0.026256274431943893, 0.013036652468144894, -0.9412232637405396, 0.18153049051761627, 0.39770472049713135, 0.06056218594312668, 0.091341204941...
This question doesn't relate only to MouseEvent.CLICK event type but to all event types that already exist in AS3. I read a lot about custom events but until now I couldn't figure it out how to do what I want to do. I'm going to try to explain, I hope you understand: Here is a illustration of my situation: ``` for(va...
[ 0.048169273883104324, -0.1486886739730835, 0.35269543528556824, -0.2041865587234497, -0.0025981792714446783, 0.0724310502409935, 0.2472192496061325, -0.5485363006591797, -0.17037667334079742, -0.6858489513397217, 0.15755537152290344, 0.6146392822265625, -0.22161424160003662, -0.02114590816...
10; i++){ var someVar = i; myClips[i].addEventListener(MouseEvent.CLICK, function(){ doSomething(someVar); }); } function doSomething(index){ trace(index); } ``` This kind of works but not as I expect. Due to the function closures, when the MouseEvent.CLICK events are actually fired the *for* lo...
[ 0.3476996123790741, -0.14395181834697723, 0.7084737420082092, -0.36913904547691345, 0.2523804306983948, 0.020079290494322777, 0.18275058269500732, -0.25261154770851135, -0.21688193082809448, -0.4322236478328705, 0.07958989590406418, 0.8980742692947388, -0.3296007812023163, 0.15753863751888...
couldn't find a way to fire a custom event when the MouseEvent.CLICK event is fired and pass the parameter to it. Now I don't know if it is the right answer. What should I do and how? Without knowing more about your application, it seems more like you should use the target to pass parameters, or extend MouseEvent. The...
[ 0.14636676013469696, -0.1266888976097107, 0.4490130841732025, 0.07832232862710953, 0.14461584389209747, -0.1073869913816452, 0.07925200462341309, -0.21119828522205353, -0.18814942240715027, -0.49258512258529663, 0.10314222425222397, 0.6462321877479553, -0.35065022110939026, 0.1650288552045...
i:int = 0; i < 10; i++) { myClips[i].myPublicProperty = i; myClips[i].addEventListener(MouseEvent.CLICK, doSomething); } ``` ... and then, in your event listener, you could retrieve that property using either the target or currentTarget property of the event (probably currentTarget, in your case): ``` function...
[ -0.2193026840686798, -0.15989349782466888, 0.6516262888908386, -0.3731866180896759, 0.40756550431251526, -0.07446464896202087, 0.5742720365524292, -0.27167579531669617, 0.01991197280585766, -0.7302552461624146, -0.10400251299142838, 0.7581561207771301, 0.04814210906624794, -0.0078429915010...
I've been a software developer for over twenty years, programming in C, Perl, SQL, Java, PHP, JavaScript, and recently Python. I've never had a problem I could not debug using some careful thought, and well-placed debugging `print` statements. I respect that many people say that my techniques are primitive, and using ...
[ 0.6835848689079285, 0.6886895895004272, -0.5961759686470032, -0.16830582916736603, -0.3161315321922302, -0.03194539621472359, 0.35805636644363403, 0.043424978852272034, 0.12309573590755463, -0.36830365657806396, 0.06538983434438705, 0.5256152749061584, 0.014970999211072922, 0.0045556579716...
using visual debuggers. Moreover, I have never read a tutorial or book that showed how to debug effectively using an IDE, beyond the basics of how to set breakpoints and display the contents of variables. What am I missing? What makes IDE debugging tools so much more effective than thoughtful use of diagnostic `print...
[ 0.606268584728241, 0.18775369226932526, -0.2154935747385025, 0.4371011257171631, -0.4666782319545746, 0.02367263287305832, 0.4917508065700531, -0.19409175217151642, -0.013621174730360508, -0.627414882183075, -0.018737005069851875, 0.6788598895072937, -0.008999207988381386, -0.2680808901786...
variables, code, or any other aspect of the runtime environment, whereas manual debugging requires me to stop, edit, and re-execute the application (possibly requiring recompilation). * Debuggers can attach to a running process or use a crash dump, whereas with manual debugging, "steps to reproduce" a defect are necess...
[ 0.2782716453075409, 0.12849831581115723, -0.08072305470705032, 0.2342381477355957, -0.3287360668182373, -0.12371762096881866, 0.48179396986961365, 0.12883822619915009, -0.06222217530012131, -0.792505145072937, -0.4869246780872345, 0.6996415257453918, -0.22237536311149597, 0.143012523651123...
debugger integrated into an IDE also gives you convenient access to smart editing and all the other features of the IDE, in a single integrated development environment (hence the name). Some examples of some abilities that an IDE debugger will give you over trace messages in code: * View the **call stack** at any poin...
[ 0.3829391598701477, -0.11494078487157822, -0.07235883921384811, 0.15897728502750397, 0.036716945469379425, -0.5411219596862793, 0.2522823214530945, -0.46198156476020813, -0.13646440207958221, -0.7072502970695496, -0.25060316920280457, 0.5079373121261597, -0.25391700863838196, -0.1963120251...
the ability to **change code while it is running** and immediately see the results of the change * Be able to **watch** variables, seeing when they change * Be able to **skip or repeat sections of code**, to see how the code will perform. This allows you to test out theoretical changes before making them. * Examine **m...
[ 0.23207944631576538, -0.39573290944099426, 0.2909048795700073, 0.313158243894577, 0.17356079816818237, -0.14312663674354553, 0.40841835737228394, -0.13061241805553436, -0.6124382019042969, -0.6078969836235046, -0.281780481338501, 0.6023678183555603, -0.07635550200939178, -0.319888383150100...
be difficult to achieve with tracing (as the traces from different threads will be interleaved in the output). In summary, print statements are (generally) *static* and you'll need to re-compile to get additional information if your original statements weren't detailed enough. The IDE removes this static barrier, givi...
[ 0.7341260313987732, -0.060344014316797256, -0.09735168516635895, 0.23958033323287964, -0.25201520323753357, -0.4076307713985443, 0.22139312326908112, 0.04251810163259506, -0.14043301343917847, -0.6406369209289551, -0.004555090796202421, 0.4934883415699005, -0.46734723448753357, -0.14202621...
want to go back to print statements.
[ 0.5549392104148865, 0.3872319161891937, -0.0996701791882515, 0.05515802651643753, -0.06575674563646317, -0.3474009037017822, 0.10282573848962784, 0.3078470230102539, -0.0832769125699997, -0.3747688829898834, 0.12279809266328812, 0.42257195711135864, -0.10302376747131348, -0.013354950584471...
I've become interested in algorithms lately, and the fibonacci sequence grabbed my attention due to its simplicity. I've managed to put something together in javascript that calculates the nth term in the fibonacci sequence in less than 15 milliseconds after reading lots of information on the web. It goes up to 1476.....
[ 0.383240669965744, -0.0699232667684555, 0.23377415537834167, -0.19860734045505524, -0.16886985301971436, 0.28684741258621216, -0.13916681706905365, -0.21830473840236664, -0.568830668926239, -0.4503304362297058, 0.23755887150764465, 0.18115685880184174, -0.12159246951341629, 0.3265863955020...
by Salty m = [[1,0],[0,1]]; odd = [[1,1],[1,0]]; function matrix(a,b) { /* Matrix multiplication Strassen Algorithm Only works with 2x2 matrices. */ c=[[0,0],[0,0]]; c[0][0]=(a[0][0]*b[0][0])+(a[0][1]*b[1][0]); c[0][1]=(a[0][0]*b[0][1])+(a[0][1]*b[1][1]); c[1][0]=(a[1][0...
[ -0.3513813018798828, 0.07976751774549484, 0.9146179556846619, -0.4534185826778412, 0.16870038211345673, 0.3912392556667328, 0.5469558835029602, -0.49621695280075073, -0.042817842215299606, -0.2376074194908142, -0.3955414295196533, 0.886086106300354, -0.24238531291484833, -0.214623644948005...
c[0][1]=m3+m5; c[1][0]=m2+m4; c[1][1]=m1-m2+m3+m6; return c; } function fib(n) { mat(n-1); return m[0][0]; } function mat(n) { if(n > 1) { mat(n/2); m = matrix(m,m); } m = (n%2<1) ? m : matrix(m,odd); } alert(fib(1476)); //Alerts 1.3069892237633993e+308 ``` The matrix f...
[ -0.17493785917758942, -0.09771469980478287, 0.6264361143112183, -0.32943156361579895, 0.1379794478416443, 0.2726617753505707, 0.34847497940063477, -0.5242478251457214, -0.31643810868263245, -0.35908666253089905, -0.36212193965911865, 0.8266298770904541, -0.3120088279247284, 0.0811786875128...
the Strassen algorithm into JS array notation and it worked on my first try! Fantastic, right? :P Thanks in advance if you manage to find an easier way to do this. Don't speculate, benchmark: **edit:** I added my own matrix implementation using the optimized multiplication functions mentioned in my other answer. This...
[ 0.03278232738375664, -0.042543794959783554, 0.6195366382598877, 0.020211774855852127, -0.21227708458900452, 0.20427492260932922, 0.21348711848258972, -0.30737558007240295, -0.2273218333721161, -0.6380192041397095, -0.036773718893527985, 0.4490649998188019, -0.3881552815437317, -0.203919827...
2; fib.round = function(n) { return Math.floor(Math.pow(phi, n) / sqrt_5 + 0.5); }; })(); (function() { fib.loop = function(n) { var i = 0, j = 1; while(n--) { var tmp = i; i = j;
[ 0.03562505915760994, -0.27252545952796936, 0.5865419507026672, -0.4227905869483948, 0.13298682868480682, 0.019339438527822495, 0.4462391138076782, -0.6919512748718262, -0.37692782282829285, -0.10253456979990005, -0.2821940779685974, 0.33979806303977966, -0.3947042226791382, 0.0960418134927...
j += tmp; } return i; }; })(); (function () { var cache = [0, 1]; fib.loop_cached = function(n) { if(n >= cache.length) { for(var i = cache.length; i <= n; ++i) cache[i] = cache[i - 1] +
[ 0.14985884726047516, -0.22354207932949066, 0.5134192109107971, -0.48684608936309814, 0.2797929644584656, 0.343151718378067, 0.741529643535614, -0.5943149328231812, -0.08284264802932739, -0.39475664496421814, -0.27486512064933777, 0.3857366144657135, -0.41882941126823425, 0.0416573360562324...
cache[i - 2]; } return cache[n]; }; })(); (function() { //Fibonacci sequence generator in JS //Cobbled together by Salty var m; var odd = [[1,1],[1,0]]; function matrix(a,b) { /* Matrix multiplication Strassen Algorithm
[ 0.009135829284787178, -0.08827909082174301, 0.39479464292526245, -0.17672280967235565, 0.4265466630458832, 0.4076533317565918, 0.419765830039978, -0.3391762673854828, -0.21388311684131622, -0.38279253244400024, -0.11494693905115128, 0.473995566368103, -0.43858954310417175, 0.09825518727302...
Only works with 2x2 matrices. */ var c=[[0,0],[0,0]]; var m1=(a[0][0]+a[1][1])*(b[0][0]+b[1][1]); var m2=(a[1][0]+a[1][1])*b[0][0]; var m3=a[0][0]*(b[0][1]-b[1][1]); var m4=a[1][1]*(b[1][0]-b[0][0]); var m5=(a[0][0]+a[0][1])*b[1][1]; var m6=(a[1][0]-a[0][0...
[ -0.3510659635066986, -0.04442097246646881, 0.550018846988678, -0.6213027238845825, -0.14634236693382263, 0.3307194411754608, 0.4082174599170685, -0.764592707157135, -0.37494996190071106, -0.1503457874059677, -0.6179319620132446, 0.6274343132972717, -0.38587161898612976, -0.3288912475109100...
c[0][1]=m3+m5; c[1][0]=m2+m4; c[1][1]=m1-m2+m3+m6; return c; } function mat(n) { if(n > 1) { mat(n/2); m = matrix(m,m); } m = (n%2<1) ? m : matrix(m,odd);
[ -0.4399584233760834, -0.2631426453590393, 0.30760833621025085, -0.46823471784591675, 0.07738229632377625, 0.4106121063232422, 0.23479443788528442, -0.6240465044975281, -0.3013063669204712, -0.3058452904224396, -0.6489391326904297, 0.777065098285675, -0.2675402760505676, 0.12114453315734863...
} fib.matrix = function(n) { m = [[1,0],[0,1]]; mat(n-1); return m[0][0]; }; })(); (function() { var a; function square() { var a00 = a[0][0], a01 = a[0][1], a10 = a[1][0],
[ 0.010516354814171791, -0.5696470141410828, 0.5648558735847473, -0.5722387433052063, 0.1681339591741562, 0.3510749042034149, 0.09545618295669556, -0.7920328974723816, -0.143355131149292, -0.3018662631511688, -0.25310343503952026, 0.6212548613548279, -0.43105024099349976, -0.0670136734843254...
a11 = a[1][1]; var a10_x_a01 = a10 * a01, a00_p_a11 = a00 + a11; a[0][0] = a10_x_a01 + a00 * a00; a[0][1] = a00_p_a11 * a01; a[1][0] = a00_p_a11 * a10; a[1][1] = a10_x_a01 + a11 * a11; } function powPlusPlus() {
[ 0.08529669046401978, 0.04792836308479309, 0.10230400413274765, -0.2620604634284973, 0.2369387447834015, 0.7589296102523804, 0.29287829995155334, -0.37001559138298035, -0.2964659035205841, -0.15330521762371063, -0.41545432806015015, 0.36939167976379395, -0.5233814716339111, -0.3270196020603...
var a01 = a[0][1], a11 = a[1][1]; a[0][1] = a[0][0]; a[1][1] = a[1][0]; a[0][0] += a01; a[1][0] += a11; } function compute(n) { if(n > 1) { compute(n >> 1);
[ -0.23523510992527008, -0.185989111661911, -0.08127512037754059, -0.5218418836593628, -0.13749131560325623, 0.48409608006477356, 0.46765372157096863, -0.4913497865200043, -0.24116666615009308, 0.129606232047081, -0.28468000888824463, 0.364758163690567, -0.4296100437641144, -0.12361475825309...
square(); if(n & 1) powPlusPlus(); } } fib.matrix_optimised = function(n) { if(n == 0) return 0; a = [[1, 1], [1, 0]];
[ 0.0681505799293518, -0.4917040467262268, 0.5132739543914795, -0.602247416973114, 0.1600697934627533, 0.18934030830860138, 0.051910337060689926, -0.86863774061203, -0.00011725843069143593, -0.2100558578968048, -0.37782925367355347, 0.569895327091217, -0.4372006058692932, -0.1461094319820404...
compute(n - 1); return a[0][0]; }; })(); (function() { var cache = {}; cache[0] = [[1, 0], [0, 1]]; cache[1] = [[1, 1], [1, 0]]; function mult(a, b) { return [ [a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1]],
[ -0.24625959992408752, -0.1263510137796402, 0.2108178436756134, -0.3847866356372833, 0.1139291450381279, 0.4218897521495819, 0.6973522305488586, -0.4999922215938568, -0.1604447215795517, -0.2710123062133789, -0.3066149055957794, 0.5981619954109192, -0.3044790029525757, 0.15841467678546906, ...
[a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]] ]; } function compute(n) { if(!cache[n]) { var n_2 = n >> 1; compute(n_2);
[ -0.10902059078216553, 0.05011316016316414, -0.11064904183149338, -0.45126935839653015, 0.27390018105506897, 0.25593361258506775, 0.636539101600647, -0.5139898061752319, -0.00828496739268303, -0.19021499156951904, -0.29175153374671936, 0.525816023349762, -0.490887314081192, 0.19228994846343...