text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I am writing a program that needs to search a LARGE text document for a large collection of words. The words are all file names, with underscores in them (eg, this\_file\_name). I know how to open and iterate through a text document, but I'm curious whether I should use Regex to search for these names, and if so, what ...
[ 0.1246727854013443, 0.47163277864456177, 0.2827976942062378, -0.14577028155326843, 0.09159063547849655, 0.2185080200433731, 0.40675273537635803, -0.047056637704372406, -0.09449994564056396, -0.6381199359893799, -0.28045350313186646, 0.3791973888874054, -0.242405965924263, 0.140552014112472...
asddf jsadf asdfj;lksdajf sdafjkl;sjdfaas sadfj;lksadf sadf jsdaf jf sda sdaf asdf sad jasfd sdf sadf sadf sdajlk;asdf this_file_name asdfsadf asdf asdf asdf asdf sadf asdfj asdf sdaf sadfsadf sadf asdf this_file_name asdf asdf "; var reg = new Regex("this_file_name", RegexOptions.IgnoreCase | RegexOptions.Multiline...
[ -0.05676848813891411, -0.1451692134141922, 0.5321114659309387, -0.13916683197021484, -0.5577266812324524, 0.1919187754392624, 0.6205406188964844, -0.5018231868743896, -0.3777894079685211, -0.5702724456787109, -0.6992596387863159, 0.4725225269794464, -0.6086559891700745, 0.31863823533058167...
I want to shift away from Excel to Awk. I need basic mathematical operations, such as addition and division, for arrays. For example, arrays A and B are [1, 3, 2] and [2, 1, 2], respectively. How can I get an array [2, 3, 4] from the multiplication between A and B? What about the addition and division between A and B...
[ 0.15988576412200928, 0.0030899127013981342, -0.12084564566612244, -0.0003105212817899883, -0.3903765082359314, 0.14769750833511353, 0.21474304795265198, -0.23891858756542206, 0.08455408364534378, -0.5623795390129089, 0.06828507035970688, 0.3180235028266907, -0.31051939725875854, -0.0249085...
&& j<length(B); j++) C[j] = A[j] * B[j] ``` It's like a hash-map. So, in awk you can do ``` A[100] = 10; A[1] = 2; ``` And have only 2 elements stored in that array (elements from 2 to 99 do not exist), indexed by strings that are created by converting the numbers 100 and 1. The GNU Awk manual has a nice secti...
[ 0.3189539909362793, 0.05473456159234047, 0.18821924924850464, -0.11005519330501556, -0.30383720993995667, 0.13164827227592468, 0.22366857528686523, -0.46019256114959717, -0.006234117783606052, -0.4006633162498474, 0.1726970225572586, 0.3671584725379944, -0.3001052439212799, -0.080899067223...
Are they sufficient in terms of security for use in a public site? OR so I need to make modifications? Are you asking about the membership and role providers or the skeleton controller actions and view? The membership and role providers certainly support secure storage for passwords and allow you to secure your applica...
[ 0.5697208046913147, 0.10282829403877258, 0.07001182436943054, 0.24192072451114655, 0.09571576863527298, -0.06465262174606323, 0.22872807085514069, -0.05831776186823845, -0.42787766456604004, -0.2916586697101593, 0.18664845824241638, 0.6629538536071777, -0.00037818404962308705, -0.232703238...
one thing you may want to set things up to require secure connections when transmitting passwords. If you choose to redirect afterwards to a non-secure connection, you'll need to manually manipulate the redirect url since the default routing doesn't support (or at least didn't in MVC Beta) changing back from secure to ...
[ 0.1137872040271759, -0.1468619555234909, 0.47910940647125244, 0.3231267035007477, 0.2829594314098358, -0.41751912236213684, 0.046513523906469345, -0.08285362273454666, -0.20008982717990875, -0.68178790807724, -0.07582379877567291, 0.4398385286331177, -0.19918939471244812, 0.130603015422821...
your security requirements.
[ 0.3373963236808777, 0.35167789459228516, 0.23185735940933228, 0.015634730458259583, 0.3184460699558258, -0.2630629539489746, 0.2047598958015442, -0.2930375039577484, -0.2972145974636078, -0.3181535303592682, -0.2010907530784607, 0.5933559536933899, -0.14015083014965057, -0.1995975524187088...
Today, for the first time in 10 years of development with sql server I used a cross join in a production query. I needed to pad a result set to a report and found that a cross join between two tables with a creative where clause was a good solution. I was wondering what use has anyone found in production code for the c...
[ 0.5350547432899475, 0.2577487826347351, -0.005935186520218849, -0.14119423925876617, 0.10326194763183594, -0.3252437710762024, 0.1921239048242569, 0.07684449106454849, -0.08331756293773651, -0.7096318602561951, 0.164890319108963, 0.3165712058544159, -0.008560612797737122, 0.015436342917382...
I was excited to have finally used it (I'm such a nerd) - sort of like the time I first used a full outer join. Thanks to everyone for the answers! Here's how I used the cross join: ``` SELECT CLASS, [Trans-Date] as Trans_Date, SUM(CASE TRANS WHEN 'SCR' THEN [Std-Labor-Value] WHEN 'S+' THEN [Std-Labor-Val...
[ -0.06601452827453613, -0.3329133987426758, 0.324441522359848, -0.10738781094551086, -0.13155467808246613, 0.4228622615337372, -0.06456712633371353, 0.22939713299274445, -0.26812663674354553, -0.49874716997146606, -0.17802363634109497, 0.07674622535705566, -0.0018686754629015923, 0.44515454...
THEN [Std-Material-Value] WHEN 'S+' THEN [Std-Material-Value] WHEN 'S-' THEN [Std-Material-Value] WHEN 'SAL' THEN [Std-Material-Value] ELSE 0 END) AS [MATERIAL SCRAP], SUM(CASE TRANS WHEN 'RWK' THEN [Act-Labor-Value] ELSE 0 END) AS [LABOR REWORK], SUM(CASE TRANS WHEN 'PRD' THEN [Act-Labor-...
[ 0.005735455546528101, -0.08198578655719757, 0.2526995539665222, 0.1535862684249878, -0.0751931294798851, 1.0272548198699951, -0.29940465092658997, -0.26120442152023315, -0.3025069236755371, -0.4438857138156891, -0.457409530878067, 0.5072609782218933, 0.08659622073173523, 0.5816252827644348...
WHEN 'TRN' THEN [Std-Labor-Value] ELSE 0 END) AS [STANDARD LABOR], SUM(CASE TRANS WHEN 'PRD' THEN [Act-Labor-Value] - [Std-Labor-Value] WHEN 'TRN' THEN [Act-Labor-Value] - [Std-Labor-Value] --WHEN 'RWK' THEN [Act-Labor-Value] ELSE 0 END) -- - SUM([Std-Labor-Value]) -- - SUM(CASE TRANS WH...
[ 0.08566264063119888, -0.47183722257614136, 0.3531903326511383, 0.16141028702259064, 0.09380856901407242, 0.7974190711975098, -0.13210143148899078, -0.5179605484008789, -0.1995830088853836, -0.42779049277305603, -0.20063516497612, 0.43873652815818787, 0.01059532631188631, 0.4590611755847931...
'~ALL' THEN CLASS ELSE @class END) GROUP BY [Trans-Date], CLASS UNION --REL 2/6/09 Pad result set with any missing dates for each class. select distinct [Description] as class, cast([Date] as datetime) as [Trans-Date], 0,0,0,0,0,0 FROM Calendar_To_Fiscal cross join PRMS.Product_Class where cast([Date] as datetime)...
[ 0.08302424103021622, -0.2890084385871887, 0.8195081949234009, 0.1773349642753601, 0.2923073172569275, 0.4754009544849396, -0.10771863162517548, -0.19676795601844788, -0.1290014684200287, -0.6451869010925293, -0.276533305644989, 0.21989555656909943, -0.043476883322000504, 0.6307908296585083...
and vl.class= PRMS.Product_Class.[Description] GROUP BY [Trans-Date], CLASS) order by [Trans-Date], CLASS ``` One use I've come across a lot is splitting records out into several records, mainly for reporting purposes. Imagine a string where each character represents some event during the correspondin...
[ 0.2395811378955841, -0.12009664624929428, 0.4267094135284424, 0.23303396999835968, 0.010966159403324127, 0.07270462810993195, 0.05075328052043915, -0.19017180800437927, -0.6660199165344238, -0.518875777721405, 0.023325784131884575, 0.39910393953323364, -0.19718854129314423, 0.2468557655811...
table of IDs 1 to 24, then work your magic... ``` SELECT [hour].id, SUM(CASE WHEN SUBSTRING([data].string, [hour].id, 1) = 'X' THEN 1 ELSE 0 END) FROM [data] CROSS JOIN [hours] GROUP BY [hours].id ``` => ``` 1, 0 2, 0 3, 0 4, 2 5, 0 6, 2 7, 0 8, 1 9, 0 10, 2 11, 0 12, 0 13, 2 14, 1 15, 0 16,...
[ 0.3355618715286255, 0.30506375432014465, 0.5403217077255249, -0.11657290905714035, 0.21031391620635986, 0.36065673828125, 0.2418946623802185, -0.6265609264373779, -0.2685372233390808, -0.5351982712745667, 0.010687490925192833, 0.2734667956829071, -0.1927565485239029, -0.015450629405677319,...
I have a J2EE web-application running on Sun hardware with `OpenSolaris/Glassfish` stack. We're starting our performance bench-marking tests, to prepare for our scalability requirements later. Any guidelines/best practices would be very useful.. I'm sure there is many generic ways to test server performance to be foun...
[ 0.40538570284843445, 0.021148012951016426, 0.13051313161849976, 0.3063856363296509, 0.0617264062166214, -0.49363306164741516, 0.0480746291577816, -0.03878496214747429, -0.0656573623418808, -0.6896343231201172, 0.1483483463525772, 0.5425164103507996, 0.04708008095622063, -0.1765322536230087...
I think this is the spirit of [agile development](http://en.wikipedia.org/wiki/Agile_software_development).
[ 0.6007974743843079, 0.31368258595466614, -0.08882585912942886, -0.23337534070014954, -0.03188367560505867, -0.35922837257385254, 0.11968208849430084, 0.30669131875038147, -0.06944561749696732, -0.36453285813331604, -0.08385097980499268, 0.551279604434967, 0.3509926199913025, 0.168384939432...
This is one of those things, that maybe so simple I'll never find it because everyone else already knows it. I've got objects I have to check for nil in my views so I don't dereference a nil: ``` <%= if tax_payment.user; tax_payment.user.name; end %> ``` Or I could do this variant: ``` <%= tax_payment.user ? tax_p...
[ -0.10195143520832062, 0.45978352427482605, 0.2658790647983551, -0.10849570482969284, -0.3835580050945282, 0.013562757521867752, 0.46219050884246826, 0.27446481585502625, -0.2727893590927124, -0.4711144268512726, -0.354670912027359, 0.3411656618118286, -0.03127654269337654, -0.2474488615989...
Is there a way to do `foreach` style iteration over parallel enumerables in C#? For subscriptable lists, I know one could use a regular `for` loop iterating an int over the index range, but I really prefer `foreach` to `for` for a number of reasons. Bonus points if it works in C# 2.0 Short answer, no. `foreach` works ...
[ 0.23366929590702057, 0.09554241597652435, 0.07055304944515228, 0.05704708769917488, -0.25393709540367126, 0.15320372581481934, 0.14845800399780273, -0.1889241635799408, -0.31266123056411743, -0.6497132778167725, 0.14746534824371338, 0.5020782351493835, -0.31210681796073914, -0.218086138367...
not tested it): ``` public IEnumerable<TSource[]> Combine<TSource>(params object[] sources) { foreach(var o in sources) { // Choose your own exception if(!(o is IEnumerable<TSource>)) throw new Exception(); } var enums = sources.Select(s => ((IEnumerable<TSource>)s).GetEnumerat...
[ 0.29185014963150024, -0.028354257345199585, 0.2718437612056732, -0.008797360584139824, 0.23046571016311646, 0.07677023112773895, 0.5200856924057007, -0.6100248694419861, -0.1250312328338623, -0.326047420501709, -0.2500780522823334, 0.2994493544101715, -0.3072509467601776, 0.108041197061538...
over the returned enumerable: ``` foreach(var v in Combine(en1, en2, en3)) { // Remembering that v is an array of the type contained in en1, // en2 and en3. } ```
[ 0.0922553539276123, 0.12172821164131165, 0.1934594213962555, -0.27213984727859497, -0.09518186748027802, 0.21794217824935913, 0.24203750491142273, -0.5562601089477539, 0.04579349234700203, -0.4511550962924957, -0.2960537374019623, 0.4810836613178253, -0.30441853404045105, -0.09936210513114...
I am using GDI+ on the server-side to create an image which is streamed to the user's browser. None of the standard fonts fit my requirements and so I want to load a TrueType font and use this font for drawing my strings to the graphics object: ``` using (var backgroundImage = new Bitmap(backgroundPath)) using (var av...
[ 0.34531348943710327, -0.19805188477039337, 0.9108116626739502, -0.28112512826919556, -0.25990888476371765, 0.4177953600883484, 0.26568731665611267, -0.17219924926757812, -0.06559046357870102, -0.9912790060043335, -0.05958331376314163, 0.6493041515350342, -0.36525875329971313, 0.00159605371...
represents a font that is not installed on the server, but for which I have the TTF file for. How can I load the TTF file so that I can use it in GDI+ string rendering? I've found a solution to using custom fonts. ``` // 'PrivateFontCollection' is in the 'System.Drawing.Text' namespace var foo = new PrivateFontCollec...
[ 0.0991271436214447, 0.11001427471637726, 0.8943752646446228, -0.14869056642055511, -0.024156706407666206, 0.2920573949813843, 0.1328408122062683, -0.2079838067293167, -0.1334521472454071, -0.8216235637664795, 0.03400649130344391, 0.5708242654800415, -0.35509514808654785, -0.004307455383241...
Well I am using the following code to redirect users who don't have my IP to a coming soon page: ``` rewritebase / rewritecond %{REMOTE_HOST} !(^1\.2\.3\.4) rewritecond %{REQUEST_URI} !/comingsoon\.html$ rewriterule .* http://www.andrew-g-johnson.com/comingsoon.html [R=302,L] ``` I want to make it so that I have tw...
[ -0.18671898543834686, 0.07609625905752182, 0.9255936145782471, -0.07337919622659683, 0.1541920304298401, -0.0859578475356102, 0.1824589967727661, 0.10977590829133987, -0.14981277287006378, -0.9345342516899109, -0.037830136716365814, 0.4024214744567871, -0.24349896609783173, 0.2129600793123...
I know at first glance (due to the title) this looks like one of the "Did you try searching Google before posting?" questions, but I can't seem to find an answer for the specific issue I'm experiencing. Sorry if I'm a noob.... still learning :) I need to simulate a pause in javascript, but the setTimeout(function\_cal...
[ 0.2718568742275238, -0.06395915895700455, 0.3858928680419922, -0.02966258116066456, 0.18749353289604187, -0.1846270114183426, 0.21725253760814667, 0.282745361328125, -0.14859427511692047, -0.4189073145389557, -0.07215327024459839, 0.3681051731109619, -0.05708160251379013, 0.248566955327987...
if a person is actually typing a message while the user is viewing the page. Since the timeout is a random interval and the function call is made asynchronously, the text ends up being printed in a random order. Here is a snippet of what I have thus far: ``` typeString: function(s) { for(var i=0;i<s.length;i++) ...
[ 0.28112491965293884, -0.17359064519405365, 0.44436997175216675, -0.14314165711402893, 0.053983137011528015, 0.23892395198345184, 0.3662906289100647, -0.1474936157464981, -0.0995372012257576, -0.581982433795929, -0.4016212522983551, 0.23835305869579315, -0.1844138652086258, -0.1025563701987...
= setTimeout("MessageType.typeChar('" + c + "')", this.genRandomTime()); } } ``` Thanks in advance for your help. CJAM UPDATE: By adding the timer delay to a varialbe, it enabled me to offset timeOut for the asynchronous calls. Thank you all for your quick responses. Here is the updated code: ``` typeString: f...
[ 0.26466214656829834, -0.5117977261543274, 0.7084442973136902, -0.24584364891052246, 0.04734550043940544, 0.21876122057437897, 0.503510057926178, -0.5160847902297974, -0.39348265528678894, -0.41946372389793396, -0.3683042824268341, 0.6418175101280212, -0.4125978946685791, 0.2577353417873382...
setTimeout("GoogleTyper.typeChar('"+c+"')", delay += this.genRandomTime()); } } ``` Have you tried cumulatively setting the timeout? Stick a variable outside of your loop and initialize it to 0. Let's call it timeout for now. Add a random amount of time to this variable at the beginning of each iteration of your l...
[ 0.450080931186676, -0.43381351232528687, 0.41920995712280273, -0.18519914150238037, 0.25065067410469055, -0.15880675613880157, 0.08520614355802536, -0.340353399515152, -0.2253037393093109, -0.49559512734413147, 0.16944114863872528, 0.6903735399246216, -0.502845048904419, 0.0227950755506753...
For one of my projects, I need to generate at run time some classes, and I thought it would be fairly simple to do using Reflection.Emit, but I'm getting MemberAccessExceptions when I run some of the generated code that calls methods that are marked internal in the generator assembly. Is there any way to tell the runti...
[ 0.42628955841064453, 0.19319917261600494, -0.15887390077114105, 0.04240420088171959, -0.151675283908844, -0.2099044919013977, 0.27861836552619934, 0.11532265692949295, -0.2711464762687683, -0.3432043492794037, 0.16615232825279236, 0.5445032119750977, 0.01832905411720276, 0.1413273513317108...
of dynamically generated assemblies. Is this even possible? `InternalsVisibleTo` works by opening an assembly to others. So if you want to use assembly `Foo` from your generated types, you must specify the name of the generated assembly in `AssemblyInfo.cs` for `Foo`. If you're emitting a new assembly using the `Assem...
[ 0.37053415179252625, -0.016620013862848282, 0.19060295820236206, -0.0841633602976799, -0.08022762089967728, -0.14856679737567902, 0.20672959089279175, 0.10677625238895416, -0.3585954010486603, -0.3188069462776184, -0.2115701138973236, 0.5408195853233337, -0.6933935284614563, 0.131119474768...
I would like to use Kdevelep as a Ruby on Rails IDE as I'm using Linux. How do I set up Kdevelop to enable this? You could use Kdevelop or Kate, although I don't know that there is a big community of support for these editors. If you are on Linux you are best to check out VIM, it's the 2nd most popular editor for Ruby/...
[ 0.15208697319030762, -0.09955766797065735, 0.29309535026550293, 0.1591258943080902, -0.4309892952442169, -0.29847022891044617, 0.39732471108436584, 0.14238297939300537, -0.18555611371994019, -0.7515544891357422, 0.263949990272522, 0.7358648777008057, -0.23262785375118256, 0.478584229946136...
I have a sql table which have the following data, ``` Id City Country --- ------ ------------ 1 Delhi India 2 New York United States 3 Karachi Pakistan 4 Mumbai India 5 Lahore Pakistan 6 Kanpur India 7 Delhi India 8 Mumbai India ``` Now, I want to display th...
[ 0.2754480540752411, -0.2987957000732422, 0.45383647084236145, 0.4595794975757599, 0.10813538730144501, 0.06856090575456619, 0.021866822615265846, 0.6346204876899719, -0.05409634858369827, -0.5988655090332031, -0.009094872511923313, -0.22145964205265045, -0.44284868240356445, 0.507121443748...
web app as displayed below; ``` India Delhi (2) Mumbai (2) Kanpur (1) United States New York (1) Pakistan Karachi (1) Lahore (1) ``` Please tell me: * The SQL query which will fetch the data as I want. I want City, Country and Count (grouping of all cities) * And how to display the fetched data in th...
[ 0.360289990901947, -0.37824466824531555, 0.7127166390419006, 0.5674768686294556, -0.012935074977576733, 0.24058541655540466, 0.1942616105079651, 0.6625540852546692, -0.4583885967731476, -0.644402027130127, -0.3726668655872345, -0.2534078061580658, -0.478928804397583, 0.2684412896633148, ...
for this. Your SQL should be ``` select country,city,count(city) from dbo.location group by country,city order by country ``` Then use datarepeter to display your data. Follow this [link](http://www.eggheadcafe.com/tutorials/aspnet/d89d1d96-03f1-4784-bbb2-a3db1af393f5/aspnet-datalist-and-data.aspx)
[ 0.20804940164089203, 0.05492258444428444, 0.45577526092529297, 0.174886554479599, -0.03830043226480484, -0.07277523726224899, 0.053903914988040924, -0.053425610065460205, -0.3510318994522095, -0.4354339838027954, -0.09377112239599228, -0.2948343753814697, -0.07131557911634445, 0.1765896379...
When I run the following jQuery animation sequence: ``` $('#task').animate({ backgroundColor: fadeColor }, 50) .animate({ opacity: 1.0 }, 1000) .animate({ backgroundColor: originalBG }, 1000); ``` It leaves unneeded styles on my table row when complete (below) ``` <tr id="task29" onclick="TaskEd...
[ 0.25038328766822815, -0.15633025765419006, 0.6064786314964294, -0.27571433782577515, -0.1486223340034485, 0.19232603907585144, 0.3267199695110321, -0.2766263782978058, 0.07740382105112076, -0.7101333737373352, -0.11247960478067398, 0.5999260544776917, -0.33071446418762207, -0.0449750497937...
Any other ideas? For what you want to do i think is more appropriate to use jquery UI and pulsate/highlight effect :)
[ 0.4926278293132782, -0.31497570872306824, 0.3993587791919708, 0.2617201507091522, -0.03314964100718498, -0.19151566922664642, -0.1309511363506317, 0.3208610713481903, -0.25546136498451233, -0.5952032804489136, -0.1560443788766861, 0.3981996476650238, 0.1618790179491043, -0.3797566592693329...
How do I accomplish a simple redirect (e.g. `cflocation` in ColdFusion, or `header(location:http://)` for PHP) in Django? It's simple: ``` from django.http import HttpResponseRedirect def myview(request): ... return HttpResponseRedirect("/path/") ``` More info in the [official Django docs](https://docs.djan...
[ 0.10354135930538177, 0.29320937395095825, 0.7116644978523254, -0.3302168548107147, -0.3385673761367798, -0.18558065593242645, 0.24057969450950623, -0.40112975239753723, -0.3489376902580261, -0.25855380296707153, -0.013645288534462452, 0.45515176653862, -0.21964696049690247, 0.1110947951674...
[Yonatan](https://stackoverflow.com/users/221917/yonatan) ``` from django.views.generic import RedirectView urlpatterns = patterns('', (r'^one/$', RedirectView.as_view(url='/another/')), ) ```
[ 0.21418902277946472, 0.1508127748966217, 0.2995879352092743, -0.33944982290267944, -0.27591070532798767, 0.023162133991718292, 0.19091518223285675, 0.030079087242484093, -0.4299403131008148, -0.39559081196784973, -0.3060733675956726, 0.5613899230957031, -0.271212100982666, 0.21649834513664...
I am trying to find a simple way to layout a 3 pane window using wxPython. I want to have a tree list in the left pane, then have a right pane that is split into two - with an edit component in the top part and a grid component in the bottom part. Something along the lines of: ``` ----------------------------------...
[ 0.2570132911205292, 0.027422813698649406, 0.26442083716392517, -0.24058587849140167, -0.09253744781017303, 0.35413244366645813, 0.18482543528079987, -0.03939797356724739, -0.06406810879707336, -0.9545581340789795, -0.026174606755375862, 0.19907015562057495, -0.3696456551551819, 0.288461953...
| Edit | | Tree | Control | | Control | | | |----------------------| |
[ -0.7307714819908142, -0.008187343366444111, 0.3838809132575989, 0.23023757338523865, 0.15644508600234985, 0.2674959897994995, 0.276968777179718, -0.20887970924377441, -0.12158568203449249, -0.3247859477996826, -0.44766390323638916, 0.06221483647823334, -0.35571062564849854, 0.0898071676492...
| | | | Grid | | | | -------------------------------------- ``` I would like the window to be re-sizable and give the user
[ 0.02081604115664959, 0.274086594581604, 0.4059676229953766, -0.16936910152435303, 0.06929654628038406, 0.060284122824668884, 0.2573394775390625, 0.12532001733779907, 0.05601920187473297, -0.8881860971450806, -0.1391076296567917, 0.2792070209980011, -0.15147031843662262, 0.3080013692378998,...
the ability to change the (relative) size of each of the components within the windows by dragging the borders. I figure that I need some combination of sizers and/or splitter-window components but can't find a decent example of this kind of window in the documentation or on the web. First of all download [wxGlade](ht...
[ -0.01017044112086296, -0.29527848958969116, 0.6323884129524231, 0.10091017931699753, -0.22288036346435547, -0.013354720547795296, -0.0509975366294384, -0.2714044153690338, -0.2999674677848816, -0.9091019034385681, -0.11204636842012405, 0.629210352897644, -0.1236037090420723, 0.048592489212...
a Sizer (manual Resize). Regards. one minute work without entering a single line of code: ``` #!/usr/bin/env python # -*- coding: utf-8 -*- # generated by wxGlade 0.6.3 on Sat Feb 07 10:02:31 2009 import wx import wx.grid # begin wxGlade: extracode # end wxGlade class MyDialog(wx.Dialog): def __init__(self, ...
[ -0.19504424929618835, -0.3118577003479004, 0.986587405204773, 0.0960918590426445, -0.1566542536020279, 0.3621234893798828, 0.04102940112352371, -0.6150311827659607, -0.41783151030540466, -0.694686233997345, -0.3250761032104492, 0.29060065746307373, -0.31197094917297363, 0.01145338639616966...
self.text_ctrl_1 = wx.TextCtrl(self.window_1, -1, "This is the Edit", style=wx.TE_MULTILINE) self.grid_1 = wx.grid.Grid(self.window_1, -1, size=(1, 1)) self.__set_properties() self.__do_layout() # end wxGlade def __set_properties(self): # begin wxGlade: MyDialog.__set_prope...
[ -0.03562270477414131, 0.19977720081806183, 0.7235719561576843, -0.34237736463546753, -0.14007256925106049, -0.0844232365489006, 0.27893099188804626, -0.46860700845718384, 0.06142392382025719, -1.203330159187317, -0.01274128071963787, 0.5913708806037903, -0.5674795508384705, -0.086956456303...
def __do_layout(self): # begin wxGlade: MyDialog.__do_layout grid_sizer_1 = wx.FlexGridSizer(1, 2, 3, 3) grid_sizer_1.Add(self.tree_ctrl_1, 1, wx.EXPAND, 0) self.window_1.SplitHorizontally(self.text_ctrl_1, self.grid_1) grid_sizer_1.Add(self.window_1, 1, wx.EXPAND, 0) sel...
[ 0.05819141864776611, -0.20240062475204468, 0.5594897866249084, -0.36799708008766174, -0.097332663834095, 0.07385832816362381, 0.10833311080932617, -0.4684910178184509, -0.3949122130870819, -0.8241679668426514, -0.4008868634700775, 0.6704013347625732, -0.4345148801803589, -0.145595699548721...
self.Layout() # end wxGlade # end of class MyDialog class MyApp(wx.App): def OnInit(self): wx.InitAllImageHandlers() mainDlg = MyDialog(None, -1, "") self.SetTopWindow(mainDlg) mainDlg.Show() return 1 # end of class MyApp if __name__ == "__main__": app = MyApp...
[ -0.21790234744548798, 0.19830326735973358, 0.8361073136329651, -0.32271191477775574, -0.028113653883337975, 0.2354760468006134, 0.5189210772514343, -0.20902718603610992, -0.21875117719173431, -0.9110649824142456, -0.23027749359607697, 0.40010806918144226, -0.6097216606140137, 0.21240548789...
I have a program that I would like to run on just one CPU so it doesn't take up too much system resources. The problem is, it makes a call into an external DLL that automatically uses all available CPU cores. I do not have the source code to the external DLL. How can I limit the DLL to only using one CPU? EDIT: Thanks...
[ 0.11903958022594452, 0.04891654849052429, 0.5194417238235474, 0.015354477800428867, 0.24085189402103424, 0.07671608775854111, 0.28525957465171814, -0.14121592044830322, -0.23393389582633972, -0.8449634313583374, -0.0845842957496643, 0.5337806344032288, -0.4242713153362274, 0.30485716462135...
&& SystemAffinityMask != 0) { // Limit to 1 thread by masking all but 1 bit of the system affinity mask DWORD NewProcessAffinityMask = ((SystemAffinityMask-1) ^ SystemAffinityMask) & SystemAffinityMask; SetProcessAffinityMask(ProcessHandle,NewProcessAffinityMask); } ``` EDIT: Turns out Brannon's approach ...
[ -0.15450836718082428, -0.20063383877277374, 0.5754923820495605, -0.17199312150478363, 0.2744840979576111, 0.08345220237970352, 0.1998794972896576, -0.3459843397140503, -0.33562612533569336, -0.6593558192253113, -0.07327581942081451, 0.6491963863372803, -0.5111566185951233, 0.34936031699180...
want to use as much processor as you can. Otherwise you're doing less work for no reason. If the machine is busy, then you want to make use of "free" cycles and not adversely affect other processes. Windows has this functionality built-in. The proper solution for this is to set the base priority of the process. See <...
[ 0.3981904685497284, -0.3213442862033844, 0.21626979112625122, 0.22184951603412628, 0.04555250331759453, 0.012285801582038403, 0.0196896530687809, -0.14026762545108795, -0.5958002805709839, -0.605360209941864, -0.12100863456726074, 0.48141664266586304, -0.2283610701560974, 0.079079978168010...
Example Interface: ``` public Interface IEntity Property ID() as Integer end Interface ``` I want all my EF objects to implement this interface on there Primary Keys. Is this possible? This seems very easy to do in CSharp but in VB you have to specifically declare which Properties/Functions/Subs are Implementi...
[ -0.23686692118644714, 0.040468260645866394, 0.5187258124351501, 0.07718464732170105, -0.3324124813079834, 0.014321058057248592, 0.03228474408388138, -0.20898130536079407, -0.08581210672855377, -0.9280416965484619, 0.07466155290603638, 0.49284809827804565, -0.47313329577445984, 0.2250794917...
Could anyone give me a small and simple example of how to do this? Or some good pointers on how to get started. I would like to create a C# client that can send a file or some text or xml or whatever, to a web service or something similar written in PHP, where the PHP Web Service stores it in a file or a database or s...
[ 0.6103469729423523, 0.060394905507564545, 0.002120804041624069, 0.5311293601989746, -0.015561116859316826, -0.08626971393823624, -0.08778727054595947, 0.3761821687221527, -0.2522669732570648, -0.48153162002563477, 0.5031230449676514, 0.5245565176010132, 0.06352714449167252, -0.077262334525...
in C#, since I could probably pretty much use the "Add Web Reference" button in vs and then go from there? You can take a look at this [tutorial](http://www.onlamp.com/pub/a/php/2007/07/26/php-web-services.html?page=1) showing how to develop a web service using php. The .NET client will be pretty straightforward as you...
[ 0.6191437244415283, 0.2101612389087677, 0.294416218996048, -0.028145987540483475, -0.19879093766212463, -0.2851203382015228, 0.12241456657648087, 0.1229928731918335, -0.14743798971176147, -0.5580218434333801, 0.14497089385986328, 0.6903901100158691, -0.26154783368110657, -0.101079963147640...
I draw a line on a Canvas object with the moveTo and lineTo graphics methods. If one end of the line lies outside the Canvas, the line spills out and is drawn over or under other elements in the application. How do I make the Canvas keep the line contained within itself? Thanks! ``` <mx:Canvas id="canvas" top="0" rig...
[ 0.6699797511100769, -0.21346834301948547, 0.7514424324035645, -0.11808289587497711, -0.11713894456624985, 0.10003047436475754, -0.08619457483291626, -0.22934503853321075, -0.022642504423856735, -0.7621124386787415, 0.05186166614294052, 0.30083414912223816, -0.25203850865364075, -0.06756860...
I need a terse, clean way to implement this in asp.net mvc (+/- jquery or js)? User clicks an element in webform A; Webform B pops up; User interracts with webform B; On closing webform B, probably by a submit button, the source element in webform a is updated with a value from webform B Thanks. With ASP.NET MVC, I'...
[ 0.4108150005340576, -0.023879313841462135, 0.8220660090446472, -0.03741954267024994, -0.29852616786956787, -0.08623374253511429, 0.1639055758714676, -0.06111057847738266, -0.054863136261701584, -0.8343889713287354, -0.30693143606185913, 0.337362676858902, -0.19971469044685364, 0.0292732045...
server. You could also use the onclose handler for the dialog to both copy values from the inputs in the dialog for use on the rest of the page. If you populated the dialog via AJAX you could have the server generate the HTML -- say by rendering a partial view and returning it -- or return json and generate the dialog ...
[ 0.07835502177476883, -0.18785962462425232, 0.538726806640625, 0.17198732495307922, -0.5478072762489319, -0.0909762755036354, 0.23689179122447968, 0.06102834641933441, -0.2160182148218155, -0.7457700967788696, 0.003719702363014221, 0.4145270586013794, -0.5604991912841797, -0.018407432362437...
I've had a look at the metronome sample given by Apple, however, the sample is too complicated and includes things not needed in my project. Is there a simple way to make a system sound play every x number of milliseconds? With ASP.NET MVC, I'd probably render a DIV on the page, initially hidden, perhaps via AJAX if t...
[ 0.4027705192565918, -0.08100822567939758, 0.4888405203819275, 0.17030903697013855, -0.14192098379135132, 0.03049078956246376, 0.10908674448728561, -0.019452791661024094, -0.029209323227405548, -0.6754885315895081, -0.03666532412171364, 0.805855393409729, -0.19203585386276245, 0.14058141410...
both copy values from the inputs in the dialog for use on the rest of the page. If you populated the dialog via AJAX you could have the server generate the HTML -- say by rendering a partial view and returning it -- or return json and generate the dialog on the fly in the browser.
[ 0.09103739261627197, 0.052966564893722534, 0.34784960746765137, 0.2063196450471878, -0.4250272214412689, 0.031238768249750137, -0.09155157953500748, -0.223298117518425, -0.03740423172712326, -0.6687775254249573, -0.06101350858807564, 0.5889210104942322, -0.37932395935058594, -0.30724671483...
I have a small experience in VB.net and I would like to learn C#.net What are the differences between VB.net and C#.net? Is there any difference in performance between these two? Apart from the syntactical differences, are there any major changes that I have to keep in mind? The *Language Features* section of the [W...
[ 0.44196000695228577, 0.08320559561252594, -0.17422831058502197, 0.015314184129238129, -0.3278014361858368, 0.20232681930065155, 0.14106632769107819, 0.06781169772148132, -0.30629536509513855, -0.7005199193954468, 0.16730153560638428, 1.0536119937896729, 0.5346719026565552, -0.1237529218196...
``` int temp = 0x5E; // in binary 0b1011110. ``` Is there such a way to check if bit 3 in temp is 1 or 0 without bit shifting and masking. Just want to know if there is some built in function for this, or am I forced to write one myself. In C, if you want to hide bit manipulation, you can write a macro: ``` #define...
[ 0.1347409188747406, 0.2044442892074585, 0.0803152546286583, -0.16806045174598694, 0.042541276663541794, -0.07231952995061874, -0.010852417908608913, -0.20690467953681946, -0.14283353090286255, -0.3999689221382141, -0.221061110496521, 0.5227749943733215, -0.42154785990715027, -0.20503321290...
I'm building a index which is just several sets of ordered 32 bit integers stored continuously in a binary file. The problem is that this file grows pretty large. I've been thinking of adding some compressions scheme but that's a bit out of my expertise. So I'm wondering, what compression algorithm would work best in t...
[ 0.0488700307905674, 0.2546994686126709, 0.28215065598487854, 0.18806827068328857, 0.16496647894382477, 0.31466031074523926, -0.05180513486266136, 0.008323493413627148, -0.7502846717834473, -0.4381064176559448, 0.010087517090141773, 0.17710405588150024, -0.2488841563463211, 0.56310409307479...
etc) you can do one thing: Find the **differences** between the adjacent numbers which would be like 2,1,1,4,1... etc.(in our example) and then **Huffman encode** this numbers. I don't think Huffman encoding will work if you directly apply them to the original list of numbers you have. But if you have a sorted list ...
[ 0.46353083848953247, -0.08512626588344574, 0.14265985786914825, 0.22963178157806396, 0.1405533254146576, 0.09373869746923447, -0.029657093808054924, -0.03131558373570442, -0.05661587044596672, -0.8051025867462158, 0.08522940427064896, 0.2730146050453186, -0.5952406525611877, 0.074178852140...
I am developing a simple platform game using Java using BlueJ as the IDE. Right now I have player/enemy sprites, platforms and other items in the game drawn using polygons and simple shapes. Eventually I hope to replace them with actual images. For now I would like to know what is the simplest solution to setting an i...
[ 0.4571279287338257, 0.04117134213447571, 0.13208508491516113, 0.1654243916273117, -0.16420289874076843, 0.13602250814437866, -0.09870187193155289, 0.355546772480011, -0.18509504199028015, -0.9223308563232422, 0.13472093641757965, 0.3640129864215851, -0.03560830280184746, 0.0757244229316711...
example codes with comments to elaborate on their function, and also if it's in its own class, how to call on relevant methods used by it on other classes. Thank you very much. The answer will vary slightly depending on whether the application or applet is using [AWT](http://java.sun.com/javase/6/docs/technotes/guides...
[ 0.48124346137046814, -0.057943545281887054, -0.04215450957417488, 0.11391045898199081, -0.3557705283164978, 0.1428760141134262, 0.1519775241613388, -0.48670563101768494, 0.08410736918449402, -0.783733069896698, -0.2278844565153122, 0.4512999355792999, -0.36189770698547363, -0.4247770309448...
1.** Loading the image can be either by using the [`Toolkit`](http://java.sun.com/javase/6/docs/api/java/awt/Toolkit.html) class or by the [`ImageIO`](http://java.sun.com/javase/6/docs/api/javax/imageio/ImageIO.html) class. The [`Toolkit.createImage`](http://java.sun.com/javase/6/docs/api/java/awt/Toolkit.html#createI...
[ 0.23604054749011993, -0.14680692553520203, 0.6492251753807068, -0.19760972261428833, -0.1505606770515442, 0.26780858635902405, 0.10618005692958832, -0.36806339025497437, -0.06565110385417938, -0.7687797546386719, -0.2641454041004181, 0.741010308265686, -0.30957862734794617, -0.229347914457...
Draw the previously loaded image to Component. g.drawImage(img, 0, 0, null); // Draw sprites, and other things. // .... } ``` For Swing, the method to override is the [`paintComponent`](http://java.sun.com/javase/6/docs/api/javax/swing/JComponent.html#paintComponent(java.awt.Graphics)) method of the [`JC...
[ 0.22921879589557648, -0.15328991413116455, 0.650265097618103, -0.13799111545085907, -0.2638273239135742, 0.12287158519029617, -0.17739786207675934, -0.39936214685440063, -0.33372583985328674, -0.40729859471321106, -0.10666163265705109, 0.801484227180481, -0.45923224091529846, -0.2918907999...
image in. Image img; public BackgroundPanel() { // Loads the background image and stores in img object. img = Toolkit.getDefaultToolkit().createImage("background.jpg"); } public void paint(Graphics g) { // Draws the img to the BackgroundPanel. g.drawImage(img, 0,...
[ 0.36975041031837463, -0.18794630467891693, 0.31211838126182556, -0.11542563140392303, -0.28683704137802124, 0.29950079321861267, 0.10180947184562683, -0.3275183439254761, -0.3487314283847809, -0.7676045894622803, -0.21640121936798096, 0.593640923500061, -0.29701367020606995, -0.28383895754...
from [The Java Tutorials](http://java.sun.com/docs/books/tutorial/index.html) may be of help.
[ 0.2908511459827423, -0.09863404929637909, -0.12381823360919952, 0.2780958116054535, 0.025708366185426712, -0.30816182494163513, 0.11446765810251236, 0.25321686267852783, -0.22287824749946594, -0.36492404341697693, -0.3787009119987488, 0.33105751872062683, 0.2704559862613678, -0.22200176119...
Suppose you're given an URL, <http://site.com> . How do you find out what it's content type is without downloading it? Can Perl's [WWW::Mechanize](http://search.cpan.org/dist/WWW-Mechanize) or [LWP](http://search.cpan.org/dist/libwww-perl) issue a HEAD request? You can use `head()` method of LWP in following manner ``...
[ 0.1284913420677185, 0.0012932028621435165, 0.6917300820350647, 0.052266400307416916, -0.022702272981405258, -0.1959211528301239, -0.08823337405920029, -0.054129425436258316, -0.15968948602676392, -0.4126349687576294, -0.4471610486507416, 0.21252579987049103, -0.14011959731578827, 0.1611152...
I have two arrays in PHP as follows: *People:* ``` Array ( [0] => 3 [1] => 20 ) ``` *Wanted Criminals:* ``` Array ( [0] => 2 [1] => 4 [2] => 8 [3] => 11 [4] => 12 [5] => 13 [6] => 14 [7] => 15 [8] => 16 [9] => 17 [10] => 18 [11] => 19 [12] => 20 ) ``` H...
[ 0.08246780186891556, 0.06519995629787445, 0.26264363527297974, -0.07896474748849869, -0.35417208075523376, 0.17193929851055145, 0.1865358203649521, -0.5708364844322205, -0.3077373504638672, -0.4803411364555359, 0.16345913708209991, 0.4669734537601471, -0.19305498898029327, -0.3112129569053...
I check if **any** of the *People* elements are in the *Wanted Criminals* array? In this example, it should return `true` because `20` is in *Wanted Criminals*. You can use [`array_intersect()`](http://www.php.net/array_intersect). ``` $result = !empty(array_intersect($people, $criminals)); ```
[ 0.16786032915115356, -0.06675629317760468, 0.17648446559906006, -0.056953176856040955, 0.1887722909450531, -0.0956871435046196, 0.16741900146007538, -0.3787483274936676, -0.5182238221168518, -0.4364803731441498, 0.04881836846470833, 0.5689144134521484, -0.34805378317832947, -0.100050181150...
What is a component class and where would I typically use one? When I add a new item to my project in VS.NET 2008 one of the options is to add a component. I am not even sure I understand what a component is - but I would sure like to find out a bit more about them. Could somebody explain them to me or perhaps point ...
[ 0.16243591904640198, -0.3289220929145813, 0.24147628247737885, 0.35371729731559753, -0.29558104276657104, -0.20599110424518585, 0.006549160461872816, 0.05708152428269386, -0.22537994384765625, -0.4046168327331543, 0.08990022540092468, 0.29193606972694397, -0.13640497624874115, 0.3051282465...
class can interact with it's logical container. More often than not, you see this in the form of design support, in that classes interact with their host in the designer, but that's not a strict requirement.
[ 0.02428276464343071, -0.388212114572525, -0.40994971990585327, 0.6783797740936279, -0.2400825470685959, -0.2075505405664444, 0.09407346695661545, 0.3697018325328827, 0.0037494590505957603, -0.6163701415061951, -0.3043234646320343, 0.10068757832050323, -0.05916089192032814, 0.26960736513137...
suppose I have a vector: ``` 0 1 2 3 4 5 [45,89,22,31,23,76] ``` And a permutation of its indices: ``` [5,3,2,1,0,4] ``` Is there an efficient way to resort it according to the permutation thus obtaining: ``` [76,31,22,89,45,23] ``` Using at most O(1) additional space? Yes. Starting from the leftmost pos...
[ -0.2167438268661499, 0.07824014872312546, 0.3421527147293091, -0.18940803408622742, 0.03825224190950394, 0.41697847843170166, 0.029518641531467438, -0.44228512048721313, -0.04832988604903221, -0.9529376029968262, -0.13335150480270386, 0.28628191351890564, -0.3592207431793213, -0.0077658793...
do the same thing. **Example:** [5 3 2 1 0 4] initial state [4 3 2 1 0 5] swapped (5,4), 5 is now in the correct position, but 4 is still wrong [0 3 2 1 4 5] swapped (4,0), now both 4 and 0 are in the correct positions, move on to next position [0 1 2 3 4 5] swapped (3,1), now 1 and 3 are both in the correct posit...
[ 0.18734844028949738, -0.18917246162891388, -0.00140283047221601, -0.2186507284641266, 0.38291069865226746, 0.0486227311193943, 0.29656746983528137, -0.6252245306968689, -0.09106612950563431, -0.4084836542606354, -0.43651413917541504, 0.19963166117668152, -0.3275544047355652, -0.06790206581...
the correct position, we need no more than N such swaps altogether.
[ 0.028869660571217537, -0.05787059664726257, 0.5021902918815613, 0.07644094526767731, 0.13468094170093536, 0.1550682783126831, -0.1349499672651291, -0.2790232002735138, 0.03941715881228447, -0.5843747854232788, -0.1952444463968277, 0.37761202454566956, -0.07235872000455856, -0.2010494172573...
I have a small hierarchy of objects that I need to serialize and transmit via a socket connection. I need to both serialize the object, then deserialize it based on what type it is. Is there an easy way to do this in C++ (as there is in Java)? Just to be clear, I'm looking for methods on converting an object into an a...
[ 0.3240814507007599, 0.16736434400081635, 0.2723946273326874, -0.06069361791014671, -0.29968374967575073, 0.011845238506793976, -0.18459756672382355, 0.10149499028921127, -0.3437829613685608, -0.7047526836395264, -0.09758363664150238, 0.6548733115196228, -0.33698174357414246, 0.204297527670...
or the [asio library](http://tenermerx.com/Asio/). If you want to serialize your objects to a byte array, you can use the boost serializer in the following way (taken from the tutorial site): ``` #include <boost/archive/binary_oarchive.hpp> #include <boost/archive/binary_iarchive.hpp> class gps_position { private: ...
[ 0.08890517055988312, 0.22251106798648834, 0.5335094332695007, -0.03244909644126892, 0.31637609004974365, 0.25326743721961975, -0.0171266570687294, -0.4362589418888092, -0.19950227439403534, -0.4103027284145355, -0.3090977072715759, 0.49530068039894104, -0.15909169614315033, -0.159081339836...
int minutes; float seconds; public: gps_position(){}; gps_position(int d, int m, float s) : degrees(d), minutes(m), seconds(s) {} }; ``` Actual serialization is then pretty easy: ``` #include <fstream> std::ofstream ofs("filename.dat", std::ios::binary); // create class instance const g...
[ 0.006944227963685989, 0.08294467628002167, 0.5353452563285828, 0.03340326249599457, 0.38122743368148804, 0.2922297716140747, 0.06775052100419998, -0.37214991450309753, 0.0911184772849083, -0.6095902323722839, -0.34167924523353577, 0.4472507834434509, -0.13960835337638855, 0.184992045164108...
// archive and stream closed when destructors are called } ``` Deserialization works in an analogous manner. There are also mechanisms which let you handle serialization of pointers (complex data structures like tress etc are no problem), derived classes and you can choose between binary and text serialization. ...
[ 0.19424548745155334, 0.006401035934686661, 0.04922410473227501, 0.16911160945892334, -0.2570926547050476, -0.22640448808670044, 0.030188603326678276, 0.08333508670330048, -0.3380172848701477, -0.6575037240982056, -0.2598726153373718, 0.5599573254585266, -0.26615893840789795, 0.268835067749...
Say I have three window classes, one for each OS I want to support: * WindowsWindow * OSXWindow * LinuxWindow They all inherit from the **Window** class. This is also the class you instantiate. The Window class have the . -> and :: operators overloaded, and depending on which OS were running on (based on IFDEFs) it...
[ 0.35708484053611755, 0.17275667190551758, 0.3047640025615692, 0.030136262997984886, -0.19174624979496002, -0.06334999948740005, 0.27037447690963745, 0.1481906771659851, -0.11074013262987137, -0.8343535661697388, 0.09654730558395386, 0.6027352809906006, -0.40088456869125366, 0.3510611355304...
there are libraries to do this, but I want to try it myself. I guess the easiest way is to create a factory. But can something like this be done? You can't overload the scope resolution operator :: at all. You could overload the -> operator, but when you invoke that operator, you already have to have an object of the ...
[ 0.511923611164093, -0.06608015298843384, 0.19664348661899567, -0.07423365861177444, 0.042909007519483566, -0.08117298781871796, 0.23573285341262817, -0.11221055686473846, -0.18346436321735382, -0.7796378135681152, 0.03623330220580101, 0.7017983198165894, -0.5377881526947021, 0.296932607889...
return new X11Window(...); #elif defined(/** whatever is defined for Mac */) return new CocoaWindow(...); #else #error "Bad platform!" #endif } }; ```
[ 0.21368256211280823, 0.1093808114528656, 0.3538374602794647, -0.0962529256939888, 0.19328798353672028, -0.0858037918806076, 0.4418324828147888, 0.041256748139858246, -0.26299959421157837, -0.4298115670681, -0.2796163260936737, 0.9996950626373291, -0.5828704237937927, 0.14375124871730804, ...
I have an Illustrator file with linked images. I'd actually like to instead embed the images. I first have to know which files they are. How do I find out? I'm using Illustrator 9. The first Illustrator version I ever used was 10, but, is there a links pallete in version 9? Try the window menu and look for "links". It ...
[ 0.18312497437000275, -0.002851459663361311, 0.6110114455223083, 0.11553356051445007, -0.46125322580337524, -0.0155482217669487, -0.13262073695659637, 0.533519446849823, -0.44993874430656433, -0.9645625352859497, 0.3459164798259735, 0.464720219373703, -0.34126371145248413, 0.026094265282154...
RDT (Ruby Development Tool) seems to be the preferred plugin for adding Ruby support to Eclipse. However, I see that the main developer on that project has joined Aptana RadRails. Does this mean that project is no longer up-to-date for Ruby in Eclipse? If so, which plugin is the preferred and best choice these days? T...
[ 0.24591189622879028, -0.005186264868825674, 0.31738612055778503, -0.25375527143478394, -0.6833643913269043, -0.17248240113258362, 0.5287386178970337, 0.013696828857064247, -0.0027716150507330894, -0.514948844909668, -0.3381868004798889, 0.6978664398193359, -0.28340524435043335, -0.09721414...
I need a PHP library/script that can retreive data from feeds, no matter if they are RSS or ATOM, because I want users to insert random feeds which will then be stored in a database. It would also be great if it could check whether a given URL is a feed or not. If anything exists that could help me out, could anyone t...
[ 0.5574520230293274, -0.08073846995830536, 0.15873382985591888, 0.05487556755542755, -0.3361036777496338, -0.2822364866733551, -0.0054436614736914635, 0.07780702412128448, -0.3482725918292999, -0.6637008190155029, 0.23663729429244995, 0.5623101592063904, -0.5350098013877869, -0.154985263943...
I have seen numerous examples of lazy loading - what's your choice? Given a model class for example: ``` public class Person { private IList<Child> _children; public IList<Child> Children { get { if (_children == null) LoadChildren(); return _children; ...
[ -0.005343880038708448, -0.34350404143333435, -0.27777910232543945, 0.06968570500612259, 0.15951044857501984, 0.5088000893592834, 0.020440317690372467, -0.07700251042842865, -0.1912141740322113, -0.6100865602493286, -0.14085090160369873, 0.5337627530097961, -0.4183516502380371, 0.1713978648...
Person class should not know anything about how it's children are loaded .... or should it? Surely it should control when properties are populated, or not? Would you have a repository that couples a Person together with its children collection or would you use a different approach, such as using a [lazyload](https://s...
[ -0.1730637103319168, -0.47751739621162415, -0.23074498772621155, 0.4988196790218353, -0.24211296439170837, 0.13831526041030884, 0.11860054731369019, -0.24048544466495514, -0.2748437821865082, -0.5512070059776306, 0.1893841028213501, 0.4810967445373535, -0.11869706958532333, 0.1655153036117...
is avoiding it ;) Thread safety is an immediate problem you'll have to handle. I have no count of how often I have seen production systems with 8 cpu cores run lazy loading 8 times for *every single* lazy loading pattern in use. At least on server startups all server cores have a tendency to end up in the same places. ...
[ 0.3927522599697113, 0.07492522895336151, -0.08188538253307343, 0.17294706404209137, -0.1704978197813034, -0.015086541883647442, 0.5744701027870178, 0.0391780324280262, -0.3976764380931854, -0.5863265991210938, 0.07494908571243286, 0.500657320022583, -0.21482810378074646, -0.040592636913061...
class. Don't put it inside the person class, just make a service that constructs the objects in the proper manner. Introducing "magic" layers that more or less transparently do these things *seem* like a nice idea, but I have yet to come across implementations that do not have unforseen and problematic consequences.
[ 0.7364792227745056, -0.17246507108211517, -0.2051474153995514, 0.38103586435317993, -0.3891277611255646, -0.1791568547487259, 0.7361534833908081, 0.22064778208732605, 0.1473442167043686, -0.6784490942955017, -0.17939341068267822, 0.17789004743099213, 0.0018304773839190602, -0.1299172192811...
If I use a custom panel to layout my ListBoxItems, the ListBox won't respect their combined Height (it does respect their combined Width though) - even when my ArrangeOverride returns a size that surrounds all the items. Setting the ListBox's Height explicitly makes everything work, but I want it to work that out for...
[ 0.36487776041030884, 0.05893122777342796, 0.9420609474182129, 0.03316192328929901, 0.04712913930416107, -0.1911214292049408, 0.11403410881757736, -0.2861214578151703, -0.4465702176094055, -0.7575439810752869, -0.01697940193116665, 0.41488587856292725, -0.13551238179206848, 0.07062506675720...
collapses! ``` <UserControl x:Class="SilverlightApplication1.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SilverlightApplication1"> <UserControl.Resources> <DataTemplate x:Key="ArticleTemplate"> <...
[ -0.5160682797431946, 0.744313657283783, 0.4023355543613434, -0.16192233562469482, -0.08845271915197372, -0.0964449793100357, 0.003389877500012517, -0.6020100116729736, -0.3796979486942291, -0.37938612699508667, -0.225876584649086, 0.12019087374210358, -0.09486007690429688, 0.48212981224060...
MyPanel : Panel { protected override Size ArrangeOverride(Size arrangeSize) { double width = 0, height = 0; foreach (UIElement child in this.Children) { var article = (Article)((ContentControl)child).DataContext; var y = child.DesiredSize.Height * article.Row; ...
[ -0.004646829795092344, -0.13885006308555603, 0.7409384846687317, -0.28620395064353943, 0.42932164669036865, 0.37930142879486084, -0.10119140148162842, -0.34696370363235474, -0.1468382030725479, -0.7621827125549316, -0.38949936628341675, 0.20288965106010437, 0.11297047883272171, 0.160712495...
var rect = new Rect(location, child.DesiredSize); child.Arrange(rect); width = Math.Max(width, child.DesiredSize.Width); height = Math.Max(height, y + child.DesiredSize.Height); } return new Size(width, height); } protected override Size MeasureOverride(Size...
[ -0.13236013054847717, -0.2736998200416565, 0.6257237792015076, -0.2289128601551056, 0.5100062489509583, 0.43884244561195374, 0.09364175796508789, -0.6246482133865356, -0.17584531009197235, -0.5965428352355957, -0.42034804821014404, 0.55192631483078, 0.15412674844264984, 0.22831737995147705...
foreach (UIElement child in this.Children) { if (child != null) { child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); } } return new Size(); } } ``` And the domain class: ``` public class Article {
[ 0.0772547647356987, 0.3903231620788574, 0.5641247034072876, -0.433124303817749, 0.2966843247413635, 0.2657225430011749, 0.018090881407260895, -0.6035181879997253, -0.10001669824123383, -0.7155988812446594, -0.324449360370636, 0.495984822511673, -0.17413820326328278, 0.5319915413856506, 0...
private readonly int row; private readonly string title; public Article(string title, int row) { this.title = title; this.row = row; } public int Row { get { return this.row; } } public string Title { get { return this.title; } } } ``` There is actually a third approach. The ...
[ 0.5538064241409302, -0.2466776818037033, 0.4045424163341522, 0.09798886626958847, -0.0892767608165741, -0.23356692492961884, 0.16847975552082062, -0.18604663014411926, -0.37730005383491516, -0.5529526472091675, -0.3073320984840393, 0.6860597729682922, -0.07596929371356964, 0.28789511322975...
your own implementation for how the data is stored, but retaining much of the benefit of asp.net membership. Some articles on the subject: <http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx> <http://www.asp.net/learn/videos/video-189.aspx> <http://www.15seconds.com/issue/050216.htm> <http://davidhayden.com/blo...
[ 0.34933751821517944, -0.2712722420692444, 0.09292370080947876, 0.2994413375854492, -0.007292610127478838, -0.3027617335319519, 0.040278758853673935, -0.26781243085861206, -0.4310636818408966, -0.4762420952320099, -0.24659240245819092, 0.20348267257213593, 0.06818865984678268, 0.15165255963...
I want to get the icons of common file types in my dll. I am using vc++. I only have the file extension and mime type of the file based on which I want to get the icon for the file. Can someone please tell me how I can do that? (The method available in vc++ needs the user to give the path of the file for which the ico...
[ 0.6037296652793884, 0.049241919070482254, 0.5469342470169067, 0.008984620682895184, -0.1206202507019043, 0.04100453481078148, 0.4614233672618866, 0.012810715474188328, -0.34878817200660706, -0.7606834173202515, -0.1293395459651947, 0.6964402198791504, -0.3071860074996948, 0.026444988325238...
the routine to work without requiring the filename passed in to actually exist, so if you have a file extension just make up a filename, append the extension, and pass it in. By combining other flags, you'll be able to retrieve: * **A large or small icon as determined by the system configuration**: `SHGFI_ICON|SHGFI_...
[ 0.14664265513420105, -0.2153504341840744, 0.7497033476829529, -0.014055600389838219, 0.41762569546699524, -0.1290491223335266, 0.3642084300518036, -0.2543203830718994, -0.4052637219429016, -0.44780996441841125, -0.3877269923686981, 0.6095185279846191, -0.3080523908138275, -0.31758910417556...
the icon index in that module): `SHGFI_ICONLOCATION` ### Examples ``` // Load a System Large icon image SHGetFileInfo( szFileName, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(SHFILEINFO), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_LARGEICON); // Load a System Small icon image SHGetFileInfo( szFileName, FILE_ATTRIBUTE...
[ -0.5769807696342468, 0.09896527975797653, 0.7703107595443726, -0.042534295469522476, 0.06346265226602554, 0.33174949884414673, 0.06590928137302399, -0.20525993406772614, -0.5805804133415222, -0.6473108530044556, -0.3653007447719574, 0.5278633832931519, -0.314929723739624, -0.13799114525318...
native size DrawIconEx( hDC, nLeft, nTop, hIcon, 0, 0, 0, NULL, DI_NORMAL ); // Draw it at the System Large size DrawIconEx( hDC, nLeft, nTop, hIcon, 0, 0, 0, NULL, DI_DEFAULTSIZE | DI_NORMAL ); // Draw it at some other size (40x40 in this example) DrawIconEx( hDC, nLeft, nTop, hIcon, 40, 40, 0, NULL, DI...
[ -0.433174192905426, -0.2909417450428009, 0.6747362613677979, -0.11693093180656433, -0.3966052830219269, 0.16010020673274994, 0.09199623018503189, -0.18128474056720734, -0.024591755121946335, -0.5362302660942078, -0.3906109929084778, 0.7004987001419067, -0.3442237377166748, -0.0046859597787...
// out: icon int iIcon; // out: icon index DWORD dwAttributes; // out: SFGAO_ flags
[ -0.1598745882511139, -0.1616278737783432, 0.24049533903598785, -0.18426772952079773, 0.1198582574725151, 0.14116327464580536, 0.18389485776424408, -0.2108040153980255, -0.24985052645206451, -0.6654359698295593, -0.4026949107646942, 0.34013015031814575, -0.44919151067733765, -0.240870341658...