text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
In C can a function expose memory that it "manageds" at a lower level as readonly to those calling that function (exposing its address). `return * const` is not effective but I wondered if I was overlooking a programming tick? Thanks. ``` const uint8_t * get_value(int index) { static uint8_t data[2] = {0, 0}; return...
[ -0.30743730068206787, -0.20405086874961853, 0.16392824053764343, -0.2653528153896332, -0.010278424248099327, -0.2057693600654602, 0.30157560110092163, -0.10188550502061844, -0.0365227609872818, -0.42610281705856323, -0.3918038308620453, 0.8409961462020874, -0.3753249943256378, -0.151449084...
index, int size) { static uint8_t data[2] = {0, 0}; uint8_t rsize; /* ... validate index, size params */ readonly_t r = { &data[index], rsize }; return r; } ``` It's C! You can't :) There is always a way to circumvent it. Just make it `const` and hope somebody will not change it. If you are hos...
[ 0.15148615837097168, -0.12948361039161682, 0.5257784128189087, 0.0007594638736918569, 0.3015715777873993, -0.1309046596288681, 0.4478124678134918, -0.2810639441013336, -0.488401859998703, -0.3034306466579437, -0.5298328995704651, 0.43548569083213806, -0.33488285541534424, 0.393358349800109...
What would be the closest resemblance? You could also try [EasyMock](http://www.easymock.org/). RhinoMocks was built off the EasyMock.NET engine, so there are a lot of similarities.
[ -0.06149524450302124, -0.11250202357769012, 0.21639198064804077, 0.1987820416688919, -0.09944306313991547, -0.290277898311615, -0.22644922137260437, 0.026579422876238823, -0.17786048352718353, -0.4340910315513611, 0.1475486010313034, 0.6674572229385376, -0.3785724937915802, -0.014487619511...
I can't help think that making XML ad XMLList both unrelated, as in both extend Object directly, is a design flaw in the AS3 core library. Surely having XML extend XMLList would be a much cleaner system, where XML is considered an XMLList with only one member? This would also avoid the very annoying practice of an E4...
[ 0.3236521780490875, 0.11274692416191101, 0.3751989006996155, -0.05118077993392944, -0.5480676293373108, -0.29660046100616455, 0.12147214263677597, -0.4242309331893921, -0.012000029906630516, -0.43886616826057434, -0.06876928359270096, 0.43973004817962646, -0.37228429317474365, -0.041328988...
question is that, it seems, from looking at the inheritance tree that, yes the two classes (*XMLList*, *XML*) are unrelated. But, from looking at the ECMA script/AS3 documentation, that they are related, most likely using the prototype system of ECMA script/AS3. When an *XMLList* has only one member it can be treat...
[ 0.060728587210178375, -0.05392952635884285, 0.07656890898942947, 0.07666175812482834, -0.1529778391122818, -0.06879324465990067, -0.06353025138378143, -0.28264546394348145, -0.21896423399448395, -0.47591978311538696, -0.07093073427677155, 0.23583291471004486, -0.0557921938598156, 0.0998554...
I've always wondered why Javascript has the global Math object instead of giving numbers their own methods. Is there a good reason for it? Also are there any drawbacks (other than efficiency) to doing something like this?: ``` Number.prototype.round = function(){ return Math.round(this); }; ``` Just to make cle...
[ -0.02549477107822895, 0.11107705533504486, -0.10783657431602478, -0.09046653658151627, -0.4295865595340729, 0.11375316977500916, 0.2167380005121231, -0.15794456005096436, -0.24933820962905884, -0.4827958047389984, 0.0835299864411354, 0.3876168131828308, -0.2978966534137726, -0.112653814256...
reasons, but here we are. I guess things made more sense back then, before Douglas Crockford started his campaign to suppress half the language\*. Originally you were "allowed", or meant, to do things like this: ``` with (Math) { var n = min( round(a) * round(b), sqrt(c) ); var result = exp( n + d ); } ``` The d...
[ 0.27289557456970215, 0.11167515814304352, -0.04107200354337692, 0.0011803543893620372, -0.048217739909887314, 0.06283486634492874, 0.2327822595834732, -0.19431239366531372, -0.13948853313922882, -0.16197776794433594, 0.1571311354637146, 0.4923429489135742, -0.44039806723594666, 0.192025497...
global functions? ``` var m = 'abs acos asin atan atan2 ceil cos exp floor log max min ' + 'pow random round sin sqrt tan PI').split(' '); for (var i=0,l=m.length; i<l; i++) { window[ m[i] ] = Math[ m[i] ]; } ``` This will drop all the math functions into the global scope, effectively allowing you to stop...
[ -0.4187036156654358, -0.004816077183932066, 0.5557851195335388, -0.05868298560380936, -0.02797112800180912, 0.11030817776918411, 0.16723906993865967, 0.03677826374769211, -0.37826526165008545, -0.3876986503601074, -0.33747249841690063, 0.8952798247337341, -0.48143503069877625, -0.030483487...
that `with` is very dangerous in an implicit global environment.
[ 0.14962898194789886, 0.2011512815952301, -0.18455974757671356, 0.04387018457055092, -0.06976042687892914, -0.47601523995399475, 0.309770792722702, -0.015676947310566902, 0.07833646982908249, -0.4833957254886627, -0.11500939726829529, 0.5259178280830383, -0.19847822189331055, 0.106813155114...
First of all, I'm new to Ajax and I don't quite understand everything about how it's work in Asp.Net. I'm using Asp.Net 3.5 and I have a c# server code that run and when it's have finish it work, it's call a subscribed event that will write the result in a txtbox control. c# code : ``` public partial class TestDBLoa...
[ 0.2212430238723755, -0.056221362203359604, 0.08450952172279358, -0.021242963150143623, -0.3903229236602783, -0.18056151270866394, 0.4507260322570801, -0.20200003683567047, -0.08226976543664932, -0.9058921337127686, 0.054433975368738174, 0.6155018210411072, -0.3506278991699219, 0.1556003242...
public void dbManager1_LoadDBCompleted(object sender, EventArgs e) { txtResult.Text = "Finish!"; updatePanel.Update(); } } public partial class DBManager : System.Web.UI.UserControl { public AsyncLoadDBDelegate asyncLoadDB; public delegate void AsyncLoadDBDelegate(object sender, EventAr...
[ -0.012091395445168018, -0.043538354337215424, 0.11950870603322983, -0.16415169835090637, -0.1924632340669632, -0.0015374846989288926, 0.6216353178024292, -0.516514241695404, -0.05651820823550224, -0.40305501222610474, -0.40977028012275696, 0.5838277339935303, -0.44958823919296265, 0.275398...
0; i <= 10; i++) { Thread.Sleep(1000); } LoadDBCompleted(sender, e); } public IAsyncResult LoadDBAsync(object sender, EventArgs e, AsyncCallback callback) { IAsyncResult asyncResult; asyncLoadDB = new AsyncLoadDBDelegate(StartLoad); asyncResult...
[ -0.12397661060094833, -0.36333397030830383, 0.34651777148246765, -0.35135746002197266, 0.3627012073993683, 0.16027672588825226, 0.5370035171508789, -0.15829089283943176, -0.12605072557926178, -0.5625742673873901, -0.4768494665622711, 0.47439470887184143, -0.34100258350372314, 0.51397901773...
return asyncResult; } } ``` Asp code : ``` <asp:ScriptManager ID="ScriptManager" runat="server" /> <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="dbManager1" EventName="LoadDBCompleted" /> </Triggers> <ContentTempl...
[ -0.1149030327796936, 0.11074421554803848, 0.16441455483436584, -0.1793404072523117, -0.1418507695198059, -0.033724863082170486, 0.4981625974178314, -0.4546443819999695, -0.1767708659172058, -0.56454998254776, -0.10933280736207962, 0.5317904949188232, -0.2763268053531647, 0.1093349903821945...
realistic and understandable. EDIT2 : If there is a way of doing it without using the UpdatePanel, please let me know how. It's most likely that the UpdatePanel's Update method isn't being fired, which is why there is no change to its contents. You need to either ensure the control which causes WorkFinished to execut...
[ 0.30379846692085266, -0.2686314284801483, 0.49102070927619934, 0.22306670248508453, 0.16222888231277466, -0.20191450417041779, 0.12364348769187927, -0.1673220843076706, -0.1578284054994583, -0.6073984503746033, -0.15547433495521545, 0.6652319431304932, -0.1766175627708435, -0.3586684167385...
something I covered here - <http://www.aaron-powell.com/blog/august-2008/optimising-updatepanels.aspx>
[ 0.22973982989788055, -0.09930339455604553, 0.12890668213367462, 0.002197635592892766, -0.08154789358377457, -0.047665785998106, 0.22891421616077423, 0.04252622649073601, -0.5102155804634094, -0.1930733323097229, 0.30203989148139954, 0.2822149395942688, 0.1965668648481369, -0.23089489340782...
It's a very common scenario: some process wants to drop a file on a server every 30 minutes or so. Simple, right? Well, I can think of a bunch of ways this could go wrong. For instance, processing a file may take more or less than 30 minutes, so it's possible for a new file to arrive before I'm done with the previous ...
[ 0.461640328168869, 0.0382235124707222, 0.18619638681411743, 0.2158193588256836, 0.44264858961105347, -0.23018749058246613, 0.09036683291196823, 0.145737886428833, -0.5890173316001892, -0.2558600902557373, 0.0495961494743824, 0.02846592478454113, -0.08887879550457001, 0.14534951746463776, ...
a partial file. The files are just tranferred with FTP or sftp (my preference), so OS-level locking isn't an option. Finally, I do need to keep the files around for a while, in case I need to manually inspect one of them (for debugging) or reprocess one. I've seen a lot of ad-hoc approaches to shuffling upload files ...
[ -0.07230286300182343, -0.09165719151496887, 0.27933529019355774, 0.07754501700401306, 0.05032221972942352, -0.16513538360595703, 0.22487998008728027, 0.25398632884025574, -0.46160539984703064, -0.6206372380256653, -0.3159209191799164, 0.338267058134079, -0.06278946250677109, 0.081098072230...
Has anyone seen a really bulletproof way to juggle batch data files so they're never processed too early, never overwritten before done, and safely kept after processing? The key is to do the initial juggling at the *sending* end. All the sender needs to do is: 1. Store the file with a unique filename. 2. As soon as t...
[ 0.32068565487861633, -0.03353981301188469, 0.2900148332118988, 0.2617638111114502, 0.15541115403175354, -0.059594254940748215, 0.3413506746292114, -0.058322906494140625, -0.47399619221687317, -0.45154324173927307, -0.37470531463623047, 0.09476092457771301, -0.18099723756313324, 0.232150286...
to a subdirectory called e.g. `processed`, and start working on it from there. 3. Optionally delete it when finished. On any sane filesystem, file moves are atomic provided they occur within the same filesystem/volume. So there are no race conditions. Multiple Receivers ------------------ If processing could take lo...
[ 0.14011313021183014, -0.32725828886032104, 0.4442684054374695, 0.3155936002731323, 0.09079540520906448, 0.08836134523153305, 0.2967444956302643, -0.240930438041687, -0.450924813747406, -0.5712289810180664, -0.46143507957458496, 0.27131253480911255, -0.3926640748977661, 0.1424420177936554, ...
atomic, means that even if multiple receivers see the same file in `completed` and try to move it, only one will succeed. All you need to do is make sure you check the return value of `rename()`, or whatever OS call you use to perform the move, and only proceed with processing if it succeeded. If the move failed, some ...
[ 0.10085092484951019, 0.021889610216021538, 0.25428465008735657, 0.26379871368408203, 0.4521925449371338, -0.27721989154815674, 0.3178599774837494, -0.06632334738969803, -0.5680992007255554, -0.2940334975719452, -0.2031513899564743, 0.2595410645008087, -0.25009721517562866, 0.23336614668369...
We are building an application that may need to be replicated to many servers (I'm hoping not, but there's no way to know if clients will need their own client/server copy until after we release the online product). Since the number of servers is unknown, I've decided to use GUIDs for any transactional table IDs. Sin...
[ 0.49663180112838745, 0.0972694531083107, 0.7004374265670776, 0.2903328239917755, 0.16240514814853668, -0.06970531493425369, 0.1745740920305252, 0.22342266142368317, -0.3482084572315216, -0.8388416171073914, 0.19437922537326813, 0.2797420918941498, 0.026962047442793846, 0.20906931161880493,...
handle cases where we want the foreign key to indicate 'none selected'. For example, a client has a single admin user. This is set up as a foreign key (login\_id) to login.id (a GUID). However, if a client doesn't yet have an admin user, how would we easily set up a "None Selected" key? In prior applications we used ...
[ -0.08361812680959702, 0.23386412858963013, 0.4336855411529541, 0.10517939925193787, -0.03793748840689659, 0.09211190789937973, -0.2090449184179306, -0.2522584795951843, -0.19318214058876038, -0.6063730716705322, -0.05158810317516327, 0.6813152432441711, -0.23676197230815887, 0.129371896386...
guid of all zeros, then link to this record 2) Just store a null for the blank references 3) Don't have the blank records in the reference table, but store an all zero guid. This may cause problems if joins are done in in the database, or with reports. You'll have to code for this special case. I'd say 1 and 2 are t...
[ 0.2284112125635147, 0.023684969171881676, 0.1322370320558548, 0.3307461142539978, -0.1319906860589981, -0.18580959737300873, 0.20735572278499603, 0.09035103023052216, 0.0005557838012464345, -0.6374865770339966, 0.20184244215488434, 0.600267231464386, -0.5205660462379456, 0.1156798228621482...
I frequently find myself typing on a line, when I realize I need(ed) a variable definition (or something similar) on the line above. What I would like is to 1. press C-return from anywhere on a line and have the cursor move to a newly inserted blank line above, with correct indentation (or at least the same as the or...
[ 0.0031184584368020296, -0.07414507865905762, 0.6680091023445129, 0.03342505544424057, -0.06007795408368111, 0.12905848026275635, 0.13574393093585968, 0.004953037481755018, -0.021185094490647316, -0.3649347722530365, -0.3400363028049469, 0.5297103524208069, -0.09883561730384827, -0.20011493...
(beginning-of-line) ; I've changed the order of (yank) and (indent-according-to-mode) ; in order to handle the case when yanked line comes with its own indent (yank)(indent-according-to-mode) ; could be as well changed to simple (newline) it's metter of taste ; and of usage (newline-and-indent))...
[ 0.25079959630966187, -0.2403104454278946, 0.5617794394493103, -0.0858992412686348, -0.15295298397541046, 0.28745099902153015, 0.4171392023563385, -0.15022149682044983, -0.19317691028118134, -0.5532271862030029, -0.1868792623281479, 0.5391295552253723, -0.28206542134284973, 0.01805022917687...
Thanks in advance for any help. I've got two combo boxes which I'd like to be dependent on each others input. For example, when I update one, it filters the available values for the next. Thought I had everything working until after I switched between the two a few times, both just because blank. I've got two combo bo...
[ 0.23526692390441895, -0.3844383656978607, 0.3569316565990448, 0.47168728709220886, 0.2424028366804123, 0.060565415769815445, -0.14264631271362305, 0.3420340120792389, -0.49259981513023376, -0.7010310292243958, -0.25397682189941406, -0.13719864189624786, 0.06860209256410599, 0.1366278082132...
gets called when you click the drop down on the To Country ``` private void ToCountry_DropDownOpened(object sender, EventArgs e) { int FromId = (Countries.Country)FromCountry.selectedItem).ID; int ToId = (Countries.Country)ToCountry.selectedItem).ID; this.ToCountry.ItemsSource = AppInfo.Coun...
[ 0.1337347775697708, -0.37641528248786926, 0.8167849183082581, 0.11719989031553268, 0.4629877209663391, 0.24718615412712097, 0.3806319832801819, -0.043400298804044724, -0.318703830242157, -0.451456755399704, -0.7833714485168457, 0.3610836863517761, -0.28489118814468384, 0.4245343804359436, ...
(Countries.Country)ToCountry.selectedItem).ID; this.FromCountry.ItemsSource = AppInfo.CountryList.Where(p=>p.ID!=ToId).OrderBy(c => c.Name); } ``` Here's my humble solution: ``` (defun my-insert-before-line () (interactive) (save-excursion (beginning-of-line) ; I've changed the order of (yank) and (ind...
[ 0.01989363692700863, -0.13694331049919128, 0.7940511703491211, 0.19067661464214325, 0.1342080682516098, 0.20225562155246735, 0.4844142496585846, -0.07959192246198654, -0.17239895462989807, -0.7574649453163147, -0.457287073135376, 0.2946302592754364, -0.11097864806652069, 0.1116979643702507...
I've built an application that uses jQuery and JSON to consume an ASP.NET .asmx web service to perform crud operations. The application and .asmx are on the same domain. I dont mind people consuming the read operations of the .asmx remotely but dont want people randomly deleting stuff!!! I can split the methods i'd l...
[ 0.7002193331718445, 0.1519305408000946, 0.07373999804258347, 0.5354719161987305, -0.36458200216293335, -0.3729325234889984, 0.2859795391559601, -0.053201138973236084, -0.14393353462219238, -0.5666672587394714, 0.17632827162742615, 0.7538621425628662, 0.09802449494600296, -0.185186192393302...
Http headers, normal forms cant. Ajax requests must be from the same domain. So "x-requested-with" "XMLHttpRequest" requests must be from the same domain. There are two scenarios you need to secure with web services: 1. Is the user authenticated? 2. Is the action coming from my page? The authentication piece is alre...
[ 0.1657431423664093, -0.11921559274196625, 0.6240442395210266, 0.11983601748943329, -0.19065149128437042, -0.3402750790119171, 0.31669458746910095, -0.48376134037971497, -0.2168535590171814, -0.48325440287590027, -0.05861509591341019, 0.18967215716838837, -0.14946575462818146, 0.04109105095...
means that a malicious website performs actions on behalf of your user while they're still logged in to your site. [Here's a great writeup on XSRF](http://www.codinghorror.com/blog/archives/001171.html). Jeff Atwood sort of sums it all up in the link above, but here is XSRF protection in four steps: 1. Write a GUID ...
[ 0.6452212333679199, 0.0871812105178833, 0.241497203707695, -0.08158674091100693, -0.07707932591438293, -0.40954577922821045, 0.5581279397010803, -0.4095838963985443, -0.07679577171802521, -0.26129069924354553, -0.033982839435338974, 0.5580589771270752, -0.5441460609436035, -0.2942132353782...
Here is some code that I can't seem to understand how it works. I know it is using generics but what does the "new" in the where clause mean? ``` public class MediaPresenter<T> where T : Media, new() { public MediaPresenter(string mediaPath, params string[] extensions) { _mediaPath = mediaPath; ...
[ 0.23688465356826782, -0.29416558146476746, 1.089921236038208, -0.1864764243364334, 0.37276318669319153, -0.15137030184268951, 0.19977393746376038, -0.3875877559185028, -0.47581154108047485, -0.8486806154251099, -0.283235102891922, 0.8921847343444824, -0.47782009840011597, 0.467613190412521...
_media = new ObservableCollection<Media>(); DirectoryInfo directoryInfo = new DirectoryInfo(_mediaPath); foreach(string extension in _fileExtensions) { FileInfo[] pictureFiles = directoryInfo.GetFiles( extension, SearchOption.AllDirectories ...
[ 0.1393127590417862, -0.3085844814777374, 1.1576370000839233, -0.1227649599313736, 0.33445507287979126, -0.1433974802494049, 0.1434343457221985, -0.28513121604919434, -0.5282438397407532, -0.8989903926849365, -0.505574643611908, 0.9017580151557922, -0.6636576652526855, 0.4092978239059448, ...
foreach(FileInfo fileInfo in pictureFiles) { if(_media.Count == 50) break; T media = new T(); media.SetFile(fileInfo); _media.Add(media);
[ 0.3723662793636322, -0.3305623233318329, 0.7153173089027405, -0.3531213700771332, 0.42253220081329346, 0.01239484641700983, 0.11885423213243484, -0.49418848752975464, -0.46291255950927734, -0.8262948989868164, -0.6247520446777344, 0.7372910976409912, -0.6002964377403259, 0.197857066988945,...
} } } } ``` I also don't understand in the LoadMedia method how the T is used? Can the T get referenced anywhere in the class? > Here is some code that I can't seem to understand how it works. I know it is using generics but what does the "new" in the where clause mean? The new() in the where clause mean...
[ 0.2833217680454254, -0.1988244205713272, 0.05686686933040619, 0.07927649468183517, -0.0764678567647934, -0.2367832213640213, 0.10400740802288055, 0.1664915680885315, -0.021212004125118256, -0.5181198716163635, -0.10138530284166336, 0.6766201257705688, -0.44425711035728455, 0.20149412751197...
a valid type to pass to this class as a type parameter. See <http://msdn.microsoft.com/en-us/library/sd2w2ew5.aspx>. > I also don't understand in the LoadMedia method how the T is used? Can the T get referenced anywhere in the class? Yes. T is a type parameter of the class, so the whole class knows about it. It woul...
[ 0.413582444190979, -0.28867411613464355, 0.05801594629883766, 0.32697728276252747, -0.12592902779579163, -0.2486594021320343, 0.082330621778965, 0.1521013230085373, -0.09873169660568237, -0.29805588722229004, -0.029794398695230484, 0.50400310754776, -0.3424825370311737, 0.16969038546085358...
In LaTeX figures, one can use `\textwidth` and `\columnwidth` to specify sizes of the graphic relative to the size of surrounding text, e.g. `\includegraphics[width=.5\textwidth]{myimage}`. I would like to easily switch from onecolumn to twocolumn template (and back) without the figure growing too large for onecolumn ...
[ -0.004593511577695608, -0.2914908230304718, 0.37254777550697327, -0.18894962966442108, -0.20251940190792084, 0.3695894777774811, -0.20635078847408295, -0.08384418487548828, -0.20091383159160614, -0.6318019032478333, -0.11282604932785034, 0.5296825170516968, -0.3384610414505005, -0.11832158...
through the use of LaTeX macro system? Although it's possible to write this sort of macro, I wouldn't want to hardcode it into each figure; how about something like this ``` \makeatletter \newlength \figwidth \if@twocolumn \setlength \figwidth {0.9\columnwidth} \else \setlength \figwidth {0.5\textwidth} \fi \makea...
[ 0.09892983734607697, -0.21932056546211243, 0.4529600143432617, -0.09929859638214111, 0.13191576302051544, 0.352471262216568, -0.2445334792137146, 0.045551225543022156, -0.26225635409355164, -0.9059088230133057, 0.15919780731201172, 0.5187435150146484, -0.3337554931640625, -0.15980577468872...
In my web application, I need to be able to allow users to upload and download their images. How can this be don in ASP.net? I want to user to be able to sign in (I already have that done) and be able to upload images to their account. Later on, I want them to be able to download them. Thanks There are probably a lot...
[ 0.2863115668296814, -0.13605447113513947, 0.8087767362594604, -0.0407024547457695, -0.2366909682750702, -0.01166979968547821, 0.04998122528195381, -0.05196886882185936, -0.32204994559288025, -0.8026746511459351, 0.11645510792732239, 0.4974891245365143, -0.2702387571334839, -0.0491246618330...
</div> <div class="bottom"></div> </div> ``` In your aspx, wherever you need this block, call it like this: ``` <% Html.RenderPartial("box", Lambda.Action(() => { %> here comes my content! <a href="http://www.google.com">Google!</a> <% })); %> ``` Here's the Lambda helper class: ``` public static class Lambda...
[ -0.011859513819217682, -0.2925841510295868, 0.6672235727310181, -0.11450185626745224, -0.2662118375301361, 0.17642106115818024, 0.13684090971946716, -0.2934211194515228, -0.2141987383365631, -0.5236569046974182, -0.39298051595687866, 0.41739892959594727, -0.518761932849884, -0.014626624993...
For a hobby project I'm going to build a program that when given an image bitmap will create a cross-stitch pattern as a PDF. I'll be using Cocoa/Objective C on a Mac. The source bitmap will typically be a 24bpp image, but of the millions of colours available, only a few exist as cross-stitch threads. Threads come in...
[ 0.7824082374572754, 0.050765957683324814, 0.5966034531593323, 0.16588431596755981, -0.07663612067699432, 0.22887013852596283, -0.3078659772872925, 0.04879831522703171, -0.4847065210342407, -0.5003615617752075, -0.026212071999907494, 0.5207271575927734, -0.15744136273860931, 0.1742449402809...
R G B ----- ------------------ --- --- --- blanc White 255 255 255 208 Lavender - vy dk 148 91 128 209 Lavender - dk 206 148 186 210 Lavender - md 236 207 225 211 Lavender - lt 243 218 228 ...etc... ``` My first problem, as I see it, is from a starting point of the RGB...
[ 0.04266685992479324, 0.2724558711051941, 0.3428032398223877, -0.27110305428504944, -0.22061164677143097, 0.40096744894981384, 0.06581823527812958, -0.6527085304260254, -0.5048682689666748, 0.06844787299633026, -0.12314216792583466, 0.5290257334709167, -0.10712312906980515, 0.45543813705444...
a pixel in the image choosing the nearest colour available from the DMC set. What's the best way of finding the nearest DMC colour mathematically, and ensuring that it's a close fit as a colour too? Although I'll be using Cocoa, feel free to use pseudo-code (or even Java!) in any code you post. Use the [LAB](http://en...
[ 0.20276159048080444, -0.11638522148132324, 0.5330562591552734, 0.06091318652033806, -0.17832911014556885, 0.1626131385564804, -0.1425112634897232, -0.2874490022659302, 0.02735547535121441, -0.8424810171127319, -0.17581717669963837, 0.448495090007782, -0.23061712086200714, -0.27019089460372...
space you choose. Note that the distance must be computed **circularly** for some color spaces (e.g. those employing *hue*). (Most color quanization revolves around actually choosing a palette, but that has already been taken care of in your case, so you can't use the more popular quantization techniques.) Also, chec...
[ 0.25813809037208557, -0.07894054800271988, 0.4567128121852875, -0.016968630254268646, -0.0615379624068737, 0.005011104978621006, -0.2269441932439804, -0.17100203037261963, -0.27908334136009216, -0.8741343021392822, -0.23220928013324738, 0.32347598671913147, -0.135046124458313, -0.044114820...
sort of defeats the purpose of cross-stitching.
[ 0.4307631850242615, 0.10942663252353668, -0.22820548713207245, 0.049408648163080215, 0.07387485355138779, 0.20283034443855286, 0.41188424825668335, 0.4023423194885254, 0.16814328730106354, -0.37198585271835327, 0.37089377641677856, 0.008562843315303326, 0.18152813613414764, 0.1462292820215...
I have a table with an `IntegerField` (`hit_count`), and when a page is visited (for example, `http://site/page/3`) I want record ID 3's `hit_count` column in the database to increment by 1. The query should be like: ```sql update table set hit_count = hit_count + 1 where id = 3 ``` Can I do this with the standard ...
[ 0.15057645738124847, 0.5090337991714478, 0.5618898868560791, -0.3041359484195709, -0.3847043216228485, -0.12898823618888855, -0.06154818460345268, -0.543673038482666, -0.35559600591659546, -0.5105694532394409, 0.1369956135749817, 0.6267808675765991, -0.4298994243144989, -0.2396620064973831...
clutter up all your views. ---
[ 0.6630464792251587, 0.6087299585342407, 0.16522330045700073, 0.09491732716560364, 0.035200271755456924, -0.3240848779678345, -0.043947454541921616, 0.4796748161315918, -0.21556365489959717, -0.39740729331970215, 0.292863130569458, 0.44807112216949463, -0.025066131725907326, 0.1657732874155...
I've been talking with friends and some completely agree that templates in C++ should be used, others disagree entirely. Some of the good things are: * They are more safe to use (type safety). * They are a good way of doing generalizations for APIs. What other good things can you tell me about C++ templates? What b...
[ 0.9098488688468933, 0.26103484630584717, -0.3093928396701813, 0.02708808332681656, -0.40580078959465027, -0.2886025011539459, 0.18185198307037354, 0.13513357937335968, -0.4094456732273102, -0.48307931423187256, 0.1776261329650879, 0.670644998550415, -0.1704704910516739, 0.02259218692779541...
a very powerful mechanism which can simplify many things. However to use them properly requires much time and experience - in order to decide when their usage is appropriate. For me the most important advantages are: * reducing the repetition of code (generic containers, algorithms) * reducing the repetition of code ...
[ -0.06458670645952225, 0.11270947009325027, 0.12005048990249634, 0.34469074010849, -0.20526188611984253, -0.10535914450883865, 0.17366717755794525, -0.4100196659564972, -0.3987991511821747, -0.5539342164993286, -0.03747236356139183, 0.7155662775039673, -0.18826158344745636, -0.0754064172506...
great Proto library, we have Blitz++) * other less spectacular tools and tricks used in everyday life: + STL and the algorithms (what's the difference between `for` and `for_each`) + bind, lambda (or Phoenix) ( write clearer code, simplify things) + Boost Function (makes writing callbacks easier) + tuples (how to g...
[ 0.07337234914302826, -0.27048376202583313, -0.39758986234664917, 0.08240041136741638, -0.1133822649717331, 0.026737155392766, 0.15580590069293976, 0.02333967015147209, -0.18918052315711975, -0.886072039604187, 0.252798855304718, 0.5826290249824524, -0.4619516432285309, -0.35696303844451904...
mentioned above. Downsides: * Compilation time (for example throw in Sprit, Phoenix, MPL and some Fusion and you can go for a coffee) * People **who can** use and understand templates are not that common (and these people are useful) * People **who think that they can** use and understand templates are quite common (...
[ 0.6567578315734863, 0.1551833599805832, -0.2881411910057068, 0.31793081760406494, -0.05551048740744591, -0.5621401071548462, 0.6614354252815247, 0.007817616686224937, -0.4491333067417145, -0.678199291229248, -0.1951020210981369, 0.458540141582489, -0.27808162569999695, -0.05842998996376991...
need, but still...) I highly recommend the following books: * [C++ Templates: The Complete Guide by David Vandevoorde and Nicolai Josuttis](https://rads.stackoverflow.com/amzn/click/com/0201734842) (thorough introduction to the subject of templates) * [Modern C++ Design. Generic Programming and Design Patterns Applie...
[ 0.43816325068473816, 0.4002304971218109, -0.2891618013381958, 0.10802921652793884, 0.05514875799417496, 0.09228895604610443, 0.25540852546691895, -0.5194326639175415, 0.020377079024910927, -0.5280324816703796, -0.20465482771396637, 0.4803989827632904, -0.31456607580184937, -0.3380058705806...
There is a thread in my Delphi application that has a message-waiting loop. Every time it receives a message, it starts doing some work. Here is the execute procedure of that thread: ``` procedure TMyThread.Execute; begin while GetMessage(Msg, 0, 0, 0) and not Terminated do begin {thread message} if Msg.hw...
[ -0.16468249261379242, -0.31780949234962463, 0.36942264437675476, -0.25305747985839844, 0.09472379088401794, -0.15456141531467438, 0.3628006875514984, -0.13348543643951416, -0.21251624822616577, -0.36644822359085083, -0.2159302979707718, 0.2745925784111023, -0.55958092212677, 0.211940005421...
this I mean that while the main thread is doing some work, the GetMessage function in my thread does not return even though a message is waiting to be received by it (the message is sent by yet another thread using the PostThreadMessage funciton: PostMessage(MyThreadId, WM\_MyMessage, 0, 0)). Only when the main threa...
[ 0.08096042275428772, -0.11936179548501968, 0.5864901542663574, 0.073127880692482, 0.13302728533744812, -0.021720439195632935, 0.45326364040374756, 0.006334650795906782, -0.2949706017971039, -0.6456010937690735, -0.29959020018577576, 0.41869479417800903, 0.1336406171321869, 0.22505302727222...
a thread would be dependent on the main thread. Doing the tests I used the WaitForSingleObject function in the main thread, waiting for an event for a few seconds. This is when I noticed that my thread was not doing any work even though messages were sent to it by another thread. When the WaitForSingleObject function...
[ 0.3387123644351959, -0.6045399308204651, 0.0695074200630188, 0.1317545473575592, -0.21984493732452393, -0.10231952369213104, 0.33917567133903503, 0.00872952863574028, -0.39693841338157654, -0.3261201083660126, 0.5445992946624756, 0.2987945079803467, -0.6031503081321716, 0.23581315577030182...
created by the main thread. May this be the reason? Thanks for your help in advance. Mariusz. --- Mghie, you were absolutely right again (you have helped me with the messaging stuff lately, you might remember). As you suggested, GetMessage returns immediately, but the thread hangs, in fact, on a call to a main wind...
[ 0.2805115580558777, -0.3205837607383728, 0.45390501618385315, 0.10740391165018082, 0.16187205910682678, -0.11040478944778442, 0.19551025331020355, 0.22794459760189056, -0.48366090655326843, -0.6864917874336243, -0.4781774878501892, 0.25375109910964966, -0.3908814787864685, 0.53849899768829...
FOnCommEventMethod(FCommEventsQueueItem); ... end else DispatchMessage(Msg); end; end; ``` FOnCommEventMethod is a method of object, declared as 'procedure (EventMask: Cardinal) of object;' (this thread handles serial port events). In this case the FOnCommEventMethod was assigned a procedure bel...
[ -0.2167891561985016, -0.18188421428203583, 0.7494913935661316, -0.12142311036586761, 0.2419877052307129, -0.04069305211305618, 0.3010818064212799, -0.050360020250082016, -0.37185215950012207, -0.1767072230577469, -0.19964295625686646, 0.577998161315918, -0.4701122045516968, 0.3766124248504...
my thread to be synchronizing with the main thread. Does it happen implicitly? BTW, I understand that any GUI components should not be accessed by any other threads but the main one, so the Synchronize method should be used, but I am only doing some quick tests now. Comming back to the WaitForSingleObject subject, I k...
[ 0.27774038910865784, -0.23961766064167023, 0.232976034283638, 0.28891003131866455, -0.034164804965257645, -0.18503744900226593, 0.6505813598632812, 0.41258060932159424, -0.2734609842300415, -0.4971705377101898, 0.37218815088272095, 0.49527502059936523, -0.4387363791465759, 0.10398738086223...
it was not the reason :-). > Only when the main thread finishes its work or the Application.ProcessMessages method is called, does GetMessage return and my thread starts doing its work. I doubt that this is really what's happening. AFAIK the two message loops should be independent of each other, as long as you don't u...
[ 0.29315492510795593, -0.19156020879745483, 0.5520978569984436, -0.017506495118141174, -0.028841236606240273, -0.09291663020849228, 0.5765755772590637, -0.19418473541736603, -0.3006853759288788, -0.374184250831604, 0.1211889237165451, 0.2911740839481354, -0.24689719080924988, 0.049274560064...
for a few seconds. You should never use *WaitForSingleObject()* in the main thread with a timeout longer than say 100 milliseconds, as this will make your GUI appear sluggish. In fact I would advise you to not use it at all in the main thread, because this is simply polling. Post a message from your worker thread inst...
[ 0.6860318779945374, -0.5335208773612976, 0.30333852767944336, 0.10967551916837692, 0.0011905852006748319, -0.16376322507858276, 0.2984994649887085, 0.4701462686061859, 0.11114820837974548, -0.6397472620010376, 0.177064448595047, 0.19409433007240295, -0.1208166778087616, -0.0715724676847457...
Is there a way to develop Bi (Business Intelligence) solutions with Django? Therefore it should be possible to define models with more than one Datasource. Is anybody out there who has experienced BI with Django? How could it work ? I'm not sure what your definition of BI is or why you assume that a BI solution require...
[ 0.38955649733543396, 0.11718976497650146, -0.13311810791492462, 0.5533348917961121, -0.294633150100708, 0.023581137880682945, -0.15407073497772217, -0.32121381163597107, -0.11897719651460648, -0.21718524396419525, 0.047720957547426224, 0.3805299699306488, -0.4013993442058563, -0.0804875195...
for all analysis. If what I'm saying is correct, then you don't need multiple data sources. Maybe another way to think about the question is: Do the ORM techniques built into Django lend themselves to modeling a dimensional star schema using objects?
[ 0.33967554569244385, 0.10540883988142014, 0.06303346157073975, 0.39007213711738586, -0.1984621286392212, -0.2426646649837494, -0.1157526820898056, 0.03353014215826988, -0.3479486405849457, -0.4277072846889496, 0.12694399058818817, 0.6663622856140137, 0.0074368915520608425, -0.1175933033227...
I know I can generate PDF reports with SQL Reporting Service (even SQL Express can do this) and I can do Word documents with SQL Developer edition. Since my dev box is SQL Developer and my website uses SQL Express (I know, it's far from ideal) I would like to know if the reporting service that is included with SQL Expr...
[ 0.4469546377658844, 0.19330772757530212, 0.27652478218078613, 0.15060675144195557, -0.18825511634349823, -0.3986862301826477, 0.3581807017326355, 0.017947353422641754, 0.0622318796813488, -0.6948841214179993, 0.09534396976232529, 0.29408594965934753, -0.015190674923360348, 0.35773041844367...
don't think can do that anyways, at least not in SQL 2005). Advantages: no Office installation needed, nothing to install but the SDK, no Reporting Services needed. Edit: 2008 does render Word and [I did not read anything](http://msdn.microsoft.com/en-us/library/ms365166.aspx) about not all formats being supported i...
[ -0.01460353285074234, -0.15960529446601868, 0.39655637741088867, 0.11471693962812424, -0.11199146509170532, -0.3194306492805481, 0.46385282278060913, 0.07920344918966293, -0.1812618225812912, -0.49157437682151794, 0.006583303213119507, 0.642268180847168, -0.4227369725704193, -0.18552076816...
I understand the purpose of GTK, QT or other graphic toolkits. But I don't understand the role of OpenGL. Is it just another GUI-library or does it refer to something more fundamental? If so, what is it and when should I use it in day-by-day hacking? OpenGL is a library for drawing graphics on a low level. It excels ma...
[ 0.059038516134023666, 0.09521058946847916, 0.48563411831855774, 0.35865265130996704, -0.6832715272903442, -0.1390315145254135, -0.2953503429889679, 0.5042202472686768, -0.29710444808006287, -0.786167323589325, -0.015950599685311317, 0.8483121395111084, -0.3734138011932373, 0.07798630744218...
graphics card is integrated into the chipset, it is still rather slow. For day-by-day hacking, GL can serve many unusual purposes. The reason is that you can leverage the GPU's processing power for graphic related tasks. For anything non-graphical, newer languages like CUDA exist as well to access the GPU. While GL's...
[ -0.14766091108322144, -0.11237086355686188, 0.6777475476264954, 0.41829001903533936, -0.393637090921402, -0.27399057149887085, -0.36365050077438354, 0.16936002671718597, -0.2252499759197235, -0.8688912987709045, -0.043706491589546204, 0.37671613693237305, -0.4526192843914032, -0.1090816706...
tasks, even if specific 2D acceleration for these tasks would be available. Mac OS X is a prominent example of a whole desktop (optionally) being rendered through GL to allow appealing effects without high CPU load. But it can also be used for example to blend anti-aliased text glyphs onto a textured background. As so...
[ -0.12407191097736359, -0.18453919887542725, 0.4483718276023865, 0.3400544822216034, -0.2851598262786865, 0.19055649638175964, 0.14428111910820007, 0.2650565207004547, -0.4428067207336426, -0.8843328952789307, -0.28227347135543823, 0.6567357778549194, -0.29513028264045715, -0.34018710255622...
but the inclusion of GL rendering into their widgets. So you can use them for UI drawing and include your performance critical realtime graphics where it suits. Building a whole UI inside GL is a pain, but there are also solutions for that available (typical use cases are games with in-game UI).
[ -0.11189159750938416, -0.17050117254257202, 0.4970318675041199, 0.38075971603393555, -0.2584618926048279, -0.2003156542778015, 0.1826643943786621, 0.0547507144510746, -0.2029508650302887, -0.8914904594421387, -0.04067128524184227, 0.33579304814338684, -0.29463905096054077, -0.1136309131979...
Does anyone know if there's an algorithm for this? I have several 2D points. I need to find a list of points that when you draw a line from point n to point n+1 you end up with an area that contains all the points. If I could attach an image, I could explain myself better. Thanks in advance. What you are looking for is...
[ 0.092115618288517, -0.04650840908288956, 0.41731417179107666, -0.04406645894050598, -0.3151192367076874, 0.3378077447414398, 0.04653127118945122, 0.08328468352556229, -0.4512613117694855, -0.7649310231208801, 0.07553398609161377, 0.28995877504348755, -0.05318097770214081, -0.06901663541793...
I'm starting the design of a new app that is primarily network oriented, and I'm looking for some advice from people who have come up with a good architectural design, or OOP class model. Please describe the basic architecture and/or class structure. Did you abstract out the communication bits? What class entities did...
[ 0.7089895009994507, -0.01998845860362053, 0.16036109626293182, 0.29114964604377747, -0.06877776980400085, 0.10986965149641037, 0.05112134665250778, 0.0939653217792511, -0.10626544058322906, -0.7431433796882629, 0.07219535112380981, 0.5571942925453186, -0.2799285650253296, 0.123716056346893...
clients that connect to me persistently and i send some (or all) of the data to them. Also, I can't use WCF or anything that's in .NET 3.0 or 3.5 (though I can use C# 3 because i'm developing on VS2008). I have to be compatible with Windows 2000. What you are looking for is probably the *convex hull*. Wikipedia has a ...
[ 0.18114832043647766, 0.10389824956655502, 0.4506947696208954, -0.03192930668592453, -0.1421426385641098, 0.0806913822889328, 0.193682461977005, 0.22032223641872406, -0.7478309869766235, -0.85579514503479, 0.20777523517608643, 0.7885222434997559, -0.37604984641075134, 0.1448362022638321, ...
Are Debug.Assert/Debug.Fail automatically conditionally compiled #if "DEBUG"? Or is it more like if there is no debugger attached (even in release) it just doesn't do much of anything? If so, are there performance implications of leaving them in your code? Or are they really not meant to be in production code, only tes...
[ 0.32679712772369385, 0.18514876067638397, -0.04689299687743187, -0.17443619668483734, 0.00032403343357145786, -0.10918735712766647, 0.5732412338256836, -0.35599276423454285, -0.021816514432430267, -0.2499803751707077, -0.5131497979164124, 0.7045438289642334, -0.5154752135276794, -0.1219490...
System; using System.Diagnostics; class Test { static void Main() { int i = 0; Debug.Assert(i++ < 10); Console.WriteLine(i); } } ``` If `DEBUG` is defined this prints out 1, otherwise it prints 0. Due to this kind of behaviour, you can't have an `out` parameter on a conditionally...
[ -0.07178063690662384, -0.1025473028421402, 0.04496411606669426, -0.30907416343688965, 0.08086474239826202, 0.18398110568523407, 0.38566920161247253, -0.20826244354248047, -0.09436182677745819, -0.3938010036945343, -0.2945176661014557, 0.37119147181510925, -0.5765653252601624, 0.46712026000...
MethodWithOut(out x); } [Conditional("FOO")] static void MethodWithOut(out int x) { x = 10; } } ``` This gives the error: > Test.cs(13,6): error CS0685: Conditional member 'Test.MethodWithOut(out int)' cannot > have an out parameter
[ -0.1936788260936737, -0.011497230269014835, 0.19877003133296967, -0.27566757798194885, 0.11224081367254257, 0.13351410627365112, 0.48614659905433655, -0.5606803297996521, -0.16996054351329803, 0.02905614860355854, 0.06836218386888504, 0.31323301792144775, -0.4674367308616638, 0.13241957128...
I extracted, configured and used make for the installation package in my server. However, I could not use *make install*. I get the error ``` [~/wepapps/python/Python-2.6.1]# make install /usr/bin/install -c python /usr/local/bin/python2.6 /usr/bin/install: cannot create regular file `/usr/local/bin/python2.6': Permi...
[ 0.4069174528121948, -0.03642716631293297, 0.11423098295927048, -0.23139192163944244, 0.0844850018620491, -0.16160497069358826, 0.45576241612434387, -0.1773340106010437, -0.07221627235412598, -0.7830854654312134, -0.23353467881679535, 0.5913441777229309, -0.5219101309776306, 0.1741477251052...
system Python which “#!/usr/bin/env python” will choose. You can alter your PATH setting to make just typing “python” from the console run that version, but it won't help for web apps being run under a different user. If you compile something that links to Python (eg. mod\_wsgi) you have to tell it where to find your...
[ 0.2133840024471283, -0.08304404467344284, 0.3192117214202881, -0.15403208136558533, 0.022203072905540466, -0.1316162794828415, 0.25851836800575256, -0.00591892609372735, -0.4630797505378723, -0.7177584767341614, -0.1429612636566162, 0.5940288305282593, -0.5271778702735901, -0.0853700861334...
What is the difference between the User scope and Application scope in app.config? I don't know of any specific add-ins, but this could be achieved with a simple [DXCore](http://devexpress.com/Products/Visual_Studio_Add-in/DXCore/) plugin.
[ 0.5829128623008728, -0.06794050335884094, 0.2989954948425293, 0.06504019349813461, -0.057719673961400986, -0.007998882792890072, -0.007767042610794306, -0.11273658275604248, -0.13558626174926758, -0.7876840233802795, 0.05074863135814667, 0.828540027141571, -0.2828176021575928, -0.186430186...
I want to make a local instance of a Java `Scanner` class in a clojure program. Why does this not work: ``` ; gives me: count not supported on this type: Symbol (let s (new Scanner "a b c")) ``` but it will let me create a global instance like this: ``` (def s (new Scanner "a b c")) ``` I was under the impressi...
[ 0.20839519798755646, 0.029024090617895126, 0.2514669895172119, 0.035518478602170944, -0.06661960482597351, -0.3910767734050751, 0.2915569543838501, -0.31248998641967773, -0.1919202357530594, -0.7163383364677429, 0.03663518279790878, 0.48861202597618103, -0.5590329766273499, 0.0520496033132...
c")] (exprs)) ``` You can only use the lexical bindings made with let within the scope of let (the opening and closing parens). Let just creates a set of lexical bindings. I use def for making a global binding and lets for binding something I want only in the scope of the let as it keeps things clean. They both hav...
[ 0.24360884726047516, 0.18140952289104462, 0.2436991035938263, -0.03826276212930679, 0.03096185065805912, -0.4036293029785156, 0.13278615474700928, -0.24103997647762299, 0.10961336642503738, -0.5000835657119751, -0.2688768208026886, 0.5898173451423645, -0.2548319399356842, -0.00648822076618...
I'm wondering if you can put the main class (or the class with the init method, whatever) inside a package and still have it run in a browser? Most of the time I put my applets into the (default package) but my applet here is in a package, so can I still embed it into the webpage? I've googled it with little results. ...
[ 0.12168611586093903, 0.218424454331398, 0.1739373803138733, -0.11049146205186844, 0.09482675790786743, 0.3000350296497345, 0.38671642541885376, -0.07258716225624084, -0.43500789999961853, -0.8206523060798645, -0.256037175655365, 0.441061407327652, -0.20941030979156494, -0.2073327898979187,...
advance. The archive attribute should contain the file name of the jar, and it should be placed in the same directory as the web page. The class file in the code attribute should contain the fully qualified class name separated by forward slashes to indicate the directory structure. Therefore, in your list of trials ...
[ 0.19733621180057526, 0.17549976706504822, 0.4693182706832886, -0.007875378243625164, -0.03863217309117317, 0.10379326343536377, 0.3074350953102112, -0.5667739510536194, -0.0951170027256012, -0.7512387037277222, -0.06416255235671997, 0.5829235315322876, -0.019154122099280357, -0.09396049380...
page](http://www.math.gatech.edu/~carlen/applets/archived/ClassFiles/Basins.html) for reference.
[ -0.06749888509511948, 0.3627735674381256, -0.0589078851044178, 0.17294982075691223, 0.08158443123102188, 0.12990371882915497, 0.07460569590330124, 0.08576971292495728, -0.5406184196472168, -0.3054788112640381, 0.08168154209852219, -0.22431866824626923, -0.012607675045728683, 0.531200289726...
I currently have an application that sends XML over TCP sockets from windows client to windows server. We are rewriting the architecture and our servers are going to be in Java. One architecture we are looking at is a REST architecture over http. So C# WinForm clients will send info using this. We are looking for high...
[ 0.14068318903446198, 0.0145125025883317, 0.43311819434165955, -0.010643023997545242, -0.2467738538980484, -0.12134150415658951, 0.04039839282631874, 0.04720766842365265, -0.17537742853164673, -0.8706815838813782, -0.017731253057718277, 0.23470216989517212, -0.2906363606452942, 0.2957119047...
service, is it straight HTTP or do you need to secure it with SSL? In other words, what can you tell us about the *workload parameters*? (I say this over and over again on performance questions: unless you can tell me something about the workload, I can't -- nobody really can -- tell you what will give better performa...
[ 0.5936952233314514, -0.029748329892754555, 0.41019365191459656, 0.15469355881214142, -0.18250970542430878, -0.22969850897789001, 0.4907451570034027, 0.09897243231534958, -0.2815437912940979, -0.6004486083984375, 0.07045017182826996, 0.5913206338882446, 0.11207713931798935, 0.03034997545182...
estimates simply by looking at how many messages you want to exchange, because setup time for TCP/IP often dominates REST. REST offers two advantages here: first, the TCP/IP time often *does* dominate the message transmission, and that's pretty well optimized in production web servers like Apache or lighttpd; second, a...
[ 0.06678632646799088, -0.258215069770813, 0.2983401417732239, 0.2839754819869995, -0.19487084448337555, -0.008924480527639389, -0.05635005608201027, -0.3653905689716339, -0.3730224072933197, -0.9000692963600159, 0.03377266228199005, 0.3892415761947632, -0.03217843547463417, -0.0283829234540...
Is there a way to add optional parameters to C# 3.0 like there will be in C# 4.0? I gotta have this feature, I just can't wait! **Edit:** If you know a work-around/hack to accomplish this, post it also. Thanks! You can use an anonymous type and reflection as a workaround to named parameters: ``` public void Foo<T>(T...
[ 0.4648870527744293, -0.36380016803741455, 0.30926963686943054, -0.050550803542137146, 0.22354111075401306, 0.023400887846946716, 0.3907378613948822, -0.03815632686018944, -0.17795586585998535, -0.5515908002853394, -0.07159783691167831, 0.9637095332145691, -0.34825679659843445, -0.055479098...
Console.WriteLine(dict["Message"]); } } ``` So now I can call Foo like this: ``` Foo(new { Message = "Hello World" }); ``` ... and it will write my message. Basically I'm extracting all the properties from the anonymous type that was passed, and converting them into a dictionary of string and object (the name...
[ -0.15193144977092743, 0.11648833006620407, 0.6825466752052307, -0.32255056500434875, 0.1250307261943817, -0.09542188793420792, 0.03749247267842293, 0.0671091079711914, 0.3753713369369507, -0.7296083569526672, 0.0608675517141819, 0.701343834400177, -0.368647962808609, 0.26827743649482727, ...
I'm hoping to use a custom richfaces skin to handle the bulk of my presentation work. Unfortunately richfaces renders borders around every cell in a calendar component and around each panel. I would like to turn them off so that day numbers site in an open grid with no borders. There is no obvious way to do that using ...
[ 0.9156768321990967, 0.08011430501937866, 0.39753246307373047, 0.017599351704120636, -0.06971409171819687, 0.12545430660247803, -0.03675046190619469, 0.21792887151241302, -0.3300030529499054, -0.8059852123260498, 0.3777376413345337, 0.23456457257270813, -0.08147437125444412, 0.1009865999221...
everything using ugly CSS. So how do I stop richfaces adding borders to panels and calendars? --- This guy has a [similar problem](http://www-02.imixs.com:8081/roller/ralphsjavablog/entry/richfaces_background_for_input_fields) As of version 3.3.0.GA it is not possible to ask richfaces to stop rendering CSS for borde...
[ 0.5321961045265198, -0.009111633524298668, 0.4828967750072479, -0.22546638548374176, -0.1346718668937683, -0.0668153241276741, 0.4736694395542145, -0.006493573542684317, -0.35677123069763184, -0.759720504283905, -0.03131734952330589, 0.68681800365448, -0.4493192434310913, -0.01479234546422...
this: ``` <u:style name="color" skin="abstractColorName" /> ``` The following CSS properties are useful for quickly neutralising the border and background related properties. ``` border: none; background: transparent; ``` To get started with plug and skin you can use the following Maven2 command sequence: ``` mv...
[ 0.4027983248233795, -0.09621728956699371, 0.49403098225593567, -0.10420041531324387, -0.1505746841430664, 0.029378274455666542, 0.16490575671195984, -0.43023499846458435, -0.07410848885774612, -0.7417747974395752, -0.05549868196249008, 0.7111383080482483, -0.13003744184970856, -0.281138896...
artefact for holding mulitple skin definitions. --- It would be possible - though a lot of work - to add support for skin properties in the general format xxxBackgroundEnabled and xxxBorderEnabled to switch off rendering of those border and background CSS on a case by case basis. You would need to work with the ric...
[ 0.23683135211467743, -0.14140285551548004, 0.34526389837265015, 0.03460374101996422, -0.2050648182630539, 0.21615077555179596, 0.16297420859336853, -0.2416279911994934, 0.21012765169143677, -0.9233354926109314, 0.21933363378047943, 0.7372320890426636, -0.22871807217597961, -0.2158286869525...
files. If you made such a modification to richfaces then you would be able to disable rendering of the controversial CSS from the properties file of any skin.
[ 0.7882676720619202, 0.014372263103723526, 0.19522622227668762, 0.2589905261993408, 0.03694288432598114, -0.049485158175230026, 0.31208336353302, 0.057970959693193436, -0.15590111911296844, -0.7868478894233704, -0.17143598198890686, 0.7082252502441406, -0.21017450094223022, -0.1055337190628...
I am wondering what other people have experienced in creating a web service application, what language/framework is best suited for a beginner? Are there characteristics of the chosen language that make it better suited to programmers of a certain way of thinking that makes language XYZ appeal to particular programmers...
[ 0.6034737825393677, 0.42132261395454407, 0.04494616761803627, 0.21831963956356049, -0.017097169533371925, -0.00528155779466033, 0.23516878485679626, 0.3521536886692047, -0.22391201555728912, -0.46232250332832336, -0.08422442525625229, 0.5559908151626587, 0.026598142459988594, -0.1299726217...
more suitable for a choice to use, or where a particular choice would appeal to a given task like communicating with a MySQL database or ease of long term maintenance of an application. Anyone have input on this without turning it into a debate? For self-directed learning, PHP is actually kind of hard to beat. It's fo...
[ 0.27597716450691223, -0.06445961445569992, -0.025409366935491562, 0.4341934025287628, -0.3022639751434326, -0.2661098837852478, 0.06102616712450981, 0.011632648296654224, -0.28682640194892883, -0.6523451209068298, 0.3276226818561554, 0.5747864246368408, 0.06377585232257843, -0.180469274520...
offer. Java, Python, C# all offer better designed languages and more consistent libraries at the cost of slightly more layers of abstraction.
[ 0.40003669261932373, 0.1681530773639679, -0.050411343574523926, 0.10723589360713959, -0.09592361748218536, 0.11356113851070404, -0.011473134160041809, -0.03344336152076721, -0.04078267514705658, -0.6722226142883301, -0.5027362704277039, 0.49613553285598755, -0.1407434344291687, -0.20250312...
> This was fixed in Django 1.9 with [form\_kwargs](https://docs.djangoproject.com/en/1.9/topics/forms/formsets/#passing-custom-parameters-to-formset-forms). I have a Django Form that looks like this: ``` class ServiceForm(forms.Form): option = forms.ModelChoiceField(queryset=ServiceOption.objects.none()) rate...
[ 0.004971137270331383, 0.04332830384373665, 0.8299003839492798, -0.42810824513435364, -0.25665539503097534, -0.26213914155960083, 0.2626059651374817, -0.2482617348432541, -0.3235987424850464, -0.6732676029205322, 0.07773072272539139, 0.44910213351249695, -0.3303091526031494, -0.030144151300...
turn this single form into a formset. What I can't figure out is how I can pass the affiliate information to the individual forms when creating the formset. According to the docs to make a formset out of this I need to do something like this: ``` ServiceFormSet = forms.formsets.formset_factory(ServiceForm, extra=3) `...
[ 0.6394340991973877, -0.055316466838121414, 0.612480878829956, -0.11215360462665558, -0.16746915876865387, -0.23551076650619507, 0.25731727480888367, -0.602117657661438, -0.4007191061973572, -0.8720297813415527, -0.0763445496559143, 0.07964478433132172, -0.40745362639427185, -0.028194179758...
by making it difficult to subclass).
[ -0.06489817798137665, 0.08942889422178268, -0.3992067277431488, -0.18803226947784424, -0.07348951697349548, 0.22525736689567566, 0.6435402035713196, -0.34927091002464294, -0.2899899482727051, -0.36516520380973816, -0.2740749418735504, 0.015579349361360073, -0.3624333441257477, 0.2663607597...
I **don't** plan to write applications without IB, I'm just in the process of trying to learn more about programming. How can I get a single instance of my AppController class at startup? (It's normally loaded from the nib.) And can you clear up the use of `+initialize` and `-init`? If I understand, `+initialize` is c...
[ -0.06955251097679138, 0.21992991864681244, 0.13171352446079254, 0.19160133600234985, -0.1531226634979248, 0.23757359385490417, 0.2227097898721695, 0.17414870858192444, -0.08888838440179825, -1.000647783279419, -0.11298806965351105, 0.4472782015800476, -0.2223043590784073, 0.078873530030250...
its subclasses receives a message for the first time. So, when you do: ``` instance = [[[YourClass alloc] init] autorelease]; ``` That `alloc` message triggers `initialize`. If you do the same thing with a subclass: ``` instance = [[[SubclassOfYourClass alloc] init] autorelease]; ``` That `alloc` message will tr...
[ -0.3829955756664276, -0.3600590229034424, 0.16070833802223206, -0.1757078319787979, -0.32953640818595886, -0.2415870875120163, 0.2919652462005615, -0.14033344388008118, -0.39531809091567993, -0.6830295920372009, -0.3304539620876312, 0.22469431161880493, -0.43057501316070557, 0.256071597337...