text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
way around. From the oo model to the database [edit] You could try to get a hybrid model working. Going from DB to OO for part of the app, and the other way around for another part. That allows you to slowly refactor and migrate to OO->DB.
[ 0.47481006383895874, -0.2537020146846771, 0.17388109862804413, 0.3413029909133911, -0.19694215059280396, -0.09986536204814911, -0.008250377140939236, 0.18486614525318146, -0.02419210784137249, -0.7384284734725952, 0.06199079006910324, 0.2113485336303711, -0.40845024585723877, 0.08652170002...
I'm using Perl's [CGI::Session](http://search.cpan.org/dist/CGI-Session) with MySQL. No problems there. I want to incorporate some other languages, most notably PHP, to use the same session cookie. How would I do that? Almost the entire site is in Perl, but I want to use free PHP things, like forums and mediawiki, an...
[ 0.6600229740142822, -0.09750472009181976, 0.09737624228000641, 0.09897430986166, -0.4477842152118683, -0.22784610092639923, 0.3630790114402771, 0.19900396466255188, -0.40540987253189087, -0.6431430578231812, -0.0569734163582325, 0.5011927485466003, -0.269093781709671, 0.03363342210650444, ...
I'm using C# and VB.NET. I often (every days...) add comments to existing source files. When I check-in these files, I would like to have my merge tool to ignore any changes made to comments - I just want to be sure that I did not change the code. I use WinMerge and Team Foundation Control Server (yes, no chance : S...
[ 0.4149757921695709, 0.21492020785808563, -0.04078519716858864, -0.08900681883096695, -0.15235348045825958, -0.18245244026184082, 0.19477875530719757, 0.19669494032859802, -0.34076783061027527, -0.9897071123123169, 0.038914475589990616, 0.4705743193626404, -0.1481054574251175, -0.0352875143...
before checking them in. And this is pretty cumbersome. (Well, since most of my co-workers do not comment at all -- hey, they use pretty long namespace/class/methods/property/type/constant names that tell it all, guys ! -- it's a lot of work.) Any suggestions ? All the best, Sylvain. You said you used WinMerge - wel...
[ 0.41330981254577637, 0.23342886567115784, -0.1493111252784729, 0.12577062845230103, -0.09282804280519485, -0.24271589517593384, 0.1738472580909729, 0.20464064180850983, -0.11029094457626343, -0.6120608448982239, -0.04834430664777756, 0.6781672835350037, -0.16635243594646454, -0.17696671187...
How do I change the tabpage being displayed in my tabcontrol programmatically? Either by tabControl1.SelectedIndex which is an integer or if you have a reference to a particular tab, tabControl1.SelectedTab. If you wanted the first one selected: ``` tabControl1.SelectedIndex = 0; ```
[ 0.032788150012493134, -0.3025621771812439, 0.35195550322532654, 0.04727794975042343, -0.1470244973897934, 0.2385842204093933, -0.17408184707164764, -0.025063466280698776, -0.31739896535873413, -0.6752834320068359, 0.03328584134578705, 0.28504517674446106, -0.5770050287246704, 0.26351454854...
I am trying to bind a ComboxBox to a foreign key table. I know that on cannot bind to the actual foreign key, SomeTableClassFK, (causes a LinqSql exception when the FK already has a value). So, I am binding to FK object, SomeTable, reference thru the SelectedItem property of the ComboBox. SomePrimaryTable SomeTabl...
[ -0.010051329620182514, 0.059608519077301025, 0.5276062488555908, -0.17192932963371277, -0.21997453272342682, 0.05055319145321846, 0.19059433043003082, -0.27450495958328247, -0.13651949167251587, -0.547135055065155, 0.05477972701191902, 0.2778145968914032, -0.4161497950553894, 0.46223747730...
then use the command: ``` diff file1 file2 ``` If you are using Windows then try a tool like [win merge](http://winmerge.org/) for example To find information about a file in the repository then use the command: ``` svn info file ``` If you want to find out more about SVN, have a look at the official [tutorial](...
[ 0.27506837248802185, -0.07176573574542999, 0.22590672969818115, 0.025331007316708565, -0.18162979185581207, -0.699415922164917, 0.12226317077875137, 0.2544504702091217, -0.12898238003253937, -0.7323550581932068, -0.42311128973960876, 0.7432457804679871, 0.03316265344619751, 0.1246334984898...
A stored procedure that runs a SELECT on a large table is timing out. The where clause is causing the timeout, because I am selecting only cities that are in another table. ``` AND city IN (SELECT DISTINCT city from tOH where clientId = @clientId) AND state IN (SELECT DISTINCT state from tOH where clientId = @clientId...
[ -0.02237051911652088, -0.410510778427124, 0.2975495755672455, 0.029406797140836716, -0.054374031722545624, -0.02679739147424698, -0.16862227022647858, -0.31156760454177856, -0.14208753407001495, -0.9673202633857727, -0.37187978625297546, -0.07811097800731659, -0.4649839699268341, 0.2884824...
tOH WHERE clientId = @clientId GROUP BY city ``` Then my where clause changes to ``` AND city IN (SELECT city from @cities) ``` Can anyone figure out a good way of optimizing this stored procedure? ---------------------------- UPDATE ------------------------------------ The joins are all too slow. I think a sol...
[ 0.21976463496685028, -0.12384910136461258, 0.7820512652397156, 0.06504553556442261, -0.07319746911525726, -0.14384786784648895, -0.1308966726064682, -0.25111788511276245, 0.05775512382388115, -0.9737396240234375, -0.20624709129333496, 0.28843605518341064, -0.3247280716896057, 0.13644774258...
in your example (INSERT INTO... and AND city IN (SELECT city from #Cities))
[ 0.07095246762037277, -0.17973320186138153, 0.37455007433891296, 0.15978588163852692, 0.18759693205356598, -0.002876955084502697, 0.1296783834695816, 0.2386903017759323, -0.1665574461221695, -0.7791286110877991, -0.35752949118614197, 0.04424270614981651, -0.2693028450012207, -0.057850386947...
I am having some trouble with this regex: ``` <img(.+)src="_image/([0-9]*)/(.+)/> ``` Global and case insensitive flags is on. The problem is that it also grabs Image n (see string below), but I want it only to match the image tags in the string. ``` <p>Image 1:<img width="199" src="_image/12/label" alt=""/> Imag...
[ 0.1517440378665924, -0.0827644020318985, 0.6560956835746765, -0.2252124547958374, -0.022470686584711075, -0.18025308847427368, 0.294428288936615, -0.4523778557777405, -0.4105604290962219, -0.5767014026641846, 0.04288022220134735, 0.6698882579803467, -0.5108745098114014, -0.0565216690301895...
I have this problem. I have an handler to the mainWindow of a certain application, and I want to simulate a keypress on that application... I'm using sendMessage/postMessage api calls to do this. The reason why I don't use the .Net SendKeys function or the keybd\_event of the win32 api, is that they simulate the keypr...
[ -0.07283370941877365, -0.03170503303408623, -0.0032636357937008142, 0.0006588163087144494, 0.3138855993747711, 0.050366416573524475, 0.293253630399704, 0.11971393972635269, 0.0012711550807580352, -0.7471456527709961, 0.07582133263349533, 0.6349097490310669, -0.25739791989326477, 0.21526709...
For example, in notepad, if I send the key to the mainWindow, nothing happens, I have to send the key to the child window that basically consists of the white canvas where you can write. With msPaint for example, if a user creates a new document, and opens a textbox in that drawing, and I want to simulate a keypress t...
[ 0.012148657813668251, -0.17162957787513733, 0.29233264923095703, -0.05174171179533005, 0.1602371633052826, 0.2896813452243805, 0.07642994076013565, 0.15549802780151367, -0.103033147752285, -0.9769868850708008, 0.053296856582164764, 0.2734626531600952, -0.15988273918628693, 0.18942277133464...
the highest z-value. Then I do it again for the child window and continue doing it until a certain childWindow has no more childWindows.. And it seemed to work and I was very happy! However... I found cases where this does not work. Firefox is one of them. Firefox has the mainWindow, and then has a childWindow that's...
[ 0.14880035817623138, -0.059927672147750854, 0.779935896396637, 0.29779481887817383, 0.3744707703590393, 0.19026483595371246, -0.1507575362920761, 0.20588290691375732, -0.005603239871561527, -0.7211596965789795, -0.05782824382185936, 0.5772518515586853, -0.05054458975791931, 0.3315058946609...
search box, it works, cause getting the child-window of the child-window gives me the correct childWindow. However, if the user clicks on the address bar for example, nothing changes in the way the getWindow works. It will still eventually get the childwindow that's under the address bar, doing nothing, instead of simu...
[ 0.027905957773327827, 0.07804731279611588, 0.5116827487945557, 0.06993581354618073, 0.2256024181842804, 0.21541659533977509, 0.3841814398765564, -0.0002529261982999742, -0.06832901388406754, -0.7445126175880432, -0.002476269146427512, 0.4608648419380188, -0.07288569211959839, 0.12518641352...
window with no childs. However, as you've seen in the firefox case, the active window is actually the parent of the child window that I get in the end. I've tried other api calls like getTopWindow but I had no luck.. Anyone can put some light on this issue? Thanks! Use a non-greedy regexp: <img .*? src="\_image/(\d+...
[ -0.029149219393730164, 0.0005357739864848554, 0.4577256143093109, 0.007411562837660313, 0.22671237587928772, 0.2289922684431076, 0.12448227405548096, 0.17421503365039825, -0.10167252272367477, -0.9212441444396973, -0.2597244679927826, 0.5600426197052002, -0.2633087635040283, 0.288918763399...
``` <?php $i = 0; while(conditionals...) { if($i == 0) print "<p>Show this once</p>"; print "<p>display everytime</p>"; $i++; } ?> ``` Would this only show "Show this once" the first time and only that time, and show the "display everytime" as long as the while loop goes thru? Yes, indeed. You can also combine...
[ 0.31746554374694824, 0.047564394772052765, 0.40997663140296936, -0.40940842032432556, -0.1418216973543167, 0.01054663211107254, 0.4031599462032318, -0.26590490341186523, -0.38521191477775574, -0.6406744718551636, -0.19695580005645752, 0.4309873878955841, -0.4160626530647278, 0.045568753033...
I'm parsing XML files with something like: ``` while (<files/*.xml>) { ... } ``` I want to use a constant to 'files', say ``` use constant FILES_PATH => 'files'; while (<FILES_PATH/*.xml>) { ... } ``` I hope you understand the idea, and can help me :).. Thank you in advance. Hmm, this is one reason to use [Reado...
[ 0.4147700071334839, 0.017485491931438446, 0.38917163014411926, -0.015064559876918793, -0.13292449712753296, -0.2660984396934509, 0.2829279899597168, 0.0024363258853554726, -0.4652601182460785, -0.3988378345966339, -0.05277620628476143, 0.5976534485816956, -0.5929695963859558, 0.20264388620...
} <${[DIR]}[0]/*>; ``` But since `glob "*"` is the same as `<*>` you may prefer: ``` #!/usr/bin/perl use strict; use warnings; use constant DIR => "/tmp"; print map { "$_\n" } glob DIR . "/*"; ``` I would probably say ``` #!/usr/bin/perl use strict; use warnings; use Readonly; Readonly my $DIR => "/tmp"; p...
[ -0.06000233814120293, 0.10978400707244873, 0.5280587077140808, -0.40255847573280334, 0.16384422779083252, -0.1585865169763565, 0.18803848326206207, -0.05244962126016617, -0.2579083740711212, -0.6091368794441223, -0.35357666015625, 0.6864736676216125, -0.5943506360054016, -0.014710737392306...
This is a more direct question stemming from an earlier [more general question i had earlier](https://stackoverflow.com/questions/828356/allowing-a-user-to-create-a-custom-query-of-a-table/) now that I've spend more time looking into ADO.NET I want to take an ADO.NET DataTable and perform the equivalent of a SQL SELEC...
[ 0.15222404897212982, 0.047402527183294296, 0.4082646667957306, -0.006528070662170649, -0.30675584077835083, 0.08359826356172562, -0.09394171833992004, -0.45119717717170715, -0.39633050560951233, -0.5153893232345581, 0.06998623162508011, 0.14616981148719788, -0.5143368244171143, 0.115503810...
to create an aggregate, there would be no group-by functionality. Instead, all rows would display the same value in the column."* How do I get GROUP BY type functionality out of ADO.NET without writing my Table to a separate database and running a query there? Is there some way to do it by creating or using a second t...
[ 0.2720086872577667, 0.24978633224964142, 0.2816295921802521, 0.10794863104820251, -0.23900540173053741, -0.04125470295548439, -0.023712165653705597, -0.32107487320899963, -0.2787957191467285, -0.5268619656562805, 0.46868547797203064, 0.007547661196440458, -0.4656035006046295, 0.12387252599...
Has anyone used Flash's SharedObject mechanism for client-side persistence? Are there big gatcha's? Size limits? SharedObjects with AS3 is very easy, but yes here are a few thing to watch out for. But nothing too serious. * **Size Limit**. Yes there is a 100kb limit per site. When this limit is reached the user gets a...
[ 0.4972594976425171, 0.0752737745642662, 0.3191187381744385, -0.0032630141358822584, -0.414794385433197, -0.30915310978889465, 0.4542209804058075, 0.09858608990907669, -0.5185433030128479, -0.6729918122291565, 0.10374674201011658, 0.5281452536582947, -0.2517588436603546, 0.00790327973663807...
actually being stored in the shared object. There are many tools for this, but I would recommend [SharedObject Reader from Sephiroth](http://www.sephiroth.it/python/solreader.php). There is also a version of this that comes With FlashDevelop. * **Security**. There is *almost* no "security" with SharedObjects, they are ...
[ 0.22129498422145844, 0.18233191967010498, 0.3933386206626892, 0.057580091059207916, -0.0722251608967781, -0.19074055552482605, 0.03175676614046097, 0.14155536890029907, -0.3365558981895447, -0.8152817487716675, -0.14252102375030518, 0.3731909990310669, -0.08827997744083405, 0.1007634550333...
found that quite often my SharedObject will stop work because during development, broken data has been stored. In this case the best thing is just to delete the .SOL file and start fresh. Hope this helps. A would definitly read [HOWTO: SharedObjects for Local Storage AS3](http://drawlogic.com/2008/01/10/howto-sharedob...
[ 0.20734480023384094, 0.011291026137769222, 0.2949901819229126, -0.15849114954471588, -0.21220454573631287, -0.15232352912425995, 0.37510189414024353, 0.02503378503024578, -0.1461462676525116, -0.7273227572441101, 0.09701027721166611, 0.35783255100250244, 0.053085148334503174, 0.10634727776...
I want to write a command line program to add a contact to GoogleMail. [WWW::Contact::GoogleContact](http://search.cpan.org/dist/WWW-Contact-GoogleContactsAPI) appears only to be able to get things from Google. I think you want the [Google Data API](http://code.google.com/apis/contacts/) instead. The Contacts API is re...
[ 0.39741185307502747, 0.0528583899140358, 0.49614015221595764, 0.1327058970928192, 0.1708739548921585, -0.08795548230409622, 0.19444377720355988, 0.28246578574180603, 0.0610070526599884, -0.5039782524108887, 0.18887844681739807, 0.3679783344268799, -0.4217323660850525, 0.06542029231786728, ...
I need to implement ellipsis (`"..."`) in the middle of a text within a resizable element. [Here](http://i40.tinypic.com/29yqslf.jpg) is what it might look like. So, ``` "Lorem ipsum dolor sit amet. Ut ornare dignissim ligula sed commodo." ``` becomes ``` "Lorem ipsum dolor sit amet ... commodo." ``` When the ele...
[ 0.04457920044660568, -0.12444279342889786, 0.9316779971122742, 0.12298434972763062, -0.023947468027472496, -0.04723804444074631, 0.00561094656586647, -0.17028990387916565, -0.11347605288028717, -0.41885918378829956, -0.24556763470172882, 0.45378243923187256, -0.22152045369148254, -0.214833...
of your span tag. Here is an example of the ellipsis function: ``` function start_and_end(str) { if (str.length > 35) { return str.substr(0, 20) + '...' + str.substr(str.length-10, str.length); } return str; } ``` Adjust the values, or if possible, make them dynamic, if necessary for different objects. If ...
[ 0.42655476927757263, -0.29243987798690796, 0.9817177653312683, 0.0651366114616394, -0.09566939622163773, 0.14831145107746124, 0.05240824446082115, -0.6583744287490845, -0.23809166252613068, -0.3038400411605835, -0.13893947005271912, 0.8080440759658813, -0.20657879114151, -0.169645190238952...
the user be able to get a tooltip with the full string. ``` <abbr title="simple tool tip">something</abbr> ```
[ 0.49330955743789673, 0.0420784130692482, 0.33650141954421997, -0.08019409328699112, -0.1622411459684372, -0.3393978476524353, 0.3712313175201416, -0.20167751610279083, 0.03265984728932381, -0.5109248161315918, -0.21155217289924622, 0.7700647711753845, -0.16165216267108917, -0.2248536050319...
I need a query for SQL Server 2000 to get a list of all foreign keys. Particularly all the foreign keys that point to a particular column. How do I write this query? ``` select * from sysobjects where xtype = 'F' ``` That should do the trick and be compatible with SQL Server 2000, I hope! If you additionally need ...
[ -0.08561792969703674, 0.4155429005622864, 0.5481189489364624, -0.020058341324329376, -0.0003498061269056052, -0.055976685136556625, 0.05333484336733818, -0.06696474552154541, -0.20062190294265747, -0.6027213335037231, 0.006010206416249275, 0.5484399199485779, -0.3386840522289276, 0.1564079...
sc2.name 'referenced column' from sysobjects so inner join sysforeignkeys sf on so.id = sf.constid inner join syscolumns sc1 on sf.fkeyid = sc1.id and sf.fkey = sc1.colid inner join syscolumns sc2 on sf.rkeyid = sc2.id and sf.fkey = sc2.colid where so.xtype in ('F','PK') ``` And if you want to leverage the INFORMATIO...
[ -0.43126291036605835, 0.009020978584885597, 0.6111100316047668, 0.04879308491945267, -0.06128395348787308, 0.2611810564994812, -0.24953989684581757, -0.3166571259498596, -0.5746538043022156, -0.3969561457633972, 0.15136411786079407, 0.191495880484581, -0.3370089530944824, 0.084480322897434...
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE rcu ON rc.CONSTRAINT_CATALOG = rcu.CONSTRAINT_CATALOG AND rc.CONSTRAINT_NAME = rcu.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE rcu1 ON rc.UNIQUE_CONSTRAINT_CATALOG = rcu1.CONSTRAINT_CATALOG AND rc.UNIQUE_CONSTRAI...
[ -0.39590251445770264, 0.33414557576179504, 0.3691507577896118, -0.11593649536371231, 0.04944658279418945, 0.3839077949523926, -0.027770012617111206, -0.15256968140602112, -0.5150943398475647, -0.5531169176101685, -0.141882061958313, 0.6364251971244812, -0.45646312832832336, 0.1303758025169...
I've got an enum of types of data that might be shown in a .NET Forms control and I want to provide an interface for consumers of the control to filter some of the types (set some of the flags). A bit field seems the logical way to do this, unfortunately, the enum starts at 0 rather than 1 (0, 1, 2, 4, 8, ...) and can'...
[ 0.7228649258613586, 0.028413966298103333, 0.3306146264076233, 0.23953744769096375, -0.10334806889295578, -0.25108516216278076, -0.14707739651203156, -0.22307340800762177, 0.0008269196259789169, -0.6708250045776367, 0.09838434308767319, 0.21671903133392334, -0.3224009573459625, 0.1157197281...
and associate it with the property via `[EditorAttribute]`. **edit** now with example - a fairly long one, I'm afraid - but most of the code can be shared between types, fortunately. You can't use a single composite enum value because of the zero - so here I'm using a `HashSet<T>` to hold the selected enums - fairly ...
[ -0.0769578143954277, 0.0914367139339447, 0.4877982437610626, -0.0937100276350975, 0.10679247975349426, 0.04424562677741051, 0.307636022567749, -0.39473649859428406, -0.09401203691959381, -0.757472038269043, -0.16506536304950714, 0.39314669370651245, -0.4392702281475067, 0.189724862575531, ...
} [Editor(typeof(MyEnumSetEditor), typeof(UITypeEditor))] [TypeConverter(typeof(MyEnumSetConverter))] public HashSet<MyEnum> Values { get; set; } } public enum MyEnum { // numbers as per the question... A = 0, B = 1, C = 2, D = 4, E = 8 } class MyEnumSetEditor : EnumSetEditor<MyEnum> { } class MyEnumS...
[ -0.27558910846710205, 0.029368601739406586, 0.41340371966362, -0.014156695455312729, 0.31882673501968384, 0.22352133691310883, 0.20815053582191467, -0.5003291964530945, -0.03379156440496445, -0.5219250321388245, -0.2704353630542755, 0.3725108206272125, -0.3192797899246216, 0.25957849621772...
} public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if(destinationType == typeof(string)) { HashSet<T> set = (HashSet<T>)value; if (set == null) return "(null)"; St...
[ -0.12131383270025253, -0.25640490651130676, 0.35274267196655273, -0.09947635978460312, 0.3178652822971344, -0.14583395421504974, 0.5722341537475586, -0.39598309993743896, 0.16787609457969666, -0.39008212089538574, -0.470670610666275, 0.3679819405078888, -0.5761726498603821, 0.4018703103065...
(T item in Enum.GetValues(typeof(T))) { if (set.Contains(item)) { if (sb.Length > 0) sb.Append(", "); sb.Append(item);
[ 0.30014675855636597, -0.32775574922561646, 0.42596352100372314, -0.22139054536819458, 0.04434936121106148, 0.20509807765483856, 0.5529341697692871, -0.7917541861534119, -0.13881516456604004, -0.46491679549217224, -0.6314036250114441, 0.29288941621780396, -0.6143504977226257, 0.213954433798...
} } return sb.ToString(); } return base.ConvertTo(context, culture, value, destinationType); } } public abstract class EnumSetEditor<T> : UITypeEditor where T : struct { public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { retu...
[ 0.16708920896053314, -0.31636843085289, 0.4651997983455658, -0.06154557317495346, -0.09478577971458435, -0.14186431467533112, 0.5518134832382202, -0.3526744544506073, -0.13690294325351715, -0.4945654571056366, -0.37906840443611145, 0.5648094415664673, -0.5282697081565857, 0.133516281843185...
{ get { return true; } } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); HashSet<T> set = val...
[ -0.27521368861198425, -0.2502465844154358, 0.6652441620826721, 0.0026034938637167215, 0.037942253053188324, 0.00940287858247757, 0.6281541585922241, -0.18879179656505585, -0.10650283843278885, -0.6710191965103149, -0.40528878569602966, 0.620479166507721, -0.1800714135169983, 0.274383395910...
UserControl ctrl = new UserControl(); CheckedListBox clb = new CheckedListBox(); clb.Dock = DockStyle.Fill; Button btn = new Button(); btn.Dock = DockStyle.Bottom; foreach (T item in Enum.GetValues(typeof(T))) {
[ -0.28128716349601746, -0.3095715045928955, 0.8382055163383484, -0.3597833812236786, 0.3873476982116699, 0.27463775873184204, 0.13325093686580658, -0.21024967730045319, -0.25823163986206055, -0.5078808665275574, -0.35895082354545593, 0.7432881593704224, -0.37462911009788513, 0.1689113378524...
clb.Items.Add(item, set.Contains(item)); } ctrl.Controls.Add(clb); ctrl.Controls.Add(btn); btn.Text = "OK"; btn.Click += delegate {
[ -0.12184055894613266, 0.006739619188010693, 0.5164747834205627, 0.0932326689362526, 0.32664528489112854, -0.08945393562316895, 0.193198561668396, -0.4411095082759857, -0.461418479681015, -0.41981491446495056, -0.6394332647323608, 0.26886186003685, -0.5157038569450378, 0.28080424666404724, ...
set.Clear(); foreach (T item in clb.CheckedItems) { set.Add(item); } svc.CloseDropDown();
[ -0.14740268886089325, -0.3430217206478119, 0.5137011408805847, -0.41331911087036133, 0.28268295526504517, 0.015206188894808292, 0.3607178330421448, -0.2611105144023895, -0.09971151500940323, -0.2176312655210495, -0.7503195405006409, 0.46669450402259827, -0.4899999797344208, 0.0260140392929...
}; svc.DropDownControl(ctrl); } return value; } } ```
[ -0.18707938492298126, -0.1543642282485962, 0.47325628995895386, -0.3227490484714508, 0.35982945561408997, -0.2610760033130646, 0.20988067984580994, 0.11371097713708878, -0.17698891460895538, -0.1788633167743683, -0.6009484529495239, 0.8237548470497131, -0.24313044548034668, 0.2055716365575...
We are having issues with our SQL Server. About two times a day we have to restart our server because SQL becomes unresponsive to our web applications. It doesn't look like we have a problem with to many connections, as there are never more then 20 active at a time. The weird thing is I can access SQL from MS SQL Ente...
[ 0.300590842962265, 0.1393672078847885, 0.38104963302612305, 0.2956620156764984, 0.16850240528583527, -0.24741074442863464, 0.487423300743103, 0.17681266367435455, -0.6452694535255432, -0.573305606842041, 0.08834049105644226, 0.6977247595787048, -0.15485873818397522, 0.32337239384651184, ...
connect to DB locally OR remotely) AND a reboot restores your app to a known state then it suggests a pooling problem and/or network problem We had a similar problem that was fixed for no stated reason by upgrading to latest service pack. Our problem manifested itself in the box keeping the underlying network connecti...
[ 0.2615221440792084, -0.21558263897895813, 0.5614074468612671, 0.2727682888507843, -0.17347301542758942, -0.06559091806411743, 0.6806290149688721, -0.32759392261505127, -0.13743026554584503, -0.7095099091529846, 0.02072642743587494, 0.3775380253791809, -0.3700074553489685, 0.188541606068611...
OS level. Can you connect from the same box that hosts your web apps, but using another client app, like Query Analyzer or even bcp or isql from the command line? Another thing to wonder: if you are able to connect from a web app box, can you USE the db your app uses? If so can you do things once you are in there? W...
[ 0.046933840960264206, -0.029357319697737694, 0.3622215688228607, 0.41610464453697205, -0.05152382329106331, -0.13404428958892822, 0.0019310049246996641, 0.09582393616437912, -0.23643863201141357, -0.8587162494659424, -0.0009791140910238028, 0.7632817029953003, -0.17027315497398376, -0.0120...
Mercurial supports push-style cloning of repositories to remote hosts, however newly cloned repositories don't contain working copies. Is there any 'hidden' option to make mercurial call update upon these cloned repos? Here is an example: 1) hg init hello 2) hg clone hello ssh://somehost/hello ssh://somehost/hello...
[ -0.009303351864218712, -0.02864760346710682, 0.5548114776611328, -0.1746930181980133, 0.10784740000963211, -0.3031075596809387, 0.18815891444683075, -0.08391378074884415, 0.19905158877372742, -0.5951473712921143, -0.12809635698795319, 0.7534340023994446, -0.4373805820941925, 0.224411875009...
Note that hooks are not cloned.
[ 0.372836709022522, -0.15955714881420135, -0.3911255896091461, 0.09893988072872162, 0.2538833022117615, -0.06380631029605865, 0.059455059468746185, 0.057098813354969025, -0.4001760482788086, -0.38076162338256836, 0.08838503807783127, 0.002431334927678108, -0.44400888681411743, -0.0879806280...
My page should make notification sounds only when the window is in the background. I can track the `window.onfocus` and `window.onblur` events to notice when the focus state changes. However, I don't know whether the window will load focused or not, since it might load in a background tab, for instance. How do I decid...
[ 0.468854159116745, -0.1978032886981964, 0.64396733045578, -0.12700794637203217, 0.05777861550450325, -0.24445953965187073, 0.33594730496406555, 0.2747034728527069, -0.24735474586486816, -0.7910305261611938, -0.14516250789165497, 1.101781964302063, -0.084270179271698, 0.10421272367238998, ...
What's the difference between the two? Why would you use one over the other? Found here: <http://aaron-powell.spaces.live.com/blog/cns!91A824220E2BF369!150.entry> **DataContractJsonSerializer** The primary purpose of the DataContractJsonSerializer is to be used with WCF, since one serialization is a big focus of WCF. ...
[ 0.07220526784658432, -0.2510959208011627, 0.3041900098323822, 0.1318904459476471, -0.3224456012248993, -0.18991582095623016, 0.026064934208989143, -0.17507818341255188, -0.1825239658355713, -0.6733447909355164, 0.0316539965569973, 0.3372602164745331, -0.5401243567466736, -0.023224741220474...
properties which are serialized. Update As the above link is dead, here is another link: [http://kb.cnblogs.com/a/1454030](http://kb.cnblogs.com/a/1454030/).
[ -0.2169266939163208, 0.06674790382385254, 0.2550804913043976, 0.38493186235427856, -0.17725425958633423, -0.2624000608921051, -0.04344566911458969, 0.0925031453371048, -0.3796459138393402, -0.7280895113945007, -0.0649593323469162, 0.40682366490364075, -0.09824693948030472, 0.36097523570060...
PROBLEM SOLVED! STUPID TYPO IN MY CODE! That's my method of my UIScrollView delegate: ``` - (void)scrollViewWillBeginDragging:(UIScrollView *)activeScrollView { NSLog(@"contentOffset: %f", activeScrollView.contentOffset); } ``` Output in console is like: ``` 2009-05-06 23:04:45.731 Demo[4851:20b] contentOffset...
[ -0.08962969481945038, 0.08881578594446182, 0.6517276763916016, -0.12693510949611664, 0.02542765997350216, -0.21065278351306915, 0.4132210314273834, -0.11726955324411392, -0.16327080130577087, -0.6274896264076233, -0.044210195541381836, 0.6479665040969849, -0.4847109019756317, -0.1056702584...
I followed the Core Data tutorial at <http://macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app> The finished application displays data in an NSTableView. Is the ordering of the data persistent as well? And is there a way that you can allow drag and drop rearrangements to the order of the records...
[ -0.24467900395393372, 0.061926353722810745, 0.276517778635025, 0.17458385229110718, -0.050201643258333206, 0.3207179307937622, 0.04997306689620018, 0.05399055406451225, -0.5313985347747803, -0.44773954153060913, 0.024421315640211105, 0.45796331763267517, 0.10393528640270233, 0.139973044395...
within the managed object itself) to change the ordering as needed when new relationship objects are added or removed. To handle rearrangement, you'll want to take advantage of NSTableView's drag and drop methods and reset the order index attribute as needed. The NSTableView documentation should explain it pretty well...
[ -0.1568397581577301, -0.14429257810115814, 0.34168586134910583, 0.19542504847049713, -0.021113812923431396, 0.05085259675979614, 0.11130223423242569, -0.09055536240339279, -0.357992947101593, -0.39934805035591125, -0.21544744074344635, 0.4768344461917877, -0.4446820914745331, 0.10214868932...
I have an IE6 absolute position `div` that I want to be full screen (100% width and height). It's being used as a "loading, please wait" message while the data loads on the page. It appears that ie6 does not recognize the css of `"height:100%"`. Any work arounds? Also, in some older browsers you need to set the heigh...
[ 0.5035022497177124, 0.010661688633263111, 0.9267392158508301, -0.26696935296058655, -0.0303919930011034, -0.01039812620729208, 0.4590434730052948, 0.16614492237567902, -0.034105248749256134, -0.6286536455154419, -0.011510851792991161, 0.3919913172721863, 0.12192866951227188, -0.02017619833...
i have to create a line chart with finance information like the one in this site <http://finance.yahoo.com/> but i need information of all the countries is there a place where i can get this information updated as a web service or xml ? Are you referring to market index data of the various stock exchanges? ( DOW, TSE...
[ 0.8317714929580688, 0.02966933697462082, 0.18639066815376282, 0.18998901546001434, 0.296440064907074, -0.24988019466400146, -0.34708312153816223, 0.21933677792549133, -0.52045077085495, -0.2952856719493866, 0.17736314237117767, 0.4053826630115509, 0.13863322138786316, 0.2329193353652954, ...
I'm running a Tomcat server with some virtual hosts and I need to POST some data to a servlet on this server from another servlet on another server. Because the server that I am POSTing to uses virtual hosts just referring to this host by it's IP address will cause problem (it won't know what virtual host I'm trying to...
[ 0.22740676999092102, 0.030078016221523285, 0.2804775834083557, -0.002930434187874198, -0.02591865323483944, 0.08984352648258209, 0.45720356702804565, 0.1937219351530075, -0.42540207505226135, -0.6632493138313293, 0.1781741976737976, 0.17087845504283905, -0.4791317582130432, 0.4186499714851...
because of the requirement that a Socket be passed a InetAddress and not the host name. ``` String host = "sub.example.com"; int port = 80; String path = "/Servlet"; StringBuilder data = new StringBuilder(); data.append(URLEncoder.encode("NameA", "UTF-8")).append('=').append(URLEncoder.encode("ValueA", "UTF-8")); data...
[ 0.16499920189380646, 0.04226242005825043, 0.5641165375709534, -0.16001585125923157, -0.2467275708913803, 0.2050863653421402, 0.5561046600341797, -0.30517062544822693, -0.00502083171159029, -0.6207565069198608, -0.5494954586029053, 0.34276580810546875, -0.29744836688041687, 0.39973819255828...
I made the ultimate laugh generator using these rules. Can you implement it in your favorite language in a clever manner? ### Rules: On every iteration, the following transformations occur. ``` H -> AH A -> HA AA -> HA HH -> AH AAH -> HA HAA -> AH ``` ``` n = 0 | H n = 1 | AH n = 2 | HAAH n = 3 | AHAH n ...
[ -0.3292854130268097, 0.4537869691848755, 0.2198602855205536, -0.07222068309783936, -0.26820510625839233, 0.33451512455940247, 0.6653812527656555, -0.14327573776245117, -0.09514301270246506, -0.2797491252422333, -0.046934980899095535, 0.6520360112190247, -0.06468137353658676, -0.05929539352...
(not including formatting characters used to make it look readable) This script ("haha.m") assumes you have already defined the variable **n**: ``` s = 'H'; for i = 1:n, s = regexprep(s,'(H)(H|AA)?|(A)(AH)?','${[137-$1 $1]}'); end ``` ...and here's the one-line version: ``` s='H';for i=1:n,s = regexprep(s,'(H)(H...
[ -0.0354500412940979, 0.3918503522872925, 0.38630667328834534, -0.3299899995326996, 0.009958824142813683, 0.056802548468112946, 0.5154843330383301, -0.23628674447536469, 0.2213827222585678, -0.2902393341064453, -0.5360707640647888, 0.42937883734703064, -0.19086351990699768, -0.0218967534601...
I have a web site hosted on IIS with windows authentication. I am trying to access it in one of my iPhone web application. Presently i am using this code, but it is not working. NSString \*authString = [[[NSString stringWithFormat:@"%@:%@", @"myusername", @"mypassword"]dataUsingEncoding:NSUTF8StringEncoding] base64Enc...
[ 0.11803591996431351, 0.3307966887950897, 0.31237685680389404, -0.10537899285554886, -0.22483007609844208, -0.17767344415187836, 0.7886075973510742, -0.13067469000816345, 0.05562771111726761, -0.8706713318824768, 0.06397353857755661, 0.5566961765289307, -0.28741028904914856, 0.2591789960861...
should work. I've used a synchronous request for brevity, ideally you should use an ASINetworkQueue or NSOperationQueue to perform the request. ``` NSString *username = @"test"; NSString *password = @"test"; NSString *domain = @"test"; NSURL *url = [NSURL URLWithString:@"http://myurl"]; ASIHTTPRequest *request = [[[AS...
[ 0.20353014767169952, 0.05937795341014862, 0.5272266864776611, -0.17939068377017975, 0.0784011110663414, -0.1027681827545166, 0.5938540697097778, -0.6254787445068359, 0.033860575407743454, -0.7280293703079224, -0.11936058104038239, 0.47590717673301697, -0.06823845952749252, 0.03755121678113...
:)
[ -0.11804179102182388, 0.13728010654449463, 0.17982403934001923, 0.07065879553556442, 0.008272250182926655, 0.4008978307247162, 0.19919633865356445, -0.4948277771472931, -0.11189078539609909, 0.012069443240761757, -0.22117410600185394, 0.509800136089325, -0.22204074263572693, 0.175080463290...
I'm doing javascript on a daily basis at the moment. I'm coming from an OO background and most of the code I have contact with is somewhat procedural/OO style. I'm looking for good examples that solves more or less typical web programming tasks but in a functional manner. I'm not interested to have any arbitrary examp...
[ 0.6892618536949158, 0.3715597987174988, -0.30544576048851013, -0.02568788267672062, -0.3099743127822876, -0.1182013526558876, 0.484144926071167, 0.2607691287994385, -0.17192839086055756, -0.8148989677429199, 0.0038722611498087645, 0.6304050087928772, -0.13797256350517273, -0.24377112090587...
want to comprehend what functional programming means; that is, what are the core concepts and how well the language allows you to adhere to those concepts. For OOP, the core concepts are encapsulation, inheritance, and polymorphism (or just message passing for smalltalkers). For FP the central tenet is [referential tra...
[ -0.052487656474113464, 0.08158447593450546, 0.18125708401203156, 0.12210318446159363, -0.022048430517315865, -0.17736315727233887, 0.38935238122940063, 0.05718904733657837, -0.12743380665779114, -0.5365509390830994, -0.5868712663650513, 0.5824035406112671, -0.5590733289718628, -0.344950944...
looking for examples of code that is 'functional' just think about all the ways in which you can ensure referential transparency and this will *naturally* lead to using the FP features of the language such as lambdas, closures, higher-order functions (e.g. map, reduce, filter), currying, etc. Seriously, this is not me...
[ 0.23995304107666016, 0.0937567949295044, -0.16067169606685638, -0.1515769213438034, -0.290876179933548, -0.10889574140310287, 0.1793133169412613, -0.17403364181518555, -0.10242076218128204, -0.5198820233345032, -0.4241821765899658, 0.6470996141433716, -0.47561904788017273, -0.6710682511329...
The `?` wildcard represents unauthenticated users while `*` represents all users, authenticated and unauthenticated. My book shows the following example of URL authorization: ``` <authorization> <deny users="?" /> <allow users="dan,matthew" /> <deny users="*" /> </authorization> ``` But doesn’t the above code ...
[ 0.058651458472013474, 0.14433717727661133, 0.27721595764160156, 0.3791639506816864, 0.26523905992507935, -0.5217182636260986, 0.10987033694982529, -0.2535880208015442, -0.11694009602069855, -0.19110281765460968, -0.5042317509651184, -0.0034252700861543417, -0.2934730052947998, 0.4700170457...
``` grants access to that user. Finally, it denies access to everyone. This shakes out as everyone except dan,matthew is denied access. Edited to add: and as @Deviant points out, denying access to unauthenticated is pointless, since the last entry includes unauthenticated as well. A good blog entry discussing this t...
[ 0.04756461828947067, 0.5025652647018433, 0.3813765048980713, 0.019547106698155403, 0.03826935589313507, -0.43115970492362976, 0.5307909846305847, -0.19693335890769958, -0.2816280722618103, -0.00036960383295081556, -0.32230788469314575, -0.02010367251932621, -0.3384383022785187, 0.629122257...
Is there a keyboard shortcut for the "Connect to Server" modal window in Microsoft SQL Server Server Management Studio? The modal window that is displayed when you first opened up SQL Server Management Studio from the Start Menu or shortcut. F8 (Object Explorer), Alt + F (File Menu), E (Connect Object Explorer)
[ -0.16749121248722076, -0.2744698226451874, 0.4551544785499573, 0.13634268939495087, -0.07193079590797424, -0.018130064010620117, 0.18501773476600647, 0.1807403415441513, -0.29621848464012146, -0.6812194585800171, -0.1979023516178131, 0.62908536195755, -0.3744078278541565, 0.005413245875388...
One thing I lack understanding on is how can code compiled for an Intel CPU work on an AMD CPU. My base understanding is that if you compile C code, for example, the compiler turns the source code into machine language which will have instructions for a particular processor. So, you need to compile with a compiler for...
[ 0.447516530752182, 0.5347440838813782, -0.293783575296402, 0.3206790089607239, 0.02166435308754444, -0.1345953345298767, -0.02338830940425396, 0.169881671667099, 0.06106521189212799, -0.627677321434021, 0.03703936189413071, 0.7660455107688904, -0.420352578163147, -0.01576828397810459, -0...
I'd like to know is how do they do that? I mean, it's not like AMD or Intel are calling each other up and telling each other their trade secrets, so how can they create instruction sets that are compatible? Is all compatibility still based on the 386 instruction set, with a bunch of statements like "IF AMD CPU, do thi...
[ 0.6700880527496338, 0.308093398809433, 0.13607144355773926, 0.25515785813331604, -0.10010980069637299, -0.2712053656578064, -0.3444270193576813, 0.11639849841594696, -0.0037437905557453632, -0.4934625029563904, -0.024239754304289818, 0.5748817324638367, -0.192199245095253, 0.33756375312805...
you tell them to. Nowadays, AMD and Intel both support almost all of each other's extensions. The only time you may have to worry about the difference is when you are doing really low-level kernel stuff. By the way, the instruction set isn't really a "trade secret." The implementation is. Both companies produce docume...
[ 0.55930495262146, 0.4148646593093872, 0.16137142479419708, 0.06635177135467529, 0.32514920830726624, -0.28549742698669434, -0.20746591687202454, 0.32008737325668335, -0.16660338640213013, -0.6209660768508911, -0.2371857911348343, 0.8466152548789978, -0.07748935371637344, 0.119960255920887,...
that people will continue to buy Intel and AMD chips. Intel and AMD have very different implementations, they just execute the same code.
[ 0.6464162468910217, 0.1302778720855713, 0.21905803680419922, 0.44428834319114685, 0.26080411672592163, -0.10928727686405182, -0.18303096294403076, 0.4359133839607239, -0.09071014076471329, -0.4013579785823822, 0.07768406718969345, 0.47898125648498535, 0.09925004839897156, 0.282033026218414...
Upon reviewing a bunch of MVC style web applications, I'm noticing that it's common to have a very large service interface sitting in front of the business layer. The implementation of this interface usually includes a bunch of DAOs. So you have something like: ``` public class FoodServiceImpl implements FoodService {...
[ 0.3266144394874573, 0.033888738602399826, -0.05111578106880188, -0.3664233982563019, 0.16574734449386597, 0.47043076157569885, 0.1900758147239685, 0.0006976957083679736, -0.1950986683368683, -0.6788963079452515, -0.5995687246322632, 0.49889910221099854, -0.22551891207695007, -0.06703285872...
return fruitDAO.getFruit(); } // ... tons of methods that mostly just delegate to DAOs } ``` Assuming that your DAOs aren't concrete in the first place, why not just expose the DAOs to the next level up? So instead of: ``` // assume foodService is injected at runtime public void controllerMethod() { foodSer...
[ 0.09002243727445602, -0.028552114963531494, 0.03141985461115837, -0.05052531510591507, 0.21552444994449615, -0.04893619939684868, 0.23274730145931244, 0.1474662870168686, -0.11825758218765259, -0.7788885235786438, -0.2450684756040573, 0.29116228222846985, -0.3828296661376953, 0.10972897708...
implementation does nothing much more than delegating to DAOs. I can see that it's nice to manage all of the DAOs in one place. I can also imagine that this pattern would be useful if the same DAOs were going to be used via multiple services. Is this considered a "best practice" when starting a web application, or do...
[ 0.2712196409702301, -0.05261941999197006, 0.03179564327001572, 0.09192997962236404, 0.021348917856812477, -0.1505001038312912, 0.21089671552181244, -0.23195643723011017, -0.3327280282974243, -0.8416656255722046, -0.31682664155960083, 0.2769447863101959, -0.2362404763698578, -0.253737896680...
unit of work, a service is required to "own" the transaction. Besides, it's the essence of service oriented architecture. Forget about WS-\*; services map to use cases and business processes.
[ 0.002548239193856716, 0.10609116405248642, 0.01790492795407772, 0.2302640974521637, 0.08428048342466354, -0.05021136626601219, 0.10305856168270111, -0.1318443864583969, -0.13838404417037964, -0.6782598495483398, -0.4334832429885864, 0.3496558964252472, -0.17165078222751617, 0.4011557996273...
I have the following CSS class: ``` .hidden { visibility: hidden; position: absolute; } ``` I have div with that class on it. If I remove the class, the div doesn't show. But the second time I "remove it", the div shows. Any idea why? See a stand-alone example using YUI for this: <http://avernet.googlepages...
[ 0.046970393508672714, 0.043703582137823105, 0.2344026118516922, -0.21963651478290558, -0.28934988379478455, -0.2275542914867401, 0.33738452196121216, 0.02401299588382244, -0.14343926310539246, -0.7325066924095154, -0.10125347971916199, 0.34752851724624634, -0.18968874216079712, 0.189777135...
the implementation for the *nudge* that we are using in the Orbeon Forms code: ``` /** * Nudge element after a short delay for IE6/7 to force IE to "do the right thing". */ nudgeAferDelay: function(element) { if (YAHOO.env.ua.ie != 0 && YAHOO.env.ua.ie <= 7) { window.setTimeout(function() { e...
[ -0.026582768186926842, -0.5313721895217896, 0.5274272561073303, -0.008738073520362377, 0.2700781226158142, 0.02466392144560814, 0.2716846764087677, -0.3535732626914978, 0.03938155248761177, -0.573189914226532, -0.41979122161865234, 0.6684979200363159, -0.4168078601360321, -0.22313354909420...
I'm nearly done with a trackback system for my website, but have one last niggling regular expression I just can't get right. What I'm after is an excerpt of the referring page, where I'm defining the most relevant excerpt as: The first paragraph (marked by `<p></p>` tags) that follows either an `<h1></h1>`, `<h2></h...
[ -0.22916945815086365, 0.10209980607032776, 0.9852614998817444, -0.12007443606853485, -0.14501461386680603, -0.303221732378006, 0.3773687779903412, -0.36066824197769165, 0.09994596987962723, -0.5615818500518799, -0.6250914931297302, 0.4576965868473053, -0.10824290663003922, 0.10992638021707...
} ``` My question -- what Regular Expression can I use to fetch the string described in the first part of my post? PS: I love StackOverflow and this community -- great job, Joel & Co.! ``` Match m = Regex.Match(strHTMLSource, "^.*?</h[123]>.*?<p>(.*?)</p>", RegexOptions.Compiled | RegexOptions.IgnoreCase); str...
[ -0.2678157091140747, 0.07321807742118835, 0.37915951013565063, -0.032539043575525284, 0.07028238475322723, 0.097659632563591, 0.36739078164100647, -0.5117135643959045, -0.3522639274597168, -0.5702379941940308, -0.40599286556243896, 0.7159760594367981, -0.29834628105163574, -0.1070583090186...
I have a select statement in Oracle PL/SQL Developer that's retrieving values based on a date: ``` select * from <table> where to_date(create_date) = to_date('20090506', 'YYYYMMDD') ``` where `create_date` is of Oracle type date. This returns a non-empty set as it should. However, in ActiveRecord: ``` <Table>.find_...
[ -0.021582262590527534, 0.1237628310918808, 0.16123701632022858, -0.18246665596961975, -0.1798333376646042, -0.07488109916448593, -0.0035967149306088686, 0.1309446096420288, -0.04282788187265396, -0.41207006573677063, 0.02122851461172104, 0.40680059790611267, -0.10022427141666412, 0.2415274...
column, but it would be better if it did raise an error. So the correct solution would be (both in ORACLE! as in ActiveRecord): ``` select * from <table> where create_date = to_date('20090506', 'YYYYMMDD') ``` In short: Don't use to\_date() on a date column.
[ 0.07873132824897766, -0.00802661757916212, 0.307573527097702, -0.30696192383766174, 0.27936601638793945, -0.14611577987670898, -0.03605616092681885, 0.19492989778518677, 0.049086056649684906, -0.3510614037513733, -0.15405967831611633, 0.3611525595188141, -0.23775959014892578, 0.21368408203...
How can I bring my RubyCocoa application to the front? Basically I want to acheive the same result as the applescript line: ``` tell application "Whatever" to activate ``` In Cocoa you would bring your app forward with NSApplication's [-activateIgnoringOtherApps:](http://developer.apple.com/documentation/Cocoa/Refere...
[ 0.0761689841747284, 0.15360698103904724, 0.5150101184844971, -0.20218637585639954, -0.22949786484241486, -0.04037424921989441, 0.20776185393333435, -0.1973869353532791, -0.22609645128250122, -0.3775739371776581, -0.1835269331932068, 0.7561345100402832, -0.34582823514938354, -0.151490896940...
I just read this requirement on a job listing: > Aware of the pitfalls of code like: `User.find(:all).each` I knew instantly that I was unqualified for the job because for the life of me, I don't understand what the problem is. Is it... * design related? Should I store the database request in a variable and **then**...
[ 0.26448410749435425, 0.46125417947769165, 0.3019113540649414, -0.10768252611160278, 0.1017155721783638, -0.01818770170211792, 0.29792332649230957, -0.15191088616847992, -0.12807254493236542, -0.661341667175293, -0.008752139285206795, 0.6363700032234192, -0.27556681632995605, 0.140260666608...
looks like this: ``` User.all.each do |u| next if !u.is_active ... end ``` meaning that the filtering is happening in Ruby, after having loaded the entire contents of each of those objects from the DB, when the filtering could have been done much more efficiently by expressing the desired property as part of...
[ 0.04380837455391884, 0.11751146614551544, 0.22771498560905457, -0.2832190692424774, -0.2843581736087799, -0.2421242743730545, 0.45933595299720764, -0.30024483799934387, -0.08085742592811584, -0.6064702868461609, -0.38448354601860046, 0.1837901622056961, -0.3103228211402893, 0.1768425852060...
From what I understand of REST principles, URLs should represent a single resource, like a user or a product. How do you deal with resources that are random, or generated dynamically? Suppose I create a resource called api.example.com/integer that returns a random integer. Would I still use GET to retrieve the integer...
[ 0.4732338488101959, -0.15290150046348572, 0.18739238381385803, 0.26398158073425293, -0.11355693638324738, 0.12098024785518646, 0.11041712760925293, 0.028502637520432472, -0.5234761834144592, -0.558117151260376, 0.29037898778915405, 0.28297340869903564, -0.5071789622306824, 0.24036711454391...
is not required that all resources support all verbs. That is what the OPTIONS verb is for to find out what verbs are supported. I would say either of the following are pretty self explanatory ``` GET http://api.example.org/RandomInteger POST http://api.example.org/RandomNumberMachine ``` Either could be valid. Ju...
[ 0.4215484857559204, -0.1398257464170456, 0.28667929768562317, 0.16378739476203918, -0.5249134302139282, -0.1922982931137085, 0.15451186895370483, -0.20932306349277496, -0.2753659784793854, -0.6296716928482056, 0.024082040414214134, 0.3477685749530792, -0.3115425705909729, -0.03319071605801...
the surface it may seem pretty pedantic differentiating between an url that ends with "Add" and one that ends with "summation". However, this is a pretty simple example and the REST constraint is there to guide you towards a design that has certain desirable characteristics for distributed systems. Many years ago peop...
[ 0.34290197491645813, 0.19991184771060944, 0.184440478682518, -0.039565812796354294, -0.25286561250686646, 0.06364551931619644, -0.18108423054218292, 0.39335164427757263, -0.1914156824350357, -0.4946839511394501, 0.1831570565700531, 0.6593248248100281, -0.06268420070409775, 0.15286767482757...
What would possibly cause a 'git push' to try and commit to two branches? I have my own branch I'm working on, which is on the shared repo... and a master branch. Right now I just wanted to push to my personal branch which went through just fine, but it also tried to push to master and got rejected. Looked something li...
[ 0.04808243364095688, -0.140067458152771, 0.43995150923728943, -0.25671178102493286, -0.037345629185438156, 0.6234875321388245, 0.34953275322914124, -0.38646480441093445, -0.3533511757850647, -0.7323281764984131, -0.05510098859667778, 0.287326842546463, -0.3300713300704956, 0.13794155418872...
master -> master (non-fast forward) error: failed to push some refs to 'ssh://example.com/project.git' ``` My config looks like this: ``` remote.origin.url=ssh://example.com/project.git remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* branch.master.remote=origin branch.master.merge=refs/heads/master branch....
[ -0.16412614285945892, -0.30297261476516724, 0.4893052577972412, -0.05324579030275345, 0.062488578259944916, 0.021381773054599762, 0.0773753747344017, -0.4292362928390503, -0.23496638238430023, -0.8187710046768188, 0.09155208617448807, 0.5777766108512878, -0.16965588927268982, 0.36226487159...
branches that have a corresponding remote branch with the same name. Since your local repository has branches `master`and `mybranch`, and also the remote repository has branches `master`and `mybranch`, then Git will push both of them. If you want to push only one branch, you can say to Git explicitly that which branch...
[ -0.12118440866470337, -0.4523340165615082, 0.3665615916252136, 0.10638242959976196, 0.2008521407842636, 0.199602872133255, -0.07825307548046112, 0.3585665225982666, -0.3147415816783905, -0.6635685563087463, -0.008020278066396713, 0.20297053456306458, -0.15173786878585815, 0.559113442897796...
What is the best/easiest way to build a minimal task queue system for Linux using bash and common tools? I have a file with 9'000 lines, each line has a bash command line, the commands are completely independent. ``` command 1 > Logs/1.log command 2 > Logs/2.log command 3 > Logs/3.log ... ``` My box has more than o...
[ 0.3259340524673462, 0.2567201852798462, 0.23259301483631134, 0.11859851330518723, -0.11084990948438644, 0.19285209476947784, 0.15892791748046875, -0.1167154610157013, -0.2225787341594696, -0.7106500864028931, 0.23531560599803925, 0.44025444984436035, -0.3235360383987427, -0.095662072300910...
can interpret more than one command (e.g. `command; command`) * can interpret stream redirects on the lines (e.g. `ls > /tmp/ls.txt`) * only uses common Linux tools Bonus points if it works on other Unix-clones without too exotic requirements. Can you convert your command list to a Makefile? If so, you could just run ...
[ 0.6146612167358398, -0.40019720792770386, 0.027926964685320854, 0.08300117403268814, 0.13921746611595154, -0.05927477777004242, 0.38931071758270264, 0.12694300711154938, 0.01127720344811678, -0.6381468176841736, -0.005630745552480221, 0.49177297949790955, -0.33654919266700745, 0.1104232445...
I have a multi view application with individual UIViewControllers and xibs. I have one view that is the game view and every time I call it I want it to re-initialize, by that I mean restart at it's initial condition and not in the state I last left it in. Here is the code block I am using to load and remove views: `...
[ 0.10436403006315231, -0.07016361504793167, 0.5794898867607117, -0.08468066900968552, -0.056896429508924484, -0.0643729716539383, -0.0006044858600944281, -0.08372613042593002, -0.12388920038938522, -0.89236980676651, -0.0986795499920845, 0.811970591545105, -0.1097392737865448, 0.31899392604...
method in a UIView to programatically draw the view. I leave the UIViewController when the game ends and I go to a score screen. I want to have the user restart and go back into the game, IE load the UIViewController with the above code but start with a new game, all settings are in the method called. I could just set ...
[ 0.07063525915145874, -0.2670176327228546, 0.8243095874786377, 0.049219388514757156, 0.02054005302488804, -0.24669021368026733, 0.1865101009607315, -0.1916767656803131, 0.06889975816011429, -0.741956889629364, 0.2123783975839615, 0.4425550401210785, -0.2648935914039612, 0.17555204033851624,...
last game. To make it work I wrote a method to reset all the variables in the UIView that draws the game screen and call that method from the UIViewController in the viewDidLoad section. I assume your view is displaying some data stored in model (game state). So wouldn't you want to reset the game state and let the vi...
[ 0.14044208824634552, -0.20868860185146332, 0.40110865235328674, 0.03379152715206146, 0.12920774519443512, 0.014977173879742622, 0.08059407770633698, -0.21689583361148834, -0.30408743023872375, -0.5840611457824707, 0.014441955834627151, 0.8712344765663147, -0.1734197735786438, 0.25910067558...
the view display it. What do you mean my "calling the view"? Do you mean when you go from a 'menu' to 'a game screen'? Maybe re-loading the game state after the view is displayed would help. There are some delegates like **viewDidLoad** but my understanding is that they are being called after the view is loaded. Howe...
[ 0.41962572932243347, -0.03423747047781944, 0.3451308608055115, 0.18677841126918793, -0.200521782040596, 0.004082998260855675, 0.032200515270233154, -0.046730510890483856, -0.29548966884613037, -0.6343070268630981, 0.03196683153510094, 0.7779321670532227, -0.08617863804101944, 0.59684371948...
meant my 'calling the view'.
[ 0.4800814688205719, 0.1675802767276764, 0.17187894880771637, -0.38506269454956055, -0.2855420708656311, -0.10215669125318527, 0.3115493953227997, 0.2616041302680969, -0.05067816376686096, 0.00857688207179308, 0.0643928274512291, 0.5419460535049438, -0.0189716387540102, 0.25702834129333496,...
I have a database that I have created using SQL Server Developer 2008. I want to script it to a file so that it can be recreated by anyone at any time. Any Ideas? To recreate the structure, right-click on the database and use Tasks --> Generate Scripts. Walk your way through the wizard, selecting those objects that y...
[ 0.6164907813072205, 0.17382895946502686, -0.0015137792797759175, 0.1803838312625885, 0.029535450041294098, -0.2390788048505783, 0.14050674438476562, 0.1328224390745163, -0.102164626121521, -0.7418989539146423, 0.13589587807655334, 0.457132488489151, -0.06064554676413536, 0.2641109526157379...
Packager](http://www.red-gate.com/products/SQL_Packager/index.htm) to script the data.
[ -0.06478799879550934, -0.02524249628186226, 0.4731983542442322, -0.1982668787240982, -0.09903781116008759, 0.029910068958997726, -0.2447556108236313, -0.5405644774436951, -0.06641381978988647, -0.23726564645767212, -0.15257908403873444, 0.21154376864433289, -0.5117833614349365, -0.00930342...