text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
randomly explore the site and see questions I think are interesting, I inevitably find "oh yes, that one looked interesting a couple days ago when I read it the first time, and hasn't been updated since". It would be much nicer if my machine would keep track of such deails for me :) --- **Update:** You can now use "and", "or", and "not" to combine multiple tags into a single feed: [Tags AND Tags OR Tags](https://blog.stackoverflow.com/2008/10/tags-and-tags-or-tags/) --- **Update:** You can now use [Filters](https://stackexchange.com/filters) to watch tags across one or multiple sites: [Improved Tag Stes](https://blog.stackoverflow.com/2011/04/improved-tag-sets/) Have you heard of **[Yahoo's Pipes](http://pipes.yahoo.com/pipes/)**. > Its an interactive feed
[ 0.5900644063949585, -0.5084460377693176, 0.358734667301178, 0.08885835856199265, -0.19873365759849548, -0.330147385597229, -0.021543722599744797, -0.2864310145378113, -0.5638999342918396, -0.6401597857475281, -0.018190177157521248, 0.3610284924507141, -0.5467941761016846, -0.24020932614803...
aggregator and > manipulator. List of 'hot pipes' to > subscribe to, and ability to create > your own (yahoo account required). I played with it during beta back in the day, however I had a blast. Its really fun and easy to aggregate different feeds and you can add logic or filters to the "pipes". You can even do more then just RSS like import images from flickr.
[ 0.7922706604003906, -0.4293062388896942, 0.12006648629903793, 0.39554595947265625, -0.43829527497291565, -0.22876130044460297, -0.19254709780216217, 0.142253577709198, 0.07285059243440628, -0.6155284643173218, 0.329674631357193, 0.623616099357605, -0.22972123324871063, 0.06555112451314926,...
What kinds of considerations are there for migrating an application from **NHibernate** 1.2 to 2.0? What are breaking changes vs. recommended changes? Are there mapping issues? [Breaking changes in NHibernate 2.0](http://forum.hibernate.org/viewtopic.php?t=985289) **If you have good test coverage it's busywork.** Edit: We upgraded this morning. There is nothing major. You have to Flush() the session after you delete. The Expression namespace got renamed to Criterion. All these are covered in the link above. Mappings need no change. It's quite transparent. Oh, and transactions *everywhere*, but you were probably doing that already. By the way, here's an interesting look at the changes: <http://codebetter.com/blogs/patricksmacchia/archive/2008/08/26/nhibernate-2-0-changes-overview.aspx>
[ -0.16395814716815948, -0.10762044042348862, 0.31097301840782166, -0.07943261414766312, -0.41206005215644836, -0.06689874827861786, 0.38596969842910767, -0.23972053825855255, -0.24509882926940918, -0.6260079145431519, -0.19469529390335083, 0.5709851384162903, -0.17430606484413147, 0.0622429...
I am looking for a (preferably) command-line tool that can reformat the C# source code on a directory tree. Ideally, I should be able to customize the formatting. Bonus points if the tool can be run on [Mono](https://en.wikipedia.org/wiki/Mono_%28software%29) (or Linux). You could also try [NArrange](http://www.narrange.net) to reformat your code. The formatting options it supports are still pretty limited, but it can process an entire directory and is a command-line tool. Also, NArrange runs under Mono.
[ 0.3157857656478882, 0.00551058491691947, -0.24648252129554749, -0.036937400698661804, -0.2796015441417694, -0.2380247861146927, 0.34315720200538635, 0.024533675983548164, -0.22509603202342987, -0.571648895740509, 0.040882110595703125, 0.7062184810638428, -0.19260048866271973, 0.34545624256...
Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's possible to do it through code? ``` <Image Height="60" HorizontalAlignment="Right" Margin="0,122,11,0" VerticalAlignment="Top" Width="60" Source="Images/Fish128x128.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" x:Name="fishImage"> <Image.RenderTransform> <TransformGroup>
[ 0.445987343788147, -0.21051692962646484, 0.7106330394744873, -0.18032272160053253, -0.10322856158018112, 0.08981974422931671, -0.008882623165845871, -0.38163211941719055, 0.023921921849250793, -0.9018616676330566, 0.13639312982559204, 0.549930214881897, 0.04711275175213814, -0.090921081602...
<ScaleTransform ScaleX="1" ScaleY="1"/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Image.RenderTransform> </Image> ``` I want to bind the ScaleX and ScaleY of the ScaleTransform element. I'm getting a runtime error when I try to bind against a double property on my data context: ``` Message="AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 1570 Position: 108]" ``` My binding looks like this: ``` <ScaleTransform ScaleX="{Binding Path=SelectedDive.Visibility}"
[ -0.15786060690879822, -0.2191721796989441, 0.8873332142829895, -0.28444841504096985, -0.3564944863319397, 0.36657610535621643, 0.24390347301959991, -0.682583212852478, 0.13336290419101715, -1.0677971839904785, -0.026330167427659035, 0.31853485107421875, -0.4088667631149292, 0.1697639822959...
ScaleY="{Binding Path=SelectedDive.Visibility}"/> ``` I have triple verified that the binding path is correct - I'm binding a slidebar against the same value and that works just fine... Visibility is of type double and is a number between 0.0 and 30.0. I have a value converter that scales that number down to 0.5 and 1 - I want to scale the size of the fish depending on the clarity of the water. So I don't think it's a problem with the type I'm binding against... ScaleTransform doesn't have a data context
[ 0.25845399498939514, -0.24158228933811188, 0.7306858897209167, -0.042742498219013214, -0.2528459429740906, 0.22575105726718903, 0.15534432232379913, -0.6152487993240356, -0.18529723584651947, -0.9777495265007019, 0.6530176997184753, 0.3145740032196045, -0.25144830346107483, 0.1976681053638...
so most likely the binding is looking for SelectedDive.Visibility off it's self and not finding it. There is much in Silverlight xaml and databinding that is different from WPF... Anyway to solve this you will want to set up the binding in code\*\*, or manually listen for the PropertyChanged event of your data object and set the Scale in code behind. I would choose the latter if you wanted to do an animation/storyboard for the scale change. \*\* i need to check but you may not be able to bind to it. as i recall if the RenderTransform is not part of
[ 0.47412291169166565, -0.011862174607813358, 0.45918649435043335, 0.11120115220546722, -0.47801095247268677, -0.35967931151390076, 0.006384323816746473, -0.46721673011779785, -0.04354726895689964, -0.7558580040931702, 0.25476744771003723, 0.31122520565986633, -0.38152840733528137, 0.3590179...
an animation it gets turned into a matrix transform and all bets are off.
[ 0.2944926917552948, -0.11609654873609543, 0.35143887996673584, 0.3203900158405304, -0.013887499459087849, -0.2128104418516159, 0.23834413290023804, 0.1880430281162262, -0.14585134387016296, -0.6598290801048279, -0.11609341949224472, 0.3463837504386902, 0.023482339456677437, 0.1918307542800...
I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php\_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the `php_gd2` entry in the extensions menu to activate it. How is it done when using MAMP? I know that I can do it using MacPorts but I'd prefer not to make any changes to my default OS X PHP installation. You shouldn't need to install the extension. I have 1.7.2 installed and running right now and it has GD bundled (2.0.34 compatible). From the MAMP start page, click on phpinfo and
[ 0.29838886857032776, 0.3145548403263092, 0.6598175764083862, -0.16569270193576813, -0.00368869723752141, -0.08669619262218475, 0.4125629961490631, 0.05733692646026611, -0.2713686525821686, -0.7130849361419678, 0.011621362529695034, 0.7473164200782776, -0.33727848529815674, 0.09878388792276...
you should see a GD section.
[ 0.3490128517150879, 0.006868545897305012, -0.21319875121116638, 0.04615909978747368, 0.08431969583034515, -0.526042103767395, 0.10234125703573227, 0.6008327603340149, -0.3594517409801483, -0.34668147563934326, 0.18301436305046082, 0.19304151833057404, 0.10315593332052231, 0.042040795087814...
I want to setup a cron job to rsync a remote system to a backup partition, something like: ``` bash -c 'rsync -avz --delete --exclude=proc --exclude=sys root@remote1:/ /mnt/remote1/' ``` I would like to be able to "set it and forget it" but what if `/mnt/remote1` becomes unmounted? (After a reboot or something) I'd like to error out if `/mnt/remote1` isn't mounted, rather than filling up the local filesystem. **Edit:** Here is what I came up with for a script, cleanup improvements appreciated (especially for the empty then ... else, I couldn't leave them empty or bash errors) ``` #!/bin/bash DATA=data ERROR="0" if cut -d' ' -f2 /proc/mounts | grep
[ 0.21155640482902527, 0.17987973988056183, 0.30048543214797974, 0.08175485581159592, 0.20588228106498718, -0.07021792978048325, 0.16407176852226257, -0.24768120050430298, -0.4238351881504059, -0.6334794163703918, -0.033869292587041855, 0.8420113921165466, -0.3206035792827606, 0.056683924049...
-q "^/mnt/$1\$"; then ERROR=0 else if mount /dev/vg/$1 /mnt/$1; then ERROR=0 else ERROR=$? echo "Can't backup $1, /mnt/$1 could not be mounted: $ERROR" fi fi if [ "$ERROR" = "0" ]; then if cut -d' ' -f2 /proc/mounts | grep -q "^/mnt/$1/$DATA\$"; then ERROR=0 else if mount /dev/vg/$1$DATA /mnt/$1/data; then
[ 0.21367888152599335, -0.18444371223449707, 0.45998501777648926, -0.17933914065361023, -0.036970362067222595, 0.32912102341651917, 0.34596362709999084, -0.8099989295005798, -0.08398384600877762, -0.05806589871644974, -0.41634583473205566, 0.7463856339454651, -0.40516918897628784, -0.0247019...
ERROR=0 else ERROR=$? echo "Can't backup $1, /mnt/$1/data could not be mounted." fi fi fi if [ "$ERROR" = "0" ]; then rsync -aqz --delete --numeric-ids --exclude=proc --exclude=sys \ root@$1.domain:/ /mnt/$1/ RETVAL=$? echo "Backup of $1
[ 0.33599576354026794, -0.16837607324123383, 0.4913265109062195, -0.15131084620952606, 0.35537058115005493, -0.09662320464849472, 0.6446930170059204, -0.6798868179321289, -0.3061123192310333, 0.015332363545894623, -0.32639530301094055, 0.529041588306427, -0.6303006410598755, 0.08508739620447...
completed, return value of rsync: $RETVAL" fi ``` ``` if cut -d' ' -f2 /proc/mounts | grep '^/mnt/remote1$' >/dev/null; then rsync -avz ... fi ``` Get the list of mounted partitions from `/proc/mounts`, only match `/mnt/remote1` (and if it is mounted, send grep's output to `/dev/null`), then run your `rsync` job. Recent `grep`s have a `-q` option that you can use instead of sending the output to `/dev/null`.
[ 0.1718173772096634, -0.015361839905381203, 0.9718220233917236, 0.00404558889567852, 0.09964828193187714, 0.06261745095252991, 0.015430801548063755, -0.4479120373725891, -0.5674735903739929, -0.4978577494621277, -0.612203061580658, 0.7431710362434387, -0.06445532292127609, 0.179135710000991...
I'm attempting to use Mono to load a bitmap and print it on Linux but I'm getting an exception. Does Mono support printing on Linux? The code/exception are below: **EDIT:** No longer getting the exception, but I'm still curious what kind of support there is. Leaving the code for posterity or something. ``` private void btnPrintTest_Click(object sender, EventArgs e) { _printDocTest.DefaultPageSettings.Landscape = true; _printDocTest.DefaultPageSettings.Margins = new Margins(50,50,50,50); _printDocTest.Print(); } void _printDocTest_PrintPage(object sender, PrintPageEventArgs e) { var bmp = new Bitmap("test.bmp"); // Determine center of graph var xCenter = e.MarginBounds.X + (e.MarginBounds.Width - bmp.Width) / 2;
[ 0.48389932513237, 0.006596690975129604, 0.41089603304862976, -0.08528897166252136, -0.16734658181667328, -0.06584758311510086, 0.4005487561225891, -0.41410234570503235, -0.32705727219581604, -0.5218110680580139, -0.02319985441863537, 0.48702508211135864, -0.5979316234588623, 0.199227869510...
var yCenter = e.MarginBounds.Y + (e.MarginBounds.Height - bmp.Height) / 2; e.Graphics.DrawImage(bmp, xCenter, yCenter); e.HasMorePages = false; } ``` From the [Mono docs](http://www.mono-project.com/FAQ:_General), I think yes: > Managed.Windows.Forms (aka > System.Windows.Forms): A complete and > cross platform, System.Drawing based > Winforms implementation. It also useful if you run the [Mono Migration Analyzer](http://www.mono-project.com/Moma) first.
[ 0.3271825313568115, -0.05892806872725487, 0.33018553256988525, -0.02784506231546402, -0.24724040925502777, 0.08733522146940231, 0.18162469565868378, -0.36505019664764404, -0.13012641668319702, -0.571456253528595, -0.2554756700992584, 0.4122791588306427, -0.11750251799821854, 0.224839270114...
I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. Are there any general rules on how to handle pointers in C++? I'm currently not allowed to use boost. I have to stick to pure c++ because the framework I'm using forbids any use of generics. I have worked with the embedded Symbian OS, which had an excellent system in place for this, based entirely on developer conventions. 1. Only one object will ever own a pointer. By default this is the creator. 2.
[ 0.32292884588241577, 0.30277109146118164, 0.20201465487480164, -0.03435209020972252, -0.3292922079563141, -0.3815549910068512, 0.15980446338653564, 0.1323799341917038, -0.37026092410087585, -0.3961625099182129, 0.03420184925198555, 0.5041617751121521, -0.2240387499332428, 0.372494667768478...
Ownership can be passed on. To indicate passing of ownership, the object is passed as a pointer in the method signature (e.g. void Foo(Bar \*zonk);). 3. The owner will decide when to delete the object. 4. To pass an object to a method just for use, the object is passed as a reference in the method signature (e.g. void Foo(Bat &zonk);). 5. Non-owner classes may store references (never pointers) to objects they are given only when they can be certain that the owner will not destroy it during use. Basically, if a class simply uses something, it uses a reference. If a class owns
[ 0.3847026228904724, -0.08558868616819382, 0.2889130115509033, 0.35055795311927795, 0.06489976495504379, -0.30101069808006287, 0.07996739447116852, -0.13293448090553284, -0.2536379098892212, -0.3284919559955597, -0.4147871136665344, 0.27090731263160706, -0.20720410346984863, 0.6233839392662...
something, it uses a pointer. This worked beautifully and was a pleasure to use. Memory issues were very rare.
[ 0.3139982521533966, -0.2610474228858948, 0.09251090884208679, 0.3082692623138428, -0.18240851163864136, -0.1338295340538025, 0.19010517001152039, 0.19811806082725525, -0.21298304200172424, -0.49334678053855896, 0.3904777467250824, 0.2361280471086502, 0.2541660666465759, -0.0727078542113304...
How do I check if an object property in JavaScript is undefined? The usual way to check if the value of a property is the special value `undefined`, is: ```js if(o.myProperty === undefined) { alert("myProperty value is the special value `undefined`"); } ``` To check if an object does not actually have such a property, and will therefore return `undefined` by default when you try to access it: ```js if(!o.hasOwnProperty('myProperty')) { alert("myProperty does not exist"); } ``` To check if the value associated with an identifier is the special value `undefined`, *or* if that identifier has not been declared: ```js if(typeof myVariable === 'undefined') { alert('myVariable is either the special
[ 0.059661462903022766, 0.07465937733650208, 0.20182152092456818, -0.11861619353294373, 0.03340201824903488, -0.38315606117248535, 0.38259589672088623, -0.048695266246795654, -0.22964996099472046, -0.5007175207138062, -0.6397378444671631, 0.5922647714614868, -0.19358840584754944, -0.14836008...
value `undefined`, or it has not been declared'); } ``` Note: this last method is the only way to refer to an **undeclared** identifier without an early error, which is different from having a value of `undefined`. In versions of JavaScript prior to ECMAScript 5, the property named "undefined" on the global object was writeable, and therefore a simple check `foo === undefined` might behave unexpectedly if it had accidentally been redefined. In modern JavaScript, the property is read-only. However, in modern JavaScript, "undefined" is not a keyword, and so variables inside functions can be named "undefined" and shadow the global property. If you are worried
[ -0.20920519530773163, -0.15498977899551392, 0.35933569073677063, -0.3722339868545532, 0.08264978229999542, -0.2949206829071045, 0.21821893751621246, 0.0704902857542038, -0.26180827617645264, -0.19539685547351837, -0.43950924277305603, 0.6221802830696106, -0.4698353409767151, 0.237071767449...
about this (unlikely) edge case, you can use [the void operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) to get at the special `undefined` value itself: ```js if(myVariable === void 0) { alert("myVariable is the special value `undefined`"); } ```
[ 0.02869570069015026, -0.10051558911800385, 0.26697489619255066, -0.18064571917057037, 0.27747321128845215, -0.3103570342063904, 0.32122188806533813, 0.08321911841630936, -0.1250903457403183, -0.45493218302726746, -0.42651134729385376, 0.592238187789917, -0.28423070907592773, 0.098673589527...
Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is [this blog entry](http://jtauber.com/blog/2008/05/18/creating_gradients_programmatically_in_python/), but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, whatever. This will be written in Java, but the display layer is already taken care of, I just need to figure out how to figure out what to display. you want an interpolation between the first and the second colour. Interpolating colours
[ -0.02187279425561428, -0.020075855776667595, 0.14207898080348969, -0.18030132353305817, -0.27177929878234863, 0.2433493584394455, 0.06019270420074463, -0.17103193700313568, -0.10335969924926758, -0.7317852973937988, 0.2548997402191162, 0.1583338975906372, -0.39306962490081787, -0.211052238...
is easy by calculating the same interpolation for each of its components (R, G, B). There are many ways to interpolate. The easiest is to use linear interpolation: just take percentage *p* of the first colour and percentage 1 - *p* of the second: ``` R = firstCol.R * p + secondCol.R * (1 - p) ``` There's [another question](https://stackoverflow.com/questions/25007/conditional-formatting-percentage-to-color-conversion) related to this. There are other methods of interpolation that sometimes work better. For example, using a [bell-shaped (sigmoidal)](http://en.wikipedia.org/wiki/Sigmoid_function) interpolation function makes the transition smoother. /EDIT: Oops, you mean using a predefined function. OK, even easier. The blog post you linked now has an example code
[ 0.3610111474990845, -0.29259124398231506, 0.18194857239723206, -0.12459589540958405, -0.12775501608848572, 0.2849079668521881, -0.1288919299840927, -0.48867353796958923, -0.30347922444343567, -0.6429468989372253, -0.14215674996376038, 0.4880945682525635, -0.13745534420013428, -0.0764361247...
in Python. In Java, you could use the [`GradientPaint`](http://docs.oracle.com/javase/7/docs/api/java/awt/GradientPaint.html).
[ -0.2592836320400238, -0.4599416255950928, 0.10331078618764877, -0.13879244029521942, -0.24904459714889526, 0.36422163248062134, -0.032660532742738724, 0.2780565321445465, 0.10289416462182999, -0.43896883726119995, 0.10158556699752808, 0.2988169193267822, -0.3488716781139374, -0.41461646556...
I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The official PyPy documentation on it just skims over the functionality, rather than providing anything I can try out myself. This document seems to go into quite a bit of detail (and I think a complete description is out of scope for a stackoverflow answer): * <http://codespeak.net/pypy/dist/pypy/doc/translation.html> The general idea of translating from one language
[ 0.3814351558685303, -0.012567120604217052, 0.14010775089263916, 0.1381208449602127, -0.0025925158988684416, 0.045560140162706375, 0.030163807794451714, 0.45180416107177734, -0.11647876352071762, -0.6882316470146179, -0.3961193859577179, 0.3661729693412781, -0.19736424088478088, -0.21291697...
to another isn't particularly revolutionary, but it has only recently been gaining popularity / applicability in "real-world" applications. [GWT](http://code.google.com/webtoolkit/) does this with Java (generating Javascript) and there is a library for translating Haskell into various other languages as well (called [YHC](http://www.haskell.org/haskellwiki/Yhc))
[ 0.36311909556388855, -0.07709167897701263, 0.23551516234874725, 0.13312691450119019, -0.2130797952413559, -0.30886349081993103, 0.009809565730392933, -0.09923486411571503, 0.1149047240614891, -0.18711994588375092, -0.06878364831209183, 0.22940123081207275, -0.3311455547809601, -0.082879893...
The **[TRACE macro](http://msdn.microsoft.com/en-us/library/4wyz8787(VS.80).aspx)** can be used to output diagnostic messages to the debugger when the code is compiled in **Debug** mode. I need the same messages while in **Release** mode. Is there a way to achieve this? (Please do **not** waste your time discussing why I should not be using TRACE in Release mode :-) Actually, the TRACE macro is a lot more flexible than OutputDebugString. It takes a printf() style format string and parameter list whereas OutputDebugString just takes a single string. In order to implement the full TRACE functionality in release mode you need to do something like this: ``` void trace(const
[ 0.36741626262664795, -0.15830038487911224, 0.280292272567749, -0.1487790197134018, 0.2568012773990631, -0.37195083498954773, 0.09614311158657074, -0.08609874546527863, -0.011810281313955784, -0.7658434510231018, 0.03566760569810867, 0.7340020537376404, -0.5547539591789246, -0.1474194228649...
char* format, ...) { char buffer[1000]; va_list argptr; va_start(argptr, format); wvsprintf(buffer, format, argptr); va_end(argptr); OutputDebugString(buffer); } ```
[ -0.17114496231079102, 0.054401785135269165, 0.7175300121307373, -0.43533989787101746, 0.29707273840904236, 0.3470654785633087, 0.43261241912841797, -0.4359781742095947, -0.23008237779140472, -0.6026720404624939, -0.5593140721321106, 0.4761178493499756, -0.2103768140077591, 0.36111378669738...
We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own drawing (all written using MFC). Recently I've been doing more research into Qt and the benefits it provides (cross-platform and supports what you might call a more "professional" looking framework for UI development). My question is - **what would be the best approach to
[ 0.5597261190414429, -0.08468573540449142, 0.490934818983078, 0.012379207648336887, 0.15953977406024933, 0.07107283920049667, 0.04812958836555481, -0.15521535277366638, -0.22203943133354187, -0.7263590693473816, -0.06310594826936722, 0.433506578207016, -0.1839008927345276, -0.20176334679126...
perhaps moving to the Qt framework**? Does Qt play nice with MFC? Would it be better to start porting some of our custom controls to Qt and gradually integrate more and more into our existing MFC apps? (is this possible?). Any advice or previous experience is appreciated. In my company, we are currently using Qt and are very happy with it. I personnally never had to move a MFC-app into using the Qt framework, but here is something which might be of some interest for you : [Qt/MFC Migration Framework](http://www.qtsoftware.com/products/appdev/add-on-products/catalog/3/Windows/qtwinmigrate/) [Qt/MFC Migration Framework](http://doc.qt.nokia.com/solutions/4/qtwinmigrate/index.html) It's part of Qt-Solutions, so this means you'll have to buy a Qt
[ 0.41655582189559937, -0.108368881046772, 0.5537496209144592, 0.10868976265192032, 0.19834214448928833, -0.17709161341190338, 0.2428407073020935, -0.2630924582481384, 0.14365138113498688, -0.6787816882133484, -0.23921993374824524, 0.5366391539573669, -0.31793326139450073, -0.104269877076148...
license along with a Qt-Solutions license. (edit: [not any more](http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt)) I hope this helps !
[ 0.2220098376274109, 0.009825583547353745, 0.573135495185852, 0.27346205711364746, -0.06031816080212593, -0.6844395995140076, 0.33927473425865173, 0.02240944840013981, -0.051245126873254776, -0.57002854347229, -0.25641074776649475, 0.46336138248443604, -0.08494768291711807, -0.2679347991943...
In our project, [SharpWired](http://sharpwired.sourceforge.net/), we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what not. The requirements are that there should be one single list, with one element on each row. Each element must be a custom control. The whole list should be dynamically re-sizable, so that when you make it longer / shorter the list adds a scroll bar when needed and when you make it thinner / wider the custom controls should resize to
[ 0.41654014587402344, -0.25223225355148315, 0.46607089042663574, 0.30460798740386963, -0.08753542602062225, 0.0903610810637474, -0.11455237120389938, -0.06864432990550995, -0.36511605978012085, -0.4807131588459015, 0.1091483011841774, 0.6694893836975098, -0.1058923676609993, 0.1573475599288...
the width of the list. We've tried using a `FlowLayoutPanel` but haven't gotten resizing to work the way we want to. Preferably we should only have to set anchoring of the custom controls to Left & Right. We've also thought about using a `TableLayoutPanel` but found adding rows dynamically to be a too big overhead so far. This must be quite a common use case, and it seems a bit weird to me that the `FlowLayoutPanel` has no intuitive way of doing this. *Has anyone done something similar or have tips or tricks to get us under way?* Cheers! /Adam If you don't
[ 0.3349592983722687, 0.07772200554609299, 0.5306772589683533, 0.15671487152576447, 0.10999240726232529, -0.09885124117136002, -0.026830140501260757, 0.1858454793691635, -0.5079723596572876, -0.6565046310424805, 0.13269776105880737, 0.7304375171661377, 0.22872710227966309, -0.097302041947841...
want to use databinding (via the `DataRepeater` control, as mentioned above), you could use a regular `Panel` control and set its `AutoScroll` property to true (to enable scrollbars). Then, you could manually add your custom controls, and set the `Dock` property of each one to `Top`.
[ 0.21943557262420654, -0.26398539543151855, 0.40157657861709595, 0.33878159523010254, 0.3436916470527649, -0.11819721758365631, 0.1324891299009323, -0.11726367473602295, -0.36733853816986084, -0.4025481343269348, -0.09654859453439713, 0.9688725471496582, -0.10939793288707733, -0.16609191894...
I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. The problem appears when I want to test the log rolling system (which appends .1 to the name of the creates a new one with the same name). On Windows (haven't tested yet on Linux) I can't rename a file that I have opened with std::ifstream() (exclusive access?) even if I open it in "input mode" (ios::in). Is there a cross-platform way to open file in a non-exclusive way? > Is there a way to
[ 0.16109448671340942, 0.13898469507694244, 0.21025118231773376, 0.14636056125164032, 0.11949536949396133, -0.24997545778751373, 0.09794403612613678, 0.08182699978351593, -0.32805535197257996, -0.6014584898948669, -0.10243862122297287, 0.4591746926307678, -0.2658737599849701, 0.4746271371841...
open file in a non-exclusive way, Yes, using Win32, passing the various FILE\_SHARE\_Xxxx flags to CreateFile. > is it cross platform? No, it requires platform-specific code. Due to annoying backwards compatibility concerns (DOS applications, being single-tasking, assume that nothing can delete a file out from under them, i.e. that they can fclose() and then fopen() without anything going amiss; Win16 preserved this assumption to make porting DOS applications easier, Win32 preserved this assumption to make porting Win16 applications easier, and it's awful), Windows defaults to opening files exclusively. The underlying OS infrastructure supports deleting/renaming open files (although I believe it does have the restriction that
[ 0.023263385519385338, 0.2235184609889984, 0.40445664525032043, -0.12291180342435837, -0.1148499995470047, -0.594889760017395, 0.3684097230434418, 0.17849983274936676, -0.4190966486930847, -0.6479046940803528, -0.6246454119682312, 0.4214155972003937, -0.6172243356704712, 0.6101210713386536,...
memory-mapped files cannot be deleted, which I think isn't a restriction found on \*nix), but the default opening semantics do not. C++ has no notion of any of this; the C++ operating environment is much the same as the DOS operating environment--no other applications running concurrently, so no need to control file sharing.
[ -0.029631247743964195, 0.08023635298013687, 0.1615504026412964, 0.1632218211889267, -0.0332275852560997, -0.35325518250465393, 0.09573425352573395, 0.2777571380138397, -0.3497294485569, -0.3016122281551361, -0.4214845597743988, 0.5585967898368835, -0.45703834295272827, 0.37617841362953186,...
My RubyOnRails app is set up with the usual pack of mongrels behind Apache configuration. We've noticed that our Mongrel web server memory usage can grow quite large on certain operations and we'd really like to be able to dynamically do a graceful restart of selected Mongrel processes at any time. However, for reasons I won't go into here it can sometimes be *very* important that we don't interrupt a Mongrel while it is servicing a request, so I assume a simple process kill isn't the answer. Ideally, I want to send the Mongrel a signal that says "finish whatever you're doing
[ 0.5734530687332153, -0.07218588888645172, 0.09274408221244812, 0.27300432324409485, 0.039642151445150375, -0.13488709926605225, 0.6905547380447388, 0.14592233300209045, -0.25402379035949707, -0.27471819519996643, 0.05091473460197449, 0.5975452065467834, -0.27709218859672546, 0.176328122615...
and then quit before accepting any more connections". Is there a standard technique or best practice for this? I've done a little more investigation into the Mongrel source and it turns out that Mongrel installs a signal handler to catch an standard process kill (TERM) and do a graceful shutdown, so I don't need a special procedure after all. You can see this working from the log output you get when killing a Mongrel while it's processing a request. For example: ``` ** TERM signal received. Thu Aug 28 00:52:35 +0000 2008: Reaping 2 threads for slow workers because of 'shutdown' Waiting for 2 requests to finish,
[ 0.3490075469017029, -0.20142363011837006, 0.1786903291940689, 0.009553473442792892, -0.15513218939304352, -0.3760412633419037, 0.5185681581497192, 0.014002056792378426, -0.6533485651016235, -0.30364423990249634, 0.15888306498527527, 0.9216416478157043, -0.5312172174453735, 0.13550998270511...
could take 60 seconds.Thu Aug 28 00:52:41 +0000 2008: Reaping 2 threads for slow workers because of 'shutdown' Waiting for 2 requests to finish, could take 60 seconds.Thu Aug 28 00:52:43 +0000 2008 (13051) Rendering layoutfalsecontent_typetext/htmlactionindex within layouts/application ```
[ -0.34278079867362976, -0.1308683305978775, 0.6662746071815491, -0.17286205291748047, -0.21544143557548523, 0.377998411655426, 0.565841019153595, -0.25642314553260803, -0.18767519295215607, -0.9381240606307983, -0.12482678145170212, 0.22130271792411804, -0.2358136624097824, -0.2603159844875...
I am storing a PNG as an embedded resource in an assembly. From within the same assembly I have some code like this: ``` Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png"); ``` The file, named "file.png" is stored in the "Resources" folder (within Visual Studio), and is marked as an embedded resource. The code fails with an exception saying: > Resource MyNamespace.Resources.file.png cannot be found in class MyNamespace.MyClass I have identical code (in a different assembly, loading a different resource) which works. So I know the technique is sound. My problem is I end up spending a lot of time trying to figure out what the correct
[ 0.2239985316991806, 0.16527000069618225, 0.21087180078029633, -0.24173815548419952, 0.05823560059070587, 0.17052823305130005, 0.20882652699947357, -0.31549522280693054, -0.3131931722164154, -0.9099714756011963, -0.22166737914085388, 0.6832903623580933, -0.2327311635017395, -0.1088307350873...
path is. If I could simply query (eg. in the debugger) the assembly to find the correct path, that would save me a load of headaches. This will get you a string array of all the resources: ``` System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames(); ```
[ -0.017224349081516266, -0.03609251230955124, 0.4774770438671112, 0.08791543543338776, 0.17643260955810547, -0.11454573273658752, 0.48727285861968994, -0.24557049572467804, -0.14007648825645447, -1.0261311531066895, 0.1034708097577095, 0.6816544532775879, -0.48738327622413635, 0.07852405309...
Effectively I want to give numeric scores to alphabetic grades and sum them. In Excel, putting the `LOOKUP` function into an array formula works: ``` {=SUM(LOOKUP(grades, scoringarray))} ``` With the `VLOOKUP` function this does not work (only gets the score for the first grade). Google Spreadsheets does not appear to have the `LOOKUP` function and `VLOOKUP` fails in the same way using: ``` =SUM(ARRAYFORMULA(VLOOKUP(grades, scoresarray, 2, 0))) ``` or ``` =ARRAYFORMULA(SUM(VLOOKUP(grades, scoresarray, 2, 0))) ``` Is it possible to do this (but I have the syntax wrong)? Can you suggest a method that allows having the calculation in one simple cell like this rather than hiding the lookups somewhere else and summing
[ 0.15144750475883484, 0.18913452327251434, 0.1927012950181961, 0.2068661004304886, -0.07116474211215973, -0.024915538728237152, 0.26594269275665283, -0.44889193773269653, -0.04948503524065018, -0.6839402914047241, 0.016218233853578568, 0.3438626825809479, -0.16083596646785736, -0.1651735603...
them afterwards? I still can't see the formulae in your example (just values), but that is exactly what I'm trying to do in terms of the result; obviously I can already do it "by the side" and sum separately - the key for me is doing it in one cell. I have looked at it again this morning - using the `MATCH` function for the lookup works in an array formula. But then the `INDEX` function does not. I have also tried using it with `OFFSET` and `INDIRECT` without success. Finally, the `CHOOSE` function does not seem to accept a cell range
[ 0.5234726667404175, -0.13023771345615387, 0.26340997219085693, -0.049284376204013824, -0.17098817229270935, 0.19644665718078613, -0.24175173044204712, -0.6786092519760132, -0.18487055599689484, -0.4016760289669037, 0.2644403874874115, 0.5080615282058716, -0.14922572672367096, -0.0694110095...
as its list to choose from - the range degrades to a single value (the first cell in the range). It should also be noted that the `CHOOSE` function only accepts 30 values to choose from (according to the documentation). All very annoying. However, I do now have a working solution in one cell: using the `CHOOSE` function and explicitly listing the result cells one by one in the arguments like this: ``` =ARRAYFORMULA(SUM(CHOOSE(MATCH(D1:D8,Lookups!$A$1:$A$3,0),
[ 0.02878015860915184, -0.1882711797952652, 0.5173710584640503, -0.4223097264766693, 0.11943188309669495, 0.24277257919311523, -0.1287992000579834, -0.537607729434967, -0.033692147582769394, -0.44600361585617065, -0.02902815490961075, 0.40503212809562683, -0.23902693390846252, -0.00268343999...
Lookups!$B$1,Lookups!$B$2,Lookups!$B$3))) ``` Obviously this doesn't extend very well but hopefully the lookup tables are by nature quite fixed. For larger lookup tables it's a pain to type all the cells individually and some people may exceed the limit of 30 cells. I would certainly welcome a more elegant solution!
[ 0.38883283734321594, 0.10014781355857849, 0.2862503230571747, -0.07363446056842804, 0.25166037678718567, 0.134018674492836, 0.25415244698524475, -0.23299604654312134, -0.6609007120132446, -0.4241534471511841, 0.1237393170595169, 0.4496380090713501, -0.7491018772125244, -0.19687755405902863...
I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently. Also any MFC centric websites or blogs that people recommend? * For blogs: Your best bet would be the [Visual C++ Team Blog](http://blogs.msdn.com/vcblog/default.aspx). * For books: [Programming Windows with MFC](https://rads.stackoverflow.com/amzn/click/com/1572316950) is one of the best book on the subject. * For tutorials: Simply [search google for various tutorials on MFC](http://www.google.ca/search?q=mfc+tutorial&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a). ![enter image description here](https://i.stack.imgur.com/cc1ng.jpg)
[ 0.5716131925582886, 0.06384871155023575, 0.6008808612823486, -0.15141984820365906, 0.30593442916870117, -0.15263161063194275, 0.2714102268218994, 0.0935298502445221, -0.36819612979888916, -0.9409772753715515, -0.09867468476295471, 0.4501388967037201, 0.3685297966003418, 0.16132037341594696...
I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing. Is there any way to see debug output from GraphBuilder when it assembles a graph? Is there a way to dump a working graph to see how it was put together? Any other ideas for unraveling the mystery that lives in the DirectShow box? Thanks! -Z You can
[ 0.5991377830505371, 0.20035752654075623, 0.2185659259557724, 0.25437963008880615, -0.32188117504119873, -0.12788647413253784, 0.15352928638458252, 0.06899749487638474, -0.23819278180599213, -0.7704315185546875, 0.29873421788215637, 0.6243686676025391, -0.3691401481628418, 0.621680796146392...
watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph... In order to find your graph in the list, you have to register it in the running object table: ``` void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) { IMoniker* pMoniker; IRunningObjectTable* pROT; GetRunningObjectTable( 0, &pROT ); WCHAR wsz[256]; swprintf_s( wsz, L"FilterGraph %08p pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId() ); CreateItemMoniker( L"!", wsz, &pMoniker ); pROT->Register( 0, pUnkGraph, pMoniker, pdwRegister
[ 0.4548247158527374, -0.4389404356479645, 0.7361589670181274, 0.05380237475037575, -0.06490087509155273, 0.11450549215078354, 0.19002605974674225, 0.03971167281270027, -0.5295681357383728, -0.7403234839439392, 0.27996155619621277, 0.30529695749282837, -0.7216974496841431, 0.1569719910621643...
); // Clean up any COM stuff here ... } ``` After destroying your graph, you should remove it from the ROT by calling IRunningObjectTable::Revoke
[ 0.07530883699655533, 0.21036341786384583, 0.4255545139312744, -0.18187762796878815, -0.23489418625831604, -0.36153775453567505, 0.7931327819824219, 0.03197874128818512, -0.18885459005832672, -0.8607190847396851, -0.10370751470327377, 0.571746826171875, -0.6505327224731445, 0.59750056266784...
So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another. What are other popular models? What are their characteristics? What are good resources (books, web, etc) on this topic? I'm not only looking for db storage but would like to expand my knowledge on trees in general. For example, I understand that nested sets/intervals are especially favorable for relational database storage and have asked myself, are they actually a *bad* choice in other contexts? The seminal resource for this
[ 0.3412902355194092, 0.15110863745212555, -0.38287147879600525, 0.1489880383014679, -0.1763460636138916, 0.16140130162239075, 0.10229770839214325, -0.1019723042845726, -0.3013468086719513, -0.6507539749145508, 0.06366313993930817, 0.4080354571342468, -0.14326125383377075, 0.2183611392974853...
are chapters 28-30 of [SQL for Smarties](https://rads.stackoverflow.com/amzn/click/com/1558605762). (I've recommended this book so much I figure Celko owes me royalties by now!)
[ 0.10728003084659576, 0.06138281896710396, 0.2959984540939331, 0.3862462043762207, 0.36621809005737305, -0.1761733740568161, 0.20526812970638275, -0.11909458041191101, 0.003655227366834879, -0.44603613018989563, -0.1498023271560669, 0.5033188462257385, 0.07324312627315521, -0.24974045157432...
In SQL Server 2005, we can create temp tables one of two ways: ``` declare @tmp table (Col1 int, Col2 int); ``` or ``` create table #tmp (Col1 int, Col2 int); ``` What are the differences between these two? I have read conflicting opinions on whether @tmp still uses tempdb, or if everything happens in memory. In which scenarios does one out-perform the other? There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp), although using tempdb isn't one of them, as spelt out in the MSDN link below. As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should
[ -0.14847643673419952, -0.05430049076676369, 0.4938214123249054, 0.029755830764770508, -0.3792468309402466, -0.2464505285024643, -0.12120333313941956, 0.061862584203481674, -0.3576798737049103, -0.4888770282268524, 0.06735502928495407, 0.45468881726264954, -0.3839792311191559, 0.12109275162...
use table variables. (This is an overly broad guideline with of course lots of exceptions - see below and following articles.) Some points to consider when choosing between them: * Temporary Tables are real tables so you can do things like CREATE INDEXes, etc. If you have large amounts of data for which accessing by index will be faster then temporary tables are a good option. * Table variables can have indexes by using PRIMARY KEY or UNIQUE constraints. (If you want a non-unique index just include the primary key column as the last column in the unique constraint. If you don't
[ 0.028949374333024025, -0.08029857277870178, 0.15278171002864838, 0.3981323540210724, 0.025459235534071922, -0.005357170477509499, -0.0654316246509552, 0.14610649645328522, -0.5401424169540405, -0.6915502548217773, -0.02024511620402336, 0.584617018699646, -0.3868045210838318, 0.076977826654...
have a unique column, you can use an identity column.) [SQL 2014 has non-unique indexes too](https://stackoverflow.com/questions/886050/sql-server-creating-an-index-on-a-table-variable/17385085#17385085). * Table variables don't participate in transactions and `SELECT`s are implicitly with `NOLOCK`. The transaction behaviour can be very helpful, for instance if you want to ROLLBACK midway through a procedure then table variables populated during that transaction will still be populated! * Temp tables might result in stored procedures being recompiled, perhaps often. Table variables will not. * You can create a temp table using SELECT INTO, which can be quicker to write (good for ad-hoc querying) and may allow you to deal with changing datatypes
[ 0.0982157364487648, -0.22435669600963593, 0.4067677855491638, 0.17666588723659515, -0.2689841389656067, -0.15449899435043335, 0.0201641246676445, -0.1734849512577057, -0.47147172689437866, -0.3455682396888733, -0.05754586309194565, 0.30816513299942017, -0.4027521312236786, 0.17473438382148...
over time, since you don't need to define your temp table structure upfront. * You can pass table variables back from functions, enabling you to encapsulate and reuse logic much easier (eg make a function to split a string into a table of values on some arbitrary delimiter). * Using Table Variables within user-defined functions enables those functions to be used more widely (see CREATE FUNCTION documentation for details). If you're writing a function you should use table variables over temp tables unless there's a compelling need otherwise. * Both table variables and temp tables are stored in tempdb. But table variables (since
[ 0.34631624817848206, -0.07228898257017136, 0.24638402462005615, 0.18374989926815033, -0.37214162945747375, -0.2556666135787964, 0.21852801740169525, 0.03551611676812172, -0.3184060752391815, -0.5839640498161316, -0.05533038079738617, 0.2717175781726837, -0.31568485498428345, -0.00961522199...
2005) default to the collation of the current database versus temp tables which take the default collation of tempdb ([ref](https://learn.microsoft.com/sql/t-sql/language-elements/declare-local-variable-transact-sql)). This means you should be aware of collation issues if using temp tables and your db collation is different to tempdb's, causing problems if you want to compare data in the temp table with data in your database. * Global Temp Tables (##tmp) are another type of temp table available to all sessions and users. Some further reading: * [Martin Smith's great answer](https://dba.stackexchange.com/a/16386) on dba.stackexchange.com * MSDN FAQ on difference between the two: <https://support.microsoft.com/en-gb/kb/305977> * MDSN blog article: <https://learn.microsoft.com/archive/blogs/sqlserverstorageengine/tempdb-table-variable-vs-local-temporary-table> * Article: <https://searchsqlserver.techtarget.com/tip/Temporary-tables-in-SQL-Server-vs-table-variables> * Unexpected behaviors and performance
[ -0.22069106996059418, 0.09207289665937424, 0.4221954643726349, 0.020848531275987625, -0.44320669770240784, -0.06843819469213486, 0.43005841970443726, -0.504034698009491, -0.21562841534614563, -0.3580911159515381, -0.017767181620001793, 0.4559401273727417, -0.21535871922969818, 0.3590489327...
implications of temp tables and temp variables: [Paul White on SQLblog.com](https://sql.kiwi/2012/08/temporary-tables-in-stored-procedures.html)
[ 0.14614389836788177, 0.0735505148768425, -0.16143883764743805, 0.06253727525472641, 0.08210640400648117, 0.03126814216375351, 0.02086697705090046, -0.1839834600687027, -0.513565719127655, -0.1327170729637146, -0.35418444871902466, 0.14917781949043274, -0.10273510962724686, -0.0981918200850...
Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" here is defined as * Relatively easy to implement, understand, and maintain * Results in a thumbnail of reasonable quality Performance and high-quality thumbnails are secondary. I suppose your best solution would be using the [GetThumbnailImage](http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx) from the .NET [Image](http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx) class. ``` // Example in C#, should be quite alike in ASP.NET // Assuming filename as the uploaded
[ 0.47773391008377075, -0.1887904405593872, 0.163877472281456, 0.5154383778572083, 0.10192237794399261, -0.22140079736709595, 0.25310564041137695, 0.10474124550819397, -0.24245685338974, -0.43476688861846924, -0.41707122325897217, 0.837572455406189, 0.07356403768062592, -0.03261427581310272,...
file using ( Image bigImage = new Bitmap( filename ) ) { // Algorithm simplified for purpose of example. int height = bigImage.Height / 10; int width = bigImage.Width / 10; // Now create a thumbnail using ( Image smallImage = image.GetThumbnailImage( width,
[ -0.006471612956374884, -0.02801058627665043, 0.8417811393737793, -0.038304343819618225, 0.4396144151687622, 0.16463597118854523, 0.090276800096035, -0.21199274063110352, -0.4045259356498718, -0.5595317482948303, 0.14431637525558472, 0.8224007487297058, -0.056986767798662186, -0.08142083138...
height, new Image.GetThumbnailImageAbort(Abort), IntPtr.Zero) ) { smallImage.Save("thumbnail.jpg", ImageFormat.Jpeg); } } ```
[ 0.21723181009292603, -0.19670194387435913, 0.9072892069816589, -0.05933380126953125, 0.3291260302066803, -0.053831178694963455, 0.20871903002262115, -0.25138190388679504, -0.19405415654182434, -0.5200901627540588, -0.29330897331237793, 0.7590171098709106, 0.07671725004911423, 0.23101161420...
My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a benefit for my long-term goals? It's probably not going to have a whole lot of benefit unless you have a direct application for it. If you're going for general knowledge, C/C++ is a fine place to start. That said, the challenges that assembly poses are very interesting and it requires a pretty different mindset to get things
[ 0.7608919143676758, 0.34123918414115906, -0.13074921071529388, 0.0045045046135783195, 0.19799672067165375, 0.16584907472133636, 0.2286100834608078, 0.07682247459888458, -0.32974591851234436, -0.7801990509033203, 0.02475825510919094, 0.5684270262718201, 0.22897404432296753, 0.18630422651767...
done. I spent a little time learning Z80 assembly by programming the [TI-86](http://education.ti.com/educationportal/sites/US/productDetail/us_ti86.html) calculator. The Z80 instruction set is pretty small and the novelty of programming a calculator in assembly is very amusing. [ticalc.org](http://www.ticalc.org) has a lot of good resources on [TI assembly programming](http://www.ticalc.org/basics/calculators/ti-86.html#8).
[ 0.5406772494316101, 0.41702932119369507, -0.10071743279695511, 0.07814809679985046, 0.41116300225257874, -0.12527784705162048, 0.006494597066193819, 0.0006183683290146291, -0.45032477378845215, -0.24108104407787323, 0.09146580100059509, 0.9356503486633301, 0.15356020629405975, -0.106592938...
When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to oriented differently. Is **240×320** still considered safe? Not enough information... You say you're targeting a "Mobile App" but the reality is that mobile could mean anything from a cell phone with 128x128 resolution to a MID with 800x600 resolution. There is no "safe" resolution for such a wide range, and if you're truly targeting all of them
[ 0.301848828792572, 0.040954288095235825, 0.4496825635433197, 0.12934213876724243, -0.08156480640172958, -0.048244770616292953, 0.30541062355041504, -0.12545150518417358, -0.09495285153388977, -0.6344883441925049, -0.09134256839752197, 0.5816323161125183, -0.37223246693611145, 0.07675439119...
you need to design a custom interface for each major resolution. Add some scaling factors in and you might be able to cut it down to 5-8 different interface designs. Further, the UI means "User Interface" and includes a lot more than just the resolution - you can't count on a touchscreen, full keyboard, or even software keys. You need to either better define your target, or explain your target here so we can better help you. Keep in mind that there are millions of phone users that don't have PDA resolutions, and you can really only count on 128x128 or better to
[ 0.2147613763809204, -0.11353977024555206, 0.6382194757461548, 0.5027334094047546, 0.1826687753200531, -0.04587965086102486, 0.03164444863796234, -0.09245602041482925, -0.18763361871242523, -0.9181939363479614, 0.08998028934001923, 0.5735134482383728, -0.12339117377996445, 0.058185145258903...
cover the majority of technically inclined cell phone users (those that know there's a web browser in their phone, nevermind those that use it). But if you're prepared to accept these losses, go ahead and hit for 320x240 and 240x320. That will give you most current PDA phones and up (older blackberries and palm devices had smaller square orientations). Plan on spending time later supporting lower resolution devices and above all... *Do not tie your app to a particular resolution.* Make sure your app is flexible enough that you can deploy new UI's without changing internal application logic - in other words separate
[ 0.3380761742591858, -0.13068699836730957, 0.6210705637931824, 0.15622666478157043, 0.023052463307976723, 0.0652836486697197, 0.1035594642162323, -0.0024401615373790264, -0.30480512976646423, -0.5728001594543457, -0.05780992656946182, 0.6868964433670044, 0.05359519645571709, -0.273008912801...
the presentation from the core logic. You will find this very useful later - the mobile world changes daily. Once you gauge how your app is being used you can, for instance, easily deploy an iPhone specific version that is pixel perfect (and prettier than an upscaled 320x240) in order to engage more users. Being able to do this in a few hours (because you don't have to change the internals) is going to put you miles ahead of the competition if someone else makes a swipe at your market. -Adam
[ 0.4556809961795807, -0.056668687611818314, 0.08629319071769714, 0.2826802432537079, 0.09648685902357101, 0.2659861147403717, 0.2582029104232788, 0.02747531235218048, -0.1862553507089615, -0.5647591948509216, -0.06906062364578247, 0.42130324244499207, 0.054548006504774094, -0.06178646162152...
I have a table of tags and want to get the highest count tags from the list. Sample data looks like this ``` id (1) tag ('night') id (2) tag ('awesome') id (3) tag ('night') ``` using ``` SELECT COUNT(*), `Tag` from `images-tags` GROUP BY `Tag` ``` gets me back the data I'm looking for perfectly. However, I would like to organize it, so that the highest tag counts are first, and limit it to only send me the first 20 or so. I tried this... ``` SELECT COUNT(id), `Tag` from `images-tags` GROUP BY `Tag` ORDER BY COUNT(id) DESC LIMIT 20 ``` and I keep getting an "Invalid use of group function - ErrNr 1111" What am I doing wrong? I'm using
[ 0.5262625813484192, 0.20606201887130737, 0.46949994564056396, -0.19843074679374695, -0.07845648378133774, -0.17541112005710602, 0.3781757354736328, -0.617466151714325, -0.2920779585838318, -0.3604663014411926, 0.05283011123538017, 0.5376874804496765, -0.29170262813568115, -0.01577265560626...
MySQL 4.1.25-Debian In all versions of MySQL, simply alias the aggregate in the SELECT list, and order by the alias: ``` SELECT COUNT(id) AS theCount, `Tag` from `images-tags` GROUP BY `Tag` ORDER BY theCount DESC LIMIT 20 ```
[ -0.03745343163609505, 0.11051834374666214, 0.25375449657440186, 0.05391240119934082, -0.09924141317605972, -0.055464696139097214, 0.08659601956605911, -0.1995754987001419, -0.04768684506416321, -0.4078402519226074, 0.06015236675739288, 0.5714896321296692, -0.6288259029388428, -0.1836492270...
I have a large database and would like to select table names that have a certain column name. I have done something like this in MySQL, but can't find any info on SQL Server. I want to do something like: ``` select [table] from [db] where table [has column 'classtypeid'] ``` How can I do something like this? Use the ANSI information\_schema views, this will also work in MySQL ``` select table_name from information_schema.columns where column_name = 'classtypeid' ```
[ 0.10518741607666016, 0.2506001591682434, 0.04467765614390373, -0.13908135890960693, -0.09757250547409058, -0.13623329997062683, -0.08925386518239975, -0.07663290202617645, -0.17818383872509003, -0.7790712714195251, 0.2942419648170471, 0.47962290048599243, -0.2550837993621826, 0.26086172461...
I have a ListBox that has a style defined for ListBoxItems. Inside this style, I have some labels and a button. One that button, I want to define a click event that can be handled on my page (or any page that uses that style). How do I create an event handler on my WPF page to handle the event from my ListBoxItems style? Here is my style (affected code only): ``` <Style x:Key="UsersTimeOffList" TargetType="{x:Type ListBoxItem}"> ... <Grid> <Button x:Name="btnRemove" Content="Remove" Margin="0,10,40,0" Click="btnRemove_Click" /> </Grid> </Style> ``` Thanks! Take a look at [RoutedCommand](http://msdn.microsoft.com/en-us/library/system.windows.input.routedcommand.aspx)s. Define your command in myclass somewhere as follows: ``` public static readonly RoutedCommand Login =
[ 0.16834552586078644, -0.18707400560379028, 0.5819417834281921, -0.12409151345491409, -0.16942612826824188, -0.2980179190635681, 0.13448305428028107, -0.16590383648872375, -0.3810155689716339, -0.7609992027282715, 0.10595150291919708, 0.337767094373703, -0.36152026057243347, 0.0559206418693...
new RoutedCommand(); ``` Now define your button with this command: ``` <Button Command="{x:Static myclass.Login}" /> ``` You can use CommandParameter for extra information.. Now last but not least, start listening to your command: In the constructor of the class you wish to do some nice stuff, you place: ``` CommandBindings.Add(new CommandBinding(myclass.Login, ExecuteLogin)); ``` or in XAML: ``` <UserControl.CommandBindings> <CommandBinding Command="{x:Static myclass.Login}" Executed="ExecuteLogin" /> </UserControl.CommandBindings> ``` And you implement the delegate the CommandBinding needs: ``` private void ExecuteLogin(object sender, ExecutedRoutedEventArgs e) {
[ 0.07080337405204773, -0.42515355348587036, 0.765290379524231, 0.007140179630368948, -0.016681717708706856, -0.314580500125885, 0.3089597821235657, -0.20297197997570038, -0.2134452909231186, -0.6966738104820251, -0.010827559046447277, 0.5880814790725708, -0.3723217844963074, 0.0299442633986...
//Your code goes here... e has your parameter! } ``` You can start listening to this command everywhere in your visual tree! Hope this helps PS You can also define the CommandBinding with a CanExecute delegate which will even disable your command if the CanExecute says so :) PPS Here is another example: [RoutedCommands in WPF](http://www.wpfwiki.com/Default.aspx?Page=WPF%20Q13.8&AspxAutoDetectCookieSupport=1)
[ 0.20040330290794373, -0.26144230365753174, 0.41758331656455994, 0.022522354498505592, 0.006315872073173523, -0.23272216320037842, 0.3403008282184601, -0.2228628545999527, -0.32766589522361755, -0.6363469362258911, -0.05615890771150589, 0.4131391942501068, -0.41489070653915405, -0.025780620...
Python has this wonderful way of handling string substitutions using dictionaries: ``` >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' ``` I love this because you can specify a value once in the dictionary and then replace it all over the place in the string. I've tried to achieve something similar in PHP using various string replace functions but everything I've come up with feels awkward. Does anybody have a nice clean way to do this kind of string substitution in PHP? ***Edit*** Here's the code from the sprintf page that I liked best. ``` <?php function sprintf3($str, $vars,
[ 0.01914171688258648, 0.26044678688049316, -0.12195052951574326, -0.25055068731307983, -0.45609864592552185, -0.051587630063295364, 0.2593153715133667, 0.07933088392019272, -0.17782236635684967, -0.41858971118927, 0.11899387836456299, 0.4574260413646698, -0.44606146216392517, -0.09949818253...
$char = '%') { $tmp = array(); foreach($vars as $k => $v) { $tmp[$char . $k . $char] = $v; } return str_replace(array_keys($tmp), array_values($tmp), $str); } echo sprintf3( 'The %site% site %adj% because it %adj%', array('site'=>'Stackoverflow', 'adj'=>'rocks')); ?> ``` ``` function subst($str, $dict){ return preg_replace(array_map(create_function('$a', 'return "/%\\($a\\)s/";'), array_keys($dict)), array_values($dict), $str); } ``` You call it like so: ``` echo subst('The %(site)s site %(adj)s because it %(adj)s', array('site'=>'Stackoverflow', 'adj'=>'rocks')); ```
[ -0.015918098390102386, 0.03910624235868454, 0.5004667043685913, -0.4626336395740509, 0.12871184945106506, 0.05136236175894737, 0.5454567670822144, -0.47146567702293396, -0.08825378119945526, -0.3370489776134491, -0.4976194500923157, 0.3288218379020691, -0.4158634543418884, 0.18856799602508...
If I open a solution in Visual Studio 2008 and run a unit test then VS creates a new .vsmdi file in the Solution Items folder and gives it the next number available e.g. My Solution2.vsmdi. Any idea why VS is doing this and how I can get it to stop doing this? It appears that the [VSMDI problem is a known bug and has been around since VS2005 Team System](http://web.archive.org/web/20080302162715/http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx) but it has no clear fix as yet. Another reason to NOT use MS Test. An MSDN blog details [how to run unit tests without VSMDI files](http://blogs.msdn.com/buckh/archive/2006/11/04/how-to-run-tests-without-test-metadata-files-and-test-lists-vsmdi-files.aspx).
[ 0.24011024832725525, -0.017494402825832367, 0.3198402523994446, 0.09999619424343109, -0.2421363890171051, -0.3418354094028473, 0.4874783754348755, -0.2872054874897003, -0.2612084746360779, -0.6347340941429138, 0.16512413322925568, 0.4883161783218384, -0.25022444128990173, 0.242987588047981...
This is a very specific question regarding **MySQL** as implemented in **WordPress**. I'm trying to develop a plugin that will show (select) posts that have specific '**tags**' and belong to specific '**categories**' (both multiple) I was told it's impossible because of the way categories and tags are stored: 1. `wp_posts` contains a list of posts, each post have an "ID" 2. `wp_terms` contains a list of terms (both categories and tags). Each term has a TERM\_ID 3. `wp_term_taxonomy` has a list of terms with their TERM\_IDs and has a Taxonomy definition for each one of those (either a Category or a Tag) 4. `wp_term_relationships` has associations
[ 0.35011109709739685, 0.18787048757076263, 0.5579392910003662, 0.1344154179096222, -0.25458234548568726, -0.254395067691803, 0.03189915046095848, -0.3426840305328369, -0.2677030861377716, -0.7173740863800049, -0.04332757741212845, 0.3087387681007385, -0.31847941875457764, 0.2488178759813308...
between terms and posts How can I join the tables to get all posts with tags "Nuclear" **and** "Deals" that also belong to the category "Category1"? I misunderstood you. I thought you wanted Nuclear or Deals. The below should give you only Nuclear and Deals. ``` select p.* from wp_posts p, wp_terms t, wp_term_taxonomy tt, wp_term_relationship tr, wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2 wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2 where p.id = tr.object_id and t.term_id = tt.term_id and tr.term_taxonomy_id = tt.term_taxonomy_id and p.id = tr2.object_id and t2.term_id = tt2.term_id and tr2.term_taxonomy_id = tt2.term_taxonomy_id and p.id = tr3.object_id and t3.term_id = tt3.term_id and tr3.term_taxonomy_id = tt3.term_taxonomy_id and (tt.taxonomy = 'category' and tt.term_id
[ 0.19290311634540558, 0.054329633712768555, 0.60845947265625, 0.11454133689403534, 0.12014569342136383, 0.10110305994749069, -0.13703708350658417, -0.3707018196582794, -0.16893623769283295, -0.5004780888557434, 0.026860080659389496, 0.6306154131889343, -0.04832993820309639, 0.13314282894134...
= t.term_id and t.name = 'Category1') and (tt2.taxonomy = 'post_tag' and tt2.term_id = t2.term_id and t2.name = 'Nuclear') and (tt3.taxonomy = 'post_tag' and tt3.term_id = t3.term_id and t3.name = 'Deals') ```
[ 0.29770705103874207, 0.21766731142997742, 0.4465517997741699, -0.13248100876808167, 0.18067525327205658, -0.24202246963977814, -0.3289867639541626, -0.49335476756095886, -0.2848588824272156, -0.1346220225095749, -0.5786483287811279, 0.5001791715621948, -0.17119529843330383, 0.5853099226951...
I'm trying to install some Ruby Gems so I can use Ruby to notify me when I get twitter messages. However, after doing a `gem update --system`, I now get a zlib error every time I try and do a `gem install` of anything. below is the console output I get when trying to install ruby gems. (along with the output from `gem environment`). ``` C:\data\ruby>gem install twitter ERROR: While executing gem ... (Zlib::BufError) buffer error C:\data\ruby>gem update --system Updating RubyGems ERROR: While executing gem ... (Zlib::BufError) buffer error C:\data\ruby>gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.2.0 -
[ 0.09670022875070572, 0.3348262310028076, 0.2667006850242615, -0.3357630968093872, -0.1483648270368576, 0.04710913076996803, 0.9509333372116089, -0.14961904287338257, 0.07161658257246017, -0.6692262291908264, -0.07162231206893921, 0.9591556787490845, -0.5276256203651428, -0.1178984791040420...
RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8 - RUBY EXECUTABLE: c:/ruby/bin/ruby.exe - EXECUTABLE DIRECTORY: c:/ruby/bin - RUBYGEMS PLATFORMS: - ruby - x86-mswin32-60 - GEM PATHS: - c:/ruby/lib/ruby/gems/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ ``` I
[ -0.1310405135154724, 0.09943528473377228, 0.47526445984840393, -0.14321129024028778, -0.27224424481391907, -0.07597494125366211, 0.6680695414543152, -0.41949814558029175, -0.18793754279613495, -0.4882543981075287, -0.4652973413467407, 0.5754006505012512, -0.22934329509735107, -0.0991381108...
just started getting this tonight as well. Googling turned up a bunch of suggestions that didn't deliver results ``` gem update --system ``` and some paste in code from jamis that is supposed to replace a function in package.rb but the original it is supposed to replace is nowhere to be found. Reinstalling rubygems didn't help. I'm reinstalling ruby right now.........and it is fixed. Pain though.
[ 0.2293982207775116, 0.18437306582927704, 0.31260690093040466, -0.11937151849269867, -0.33628755807876587, -0.017238765954971313, 0.894050121307373, -0.014222217723727226, -0.13451199233531952, -0.4338463842868805, 0.14119794964790344, 0.81296306848526, -0.32593727111816406, 0.4893503487110...
I've developed an equation parser using a simple stack algorithm that will handle binary (+, -, |, &, \*, /, etc) operators, unary (!) operators, and parenthesis. Using this method, however, leaves me with everything having the same precedence - it's evaluated left to right regardless of operator, although precedence can be enforced using parenthesis. So right now "1+11\*5" returns 60, not 56 as one might expect. While this is suitable for the current project, I want to have a general purpose routine I can use for later projects. **Edited for clarity:** What is a good algorithm for parsing equations with precedence? I'm interested in something
[ -0.2353021800518036, 0.21251578629016876, 0.364697128534317, 0.07130321860313416, -0.058728624135255814, 0.2842574119567871, -0.07425497472286224, -0.3749045729637146, -0.28848475217819214, -0.5510300397872925, -0.059057433158159256, 0.23256176710128784, -0.1366809457540512, -0.14885362982...
simple to implement and understand that I can code myself to avoid licensing issues with available code. **Grammar:** I don't understand the grammar question - I've written this by hand. It's simple enough that I don't see the need for YACC or Bison. I merely need to calculate strings with equations such as "2+3 \* (42/13)". **Language:** I'm doing this in C, but I'm interested in an algorithm, not a language specific solution. C is low level enough that it'll be easy to convert to another language should the need arise. **Code Example** I posted the [test code for the simple expression parser](http://web.archive.org/web/20171012060859/http://www.ubasics.com/simple_c_equation_parser) I was talking
[ 0.18308208882808685, 0.1255466341972351, 0.1551361382007599, -0.2653426229953766, -0.25080835819244385, 0.016423746943473816, 0.5894463062286377, -0.15473416447639465, 0.061498161405324936, -0.6079546213150024, -0.15436497330665588, 0.7341954112052917, -0.4700300991535187, -0.4955931305885...
about above. The project requirements altered and so I never needed to optimize the code for performance or space as it wasn't incorporated into the project. It's in the original verbose form, and should be readily understandable. If I do anything further with it in terms of operator precedence, I'll probably choose [the macro hack](https://stackoverflow.com/questions/28256/equation-expression-parser-with-precedence/783132#783132) because it matches the rest of the program in simplicity. If I ever use this in a real project, though, I'll be going for a more compact/speedy parser. **Related question** > [Smart design of a math parser?](https://stackoverflow.com/questions/114586/smart-design-of-a-math-parser) -Adam ### The hard way You want a [recursive descent parser](http://en.wikipedia.org/wiki/Recursive_descent_parser). To get precedence
[ -0.569135844707489, 0.035035621374845505, 0.28952133655548096, 0.09758468717336655, -0.08459904044866562, -0.04848020523786545, 0.3226141929626465, -0.07952770590782166, -0.5030025839805603, -0.4535684883594513, -0.2147437185049057, 0.46926429867744446, 0.026760786771774292, -0.34485659003...
you need to think recursively, for example, using your sample string, ``` 1+11*5 ``` to do this manually, you would have to read the `1`, then see the plus and start a whole new recursive parse "session" starting with `11`... and make sure to parse the `11 * 5` into its own factor, yielding a parse tree with `1 + (11 * 5)`. This all feels so painful even to attempt to explain, especially with the added powerlessness of C. See, after parsing the 11, if the \* was actually a + instead, you would have to abandon the attempt at making a term
[ 0.05742642655968666, 0.30264198780059814, -0.09137282520532608, -0.12069045007228851, -0.14073261618614197, 0.10966301709413528, 0.5955042839050293, -0.5160259008407593, -0.13107524812221527, -0.46499451994895935, -0.2740430533885956, 0.5958067178726196, -0.22411935031414032, -0.2281519323...
and instead parse the `11` itself as a factor. My head is already exploding. It's possible with the recursive decent strategy, but there is a better way... ### The easy (right) way If you use a GPL tool like Bison, you probably don't need to worry about licensing issues since the C code generated by bison is not covered by the GPL (IANAL but I'm pretty sure GPL tools don't force the GPL on generated code/binaries; for example Apple compiles code like say, Aperture with GCC and they sell it without having to GPL said code). [Download Bison](http://www.gnu.org/software/bison) (or something equivalent, ANTLR, etc.). There
[ 0.5429161190986633, 0.36575931310653687, -0.2448120266199112, 0.1352374404668808, -0.3096974194049835, -0.3737203776836395, 0.21664464473724365, 0.21433627605438232, -0.34367233514785767, -0.5759707093238831, -0.058041397482156754, 0.7978731989860535, -0.10909109562635422, -0.3620800971984...
is usually some sample code that you can just run bison on and get your desired C code that demonstrates this four function calculator: <http://www.gnu.org/software/bison/manual/html_node/Infix-Calc.html> Look at the generated code, and see that this is not as easy as it sounds. Also, the advantages of using a tool like Bison are 1) you learn something (especially if you read the Dragon book and learn about grammars), 2) you avoid [NIH](http://en.wikipedia.org/wiki/Not_Invented_Here) trying to reinvent the wheel. With a real parser-generator tool, you actually have a hope at scaling up later, showing other people you know that parsers are the domain of parsing tools. --- **Update:** People
[ 0.5077289342880249, 0.055903609842061996, -0.34964245557785034, 0.6818583607673645, -0.34371381998062134, -0.3707145154476166, 0.2196425199508667, -0.028021670877933502, -0.15292568504810333, -0.6525306105613708, 0.14602161943912506, 0.7820701003074646, 0.07130233198404312, -0.327549397945...
here have offered much sound advice. My only warning against skipping the parsing tools or just using the Shunting Yard algorithm or a hand rolled recursive decent parser is that little toy languages[1](http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html) may someday turn into big actual languages with functions (sin, cos, log) and variables, conditions and for loops. Flex/Bison may very well be overkill for a small, simple interpreter, but a one off parser+evaluator may cause trouble down the line when changes need to be made or features need to be added. Your situation will vary and you will need to use your judgement; just don't [punish other
[ 0.43645790219306946, 0.026992037892341614, -0.27257904410362244, 0.06723703444004059, -0.09324817359447479, -0.11550691723823547, 0.5606032609939575, 0.1985529363155365, -0.13712994754314423, -0.4376172125339508, 0.014263822697103024, 0.867191731929779, 0.1186281070113182, -0.3473431169986...
people for your sins](http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html) [2] and build a less than adequate tool. **My favorite tool for parsing** The best tool in the world for the job is the [Parsec](http://book.realworldhaskell.org/read/using-parsec.html) library (for recursive decent parsers) which comes with the programming language Haskell. It looks a lot like [BNF](http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form), or like some specialized tool or domain specific language for parsing (sample code [3]), but it is in fact just a regular library in Haskell, meaning that it compiles in the same build step as the rest of your Haskell code, and you can write arbitrary Haskell code and call that within your parser, and
[ 0.3933318257331848, 0.3898235857486725, -0.009116626344621181, 0.006309830117970705, -0.2752797305583954, 0.1684935986995697, 0.6386561393737793, -0.19040772318840027, -0.46556881070137024, -0.29104697704315186, 0.44231075048446655, 0.9875476360321045, -0.07016345858573914, -0.205043151974...
you can mix and match other libraries *all in the same code*. (Embedding a parsing language like this in a language other than Haskell results in loads of syntactic cruft, by the way. I did this in C# and it works quite well but it is not so pretty and succinct.) **Notes:** [1](http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html) Richard Stallman says, in [Why you should not use Tcl](http://web.cecs.pdx.edu/~trent/gnu/tcl-not) > The principal lesson of Emacs is that > a language for extensions should not > be a mere "extension language". It > should be a real programming language, > designed for writing and maintaining > substantial programs. Because people >
[ 0.5501234531402588, 0.3945687413215637, 0.11481635272502899, 0.027786782011389732, 0.1655314713716507, -0.07056725025177002, -0.11542950570583344, -0.3620905578136444, -0.11079887300729752, -0.12967939674854279, 0.034527264535427094, 0.8171437382698059, -0.1916666030883789, -0.078235872089...
will want to do that! [2] Yes, I am forever scarred from using that "language". Also note that when I submitted this entry, the preview was correct, but **SO's less than adequate parser ate my close anchor tag on the first paragraph**, proving that parsers are not something to be trifled with because if you use regexes and one off hacks **you will probably get something subtle and small wrong**. [3] Snippet of a Haskell parser using Parsec: a four function calculator extended with exponents, parentheses, whitespace for multiplication, and constants (like pi and e). ```hs aexpr = expr `chainl1`
[ 0.2755599915981293, 0.26929160952568054, 0.38909390568733215, 0.033667098730802536, 0.1188829094171524, -0.21595007181167603, 0.45889443159103394, -0.060933034867048264, 0.1355309784412384, -0.7355555891990662, -0.14242605865001678, 0.571260929107666, -0.3118269145488739, -0.20903173089027...
toOp expr = optChainl1 term addop (toScalar 0) term = factor `chainl1` mulop factor = sexpr `chainr1` powop sexpr = parens aexpr <|> scalar <|> ident powop = sym "^" >>= return . (B Pow) <|> sym "^-" >>= return . (\x y -> B Pow x (B Sub (toScalar 0) y)) toOp = sym "->" >>= return
[ -0.01672094129025936, -0.5607727766036987, 0.7262841463088989, -0.31651484966278076, 0.11058732867240906, 0.28651127219200134, 0.25892573595046997, -0.5918940901756287, -0.06712893396615982, -0.08252038806676865, -0.44334909319877625, 0.39860785007476807, -0.5953305959701538, -0.4142959713...
. (B To) mulop = sym "*" >>= return . (B Mul) <|> sym "/" >>= return . (B Div) <|> sym "%" >>= return . (B Mod) <|> return . (B Mul) addop = sym "+" >>= return . (B Add) <|> sym "-" >>= return . (B Sub) scalar = number >>=
[ 0.02651432901620865, -0.48696213960647583, 0.6127254366874695, -0.4417092502117157, -0.014398724772036076, 0.48631376028060913, 0.14630107581615448, -0.7267113924026489, -0.3681205213069916, -0.4527972638607025, -0.7459166049957275, 0.4563809931278229, -0.36364811658859253, -0.053935572504...
return . toScalar ident = literal >>= return . Lit parens p = do lparen result <- p rparen return result ```
[ -0.11269019544124603, 0.020253075286746025, 0.46688899397850037, -0.14592179656028748, 0.339720219373703, 0.025019114837050438, 0.11904044449329376, -0.55311119556427, 0.09506412595510483, -0.03236919641494751, -0.22798368334770203, 0.9006841778755188, -0.5881356596946716, -0.2590352594852...
I am having trouble integrating two products, one of which is mine and they appear not to be talking. So I want to make sure they are communicating correctly. I had a look around for network monitor and found TCP Spy. This works but only shows 1 side of the conversation at a time (it has to run locally) I would ideally like to see both sides at the same time - but you can't run two copies of TCP Spy. I've hit Sourceforge, but nothing seems to jump out - I'm a Windows developer, I don't have perl installed. I've found
[ 0.44072815775871277, -0.06975360959768295, 0.22577042877674103, 0.01510272454470396, -0.1460643857717514, -0.1570245623588562, 0.23726874589920044, 0.28713515400886536, -0.0809321254491806, -0.7515392303466797, 0.17458531260490417, 0.6024048328399658, -0.19455547630786896, 0.29121086001396...
a couple of others which are cripple-ware and totally useless, so I was wondering what do the SO guys use for watching the TCP conversation? BTW - the 'not-written-here' product is not a browser. I tried Wireshark and Microsoft Network Monitor, but neither detected my (and the program I am trying to communicate with) transfer. If I had a day to sit and configure it I probably could get it working but I just wanted the bytes sent and, more specifically, bytes received. In the end I found [HHD Software's Accurate Network Monitor](http://www.hhdsoftware.com/Products/home/accurate-network-monitor.html) software which did what I wanted it to, even if
[ 0.5246451497077942, 0.17525845766067505, 0.5146801471710205, 0.11790969967842102, -0.3120322823524475, -0.23372982442378998, 0.11169730871915817, 0.12088475376367569, -0.07967951893806458, -0.6511998772621155, 0.1851826310157776, 0.5227476954460144, -0.15486912429332733, 0.1324342489242553...
it was slight clunky.
[ -0.21793702244758606, 0.5459590554237366, -0.10441534966230392, -0.009873460978269577, -0.1594085395336151, -0.2042543590068817, -0.08832114189863205, 0.12127681076526642, -0.2376106083393097, 0.04388774558901787, 0.5932973623275757, 0.22815217077732086, 0.23064251244068146, 0.270207911729...