text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I am trying to create a simple dialog in MFC using Visual C++. My problem is that when I get the dialog on the screen and try to type in an Edit Box field, if I type the letter 'a' once, it appears in the edit box as 'aaaaaaaaaaa' (that's 12 a's). Furthermore, if I try to navigate around in the box using the arrow keys...
[ 0.36620405316352844, 0.3378598093986511, 0.2143653780221939, -0.25707051157951355, -0.22201204299926758, 0.617314875125885, 0.542611837387085, -0.029184821993112564, -0.1181207224726677, -0.5936827063560486, 0.09900868684053421, 0.5066884160041809, -0.3822998106479645, 0.07962390035390854,...
box using the Toolbox in Visual Studio and assigned a variable to it in my class so this isn't any sort of special edit box. If anyone has any thoughts as to what might be happening it would be greatly appreciated. Unfortunately, I don't know where to begin. Thank as always. Are you capturing any events such as WM\_K...
[ 0.2953498959541321, -0.09874217212200165, 0.2791256606578827, 0.06340420991182327, -0.1289518177509308, -0.18858513236045837, 0.31736811995506287, 0.18267399072647095, -0.3753288686275482, -0.7325183153152466, -0.025708032771945, 0.418900728225708, -0.2248607873916626, -0.03087610006332397...
does anyone know is there a way to implement Windows Live ID authentication into your ASP.NET MVC site. There is some info about OpenID implementations and it uses some libraries. So is there a way to implement Live ID or it is not yet supported. Thank you The same way you would with Memberships: <http://www.eggheadca...
[ 0.527519941329956, 0.07755820453166962, 0.16235759854316711, 0.23143941164016724, 0.10144852846860886, -0.4689963161945343, 0.44886457920074463, -0.07633504271507263, -0.37486276030540466, -0.5859191417694092, 0.16843068599700928, 0.3595276176929474, -0.057284481823444366, -0.1239719912409...
I'm performing a bulk insert with an ADO.NET 2.0 SqlBulkCopy object from a C# method into a MS SQL 2005 database, using a database user with limited permissions. When I try to run the operation, I get the error message: > Bulk copy failed. User does not have > ALTER TABLE permission on table > 'theTable'. ALTER > T...
[ -0.07403445988893509, 0.26368871331214905, 0.1865256428718567, -0.2356051802635193, -0.03127620369195938, -0.20972497761249542, 0.17101965844631195, -0.27841103076934814, 0.03132038563489914, -0.27754074335098267, 0.18701571226119995, 0.4834376871585846, -0.3701285421848297, -0.00755989411...
read some documentation and created the bulk copy object with the constructor that lets me specify such things: ``` SqlBulkCopy bc = new SqlBulkCopy( System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"], SqlBulkCopyOptions.FireTriggers & SqlBulkCopyOptions.CheckConstraints); ...
[ 0.32964205741882324, 0.38711807131767273, 0.4628530442714691, 0.052338022738695145, 0.037477415055036545, -0.13904570043087006, 0.18325704336166382, -0.14163823425769806, -0.332743763923645, -0.33119940757751465, 0.21360792219638824, 0.42085495591163635, -0.4744621515274048, 0.239923655986...
is not an option for my situation. Solved it! Looks like I need a refresher on flags enums. I was bitwise ANDing the enum values when I should have been ORing them. ``` SqlBulkCopyOptions.FireTriggers & SqlBulkCopyOptions.CheckConstraints ``` evaluates to zero (which is equivalent to SqlBulkCopyOptions.Default.) ``...
[ -0.4789014160633087, 0.12485820055007935, 0.30456432700157166, -0.14049607515335083, 0.04334131255745888, -0.06443973630666733, 0.4718300402164459, -0.36657360196113586, -0.03263069689273834, -0.42916402220726013, -0.13206197321414948, 0.5691219568252563, -0.328914076089859, -0.33786809444...
My program has to read files that use various encodings. They may be ANSI, UTF-8 or UTF-16 (big or little endian). When the BOM (Byte Order Mark) is there, I have no problem. I know if the file is UTF-8 or UTF-16 BE or LE. I wanted to assume when there was no BOM that the file was ANSI. But I have found that the fil...
[ 0.09075742959976196, 0.3408021330833435, 0.030161654576659203, -0.15546540915966034, 0.10807227343320847, 0.10871807485818863, 0.15292535722255707, 0.24106630682945251, -0.28289440274238586, -0.6840270757675171, -0.3493645489215851, 0.48517045378685, -0.21419423818588257, 0.142703354358673...
way to scan some of the file and most accurately guess the type of encoding? I'd like to be right close to 100% of the time if the file is ANSI and in the high 90's if it is a UTF format. I'm looking for a generic algorithmic way to determine this. But I actually use Delphi 2009 which knows Unicode and has a TEncodin...
[ 0.3454316556453705, 0.06416770070791245, 0.26364684104919434, 0.2543286681175232, -0.23786300420761108, -0.11322736740112305, 0.17277368903160095, 0.12399638444185257, -0.3591279089450836, -0.659979522228241, -0.13827992975711823, 0.11227498948574066, -0.1312119960784912, 0.077934086322784...
alive for only about 45 minutes! That is fast googlebotting!! And also amazing that Stackoverflow gets into 1st place so quickly. The 2nd entry in Google was a blog entry by Fred Eaker on [Character encoding detection](http://fredeaker.blogspot.com/2007/01/character-encoding-detection.html) that listed algorithms in v...
[ 0.276879221200943, 0.06546196341514587, 0.33686381578445435, 0.31532591581344604, -0.30369600653648376, 0.0776987224817276, 0.2886909246444702, -0.19428583979606628, 0.09454215317964554, -0.675111711025238, -0.037292033433914185, 0.23199915885925293, -0.14728699624538422, -0.48997566103935...
you can shell out to a Python script that uses [Chardet: Universal Encoding Detector](http://chardet.feedparser.org/). It is a reimplementation of the character encoding detection that used by Firefox, and is used by [many different applications](http://diveintomark.org/archives/2008/03/05/upstream). Useful links: [Moz...
[ 0.26902732253074646, 0.034995317459106445, 0.3729219436645508, -0.16103287041187286, 0.01569359563291073, -0.08239734917879105, 0.00442165695130825, -0.061247773468494415, -0.2528317868709564, -0.5580676198005676, -0.11174041032791138, 0.6275240182876587, -0.631752073764801, 0.024814259260...
What is the purpose of this Rails config setting... ``` config.action_controller.consider_all_requests_local = true ``` It's set to true by default in `config/environments/development.rb`. Thanks, Ethan Non-local requests result in user-friendly error pages. Local requests, assumed to come from developers, see a m...
[ -0.08058784902095795, -0.043910253793001175, 0.1673353612422943, 0.0843975692987442, 0.012857028283178806, -0.07257367670536041, 0.7740458250045776, 0.04043545946478844, -0.07472091168165207, -0.753004789352417, -0.17686176300048828, 0.699215829372406, -0.28887954354286194, -0.009899761527...
I have a site that will ultimately support 4 languages and 2 countries (US & Canada, English and Spanish) I'm wondering what's the best way to set up the directory structure? Right now, I have a root site called site.com: This will take you to a page where you choose your country and language. Ideally, I want to h...
[ 0.515684187412262, 0.5987792611122131, 0.3442365527153015, -0.18201479315757751, 0.07659660279750824, 0.05825613811612129, 0.44174134731292725, 0.6237887740135193, -0.1489371359348297, -0.5499423742294312, -0.21412713825702667, 0.2781176269054413, 0.18569360673427582, -0.07290622591972351,...
(Canada French) site.com/us-en/ (US English) site.com/us-es/ (US Spanish) ``` **edit: I have done the following:** There is a dummy directory: /ca/ and /us/ in the application. They both have a default.aspx which is just a redirect. In my case, I redirect them to their English language sites: For example: site.com...
[ 0.6041505932807922, 0.4353472590446472, 0.05536934360861778, 0.009422879666090012, -0.1311241090297699, 0.1074168011546135, 0.22232301533222198, 0.636236846446991, -0.22998423874378204, -0.42793703079223633, -0.1790602058172226, 0.10339199751615524, -0.04722343012690544, -0.176153033971786...
country. Anyway, the Virtual directories /en/, /fr/ and /es/ are inside their respective country physical folders. So you have the following (Virtual Dirs are in **bold**): site.com/ca/**en**/ (default) site.com/ca/**fr**/ site.com/us/**en**/ (default) site.com/us/**es**/ What this means is that you need to have fi...
[ 0.6533770561218262, 0.14527566730976105, 0.7040205597877502, 0.258044570684433, 0.20034240186214447, -0.08806867897510529, 0.24766291677951813, 0.25414398312568665, -0.5918565392494202, -0.42650339007377625, -0.2333209365606308, 0.16323013603687286, -0.027530530467629433, 0.227420434355735...
locations. Identical app. Globalization using one URL SOUNDS like a good idea, but I don't think it will spider properly, and even if it does, doesn't offer a good bookmarkable link. (French person sends link to another french person using an computer set to English). There are other implications, but there is a reas...
[ 0.31492215394973755, 0.1569995880126953, 0.6088778972625732, 0.20775167644023895, 0.2931887209415436, -0.0029116463847458363, 0.3543805778026581, 0.4948197603225708, -0.28355342149734497, -0.7200952768325806, -0.052127595990896225, 0.16322334110736847, -0.10932385176420212, 0.1560471951961...
a reponse redirect to the "choose a language" page.** Perhaps not the best solution, but it seems to be working. Another benefit of doing it this way is if there is some special page that only applies to one site, it can be added to that site only.
[ -0.011377640999853611, -0.24995070695877075, 0.5933197140693665, 0.15890732407569885, -0.18663614988327026, 0.21465283632278442, 0.6591214537620544, 0.16246993839740753, -0.33609166741371155, -0.6805999875068665, -0.6141529679298401, 0.5055283904075623, -0.19203117489814758, -0.09424345195...
I'm scared that one day, I'm going to put a space or miss out something in the command I currently use: ``` rm -rf ./* ``` Is there a safer way of emptying the current directory's contents? The safest way is to sit on your hands before pressing Enter. That aside, you could create an alias like this one (for Bash) ...
[ 0.4348234236240387, 0.09195147454738617, 0.3462251126766205, -0.12683965265750885, 0.40992534160614014, -0.343988299369812, 0.12539397180080414, -0.22502584755420685, -0.32961755990982056, -0.41754063963890076, -0.06567072123289108, 0.9914281964302063, -0.23742687702178955, 0.1778726875782...
I bet I've got elementary question, but I couldn't solve it for two nights. I've got 1 "ul" element and I just want it to move any amount of pixels every e.g. 2 sec to the left. I want him to move like this step by step and then come back to the original position and start moving again. I've been stucked, my script on...
[ 0.12172173708677292, -0.23880186676979065, 0.8853887319564819, -0.2945534288883209, 0.16084414720535278, 0.31636908650398254, 0.15369057655334473, -0.511309802532196, 0.02531445398926735, -0.850623369216919, -0.20985805988311768, 0.3790290355682373, -0.4169465899467468, -0.0439851544797420...
eUl.style.marginLeft = i*x+'px'; } } setInterval(move,1000); } ``` This is the simpliest I can think of. I know this script executes whole loop after 1 sec, but I try to do something like this : Move this element to the left, wait, move more to left and so on. Do you mean something like this? ``` window.onload...
[ 0.25711366534233093, -0.425258606672287, 0.6726980209350586, -0.3838542401790619, 0.2513088285923004, 0.1736280471086502, 0.2845996618270874, -0.4958382844924927, -0.0244289580732584, -0.8241543173789978, -0.23827968537807465, 0.26694223284721375, -0.4510952830314636, 0.12458062171936035, ...
eUl.style.marginLeft = (-300*i+delta)+'px'; delta -= 100; // Prepares for the next step if ( delta == -1000 ) delta = 0; // Resets after 10 steps } setInterval(move,1000); } ```
[ 0.11806055903434753, -0.31318050622940063, 0.7454140782356262, -0.3936258554458618, 0.34968864917755127, 0.27779340744018555, 0.14385586977005005, -0.6320428848266602, -0.10149148851633072, -0.7540448904037476, -0.23627614974975586, 0.2754921317100525, -0.14386650919914246, -0.205699965357...
I've created a *very* simple app, which presents an easygui entrybox() and continues to loop this indefinitely as it receives user input. I can quit the program using the Cancel button as this returns None, but I would also like to be able to use the standard 'close' button to quit the program. (ie. top right of a Win...
[ 0.22001352906227112, 0.03364076465368271, 0.4011630117893219, -0.039851561188697815, 0.19532449543476105, -0.24950455129146576, 0.702109694480896, 0.3312637507915497, -0.2039656639099121, -0.5276487469673157, -0.18382428586483002, 0.5460739135742188, -0.32693517208099365, 0.336956024169921...
to alter this handler to act the way I want. However, as I'd rather not mess about with the easygui module, Is there a way to override this behavior from my main script, and have the close button either close the program outright or return None? It would require altering the easygui module, yes. I will get it modified...
[ 0.16166497766971588, 0.043887604027986526, 0.5562241673469543, 0.03210008889436722, 0.12740109860897064, -0.3942689001560211, 0.4779597818851471, 0.3097520172595978, -0.28034722805023193, -0.8937451243400574, -0.11006338149309158, 0.8150426149368286, -0.41959869861602783, -0.05538187175989...
intended to be a simple, discrete way to create GUIs. I think that this addition wouldn't help any, especially since the interface is very sequential, so it would be confusing to new users. [12:19 PM, January 23/09] \*\* The EasyGUI creator said this in reply to my e-mail: > An easygui dialog should never exit > the...
[ -0.22362563014030457, -0.1938137412071228, 0.8306865692138672, -0.0871237963438034, -0.061199385672807693, -0.3553873896598816, 0.23169954121112823, 0.25028806924819946, -0.28248530626296997, -0.9408042430877686, 0.06236274912953377, 0.5465072989463806, -0.33399099111557007, -0.05881738662...
return the same value that a click on > the "cancel" button would return. > I'll meditate on this. > > > -- Steve Ferg I think that this is progress at least. [2:40 PM, January 23/09]
[ 0.15638203918933868, 0.2839139997959137, 0.8679903745651245, 0.25619474053382874, 0.3251246213912964, -0.356945663690567, 0.356108695268631, 0.2775624990463257, -0.05493079125881195, -0.6413173675537109, -0.21902191638946533, 0.6512162685394287, -0.1754126399755478, 0.059147220104932785, ...
How do I check to see if a column exists in a `SqlDataReader` object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored procedures. I want to modified the method to ...
[ 0.2365213930606842, 0.21034424006938934, 0.4261798858642578, -0.04001501202583313, 0.03897153213620186, 0.029762109741568565, 0.08453159779310226, -0.35574740171432495, 0.07633813470602036, -0.5437740087509155, 0.1512107402086258, 0.5819679498672485, -0.32898983359336853, 0.160067364573478...
{ if (dr.GetName(i).Equals(columnName, StringComparison.InvariantCultureIgnoreCase)) return true; } return false; } } ``` Using `Exception`s for control logic like in some other answers is [considered bad practice](https://learn.microsoft.com/en-us/dotnet/standard/desig...
[ -0.04133279249072075, 0.15735085308551788, 0.2416827380657196, 0.11359453946352005, -0.09043127298355103, -0.21612481772899628, 0.6200212836265564, -0.23507066071033478, -0.026400413364171982, -0.4810218811035156, -0.10278026759624481, 0.4109497666358948, -0.305470734834671, 0.223297566175...
thrown. GetSchemaTable() is also another suggestion in many answers. This would not be a preffered way of checking for a field's existance as it is not implemented in all versions (it's abstract and throws NotSupportedException in some versions of dotnetcore). GetSchemaTable is also overkill performance wise as it's a...
[ 0.22897690534591675, -0.08308397978544235, -0.05265560746192932, 0.2709033787250519, -0.4211527109146118, -0.5254372358322144, 0.6454954147338867, -0.1514011025428772, -0.27870818972587585, -0.43904441595077515, -0.020334210246801376, 0.2504778504371643, -0.26929640769958496, 0.17780277132...
How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist. ``` set P4DIFF=C:\cygwin\bin\diff.exe p4 diff -du -c 12345 > patch-to-head.diff # On Other machine patch -p1 < pa...
[ 0.16771216690540314, 0.14184997975826263, 0.5847550630569458, -0.03776808828115463, -0.011475374922156334, -0.20407216250896454, 0.06330221146345139, -0.13747845590114594, -0.2003713846206665, -0.8610818982124329, -0.10020539164543152, 0.6510404944419861, -0.3453768491744995, 0.05405719950...
Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg: ``` typedef struct _foo {} foo; foo *f = ma...
[ 0.036465782672166824, -0.26963168382644653, 0.45246627926826477, -0.2523217797279358, -0.3012470006942749, 0.43829411268234253, 0.3388414680957794, -0.2281331568956375, -0.23894676566123962, -0.7347937226295471, -0.29130861163139343, 0.4049161374568939, -0.3520353436470032, -0.095643565058...
\* can easily be confused for a multiplication. If the type of the variable is changed, the sizeof will not require changing if the variable is the argument, rather than the type. Regarding @icepack's comment: the possibility or likelihood of change for type vs. variable name is not the issue. Imagine the variable nam...
[ -0.04262712970376015, -0.06190863251686096, 0.3653194010257721, -0.15281318128108978, 0.03994804248213768, 0.24592922627925873, 0.23082707822322845, -0.019057393074035645, -0.2633589506149292, -0.6235882639884949, -0.12113912403583527, 0.6015808582305908, -0.3930957317352295, 0.12624084949...
type is changed you are done, no possibility of errors at sizeof statements. Now imagine the type is the argument to sizeof. If the type of the variable is changed, there is no means other than inspection to find all sizeof relating to that variable. You can search, but you will get hits for all the unrelated uses of ...
[ 0.13358193635940552, -0.13786697387695312, 0.40166929364204407, 0.03848855569958687, -0.07127992063760757, 0.13199272751808167, 0.0929911881685257, -0.2795414626598358, -0.41650110483169556, -0.5462660193443298, 0.06928769499063492, 0.7261304259300232, -0.4987076222896576, 0.33962023258209...
Given an array like {"one two", "three four five"}, how'd you calculate the total number of words contained in it using LINQ? Or if you want to use the C# language extensions: ``` var words = (from line in new[] { "one two", "three four five" } from word in line.Split(' ', StringSplitOptions.RemoveEmptyEn...
[ 0.14036017656326294, 0.04764322191476822, 0.396217405796051, -0.1715451031923294, -0.021061884239315987, 0.2351296991109848, 0.2096525877714157, -0.40170958638191223, -0.18522347509860992, -0.36668461561203003, -0.14296987652778625, 0.41781318187713623, -0.12872852385044098, 0.053529590368...
I have many sites that use the same root category of the Main Site. Each product that is added is added to the site it was added to (wow.) and also the Main Site. However, I would like categories on a per site basis to only appear if there are products on that site. If I have: ``` Category1 Category2 Category3 ``` ...
[ 0.5970503687858582, 0.4691341519355774, 0.37989795207977295, -0.38572296500205994, -0.19034329056739807, -0.03145036846399307, 0.1491243541240692, 0.07061551511287689, -0.34836599230766296, -0.6159108281135559, -0.22328196465969086, 0.16158147156238556, 0.08264179527759552, 0.5268814563751...
to the Main Site; the Main Site would list Category1/2/3. No products are added directly to the Main Site. It simply serves as a repository for the other sites. Now, if there is no really easy way to enable this (as I'm sure), would it be as simple as writing my own theme that lists categories that only have products...
[ 0.4667341113090515, -0.07762373983860016, 0.46946147084236145, 0.03457663208246231, -0.3346751630306244, -0.311115026473999, -0.06311678886413574, 0.12391068041324615, -0.4455335736274719, -0.09888911992311478, -0.14754921197891235, 0.3940638303756714, -0.13522832095623016, 0.2670550346374...
base would be easier in the future with later versions of Magento. Thanks, -nelson Well, what you can do is, create your own helper with a collection (through a model), and then filter the collection based on product count. Only a rough draft, but I've posted some code in another magento related question: [Magento p...
[ 0.5564194917678833, -0.005203070119023323, 0.17695286870002747, 0.23994432389736176, -0.1826520711183548, -0.18150950968265533, -0.0760418176651001, -0.28702154755592346, -0.13198478519916534, -0.28710365295410156, 0.1322774589061737, 0.5477365851402283, -0.13233767449855804, -0.5245800614...
shortcutting directly to the database. As long as you stay in your skin/template, there are no larger issues with updating.
[ 0.9694726467132568, -0.3427087068557739, -0.12998592853546143, 0.33117830753326416, -0.10519934445619583, -0.013595971278846264, 0.2685471773147583, 0.025038152933120728, -0.16141511499881744, -0.7723261117935181, 0.10368549078702927, 0.3146105706691742, -0.2127624899148941, -0.28012064099...
How can the XOR operation (on two 32 bit ints) be implemented using only basic arithmetic operations? Do you have to do it bitwise after dividing by each power of 2 in turn, or is there a shortcut? I don't care about execution speed so much as about the simplest, shortest code. **Edit:** This is not homework, but a ri...
[ 0.2623400092124939, 0.21698181331157684, 0.05673063546419144, 0.015635879710316658, -0.18665866553783417, -0.04585716873407364, 0.2734938859939575, -0.21692943572998047, -0.022415244951844215, -0.40331289172172546, -0.1512366384267807, 0.5931487083435059, -0.5426740050315857, -0.3013139069...
easier by an algorithm that is short and simple. While FryGuy's solution is clever, I'll have to go with my original ideal (similar to litb's solution) because comparisons are difficult to use as well in that environment. I'm sorry i only know the straight forward one in head: ``` uint32_t mod_op(uint32_t a, uint32_t...
[ -0.23946675658226013, 0.061212196946144104, 0.5838467478752136, -0.2667297422885895, -0.02127639763057232, -0.11856599897146225, 0.557100772857666, -0.4932266175746918, -0.16675542294979095, -0.706636369228363, -0.27253177762031555, 0.8543112874031067, -0.13984811305999756, -0.150186181068...
// or just: result += n * mod_op(a - b, 2); if(mod_op(a, 2) != mod_op(b, 2)) { result += n; } a /= 2; b /= 2; n *= 2; } return result; } ``` The alternative in comments can be used instead of the
[ -0.012626253068447113, -0.16132678091526031, 0.23295573890209198, -0.29683616757392883, -0.019556017592549324, 0.13666582107543945, 0.20795035362243652, -0.42217788100242615, -0.23984871804714203, -0.1962718814611435, -0.36069974303245544, 0.7465994954109192, -0.3237912058830261, -0.086388...
if to avoid branching. But then again, the solution isn't exactly fast either and it makes it look stranger :)
[ -0.11468115448951721, -0.6203018426895142, 0.2053273618221283, 0.40991121530532837, 0.16623950004577637, 0.15817421674728394, 0.2801305055618286, 0.18463583290576935, -0.45252150297164917, -0.47136786580085754, 0.2013360559940338, 0.37335771322250366, 0.006086705252528191, 0.00944986660033...
A lot of developers say only throw exceptions in truly exceptional circumstances. One of these would be if an external hard drive I want to write to is not switched on (therefore not a connected/registered drive). However, there are some situations which are difficult to work out whether they are truly exceptional or n...
[ 0.22735169529914856, 0.059054650366306305, -0.23842164874076843, 0.09570539742708206, 0.007242204155772924, -0.6276349425315857, 0.5965486168861389, 0.21720340847969055, -0.36664316058158875, -0.4183482229709625, -0.351580947637558, 0.38732096552848816, -0.23538896441459656, 0.151265665888...
action? E.G. ``` public void Find(string name) { if(Names.contains(name) { string s = Names.get(name); } if(!Names.contains(string name) { throw new ???Exception; } } ``` Or do something like display a popup and handle the situation gracefully? Is it wise to throw an except...
[ -0.03003576025366783, -0.35963061451911926, -0.1755266636610031, -0.10217925906181335, -0.14537586271762848, -0.010675725527107716, 0.3934073746204376, -0.5065951943397522, -0.4711267054080963, -0.47578638792037964, -0.2488863617181778, 0.5294494032859802, -0.43653604388237, -0.23703572154...
any interruptions, do so. (File doesn't exist, but its input isn't essential to continuing operation [preferences, optional configuration, etc]) If you need user intervention, ask them. (File doesn't exist, but you need it to continue operating) If it's a problem the user can't fix (out-of-memory, failed hardware, et...
[ 0.5742557644844055, 0.2107771933078766, 0.2273634374141693, 0.0799328088760376, 0.5084512829780579, -0.39863377809524536, 0.24364632368087769, 0.08430895954370499, -0.45007580518722534, -0.5973648428916931, -0.6374167203903198, 0.51727294921875, -0.18354298174381256, -0.024271629750728607,...
Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone? An app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture. The EXIF data for a photo taken on the iPhone contains aper...
[ 0.03807508200407028, 0.04755079373717308, 0.3194323778152466, 0.11679104715585709, 0.1601538360118866, -0.04571681469678879, 0.4284602701663971, -0.037746261805295944, -0.16308322548866272, -0.4502033591270447, -0.12169113010168076, 0.9270735383033752, -0.4674138128757477, -0.2636761069297...
`C:\Windows\SysWoW64\CMD.EXE`. The reason this worked fine on my system is that I use Far Manager for most of my command-line usage, which is 32-bit (therefore it launches 32-bit command prompts). When I verified I must have confused a 32-bit window for a 64-bit window (after all they look the same!) and asked a stupi...
[ 0.1420062929391861, 0.2173883616924286, 0.17854586243629456, -0.11869919300079346, 0.04473463073372841, -0.42167559266090393, 0.17716027796268463, 0.3986043334007263, 0.02425876259803772, -0.5591439604759216, -0.04985056445002556, 0.7095596790313721, -0.10992085933685303, 0.333553642034530...
I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically when it comes to using Object Initializers. The project builds fine normally, however it would seem that TeamCity transforms the build file into something it likes (some MSBuild mutation) and when it comes to compiling the code for a pa...
[ 0.11388897150754929, 0.09577344357967377, -0.23147180676460266, -0.03902784734964371, -0.2700416147708893, 0.09818576276302338, 0.7301444411277771, -0.33813074231147766, -0.12542203068733215, -0.7508241534233093, -0.11063990741968155, 0.2908821403980255, -0.32504206895828247, -0.2276669293...
ErrorView.xaml.cs(35, 16): error CS1518: Expected class, delegate, enum, interface, or struct [11:16:21]: ErrorView.xaml.cs(46, 91): error CS1031: Type expected [11:16:21]: ErrorView.xaml.cs(46, 119): error CS0116: A namespace does not directly contain members such as fields or methods [11:16:21]: ErrorView.xaml.cs(48,...
[ 0.13702082633972168, 0.19471722841262817, -0.08696111291646957, -0.16621683537960052, -0.10752379149198532, 0.15232275426387787, 0.7583043575286865, -0.3418545126914978, -0.09293347597122192, -0.5613778829574585, -0.11365389823913574, 0.38232266902923584, -0.30923232436180115, -0.253793388...
and if not, does anyone know a way to force it to use the 3.0 compiler (if one exists) or the 3.5 compiler? For those interested, the CSC command being executed is: ``` C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\..\....
[ 0.2017040103673935, 0.21975833177566528, 0.6205183267593384, 0.028670933097600937, 0.13682204484939575, 0.10843124985694885, 0.07925858348608017, -0.26130086183547974, -0.24135760962963104, -0.6372626423835754, -0.3774472773075104, 0.2091192901134491, -0.31309765577316284, 0.10720253735780...
changing the build runner from Nant to command runner - this just executed the Nant build file as it was intended without any manipulation, though the feedback level is different. Any other suggestions would be appreciated. Are you using the sln2005 build runner? That will use the 2.0 csc. Check your build configuratio...
[ -0.2370230108499527, -0.3125317096710205, 0.44007664918899536, -0.3582873046398163, -0.28026092052459717, -0.09407420456409454, 0.3584691286087036, -0.2094220370054245, -0.1938406080007553, -0.8013527989387512, 0.03095155768096447, 0.5980463624000549, -0.4274398684501648, 0.039667174220085...
msbuild task uses MSBuild 2.0 (from Microsoft .NET Framework 2.0), however you can use MSBuild 3.5 (from Microsoft .NET Framework 3.5) if you add the teamcity\_dotnet\_use\_msbuild\_v35 property with the value of true to your msbuild task in NAnt script. For example:" ``` <msbuild project="SimpleEcho.v35.proj"> <!-...
[ 0.12603524327278137, -0.17462603747844696, 0.4444046914577484, -0.09876091778278351, -0.14859668910503387, -0.039326198399066925, 0.5806480646133423, -0.2468533217906952, -0.05279802531003952, -0.8269550204277039, -0.17751798033714294, 0.7458242774009705, -0.1806577444076538, -0.3132967948...
The code ``` <%=Html.CheckBox("SendEmail") %> ``` evaluates to two HTML elements when it's rendered ``` <input id="SendEmail" name="SendEmail" type="checkbox" value="true" /> <input name="SendEmail" type="hidden" value="false" /> ``` Is this by a bug? Or by design? If it's by design, why? I think I found [somet...
[ 0.14392386376857758, 0.26890313625335693, 0.21526704728603363, -0.12967272102832794, -0.2025950402021408, 0.16095687448978424, 0.5334790945053101, -0.18351233005523682, -0.03256091848015785, -0.804446816444397, -0.15879115462303162, 0.2766845226287842, -0.27622559666633606, -0.180326089262...
I'd like to split a string using one or more separator characters. E.g. "a b.c", split on " " and "." would give the list ["a", "b", "c"]. At the moment, I can't see anything in the standard library to do this, and my own attempts are a bit clumsy. E.g. ``` def my_split(string, split_chars): if isinstance(string...
[ 0.47106286883354187, -0.26101624965667725, -0.07828506082296371, -0.2706077992916107, 0.06517040729522705, 0.052693065255880356, -0.07204738259315491, -0.3018724024295807, -0.09164910018444061, -0.5147093534469604, -0.19126269221305847, 0.4741540551185608, -0.26582300662994385, 0.118758358...
[] for s in string_L: res.extend(s.split(split_char)) return my_split(res, split_chars[1:]) print my_split("a b.c", [' ', '.']) ``` Horrible! Any better suggestions? ``` >>> import re >>> re.split('[ .]', 'a b.c') ['a', 'b', 'c'] ```
[ 0.49688127636909485, -0.15667560696601868, 0.1526029109954834, -0.6018072366714478, 0.1696230173110962, 0.4500584602355957, 0.2641555666923523, -0.24129068851470947, -0.08322974294424057, -0.4917967915534973, -0.43492671847343445, 0.5152230262756348, -0.36956092715263367, 0.324613034725189...
I'm trying to do a simple erase and keep getting errors. Here is the snippet of code for my erase: ``` std::list<Mine*>::iterator iterMines = mines.begin(); for(int i = oldSizeOfMines; i >0 ; i--, iterMines++) { if(player->distanceFrom(*iterMines) < radiusOfOnScreen) { onScreen.push_back(*iterMines); ...
[ 0.17819808423519135, 0.5851912498474121, 0.5089675188064575, -0.35244473814964294, 0.14470341801643372, 0.29567116498947144, 0.6227108240127563, -0.12840133905410767, -0.07444508373737335, -0.7101870775222778, 0.09865415096282959, 0.482505202293396, -0.37134623527526855, 0.3538400530815124...
[ 1> _Ty=SpaceObject *, 1> _Secure_validation=true 1> ] 1> and 1> [ 1> _Ty=Mine *, 1> _Secure_validation=true 1> ] 1> and 1>
[ 0.4539589583873749, 0.5705757141113281, 0.17467932403087616, 0.011521023698151112, 0.24467889964580536, 0.04217410832643509, 0.13293522596359253, -0.4592534005641937, 0.13124683499336243, -0.20092545449733734, -0.38225534558296204, 0.3978520631790161, 0.12788048386573792, 0.031429763883352...
[ 1> _Ty=SpaceObject *, 1> _Secure_validation=true 1> ] 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called ``` I'm puzzled because I believe I'm giving it the correct iterator. Mine is a subclass of SpaceObject (a se...
[ 0.21860677003860474, 0.37971094250679016, 0.06953278183937073, 0.14483284950256348, 0.05103040859103203, 0.04859152436256409, 0.18482080101966858, -0.20644798874855042, 0.1120658740401268, -0.4955902397632599, -0.2600944936275482, 0.4418240487575531, -0.19893677532672882, 0.107449345290660...
iterator of mines as an iterator in the onScreen list. This will not work. Did you mean to call mines.erase(iterMines) instead of onScreen.erase(iterMines)?
[ 0.3241356611251831, 0.23633868992328644, 0.16260649263858795, 0.07092456519603729, 0.18205837905406952, 0.4011627733707428, 0.4142649471759796, -0.09474977850914001, -0.4444495141506195, -0.3922884464263916, 0.06637200713157654, 0.5411984324455261, -0.4748156666755676, 0.07185538858175278,...
Using the Java URL class, I can connect to an external `HTTPS` server (such as our production site), but using a local URL I get following exception. ``` "SunCertPathBuilderException: unable to find valid certification path to requested target". ``` How do I get a valid certification path? EDIT: I'm not using this...
[ 0.45156025886535645, 0.14540770649909973, 0.4638154208660126, 0.10532243549823761, -0.1169348955154419, -0.3600192666053772, 0.41087618470191956, -0.058057889342308044, -0.01994912512600422, -0.7426618337631226, -0.148812398314476, 0.48930320143699646, -0.34053099155426025, 0.2067669630050...
default Trust Manager and HostName Verifier for HttpsURLConnection. This might be undesirable for some because it will effect all HttpsURLConnections but I'm just writing a simple proxy so it worked for me. ``` private void setTrustAllCerts() throws Exception { TrustManager[] trustAllCerts = new TrustManager[]{ ...
[ 0.04412359371781349, -0.09297183156013489, 0.27974843978881836, -0.14376357197761536, 0.157553032040596, -0.42612534761428833, 0.7643067836761475, -0.30826535820961, 0.14197885990142822, -0.6596328616142273, -0.1152377799153328, 0.7404347062110901, -0.45148560404777527, -0.0342315100133419...
public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType ) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType ) { } } }; // Install the all-trusting trust manager try { SSLContext sc = SSLContext.get...
[ 0.20370827615261078, -0.28525376319885254, 0.28726711869239807, 0.18701064586639404, 0.1699228435754776, -0.36806291341781616, 0.781600296497345, -0.2646014392375946, 0.2334633618593216, -0.5733569264411926, -0.5701019763946533, 0.5214377641677856, -0.6062158346176147, -0.02797249890863895...
HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { return true; } }); }
[ -0.018717218190431595, -0.22857289016246796, 0.504307746887207, -0.03176301717758179, -0.20711547136306763, -0.38366931676864624, 0.6649786233901978, -0.004999652970582247, 0.09152328222990036, -0.6244227290153503, -0.26162540912628174, 0.4936741888523102, -0.37705421447753906, 0.244173988...
catch ( Exception e ) { //We can not recover from this exception. e.printStackTrace(); } } ```
[ 0.2878815829753876, -0.17232540249824524, 0.14580707252025604, -0.0512288399040699, 0.3698582947254181, -0.5408768653869629, 0.26094716787338257, -0.14541566371917725, -0.2076413780450821, -0.3236013948917389, -0.23811949789524078, 0.5510175824165344, -0.4527229070663452, 0.146750152111053...
I am using a route like this one: ``` routes.MapRoute("Invoice-New-NewCustomer", "Invoice/New/Customer/New/{*name}", new { controller = "Customer", action = "NewInvoice" }, new { name = @"[^\.]*" }); ``` There is an action which handles this route: ``` public ActionResult NewInvoice(string name) { A...
[ -0.20052826404571533, -0.24663777649402618, 0.7662181854248047, -0.20857581496238708, 0.17744986712932587, -0.03928826376795769, 0.049401137977838516, -0.17083898186683655, -0.2912939786911011, -0.734576940536499, -0.2831580340862274, 0.41692569851875305, -0.3121209740638733, 0.09871578216...
is the best way to handle this kind of special character with ASP.NET MVC? Thanks! Ok, I confirmed that this is *now* a known issue in ASP.NET Routing, unfortunately. The problem is that deep in the bowels of routing, we use Uri.EscapeString when escaping routing parameters for the Uri. However, that method does not e...
[ 0.029157789424061775, -0.08217646181583405, 0.33862367272377014, 0.0328177772462368, -0.3280952572822571, 0.13951760530471802, 0.12705931067466736, 0.01818559318780899, -0.2949099540710449, -0.5006650686264038, 0.16172127425670624, 0.6678095459938049, 0.05831810459494591, 0.257137119770050...
want to use the octothorpe is to write a custom route for this route and after getting the virtual path path, encode the # sign using HttpUtility.UrlEncode which encodes # to %23. As a follow-up, I wanted to point you to this blog post which talks about passing in other "invalid" characters. <http://haacked.com/archiv...
[ 0.12839925289154053, -0.11046476662158966, 0.4160368740558624, 0.14687848091125488, 0.08811479061841965, -0.03989459201693535, 0.18213783204555511, 0.23909856379032135, -0.30880215764045715, -0.7817564606666565, 0.22669705748558044, 0.15417183935642242, -0.24058610200881958, -0.02255551703...
**The question, in brief:** In MVC, how do you distinguish between a checkbox click (or a selectbox or listbox change) from a human meaning "Controller, modify the model", and a checkbox click (or a selectbox or listbox change) from the Controller meaning "I'm updating the view because the model has changed"? --- **...
[ 0.0006621726206503808, -0.12150131911039352, 0.5144152045249939, 0.0038203203584998846, -0.25910288095474243, -0.0041437712498009205, 0.06709494441747665, -0.0541374497115612, -0.0746987834572792, -0.8280447721481323, -0.21578335762023926, 0.42444905638694763, -0.4316520392894745, -0.08916...
Edges between pairs of Vertices. There are two ways to disable an Edge from Vertex A to Vertex B: 1. click on the Edge to make the "Edge Details" window provide you with a "Disable This Edge" button; or 2. click on Vertex A (or B) to make the "Vertex Details" window provide you with a checklist of nearby Vertices, fr...
[ -0.047552041709423065, -0.2004145234823227, 0.4703783690929413, 0.1655275672674179, -0.18549752235412598, -0.14228013157844543, 0.6960194706916809, -0.12864646315574646, -0.3515734076499939, -0.8259304165840149, -0.22351641952991486, 0.4673583507537842, -0.5775099396705627, 0.2419100701808...
of Edge objects. * View: a GMaps UI, with markers and polylines, plus checkboxes and buttons and "Vertex Details" and "Edge Details" DIVs. * Controller: + JS functions that update the model when events on the checkboxes and buttons fire; and + JS functions that update the view when events on the models fire. **Here'...
[ -0.2493508756160736, -0.42542845010757446, 0.7549691796302795, 0.1720179319381714, -0.251903235912323, 0.0803549587726593, 0.3863621950149536, -0.22526946663856506, -0.04247469827532768, -0.8643347024917603, -0.10288059711456299, 0.3219332695007324, -0.43671485781669617, 0.0762609094381332...
on the Edge model object. 4. The Edge model object fires the "I just got disabled" event. 5. Controller function 2 receives the "I just got disabled" event, and 1. redraws the Edge Details Window to say "I'm disabled!" and 2. **unchecks Vertex B in the Vertex Details Window.** 1. **Crap!** This fires Controller fun...
[ -0.006104102358222008, -0.03453955426812172, 0.6576789617538452, 0.20628933608531952, -0.471026211977005, -0.09150129556655884, 0.5832527279853821, -0.07682975381612778, -0.45087772607803345, -0.7008762359619141, -0.19068366289138794, 0.5260065793991089, -0.13091982901096344, 0.26168152689...
misunderstood MVC a bit. I don't have just one View, as I described above: I have several Views into several Models. In particular, I have a checkbox-list View of Edges to a particular Node, and a separate, "detailed window-style" View of an Edge. Furthermore, I shouldn't have one controller function updating all view...
[ 0.15694588422775269, -0.15425892174243927, 0.5844302773475647, -0.08209117501974106, -0.15179447829723358, 0.29370421171188354, 0.3120724558830261, -0.20716801285743713, -0.22421644628047943, -0.49099117517471313, 0.3618934750556946, 0.4415207505226135, -0.5345838069915771, 0.5734055638313...
disable checkbox events for the moment that it is updating the checkboxes after a Model state change.** Now if a user disables an Edge via the Edge Detail window, the Controller updates the Edge Model, the checkbox-list View receives notification of the update, and the checkbox-list View is smart enough to silence che...
[ 0.20354871451854706, -0.21393220126628876, 0.41516536474227905, 0.22257472574710846, -0.020732948556542397, -0.14069917798042297, 0.6596769690513611, -0.17073091864585876, -0.24020607769489288, -0.6551875472068787, -0.20706914365291595, 0.5102372765541077, -0.46117469668388367, 0.050769273...
has to deal with the problem. Thanks to those who answered my question! Just to recap the MVC model. Views should generally update themselves. Here's how it works: a controller changes the state of the model, the model sends updates to its views, the views pull in new state from the model and update themselves. While...
[ 0.29426032304763794, -0.18086810410022736, 0.5431362986564636, 0.3216632604598999, -0.0794278159737587, -0.14452259242534637, -0.16851601004600525, 0.12126878648996353, -0.3549466133117676, -0.5725444555282593, -0.14471834897994995, 0.8143318891525269, -0.1687159538269043, 0.12615376710891...
They should be considered part of your view. This might not be helpful to the problem at hand but I thought it merited pointing out. You can also not delete your model, I assume you mean you're deleting someting *from* your model, since no views or controllers can actually exist (or be in a functional state) if they'r...
[ 0.2703770697116852, -0.11283090710639954, 0.2917196750640869, 0.3881478011608124, 0.1447700560092926, -0.298029363155365, 0.47428858280181885, 0.03889007866382599, -0.2986350357532501, -0.4735361635684967, -0.047430671751499176, 0.46577733755111694, -0.19843247532844543, 0.1402678191661834...
it that way, otherwise you could just attach your controller to the onClick() and add some logic to the checkbox (or, this being JS, in a function somewhere) to change the checkbox state. If that's not possible, option 1 and 2 are definitely your best bet. addition: user interacting with a view -----------------------...
[ 0.06876075267791748, -0.5374711751937866, 0.5590759515762329, 0.4240880012512207, 0.07304534316062927, -0.1465928852558136, 0.11537205427885056, 0.14999224245548248, -0.0953550860285759, -0.9041118621826172, 0.036644451320171356, 0.6914965510368347, -0.24116745591163635, 0.0827685669064521...
principle the following should happen: * checkbox controller receives the event * checkbox controller changes the state for the value this checkbox represents in the model * model updates listeners (including the checkbox) * checkbox updates its look to reflect that that value has changed The first step, how the cont...
[ 0.31938058137893677, -0.19304803013801575, 0.5238530039787292, -0.07805968075990677, -0.1352011263370514, -0.29310086369514465, 0.5024996995925903, -0.3460882902145386, -0.05084672570228577, -0.42734119296073914, 0.029285479336977005, 0.6796210408210754, -0.1816132664680481, 0.060560092329...
Design patterns are great in that they distill a potentially complex technique into something idiomatic. Often just the fact that it has a name helps communication and understanding. The downside is that it makes it easier to try to use them as a silver bullet, applying them to every situation without thinking about t...
[ 0.6661967635154724, 0.1901140809059143, -0.20681191980838776, 0.41146981716156006, -0.11711453646421432, -0.17240911722183228, 0.4577759802341461, -0.0868985652923584, -0.3582569658756256, -0.7303956747055054, -0.059781718999147415, 0.3445813059806824, -0.23816443979740143, 0.0328749045729...
I'm looking for cases where someone "missed the point" and either applied the wrong pattern, or even implemented it badly. The point of this is that I'd like to be able to highlight that design patterns aren't an excuse to disable critical analysis. Also, I want to emphasise the need to understand not just *what* the ...
[ 0.5380284190177917, 0.1867232620716095, -0.05110268294811249, 0.16369548439979553, -0.037913236767053604, -0.13282355666160583, 0.16854502260684967, 0.01783653162419796, -0.21415510773658752, -0.7836686372756958, 0.01796101965010166, 0.4915069043636322, -0.3505920469760895, 0.0729970857501...
implemented by an abstract BaseDataProvider, that is in turn extended by a SqlDataProvider. In each of the hierarchies, there is only one concrete implementation of each type. Apparently the developer got ahold of a Microsoft document on implementing Enterprise Architecture and, because lots of people use this applicat...
[ 0.1731281578540802, 0.14100968837738037, 0.1590370386838913, 0.22934675216674805, 0.225303053855896, -0.14066122472286224, -0.058972541242837906, -0.09562837332487106, -0.2281728982925415, -0.753288209438324, -0.12807577848434448, 0.25499042868614197, -0.42855507135391235, 0.18382450938224...
passed in via parameters to the more abstract classes. Changing this application is a lot like pulling on a thread in a sweater. The more you pull the more things get unraveled and you end up making changes all over the code to do something that should have been simple. I'm slowly rewriting it -- partly because the co...
[ 0.5265017151832581, -0.13234688341617584, 0.2136790156364441, 0.09527935087680817, -0.004919780883938074, 0.2019280046224594, 0.14246965944766998, -0.14224937558174133, -0.35554245114326477, -0.6138560175895691, 0.23333626985549927, -0.020212525501847267, -0.21911530196666718, 0.4568879008...
If I have a clone of a git repository as a cached copy on a remote server for capistrano/vlad style deployment, is it better to do A) ``` git archive --format=tar origin/master | (cd #{destination} && tar xf -) ``` or B) ``` cp -R cached-copy #{destination} && rm -Rf #{destination}/.git ``` To clarify, the repos...
[ 0.4286401569843292, -0.10148823261260986, 0.6431974172592163, -0.030323151499032974, 0.32191962003707886, 0.009763052687048912, 0.0347508043050766, -0.031329017132520676, -0.4984310269355774, -0.7176865339279175, -0.2505336105823517, 0.7549811601638794, -0.3089955747127533, 0.2554397284984...
to skip *only* `.git` then you'll need the `-f` option and the man page. I love [rsync](http://samba.anu.edu.au/rsync/). Works great and most times you can use it just as you would use scp!
[ 0.622423529624939, 0.13227029144763947, 0.3199557363986969, 0.08993693441152573, -0.040034499019384384, -0.26181095838546753, -0.011597581207752228, 0.211355522274971, -0.6841480731964111, -0.6607562899589539, 0.1150008887052536, 0.23060570657253265, -0.0851394385099411, -0.083635501563549...
Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control? I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max. lengths etc. Any ideas why this would h...
[ 0.25212720036506653, -0.10462979972362518, 0.5784949064254761, 0.17988170683383942, -0.08887666463851929, -0.38824227452278137, 0.4212275743484497, -0.1219264343380928, -0.26593318581581116, -0.5159242153167725, -0.018838563933968544, 0.4266890287399292, -0.08072801679372787, 0.06214449927...
I've tested in Chrome, do I need to test in Safari? I've noticed Safari handles Asian characters better than Chrome. Also Chrome and Safari rely on the same Webkit for rendering pages, but their Javascript engines are totally different, so if you use Javascript in your pages you need to check both.
[ 0.17915283143520355, 0.4434306025505066, -0.12881673872470856, 0.04973851516842842, -0.35262346267700195, 0.2948080003261566, 0.11218281090259552, 0.10668700188398361, -0.04958216845989227, -0.651252269744873, 0.2506556510925293, 0.16818757355213165, -0.06451830267906189, -0.29817607998847...
I am creating an application in .NET that will serve as a second UI for my already-deployed Django app. For some operations users need to authenticate themselves (as Django users). I used a super-simple way to do this (without encrypting credentials for simplicity):- Step 1. I created a django view that accepted the u...
[ 0.08923155814409256, 0.17902988195419312, 0.3211468756198883, -0.18625248968601227, -0.36009976267814636, -0.21459634602069855, 0.32784831523895264, -0.2903881072998047, 0.1916930079460144, -0.6811175346374512, -0.08621125668287277, 0.40055015683174133, -0.2541755735874176, 0.0433919429779...
is not None: if user.is_active: return HttpResponse("correct", mimetype="text/plain") else: return HttpResponse("disabled", mimetype="text/plain") else: return HttpResponse("incorrect", mimetype="text/plain") ``` Step 2. I called this using th...
[ -0.00854515377432108, -0.007524386048316956, 0.4483575224876404, -0.39496415853500366, 0.1469530612230301, -0.2553394138813019, 0.5066027641296387, -0.31716057658195496, -0.06892257928848267, -0.5927363038063049, -0.4055465757846832, 0.7100202441215515, -0.3537948727607727, -0.208187311887...
following representes a simple django URL mapped to the django view above: ``` Dim request As HttpWebRequest = CType(WebRequest.Create(strAuthURL), HttpWebRequest) Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse) Dim reader As StreamReader = New StreamReader(response.GetResp...
[ 0.024398615583777428, 0.07060147821903229, 0.8655291199684143, -0.2746833562850952, -0.5143385529518127, -0.18549880385398865, 0.2943856716156006, -0.5634950399398804, 0.025425100699067116, -0.5402383208274841, -0.03979429230093956, 0.7321273684501648, -0.27730071544647217, 0.0302598904818...
if request.method == 'POST': user = authenticate(username=request.POST['username'], password=request.POST['password']) if user is not None: if user.is_active: return HttpResponse("correct", mimetype="text/plain") else:
[ -0.3035908043384552, -0.17767640948295593, 0.4337248206138611, -0.17024601995944977, 0.38459041714668274, -0.11840680241584778, 0.4989320635795593, -0.26220011711120605, -0.1297321766614914, -0.6667910814285278, -0.6014772057533264, 0.30950120091438293, -0.09046057611703873, -0.15442992746...
return HttpResponse("disabled", mimetype="text/plain") else: return HttpResponse("incorrect", mimetype="text/plain") ``` `I have tested this using restclient and this view works as expected. However I can't get it to work from the .NET code below:` ``` Dim request As HttpWebRequest = ...
[ 0.1868988275527954, -0.1845628172159195, 0.6365711688995361, -0.23975124955177307, -0.28699740767478943, 0.0851818174123764, 0.4042613208293915, -0.4668618142604828, 0.24496540427207947, -0.7852869033813477, -0.5273740291595459, 0.7312238216400146, -0.35359618067741394, 0.0464433953166008,...
Dim postData As String = "username=" & m_username & "&password=" & m_password Dim postBytes As Byte() = encoding.GetBytes(postData) request.ContentLength = postBytes.Length Try Dim postStream As Stream = request.GetRequestStream() postStream.Write(postBytes, 0, postBytes.Length) post...
[ -0.005764205474406481, -0.6280801296234131, 0.9704853892326355, -0.25634756684303284, -0.46162548661231995, 0.3270455300807953, 0.57715904712677, -0.45876309275627136, -0.12111948430538177, -0.4722039997577667, -0.5687611699104309, 0.47536149621009827, -0.5040889978408813, 0.27835851907730...
responseStream.ReadToEnd() response.Close() Catch ex As Exception MessageBox.Show(ex.ToString) End Try ``` The server is giving me a 500 internal server error. My guess is that the POST request is not properly set up in .NET. So I basically need some guidance on how to call the django view from...
[ 0.25476112961769104, -0.030637245625257492, 0.4671470820903778, -0.023569365963339806, -0.4471665918827057, -0.23261648416519165, 0.4620100259780884, -0.11897710710763931, -0.42009982466697693, -0.6014344096183777, 0.1872512698173523, 0.5130109786987305, -0.28711119294166565, 0.02581384219...
This seems to be an absurdly simple question but Google and Stack Overflow searches yield nothing. How can I disable horizontal scrolling in a WPF [ListBox](https://learn.microsoft.com/en-gb/dotnet/api/system.windows.controls.listbox) when items take up more horizontal space than is available in the box? In XAML: ``` ...
[ -0.025670137256383896, 0.00252005853690207, 0.7953492999076843, 0.07795187830924988, -0.01080007292330265, -0.06647936254739761, 0.2418801337480545, -0.23856545984745026, -0.4252973794937134, -0.6997440457344055, -0.2822471857070923, 0.3513166308403015, -0.22078193724155426, -0.10184779018...
I need to read smallish (few MB at the most, UTF-8 encoded) XML files, rummage around looking at various elements and attributes, perhaps modify a few and write the XML back out again to disk (preferably with nice, indented formatting). What would be the best XML parser for my needs? There are lots to choose from. Som...
[ 0.0351482555270195, 0.15432853996753693, 0.32702621817588806, 0.029542410746216774, -0.1233212798833847, 0.14924636483192444, 0.09629100561141968, -0.17458736896514893, -0.3830617666244507, -0.7900649309158325, -0.19596901535987854, 0.5912446975708008, 0.16695018112659454, -0.1857818961143...
need speed, using a StAX parser like *Woodstox* is the right way, but you have to write more code to get things done and you have to get used to process XML in streams.
[ 0.15082895755767822, 0.03459664434194565, 0.15283986926078796, 0.5115900635719299, -0.21881960332393646, -0.33039650321006775, 0.013821610249578953, -0.08686547726392746, -0.060024868696928024, -0.7810772061347961, 0.07977142930030823, 0.3028505742549896, -0.22040368616580963, -0.286651611...
I'm curious How do you people think ? (I mean a way of thinking) about design architecture of your Libraries, Systems, Frameworks, etc. before start coding it. I recently find my self feeling pain in what I've done, and practically every time I want to start everything from scratch.. I do design before, painting some...
[ 0.9968290328979492, 0.24291935563087463, -0.12937034666538239, 0.328764945268631, -0.06239347159862518, 0.1256503015756607, -0.03209490701556206, 0.16907411813735962, -0.3053838014602661, -0.9854639768600464, 0.4659941792488098, 0.3150638937950134, -0.20051932334899902, 0.24849845468997955...
ago, my friend asked me a library what I've done some time ago, and instead of giving him just one file, I had to give him about 3-4 files, and that's because they're connected in some way.. but not in the right one I think :) so it was my mistake in design..) I usually do enough analysis of the problem domain on paper...
[ 0.2752158045768738, 0.38778412342071533, -0.2916050851345062, 0.2202850729227066, -0.0648898333311081, 0.18102721869945526, 0.23965759575366974, -0.12612947821617126, -0.3882375657558441, -0.7486700415611267, 0.2585920989513397, 0.09563617408275604, -0.15338234603405, 0.07318617403507233, ...
too attached to the code you write. If I don't like it, I delete, rename, move and shuffle it around until it expresses a good enough solution to what I'm trying to solve. Sounds easy? Not at all! But with good "coding" tools, actually writing the code is not the major effort. Write some, refactor, delete, write again....
[ 0.48030218482017517, 0.13532225787639618, 0.36213308572769165, 0.3894537091255188, 0.02057318203151226, -0.07768668979406357, 0.5191689729690552, -0.09889047592878342, -0.005400574766099453, -0.7506834864616394, -0.11643411219120026, 0.7589464783668518, -0.023453330621123314, -0.0316628888...
though. The point being, even excellent designers don't get it right the first time. Many times, I thought I understood the problem domain when I started, but I didn't. I then go back to the white board, talk to someone or read up on the problem domain if I realize I don't understand it well enough. I then go back to ...
[ 0.49297863245010376, 0.2576548755168915, -0.04351320117712021, 0.18749210238456726, -0.07822220027446747, 0.016617542132735252, 0.22766327857971191, 0.11744323372840881, -0.20922636985778809, -0.8261688947677612, 0.014595219865441322, 0.44530653953552246, -0.09574352204799652, 0.2795424461...
had profound influence on the way I develop software. The most important among them have been to design software with people who are expert designers. Nothing has influenced me more than spending iterations with great designers. Another event that has, and still do, affect the way I think is going back and look at soft...
[ 0.5120888352394104, 0.46799027919769287, -0.2755569815635681, 0.03483104333281517, 0.03400634974241257, 0.1409095674753189, 0.19673386216163635, 0.31045183539390564, -0.16695842146873474, -0.716941773891449, 0.33777129650115967, 0.6095778942108154, 0.5885142683982849, 0.28433865308761597, ...
Is there any reason for the use of 'T' in generics? Is it some kind of abbreviation? As far as I know, everything works. For example ``` public G Say<G>(){ ... } ``` or even ``` public Hello Say<Hello>(){ ... } ``` T is for **T**ype. But it's really just a tradition and there is nothing to prevent you from using ...
[ 0.7745059728622437, -0.08513636142015457, 0.2653699517250061, -0.008846059441566467, -0.446012943983078, -0.1277618110179901, 0.31046193838119507, 0.26973119378089905, -0.25890690088272095, -0.5596813559532166, -0.18590214848518372, 0.4438444972038269, -0.3495243191719055, 0.36087876558303...
consistent feel across your code.
[ 0.15531405806541443, -0.02099781669676304, 0.2882634997367859, 0.1291806399822235, -0.13377881050109863, -0.3825647532939911, 0.31496313214302063, 0.04821338132023811, -0.035617899149656296, -0.8036722540855408, 0.284922331571579, 0.44084903597831726, 0.12505502998828888, -0.28149977326393...