text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I have a requirement that a Map will be constructed with up to 50~200 entries (it could be more, let's call it not-too-little anyway). The writing is only done once and the reading (using Map.get("keyName")) can go more than 20 per request (it's a webapp). I'm going for Hashmap currently as it (I suppose) gives me the...
[ 0.2092437893152237, -0.03368546813726425, 0.4000365734100342, 0.08747375011444092, -0.03689528629183769, -0.25966256856918335, 0.245605930685997, -0.19896022975444794, -0.30742305517196655, -1.2646605968475342, -0.09760720282793045, 0.4140254259109497, 0.1256393939256668, -0.15202417969703...
them to this code) I wouldn't worry about it. And before I tried to replace the Map I'd look at why, exactly, I need to do 4000 lookups (200 entries by 20 reads each) to generate a web page. But at a bet I'd guess that the time to do those 4000 lookups will turn out to be negligible compared to other parts of the pro...
[ 0.2589084506034851, 0.3019815981388092, 0.5726080536842346, 0.22642171382904053, 0.0828629732131958, 0.3710252344608307, 0.5766726136207581, -0.12091861665248871, -0.4486542046070099, -0.8157427906990051, 0.06899619847536087, 0.37106427550315857, -0.004258560482412577, 0.15063096582889557,...
Has anyone ever been debugging in Visual Studio and it appears to execute different code then the code that is being stepped through? Sometimes it even steps into what appears to be white space in the file that is being stepped through but VS is executing something anyway? I've had this happen several times, once some...
[ 0.6231921315193176, -0.03126576170325279, -0.08659399300813675, 0.2284988909959793, -0.1905800700187683, -0.006420873571187258, 0.39916419982910156, -0.17832250893115997, -0.4898659884929657, -0.3666806221008301, 0.14818735420703888, 0.3108353614807129, -0.37687352299690247, 0.299364328384...
to the executable to start is set on the "Debugging" page of the project properties. Reason 2: you have optimization on. In this case the compiler only saves line of code - to compiled code information for some code and not for other. You'll see that after you press "step over" you actually jump several statements ahe...
[ -0.3011818826198578, -0.039669137448072433, 0.37150025367736816, -0.017911572009325027, -0.01342162024229765, -0.049788039177656174, 0.2222800999879837, -0.4415596127510071, -0.10305732488632202, -0.5352225303649902, -0.3059929609298706, 0.6281053423881531, -0.5001927018165588, -0.23531828...
project usually helps. Reason 4: the program database (see reason 3) in the folder where the executable is located is out of date because VS puts the program database elsewhere on each compilation). Path where to put the .pdb file is set in the linker properties of the project.
[ 0.23870398104190826, -0.14582298696041107, 0.16409412026405334, 0.1447465866804123, 0.13253675401210785, -0.2486535608768463, 0.33019453287124634, -0.26895272731781006, -0.25114548206329346, -0.5432643294334412, -0.2772568464279175, 0.2606377601623535, -0.1702861338853836, 0.03512885794043...
I have been using `eval` feature of ruby many a times. But I have heard people saying `eval`s are nasty. When asked, why and how, I could never get a convincing reason not to use it. Are they really nasty? If yes, in what way? What are possible "safer" options to eval? If you are `eval`ing a string submitted by, or mod...
[ 0.5173553228378296, 0.14004261791706085, -0.10175955295562744, -0.09372051805257797, -0.4093067944049835, -0.12575018405914307, 0.5636726021766663, -0.07322842627763748, -0.09175334125757217, -0.274391233921051, -0.040792644023895264, 0.6084390878677368, -0.49104976654052734, 0.21405331790...
Ruby interpreter is sandboxed appropriately, or ideally both, `eval` can be extraordinarily powerful. The problem is analogous to [SQL injection](http://en.wikipedia.org/wiki/SQL_injection), if you're familiar. The solution here is similar to the solution to the injection problem (parameterized queries). That is, if t...
[ 0.2267572432756424, 0.043023936450481415, -0.2734093964099884, 0.004176987800747156, -0.4269723892211914, -0.0968371331691742, 0.5250787138938904, -0.412221223115921, -0.042037054896354675, -0.38211190700531006, -0.025718364864587784, 0.5904058218002319, -0.5139061212539673, -0.28829354047...
plugged in in the appropriate places.
[ 0.3359299898147583, 0.32035648822784424, 0.3529374599456787, 0.4022987186908722, 0.046087246388196945, -0.11989076435565948, -0.25795888900756836, 0.10683365166187286, 0.1288520246744156, -0.44333136081695557, -0.29952672123908997, 0.5328845381736755, -0.01773594319820404, -0.3219952583312...
I have a site which has been developed completely in flash. Now the site owners do not want to shift to a more text/html based site. So am planning to create an alternative html/text based site which the googlebot will get redirected to. (By checking the useragent). My question is that is this allowed officially by goo...
[ 0.8582606911659241, 0.0602630190551281, 0.14380550384521484, 0.24024583399295807, -0.14459684491157532, -0.46779873967170715, 0.13392704725265503, 0.21033935248851776, -0.3873974680900574, -0.28856465220451355, 0.05096468701958656, 0.3416769504547119, -0.0725385919213295, 0.084892734885215...
the site. Google considers it cloaking and addresses it directly [here](http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=66355) and says: > Cloaking refers to the practice of presenting different content or URLs to users and search engines. Serving up different results based on user agent may cause...
[ 0.7056048512458801, -0.12634171545505524, 0.3182811737060547, 0.19604268670082092, -0.14573463797569275, -0.43106958270072937, 0.43415164947509766, -0.02388230711221695, -0.28824734687805176, -0.2170981764793396, -0.325325071811676, 0.14401091635227203, -0.3629913330078125, 0.1342581808567...
I have an extremely simple control i'm trying to render which looks like this: ``` using System; using System.Web; using System.Web.UI; namespace CORE.BusinessObjects.Web.Controls { public class TestControl : Control { protected override void Render(HtmlTextWriter writer) { writer....
[ 0.015014194883406162, 0.03937608748674393, 0.33990252017974854, 0.018725523725152016, 0.13638968765735626, 0.1681811660528183, 0.2510080933570862, -0.2564103305339813, 0.15773998200893402, -0.6669517755508423, -0.09329477697610855, 0.5160700082778931, -0.3396751582622528, 0.234280019998550...
<Custom:TestControl ID="testControl" runat="server" Visible="true"> </Custom:TestControl> ``` Am i doing something wrong? I have also failed to run ANY control samples i found online. Nothing executes. I can only execute the constructor of the control. Every other method i tried to override like `Render()` or `Create...
[ 0.6118996143341064, 0.12678343057632446, 0.018771156668663025, 0.26057377457618713, 0.07748689502477646, -0.1291225105524063, 0.46767565608024597, -0.30955442786216736, -0.28916555643081665, -0.5837005376815796, 0.22404687106609344, 0.5670215487480164, -0.11313372850418091, 0.0749637037515...
is compiled and referenced in the relevant web project. Optionally, add it to the toolbox and drag it onto the form from there. That should also add the reference in one step. c. Make sure that your control declaration has the `Assembly` attribute which points to the name of the referenced control assembly: ``` <%@ R...
[ 0.3167702257633209, 0.11186958104372025, 0.3609621822834015, 0.247528538107872, 0.33161982893943787, -0.13368941843509674, -0.041909877210855484, -0.30664342641830444, 0.11110401898622513, -0.599565863609314, -0.3629707396030426, 0.3650514781475067, -0.21031183004379272, -0.018726523965597...
I'm using the ASP.NET Login control and have been doing so for a couple of years on a particular site with success. Out of the blue, in the dev environment, this control has stopped working and is now bouncing me back to the login page. Using source control I've reverted recent changes that might have been the cause b...
[ 0.5342540740966797, 0.076750248670578, 0.3422701358795166, -0.07841508835554123, 0.06871624290943146, -0.1381368488073349, 0.6004142165184021, 0.09122830629348755, -0.11175224930047989, -0.6637101173400879, -0.12121016532182693, 0.6281373500823975, 0.16981786489486694, 0.37108710408210754,...
way is fine. If it was me, I would have it on construction of the config object. ``` cConfig Config("config.ini"); ``` This Config class would load the settings found in the file. Any code can access the settings by doing ``` Config.Get("NumberOfFoobars") ``` For testability purposes, if there is no file in the...
[ -0.008078754879534245, -0.052783507853746414, 0.6932874917984009, 0.13775593042373657, 0.3558580279350281, -0.10150688141584396, 0.05392574891448021, -0.15245269238948822, -0.2267760932445526, -0.7017004489898682, -0.16145314276218414, 0.7025259733200073, -0.33141785860061646, 0.0376539379...
testable (you can mock Config class), readeable (at a glance, you can tell which function requires Configs) and you don't have to rely on static instances (singletons are dangerous if you don't know how to use them). You might be interested to [learn more about this](http://misko.hevery.com/2009/02/19/constructor-inje...
[ 0.14538820087909698, -0.3113466501235962, -0.24524526298046112, 0.2650868892669678, -0.14805296063423157, -0.035551268607378006, 0.27054262161254883, -0.16246448457241058, -0.05240925773978233, -0.3200390338897705, -0.05975889042019844, 0.6964426636695862, -0.22571706771850586, -0.23331628...
The applet is in a signed JAR. Last line in console reads: ``` security: Checking if certificate is in Deployment permanent certificate store ``` CPU and memory usage are normal. Other page elements still respond. It's just that the applet is not displayed. There is another applet in the same page but it works. An...
[ -0.35712507367134094, 0.5189216136932373, 0.7019180059432983, -0.1818845421075821, 0.1773190051317215, 0.6650755405426025, 0.4102933704853058, 0.029334448277950287, -0.220017671585083, -0.7178165316581726, -0.19283153116703033, 0.39891478419303894, -0.24612589180469513, 0.18455307185649872...
thread applet-OsApplet,4,alive AWT-EventQueue-2,4,alive Group file:/c:/project/html/-threadGroup,ac=3,agc=0,pri=4 thread applet-javax.swing.JApplet.class,4,alive TimerQueue,4,alive,daemon AWT-EventQueue-3,4,alive Done. ``` Fixed it. Applet is sized relatively but containing DIV is not sized explicitly....
[ -0.15047234296798706, -0.18094177544116974, 0.46221432089805603, -0.39714524149894714, 0.06403791159391403, 0.4519181251525879, 0.24595308303833008, -0.11180554330348969, -0.4112233817577362, -0.5572704672813416, -0.22580426931381226, 0.16511264443397522, -0.3701971471309662, 0.20772175490...
I have an array of dates in a one week range stored in an unusual way. The Dates are stored in this numeric format: 12150 From left to right: 1st digit represents day: 1 = sunday, 2 = monday, 3 = tuesday, ...., 7 = saturday next two digits represent hour in a 24 hour system: 00 = midnight, 23 = 11pm next two digit...
[ 0.4026373028755188, -0.07018937915563583, 0.5003838539123535, 0.1327674686908722, 0.14972764253616333, 0.4648017883300781, 0.05562007054686546, -0.031984783709049225, -0.13657918572425842, -0.5517070293426514, 0.1381373405456543, 0.2065276950597763, 0.034717854112386703, 0.3956243097782135...
time, but I am not sure. In any case, I think there is probably a better and simpler way to do this and I was wondering if anybody knew what that algorithm was. If not it would be cool if someone could double check my work and verify that it does actually work for 100% of valid cases. What I have right now is: ``` ...
[ 0.11012344807386398, -0.057202987372875214, 0.48435840010643005, -0.18614158034324646, 0.2412760704755783, -0.16049402952194214, 0.18649151921272278, -0.2764177918434143, -0.01869342476129532, -0.557004451751709, 0.12568417191505432, 0.35713282227516174, -0.16314579546451569, 0.13704317808...
+ 72359) > startDate && (inputDate + 72359) < endDate) { inRange = yes; } else if((inputDate + 72359) > startDate && (inputDate + 72359) < (endDate + 72359)) { inRange = yes; } } ``` How
[ 0.14001412689685822, 0.1855768859386444, 0.5091583132743835, -0.3560956120491028, 0.32135963439941406, -0.07789261639118195, 0.2633414566516876, -0.37006676197052, 0.06807275116443634, -0.4816523492336273, -0.5120061039924622, 0.4788150191307068, -0.10360538959503174, 0.03499586880207062, ...
about ``` const int MAX = 72460; // Or anything more than the highest legal value inRange = (MAX + inputDate - startDate) % MAX < (MAX + endDate - startDate) % MAX; ``` This assumes of course that all the dates are well formed (according to your specs). This addresses the case where the start is "after" ...
[ 0.35763874650001526, 0.00452630827203393, 0.6126453876495361, -0.19591841101646423, 0.3029177784919739, -0.5212771892547607, 0.11674131453037262, -0.07853903621435165, -0.33017757534980774, -0.3859807550907135, -0.12051316350698471, 0.5622008442878723, 0.1851636916399002, -0.03029453754425...
the basic trick: ``` Legend: 0: Minimum time M: Maximum time S: Start time 1,2,3: Input Time test points E: End Time The S E => Not in range 2 In range 3 > E => Not in range The S > E case 0 M Original
[ -0.2738216817378998, 0.07292553037405014, 0.39456838369369507, 0.011518222279846668, 0.20442791283130646, 0.11438583582639694, 0.6613656878471375, -0.510105550289154, -0.1254546344280243, -0.3491094410419464, -0.2715221345424652, 0.5087916851043701, 0.0753103494644165, 0.029750945046544075...
-1--E----2---S--3-- Add Max -------------------1--E----2---S--3-- Subtract StartDate ------1--E----2---S--3-- % Max S--3--1--E----2---- 1 In range 2 > E => Not in range 3 In range ``` If you really want to go nuts (and be even more difficult to decipher) ``` cons...
[ -0.1143171414732933, -0.00506463972851634, 0.34748512506484985, 0.177361860871315, 0.45965850353240967, -0.1806545853614807, 0.6863473653793335, -0.0973946675658226, -0.24381069839000702, -0.11295923590660095, -0.764518678188324, 0.8599184155464172, -0.18260787427425385, -0.336132138967514...
MAX - startDate; inRange = (maxMinusStart + inputDate) & MASK < (maxMinusStart + endDate) & MASK; ``` which ought to be slightly faster (trading modulus for a bitwise and) which we can do since the value of MAX doesn't really matter (as long as it exceeds the maximum well-formed value) and we're free to ch...
[ -0.0713631808757782, -0.5220730900764465, 0.49648168683052063, -0.0009365517180413008, 0.06077762693166733, 0.04983322322368622, 0.10072503983974457, -0.07248607277870178, -0.14914901554584503, -0.44503316283226013, -0.0651274025440216, 0.5926191806793213, -0.028685670346021652, -0.1420874...
Thare is two forms in a page first one for searching and another for deleting.... ``` <table><tr><td> <% using(Html.BeginForm("ViewList","ControllerName", [values],FormMethod.Post,new{id="viewListForm"})) { %> Name: <%=Html.TextBox("Name", "[value]", new { maxlength = "250" })%> Location: <%=Html.TextBox("L...
[ 0.029346758499741554, -0.04035038873553276, 0.4342789053916931, -0.14168432354927063, -0.048542365431785583, 0.77169269323349, -0.08369330316781998, -0.46237435936927795, 0.06929202377796173, -0.6024782061576843, -0.14015237987041473, 0.3979346752166748, -0.17340871691703796, 0.42662954330...
pressed i need to pass two parameters ie name and location. The values of name and location are in the above viewListForm. How i take this value from the viewListForm at run time ? <% } %> </td></tr><table> ``` The trick to solve this was to create a facade principal and assign that to the thread. Then behind it you ...
[ 0.049001824110746384, -0.057086747139692307, 0.6530700922012329, -0.2968486547470093, 0.22759531438350677, 0.2919609546661377, -0.057883020490407944, -0.11015450954437256, 0.18990390002727509, -0.6853960156440735, 0.3287383019924164, 0.843390703201294, -0.2709816098213196, 0.33541420102119...
What would be considered the best practice in duplicating [cloning] a LINQ to SQL entity resulting in a new record in the database? The context is that I wish to make a duplicate function for records in a grid of an admin. website and after trying a few things and the obvious, read data, alter ID=0, change name, `subm...
[ 0.4731845259666443, 0.358724981546402, 0.15420103073120117, 0.2252754122018814, 0.36422187089920044, -0.08838431537151337, -0.12999260425567627, -0.17821453511714935, -0.36875492334365845, -0.23793838918209076, 0.23419426381587982, 0.28594130277633667, -0.32033470273017883, 0.4011859893798...
and then use the linq mapping classes together with reflection to copy member values. E.g. ``` public static void CopyDataMembers(this DataContext dc, object sourceEntity, object targetEntity) { //get entity members
[ 0.1362246721982956, 0.16674546897411346, 0.3544747531414032, 0.1990245282649994, 0.26384884119033813, -0.36062702536582947, -0.0780748501420021, -0.3197757303714752, -0.13771548867225647, -0.29610198736190796, -0.13132239878177643, 0.6016808748245239, -0.44878116250038147, 0.53142815828323...
IEnumerable<MetaDataMember> dataMembers = from mem in dc.Mapping.GetTable(sourceEntity.GetType()) .RowType.DataMembers where mem.IsAssociation == false select mem; //go through the list of members and compare values foreach (MetaDataMember mem in dat...
[ 0.10361577570438385, -0.03621336817741394, 0.5398150086402893, 0.04876264929771423, 0.1524779051542282, -0.13368870317935944, 0.037722278386354446, -0.21201245486736298, -0.06530332565307617, -0.5263415575027466, -0.2962535619735718, 0.5889459252357483, -0.15766838192939758, 0.124503597617...
object originalValue = mem.StorageAccessor.GetBoxedValue(targetEntity); object newValue = mem.StorageAccessor.GetBoxedValue(sourceEntity); //check if the value has changed if (newValue == null && originalValue != null || newValue != null && !newValue.Equals(originalValue)) {...
[ 0.10022985190153122, -0.14305812120437622, 0.49809521436691284, -0.0857095867395401, 0.2421359121799469, 0.15859773755073547, 0.35833120346069336, -0.3408498466014862, -0.10916955769062042, -0.5310226678848267, -0.08232662081718445, 0.754643976688385, -0.28277596831321716, 0.30307894945144...
targetEntity.GetType().GetProperty(mem.Name); propInfo.SetValue(targetEntity, propInfo.GetValue(sourceEntity, null), null);
[ 0.16285985708236694, -0.6453291773796082, 0.49703076481819153, -0.057884540408849716, 0.0653013363480568, 0.2650574743747711, 0.2880847454071045, 0.02012195996940136, 0.26336485147476196, -0.5464769601821899, -0.39098119735717773, 0.5951324701309204, -0.5955317616462708, 0.1539302170276641...
// setboxedvalue bypasses change tracking - otherwise // mem.StorageAccessor.SetBoxedValue(ref targetEntity, newValue); // could be used instead of reflection } } } ``` ...or you can clone it using the DataContractSerializer: ``` internal static T CloneEntity<T>(T originalEntity)...
[ 0.43897414207458496, -0.4120067358016968, 0.6529514193534851, -0.1482311487197876, 0.3420121371746063, 0.18365536630153656, 0.12062545865774155, -0.2063472419977188, -0.11464647203683853, -0.69305020570755, -0.019796213135123253, 0.37003347277641296, -0.6321879029273987, 0.3892024159431457...
new MemoryStream()) { ser.WriteObject(ms, originalEntity); ms.Position = 0; return (T)ser.ReadObject(ms); } } ```
[ -0.3113640248775482, -0.316761314868927, 0.7484163045883179, -0.18353033065795898, 0.369021475315094, 0.3115006685256958, 0.28333473205566406, -0.28451088070869446, -0.20676115155220032, -0.8041892051696777, -0.3435438275337219, 0.42221033573150635, -0.22404785454273224, 0.590650200843811,...
I recently had to struggle with one installation project (which uses most popular product for creating installations: InstallShield) to make it work for product upgrades (migrating from one version to another). In the end it turned out that I needed to use one long package code but was using some other. It wasted my 8 ...
[ 1.0242702960968018, 0.21884679794311523, 0.05131285637617111, 0.04030587524175644, 0.1425551176071167, -0.1050916463136673, 0.38505223393440247, -0.14156785607337952, 0.007103730458766222, -0.5525062084197998, 0.12514369189739227, 0.6148603558540344, -0.026753775775432587, 0.07818429917097...
simple task normally turns out to be a tricky one and "being closed to finish date" makes in even harder. 1. Don't you think deploying a product is made damn difficult on windows which should have been simpler? (or installer really deserves that much attention and I am just being crazy about it?) 2. Have you ever used...
[ 0.28392326831817627, -0.18234507739543915, -0.0398351326584816, 0.12125201523303986, 0.16436384618282318, -0.34810298681259155, 0.4268615245819092, -0.08993380516767502, -0.45064911246299744, -0.5246450901031494, -0.07923436164855957, 0.7508184313774109, -0.40769219398498535, -0.1028387397...
for the benefit of your customers. Otherwise you will need to do a lot more work to 1. Handle situations where for some reason an error occurs during the installation. What do you do next? 2. Handle issues like security. What if the installing user does not have rights to particular folders/registry keys? 3. Correctly...
[ 0.7474665641784668, -0.18838433921337128, 0.3749854862689972, 0.3107641935348511, 0.3077404499053955, -0.1401599794626236, 0.21509338915348053, -0.31966403126716614, -0.18199533224105835, -0.8751025795936584, -0.19012199342250824, 0.9547030925750732, -0.13899637758731842, -0.23248486220836...
the installation itself! I recommend that you check out [Wix](http://wix.sourceforge.net/). It's not exactly child's play but it gets the job done. If you install Votive as a visual studio add in you get intellisense to help you strucutre the tags correctly. With the help file you can create pretty functional flexible...
[ 0.7926774024963379, -0.39858680963516235, 0.43647241592407227, 0.12962748110294342, 0.014982100576162338, -0.13957464694976807, 0.038152191787958145, 0.2001524418592453, -0.10930715501308441, -0.7104790806770325, 0.04785633459687233, 0.46326932311058044, -0.08202723413705826, -0.2518056631...
Does any one know of a good text to speech library. It needs to be open source and provide C API? PS: I've already done a search, but I'd like recommendations from people who have actually used these APIs you can go for [Festival](http://www.cstr.ed.ac.uk/projects/festival) worked nice for me.
[ 0.5260829925537109, 0.029419781640172005, 0.059171050786972046, 0.19276635348796844, -0.20209267735481262, -0.18898971378803253, 0.17472882568836212, 0.3897152841091156, -0.16656585037708282, -0.46899816393852234, -0.06510306894779205, 0.30224505066871643, 0.28493258357048035, -0.385895758...
I saw this in the java docs: [ScheduledAtFixedRate](http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html#scheduleAtFixedRate(java.lang.Runnable,%20long,%20long,%20java.util.concurrent.TimeUnit)), it says > If any execution of the task > encounters an exception, subsequent > exe...
[ 0.3464668095111847, -0.41364210844039917, 0.2746310234069824, -0.17790578305721283, 0.20987644791603088, -0.22903327643871307, 0.2515094578266144, 0.06253765523433685, -0.545838475227356, -0.46454665064811707, 0.0837627425789833, 0.49353665113449097, -0.5656561851501465, 0.0604652948677539...
ex) { // handle it } catch(final RuntimeException ex) { // handle it } catch(final Exception ex) { // handle it } catch(final Error ex) { // handle it } catch(final Throwable ex)
[ -0.1257469654083252, -0.5423777103424072, 0.35710734128952026, -0.18024508655071259, 0.06249746307730675, 0.08254760503768921, 0.357256144285202, -0.20688022673130035, 0.07991001754999161, -0.3471898138523102, -0.33150723576545715, 0.3267114758491516, -0.4321388900279999, 0.099471777677536...
{ // handle it } } ``` Note that catching anything other than what the compiler tells you too (the IOException in my sample) isn't a good idea, but there are some times, and this sounds like one of them, that it can work out if you handle it properly. Remember that things like Error are very bad - the VM...
[ 0.23352141678333282, -0.089217908680439, -0.2709159255027771, 0.030401267111301422, -0.11468863487243652, -0.1971500962972641, 0.2921212315559387, -0.16832241415977478, -0.12956546247005463, -0.49201148748397827, 0.10269340127706528, 0.4919835329055786, -0.30078864097595215, -0.15910215675...
I have a WPF Label control which I'm trying to change the appearance of using a System.Drawing.Font object supplied by some legacy code. I have been able to set most of the properties, but am struggling with Strikeout and Underline. So far I have: ``` System.Drawing.Font font = FontFromLegacyCode(); System.Windows.C...
[ 0.10554447025060654, -0.0005173470126464963, 0.7590346336364746, -0.1996006816625595, -0.033160120248794556, 0.25649288296699524, 0.21771188080310822, -0.6771022081375122, -0.1328415721654892, -0.8891521692276001, 0.16414634883403778, 0.406141459941864, -0.2488522082567215, 0.1457269936800...
can use. ``` <TextBlock Name="textBlock" TextDecorations="Underline, Strikethrough" /> ``` Or you can stick a TextBlock inside a Label if you really like (although I'd just use the TextBlock by itself). ``` <Label Name="label"> <TextBlock Name="textBlock" TextDecorations="Underline, Strikethrough" /> </Label> ...
[ 0.056372176855802536, 0.01326841115951538, 0.19225828349590302, 0.3420771062374115, -0.21584798395633698, -0.2199176698923111, 0.2769987881183624, -0.19198042154312134, -0.1520276963710785, -0.5943765044212341, -0.0720064640045166, 0.37762877345085144, -0.14095254242420197, 0.0563519150018...
I've discovered that `std::string`s are very slow compared to old-fashioned null-terminated strings, so much slow that they significantly slow down my overall program by a factor of 2. I expected STL to be slower, I didn't realise it was going to be this much slower. I'm using Visual Studio 2008, release mode. It sh...
[ -0.22051581740379333, 0.1530231535434723, 0.22233162820339203, -0.03217693790793419, -0.3976239264011383, 0.03071688488125801, 0.4676983952522278, -0.1720711588859558, -0.10182322561740875, -0.7160877585411072, 0.10432140529155731, 0.6320025324821472, -0.1594737023115158, 0.120680533349514...
sure I could use the "*const reference*" trick in all places. With a reference counting implementation my program would have been fine, but these implementations don't seem to exist anymore. My real question is: why don't people use reference counting implementations anymore, and does this mean we all need to be much ...
[ 0.15341749787330627, 0.23317907750606537, 0.5392587184906006, -0.3094712197780609, 0.35556092858314514, 0.13536085188388824, 0.39651015400886536, -0.09260168671607971, -0.3228359818458557, -0.4496840834617615, 0.18376946449279785, 0.8566464781761169, -0.3177167773246765, -0.042867623269557...
"Hello there buddy, yeah you too"; std::string f; start = clock(); for (int i=0; i < LIMIT; i++) { stop(); f = foo1; foo1 = foo2; foo2 = f; } double stl = double(clock() - start) / CLOCKS\_PER\_SEC; start = clock(); for (int i=0; i < LIMIT; i++) {
[ 0.10518618673086166, 0.08485936373472214, 1.1584608554840088, -0.2836630642414093, 0.33114027976989746, 0.11264627426862717, 0.5804489850997925, 0.05004049837589264, -0.3471469581127167, 0.10172125697135925, -0.4922415614128113, 0.79514080286026, -0.35071176290512085, 0.019710848107933998,...
stop(); } double emptyLoop = double(clock() - start) / CLOCKS_PER_SEC; char* goo1 = "Hello there buddy"; char* goo2 = "Hello there buddy, yeah you too"; char *g; start = clock(); for (int i=0; i < LIMIT; i++) { stop(); g = goo1; goo1 = goo2; goo2
[ 0.02400452084839344, 0.061499498784542084, 0.7638057470321655, -0.3605194091796875, 0.3851167559623718, 0.44233450293540955, 0.47852063179016113, 0.20004379749298096, -0.6434983015060425, -0.023846087977290154, -0.4981938898563385, 0.698100745677948, -0.476010262966156, 0.06140970066189766...
= g; } double charLoop = double(clock() - start) / CLOCKS_PER_SEC; cout << "Empty loop = " << emptyLoop << "\n"; cout << "char* loop = " << charLoop << "\n"; cout << "std::string = " << stl << "\n"; cout << "slowdown = " << (stl - emptyLoop) / (charLoop - emptyLoop) << "\n"; std::string wait...
[ 0.027261750772595406, -0.22811368107795715, 0.16785752773284912, -0.4562039375305176, 0.1557222306728363, 0.19254329800605774, 0.35199108719825745, -0.358403742313385, -0.2461206018924713, -0.2788098156452179, -0.3431588113307953, 0.41032710671424866, -0.51835697889328, 0.00921621918678283...
other containers. Most of them have to do with temporaries and unnecessary copies. It's not too hard to use it right, but it's also quite easy to Do It Wrong. For example, if you see your code accepting strings by value where you don't need a modifiable parameter, you Do It Wrong: ``` // you do it wrong void setMemb...
[ -0.054509978741407394, -0.18759369850158691, -0.23818616569042206, 0.18899495899677277, -0.03649337217211723, -0.1535084992647171, 0.050323884934186935, -0.09856710582971573, -0.3601069152355194, -0.48667123913764954, 0.019926883280277252, 0.430527925491333, -0.42996442317962646, 0.2510400...
are right definitely that there are known problems. For example in this: ``` // let's add a Foo into the vector v.push_back(Foo(a, b)); ``` We are creating one temporary `Foo` just to add a new `Foo` into our vector. In a manual solution, that might create the `Foo` directly into the vector. And if the vector reache...
[ 0.21919114887714386, 0.00865568220615387, 0.4066719710826874, 0.06074216589331627, 0.07527883350849152, 0.10612882673740387, -0.20929692685604095, -0.08802174776792526, -0.3374032974243164, -0.616586446762085, 0.15173277258872986, 0.5348488688468933, -0.53230220079422, 0.06484846770763397,...
common problem is introduced temporaries. Have a look at this ``` string a = b + c + e; ``` There are loads of temporaries created, which you might avoid in a custom solution that you actually optimize onto performance. Back then, the interface of `std::string` was designed to be copy-on-write friendly. However, wit...
[ -0.04771113023161888, -0.1046774834394455, 0.43771663308143616, 0.17438076436519623, -0.16741155087947845, -0.300194650888443, 0.2719694674015045, 0.12436134368181229, -0.5322173237800598, -0.8161087036132812, 0.07233308255672455, 0.4825408160686493, -0.4932425022125244, 0.3987928032875061...
you can use `emplace_back` to directly create a `Foo` into your vector ``` v.emplace_back(a, b); ``` And instead of creating copies in a concatenation above, `std::string` will recognize when it concatenates temporaries and optimize for those cases. Reallocation will also avoid making copies, but will move elements ...
[ 0.13484466075897217, 0.2216065526008606, 0.02287169173359871, -0.06221850961446762, 0.06495603173971176, 0.39755287766456604, -0.2747102379798889, -0.5068370699882507, -0.19559019804000854, -0.7036710381507874, -0.0003555708099156618, 0.09500805288553238, -0.6258142590522766, 0.10881475359...
to the standard map can become unfair, because the standard map has to ensure that elements keep being valid. That was just an example, of course, and there are many such cases that you have to keep in mind when stating "my container is faster than standard ones!!!".
[ 0.15790009498596191, -0.019284069538116455, 0.075803242623806, 0.5346702933311462, 0.07387752830982208, -0.34339815378189087, 0.15079200267791748, 0.20679543912410736, -0.3238639533519745, -0.4482782781124115, 0.177402526140213, 0.08946030586957932, -0.02316177822649479, 0.1150166764855384...
I have a public-facing website that is used to manage business infrastructure equipment for my clients. A security breach on this website could cause expensive problems for clients. A number of different websites--mostly banks, health care, and government--disable the "save password" dialog from appearing in Firefox, ...
[ 0.8073599338531494, 0.27089110016822815, 0.13185589015483856, -0.04983466863632202, 0.41177257895469666, -0.10930868983268738, 0.22248882055282593, 0.07131488621234894, -0.09599502384662628, -0.601284384727478, -0.06911575049161911, 0.5085850954055786, -0.3202952742576599, 0.00511397980153...
I want to know is: * What are some cases in which it is absolutely essential to disable "save password" functionality? Do such cases exist? * Does this technique really provide any additional security? In other words, won't people find a way to leak their passwords despite your best efforts? * Do users complain about ...
[ 0.8512026071548462, 0.3559795320034027, -0.028998175635933876, -0.041238997131586075, 0.29529568552970886, -0.527046799659729, 0.5030421614646912, 0.32599952816963196, -0.271335631608963, -0.3939877450466156, -0.04082700237631798, 0.7311684489250183, -0.25973474979400635, 0.022730829194188...
of people who know how to manage their passwords securely, and for them it's really irritating when websites disable the password field autocompletion because it means they need to do something like, say, writing the password down, or picking a simple one that's easy to remember - neither of which makes them happy, bec...
[ 0.4051494598388672, 0.5225193500518799, 0.05458530783653259, 0.18707947432994843, 0.1852564811706543, -0.37492477893829346, 0.5395570397377014, 0.34443894028663635, -0.443851113319397, -0.5222285985946655, -0.35329437255859375, 0.7368412017822266, -0.17440687119960785, -0.14261285960674286...
some browsers to ignore that. (In Firefox it requires hacking some Javascript file) This also ties into the thing Joel once wrote about how users, erm, *people* like to be in control of their environment. They're much less likely to use (or at least like) a program or website that takes it upon itself to decide that t...
[ 0.05923391878604889, -0.25547459721565247, -0.16141290962696075, 0.3964575231075287, -0.11638842523097992, -0.5050825476646423, 0.5095981955528259, 0.18532973527908325, -0.13862258195877075, -0.5278287529945374, -0.1312340497970581, 0.37727007269859314, -0.2712517976760864, -0.015548428520...
I'm trying to implement a search, where you can enter more than one searchterm to form an AND-Condition. Also it should search in different fields of the database. So for instance: You when you enter *"Bill Seattle"*, you should get a record where **NAME** matches *Bill* and **CITY** matches *Seattle*. You shoudn't...
[ 0.6059395670890808, 0.11996650695800781, 0.4751541018486023, 0.23365217447280884, -0.15983295440673828, 0.06719683110713959, -0.0222711693495512, -0.12844251096248627, -0.22276949882507324, -0.9119090437889099, 0.22873370349407196, 0.0699840858578682, -0.4871714413166046, 0.257883101701736...
works well in our previous case, but suppose we add another field: ``` SELECT * FROM ADDRESS WHERE ((NAME LIKE 'Bill%') OR (NAME LIKE 'Seattle%')) AND ((CITY LIKE 'Bill%') OR (CITY LIKE 'Seattle%')) AND ((COMPANY LIKE 'Bill%') OR (COMPANY LIKE 'Seattle%')) ``` Now it won't return the desired result. What I essentia...
[ -0.09667528420686722, -0.07084397971630096, 0.38172677159309387, 0.05425374209880829, 0.046535443514585495, -0.17997126281261444, 0.22897331416606903, 0.014258239418268204, 0.007828364148736, -0.8366059064865112, -0.24190083146095276, 0.3139673173427582, -0.3260219097137451, 0.068658702075...
be what you really mean: ``` SELECT * FROM ADDRESS WHERE ((NAME LIKE 'Bill%') OR (CITY LIKE 'Bill%') OR (COMPANY LIKE 'Bill%')) AND ((NAME LIKE 'Seattle%') OR (CITY LIKE 'Seattle%') OR (COMPANY LIKE 'Seattle%')) ```
[ 0.48540982604026794, -0.10575054585933685, 0.3777952194213867, 0.1389332115650177, 0.1441039741039276, 0.058286748826503754, -0.2387915551662445, -0.09037071466445923, 0.36442795395851135, -0.7819926738739014, -0.34307795763015747, 0.14433203637599945, -0.18259595334529877, 0.0400396510958...
I'm trying to add a simple "page x of y" to a report made with ReportLab.. I found [this old post](http://two.pairlist.net/pipermail/reportlab-users/2002-May/000020.html) about it, but maybe six years later something more straightforward has emerged? ^^; I found [this recipe](http://code.activestate.com/recipes/5465...
[ 0.4463397264480591, 0.10865123569965363, 0.3518528342247009, 0.16787034273147583, -0.4537717401981354, 0.08149991929531097, 0.14496634900569916, -0.126329705119133, -0.18266820907592773, -0.8087647557258606, 0.31363987922668457, 0.1815563589334488, -0.18597312271595, -0.021513288840651512,...
of where the "x of y" was displayed: ``` self.doc.build(pdf) ``` became ``` self.doc.build(pdf, canvasmaker=NumberedCanvas) ``` **doc** is a BaseDocTemplate and **pdf** is my list of flowable elements.
[ 0.05545199662446976, 0.1245693787932396, 0.5981902480125427, -0.17035506665706635, -0.06093139573931694, 0.22159238159656525, 0.11768515408039093, -0.2508046329021454, 0.08728073537349701, -0.7427329421043396, 0.002959674224257469, 0.4564039707183838, -0.01194889098405838, -0.0693101733922...
I want to redirect both [standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_.28stdout.29) and [standard error](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) of a process to a single file. How do I do that in Bash? Take a look [here](http://tldp.org/LDP/abs/html/io-...
[ 0.3405941128730774, 0.26496338844299316, 0.3891879618167877, -0.2592339813709259, -0.03540380671620369, 0.11976991593837738, 0.20350268483161926, -0.6047119498252869, -0.44828322529792786, -0.6899494528770447, -0.031123856082558632, 0.7842113375663757, -0.008715438656508923, 0.082451209425...
I am using GWT ext and trying to get the values from page and setting it in pojo class. Except date field all the values are obtained using (TimeField) ComponentMgr.getComponent(id[2])).getText()).... But while using the same snippet for date field it fails to perform. Can any one help me with this issue please.......
[ 0.1414192169904709, -0.07933949679136276, 0.7452506422996521, -0.14678709208965302, 0.07672996819019318, -0.3787509799003601, 0.32232391834259033, -0.1277426779270172, 0.03640560060739517, -0.6487008333206177, -0.1684621423482895, 0.7525501847267151, -0.5060731768608093, 0.0644546970725059...
How could I set a constraint on a table so that only one of the records has its `isDefault` bit field set to 1? The constraint is not table scope, but one default per set of rows, specified by a FormID. Here's a modification of Damien\_The\_Unbeliever's solution that allows one default per FormID. ``` CREATE VIEW for...
[ -0.01315600611269474, 0.11853719502687454, 0.4233841896057129, 0.0721733570098877, -0.03395039960741997, -0.11233264952898026, 0.19749243557453156, -0.4541005790233612, -0.13890834152698517, -0.7036964893341064, -0.0792708620429039, 0.41977137327194214, -0.37445372343063354, 0.229899927973...
Hi All I am a newcomer here, I am using the following code from an open source library (Matrix Toolkits for Java) which outputs the following matrix ``` 1000 1000 5 3 5 1.000000000000e+00 ``` I am trying to do a String split that will return me 1000,1000,5 I tried using `S...
[ 0.253775030374527, 0.05121508985757828, 0.4784299433231354, -0.13499562442302704, -0.199596107006073, 0.15504248440265656, 0.29519277811050415, -0.38059353828430176, 0.01830940693616867, -0.28333744406700134, 0.08730088174343109, 0.5078197121620178, -0.09947951138019562, 0.1817235499620437...
is wrong, any idea what I should use instead? thanks a lot! ``` public String toString() { // Output into coordinate format. Indices start from 1 instead of 0 Formatter out = new Formatter(); out.format("%10d %10d %19d\n", numRows, numColumns, Matrices .cardinality(this)); ...
[ -0.06026168167591095, 0.035553283989429474, 0.4426846504211426, -0.1911013275384903, 0.2751310467720032, 0.09645682573318481, 0.1343214511871338, -0.3059389591217041, -0.08513768762350082, -0.5355427265167236, -0.1388373076915741, 0.698284387588501, -0.4004034698009491, 0.08923599869012833...
0) out.format("%10d %10d % .12e\n", e.row() + 1, e.column() + 1, e .get()); return out.toString(); } ``` You should split on any number of spaces, not just single ones. That is, add "+" to your regexp like this: ``` String[] parts = str.trim().split("\\s+"); ```
[ 0.05808194354176521, -0.17275339365005493, 0.11882889270782471, -0.24476003646850586, 0.2372591197490692, 0.1946343183517456, 0.02669820748269558, -0.518405020236969, -0.19838547706604004, -0.3206750750541687, -0.41407427191734314, 0.36661723256111145, -0.3942379057407379, 0.08825606852769...
I'm using netbeans to develop some BPEL but can't figure out how to add a switch-case block, it's not in the palette anywhere. I'm using netbeans 6.5. Any ideas? Switch is definitely a valid element: <http://charltonb.typepad.com/weblog/2003/08/bpel4ws_switch_.html> It's also mentioned in the course materials I'm run...
[ 0.544830858707428, -0.379353404045105, 0.39856892824172974, -0.032356079667806625, -0.010309388861060143, -0.23501349985599518, -0.2556028366088867, -0.2584434449672699, -0.3954927623271942, -0.536194384098053, 0.3022632598876953, 0.49063625931739807, -0.0005021459655836225, -0.12402165681...
How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a `div` while the text remains opaque? I need to do it without using any library such as jQuery, etc. (But if you know of a library that does it I'd love to know so I can look at their code). Use rgba! ``` .alpha60 { ...
[ 0.29020071029663086, 0.1170908734202385, 0.39770472049713135, -0.09161213040351868, -0.2381553202867508, -0.04047580435872078, 0.3741091787815094, -0.17149922251701355, -0.10788057744503021, -0.994939923286438, -0.13295280933380127, 0.6561047434806824, -0.47759515047073364, 0.0259502567350...
5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); /* For IE 8*/ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; } ``` > In addition to this, you have to declare `background: transparent` fo...
[ -0.010688374750316143, -0.21411848068237305, 0.4539160132408142, -0.10627246648073196, 0.010537463240325451, 0.23514710366725922, 0.3236469030380249, 0.13271519541740417, -0.19215986132621765, -0.754700779914856, -0.32559773325920105, 0.22661559283733368, -0.3222881853580475, -0.0881027504...
I am trying to serialize a .NET `TimeSpan` object to XML and it is not working. A quick google has suggested that while `TimeSpan` is serializable, the `XmlCustomFormatter` does not provide methods to convert `TimeSpan` objects to and from XML. One suggested approach was to ignore the `TimeSpan` for serialization, and...
[ 0.3228096067905426, -0.07240329682826996, 0.23956714570522308, -0.0284186489880085, 0.012287888675928116, -0.0592304952442646, 0.25157874822616577, -0.17622511088848114, -0.042952410876750946, -0.8742326498031616, -0.031116286292672157, 0.0574604757130146, -0.3885279595851898, 0.3970254659...
public TimeSpan TimeSinceLastEvent { get { return m_TimeSinceLastEvent; } set { m_TimeSinceLastEvent = value; } } // Pretend property for serialization [XmlElement("TimeSinceLastEvent")] public long TimeSinceLastEventTicks { get { return m_TimeSinceLastEvent.Ticks; } ...
[ 0.43853020668029785, -0.3116651177406311, 0.44716382026672363, -0.05171026661992073, 0.45116475224494934, 0.12122657150030136, 0.10657189786434174, -0.146850124001503, -0.3968966603279114, -0.6445165872573853, 0.12734472751617432, 0.5892722606658936, -0.03447360172867775, 0.175829812884330...
the best way to achieve this? Is there a better way to serialize a TimeSpan to and from XML? The way you've already posted is probably the cleanest. If you don't like the extra property, you could implement `IXmlSerializable`, but then you have to do **everything**, which largely defeats the point. I'd happily use the...
[ 0.2614447772502899, 0.045811742544174194, 0.5009911060333252, 0.2411479353904724, -0.1937437355518341, -0.43881353735923767, -0.021580668166279793, 0.2823490798473358, -0.19919729232788086, -0.9659976959228516, -0.33128878474235535, 0.2744494080543518, -0.13426761329174042, 0.0995308384299...
When I need buffered IO on blocking file descriptor I use stdio. But if I turn file descriptor into non-blocking mode according to manual stdio buffering is unusable. After some research I see that BIO can be usable for buffering non-blocking IO. But may be there are other alternatives? I need this to avoid using thr...
[ 0.3323844075202942, 0.0018811540212482214, 0.07470265030860901, -0.1509743481874466, -0.3382635712623596, 0.03374621272087097, 0.11759055405855179, -0.1845514178276062, -0.20282648503780365, -0.8681357502937317, 0.29280486702919006, 0.5439881682395935, -0.5248773694038391, 0.19220373034477...
is: * have a buffer for each socket * check which sockets are ready to read (select(), poll(), or just iterate) * for each socket: + call recv() and accumulate the contents into the socket's buffer until recv returns 0 or an error with EWOULDBLOCK + call application level data handler for the socket with the content...
[ 0.16445356607437134, -0.34574899077415466, 0.3947242200374603, -0.18062621355056763, 0.1002378761768341, 0.03668881952762604, 0.12337857484817505, -0.23024089634418488, -0.09142301231622696, -0.6138108372688293, -0.4240759313106537, 0.4803268015384674, -0.1923038214445114, -0.0709505155682...
If I have a statement block like this: ``` if (/*condition here*/){ } else{ } ``` or like this: ``` if (/*condition here*/) else if (/*condition here*/) {} else if (/*condition here*/) {} ``` What is the difference? It seems that with if/else, if part is for true state and the else part is for all other possibl...
[ 0.0672898143529892, -0.09740330278873444, 0.02018825151026249, -0.05935411527752876, -0.08128606528043747, -0.10033775866031647, 0.19493606686592102, -0.34706321358680725, -0.1219482272863388, -0.42494261264801025, -0.3253690302371979, 0.4106833040714264, -0.13981005549430847, 0.1413507908...
'condition' is false, then the statements in the else if block will only be executed when condition2 is true. The statements in the else block will be executed when condition2 is false.
[ -0.060850951820611954, -0.30561235547065735, 0.09113381057977676, -0.09777425229549408, 0.3176945149898529, -0.09092333167791367, 0.24940840899944305, -0.11255227774381638, 0.08499223738908768, -0.3041989207267761, -0.6197824478149414, 0.35338839888572693, -0.34016814827919006, 0.006246901...
Recently, I've got a dangerous idea into my head after reading [this](http://www.codinghorror.com/blog/archives/001145.html "Don't Reinvent The Wheel, Unless You Plan on Learning More About Wheels") blog post. That idea can be expressed like this: I don't need most of what the C++ standard library offers. So, why don'...
[ 0.4882119297981262, 0.24932290613651276, -0.11066657304763794, 0.2452329397201538, -0.11101409047842026, -0.13491292297840118, 0.17535065114498138, -0.015255890786647797, -0.42167410254478455, -0.44791579246520996, 0.32262152433395386, 0.8399491310119629, -0.1606227457523346, 0.22485575079...
I'd like to know from the StackOverflow community is this: what are the dangers, possible disadvantages and possible advantages to "rolling my own" for most of the existing functionality in C++? **Edit:** I feel that people have misunderstood me about this idea. The idea was to understand whether I could implement a *...
[ 0.5740290880203247, 0.2493734359741211, 0.24037837982177734, -0.03378814458847046, -0.3019503057003021, -0.15952499210834503, -0.19135640561580658, 0.2826634645462036, -0.30370426177978516, -0.24846474826335907, 0.13607022166252136, 0.4052325189113617, 0.06911302357912064, 0.17658984661102...
I wanted to figure out is whether the complexity of using the STL warrants the creation of smaller, simpler version of itself.** **Re-using boost or similiar.** Most of what I code is for University and we're not allowed to use external libraries. So it's either the C++ standard library, or my own classes. **Objecti...
[ 0.5783994197845459, 0.23979929089546204, 0.16978800296783447, 0.10318247973918915, -0.516950249671936, -0.12628889083862305, 0.14717121422290802, 0.09267916530370712, 0.006361008621752262, -0.3757043480873108, -0.08160723000764847, 0.5369895100593567, 0.12234203517436981, -0.30416727066040...
good logical arguments. **Format.** Please post only one disadvantage **or** one advantage per answer. This will allow people to evaluate individual ideas instead of all your ideas at once. **And please...** No religious wars. I'm not a fan boy of any language. I use whatever's applicable. For graphics and data com...
[ 0.2862764596939087, 0.5370993614196777, 0.14786610007286072, 0.1491173952817917, -0.3661769926548004, -0.14543335139751434, 0.3461330533027649, 0.2343917042016983, -0.11121667921543121, -0.7379623055458069, -0.03222406655550003, 0.8152303099632263, -0.06679829955101013, -0.1890956610441208...
language, and if you're not already very good at it, your linked list implementation will be buggy. Honestly, your choice is simple: Learn C++, or don't use it. Yes, C++ is commonly used for graphics, but Java has OpenGL libraries too. So does C#, Python and virtually every other language. Or C. You don't have to use...
[ 0.2933329939842224, 0.028491351753473282, 0.3569665849208832, 0.14498010277748108, -0.47123900055885315, -0.07315576821565628, 0.20997782051563263, 0.4431487023830414, -0.1849273294210434, -0.8016108870506287, -0.15124817192554474, 0.8455352187156677, -0.4851924180984497, -0.46746605634689...
But more importantly, they are not exclusive to STL code. You'll encounter them no matter what you do, and which libraries you use. So get used to them. And if you're getting used to them anyway, you might as well use STL too. Apart from that, a few other disadvantages: * No one else will understand your code. If you...
[ 0.3214312195777893, 0.1322305053472519, 0.18203331530094147, 0.24951979517936707, -0.3945634961128235, -0.10240013897418976, 0.2748071849346161, 0.2642606794834137, -0.6431195735931396, -0.5759881734848022, -0.3125840127468109, 0.6376527547836304, -0.14723914861679077, 0.13375845551490784,...
bugs to ask for help about. * You're trying to cure the symptom, rather than the cause. The problem is that you don't understand C++. STL is just a symptom of that. Avoiding STL won't magically make your C++ code work better. * The compiler errors. Yes, they're nasty to read, but they're there. A lot of work in the STL...
[ 0.5445645451545715, 0.44512417912483215, -0.07321327179670334, 0.26157572865486145, 0.032215967774391174, 0.08210955560207367, 0.522462785243988, 0.3380911350250244, -0.5208243727684021, -0.7249559760093689, 0.05146237462759018, 0.44922012090682983, -0.5607424974441528, -0.0465142354369163...
own linked list would almost certainly move more errors to runtime, where they'd go undetected for a while, and be much harder to track down. * And once again, it will be buggy. Trust me. I've seen damn good C++ programmers write a linked list in C++ only to uncover bug after bug, in obscure border cases. And C++ is al...
[ 0.4875437617301941, -0.013401268050074577, 0.41728994250297546, 0.20207339525222778, -0.1754569262266159, -0.5056177377700806, 0.4280513823032379, 0.046067703515291214, -0.6385738253593445, -0.672961950302124, 0.006561126559972763, 0.5750158429145813, -0.32210251688957214, -0.1711622625589...
that all the appropriate destructors will be called? Will it be as type-safe? Will it be as performant? There are a lot of headaches to deal with when writing container classes in C++. * You're missing out on one of the most powerful and flexible libraries in existence, in *any* language. The STL can do a lot that woul...
[ 0.247237429022789, 0.09775592386722565, 0.06116637960076332, 0.06851445138454437, -0.255117803812027, -0.014629148878157139, 0.17165020108222961, 0.04291624575853348, -0.24411796033382416, -0.5919212698936462, 0.03590770065784454, 0.7175216674804688, -0.14313657581806183, -0.03848328068852...
don't even need to know that they exist. Iterators are brilliant though, and figuring them out would save you a lot of headaches. There are only three concepts you need to understand to use STL effectively: * Containers: You already know about these. vectors, linked lists, maps, sets, queues and so on. * Iterators: Ab...
[ 0.09424122422933578, -0.08296607434749603, 0.11721287667751312, 0.5724373459815979, 0.08375557512044907, 0.0964115783572197, -0.011626126244664192, 0.2571057081222534, -0.4158520996570587, -0.8164825439453125, -0.12847913801670074, 0.3230714201927185, -0.0930498018860817, -0.06765274703502...
and many others. Yes, the STL is small compared to Java's library, but it packs a surprising amount of power when you combine the above 3 concepts. There's a bit of a learning curve, because it is an unusual library. But if you're going to spend more than a day or two with C++, it's worth learning properly. And no, I...
[ 0.3921036720275879, 0.04680921882390976, 0.09660941362380981, 0.3034707307815552, -0.501528263092041, -0.0680653303861618, -0.1477556824684143, 0.10535849630832672, -0.2606605887413025, -0.3443818986415863, -0.09287305176258087, 0.49087876081466675, 0.11590576171875, -0.2555136978626251, ...
why the STL is one of its saving graces.. But I'm not really convinced it's true. It might work, but it can backfire too. As I said above, it's easy to write C++ code that *seems* to work. And when it stops working, it's easy to rearrange a few things, like the declaration order of variables, or insert a bit of paddin...
[ 0.5750928521156311, 0.03678687661886215, 0.04804980009794235, 0.14961375296115875, -0.16185002028942108, -0.04898027703166008, 0.3138415217399597, 0.023137474432587624, -0.050538789480924606, -0.25024542212486267, -0.060429513454437256, 0.5408272743225098, -0.17232990264892578, 0.154100000...
how to use the STL? Definitely not. A more useful approach might be utilizing the awesome power of StackOverflow in learning STL the right way. :)
[ 0.14971157908439636, -0.08106616139411926, 0.30765485763549805, 0.5244917273521423, -0.1336970031261444, -0.3969148099422455, 0.19114741683006287, 0.22260433435440063, -0.18957839906215668, -0.5505558252334595, -0.17414267361164093, 0.5430247187614441, 0.06013024225831032, -0.2593018412590...
I need to validate an object to see whether it is null, a value type, or `IEnumerable<T>` where `T` is a value type. So far I have: ``` if ((obj == null) || (obj .GetType().IsValueType)) { valid = true; } else if (obj.GetType().IsSubclassOf(typeof(IEnumerable<>))) { // TODO: check whether the generic para...
[ -0.0118746068328619, 0.2152371108531952, 0.3886811137199402, -0.1804490089416504, 0.04565592482686043, -0.11594120413064957, 0.5018041729927063, -0.4064089357852936, 0.03828048333525658, -0.5615733861923218, -0.08960478752851486, 0.6165392398834229, -0.22824133932590485, 0.2083139419555664...
could in theory implement `IEnumerable<T>` for multiple `T`): ``` foreach (Type interfaceType in obj.GetType().GetInterfaces()) { if (interfaceType.IsGenericType && interfaceType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { Type itemType = interfaceType.GetGenericArguments()[0]; ...
[ -0.11896032840013504, -0.1472456008195877, 0.8117931485176086, -0.17108528316020966, 0.06723622977733612, 0.07605025172233582, 0.3457246422767639, -0.5565412044525146, 0.14786674082279205, -0.8519390821456909, -0.26055988669395447, 0.5189887881278992, -0.329741507768631, 0.1361773014068603...
I am trying to make an application in which one component captures the screen of the user (for screen casting). I am aware that there are two options to achieve the same using a Java applet (please correct me if I am wrong). First is to use the java applet to take screen shots continuously and convert it into a video a...
[ 0.661861777305603, -0.013513220474123955, 0.5164291262626648, -0.08130938559770584, -0.18197640776634216, -0.2482641041278839, -0.017561957240104675, -0.14893099665641785, -0.24826449155807495, -0.6698257923126221, 0.3719077408313751, 0.5497995018959045, -0.28341975808143616, 0.03527598828...
terms of video quality, file size, cross-platform compatibility (windows and mac), firewall problems and finally ease of implementation. I am very new to Java. Please tell me whats the best solution for my problem. Also, is it easy enough for me to program it on my own or should I get it developed via a freelancer. I ...
[ 0.3351675570011139, -0.064921073615551, 0.7742031812667847, 0.23753134906291962, -0.0331525020301342, -0.1113850474357605, 0.07149390131235123, -0.25940272212028503, -0.2888678312301636, -0.7467436194419861, -0.05099156126379967, 0.7139612436294556, -0.3782562017440796, -0.0308214053511619...
grabber) for a former employer. I had the best bandwidth-to-quality ratio with VNC, but I got higher framerate with VGA capture. In all three cases, I reduced the frames + capture times to PNGs and sequenced them in a QuickTime reference movie. Then I made flattened video (MPEG4 or SWF) of the results. In my case, I th...
[ 0.07064338028430939, -0.22357575595378876, 0.4996892213821411, 0.20088309049606323, 0.07434068620204926, 0.1935211569070816, -0.35367897152900696, -0.24129505455493927, -0.2199123352766037, -0.09820143133401871, -0.09567783772945404, 0.5811540484428406, -0.1310453861951828, 0.1281070411205...
I have a page where I have to modify variables which are strings with pairs of values and labels. I was using a datagrid object but its not sufficient for whats required ( or eventually will not anyway ). So I have a form which is a text label and textbox, and a flowpanel, and I'm trying to programmatically add instan...
[ 0.15584775805473328, -0.01143520325422287, 0.5418208837509155, 0.02151188813149929, -0.03054674156010151, 0.1357365846633911, 0.0055487193167209625, -0.030482370406389236, -0.03695782274007797, -0.7690672874450684, 0.17291896045207977, 0.46632665395736694, -0.26844504475593567, -0.05695175...
do this programmatically however. What is the 'correct' or 'standard' way of doing this. With this solution you need to post "sa" on every page request, otherwise it will always fall back to "qp\_sbl" for any other request, since you don't seem to store which database you want to use during the session.
[ 0.16915898025035858, -0.14257760345935822, 0.2784561812877655, -0.015876712277531624, -0.11367424577474594, -0.2747320830821991, 0.5533331632614136, -0.10586513578891754, -0.3098491132259369, -0.81003338098526, -0.11252061277627945, 0.0744854062795639, -0.2309066355228424, 0.12636263668537...
I am trying to import a dump into two schema in the same oracle DB.Following a workaround to do this. I am trying to run the imp command with the INDEXFILE option to be able to modify the tablespace names in the sql. This is what I get : > E:\oracle\_10\_2\BIN>imp atlantis/atlantis@orcl file=ABCD1\_EXCLUDE\_CLOB\_TA...
[ 0.28107956051826477, 0.5273507237434387, 0.3076380789279938, -0.11760708689689636, -0.017719317227602005, -0.0009800727711990476, 0.2042379230260849, 0.01323406957089901, -0.19709111750125885, -0.21680092811584473, -0.13046160340309143, 0.3012888729572296, -0.5719184279441833, 0.3718990087...