text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I just found out about the Yahoo UI [Reset CSS](http://developer.yahoo.com/yui/reset/) tool/file and I'm using it on my website. On my machine I have Internet Explorer 7 and Firefox 3.01 and my webpage looks the same on these two browsers. A friend is using Internet Explorer 6 and the page is completely a mess. I have...
[ 0.7501708269119263, 0.29980501532554626, -0.03511805459856987, -0.017618563026189804, -0.29051241278648376, 0.051751427352428436, 0.38836729526519775, -0.010429270565509796, -0.24791355431079865, -0.9465581178665161, 0.2667964994907379, 0.6149553656578064, -0.13063453137874603, -0.10784538...
various browsers on Linux/Windows/Mac OS/BSD.
[ 0.11062696576118469, 0.0537753701210022, -0.17103537917137146, 0.08584534376859665, -0.12106367200613022, 0.17804472148418427, 0.18969915807247162, 0.6137223839759827, -0.22913850843906403, -0.7849316596984863, -0.43392178416252136, 0.11066101491451263, -0.15807856619358063, 0.036083757877...
For quick tasks where I only use an instantiated object once, I am aware that I can do the following: ``` int FooBarResult = (new Foo()).Bar(); ``` I say this is perfectly acceptable with non-disposable objects and more readable than the alternative: ``` Foo MyOnceUsedFoo = new Foo(); int FooBarResult = MyOnceUsedF...
[ -0.13111472129821777, 0.004096859134733677, 0.14453580975532532, 0.025360263884067535, -0.03724216669797897, 0.12349212914705276, 0.2203698754310608, 0.009006899781525135, -0.299116849899292, -0.5020571351051331, -0.38001012802124023, 0.40147534012794495, -0.47857439517974854, -0.123640775...
will be far from uniform. --- Other than that, in general, there is not much difference between the two. The compiler will most probably generate the exact same code in either case. You should go with the most readable case (long statements might harm readability; more code will do it too, so you have to make the tra...
[ 0.14817671477794647, 0.13742679357528687, 0.03417610377073288, 0.11986052244901657, -0.18151146173477173, 0.09622874855995178, 0.49884289503097534, -0.03025294467806816, -0.027601614594459534, -0.4892585873603821, -0.41187936067581177, 0.4604608714580536, -0.2686111330986023, -0.2929505705...
I am trying to find a way to get the list of method calls inside a lambda expression in C# 3.5. For instance, in the code below, I would like to method LookAtThis(Action a) to analyze the content of the lambda expression. In other words, I want LookAtThis to return me the MethodInfo object of Create. ``` LookAtThis((...
[ 0.12766195833683014, 0.05544281378388405, 0.15962842106819153, -0.039152152836322784, -0.03310514613986015, -0.06090853735804558, 0.1989593803882599, -0.25917279720306396, -0.06235012412071228, -0.2997124493122101, -0.03489001467823982, 0.5584469437599182, -0.2767365872859955, -0.193933039...
the code I use in protobuf-net to do RPC based on lambdas.
[ 0.2608047425746918, 0.13726720213890076, -0.009877463802695274, -0.25550973415374756, -0.08457214385271072, -0.36286991834640503, -0.10159154236316681, -0.023276519030332565, 0.21094007790088654, -0.5028762817382812, 0.26751136779785156, 0.39213860034942627, -0.3912237286567688, 0.06796884...
What are the best practices in building applications that support multiple tenants such as Software as a Service? Links to white papers that expand on this topic are greatly appreciated. You might find some valuable advise in a series of blog posts by Oren Eini. This is one of the last posts in the series, with links...
[ 0.7132889032363892, 0.522150456905365, -0.12491726875305176, -0.11632054299116135, 0.017707349732518196, -0.02033618651330471, 0.05705656856298447, -0.4857505261898041, -0.054185520857572556, -0.13869093358516693, -0.21890564262866974, 0.06145011633634567, 0.2985227704048157, 0.25788772106...
I like to create a batch file (winxp cmd) that recursively goes through a chose folder and sub folders and renames there files+folders with the following rules: from all file + folder names, all uppercase+lowercase "V" and "W" letters need to be replaced with letters "Y" and "Z". e.g. 11V0W must become 11Y0Z. I bel...
[ 0.27654382586479187, 0.19730693101882935, 0.21577094495296478, -0.038863249123096466, -0.031223678961396217, -0.08074720203876495, 0.3173425793647766, 0.22920449078083038, -0.1806943565607071, -0.5449069142341614, -0.22276760637760162, 0.33777567744255066, -0.12589456140995026, 0.154372975...
(at least I couldn't come up with a non-infinite solution so far): ``` @echo off setlocal enableextensions for /r %%f in (*) do call :process "%%f" endlocal goto :eof :process pushd "%~dp1" set fn=%~nx1 set fn=%fn:V=Y% set fn=%fn:W=Z% ren "%~nx1" "%fn%" popd goto :eof ``` But in theory it shouldn't be too hard to t...
[ -0.2260570228099823, -0.16132229566574097, 0.5718546509742737, -0.41233018040657043, 0.0935380607843399, 0.2896571457386017, 0.438447505235672, -0.41160789132118225, 0.14237436652183533, -0.33468106389045715, -0.26157161593437195, 0.6630576848983765, -0.23773930966854095, 0.074467122554779...
I have a database of company registrants (for a search/directory functionality). We've added a new table to hold "enhanced" information for registrants that pay for this feature (such as advertisements/additional images/logos etc). Right now the new table just holds the registrants unique identifier, and a few addition...
[ 0.7166647911071777, 0.4565872848033905, 0.5669218897819519, -0.004016623832285404, 0.3166715204715729, -0.23847338557243347, -0.18642890453338623, -0.015098833478987217, -0.2822836637496948, -0.4297749996185303, 0.10556406527757645, 0.4377883970737457, 0.14112775027751923, 0.20650476217269...
can I accomplish this? There are several pieces to this: * you need to come up with EMACS functions to do all the reformatting you want. `indent-region` is a start, but you might also want to untabify or some other things. * you need to invoke them on each file, and since the indent functions work on ranges, you need ...
[ 0.2642393410205841, 0.11854149401187897, 0.2702365219593048, 0.052527401596307755, -0.22806791961193085, 0.05724300816655159, 0.38354793190956116, -0.43404123187065125, -0.31575971841812134, -0.5926377773284912, 0.013298551551997662, 0.5844976902008057, 0.014865885488688946, 0.005591382738...
I am learning Rails the age old way. By reading Agile Web Development with Rails (3rd Edition) as a starting point. I am currently in the chapter that teaches Testing. I am also aware of other BDD Testing framework such as RSPec. So I was wondering if frameworks such as RSpec, Cucumber, Shoulda replace the need for kno...
[ 0.783791720867157, -0.015810344368219376, -0.05954138562083244, 0.12508247792720795, -0.44972914457321167, -0.4019281268119812, 0.8102133274078369, 0.22582772374153137, -0.36605358123779297, -0.9719029664993286, 0.48965904116630554, 0.34053725004196167, 0.39292392134666443, 0.0596842914819...
changed! Check down and upvote @prusswan** I think Test::Unit is still relevant even though there is a lot of hype surrounding BDD and other testing tools. That being said, if you are up for it, you could bypass learning Test::Unit and start with something like RSpec and Shoulda right away, but there is something to ...
[ 0.7078672051429749, -0.13516294956207275, 0.24128824472427368, -0.019428042694926262, -0.2661486268043518, -0.013845916837453842, 0.14825600385665894, 0.06861688941717148, -0.4724501967430115, -0.7680374383926392, 0.26329004764556885, 0.6039639711380005, -0.059495072811841965, 0.2454485893...
don't think it's obsolete but it's not the cutting edge any more. BDD is a testing paradigm shift especially if you start using Cucumber and Webrat, but it's fantastic once you get into it. Shoulda is the easiest to make the transition to, so I would start with Test::Unit, then move to Shoulda, then Give RSpec and Cucu...
[ 0.6041572093963623, -0.20674076676368713, 0.06386364251375198, 0.08188795298337936, -0.1799517273902893, -0.14521750807762146, -0.2796182632446289, 0.36366358399391174, -0.03335541859269142, -0.6934959292411804, 0.3862949013710022, 0.51869797706604, 0.11679079383611679, 0.05983119457960129...
Quick question here: why not ALWAYS use ArrayLists in Java? They apparently have equal access speed as arrays, in addition to extra useful functionality. I understand the limitation in that it cannot hold primitives, but this is easily mitigated by use of wrappers. If you need a collection of primitives, then an array ...
[ 0.5100486278533936, 0.1407923549413681, -0.47792044281959534, 0.0698024109005928, -0.3257429301738739, -0.15629400312900543, 0.24975259602069855, -0.44991883635520935, -0.26637670397758484, -0.638361930847168, 0.05827532708644867, 0.5501040816307068, -0.2902482748031616, -0.494919836521148...
an array and an `ArrayList`, however. If a `List` will provide better, cleaner, more maintainable code, then I will always use a `List` (or `Collection` or `Set`, etc, as appropriate, but your question was about `ArrayList`) unless there is some compelling reason not to. Performance is **rarely** that compelling reason...
[ 0.48197850584983826, 0.06584538519382477, -0.13428977131843567, 0.22533643245697021, -0.26531341671943665, -0.2119579017162323, 0.24855707585811615, -0.39596033096313477, -0.3344274163246155, -0.7224031090736389, -0.29734885692596436, 0.4997560381889343, -0.3673745095729828, -0.14880289137...
be trivially swapped in and out for each other * A Collection can be trivially converted to an array, if *occasional* use of an array version is useful * Many Collections grow more gracefully than an array grows, which can be a performance concern * Collections work very well with generics, arrays fairly badly * As Tof...
[ 0.2836489677429199, -0.38324040174484253, -0.16682125627994537, 0.3687642812728882, -0.28180167078971863, -0.10631397366523743, 0.274458646774292, -0.14832259714603424, -0.4068783223628998, -0.49798303842544556, -0.16232945024967194, 0.2363809198141098, -0.2861587405204773, 0.0910613685846...
yourself. If an array needs to be resized, you have to do that yourself. All of this together, I rarely use arrays and only a little more often use an `ArrayList`. However, I do use `List`s very often (or just `Collection` or `Set`). My most frequent use of arrays is when the item being stored is a primitive and will ...
[ 0.644466757774353, 0.0551949106156826, -0.30776768922805786, 0.1260344386100769, -0.0642300471663475, -0.014536907896399498, 0.13510611653327942, -0.20637980103492737, -0.4809586703777313, -0.6738010048866272, 0.003643149510025978, 0.5578787326812744, -0.3745458126068115, -0.27935662865638...
the form in which it is always referenced. (That is, 'int' instead of 'Integer'.)
[ -0.09103155881166458, 0.17955940961837769, 0.3442417085170746, -0.2015182226896286, -0.08702921867370605, 0.013663764111697674, -0.06302235275506973, -0.028092266991734505, 0.02549746260046959, -0.21513545513153076, -0.44430267810821533, 0.2645072937011719, -0.13586784899234772, 0.03048642...
One of the requirements for the twitter client we are developing for the community is a spellcheck component. What are some of the spellcheck components/systems you have used in applications and what was your experience using it? Windows comes with a spell checker API (Windows 8). ``` TWindow8SpellChecker = class(TCus...
[ 0.07181625068187714, 0.09055770188570023, 0.47165337204933167, 0.013114015571773052, -0.13542047142982483, 0.1398475021123886, 0.6499001979827881, -0.28002774715423584, 0.16116029024124146, -0.5946178436279297, -0.21549111604690552, 0.19253858923912048, -0.3986378610134125, 0.0040365965105...
factory := CoSpellCheckerFactory.Create; OleCheck(factory.CreateSpellChecker(LanguageTag, {out}FSpellChecker)); end; procedure TWindow8SpellChecker.Check(const text: UnicodeString; const Errors: TList); var enumErrors: IEnumSpellingError; error: ISpellingError; spellingError: TSpellingError; begin ...
[ 0.024716634303331375, 0.03888631984591484, 0.42098313570022583, -0.5089372992515564, 0.20002059638500214, 0.6575416326522827, 0.9378173351287842, -0.21736106276512146, -0.1750374436378479, -0.4724230468273163, -0.487701416015625, 0.12022003531455994, -0.6145346760749817, 0.2835142612457275...
error.Length, error.CorrectiveAction, error.Replacement); Errors.Add(spellingError); end; end; function TWindow8SpellChecker.Suggest(const word: UnicodeString; const Suggestions: TStrings): Boolean; var hr: HRESULT; enumSuggestions: IEnumString; ws: PWideChar; ...
[ -0.11612231284379959, -0.09563608467578888, 0.3807903230190277, -0.40650567412376404, -0.16989150643348694, 0.37829557061195374, 0.5028107166290283, -0.4845150411128998, 0.20443730056285858, -0.6017100214958191, -0.4345567524433136, 0.24480795860290527, -0.19720979034900665, 0.232983037829...
Exit; end; hr := FSpellChecker.Suggest(word, {out}enumSuggestions); OleCheck(hr); Result := (hr = S_OK); //returns S_FALSE if the word is spelled correctly ws := ''; while enumSuggestions.Next(1, {out}ws, {out}@fetched) = S_OK do begin if fetched < 1 then Continue; ...
[ -0.03430642560124397, 0.010682745836675167, 0.5189248323440552, -0.44178441166877747, 0.19726337492465973, 0.18518419563770294, 0.6128960847854614, -0.3283010721206665, 0.058161795139312744, -0.741482675075531, -0.49959596991539, 0.13935108482837677, -0.07231125235557556, 0.481190592050552...
end; end; ``` The **TSpellingError** object is a trivial wrapper around four values: ``` TSpellingError = class(TObject) protected FStartIndex: ULONG; FLength: ULONG; FCorrectiveAction: CORRECTIVE_ACTION; FReplacement: UnicodeString; public constructor Create(StartIndex, Length: ULONG; Corrective...
[ -0.4464368224143982, 0.14950336515903473, 0.580353319644928, -0.13891617953777313, -0.14521510899066925, 0.4524923264980316, 0.328995943069458, -0.5007150769233704, -0.1327536553144455, -0.023600148037075996, -0.6689888834953308, 0.5015687942504883, -0.5440348982810974, -0.0678357034921646...
I'm trying to make my own [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG) editor. Is there a way to get the text which has the user selected in a [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea)? For example, if the user selects some word and then clicks button, how do I find out which t...
[ 0.5394093990325928, 0.008349831216037273, 0.14877949655056, -0.028155842795968056, -0.32129383087158203, -0.013576727360486984, 0.059789836406707764, 0.1573023796081543, -0.19309307634830475, -0.7202432751655579, 0.055941902101039886, 0.4305945336818695, -0.08706606924533844, -0.0181369557...
I'm working on a PHP web interface that will receive huge traffic. Some insert/update requests will contain images that will have to be resized to some common sizes to speed up their further retrieval. One way to do it is probably to set up some asynchronous queue on the server. Eg. set up a table in a db with a tasks...
[ 0.5240359902381897, 0.08576735854148865, 0.20861615240573883, 0.3562685251235962, -0.10665921121835709, -0.054026857018470764, 0.008249824866652489, 0.0090213967487216, -0.18533380329608917, -0.7178801894187927, 0.37638744711875916, 0.21807317435741425, -0.281179815530777, 0.18852165341377...
Java, or maybe something lighter would do? If what you're doing is really high volume then what you're looking for is something like [beanstalkd](http://xph.us/software/beanstalkd/). It is a distributed work queue processor. You just put a job on the queue and then forget about it. Of course then you need something at...
[ 0.18980304896831512, -0.055360548198223114, -0.17665810883045197, -0.0021768328733742237, -0.14871445298194885, 0.048659343272447586, -0.004848190117627382, 0.12235241383314133, -0.6251177787780762, -0.8651894330978394, -0.12991870939731598, 0.275836706161499, -0.5011216402053833, 0.088639...
up by work becoming available. The advantage of this kind of approach is you can tailor the number of workers to how much work needs to get done and beanstalkd handles distributed prorcessing (in the sense that the listners can be on different machines).
[ 0.5598835945129395, -0.22483332455158234, 0.2287321388721466, 0.11424807459115982, -0.20002612471580505, -0.05047179386019707, 0.049870118498802185, -0.3062046766281128, -1.0304723978042603, -0.6073914766311646, 0.08380784094333649, 0.07575976848602295, -0.33265334367752075, 0.229182124137...
``` $split_point = ' - '; $string = 'this is my - string - and more'; ``` How can I make a split using the second instance of `$split_point` and not the first one. Can I specify somehow a right to left search? Basically how do I explode from right to left. I want to pick up only the last instance of " - ". Result I...
[ 0.17242474853992462, 0.03645005077123642, 0.19494430720806122, -0.02703162468969822, -0.19101758301258087, -0.0747174397110939, 0.07009656727313995, -0.3176496624946594, -0.43796107172966003, -0.15701866149902344, -0.29615649580955505, 0.5794646143913269, -0.35492151975631714, 0.2852376103...
array_map('strrev', explode($split_point, strrev($string))); ``` Not sure if this is the best solution though.
[ 0.08453203737735748, -0.26398399472236633, 0.23125244677066803, -0.26945194602012634, 0.1338992416858673, -0.3180249333381653, 0.26534873247146606, -0.10061687976121902, -0.23028570413589478, -0.33625271916389465, -0.0847247764468193, 0.5379694104194641, -0.3846507966518402, 0.009421675466...
I am developing a PHP application that uses SQLite as database management system, MySQL and PostgreSQL etc. is not an alternative (although I would really like to use pgsql), because I want the setup to be very beginner-friendly and zero-headache alike. Now many people use a shared hosting, and alot of them only offer ...
[ 0.3554990887641907, 0.4077369272708893, 0.3434542715549469, 0.12498395144939423, 0.08489671349525452, -0.28282594680786133, -0.1219378262758255, 0.24751269817352295, -0.2544722259044647, -0.5474839806556702, 0.07827410101890564, 0.5092822313308716, -0.013301949016749859, 0.2412606775760650...
protection from that, that is simple and also supported on all HTTP servers? You can use a .htaccess file and lock down the database name so it's not externally accessible. Many servers will already do this for all filenames starting with a ".". This will work on Apache of course, but you'll still need fixes for other ...
[ 0.35554853081703186, 0.16278763115406036, 0.16554901003837585, 0.20510831475257874, 0.13408228754997253, -0.4882447421550751, 0.5701634883880615, -0.25814566016197205, -0.2513636648654938, -0.4642520248889923, 0.06537739932537079, 0.728095531463623, -0.1546444594860077, 0.0780072808265686,...
read and written to by the same user as the web server, there's no easy way to lock it down from external access. Hiding it and moving it are the only real solutions I can think of.
[ 0.38544875383377075, 0.34142380952835083, 0.1628340184688568, 0.22689032554626465, 0.33905503153800964, -0.06391970068216324, 0.218165785074234, 0.23561792075634003, -0.13921508193016052, -0.3224567770957947, -0.14343224465847015, 0.20315943658351898, -0.09227020293474197, 0.38430473208427...
In the US, you use a "." as the separator, but in Germany you use a ",". I'm trying to test whether my logic is smart enough to handle either one but I seem to be failing to put my Windows 2000 machine into German mode. I went to Control Panel, Regional Options, and changed "Your locale" to "Germany". I then restarted...
[ 0.2694427967071533, -0.05204073339700699, 0.7685166597366333, 0.13438454270362854, 0.019477086141705513, -0.106556236743927, 0.047792527824640274, 0.07452033460140228, -0.24570171535015106, -0.545496940612793, -0.15231652557849884, -0.012141682207584381, -0.07670581340789795, 0.48827949166...
to add a globalization element to your web.config, e.g.: ``` <system.web> <globalization culture="de-DE" uiCulture="en-US" /> </system.web> ``` Changing culture to de-DE will affect date and numeric formats: you could also change uiCulture if you want, leaving uiCulture as en-US means you will get exception messa...
[ 0.4204145669937134, -0.22407223284244537, 0.281246542930603, 0.4385624825954437, -0.0444767102599144, -0.10266847908496857, -0.05524984747171402, 0.43192270398139954, -0.42204463481903076, -0.7241907119750977, -0.20210540294647217, -0.008700402453541756, -0.19064907729625702, 0.31435558199...
I know there is a requirement in their EULA, but I heard about people getting their apps developed on Windows into the app store. How can Apple find out, or do they even know? They don't, so if you get a native compiler and toolset up and running on Windows, more power to you. But realize that: 1. You will not be ab...
[ 0.41595977544784546, 0.35547271370887756, 0.12984128296375275, 0.26595649123191833, 0.14812684059143066, -0.007772837299853563, 0.5028231739997864, -0.0015771574107930064, -0.0024564010091125965, -0.9142310619354248, -0.16233183443546295, 0.7535040378570557, -0.37501105666160583, -0.202353...
equivalent or an iPhone Simulator equivalent. You're going to be writing a lot of code and spending a lot more time testing. 3. You won't have local documentation. You'll either have to use Apple's website or rely on third-party documentation which may mix App Store-allowed and -forbidden methods without indicating whi...
[ 0.39116400480270386, -0.12550431489944458, 0.23726677894592285, 0.4337470829486847, 0.1526629477739334, -0.06301288306713104, 0.35236790776252747, -0.08793417364358902, 0.05255564674735069, -0.7255184650421143, 0.13475210964679718, 0.687531590461731, -0.392957478761673, -0.2669488191604614...
tools, or your platform. People using the official SDK can file bug reports on the tools just as easily as the platform. 7. Your tech support incidents are worthless, because you're violating your contracts. 8. If Apple ever *does* find out, you're likely to be kicked out of the App Store and all your work will be for ...
[ 0.6202201843261719, 0.05758436396718025, 0.15813803672790527, 0.7558484077453613, 0.3565005958080292, -0.16883184015750885, 0.18334946036338806, 0.05160895362496376, -0.23589131236076355, -0.6309925317764282, -0.08068547397851944, 1.1288374662399292, -0.01590394414961338, -0.15163598954677...
and think of all the money you're *not* spending on a factory, a store, offices, inventory, or employees during your setup time.
[ 0.9305081367492676, 0.253131240606308, -0.37188225984573364, 0.2625812292098999, 0.3679434657096863, 0.21929816901683807, 0.05815960466861725, 0.1352037489414215, -0.35498517751693726, -0.5080593228340149, 0.014232736080884933, 0.37624019384384155, -0.035584013909101486, 0.0016792158130556...
Suppose I have the following two classes in two different assemblies: ``` //in assembly A public class TypeA { // Constructor omitted public void MethodA { try { //do something } catch { throw; } } } //in assembly B public class TypeB { public void MethodB { tr...
[ 0.1896345168352127, -0.13722006976604462, -0.2969018220901489, -0.4680071771144867, -0.17581239342689514, 0.03001498617231846, 0.18999363481998444, -0.3617574870586395, 0.17231494188308716, -0.5160936713218689, -0.1675662100315094, 0.16161447763442993, -0.470283567905426, 0.179773107171058...
a.MethodA(); } catch (Exception e) //Handle exception } } } ``` In this case, the try-catch in MethodA just elevates the exception but doesn't really handle it. Is there any advantage in using try-catch at all in MethodA? In other words, is there a difference between this kind of try-catch bl...
[ 0.119786337018013, -0.14843308925628662, -0.1353127807378769, 0.04102552309632301, -0.13538974523544312, -0.4222286343574524, 0.14407142996788025, -0.19495119154453278, -0.1968429982662201, -0.30759701132774353, -0.13077875971794128, 0.2708309292793274, -0.5192216634750366, -0.161406710743...
a specific exception. ``` public void Foo() { try { // Some service adapter code // A call to the service } catch (ServiceBoundaryException) { throw;
[ 0.34094107151031494, -0.053189054131507874, 0.13690614700317383, -0.48937979340553284, 0.15938661992549896, -0.06414946168661118, 0.6468648910522461, -0.10438451170921326, 0.07467949390411377, -0.30036893486976624, -0.51273512840271, 0.4802020192146301, -0.5576083064079285, 0.3091640770435...
} catch (Exception ex) { throw new AdapterBoundaryException("some message", ex); } } ``` This allows you to easily identify which boundary an exception occurred in. In this case, you would need to ensure your boundary exceptions are only thrown for code specific to the boundary...
[ 0.08492029458284378, -0.30275827646255493, 0.08490622043609619, -0.0956706553697586, 0.03243958204984665, -0.3805460035800934, 0.2645348608493805, -0.17136073112487793, -0.13375109434127808, -0.3701489269733429, -0.08905688673257828, 0.16810423135757446, -0.4681091010570526, 0.238892450928...
I'm trying to figure out what is the smartest way to name private methods and private static methods in C#. Background: I know that the best practice for private members is underscore-prefix + camelcase. You could argue this with me, but trust me I've seen enough code from hardcore pros that follow this convention, it...
[ 0.32489272952079773, 0.25794360041618347, -0.32625576853752136, 0.21856854856014252, -0.11449116468429565, -0.2379496991634369, 0.13653583824634552, -0.015722470358014107, -0.30519720911979675, -0.2262060046195984, -0.09816351532936096, 0.8213818669319153, -0.2402781844139099, -0.125849336...
best practice style for private and private static method naming in C#? If there are certain styles that are used from some private methods and not others, I can understand that, just explain. Thanks for reading. Check out the Microsoft's [Naming Guidelines](http://msdn.microsoft.com/en-us/library/xzf533w0%28VS.71%29...
[ 0.2632521688938141, 0.16427966952323914, 0.0006016361294314265, -0.027564283460378647, 0.19276711344718933, -0.33528944849967957, 0.42402103543281555, 0.06663103401660919, -0.02234436757862568, -0.5467398762702942, -0.1142592802643776, 0.6872230768203735, -0.011115661822259426, 0.010269388...
In many discussions I have heard about Ruby in which people have expressed their reservations about the language, the issue of monkey patching comes up as one of their primary concerns. However, I rarely hear the same arguments made in the context of Python although it is also permitted in the Python language. Why ...
[ 0.6182798147201538, 0.4628804922103882, -0.6268655061721802, -0.28764522075653076, -0.27720800042152405, -0.4155413806438446, 0.4373132884502411, 0.40319979190826416, -0.5871142745018005, -0.18791604042053223, -0.19772641360759735, 0.904733419418335, -0.37739425897598267, -0.12787368893623...
and Java programmers would ‘bash’ Python, stating that it wasn't a real language, and that the dynamic nature of its types would be dangerous, and allow people to create ‘bad’ code. As Python became more popular, and the advantages of its rapid development time became apparent, not to mention the less verbose syntax: ...
[ -0.2748837172985077, 0.03338058665394783, -0.1738613396883011, -0.19091545045375824, -0.369723916053772, -0.1222919374704361, 0.4983443021774292, -0.07475054264068604, -0.4775906503200531, -0.3033691644668579, -0.14389245212078094, 0.6901991963386536, -0.7806533575057983, -0.10348536819219...
some amusement that I saw one of the key flexible features of Ruby – Monkey Patching, being touted as dangerous by the Python crowd. Having started teaching Ruby to students this year, I think that being able to ‘fix’ the implementation of an existing class, even one that is part of the system, is very powerful. Sure,...
[ 0.3844028115272522, 0.21818920969963074, -0.35438376665115356, 0.10093282163143158, -0.06506248563528061, -0.14703978598117828, 0.5981400609016418, 0.4146426022052765, -0.5197810530662537, -0.3526104688644409, 0.023595742881298065, 0.685684859752655, -0.23313012719154358, -0.26659631729125...
around since Smalltalk.
[ 0.16371667385101318, -0.0081449830904603, -0.01311366818845272, -0.5549224615097046, -0.08394119143486023, -0.25432950258255005, -0.06070414558053017, 1.0571810007095337, -0.9148371815681458, -0.1832161694765091, 0.03296241536736488, 0.4472503960132599, -0.01328249555081129, 0.071775875985...
I'm developing an iPhone game and currently using AVAudioPlayer for playing background music and sounds. From what I've been reading, I'm not sure if that's the best way, but other alternatives seem to be overly complex. Is there any good open source framework that works on the iPhone and I can integrate? I only need ...
[ 0.40161144733428955, -0.11215343326330185, 0.1451842337846756, 0.127337247133255, 0.29674890637397766, -0.04967712238430977, 0.07244562357664108, 0.18305470049381256, -0.10743308812379837, -0.7875566482543945, 0.05934733524918556, 0.8327488303184509, -0.025176946073770523, -0.1110590249300...
AVAudioPlayer meets your needs. On the one hand you didn't mention any shortcomings you've encountered, but on the other hand your asking for alternatives suggests there are some. If AVAudioPlayer does meet your needs, why make life difficult? If AVAudioPlayer does not meet your needs, you need to explain what else y...
[ 0.36949899792671204, -0.20639628171920776, -0.2530003786087036, 0.44280949234962463, 0.23667533695697784, 0.2991540729999542, -0.1507989466190338, 0.20181894302368164, 0.05282791331410408, -0.7415175437927246, -0.002977925119921565, 0.5615500807762146, -0.4215090274810791, -0.2037876993417...
I am trying to implement MODE Z compression for FTP using C# for an FTP client that I have written. My understanding is that MODE Z uses the same compression as zlib. I cannot get zlib.net from componentace to work. It hacks off the last part of the file after the upload to a FileZilla FTP Server. Where are the specs f...
[ 0.3488234281539917, 0.06604378670454025, 0.48928120732307434, -0.03766067326068878, -0.222204327583313, -0.24050550162792206, 0.09642846882343292, -0.04643175005912781, 0.08666099607944489, -0.6181182265281677, 0.005794687662273645, 0.6037452816963196, -0.21941331028938293, 0.1273504793643...
from September 2005. You might try emailing one of the authors for current status if you get really stuck (see section 7, *Authors' addresses*). RFCs [1950](http://www.ietf.org/rfc/rfc1950.txt) and [1951](http://www.ietf.org/rfc/rfc1951.txt) (zlib and deflate respectively) may also be useful to you for low-level debu...
[ -0.08306510746479034, 0.05247221142053604, 0.5891104936599731, -0.12388776242733002, -0.40875765681266785, -0.3469996750354767, 0.17260944843292236, 0.20789241790771484, -0.25144463777542114, -0.1990519016981125, -0.42459478974342346, 0.4326937198638916, -0.36316657066345215, 0.27066060900...
taking place: are you sure it's in the compression library? Can you dump the compressed data before you upload? Can you watch the bytes go over the wire? Can you trace the server side to see if it receives the entire file (but then truncates it)?
[ 0.2210957109928131, -0.2925717532634735, 0.21625015139579773, 0.15595842897891998, 0.3578851521015167, -0.08604781329631805, -0.13909661769866943, -0.30529430508613586, -0.1650184988975525, -0.3142603933811188, -0.09085496515035629, 0.4015401005744934, -0.06299218535423279, -0.091295443475...
I am trying to create nested repeaters dynamically using ITemplate. This repeater is like that I am passing `List<Control>` and it generates repeater. Issue is that when I databound outer repeater. Only the last nested repeater shows. Following is screen shot. [![screen shot](https://i.stack.imgur.com/PaT4Y.png)](http...
[ 0.2929328978061676, 0.0052191028371453285, 0.5269814133644104, -0.26116257905960083, -0.21010984480381012, 0.12637820839881897, 0.3937538266181946, -0.35315313935279846, -0.2260962873697281, -0.6909772157669067, 0.21862661838531494, 0.4123721718788147, -0.22799141705036163, 0.2991714775562...
<td> <asp:PlaceHolder ID="phControls" runat="server" /> </td> </tr> </table> </div> </form> </body> </html> ``` --- **Code Behind** --- ``` using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ...
[ 0.16426187753677368, -0.15111684799194336, 0.5220396518707275, 0.06772605329751968, 0.03844720870256424, 0.12840767204761505, -0.03290542960166931, -0.5218631625175476, -0.3853854537010193, -0.5865352749824524, -0.36486929655075073, 0.3408888280391693, -0.3156810998916626, 0.20892158150672...
{ Repeater childRpt = new Repeater(); List repeatingRuleControls = new List(); repeatingRuleControls.Add(new TextBox()); repeatingRuleControls.Add(new TextBox()); repeatingRuleControls.Add(new TextBox()); RepeatingRuleTemplate repeatingRuleTemplate = new RepeatingRuleTemp...
[ -0.1192028746008873, 0.02287141978740692, 0.5528662800788879, -0.13572043180465698, 0.05697019770741463, 0.7632908225059509, 0.5732032656669617, -0.5296046733856201, -0.3684769570827484, -0.3828597068786621, 0.1321655511856079, 0.11355970799922943, -0.2632504403591156, 0.9088636636734009, ...
childRpt.DataSource = new DataRow[4]; Repeater parentRpt = new Repeater(); repeatingRuleControls = new List(); repeatingRuleControls.Add(new TextBox()); repeatingRuleControls.Add(new TextBox()); repeatingRuleControls.Add(new TextBox()); repeatingRuleControls.Add(childRpt...
[ 0.012859510257840157, 0.03562745451927185, 0.6418114900588989, -0.027056381106376648, 0.14278453588485718, 0.6618768572807312, 0.3651835024356842, -0.396846741437912, -0.4056060016155243, -0.37027695775032043, -0.019748330116271973, 0.05872068554162979, -0.19951127469539642, 0.897156119346...
parentRpt.ItemTemplate = parentrepeatingRuleTemplate; parentRpt.FooterTemplate = new RepeatingRuleTemplate(ListItemType.Footer, null); parentRpt.DataSource = new DataRow[4]; parentRpt.DataBind(); phControls.Controls.Add(parentRpt); } public class RepeatingRuleTemplate : ITemplat...
[ 0.00895072240382433, 0.05203850567340851, 0.5582677721977234, -0.1464836597442627, 0.19562867283821106, 0.7100309729576111, 0.2822130620479584, -0.28460049629211426, -0.35177484154701233, -0.1714351624250412, -0.009548824280500412, -0.07501009851694107, -0.3711498975753784, 0.9451588392257...
templateType = type; innerControls = controls; } public void InstantiateIn(Control container) { PlaceHolder ph = new PlaceHolder(); switch (templateType) {
[ 0.10493477433919907, -0.45649826526641846, 0.23846565186977386, -0.0038789978716522455, 0.4640319347381592, 0.01569523476064205, -0.09928370267152786, -0.3461414873600006, 0.05279117077589035, -0.6332272887229919, -0.4423120319843292, 0.013488038443028927, -0.37642788887023926, 0.300016224...
case ListItemType.Header: ph.Controls.Add(new LiteralControl("")); ph.Controls.Add(new LiteralControl("")); foreach (Control control in innerControls) {
[ -0.10328034311532974, -0.06848885118961334, 0.30985456705093384, -0.08317191898822784, 0.34607306122779846, 0.03453098237514496, 0.1951383352279663, -0.5094509720802307, 0.08389931172132492, -0.3181516230106354, -0.3545109033584595, 0.53016197681427, -0.45968368649482727, -0.17877764999866...
Label label = new Label(); label.Text = control.ID; ph.Controls.Add(new LiteralControl("")); ph.Controls.Add(label);
[ -0.05211811512708664, -0.012092828750610352, 0.499357134103775, -0.008115062490105629, 0.10887401551008224, -0.007425312884151936, 0.05329906567931175, -0.512332022190094, -0.15089917182922363, -0.4951068162918091, -0.5123031139373779, 0.34808364510536194, -0.560558557510376, 0.01440798025...
ph.Controls.Add(new LiteralControl("")); } ph.Controls.Add(new LiteralControl("")); break;
[ -0.02937496267259121, -0.010863205417990685, 0.24296145141124725, -0.06807343661785126, 0.47336217761039734, -0.2898920476436615, 0.35791638493537903, -0.2517795264720917, -0.06638530641794205, -0.25890177488327026, -0.5422587394714355, 0.4181922376155853, -0.6553651690483093, -0.247764706...
case ListItemType.Item: ph.Controls.Add(new LiteralControl("")); foreach (Control control in innerControls) { if (control.GetType() != typeof(Repeater))
[ 0.09668933600187302, -0.31316664814949036, 0.39122140407562256, -0.24577054381370544, 0.3825996220111847, 0.12850408256053925, 0.5367177724838257, -0.5360798835754395, 0.08583091199398041, -0.36174362897872925, -0.25676625967025757, 0.5193319320678711, -0.46824735403060913, 0.1062643751502...
{ ph.Controls.Add(new LiteralControl("")); TextBox textBox = new TextBox();
[ 0.03491911292076111, 0.01648627407848835, 0.4907732605934143, -0.19561028480529785, 0.45671284198760986, 0.14255863428115845, 0.1993137151002884, -0.43621259927749634, -0.02526760846376419, -0.5767117142677307, -0.3130396008491516, 0.5477087497711182, -0.7139602899551392, -0.20279458165168...
textBox.ID = control.ID; ph.Controls.Add(textBox); ph.Controls.Add(new LiteralControl("")); }
[ -0.10114574432373047, 0.007461771834641695, 0.38125407695770264, -0.020694158971309662, 0.3288213014602661, 0.2317201793193817, 0.11587385088205338, -0.3517756462097168, 0.0642482191324234, -0.49938905239105225, -0.3214223086833954, 0.45504826307296753, -0.6426657438278198, -0.252457290887...
else { ph.Controls.Add(new LiteralControl("")); ph.Controls.Add(control as Repeater);
[ 0.15360110998153687, -0.1443680375814438, 0.2225313037633896, -0.16907736659049988, 0.5455010533332825, -0.06718988716602325, 0.3847961127758026, -0.39891207218170166, 0.09408140182495117, -0.21070384979248047, -0.33530718088150024, 0.5517944097518921, -0.48539528250694275, 0.2050537616014...
//(control as Repeater).DataSource = new DataRow[4]; // (control as Repeater).DataBind(); ph.Controls.Add(new LiteralControl(""));
[ 0.023677706718444824, -0.14986620843410492, 0.47083038091659546, 0.01679850183427334, 0.3248559236526489, 0.1250486522912979, 0.15451809763908386, -0.4006338119506836, -0.09108628332614899, -0.39449208974838257, -0.2691439986228943, 0.38965606689453125, -0.3351937234401703, 0.2000171542167...
} } ph.Controls.Add(new LiteralControl("")); //ph.DataBinding += new EventHandler(Item_DataBinding); break;
[ -0.10303568840026855, -0.3416942059993744, 0.16808466613292694, -0.03548005223274231, 0.453298419713974, -0.07913241535425186, 0.26006051898002625, -0.47230222821235657, -0.2816689908504486, -0.3599628508090973, -0.3970394432544708, 0.43639788031578064, -0.6251052021980286, -0.164928182959...
case ListItemType.Footer: ph.Controls.Add(new LiteralControl("")); break; } container.Controls.Add(ph); } public List Controls
[ -0.026564346626400948, -0.14796660840511322, 0.406303733587265, -0.05009257048368454, 0.2879669666290283, 0.10979801416397095, -0.008572806604206562, -0.48573073744773865, -0.2484937161207199, -0.4744178056716919, -0.32240286469459534, 0.41201674938201904, -0.4934369921684265, 0.0397223904...
{ get { return innerControls; } } } } ``` --- If you write a new png to `/User/Library/LockBackground.png` and then call `notify_post(" com.apple.language.changed");` the device will respring and your new background will be present. This isn't technica...
[ -0.06147383525967598, 0.08786607533693314, 0.13902613520622253, -0.2007049322128296, 0.5092115998268127, 0.07589353621006012, 0.47246503829956055, 0.18159952759742737, -0.4511953890323639, -0.7263707518577576, -0.5438669919967651, 0.6425309181213379, -0.43874940276145935, -0.01232465915381...
API, but does fall outside of what Apple allows on the store.
[ 0.31622257828712463, 0.19325695931911469, 0.0868595615029335, 0.053133685141801834, 0.13125093281269073, -0.09202636033296585, 0.3641991913318634, 0.12693952023983002, 0.052141234278678894, -0.3917575478553772, -0.003914711996912956, 0.2830902934074402, -0.3042568862438202, 0.2777909636497...
I don't have direct network access to the linux host I'm debugging PHP/Javascript code on. I SSH to a jump box, then use FoxyProxy to tunnel my firefox requests through my SSH session using SOCKS forwarding. I want to be able to debug the javascript code in IE, but unfortunately my FoxyProxy setup only works through t...
[ 0.4580979347229004, 0.18253003060817719, 0.05752091854810715, 0.3473956286907196, -0.06337353587150574, -0.215689018368721, 0.3501402735710144, 0.2533281743526459, 0.07755134254693985, -0.7166609168052673, 0.2595241367816925, 0.35434719920158386, -0.26324737071990967, 0.09611619263887405, ...
do when you see something that looks like non-blocking I/O, say in a curses/ncurses application, is called *raw I/O*. In raw I/O, there's no interpretation of the characters, no erase processing etc. Instead, you need to write your own code that checks for data while doing other things. In modern C programs, you can s...
[ 0.4409932494163513, -0.019696801900863647, -0.02669404074549675, -0.15228800475597382, -0.02290489710867405, -0.1586000621318817, 0.2147730439901352, -0.1401587724685669, -0.26611626148223877, -0.709185779094696, -0.3441675901412964, 0.380069762468338, -0.13731294870376587, -0.044336173683...
it more.
[ 0.13224105536937714, -0.3724316954612732, 0.11764928698539734, 0.3878950774669647, -0.552446722984314, -0.04003915935754776, -0.20280615985393524, -0.21682338416576385, -0.06677886098623276, -0.5355396270751953, 0.4249661862850189, 0.7024134397506714, 0.17329080402851105, 0.468412697315216...
I'm trying to come up with a setup where I can generate a visual studio solution + projectfile, that references files and folders "outside" of the folder where the .sln and .csproj's are stored. *and* (the catch :) ), I need new files that get created with you rightclick a folder and say "new code file" to be generate...
[ 0.7826381921768188, -0.02350139245390892, 0.034716080874204636, 0.2061571478843689, -0.048551034182310104, -0.3465133011341095, 0.2703043520450592, 0.009252945892512798, -0.3057895004749298, -0.7600001096725464, 0.06735881417989731, 0.4952431619167328, -0.2660975754261017, 0.21198138594627...
of other files, and I don't want the .sln, .csproj, .ReSharper, .suo etc files to clutter my directory. Thanks to everybody for their input. It looks like what I want exactly is not possible at this point in time. Bummer.
[ 0.4249928295612335, 0.2193383276462555, 0.25087112188339233, 0.3185109794139862, 0.22471463680267334, -0.20351183414459229, 0.07381970435380936, 0.547995388507843, -0.38457292318344116, -0.26765063405036926, -0.06087910756468773, 0.3173229396343231, -0.17756901681423187, 0.3921673595905304...
I'm trying to dynamically accept a table name depending on the conditions satisfied, also the column name is selected dynamically, and so is the comparison value, but I'm getting an error while running it. I'm writing this code in C# and my backend is SQL server 2005. Please help me. Here is the code: ``` if( tab...
[ -0.008374490775167942, 0.17973142862319946, 0.5596758127212524, -0.24802127480506897, 0.0649481862783432, -0.2138848751783371, 0.1630622148513794, 0.12845467031002045, 0.06149008870124817, -0.7961329817771912, 0.0016142416279762983, 0.4083656072616577, -0.1517258584499359, 0.18218517303466...
string p = field[0].ToString().ToLower(); string q = code[0].ToString(); SqlCommand thiscommand3 = thisconnection1.CreateCommand(); thiscommand3.CommandText = " Select * from '" + table + "' where '" + p + "' = '" + q + "' "; // here it gives error "Incorrect syntax n...
[ -0.16846798360347748, 0.04046415537595749, 0.43835005164146423, -0.16094337403774261, 0.3487176299095154, -0.1209213063120842, 0.6729589700698853, -0.40861186385154724, -0.01393806654959917, -0.349649578332901, -0.25758832693099976, 0.7076395153999329, -0.2868463099002838, 0.05083532631397...
SqlDataReader thisreader3 = thiscommand3.ExecuteReader(); ``` To answer your specific question, I would guess the error is due to the fact that you are surrounding your table name and column names with single quotes. your object names should not be surrounded with quotes of any kind. As a side note, please look into ...
[ 0.3921651542186737, 0.13093851506710052, 0.16585955023765564, -0.11845478415489197, -0.21119050681591034, -0.4841136336326599, 0.35797539353370667, -0.05929587036371231, -0.09042675048112869, -0.16386374831199646, 0.1816703826189041, 0.5468997955322266, -0.4671725630760193, 0.2341455519199...
So, I understand the problem of finding the longest simple path in a graph is NP-hard, since you could then easily solve the Hamiltonian circuit problem by setting edge weights to 1 and seeing if the length of the longest simple path equals the number of edges. My question is: What kind of path would you get if you to...
[ -0.13990527391433716, 0.02617238089442253, -0.07195831090211868, 0.19744254648685455, -0.1436973214149475, 0.08831484615802765, 0.12207004427909851, -0.30031782388687134, -0.5149958729743958, -0.5341398119926453, -0.11723378300666809, 0.3004363775253296, -0.38153621554374695, 0.10734921693...
and I think the proof for something like that would be a bit more complicated =P. [alt text http://dl.getdropbox.com/u/317805/path2.jpg](http://dl.getdropbox.com/u/317805/path2.jpg) The graph above is transformed to below using your algorithm. The Longest path is the red line in the above graph.And depending on how t...
[ 0.03737308830022812, -0.3688214421272278, 0.5651737451553345, 0.2163841277360916, -0.17234329879283905, -0.045014508068561554, 0.11487928032875061, -0.13694298267364502, -0.5390545129776001, -0.8454282283782959, 0.06735510379076004, 0.2987145483493805, -0.47175663709640503, 0.1266417354345...
transformation could be to negate all the edge weights and run the algorithm. I dont know if I have answered your question but as far as the path property goes the transformed graph doesnt have any useful information regarding the distance. However this particular transformation is useful in other areas. For example y...
[ -0.03874659910798073, -0.3631229102611542, -0.1505144089460373, 0.2146926373243332, -0.43787163496017456, 0.03459729254245758, 0.30352142453193665, -0.3984564244747162, -0.21826668083667755, -0.8924731612205505, 0.12907563149929047, 0.46484532952308655, -0.4562992453575134, -0.077310234308...
the triangle inequality. Thanks.
[ -0.024837680160999298, 0.2495654970407486, -0.16539782285690308, 0.27524593472480774, -0.22539180517196655, -0.04729028418660164, 0.1782229244709015, 0.20066069066524506, -0.15102525055408478, -0.36395546793937683, -0.1691189408302307, 0.34306421875953674, -0.07406220585107803, 0.069058030...
I have a ruby script that goes and saves web pages from various sites, how do i make sure that it checks if the server can send gzipped files and saves them if available... any help would be great! One can send custom headers as hashes ... ``` custom_request = Net::HTTP::Get.new(url.path, {"Accept-Encoding" => "gzip"}...
[ 0.26778027415275574, 0.176370769739151, 0.399885356426239, -0.05764327570796013, -0.4952763617038727, 0.1357964724302292, 0.3395807147026062, -0.19934678077697754, -0.385794460773468, -0.6737179756164551, 0.05491597577929497, 0.5333239436149597, -0.1985766589641571, 0.21960638463497162, ...
Is it true I can't edit a MySQL trigger, I have to drop it and create a new one? Also, being a relative newcomer to triggers, it feels like they seem liable to causing 'erroneous' data. For example I might want a trigger to be fired (inserting data into another table) after one particular type of update query, but not...
[ 0.5998892784118652, 0.10568404942750931, 0.16271473467350006, -0.013729243539273739, -0.1977171152830124, -0.39151546359062195, 0.20168539881706238, -0.051030468195676804, -0.08443935215473175, -0.14073048532009125, 0.13224324584007263, 0.4833134412765503, -0.285805881023407, -0.0972017198...
in SQL 92, so consider yourself lucky to have TRIGGER at all :-) The [Visual Studio MySQL plugin documentation](http://dev.mysql.com/doc/refman/5.0/en/connector-vstudio-using-triggers.html) has: > To modify an existing trigger, double click on a node of the trigger you wish to modify, or right click on this node and ...
[ 0.3297232985496521, 0.17526572942733765, 0.3112988770008087, -0.06141974404454231, -0.045437559485435486, -0.4403995871543884, -0.16268637776374817, -0.35887444019317627, -0.10445847362279892, -0.2933006286621094, 0.27499911189079285, 0.6573240160942078, -0.338399738073349, -0.219557195901...
Put an `IF` clause at the start of your `UPDATE` trigger so that your logic - whatever you are doing in some of your `UPDATE`s - is only executed when you think it is appropriate.
[ 0.3131479024887085, -0.2145867943763733, 0.10026683658361435, -0.03804400935769081, 0.29149097204208374, -0.3696497976779938, 0.24511776864528656, -0.16333550214767456, 0.2118343561887741, -0.23724424839019775, -0.3187214732170105, 0.5189827084541321, -0.19555433094501495, -0.1704740524291...
I am creating a small message board and I am stuck I can select the subject, the original author, the number of replies but what I can't do is get the username, topic or date of the last post. There are 3 tables, boards, topics and messages. I want to get the author, date and topic of the last message in the message...
[ 0.08403120189905167, 0.2568746507167816, 0.5084522366523743, 0.19452649354934692, -0.3071900010108948, 0.22736185789108276, 0.15663030743598938, 0.258158802986145, -0.24480603635311127, -0.5492367148399353, -0.022183971479535103, -0.002005786169320345, -0.12574823200702667, 0.6194852590560...
t.topicname, t.author, count( message ) AS message FROM topics t INNER JOIN messages m ON m.topicid = t.topicid INNER JOIN boards b ON b.boardid = t.boardid WHERE b.boardid = 1 GROUP BY t.topicname ``` Can anyone please help me get this finished? This is what my tables look like ``` CREATE TABLE `...
[ -0.06583257764577866, 0.00916568748652935, 0.9407750964164734, 0.038482148200273514, -0.295403391122818, -0.0847003161907196, 0.13119187951087952, -0.28998565673828125, -0.5888943076133728, -0.7228207588195801, -0.18573430180549622, 0.2166430950164795, -0.27408188581466675, 0.3305892348289...
`author` varchar(255) NOT NULL default '', `date` timestamp(14) NOT NULL, PRIMARY KEY (`messageid`) ); CREATE TABLE `topics` ( `topicid` int(4) NOT NULL auto_increment, `boardid` int(2) NOT NULL default '0', `topicname` varchar(255) NOT NULL default '', `author` varchar(255) NOT NULL default '', PRIMARY...
[ -0.34774914383888245, 0.16051024198532104, 0.8271627426147461, 0.04849202185869217, 0.049232129007577896, -0.031664978712797165, 0.06756744533777237, -0.12541653215885162, -0.4130651354789734, -0.6191521286964417, -0.5446113348007202, 0.5237472653388977, -0.2828758955001831, 0.245737552642...
want to combine this with the original query, it has to be rewritten using subqueries to extract the message count and the date of last message: ``` SELECT t.topicname, t.author, (select count(message) from messages m where m.topicid = t.topicid) AS messagecount, lm.author, lm.date FROM topics t INN...
[ -0.3222753703594208, -0.44483327865600586, 0.8084548115730286, -0.15985797345638275, 0.07073872536420822, 0.2990960478782654, -0.12814991176128387, -0.1858963966369629, -0.5163769125938416, -0.5796804428100586, -0.32586535811424255, 0.026036368682980537, -0.206703320145607, 0.1889033317565...
that if you don't pick any field from table boards, you don't need the last join: ``` SELECT t.topicname, t.author, (select count(message) from messages m where m.topicid = t.topicid) AS messagecount, lm.author, lm.date FROM topics t INNER JOIN messages lm ON lm.topicid = t.topicid AND lm.date =...
[ -0.26168397068977356, -0.2565089464187622, 0.6139682531356812, -0.0702890008687973, -0.08917436748743057, 0.2894754707813263, -0.1265033334493637, -0.097043976187706, -0.395291805267334, -0.4450385868549347, -0.34083956480026245, 0.3708718717098236, -0.08118834346532822, 0.0456639677286148...
JOIN (select m.topicid, count(*) as messagecount from messages m group by m.topicid) as mc ON mc.topicid = t.topicid JOIN messages lm ON lm.topicid = t.topicid AND lm.date = (SELECT max(m2.date) from messages m2) WHERE t.boardid = 1 GROUP BY t.topicname ```
[ -0.26637130975723267, -0.37020689249038696, 1.056848406791687, 0.010800969786942005, -0.05953031778335571, 0.2010040134191513, -0.11011486500501633, -0.2648078203201294, -0.6855975985527039, -0.5105636715888977, -0.5202459692955017, 0.11729472130537033, -0.21531246602535248, 0.426951497793...
I just got some C code that uses extern "C" to declare external functions like this: ``` extern "C" void func(); ``` Is this valid C? I'm getting an error at this line, but I'm not sure if it's because of this or something else. No, it's not valid C. It should only be used in C++ code to refer to functions defined i...
[ 0.1462377905845642, 0.12349628657102585, 0.41402897238731384, -0.16129957139492035, -0.04487372189760208, -0.16892565786838531, 0.2529850900173187, -0.07274400442838669, -0.3117378354072571, -0.11569704115390778, -0.14384572207927704, 0.5935505032539368, -0.40009284019470215, 0.25121915340...
I have three X/Y points that form a parabola. I simply need to calculate what the vertex of the parabola is that goes through these three points. Preferably a quick way as I have to do a LOT of these calculations! The "Ask A Scientist" website provides [this answer](http://www.newton.dep.anl.gov/askasci/math99/math990...
[ 0.01527432631701231, 0.10348883271217346, 0.3198743760585785, -0.17069022357463837, -0.5461587309837341, 0.5563522577285767, 0.3803999722003937, -0.4773237109184265, -0.25108909606933594, -0.28552618622779846, 0.12184805423021317, 0.21807079017162323, -0.619999349117279, 0.3617464601993561...
the equation for a parabola. You will get three LINEAR equations in three unknowns, the three constants. You can then easily solve this system of three equations for the values of A, B, and C, and you'll have the equation of the parabola that intersects your 3 points. The vertex is where the first derivative is 0, a li...
[ -0.3288187086582184, 0.22326414287090302, 0.5558271408081055, 0.018415501341223717, -0.2709863781929016, 0.42266711592674255, 0.32440057396888733, -0.5219928026199341, -0.4040747582912445, -0.7130773663520813, 0.20732401311397552, 0.09804622828960419, -0.6189749240875244, 0.147591203451156...
calculation symbolically. When you substitute in the x and y values of your three points, you'll get three linear equations in three unknowns. ``` A x1^2 + B x1 + C = y1 A x2^2 + B x2 + C = y2 A x3^2 + B x3 + C = y3 ``` The straightforward way to solve this is to invert the matrix ``` x1^2 x1 1 x2^2 x2 1 x3^2 ...
[ -0.4065544009208679, 0.2949312627315521, 0.09281965345144272, -0.14921121299266815, -0.21956975758075714, 0.39111173152923584, 0.24998770654201508, -0.6501674652099609, -0.08585727214813232, -0.2845267355442047, 0.3011213541030884, 0.3133322298526764, -0.21441444754600525, -0.1532801091670...
x2)(x1 - x3)(x2 - x3) A = (x3 * (y2 - y1) + x2 * (y1 - y3) + x1 * (y3 - y2)) / denom B = (x3^2 * (y1 - y2) + x2^2 * (y3 - y1) + x1^2 * (y2 - y3)) / denom C = (x2 * x3 * (x2 - x3) * y1 + x3 * x1 * (x3 - x1) * y2 + x1 * x2 * (x1 - x2) * y3) / denom ``` Alternatively, if you wanted to do the matrix math numerically, you...
[ -0.033158428966999054, 0.2724479138851166, 0.13908663392066956, -0.13108816742897034, -0.4048956334590912, 0.02666633389890194, 0.29244986176490784, -0.40454158186912537, -0.16692858934402466, -0.39171481132507324, -0.540678083896637, 0.18311633169651031, -0.3280787169933319, -0.0792100802...
if it has C#/C++ bindings). In any case, once you have the values of `A`, `B`, and `C` as calculated by these formulas, you just have to plug them into the expressions given in the question, `-B / 2A` and `C - B^2/4A`, to calculate the coordinates of the vertex.1 Note that if the original three points have coordinate...
[ -0.07078804820775986, 0.03216975927352905, 0.22317488491535187, -0.22927655279636383, -0.060566432774066925, -0.0499485619366169, 0.2634665369987488, -0.4297339916229248, -0.060977064073085785, -0.5955341458320618, -0.34847119450569153, -0.0293350238353014, -0.20317120850086212, -0.0241808...