text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
other side: ``` # get patches from mail and place in /tmp git am /tmp/00* rm /tmp/00* ```
[ 0.34902793169021606, 0.09715383499860764, 0.05727515369653702, 0.15889611840248108, -0.07231254130601883, 0.21787801384925842, 0.10686521977186203, 0.32838621735572815, -0.1737011969089508, -0.8192834258079529, -0.06958359479904175, 0.4882154166698456, 0.00923849642276764, -0.2025448977947...
In Visual c# Express Edition, is it possible to make some (but not all) items in a ListBox bold? I can't find any sort of option for this in the API. You need to change listbox's DrawMode to DrawMode.OwnerDrawFixed. Check out these articles on msdn: [DrawMode Enumeration](http://msdn.microsoft.com/en-us/library/syst...
[ -0.2196177989244461, -0.30192065238952637, 0.40708333253860474, -0.2778588533401489, -0.5289813876152039, -0.21306735277175903, -0.07407786697149277, -0.3391435444355011, -0.1752258539199829, -0.556509256362915, -0.47398024797439575, 0.3642808496952057, -0.4807472229003906, -0.364900320768...
ListBox1.Items.AddRange(new Object[] { "First Item", "Second Item"}); ListBox1.DrawMode = DrawMode.OwnerDrawFixed; } private void ListBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); e.Graphics.DrawString(ListBox1.Items[e.Index].ToString(), new Font("Arial", 1...
[ -0.12967973947525024, -0.22550001740455627, 0.6465912461280823, -0.39600086212158203, -0.141109898686409, 0.31382831931114197, 0.21229106187820435, -0.5180631279945374, -0.314673513174057, -0.5704883933067322, -0.38009291887283325, 0.5973672270774841, -0.5310834050178528, 0.024896226823329...
I am working on some sort of CRM application which has huge sales data with all the customer leads etc (ASP.NET 2.0/Ajax) I want to create a dashboard which will have four separate data containers each container will have different sort of data and each container has to update it self after some configured time interv...
[ 0.28164660930633545, 0.06618621200323105, 0.42952579259872437, 0.1076195165514946, -0.1353638917207718, -0.12005379796028137, -0.2369176149368286, 0.025199778378009796, -0.2698017358779907, -0.6504574418067932, 0.1984686255455017, 0.8095346093177795, 0.19437365233898163, -0.301425069570541...
you fine on this scenario; if you don't have experience with neither, I would recommend the UpdatePanel way because it is closer to the regular ASP.NET code you're used to. [This article](http://msdn.microsoft.com/en-us/library/bb398867.aspx) will get you 90% there, all you have to do at the end is to put some simple...
[ 0.3468104600906372, -0.13987737894058228, 0.4749615490436554, 0.11288495361804962, -0.04567192494869232, -0.22234658896923065, 0.4013933837413788, -0.11590439081192017, -0.27887487411499023, -0.949549674987793, -0.19982074201107025, 0.9212512969970703, -0.1003354862332344, -0.3642267882823...
etc) but that's an easy way to get the job done.
[ 0.45363834500312805, 0.15695494413375854, 0.32223501801490784, 0.15377134084701538, 0.06592005491256714, -0.08398167043924332, 0.289520800113678, -0.03680603951215744, -0.20541106164455414, -0.18455876410007477, -0.13132937252521515, 0.7604311108589172, -0.11049223691225052, -0.14496204257...
I have a problem redrawing a custom view in simple cocoa application. Drawing is based on one parameter that is being changed by a simple NSSlider. However, although i implement -setParameter: and -parameter methods and bind slider's value to that parameter in interface builder i cannot seem to make a custom view to re...
[ -0.09136059880256653, 0.03613809868693352, 0.5661282539367676, -0.16107140481472015, -0.29879868030548096, 0.04579117149114609, 0.30213072896003723, -0.13815918564796448, -0.39460304379463196, -0.7990251779556274, 0.02050120010972023, 0.6022521257400513, -0.4628123342990875, 0.207445144653...
although I would assume that that means the same thing. Are you implementing the `- (void)drawRect:(NSRect)rect` method, or using the `drawRect:` method of your superclass?
[ 0.17692622542381287, -0.29448607563972473, 0.09126795828342438, 0.1842840015888214, 0.1283428817987442, -0.44397273659706116, 0.25631168484687805, 0.19257357716560364, -0.1788008213043213, -0.4693262577056885, -0.10656460374593735, 0.5981396436691284, -0.3834158182144165, -0.04197303205728...
How is a breakpoint implemented on PPC (On OS X, to be specific)? For example, on x86 it's typically done with the INT 3 instruction (0xCC) -- is there an instruction comparable to this for ppc? Or is there some other way they're set/implemented? I'm told by a reliable (but currently inebriated, so take it with a grai...
[ 0.3667512834072113, 0.3273538649082184, 0.03961264714598656, -0.11406289041042328, 0.007944295182824135, -0.3765084147453308, 0.529728889465332, 0.2328958809375763, -0.24827170372009277, -0.13129664957523346, -0.2432199865579605, 0.34503915905952454, -0.22427815198898315, -0.03121359460055...
We have a large ASP.Net website that has a single css stylesheet which is getting out of control. I am thinking of using the following strategy (taken from <http://www.techrepublic.com/article/developing-a-css-strategy/5437796/>) which seems logical to me... *you might have one CSS file devoted to sitewide styles and...
[ 0.6765487194061279, -0.08313662558794022, 0.33421841263771057, 0.11644040793180466, -0.11094307899475098, -0.11315836757421494, -0.14697028696537018, 0.15887916088104248, -0.41617053747177124, -0.7086033821105957, -0.09959052503108978, 0.21223515272140503, 0.008216587826609612, -0.08150617...
the appropriate CSS files for each page, so that you load all the styles needed to display that page, but very few unnecessary styles that only appear on other pages.* Is this a good way to proceed? What are the alternatives? I think the best option is to divide css in: -layout.css -content.css Then if you need oth...
[ 0.571850061416626, 0.17227670550346375, 0.2654363214969635, 0.09016267955303192, -0.4755202829837799, -0.12466137856245041, 0.04197623208165169, 0.06807046383619308, -0.2686298191547394, -0.8222615122795105, 0.11979879438877106, 0.43347570300102234, -0.4079279601573944, -0.1262326687574386...
too many css, is that your page will have to do more requests to the server and this will slow your page. This is why i recommend you to implement an HttpHandler which will create a cache copy in only one file of the css you need at the moment. Look here: <http://blog.madskristensen.dk/post/Combine-multiple-stylesheet...
[ 0.49438413977622986, 0.0032619202975183725, 0.02490079030394554, 0.24414193630218506, -0.18721634149551392, -0.19480714201927185, 0.35116124153137207, -0.18506617844104767, -0.24088512361049652, -0.5964935421943665, 0.2642861008644104, 0.31349682807922363, -0.34390032291412354, 0.022249063...
I need to stop the execution Is there any procedures for using terminate and suspend activity It depends exactly what you want to do. There is a Terminate Activity will terminate the workflow instance that is running and has reached that activity. Once terminated, that workflow instance will be dead and will never be r...
[ 0.7424755692481995, -0.20012135803699493, 0.38736945390701294, -0.03279886022210121, 0.010648318566381931, -0.3648923933506012, 0.4394019544124603, 0.22655807435512543, -0.2629753649234772, -0.37338221073150635, -0.25031864643096924, 0.5557764172554016, -0.5977921485900879, 0.4754692316055...
I have a DAL that I want to return an ADODB.recordset when executed from a classic asp. The object is exposed as a com object and I have a complete dal workin but I am not sure how to return an object that is a recordset that .net can use. Any help would be aprcitated. Thank you! --Nicolas I think you both for your f...
[ 0.46355104446411133, -0.02653491124510765, 0.22445549070835114, 0.3633400797843933, -0.3422819674015045, -0.08784151822328568, 0.024698441848158836, -0.14290502667427063, -0.23273423314094543, -0.6318807005882263, 0.0378001406788826, -0.11922846734523773, -0.096186563372612, 0.145023003220...
is an Assembly that I wanted to expose to ASP but to do so, to prevent from having to rewrite to much code I needed to first find a way to return a type of a recordset ONLY when called from Classic ASP apps. This would happen VIA a COM exposed method call that would make the call to the DAL and convert the returned .NE...
[ 0.5956758260726929, 0.09191565960645676, 0.0190650075674057, 0.2238578349351883, -0.03500046581029892, 0.09930110722780228, 0.05048452690243721, -0.24539467692375183, -0.2414603978395462, -0.4162410497665405, 0.043094146996736526, 0.18872347474098206, -0.24194008111953735, 0.06034861132502...
I have a file with n lines. (n above 100 millions) I want to output a file with only 1 of 10 lines, I can't split the file in ten part and keep only one part, as it must be a little more random. later I have to do a statistical analysis I can't afford to create a strong bias in the data). I was thinking of reading th...
[ 0.20539076626300812, 0.017842771485447884, 0.4726170599460602, 0.1477992981672287, 0.15046335756778717, 0.28794264793395996, 0.3201739192008972, 0.02050318382680416, -0.45733168721199036, -0.6653570532798767, 0.1006242036819458, 0.3326817750930786, -0.218991219997406, 0.11788100749254227, ...
no network,usb,cd-rom. read no external communication. Therefore I was thinking of windows batch file (I can't assume powershell, and vbscript is likely to have been removed). And at the moment looking at the FOR /F command. Still I am not an expert and I don't know how to achieve this. *Thank you Paul for your answe...
[ 0.24514010548591614, 0.13548903167247772, 0.3454655706882477, -0.15684032440185547, 0.040554892271757126, 0.09431231021881104, 0.46095240116119385, -0.126809760928154, -0.33108606934547424, -0.7269424200057983, -0.08256881684064865, 0.484397292137146, -0.38870522379875183, 0.06126764044165...
on a larger file Paul's answer is roughly 8 times faster. I guess the evaluation (in SET) is kind of slow, even if the logic seems brilliant.* Ok, I think I've cracked it: ``` findstr/N . path-to-log-file | findstr ^[0-9]*0: ``` (use findstr to add the line number to the beginning of the line, then again to print on...
[ -0.13624002039432526, 0.037314046174287796, 0.5350310206413269, -0.12887799739837646, -0.14565280079841614, 0.28362274169921875, 0.43944051861763, -0.08388211578130722, -0.37489601969718933, -0.8774069547653198, 0.08256322145462036, 0.24393372237682343, -0.20587308704853058, 0.105015590786...
and colon with ``` FOR /F "tokens=1,2* delims=: " %i in (file-with-linenumbers) do echo %j ``` Paul.
[ 0.02528144232928753, 0.014160114340484142, 0.22037427127361298, -0.3910508155822754, -0.011272259056568146, 0.3746560215950012, 0.1627889722585678, -0.34030964970588684, -0.2880183160305023, -0.4869542419910431, -0.3894335627555847, 0.22023378312587738, -0.204657644033432, 0.00790539756417...
In my program I have one array with 25 double values 0.04 When I try to sum these values in a loop I get following results: ``` 0.0 + 0.04 = 0.04 0.04 + 0.04 = 0.08 0.08 + 0.04 = 0.12 0.12 + 0.04 = 0.16 0.16 + 0.04 = 0.2 0.2 + 0.04 = 0.24000000000000002 0.24000000000000002 + 0.04 = 0.28 0.28 + 0.04 = 0.32 0.32 + 0.04 ...
[ 0.24427814781665802, 0.3633749186992645, 0.24104884266853333, -0.12141014635562897, -0.2134486436843872, 0.45057860016822815, 0.7786630988121033, -0.39744025468826294, -0.28731516003608704, -0.5497549176216125, 0.13601861894130707, 0.43527209758758545, -0.3193061053752899, 0.10322552919387...
0.7600000000000001 0.7600000000000001 + 0.04 = 0.8000000000000002 0.8000000000000002 + 0.04 = 0.8400000000000002 0.8400000000000002 + 0.04 = 0.8800000000000002 0.8800000000000002 + 0.04 = 0.9200000000000003 0.9200000000000003 + 0.04 = 0.9600000000000003 ``` Why on earth could that happen?! The most common storage for...
[ 0.1649867296218872, 0.3084484040737152, 0.14940880239009857, 0.22905592620372772, -0.027005687355995178, 0.08266721665859222, -0.05992410331964493, -0.14996378123760223, -0.44577229022979736, -0.09553114324808121, 0.03357569873332977, 0.1277245432138443, 0.04966307058930397, 0.549074828624...
that representations of numbers like 0.96 are not exactly representable, because they are not expressible as a sum of negative powers of two. Thus, when printed out with full precision as a decimal fraction, they won't match the original value.
[ 0.11290714889764786, 0.1970984935760498, 0.11063239723443985, 0.14221730828285217, -0.09881149232387543, 0.2330629527568817, -0.02185874618589878, -0.1201796904206276, -0.16920283436775208, -0.33161646127700806, -0.050082962960004807, 0.03228927031159401, 0.014522254467010498, 0.4376465678...
I'm trying to scrape a price from a web page using PHP and Regexes. The price will be in the format £123.12 or $123.12 (i.e., pounds or dollars). I'm loading up the contents using libcurl. The output of which is then going into `preg_match_all`. So it looks a bit like this: ``` $contents = curl_exec($curl); preg_mat...
[ 0.3965732753276825, 0.16643297672271729, 0.7466760277748108, -0.09884520620107651, -0.4405688941478729, 0.05458320304751396, -0.2056339532136917, -0.21952039003372192, 0.05563047155737877, -0.50644451379776, 0.2285003960132599, 0.5081825852394104, -0.1557328701019287, 0.11489709466695786, ...
charset issue. But whatever I do, I can't seem to get PHP to match it! Anyone have any ideas? (Edit: I should note if I try using the [Regex Test Tool](http://www.spaweditor.com/scripts/regex/index.php) using the same regex and page content, it works fine) Have you try to use \ in front of £ ``` preg_match_all('/(\$|...
[ -0.08059579133987427, 0.22070300579071045, 0.3969215452671051, -0.2952820658683777, -0.3704334795475006, 0.06702138483524323, 0.5270933508872986, -0.16137999296188354, -0.16193868219852448, -0.48716193437576294, -0.10412505269050598, 0.5513158440589905, -0.4422670602798462, -0.231340035796...
Is it possible to pump monochrome (graphical data with 1 bit image depth) texture into OpenGL? I'm currently using this: ``` glTexImage2D( GL_TEXTURE_2D, 0, 1, game->width, game->height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, game->culture[game->phase] ); ``` I'm pumping it with square array of 8 bit unsigned integers ...
[ -0.23095645010471344, -0.13092471659183502, 0.6705999970436096, -0.06178080663084984, -0.31889522075653076, 0.24637949466705322, 0.017270511016249657, -0.2531270980834961, -0.0021667000837624073, -0.965115487575531, 0.20195086300373077, 0.8328073024749756, -0.22138237953186035, -0.05046729...
texture-format for luminance images uses 8 bits per pixel. However, 1 bit per pixel images can be compressed without loss to the S3TC or DXT format. This will still not be 1 bit per pixel but somewhere between 2 and 3 bits. If you really need 1 bit per pixel you can do so with a little trick. Load 8 1 bit per pixel ...
[ -0.22754910588264465, -0.10199634730815887, 0.4076097905635834, 0.24168947339057922, -0.3296879529953003, 0.23462271690368652, 0.059808481484651566, -0.20151537656784058, 0.03637930750846863, -0.7247709035873413, 0.12210344523191452, 0.3724473714828491, -0.26407670974731445, -0.06872323900...
and a bit of texture environment programming to turn alpha into a color. This will of only work if you have 8 1 bit per pixel textures and tricky to get right though.
[ 0.16251105070114136, -0.01644984446465969, -0.01495408546179533, 0.05393538624048233, -0.16067618131637573, -0.022678272798657417, 0.12943825125694275, -0.053262583911418915, 0.03625039756298065, -0.8727971911430359, 0.22447586059570312, 0.5565972328186035, -0.4091397523880005, -0.06430397...
I am trying to specify an alternative jre (my default is 1.6 and i need to run with jdk 1.4.2) in Eclipse, for an application that i shall launch from eclipse. I am not sure if I am doing the right thing in the following code: ``` Path jreContainerPath = new Path("/usr/lib/jvm/j2sdk1.4.2_18/"); IVMInstall jre = JavaRu...
[ -0.25156599283218384, -0.10305316746234894, 0.6967864036560059, -0.16325204074382782, -0.038851797580718994, -0.04669320210814476, 0.4352225661277771, -0.2086542546749115, -0.14289885759353638, -0.7280430793762207, -0.1779189556837082, 0.632282555103302, -0.2107418179512024, 0.123033769428...
`getExecutionEnvironmentId()`. It takes the second segment of the path as the id of the JVM (see `getVMName()` of the same `JREContainerInitializer` class) May be that means the expected path is not the literal one, but one like '/jvm/j2sdk1.4.2\_18', with 'j2sdk1.4.2\_18' the name of one of the installed JREs of you...
[ 0.22745738923549652, -0.5561345219612122, 0.583116352558136, 0.03459428250789642, -0.08435216546058655, -0.1881006807088852, 0.26541683077812195, -0.15503713488578796, 0.16117416322231293, -0.5028173327445984, -0.4297448992729187, 0.776486873626709, -0.12736158072948456, -0.276376187801361...
Tried to map it from Preferences -> Settings -> Keyboard, but the "key" combo box has only "forward delete" but no "delete". My keyboard on the other hand has only "delete" and no "forward delete"! Is there some other way to do it except from the preferences? Enable option key as meta key =============================...
[ -0.3715135157108307, -0.19190478324890137, 0.9603303074836731, -0.028821758925914764, 0.08446265012025833, 0.1492660790681839, 0.6044265031814575, -0.3182835280895233, -0.4206336736679077, -0.8356336951255798, -0.2459939569234848, 0.8328057527542114, -0.26035192608833313, 0.029205521568655...
I am using jquery and the getJSON method and I am wondering if there is a way to display a message saying loading before it loads my content. i know with the jquery ajax calls there is the before submit callbacks where you can have something but the getJSON only has like three options. Any ideas? there is the custom `...
[ 0.5640361905097961, -0.1487402468919754, 0.2878267168998718, -0.029241660609841347, -0.2663842737674713, -0.26323801279067993, 0.09673832356929779, 0.23152735829353333, -0.32302987575531006, -0.4204865097999573, 0.03410184383392334, 0.798241913318634, -0.3608179986476898, 0.073616333305835...
vauge, and its hard to ascertain what it is you want to do that you wouldn't already be able to do simply with javascript.
[ 0.371824711561203, -0.0609469935297966, 0.28009477257728577, -0.04455207660794258, -0.2308773547410965, -0.1744600087404251, 0.38581326603889465, 0.00790807418525219, -0.12098580598831177, -0.5864253640174866, -0.15138041973114014, 0.3757110834121704, -0.09778553247451782, 0.02780438214540...
I'd like to create an application that would run on Google's appengine. However, this application needs to be able to generate PDFs dynamically. How could I do this? You can use the [`reportlab` library](http://www.reportlab.org/rl_toolkit.html) to generate a PDF from Python. You can just include the ReportLab files ...
[ 0.6327916383743286, 0.048345789313316345, 0.20372998714447021, 0.13490109145641327, -0.06539718061685562, -0.28254052996635437, -0.054669588804244995, -0.07744527608156204, -0.08406379073858261, -0.5654215812683105, -0.031285036355257034, 0.44762516021728516, -0.444091796875, 0.00264363572...
I have some forms that communicate with server using AJAX for real reasons: cascade combos, suggestions, multiple correlated selections (e.g. I have {elementary} knowledge of {French} [add], and {good} knowledge of {German} [add]...). I also have some regular fields that I handle trough get. Thing is that once I've m...
[ 0.20344869792461395, 0.004977055359631777, 0.37889567017555237, 0.29107558727264404, -0.49337247014045715, -0.2479214370250702, 0.43200165033340454, 0.16497254371643066, -0.10684118419885635, -0.7098771929740906, 0.010231380350887775, 0.34682950377464294, 0.01008627749979496, -0.0952724665...
people with javascript off, but most of the underlying logic would be the same, so it doesn't seam to me as an much of an overhead. It is a kind of data I would push through post anyway, so I'm not losing get parameters that would be good for something. Any reason not to do things this way? User experience is an impor...
[ 0.36449259519577026, 0.30891019105911255, 0.16165892779827118, -0.14227332174777985, -0.25330808758735657, -0.23476651310920715, 0.5940494537353516, 0.10665496438741684, -0.208944633603096, -0.5778615474700928, 0.008031830191612244, 0.5679060220718384, -0.28933972120285034, -0.037585876882...
can still complete the interactions.
[ 0.40108513832092285, 0.10139714926481247, 0.33376652002334595, 0.32250505685806274, 0.16583213210105896, -0.06738138943910599, 0.25634026527404785, -0.033760569989681244, -0.0042324126698076725, -0.6086260676383972, 0.03220634534955025, 0.27254539728164673, 0.10735495388507843, -0.12071217...
I'm creating a user-based website. For each user, I'll need a few MySQL tables to store different types of information (that is, userInfo, quotesSubmitted, and ratesSubmitted). Is it a better idea to: a) Create one database for the site (that is, "mySite") and then hundreds or thousands of tables inside this (that is,...
[ 0.516925036907196, 0.16670377552509308, 0.20917651057243347, 0.29595959186553955, 0.053189102560281754, 0.29321029782295227, -0.19215479493141174, 0.16546429693698883, -0.18752291798591614, -0.5950223803520203, 0.3658391833305359, 0.3666943311691284, 0.09592269361019135, 0.1990487873554229...
database?** --- Edit: The problem is that I need to keep track of who has rated what. That means if a user has rated 300 quotes, I need to be able to know exactly which quotes the user has rated. Maybe I should do this? One table for quotes. One table to list users. One table to document ALL ratings that have been...
[ 0.6431839466094971, 0.2568757236003876, 0.3995518684387207, 0.4142248034477234, -0.06717338413000107, 0.19142131507396698, -0.112315833568573, -0.3256262540817261, -0.22186389565467834, -0.31589269638061523, 0.7753441333770752, 0.7481167912483215, -0.21163900196552277, 0.09812771528959274,...
match users to quotes, this table will hold the rating that a user has given a quote. This simple design will allow you to store a practically unlimited number of quotes, unlimited users, and you will be able to match up each quote to zero or more users and vice versa. The table in the middle will contain *foreign ke...
[ 0.2767440676689148, 0.09016269445419312, 0.519639790058136, 0.21295982599258423, 0.01690741442143917, -0.13693508505821228, -0.2394828200340271, -0.20485259592533112, -0.05428900942206383, -0.08791273087263107, 0.1606825888156891, 0.5066735744476318, -0.48991483449935913, -0.14573802053928...
'too many'?](https://stackoverflow.com/questions/220613/how-many-fields-is-too-many-in-a-table) [More tables or more columns?](https://stackoverflow.com/questions/59482/whats-the-better-database-design-more-tables-or-more-columns)
[ 0.14918218553066254, 0.10266444087028503, 0.36645835638046265, 0.28827622532844543, -0.037594687193632126, -0.051332999020814896, -0.07653290778398514, -0.23131601512432098, -0.5426349639892578, -0.2216198593378067, 0.04146615043282509, 0.34523433446884155, -0.45395901799201965, -0.0146765...
I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server. Can someone share their experiences with either of them? Here's [quite an old comparison](https://rogerkeays.com/blog/glassfish-vs-tomcat). As such, the capabilities of ...
[ 0.29508569836616516, -0.09332136064767838, 0.3002803325653076, -0.07977982610464096, 0.007227098103612661, 0.02431768923997879, 0.17291060090065002, 0.06635789573192596, -0.3602354824542999, -0.571989893913269, 0.2951107323169708, 0.5000807642936707, 0.07869769632816315, 0.1805363744497299...
A common argument against using .NET for high volume, transactional enterprise systems is that IIS does not compare to the likes of Weblogic and websphere for java. Is this true? Unfortunately for .NET web apps IIS is the only option as an application server. Does anyone have any arguments against this? I would like to...
[ 0.4460565149784088, -0.07138992846012115, -0.10785804688930511, 0.17912529408931732, -0.25383898615837097, -0.2779865562915802, 0.09686848521232605, 0.20913350582122803, -0.2954176664352417, -1.010453224182129, 0.2066183239221573, 0.5741846561431885, -0.2988595962524414, 0.1833350658416748...
of those other platforms. However, it's easy to screw up performance with mediocre programming skills, and it is possible that a highly tuned platform could beat a standard IIS configuration. Honestly, I don't put much stock in the whole debate about which platform has the higher potential performance, because I've ne...
[ 0.23851117491722107, 0.2604118883609772, -0.1464666724205017, 0.30241477489471436, -0.08148399740457535, -0.2174500674009323, 0.26184821128845215, 0.22000740468502045, 0.053009554743766785, -0.42815160751342773, 0.03588486090302467, 0.7250754833221436, -0.15433362126350403, -0.084315709769...
I have a button control style and I want to change the padding from whatever the data-bound version is to adjust for a glyph that needs a 2 pixel offset. I'll use SimpleButton from SimpleStyles.xaml as an example (... shows where the trigger code was removed for conciseness): ``` <Style x:Key="SimpleButton" TargetType...
[ 0.23600946366786957, -0.5541574954986572, 0.6724852323532104, -0.14320027828216553, -0.2350272387266159, 0.28434187173843384, -0.005585990380495787, -0.5810444951057434, 0.021455729380249977, -0.8418672680854797, 0.08536182343959808, 0.51784747838974, -0.6397197842597961, -0.07871779799461...
a root because it is easy to add more elements to customize the button --> <Grid x:Name="Grid"> <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/> ...
[ -0.16295060515403748, -0.3141603469848633, 0.5958867073059082, 0.22601523995399475, -0.16501137614250183, -0.0004829801036976278, 0.2425258904695511, -0.3014731705188751, -0.3373483121395111, -0.620611846446991, 0.009958531707525253, -0.04174003005027771, -0.045372989028692245, 0.341039091...
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/> </Grid> ... </Setter.Value> </Setter> </Style> ``` What I want ...
[ 0.0924765020608902, 0.09314129501581192, 0.6780966520309448, 0.06286979466676712, -0.12392394989728928, 0.033733587712049484, 0.01992242969572544, -0.6435173749923706, -0.1231275126338005, -0.5723097324371338, 0.1939338892698288, 0.4318440556526184, -0.0649564117193222, -0.0365542694926261...
syntax, etc. However, you can use an [IValueConverter](http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx) or [IMultiValueConverter](http://msdn.microsoft.com/en-us/library/system.windows.data.imultivalueconverter.aspx) to help yourself out: XAML: ``` <Setter.Value> <ControlTemplate ...
[ -0.059645652770996094, -0.09414447098970413, 0.36643075942993164, 0.08888296782970428, -0.22900334000587463, 0.04254657402634621, 0.11352403461933136, -0.17522898316383362, -0.30995678901672363, -0.6833783984184265, -0.3369671106338501, 0.41411522030830383, -0.2237202525138855, -0.15632034...
<Binding Path="Padding" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource AdditiveThickness}"> <Binding.ConverterParameter> <Thickness>2,0,0,0</Thickness> </Binding.ConverterParameter>
[ -0.2882365584373474, -0.19775837659835815, 0.7691226601600647, -0.06502106785774231, -0.07891842722892761, 0.4893365204334259, -0.12482623010873795, -0.9056650996208191, -0.3072807192802429, -0.6689052581787109, 0.1662745177745819, 0.20297904312610626, -0.15495601296424866, 0.2436421513557...
</Binding> </Border.Padding> </Border> ... </Setter.Value> ``` IValueConverter code behind: ``` public class ThicknessAdditionConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) return ...
[ 0.20918843150138855, -0.13804244995117188, 0.9890416264533997, -0.37759697437286377, 0.04200400412082672, 0.23803801834583282, 0.3847857713699341, -0.5752829313278198, -0.2115941345691681, -0.6140545010566711, -0.06044033169746399, 0.571250855922699, -0.12890788912773132, 0.567236244678497...
if (!(parameter is Thickness)) throw new ArgumentException("Parameter not a thickness", "parameter"); var thickness = new Thickness(0, 0, 0, 0); var t1 = (Thickness)value; var t2 = (Thickness)parameter; thickness.Left = t1.Left + t2.Left; thickness.Top = t1.Top + t2.Top; ...
[ -0.2113320231437683, -0.21926504373550415, 0.6158550381660461, -0.30630263686180115, 0.22100599110126495, 0.4741874635219574, 0.27055224776268005, -0.6886829733848572, -0.3321024477481842, -0.41117727756500244, -0.3967726528644562, 0.7666563987731934, 0.2679385244846344, 0.2104686647653579...
t2.Bottom; return thickness; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } ```
[ 0.2106582075357437, -0.15864257514476776, 0.3022025525569916, -0.2636631727218628, -0.017793569713830948, 0.12181240320205688, 0.35268402099609375, -0.12640395760536194, -0.07852726429700851, -0.6340769529342651, -0.3737757205963135, 0.6270129680633545, -0.12260159105062485, 0.333792775869...
My goal is to implements different image classification methods to show how they function and the advantages and disadvantages behind such methods. The ones I want to try and implement using Java include; Minimum distance classifier k-nearest neighbour classifier. I was wondering what can be used to accomplish my t...
[ 0.5155672430992126, 0.10862842947244644, 0.16573846340179443, 0.19185662269592285, -0.2003062516450882, 0.13852933049201965, -0.047279201447963715, -0.02522326447069645, -0.0979607030749321, -0.9442322254180908, 0.13717657327651978, 0.3353790044784546, -0.35189926624298096, 0.1088273078203...
you may want to look at Weka (<http://www.cs.waikato.ac.nz/ml/weka/>), in my opinion the best Java library for data mining experimentation. If, instead, you are looking for algorithms that would allow you to analyze images in order to extract features that can, in turn, be used to perform the classification, you may ...
[ 0.7457830309867859, -0.11202867329120636, -0.23380497097969055, 0.23193469643592834, -0.2709072530269623, -0.19647672772407532, 0.0041126380674541, -0.12425211071968079, -0.20827972888946533, -0.41733604669570923, 0.14282749593257904, 0.06137127801775932, -0.0779205784201622, -0.0608110316...
I would like to draw lines (of arbitrary position and length) onto a surface in pygame, which itself is an image loaded from a file on disk. Can anyone point me to some example code that does this? This should do what you're asking for: ``` # load the image image = pygame.image.load("some_image.png") # draw a yellow...
[ 0.33327871561050415, 0.03842444717884064, 0.5077403783798218, 0.11920617520809174, -0.0827653557062149, 0.27273088693618774, -0.40784674882888794, 0.22904689610004425, -0.27979910373687744, -1.0236427783966064, 0.0746379941701889, 0.3038415312767029, -0.11933159828186035, -0.25656291842460...
more like this: ``` # initialize pygame and screen import pygame pygame.init() screen = pygame.display.set_mode((720, 576)) # Draw the image to the screen screen.blit(image, (0, 0)) # Draw a line on top of the image on the screen pygame.draw.line(screen, (255, 255, 255), (0, 0), (50, 50)) ```
[ 0.1837131530046463, -0.3303374946117401, 0.7034680843353271, -0.2200324535369873, -0.05945701524615288, 0.3579854965209961, -0.24277329444885254, -0.16252347826957703, -0.25009042024612427, -0.8530483245849609, -0.5062578320503235, 0.30617576837539673, -0.3084421753883362, -0.2056048214435...
I still have a large number of floppies. On some of them there probably is source code I don't want to lose. I also don't want to take look at each one individually, as that's going to take a lot of time. What software would be best for copying all data to a hard disk, preferably while creating an index at the same tim...
[ 0.7533960342407227, 0.08431625366210938, 0.22802932560443878, 0.4447602331638336, 0.48148012161254883, 0.0028158787172287703, 0.13575029373168945, 0.14972023665905, -0.6052197813987732, -0.5042384266853333, 0.08927726000547409, 0.40559911727905273, 0.01903754472732544, 0.2706380784511566, ...
images as xcopy doesn't copy all (hidden?) sectors, does it? Is xxcopy better? I don't want to type a name for each floppy. Disk Utility on the mac probably needs a bit too much keyboard or mouse action, but might be appescriptable Here is a script I used on my Linux box to perform the same type of task. Basically I...
[ 0.4691801369190216, 0.14211930334568024, 0.41808944940567017, 0.03127579391002655, -0.33262261748313904, -0.13256746530532837, 0.001772478106431663, -0.13865260779857635, -0.37073174118995667, -0.6809170842170715, 0.1544373780488968, 0.77546626329422, -0.483638197183609, 0.0987486839294433...
floppy" read -n 1 dd if=$floppydev of=/dev/null count=1 2> /dev/null errlvl=$? #if the disk isn't in the drive then wait while [ $errlvl -ne 0 ] do sleep 1 dd if=$floppydev of=/dev/null count=1 2> /dev/null errlvl=$? done filename=$(date +'img-%Y%m%d-%H%M%S.flp') if [ ! -f $savepath/$fi...
[ 0.47514355182647705, -0.009701402857899666, 0.7615277171134949, -0.3140759766101837, 0.05433500558137894, -0.2688951790332794, 0.20014116168022156, -0.707615852355957, -0.684630274772644, -0.22510381042957306, -0.3352610468864441, 0.9525074362754822, -0.15201452374458313, 0.199296474456787...
echo 'the image copy failed!' rm -i $savepath/$filename else mlabel -s -i $savepath/$filename :: md5sum $savepath/$filename > $savepath/$filename.md5 echo "copy complete" echo " " fi fi done ```
[ 0.2927108407020569, 0.2912949323654175, 0.33536991477012634, -0.3973534405231476, -0.07377323508262634, -0.14032791554927826, 0.6524359583854675, -1.0445696115493774, -0.14945030212402344, 0.07658159732818604, -0.11400368809700012, 0.5195592045783997, -0.580775797367096, 0.0215839259326457...
If you have a C# function with Sqlaccess, is it mandatory to close all objects/handles, or is everything cleaned up automatically once you exit the function For example: ``` void DoSqlStuff() { SqlConnection sqlConn = new SqlConnection(...); SqlCommand cmd = new SqlCommand(...); SqlDataReader sqlData= nul...
[ -0.16502726078033447, 0.1427469104528427, 0.603380024433136, -0.13939978182315826, 0.15530474483966827, -0.256184458732605, 0.35431429743766785, 0.16895879805088043, -0.22121380269527435, -0.4762127101421356, -0.570307195186615, 0.7111664414405823, -0.3112841844558716, 0.3129800856113434, ...
done with it. If you don't then the connection will remain open, and will not be available to handle other requests. The using statement is useful for this. It will call Dispose() on the object for you: ``` using (SqlConnection cn = new SqlConnection(connectionString)) { SqlCommand cm = new SqlCommand(command...
[ 0.3210913836956024, 0.016186930239200592, 0.5809227824211121, 0.07204131782054901, 0.2629144787788391, -0.3810177743434906, 0.06619065999984741, -0.04719461128115654, -0.4422914385795593, -0.5010525584220886, -0.31404241919517517, 0.4236297905445099, -0.19937172532081604, 0.441176384687423...
I've noticed on bank websites, etc, my user IDs aren't saved (they don't appear in a dropdown like other commonly entered stuff does) and there's no prompt for it to remember your password. How is this done? How do the sites notify the browser that they are in 'special' or else exceptions? Just curious. Usually you jus...
[ 0.4512327015399933, 0.45865216851234436, 0.22625455260276794, -0.06842979043722153, 0.4397966265678406, -0.14845465123653412, 0.21236029267311096, 0.10222930461168289, -0.344943642616272, -0.383722722530365, -0.13443244993686676, 0.36038827896118164, -0.20162470638751984, 0.155964478850364...
I have a small lightweight application that is used as part of a larger solution. Currently it is written in C but I am looking to rewrite it using a cross-platform scripting language. The solution needs to run on Windows, Linux, Solaris, AIX and HP-UX. The existing C application works fine but I want to have a single...
[ 0.32454434037208557, 0.3109889328479767, 0.17865484952926636, -0.031422488391399384, 0.028075862675905228, -0.10211239010095596, 0.04570707678794861, 0.16364313662052155, -0.04021889343857765, -0.9433331489562988, 0.07250644266605377, 0.5537804961204529, -0.24062930047512054, 0.11651281267...
to many times per second. As a consequence, keeping it's memory and startup time low are important. So basically I'm looking for the best scripting languages that is: * Cross platform. * Capable of XML parsing and HTTP Posts. * Low memory and low startup time. Possible choices include but are not limited to: bash/ks...
[ 0.34129077196121216, 0.0642285943031311, 0.16043232381343842, 0.06729820370674133, -0.08213353902101517, 0.02413073554635048, 0.31743159890174866, 0.17353090643882751, -0.15164250135421753, -0.7519021034240723, -0.11394232511520386, 0.6655678749084473, -0.1541934758424759, -0.1813108026981...
few ifdefs) or exploring the possibility of turning it into a service daemon that is always running. Of course this depends on how Python can have lower startup times if you compile the module and run the .pyc file, but it is still generally considered slow. Perl, in my experience, in the fastest of the scripting lan...
[ 0.3500070571899414, -0.08862641453742981, 0.04873271659016609, 0.18685442209243774, -0.3304046392440796, -0.15222331881523132, 0.26844266057014465, 0.19734910130500793, -0.45428338646888733, -0.5918474197387695, 0.06357138603925705, 0.6757785677909851, -0.19369806349277496, -0.166308954358...
the job of using a fast C based application easier.
[ 0.06468574702739716, -0.06810474395751953, -0.1595512479543686, 0.3264909088611603, -0.21321171522140503, -0.255502313375473, -0.05394721031188965, 0.0876634418964386, -0.045471493154764175, -0.5811092853546143, -0.13700197637081146, 0.6704214811325073, 0.06272950023412704, -0.298103272914...
I'm trying to open a file and create a list with each line read from the file. ``` i=0 List=[""] for Line in inFile: List[i]=Line.split(",") i+=1 print List ``` But this sample code gives me an error because of the `i+=1` saying that `index is out of range`. What's my problem here? How can I ...
[ 0.24383577704429626, 0.07783028483390808, 0.44995492696762085, -0.16640397906303406, -0.13798749446868896, 0.35402271151542664, 0.3763333559036255, -0.3642745614051819, -0.18491806089878082, -0.7602481842041016, -0.13235534727573395, 0.43623632192611694, -0.59765625, 0.09720151871442795, ...
file.
[ 0.18541590869426727, 0.23327282071113586, 0.11664856225252151, 0.377433180809021, 0.4377826452255249, -0.2228066474199295, -0.14906209707260132, 0.14225329458713531, -0.13097406923770905, -0.3212955594062805, -0.5051196813583374, 0.1254396140575409, -0.24438773095607758, 0.2972111403942108...
Let's say you have a two dimensional plane with 2 points (called a and b) on it represented by an x integer and a y integer for each point. How can you determine if another point c is on the line segment defined by a and b? I use python most, but examples in any language would be helpful. Check if the **cross product...
[ 0.304751455783844, 0.06816140562295914, 0.09621143341064453, 0.2318795919418335, -0.013589859940111637, 0.0736314207315445, -0.12091556191444397, 0.010753228329122066, -0.25986215472221375, -0.4651221036911011, -0.04650400951504707, 0.14472696185112, -0.1437201201915741, 0.1724825650453567...
the **dot product** of (b-a) and (c-a) is *positive* and is *less* than the square of the distance between a and b. In non-optimized pseudocode: ``` def isBetween(a, b, c): crossproduct = (c.y - a.y) * (b.x - a.x) - (c.x - a.x) * (b.y - a.y) # compare versus epsilon for floating point values, or != 0 if usin...
[ 0.03623528406023979, -0.08796060085296631, 0.14503280818462372, -0.34210923314094543, -0.06632887572050095, 0.2529243230819702, 0.15458905696868896, -0.5826305747032166, 0.06383445858955383, -0.6734319925308228, -0.09648185223340988, 0.5463151335716248, -0.37709730863571167, -0.09720285981...
if dotproduct < 0: return False squaredlengthba = (b.x - a.x)*(b.x - a.x) + (b.y - a.y)*(b.y - a.y) if dotproduct > squaredlengthba: return False return True ```
[ 0.12953269481658936, -0.12888233363628387, 0.6242053508758545, -0.42455506324768066, -0.11410964280366898, 0.10779595375061035, 0.2862569987773895, -0.4990670382976532, -0.011262061074376106, -0.24114522337913513, -0.30905720591545105, 0.5255497097969055, -0.4675304591655731, 0.15761542320...
I would like to be able to control a flash movie stream using JavaScript in the same pages as the flash component including: * Play and Pause stream * Change Stream I can already load the player and set the flash args, but I don't know how to interact with the player once the stream has started. Is this possible with...
[ 0.5602404475212097, 0.06534504145383835, 0.3816545903682709, -0.1750078648328781, -0.02680639736354351, -0.31112509965896606, 0.08721283823251724, -0.2161334753036499, -0.03732141852378845, -0.5621618628501892, 0.06467842310667038, 1.0786441564559937, -0.156199112534523, -0.028619637712836...
When I supply the script with the argument: hi[123].txt it will do exactly what I want. But if I specify the wildcard character ( hi\*.txt ) it will be re-reading some files. I was wondering how to modify this script to fix that silly problem: ``` #!/bin/sh count="0" total="0" FILE="$1" #FILE specification is now $...
[ 0.4861658215522766, 0.1880994439125061, 0.8011786937713623, -0.3706623911857605, 0.11543294042348862, -0.3706807792186737, 0.3885088264942169, -0.6746549010276794, -0.17378106713294983, -0.38809043169021606, -0.06661985069513321, 0.503497838973999, -0.3639262318611145, 0.025984615087509155...
0 fi # Start processing readable files while read line do if [[ "$line" =~ ^Total ]]; then tmp=$(echo $line | cut -d':' -f2)
[ 0.03638621047139168, -0.5919793844223022, 0.7104638814926147, -0.30129140615463257, 0.255634605884552, -0.04214096441864967, 0.4324988126754761, -0.4630905091762543, 0.0805043950676918, -0.3882938027381897, -0.4330582022666931, 0.5610047578811646, -0.4834364354610443, -0.28553956747055054,...
total=$(expr $total + $tmp) echo "$FILE (s) have a total of:$tmp " count=$(expr $count + 1) fi done < $FILE done echo " Total is: $total" echo " Number of files read is:$count" ``` On error, exit with a non-zero status. Also on error, report errors to stand...
[ 0.45421481132507324, -0.12804774940013885, 0.40681132674217224, -0.2972477972507477, 0.02420913428068161, 0.0596904419362545, 0.5928832292556763, -0.7248093485832214, -0.46586164832115173, 0.008453902788460255, -0.16867315769195557, 0.39702922105789185, -0.4636569917201996, 0.0998102799057...
not standard output - though that may be a bit advanced for you as yet. ``` echo "$0: file $FILE not readable" 1>&2 ``` The 1 is theoretically unnecessary (though I remember problems with a shell implementation on Windows if it was omitted). Echoing the script name '`$0`' at the start of the error message is a good ...
[ 0.22031435370445251, 0.03509093448519707, 0.19807757437229156, -0.012481849640607834, -0.11391942203044891, -0.2933419644832611, 0.3317769467830658, -0.042851194739341736, -0.2549015283584595, -0.4524688422679901, -0.16132503747940063, 0.7516176104545593, -0.29782214760780334, -0.212812170...
shell programming, but one of the important things with shell programming is knowing which programs to use.
[ 0.15935850143432617, 0.07559604197740555, -0.3518514037132263, 0.30596721172332764, -0.05369007959961891, -0.4462263584136963, 0.0070388223975896835, -0.03677395358681679, 0.06563569605350494, -0.6177833676338196, 0.11632972955703735, 1.0263009071350098, -0.10729724913835526, -0.1408120989...
I'd like to extract the text from an HTML file using Python. I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad. I'd like something more robust than using regular expressions that may fail on poorly formed HTML. I've seen many people recommend Beautiful Soup,...
[ 0.007287863176316023, 0.09482441842556, -0.07289833575487137, -0.0037076447624713182, -0.34021762013435364, 0.2950902581214905, 0.23582175374031067, 0.04518917202949524, -0.10989433526992798, -0.607894241809845, 0.0057485634461045265, 0.1521625816822052, -0.47553926706314087, -0.2150434404...
just as if I'd pasted the browser content into notepad. **Update** `html2text` looks promising. It handles HTML entities correctly and ignores JavaScript. However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation,...
[ -0.22545383870601654, 0.013441161252558231, 0.18425220251083374, -0.04635148122906685, -0.15964028239250183, -0.2794519364833832, 0.282335102558136, -0.2590726613998413, -0.1704859733581543, -0.6365727782249451, -0.15839160978794098, 0.5110140442848206, -0.24180740118026733, -0.29751273989...
I'm a php guy, but I have to do some small project in JSP. I'm wondering if there's an equivalent to htmlentities function (of php) in JSP. ``` public static String stringToHTMLString(String string) { StringBuffer sb = new StringBuffer(string.length()); // true if last char was blank boolean lastWasBlankCha...
[ 0.24289388954639435, -0.17739951610565186, 0.5022732019424438, -0.40569165349006653, -0.20196107029914856, -0.11928244680166245, 0.6496091485023499, -0.20786434412002563, -0.26094815135002136, -0.3176017105579376, -0.22227156162261963, 0.5977751016616821, -0.21207104623317719, 0.2395452708...
if (c == ' ') { // blank gets extra work, // this solves the problem you get if you replace all // blanks with &nbsp;, if you do that you loss // word breaking if (lastWasBlankChar) {
[ -0.14157648384571075, -0.20882545411586761, 0.06819023936986923, -0.06548617780208588, 0.07603473216295242, -0.1632254272699356, 0.5904750823974609, -0.0422985814511776, -0.43427857756614685, -0.5426146388053894, -0.5832153558731079, 0.3068990707397461, -0.07595167309045792, -0.04984636232...
lastWasBlankChar = false; sb.append("&nbsp;"); } else { lastWasBlankChar = true; sb.append(' ');
[ -0.2255483865737915, -0.21096526086330414, 0.3939649164676666, -0.508779764175415, 0.06098175421357155, -0.0017394169699400663, 1.2371922731399536, -0.45207563042640686, -0.1594659984111786, -0.3773082494735718, -0.38966104388237, 0.1324901133775711, -0.3580203354358673, 0.1430367976427078...
} } else { lastWasBlankChar = false; // // HTML Special Chars if (c == '"')
[ 0.08527422696352005, -0.20640671253204346, 0.3289600610733032, -0.1551259607076645, 0.287095844745636, -0.022557735443115234, 0.6255832314491272, -0.1182762011885643, -0.10967859625816345, -0.3300597369670868, -0.4856600761413574, 0.4456425607204437, -0.019621191546320915, -0.0735321938991...
sb.append("&quot;"); else if (c == '&') sb.append("&amp;"); else if (c == '<') sb.append("&lt;"); else if (c == '>')
[ 0.28955596685409546, -0.0640118420124054, 0.48093754053115845, -0.5878743529319763, 0.12314915657043457, 0.3298720121383667, 0.7305377721786499, -1.0411076545715332, -0.28667202591896057, -0.4028003215789795, -0.6169946789741516, 0.406281441450119, -0.7863255739212036, -0.07501276582479477...
sb.append("&gt;"); else if (c == '\n') // Handle Newline sb.append("&lt;br/&gt;"); else { int ci = 0xffff & c;
[ 0.3337097764015198, -0.10353758931159973, 0.6295762062072754, -0.5882498621940613, 0.04425138235092163, 0.1011141687631607, 0.6803881525993347, -0.7494838833808899, -0.06834844499826431, -0.5649983882904053, -0.3915940821170807, 0.25587329268455505, -0.7860330939292908, 0.19625644385814667...
if (ci < 160 ) // nothing special only 7 Bit sb.append(c); else { // Not 7 Bit use the unicode system
[ 0.5282578468322754, -0.1625802367925644, 0.4039788544178009, -0.2005767971277237, 0.09802931547164917, -0.1436941772699356, 0.13295888900756836, -0.44692462682724, -0.21422086656093597, -0.39899954199790955, -0.40028300881385803, 0.1577516496181488, -0.40286505222320557, -0.187897592782974...
sb.append("&#"); sb.append(new Integer(ci).toString()); sb.append(';'); } }
[ 0.16207703948020935, -0.09139346331357956, 0.5113306045532227, -0.5027827620506287, 0.18836940824985504, 0.3009885847568512, 0.4388512670993805, -0.6613200306892395, -0.23835857212543488, -0.48803335428237915, -0.3522503972053528, 0.1911771297454834, -0.8136952519416809, 0.1124933362007141...
} } return sb.toString(); } ```
[ -0.21493391692638397, -0.1102825254201889, 0.11001012474298477, -0.6111835241317749, 0.24047601222991943, -0.1861163079738617, 0.3441161513328552, -0.3776029348373413, -0.06536803394556046, -0.3839406669139862, -0.3724227547645569, 0.7322689294815063, -0.6045859456062317, 0.101425170898437...
I'm using PHP to generate thumbnails. The problem is that I have a set width and height the thumbnails need to be and often times the images are stretched. What I'd like is the image to remain at the same proportions and just have black filler (or any color) either on the left & right for tall images or top & bottom f...
[ 0.5810589790344238, 0.09498081356287003, 0.794791579246521, -0.11867360770702362, -0.1819135546684265, 0.3041357398033142, -0.01346859522163868, -0.44540300965309143, -0.12179017812013626, -0.7335659265518188, 0.16837859153747559, 0.6463397145271301, -0.06122244894504547, 0.041907608509063...
this page: <http://us3.php.net/imagecopyresampled>
[ -0.06028030812740326, -0.43396955728530884, 0.47814562916755676, 0.1628500372171402, -0.12935751676559448, -0.3572823405265808, -0.12291611731052399, 0.43102797865867615, -0.5052172541618347, -0.7008404731750488, -0.37787529826164246, 0.17402157187461853, -0.17245995998382568, 0.0115822004...
What are some *common*, *real world examples* of using the Builder Pattern? What does it buy you? Why not just use a Factory Pattern? The key difference between a builder and factory IMHO, is that a builder is useful when you need to do lots of things to build an object. For example imagine a DOM. You have to create pl...
[ 0.8120242953300476, -0.1045350730419159, -0.27883315086364746, 0.08936966955661774, -0.08248285949230194, -0.05393403023481369, 0.18443536758422852, -0.1666468232870102, -0.41085511445999146, -0.7436177730560303, 0.34512513875961304, 0.5555257201194763, -0.2771933376789093, 0.2431892603635...
model when building HTML fragments for example I might have a Builder for building a specific type of table and it might have the following methods **(parameters are not shown)**: ``` BuildOrderHeaderRow() BuildLineItemSubHeaderRow() BuildOrderRow() BuildLineItemSubRow() ``` This builder would then spit out the HTML...
[ 0.3561013340950012, -0.08051898330450058, 0.09202105551958084, -0.024536587297916412, -0.3248600661754608, -0.057642288506031036, 0.4580446183681488, -0.24526627361774445, -0.11419995129108429, -0.8983184695243835, 0.13978862762451172, 0.38514548540115356, -0.3003525137901306, 0.1685797721...
I have been working with PHP for a while now and would like to learn some Windows desktop-based GUI applications. Something similar to C# or Visual Basic would be nice, however I would like to learn a language that is open, similar to PHP. Please do not suggest anything that requires an expensive compiler or one that...
[ 0.333677738904953, 0.04446645453572273, -0.1519104689359665, 0.20067252218723297, -0.42366907000541687, -0.11252059042453766, 0.10922890156507492, 0.5358512997627258, -0.2219887524843216, -0.5932521224021912, 0.25633692741394043, 0.565223753452301, -0.13418102264404297, -0.1032843887805938...
suited to general purpose/admin scripts on unix boxes. There are GUI bindings (tk, gtk,...) for many languages - included "interpreted" ones that are closest (but still not that close) to php. Obvious examples would be python, ruby, or perl (though I'd greatly recommend one of the first two). However, none of these a...
[ 0.25047212839126587, 0.08054005354642868, 0.11515588313341141, 0.1023731529712677, -0.24239622056484222, -0.16421455144882202, -0.09811466187238693, 0.06624731421470642, -0.19746556878089905, -0.7862778902053833, -0.03452279046177864, 0.7206938862800598, -0.37869793176651, -0.2032984644174...
tool than going for something close to PHP. Don't even consider VB
[ 0.4342300593852997, -0.07456623017787933, -0.1624380350112915, 0.5098916888237, -0.10959624499082565, -0.3936211168766022, 0.1955428421497345, 0.371540367603302, -0.056288883090019226, -0.38866984844207764, 0.47293373942375183, 0.4184825122356415, 0.0019985355902463198, -0.0818289890885353...
How can I set default value in ActiveRecord? I see a post from Pratik that describes an ugly, complicated chunk of code: <http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model> ``` class Item < ActiveRecord::Base def initialize_with_defaults(attrs = nil, &block) initialize_without_defaults(attr...
[ -0.2573632001876831, -0.24635310471057892, 0.4130789637565613, -0.03869704157114029, 0.13849666714668274, -0.06647781282663345, 0.3142857551574707, -0.4410362243652344, -0.1376992017030716, -0.6522955298423767, -0.14414215087890625, 0.6104757189750671, -0.38133907318115234, -0.005089661106...
super self.status = ACTIVE unless self.status end ``` and ``` def after_initialize return unless new_record? self.status = ACTIVE end ``` I've also seen people put it in their migration, but I'd rather see it defined in the model code. Is there a canonical way to set default value for fields in...
[ 0.049436431378126144, -0.3250885009765625, 0.36252838373184204, -0.21775585412979126, 0.055771976709365845, -0.3658612370491028, 0.2662326693534851, -0.2521973252296448, -0.3718448877334595, -0.3972787857055664, -0.027638576924800873, 0.7621234059333801, -0.5292311906814575, 0.214701294898...
become the scope on which you find the model. If you just want to initialize some numbers to 0 then this is *not* what you want. 2. Defining defaults in your migration also works part of the time... As has already been mentioned this will *not* work when you just call Model.new. 3. Overriding `initialize` can work, but...
[ 0.3158441483974457, -0.24701876938343048, 0.33094173669815063, -0.01081082783639431, -0.16795720160007477, -0.3730383813381195, 0.44074052572250366, -0.1060335636138916, -0.308878093957901, -0.6931967735290527, -0.10765137523412704, 0.6349381804466248, -0.5949066281318665, 0.15210503339767...
3.0.3 I get the following warning in the console: > DEPRECATION WARNING: Base#after\_initialize has been deprecated, please use Base.after\_initialize :method instead. (called from /Users/me/myapp/app/models/my\_model:15) Therefore I'd say write an `after_initialize` callback, which lets you default attributes *in ad...
[ -0.5008352398872375, -0.022295357659459114, 0.41911327838897705, -0.29735949635505676, -0.0161692276597023, -0.08830264955759048, 0.39161810278892517, -0.4781896471977234, 0.06725039333105087, -0.5858574509620667, -0.0726570412516594, 0.7936464548110962, -0.24983163177967072, -0.0322462581...
build_address #let's you set a default association end end ``` Now you have **just one** place to look for initialization of your models. I'm using this method until someone comes up with a better one. Caveats: 1. For boolean fields do: `self.bool_field = true if self.bool_field.nil?` See Paul Russell's...
[ 0.1529960036277771, 0.35188934206962585, 0.15656442940235138, -0.22332258522510529, 0.16407573223114014, 0.05432021617889404, 0.3209103047847748, -0.3759427070617676, -0.1695655733346939, -0.6193674206733704, 0.00859135203063488, 0.48462435603141785, -0.40753820538520813, 0.288082152605056...