text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Could someone tell me the advantages to using the ConfigurationManager class which load's a config file for manipulation VS an XML file with a class you build to read it yourself? Recently, I built a class which inherits from ConfigurationSection in order to manipulate a custom section within app.config. This was quit...
[ 0.6115360260009766, -0.1774708479642868, 0.008590389043092728, 0.22206485271453857, 0.01582619734108448, -0.058592624962329865, -0.046300143003463745, -0.1861550360918045, -0.36532190442085266, -0.7337946891784668, 0.4102872908115387, 0.8460357189178467, -0.03631431981921196, -0.0756604820...
get as compared to using your own class with an XML serializer include: * Type conversions and validations: if one of your configuration settings is, say, a "Type" (maybe you store in your configuration what kind of implementation you need to create for some provider), then the ConfigurationManager will not only conve...
[ 0.4073810279369354, -0.36653560400009155, 0.2796053886413574, 0.34697213768959045, 0.005015433765947819, -0.015499993227422237, 0.2041160613298416, -0.3086239695549011, -0.1751800924539566, -0.766235888004303, -0.18531785905361176, 0.5965527892112732, -0.053719475865364075, 0.0643885657191...
of your code, you just "get" the configuration and you know everything's valid. * Multi-level settings hierarchy: you can play around with storing settings at the machine, application or user levels, which gives you a mechanism to handle default vs. user-specific settings. You also have APIs to load configurations from...
[ 0.6432411670684814, -0.27392423152923584, 0.08356408774852753, 0.290589302778244, 0.4448471665382385, -0.33365240693092346, 0.40165969729423523, -0.006367670372128487, -0.3816494643688202, -0.9959432482719421, -0.07351243495941162, 0.5080618262290955, -0.2394465059041977, -0.20102593302726...
the .config). If you're using your own config file for your custom settings, then you end up with 2 configuration files, which is not so good. There's probably other benefits, but that's what comes to mind so far.
[ 0.24065692722797394, -0.371893048286438, 0.38593268394470215, 0.4160138666629791, 0.2714821696281433, -0.1250506043434143, 0.013335909694433212, 0.08870149403810501, -0.22051294147968292, -0.8800176978111267, -0.039702706038951874, 0.766707181930542, -0.34766244888305664, 0.019929740577936...
I've built a Java application which executes correctly from my IDE (Netbeans). I have packaged the jar into a bundle for Mac OS (Leopard). If I run the application from the bundle or from the shell I get this error: > java.lang.NoSuchMethodError: java.util.Properties.load(Ljava/io/Reader;)V I'm using java 1.5.0\_16. ...
[ 0.3605942726135254, 0.3420870006084442, 0.04447796195745468, -0.12375060468912125, -0.06559672951698303, -0.28255417943000793, 0.665960431098938, -0.5223852396011353, -0.29554274678230286, -0.763688862323761, 0.1312454491853714, 0.7632937431335449, -0.3296153247356415, -0.08230627328157425...
the member you're interested in - it will often give the version in which it was introduced (e.g. "Since: 1.6" in this case). You'll need to create an `InputStream` instead of a `Reader` - or upgrade to Java 6. I suspect you'll find NetBeans is using Java 6, which is why it's working there.
[ 0.2710358202457428, -0.22264538705348969, 0.28465384244918823, -0.05832357704639435, -0.20862214267253876, -0.4516780972480774, 0.03383171930909157, 0.11085767298936844, -0.31832560896873474, -0.3635808229446411, -0.28222599625587463, 0.33488407731056213, -0.314959317445755, 0.004223618656...
I guess the question says it all, but, what happens if someone closes a c++ console app? As in, clicks the "x" in the top corner. Does it instantly close? Does it throw some sort of exception? Is it undefined behavior? Closing a c++ console app with the "x" in the top corner throws an `CTRL_CLOSE_EVENT` which you could...
[ -0.11504586040973663, 0.1566651165485382, 0.5232641696929932, -0.20563861727714539, 0.09882558882236481, -0.2172715663909912, 0.1319546401500702, -0.06587543338537216, -0.047487370669841766, -0.15317508578300476, -0.5102799534797668, 0.46082034707069397, -0.2668941617012024, 0.081199198961...
I'm trying to create an auto-clicker in Java(only language I know and I just learned Threads). I want to have the applet open in it's own window(not on a webpage), and I want to be able to start and stop the program with the spacebar without the window being selected so that I can use the auto-clicker on another progra...
[ 0.40951794385910034, 0.1844259649515152, 0.06845933943986893, 0.020889028906822205, 0.2203843742609024, 0.00872174371033907, 0.17954428493976593, 0.39118802547454834, -0.3305916488170624, -0.6477012634277344, 0.10078225284814835, 0.4898088574409485, -0.31909728050231934, 0.1101805046200752...
Java applet. In fact, global keyboard hooks are definitely out of the scope of simply using Java, but I can help you get moving in the right direction. However, you have some hope. I'll point you into the direction of [JNI (Java Native Interface)](http://java.sun.com/docs/books/jni/), which will allow you to use nativ...
[ 0.3492491841316223, -0.023174088448286057, -0.2991592288017273, 0.062257688492536545, -0.2615656554698944, -0.08498893678188324, 0.13634230196475983, 0.37193337082862854, -0.30226588249206543, -0.9351063966751099, 0.3160645365715027, 0.5262420177459717, -0.3387312591075897, -0.097442321479...
a lot of these cost money. --- So the best solution for you, I think, is [JNA (Java Native Access)](https://github.com/twall/jna/). This allows you to directly call native libraries from within Java. (NOTE: The implementation not will be cross platform. You have to make separate implementations for Windows, Linux, et...
[ 0.11225047707557678, -0.10198032110929489, -0.17007097601890564, -0.20587578415870667, -0.061063095927238464, -0.23002566397190094, 0.27301687002182007, -0.04163341969251633, -0.37456628680229187, -0.7879965305328369, -0.21170896291732788, 0.33961403369903564, -0.14212414622306824, 0.12814...
browser window being open? * If you want to simply launch a new window and still require the browser to be open, then here's a good example: ``` final Frame window = new Frame("This is the Frame's Title Bar!"); window.add(new Label("This is the Frame.")); window.setSize(300,200); window.setVisible(true); window.addW...
[ 0.43636956810951233, -0.08969780802726746, 0.6923457980155945, -0.40805014967918396, -0.0314529612660408, -0.17621931433677673, 0.3560545742511749, -0.21749605238437653, -0.12899844348430634, -1.0028704404830933, -0.5363590121269226, 0.42800766229629517, -0.4436367154121399, 0.181258931756...
I'm trying to make a progress bar that starts at 0%, and takes 5 seconds to get to 100%. The progress bar will begin to go up as soon as Button1 is clicked. Any advice? I looked on Google, but that gave me nothing good on this sort of thing. Also, at 0%, there should be a label that says `Waiting...`, when the progres...
[ 0.07917283475399017, -0.05192113667726517, 0.8183841109275818, -0.4182046055793762, 0.2709311842918396, 0.1698116958141327, 0.44037073850631714, -0.39197173714637756, -0.14321905374526978, -0.6758028864860535, -0.3515407145023346, 0.6249727606773376, -0.12522637844085693, -0.08935382217168...
Label1.Caption := ''; ProgressBar1.Position := 0; Label1.Caption := 'Waiting...'; end; procedure TForm1.Button1Click(Sender: TObject); begin ProgressBar1.Min := 0; ProgressBar.Max := 100; ProgressBar1.Position := 0; timer1.Enabled := True; Label1.Caption := 'Working...'; end; procedure TForm1.Timer1...
[ -0.060974739491939545, -0.29520881175994873, 0.8451088666915894, -0.3205602169036865, 0.4711466133594513, 0.281175822019577, 0.4780549108982086, -0.5856694579124451, -0.41667068004608154, -0.5727300047874451, -0.6328365206718445, 0.5258973240852356, -0.08471675962209702, 0.2251926809549331...
In relation to my other question ["What’s the best way to audit log DELETEs?"](https://stackoverflow.com/questions/695817/whats-the-best-way-to-audit-log-deletes). What's the PostgreSQL equivalent of `CONTEXT_INFO`? I want to log deletes using a trigger, but since I'm not using the database user as my app's logical us...
[ 0.12729936838150024, 0.20927146077156067, 0.4192207157611847, 0.13156048953533173, 0.06588448584079742, -0.16684088110923767, 0.05621398240327835, -0.21166524291038513, -0.44869160652160645, -0.24034929275512695, 0.05878220126032829, 0.723531186580658, -0.37826868891716003, 0.0745916515588...
to this site.
[ 0.3840938210487366, 0.08149924874305725, 0.368390291929245, -0.06764771044254303, 0.3865988850593567, -0.09023286402225494, 0.31467822194099426, 0.16623948514461517, -0.17122633755207062, -0.5646674633026123, -0.16794274747371674, 0.06429551541805267, 0.11032605171203613, 0.154950469732284...
I'm new to this site but I've read the rules and also searched the questions section but not found any related question answered well. anyway, the question: what's the Pros. & Cons. of using OpenID on a website instead of a regular login system? My customer wants me to use this kind of logins for a local sale syste...
[ 0.4085177183151245, -0.06857125461101532, 0.1824083775281906, 0.27269455790519714, 0.019959624856710434, -0.3997725546360016, 0.3087194263935089, 0.08904746174812317, -0.16535115242004395, -0.9851541519165039, 0.25269338488578796, 0.44508761167526245, 0.007158088497817516, 0.23533351719379...
or sending you any of their personal information. As long as they have an account with an OpenId provider that your site supports (Google, for example), they can simply use their google username and password to log in through your site. This can increase customer retention and reduces the likelihood that users will lea...
[ 0.30054283142089844, -0.29074424505233765, 0.32398709654808044, 0.41598913073539734, 0.03139575570821762, -0.22480028867721558, 0.28408217430114746, 0.3540136218070984, -0.42417827248573303, -0.8991725444793701, -0.14983302354812622, 0.292318195104599, 0.07249502092599869, -0.0176159497350...
Is it possible to programmatically start an application from Java and then send commands to it and receive the program's output? I'm trying to realize this scenario: I want to access a website that uses lots of javascript and special html + css features -> the website isn't properly displayed in swt.browser or any o...
[ 0.40799784660339355, 0.2531299293041229, 0.16491834819316864, 0.21564963459968567, -0.19394849240779877, -0.1414434313774109, 0.09385158866643906, -0.01190744899213314, -0.2769520878791809, -0.6530803442001343, -0.01591322384774685, 0.6844968795776367, -0.4871663749217987, -0.1582150757312...
JFrame or so..) Has anybody got an idea how to realize this? Any help would really be appreciated! EDIT: The website loads some Javascript that does some html magic and loads some pictures. When I only read the html from the website I see nothing more than some JavaScript calls. But when the website is loaded in a Br...
[ 0.5282583236694336, 0.21355745196342468, 0.3400821089744568, -0.19571757316589355, -0.16266538202762604, -0.24477575719356537, 0.2838191092014313, -0.25959715247154236, -0.2416420727968216, -0.776314914226532, -0.09844322502613068, 0.5275344848632812, -0.635250449180603, -0.145886987447738...
runtime.exec(path + " " + url); } catch (IOException e) { // ... } ``` To manipulate processes once they have started, one can often use *process.getInputStream()* and *process.getOutputStream()*, but that would not help you in the case of Firefox. You should probably look into ways of solving your specific prob...
[ 0.3643677532672882, -0.3331069350242615, 0.26351356506347656, -0.018442818894982338, 0.09826453775167465, -0.10974735021591187, 0.1613796353340149, -0.04411725327372551, -0.26733237504959106, -0.9773001074790955, -0.026843613013625145, 0.5404492616653442, -0.6459351778030396, -0.1611106693...
When designing libraries, I often end up resorting to the following pattern, which I don't like as it results in lots of type-casting. The basic pattern is: The code using the library hands an object to the library, the library then hands the object back to the calling code. The calling code is forced to cast the...
[ 0.2786191999912262, -0.09751709550619125, 0.36840564012527466, 0.11068539321422577, -0.15675342082977295, -0.014295214787125587, 0.03656211867928505, -0.42370957136154175, -0.08858206123113632, -0.5202212929725647, -0.11794453859329224, 0.36288121342658997, -0.5299543738365173, 0.269880503...
TThing); Virtual; Abstract; End; Procedure DoEverything (Processor : TThingProcessor); ``` The calling code then uses the library by overriding the objects and calling DoEverything, as follows - ``` TMyThing = Class(TThing) Public X : Integer; End; TMyThingProcessor = Class(TThingProcessor) Public XSum : I...
[ 0.05823845416307449, -0.07571220397949219, 0.5981391072273254, -0.24076680839061737, -0.00934490468353033, 0.1580394059419632, 0.4314905107021332, -0.7068625092506409, -0.321357399225235, -0.3806077837944031, -0.3003351092338562, 0.5735172033309937, -0.593392550945282, 0.2309415638446808, ...
a TThing factory. The library guarantees that it will only pass TThings to the corresponding TThingProcessor that created them, so it works, but isn't type-safe. While the code above is a bit stupid in that it doesn't really do anything, it shows why ProcessThing can't simply be shifted to TThing and be polymorphic - t...
[ 0.5907958745956421, 0.07435885071754456, 0.12429695576429367, -0.018381938338279724, -0.20716756582260132, 0.24585939943790436, 0.13732722401618958, -0.4277645945549011, -0.10258051007986069, -0.42989736795425415, 0.28763604164123535, 0.5044864416122437, -0.5363132357597351, 0.057190198451...
exception instead of crash in the case of mismatched types Are you using Delphi 2009? This is a great use for generics. Change your declarations to: ``` TThingProcessor<T: TThing> = Class Public Function CreateThing : T; Virtual; Abstract; Procedure ProcessThing (Thing : T); Virtual; Abstract; End; TMyThingP...
[ 0.3160601556301117, -0.12458817660808563, 0.17398416996002197, -0.19061778485774994, -0.29117995500564575, -0.09517189115285873, 0.3790876865386963, -0.40165963768959045, -0.32125169038772583, -0.44974491000175476, -0.0577278807759285, 0.6099022030830383, -0.5664854049682617, 0.11553754657...
``` function outputscores($mysqlquery,$reverse=false) { while($row = mysql_fetch_array($mysqlquery)) { echo '<img src="img/date.png" /> ' . date("j M Y",strtotime($row['timestamp'])) . ' <img src="img/time.png" /> ' . date("H:i:s",strtotime($row['timestamp'])) . ' <img src="img/star.png"...
[ -0.03242294117808342, 0.14723755419254303, 0.7666717171669006, -0.3124504089355469, 0.02220831997692585, 0.10851601511240005, 0.38651084899902344, -0.4325668215751648, -0.2888643145561218, -0.3749394416809082, -0.030125830322504044, 0.5199057459831238, -0.25390440225601196, 0.2235235720872...
* FROM $gid LIMIT 25") or throwerror(mysql_error()); outputscores($result); ``` **EDIT2** Another possible call: ``` $result = mysql_query("SELECT * FROM ".$gid.",users WHERE users.lastcheck < ".$gid.".timestamp") or throwerror(mysql_error()); outputscores($result); ``` Edit: Change your sql query to this: ``` $...
[ -0.06097487732768059, 0.03810986876487732, 0.507744312286377, -0.3756643235683441, -0.035793907940387726, 0.37032902240753174, 0.2744636833667755, -0.4574744999408722, -0.24881482124328613, -0.4733900725841522, -0.19162794947624207, 0.7386929392814636, -0.33350881934165955, 0.2710229456424...
id DESC` you will make the records be ordered in descending order of the 'id' column in your table. By typing `ASC` instead of `DESC` you can have them ordered in ascending order. Also, you can replace 'id' with any other column from your table, for example `timestamp`, `score`, etc. Edit: Alternatively, you could als...
[ 0.002998438896611333, 0.04029131680727005, 0.3180779814720154, 0.10643788427114487, -0.1827308088541031, 0.04288740083575249, 0.0796080231666565, -0.364767462015152, -0.1445389837026596, -0.5922359824180603, -0.0008382649975828826, 0.5911347270011902, -0.3628939092159271, 0.281383454799652...
In mid July 2008 Memoization was added to Rails core. A demonstration of the usage is [here](http://www.railway.at/articles/2008/09/20/a-guide-to-memoization). I have not been able to find any good examples on when methods should be memoized, and the performance implications of each. [This blog post](http://blog.purep...
[ -0.2378963828086853, -0.29494398832321167, 0.06378321349620819, 0.38702109456062317, -0.3851996064186096, -0.22558601200580597, 0.3597557842731476, 0.07068507373332977, 0.08313687145709991, -0.5214973092079163, 0.15899522602558136, 0.3926389515399933, -0.12557482719421387, -0.1162477508187...
that memoization is used a remarkable number of times inside of Rails core. Here's an example: <http://github.com/rails/rails/blob/1182658e767d2db4a46faed35f0b1075c5dd9a88/actionpack/lib/action_view/template.rb>. This usage seems to go against the findings of the blog post above that found memoization can hurt perfor...
[ -0.024130530655384064, 0.06851012259721756, -0.18717028200626373, 0.2812582552433014, -0.19618751108646393, -0.07868902385234833, 0.24490678310394287, 0.012283259071409702, -0.1969487965106964, -0.7047569751739502, 0.08130407333374023, 0.5742965936660767, -0.276689738035202, 0.141055405139...
track down bugs. I would *not* apply memoization if * the returned value is merely slightly expensive to calculate. It would have to be *very* expensive, and not further optimizable, for it to be worth memoization. * the returned value is or could be lazy loaded * the method is not a pure function, i.e. it is guaran...
[ 0.13590441644191742, 0.1491486132144928, -0.044749438762664795, 0.41071316599845886, 0.3233889043331146, -0.12434623390436172, 0.5942514538764954, 0.22522656619548798, -0.3964470624923706, -0.34053659439086914, -0.024536199867725372, 0.7650151252746582, -0.7208415269851685, -0.365561842918...
the same arguments. There are other situations too where memoization isn't appropriate, such as the one in the question and the answers above, but these are three that I think aren't as obvious. The last item is probably the most important: memoization caches a result based on the arguments to the method, if the meth...
[ -0.055568628013134, 0.14940111339092255, 0.3911074995994568, -0.17381645739078522, 0.024965455755591393, -0.07095984369516373, 0.41624686121940613, -0.19064144790172577, -0.20990940928459167, -0.6168842315673828, -0.3558129370212555, 0.5617120265960693, -0.33220726251602173, 0.135029807686...
time) "#{name} was here #{time}" end memoize :memoizable1 def unmemoizable2 memoizable2(@size) end def memoizable2(size) find_by_shoe_size(size) end memoize :memoizable2 ``` (assuming that `find_by_shoe_size` didn't have, or relied on, any side effects) The trick is to extract a pure function from the method...
[ -0.19179970026016235, -0.186429962515831, 0.15980373322963715, -0.2972092628479004, 0.2892863154411316, -0.18376335501670837, 0.31724637746810913, -0.49296239018440247, 0.14628270268440247, -0.724109411239624, -0.3752344846725464, 0.6189162731170654, -0.4209006428718567, -0.006234313827008...
I have two parallel inheritance chains: ``` Vehicle <- Car <- Truck <- etc. VehicleXMLFormatter <- CarXMLFormatter <- TruckXMLFormatter <- etc. ``` My experience has been that parallel inheritance hierarchies can become a maintenance headache as they grow. i.e. NOT adding `toXML(), toSo...
[ 0.12941952049732208, 0.12072299420833588, 0.20191001892089844, 0.1857435554265976, 0.00047690197243355215, 0.24963697791099548, 0.05432512238621712, 0.049614228308200836, -0.17332349717617035, -0.46333780884742737, -0.012054613791406155, 0.568106472492218, -0.13802294433116913, 0.703549146...
IVehicleFormatter v ) { v.Visit (this); } } public class Truck : Vehicle { public void Accept( IVehicleFormatter v ) { v.Visit (this); } } public interface IVehicleFormatter { public void Visit( Car c ); public void Visit( Truck t ); } public class VehicleXmlFormatter : IVehicleFor...
[ 0.14373664557933807, -0.016610918566584587, 0.8901839852333069, 0.1625174880027771, -0.2116132229566574, 0.22149036824703217, 0.306900292634964, -0.430448979139328, -0.283942848443985, -0.32393091917037964, -0.06273524463176727, 0.5848686695098877, 0.05725247412919998, 0.5147271156311035, ...
interface (and implement this new method in all the implementations of the formatter interface). But, I think that this is better then creating a new Vehicle class, and for every IVehicleFormatter you have, create a new class that can handle this new kind of vehicle.
[ 0.18875013291835785, 0.07396577298641205, 0.6189216375350952, 0.2906377911567688, -0.3612026870250702, 0.038133617490530014, 0.00014377565821632743, -0.23585356771945953, 0.05790184065699577, -0.7881585359573364, 0.4725465476512909, 0.7918400168418884, 0.017791006714105606, 0.0147757725790...
I'm building a restaurant system, and I want to give adminstrator a privilege to change and save the settings so that when other users log in, will find new settings. Java has a dedicated [preferences API](http://java.sun.com/j2se/1.4.2/docs/guide/lang/preferences.html), which is more powerful than using Properties fil...
[ 0.45101088285446167, 0.26672300696372986, 0.16171613335609436, -0.2384345978498459, 0.18988244235515594, 0.06109604611992836, -0.0752316266298294, 0.02110975608229637, -0.024373212829232216, -0.829343318939209, 0.0683387964963913, 0.47018498182296753, -0.20559918880462646, -0.1248967871069...
I am trying to hydrate a list of ~400 business objects and the performance becomes very slow when it needs to hydrate strings. It's taking in excess of 20secs to hydrate the 400 objects. **EDIT** *We are using MySQL 5.1 and dotConnect for MySQL v5.0.12 as the data provider <http://www.devart.com/dotconnect/mysql/>* ...
[ -0.22514118254184723, 0.2292480766773224, 0.8143530488014221, -0.2617414891719818, -0.141196146607399, 0.20841340720653534, 0.45560216903686523, -0.6213389039039612, -0.07137662917375565, -0.9608297944068909, -0.1000152975320816, 0.4683981239795685, -0.6140919327735901, 0.14933206140995026...
object in 0ms ``` objUserInfo.PortalID = portalId objUserInfo.IsSuperUser = Convert.ToBoolean(dr("IsSuperUser")) objUserInfo.UserID = Convert.ToInt32(dr("UserID")) objUserInfo.Firstname = "FirstName" ``` However as soon as i do the convert on the datareader object to a string it takes an average of 53ms ``` objUser...
[ -0.7387263178825378, 0.25120809674263, 0.6633745431900024, -0.22892804443836212, -0.26940831542015076, 0.2818988859653473, 0.6068598031997681, -0.5314449667930603, -0.04830833151936531, -0.8081339001655579, -0.37327513098716736, 0.6706528067588806, -0.5336964130401611, 0.020925264805555344...
do this? **EDIT** Just did another test which was to do a directcast on a string and it produces the same slow speeds :( 53ms just to do the cast. ``` objUserInfo.FirstName = DirectCast("alex", String) ``` Give this a try: Instead of ``` objUserInfo.Firstname = Convert.ToString(dr("FirstName")) ``` use ``` objU...
[ 0.1579478234052658, -0.02507096901535988, 0.27181634306907654, -0.019534330815076828, 0.022433649748563766, -0.2252265214920044, 0.3432372808456421, -0.3066827356815338, -0.049645546823740005, -0.636067807674408, 0.0321519561111927, 0.39128267765045166, -0.668552041053772, -0.1259296983480...
comment about it: > Alright i've tracked down the problem! > I'm using DotNetNuke and filling one > of it's standard objects. The problem > is that when i set the FirstName > property it makes another call out to > a profile object which is what > actually takes so long! It's nothing > to do with string convers...
[ 0.21613170206546783, -0.249940425157547, 0.24615231156349182, -0.11938150227069855, -0.2518540918827057, -0.10297250002622604, 0.4074918329715729, -0.027618609368801117, -0.174837127327919, -0.6666712760925293, 0.255248486995697, 0.45888185501098633, -0.23260769248008728, 0.046080425381660...
I have this little code ``` NSMutableArray *myArray = [[NSMutableArray alloc] init]; NSNumber *myNumber = [NSNumber numberWithDouble:752.65]; [myArray addObject:myNumber]; ``` With this code I store Objects inside an array. But now I have two objects independent from each other. If I change myNumber after it's...
[ 0.02294698730111122, 0.04460056871175766, 0.370337575674057, -0.030143821612000465, -0.13578997552394867, 0.2708057463169098, 0.1948174089193344, -0.09061188995838165, -0.3560044765472412, -0.6355478763580322, 0.22381338477134705, 0.25795555114746094, -0.1547623574733734, 0.420064032077789...
difference is that a variable is not also an object\*, like the array is, and you can only put objects into an array. What you pass to `addObject:` is not the variable `myNumber`, but the object it contains. That's what you are adding to the array. To add the variable instead of the object inside it, you would need t...
[ 0.08003289997577667, 0.0014037846121937037, 0.29007384181022644, -0.1161133199930191, -0.13587361574172974, -0.0830208882689476, 0.04175814986228943, -0.07471153885126114, -0.10926475375890732, -0.566877543926239, -0.08072620630264282, 0.4800098240375519, -0.6129128932952881, 0.28776949644...
perish when the function exits; then you have a pointer to dead memory inside your array. When you go to access whatever's at that pointer, your program would crash. There are three solutions that will work: 1. As f3lix suggests, create a mutable number class, and create your number object from this class instead of ...
[ -0.03038797900080681, -0.2443508356809616, 0.2892740070819855, 0.17431077361106873, 0.2594047784805298, 0.21191322803497314, 0.37974098324775696, -0.3955719470977783, -0.29138511419296265, -0.6799383163452148, -0.10626097023487091, 0.5696825981140137, -0.4377642869949341, 0.294882535934448...
object class that has the number as a property. That last solution is, in my opinion, the correct one. I doubt you are managing only a list of numbers; more likely, you are showing the user a list of something that has the number as a property. Model this in your code, and everything becomes much simpler. Your code a...
[ -0.2753167152404785, -0.06099696829915047, 0.5964813828468323, 0.09914278239011765, -0.0520116351544857, 0.036858152598142624, 0.27284905314445496, -0.045404743403196335, -0.33095064759254456, -0.897877037525177, -0.1017811968922615, 0.5156211256980896, -0.2832174301147461, 0.1938688606023...
Cocoa objects. The C language does call any pointer, int, etc. an “object”, but this is a different definition.
[ -0.005238072481006384, 0.42261847853660583, 0.03296637162566185, -0.01530060637742281, -0.26793399453163147, -0.1345256268978119, -0.053473733365535736, 0.3195188045501709, -0.4737424850463867, -0.14142128825187683, -0.5061138272285461, 0.22048088908195496, -0.3720967173576355, 0.264948934...
what is tunnelling (ssh tunneling and ppp tunneling)? I searched in google but it is confusing.. can anyone provide some good material on this tunneling topic? Tunnelling is when instead of sending a packet directly through the network you send in inside another (often encrypted) connection by means of [encapsulation](...
[ 0.19539578258991241, 0.04400612786412239, 0.07826008647680283, -0.10319700837135315, -0.26980119943618774, -0.2063615620136261, 0.5048511028289795, -0.05742863565683365, -0.31317800283432007, -0.6190173625946045, -0.09664919227361679, -0.014680187217891216, -0.30291470885276794, 0.41302564...
work.
[ 0.47597983479499817, 0.09436158090829849, 0.2680848240852356, 0.07810761034488678, -0.0013353588292375207, 0.17954352498054504, -0.03681780770421028, -0.050629135221242905, -0.4051492214202881, -0.6612992286682129, -0.3433407247066498, 0.45133110880851746, 0.07068199664354324, 0.0424391515...
Is it possible to define **static** rule for 301 redirect to canonical host name? I.e. I'd like what in Apache's mod\_rewrite is done with: ``` # To force the use of RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.example.com/$1...
[ 0.22656938433647156, -0.03291301056742668, 0.35332798957824707, -0.19253452122211456, -0.10090241581201553, -0.10521189123392105, 0.30926230549812317, -0.374215304851532, -0.08294716477394104, -0.5658822655677795, 0.09664428234100342, 0.7067549228668213, -0.411422461271286, -0.133284091949...
one you use for the rest of your app, so you're still maintaining a degree of separation.
[ 0.29973068833351135, -0.27807050943374634, 0.33062008023262024, 0.30207711458206177, 0.37386107444763184, 0.22750844061374664, -0.13489192724227905, -0.1140746995806694, -0.09565462917089462, -0.290742963552475, 0.06442218273878098, 0.2809715270996094, -0.33627551794052124, -0.075010888278...
I am fairly new to asp.net and come into a problem whilst using a gridview. I have added some entries that contain the "&" symbol eg "PR Murphy & Associates". I haven't done any encoding of my data prior to inserting it into the database. When the gridview is changed to edit mode my text looks like this: "PR Murphy &...
[ 0.3992868959903717, 0.30217862129211426, 0.6857485771179199, -0.3154430091381073, 0.08976676315069199, -0.05645546317100525, 0.17496858537197113, 0.09473541378974915, -0.2933659255504608, -0.7801278233528137, 0.1511494517326355, 0.5763472318649292, -0.004951668903231621, 0.1459398120641708...
the properties for that column you can set HTMLEncode to False (or True depending upon your needs).
[ 0.5058994889259338, 0.12468820065259933, 0.39043399691581726, 0.16150662302970886, 0.01908210478723049, -0.015046141110360622, 0.5934495329856873, -0.0031303116120398045, -0.015978725627064705, -0.5501269698143005, 0.06703758984804153, 0.4634935259819031, -0.1355167180299759, -0.0832132995...
Due to the nature of OpenID, wouldn't it be a lucrative target for spammers? For starters, you could create an OpenID account on any site and use it on any other site which would mean that I could log into a forum and write a few thousand posts if the forum assumes that logged in users can be trusted. Do you agree Ope...
[ 0.5009868144989014, -0.03231222927570343, 0.12243875861167908, 0.3589229881763458, -0.31072568893432617, -0.4605860710144043, 0.3418644964694977, 0.3019428849220276, -0.2223086655139923, -0.5317351222038269, 0.2587951123714447, 0.4158506989479065, -0.43725791573524475, 0.17061784863471985,...
solve the usability problems of E-Mail based logins, it is not designed to solve any of the security problems of E-Mail based logins. If there are rogue OpenID providers out there, that allow users to create accounts willy-nilly, without checking their identity, then that is a problem. However, the exact same problem ...
[ 0.3526315987110138, 0.05494789779186249, 0.01841730996966362, 0.5535653233528137, 0.10616467893123627, -0.5674142241477966, 0.5228884220123291, 0.05100627988576889, -0.33445996046066284, -0.5346230268478394, 0.19122520089149475, 0.3228887915611267, -0.27696070075035095, 0.20585323870182037...
trustworthy providers. And the same can be done for OpenID: only accept OpenIDs issued from trustworthy providers. If someone logs in with `http://John.Doe.VeriSign.Com/`, you let them in, and if someone tries to log in with `http://Any.Nymous.Evil-4aX0rZ.ru/`, you reject them.
[ 0.295979768037796, -0.15951679646968842, -0.06755315512418747, 0.211672842502594, 0.1395033597946167, -0.37144675850868225, 0.5900475978851318, 0.08727430552244186, -0.12404881417751312, -0.6200842261314392, -0.18091198801994324, 0.37973645329475403, -0.3709275722503662, 0.3446862101554870...
I've got a social community with a lot of traffic. In the right column of the site's layout, we got a "online list" that prints out a 40x40px thumbnail pic of friends, people in your area etc. 30-40 images in total. Just before the right column loads, it hangs as all these images are loaded. I need a faster solution ...
[ 0.620397686958313, 0.029726989567279816, 0.5435361266136169, 0.1337151974439621, -0.25465449690818787, -0.16049081087112427, 0.12738317251205444, 0.10837219655513763, -0.23061388731002808, -0.850000262260437, 0.09340426325798035, 0.48878583312034607, -0.019961843267083168, 0.03884188458323...
using jQuery for example. Define a div for every image you want to display. Perhaps you could display a "Loading.." image or something like that in place of the actual image, when the page is initially displayed. There are many options with jQuery. There is a plug-in for [lazy loading](http://www.appelsiini.net/2007/9...
[ 0.5631687641143799, -0.3967880308628082, 0.40540552139282227, 0.2522904574871063, -0.377916544675827, -0.02719002589583397, -0.10302307456731796, -0.04036908596754074, -0.5458565354347229, -0.5900041460990906, 0.15489110350608826, 0.8056949377059937, -0.2934432327747345, -0.140394836664199...
I need to insert a year(eg:1988 ,1990 etc) in a database. When I used Date or Datetime data type, it is showing errors. Which datatype should I use. If you need to store a year in the database, you would either want to use an Integer datatype (if you are dead set on only storing the year) or a DateTime datatype (which ...
[ 0.35310158133506775, 0.3857383728027344, 0.1965489387512207, 0.000148641862324439, 0.24531416594982147, 0.17668864130973816, 0.05078994482755661, 0.1250145137310028, -0.19415517151355743, -0.2163194864988327, 0.24809962511062622, 0.1443805694580078, 0.10307518392801285, 0.5302254557609558,...
I've been building a test application that works with a database that up until recently has been without a UI. I'm adding one now. Problem is, the JFrame is launched in another thread and I need my database connection to close when that thread closes (when the UI closes, I should say). How do I do this? Also, what hap...
[ 0.23286910355091095, -0.017055606469511986, 0.40140753984451294, -0.2278592586517334, -0.1841791868209839, -0.35154908895492554, 0.21519020199775696, 0.13240937888622284, -0.23710128664970398, -0.984485924243927, -0.08015764504671097, 0.4058779776096344, -0.3458820581436157, 0.200346991419...
fired if a User attempts to close your JFrame. So in this method you can close your connection. 2. Your DBMS uses a pool of connection. If you don't close your connections properly, this connection pool is filled with unused connection. It's bad if the pool is full and a new connection is needed. The application won...
[ 0.1377776563167572, -0.1375148445367813, 0.21145625412464142, 0.0887899398803711, -0.15891027450561523, -0.24602656066417694, 0.36669957637786865, -0.22611673176288605, -0.6332690715789795, -0.42308443784713745, -0.3789515197277069, 0.6509386897087097, -0.5583387017250061, 0.18448586761951...
Which parameter does specify this time, you'll find it in your DBMS manual. In addtion to your comment: You cannot assure that you have enough time to clean up your connections. Probably your application is killed by your sytem or whatever. So: **Try** to clean up your connection as soon as possible. Unused connect...
[ 0.34112033247947693, 0.10684821009635925, 0.35603538155555725, 0.20248688757419586, 0.02876148372888565, -0.3196035921573639, 0.5769633054733276, 0.2701740860939026, -0.41089096665382385, -0.7490397095680237, -0.2358870655298233, 0.44300100207328796, -0.1481133997440338, 0.5118061900138855...
We are creating a unix timestamp with the mktime method giving following attributes: ``` print_r(mktime(0,0,0,3,1,2009)); print_r(mktime(null,null,null,3,1,2009) / 60 / 60 / 24) . "days");` ``` this creates a result of ``` 1235862000 14303.958333333 days ``` this should be 14304 days. The problem in this case is...
[ 0.13327665627002716, 0.16920165717601776, 0.8193362951278687, -0.1354249268770218, 0.2120920717716217, -0.19405117630958557, 0.5367556214332581, 0.10293968766927719, -0.16402050852775574, -0.6053329706192017, -0.14386966824531555, 0.44748589396476746, -0.11596706509590149, 0.31566482782363...
The [WindowClosingEvent](http://java.sun.com/javase/6/docs/api/java/awt/event/WindowListener.html#windowClosing(java.awt.event.WindowEvent)) will be fired if a User attempts to close your JFrame. So in this method you can close your connection. 2. Your DBMS uses a pool of connection. If you don't close your connections...
[ 0.2470441460609436, -0.08787684142589569, 0.6272003054618835, -0.2845255434513092, -0.16239014267921448, -0.32194629311561584, 0.2951384484767914, -0.2357352375984192, -0.3527587652206421, -0.5689278244972229, -0.37610211968421936, 0.5739295482635498, -0.574863076210022, 0.2007172107696533...
after a predefined time. Which parameter does specify this time, you'll find it in your DBMS manual. In addtion to your comment: You cannot assure that you have enough time to clean up your connections. Probably your application is killed by your sytem or whatever. So: **Try** to clean up your connection as soon as po...
[ 0.2919825315475464, 0.06239869073033333, 0.5369377136230469, 0.18760667741298676, 0.05552171915769577, -0.351540744304657, 0.672805666923523, 0.3547000586986542, -0.32865697145462036, -0.880140483379364, -0.41185471415519714, 0.291323721408844, -0.05133639648556709, 0.4191451370716095, 0...
On a customer machine (WinXP SP2) to which I have no access, I have a Win32 EXE (unmanaged C++) that crashes on startup. I guess the best way to troubleshoot this is to obtain a (mini-)dump and analyze it later with windbg or similar. Now, I would normally tell the customer to install Debugging Tools for Windows and r...
[ -0.12268398702144623, 0.4951169192790985, 0.30743151903152466, -0.03491666167974472, -0.0046406094916164875, -0.2542411684989929, 0.37908533215522766, 0.10425946861505508, -0.2072213739156723, -0.45848551392555237, -0.3132317364215851, 0.38500967621803284, -0.42606812715530396, 0.245210334...
says "use User Mode Process Dump", but I failed to install it successfully. Any idea of how to get a dump of a process that crashes on startup on Win32? You can install [WinDBG](http://www.microsoft.com/whdc/devtools/debugging/) on the client machine and then use "[Image File Execution Options](http://support.microsof...
[ 0.0038759694434702396, -0.07549099624156952, 0.29792913794517517, -0.005891898181289434, -0.2221360206604004, -0.5319960117340088, 0.37165188789367676, 0.030286839231848717, -0.32154831290245056, -0.5688985586166382, -0.2899510860443115, 0.5216330289840698, -0.21873503923416138, 0.11730672...
in a PHP project we already have separated business logic from database access. All database tasks are encapsulated in different database classes grouped by database and topic. Theses classes look very horrible, half the source are SQL strings, that get filled with params and so on. We thought of putting the SQL in "ot...
[ 0.09688936918973923, 0.15168344974517822, 0.027191143482923508, 0.31498464941978455, 0.04774016886949539, -0.001808446948416531, 0.13772810995578766, -0.0820297822356224, -0.24634727835655212, -0.406957745552063, 0.33088839054107666, 0.25691384077072144, -0.21854782104492188, -0.0070424419...
still want to separate the SP queries from the DAL, why not store them in a database? It may seem odd to store SQL queries in the database for abstraction, since a query is needed to extract other queries. This is actually a quite common approach, where you can select queries matching a certain criteria and possibly (i...
[ 0.08713632822036743, -0.3385244309902191, 0.4008307456970215, 0.14321818947792053, -0.04670536145567894, 0.12929566204547882, -0.05598398670554161, -0.3227900564670563, -0.5703287720680237, -0.270887166261673, 0.11089973896741867, 0.36334824562072754, -0.3240968585014343, 0.056698974221944...
"fruit=:type"; $this->internalSQLParameters[] = array(':type', $type); } ... public function create() { $this->internalSQLQuery = "SELECT ... FROM Fruits"; if (sizeof($this->internalSQLCriterias) > 0) { $this->internalSQLQuery .= " WHERE "; $moreThanOne = '';...
[ 0.23886430263519287, -0.13623027503490448, 0.18741950392723083, -0.13539868593215942, 0.4207276999950409, 0.3261423110961914, 0.4437621533870697, -0.8031793236732483, -0.06814951449632645, -0.5424379110336304, -0.10933389514684677, 0.57032710313797, -0.2769831120967865, 0.2577093839645386,...
$this->internalSQLQuery .= $moreThanOne . $criteria; $moreThanOne = " AND "; } } } ... public function execute() { /* Bind the parameters to the internalSQLQuery, execute and return results (if any) */ } ... ``` This class is
[ 0.4664295017719269, -0.21859627962112427, 0.22500073909759521, -0.050580885261297226, 0.21514399349689484, -0.06184104084968567, 0.236343652009964, -0.7056953310966492, 0.10740203410387039, -0.6221596598625183, 0.11423197388648987, 0.5070216655731201, -0.47652745246887207, 0.27465516328811...
absolutely not complete in any way, and you might want to rethink the structure of it - but you probably get the point I'm trying to make. :) Of course you have to filter the input to the Query-builder to avoid security breaches!
[ 0.5075074434280396, 0.009424734860658646, 0.04608730599284172, 0.32703909277915955, 0.20410402119159698, -0.5675879716873169, 0.31373873353004456, -0.014115594327449799, -0.059080950915813446, -0.15662147104740143, -0.3068433105945587, 0.4730670154094696, -0.1943836510181427, 0.04072565957...
I can't find a good article that solves my following issue, so if anyone has the answer or just a link to the answer I would be happy. Let's say I have created a UserControl called MyUserControl.ascx I reg it in ascx with prefix uc ``` <uc:MyUserControl runat="server" id="uc_test" SomeProperty="true"> <InnerContent>...
[ 0.0659065768122673, 0.37368980050086975, 0.4343792498111725, -0.007824556902050972, -0.10392332077026367, -0.11665646731853485, 0.2114931344985962, 0.027797436341643333, -0.10461343824863434, -0.7468134164810181, 0.10293962061405182, 0.40426206588745117, -0.12850633263587952, -0.0184442996...
user controls (`.ascx`). It's completely possible though. This is mostly done in custom controls you build using code files. To accomplish it, you declare your control class like: ``` [ParseChildren(true), PersistChildren(false)] public class MyControl : Control, INamingContainer { [PersistenceMode(PersistenceMode...
[ -0.23483189940452576, -0.27384984493255615, 0.6243351101875305, 0.15687841176986694, 0.30331847071647644, 0.05138193070888519, 0.3267311751842499, -0.37975814938545227, -0.07986823469400406, -0.8381777405738831, -0.0027561262249946594, 0.5294521450996399, -0.41030243039131165, 0.1361849457...
in ASP.NET is a rather complex thing. It's not really possible to explain everything in an answer. You should look at some samples and documentation.
[ 0.5899204611778259, -0.2684180438518524, -0.03454611077904701, 0.45076465606689453, -0.1422099769115448, -0.5017175674438477, 0.17589391767978668, 0.033723387867212296, -0.18142831325531006, -0.4641089141368866, -0.019374651834368706, -0.08921266347169876, -0.12490656971931458, -0.09912799...
I know review board is open source and I could modify the code myself, but I'm wondering if there is an easier way. By "review board", I mean the web-based diff review tool that lives here: <http://www.review-board.org/> I've not used the Review Board tool at all but the [post-review docs](http://www.review-board.org/...
[ 0.7019944787025452, 0.2702324688434601, 0.050300128757953644, -0.08669126033782959, -0.07904428243637085, -0.5077923536300659, -0.21534107625484467, 0.1273595094680786, -0.22761143743991852, -0.4584938585758209, 0.30958330631256104, 0.5108247399330139, -0.021554255858063698, 0.343915611505...
For a project we having a bunch of data that always have the same structure and is not linked together. There are two approaches to save the data: * Creating a new database for every pool (about 15-25 tables) * Creating all the tables in one database and differ the pools by table names. Which one is easier and faster...
[ 0.7654916644096375, 0.04291200637817383, 0.13529235124588013, 0.2237812876701355, 0.01741545833647251, 0.11852975189685822, 0.03034585528075695, -0.15444199740886688, -0.1841423362493515, -0.9018426537513733, 0.2366357147693634, 0.6038017272949219, -0.11292203515768051, -0.0715958774089813...
date rarely belongs together in different pools. Putting all the data of one type in one table and linking it with a pool id is not a good idea: * It is hard to backup/delete a specific pool (and we expect that we are running out primary keys after a while (even when use big int)) So the idea is to make a database fo...
[ 0.3315775692462921, -0.12324473261833191, 0.16264037787914276, 0.22504350543022156, 0.18522128462791443, -0.15279272198677063, -0.16892750561237335, -0.06576752662658691, -0.3799254894256592, -0.435041606426239, 0.10256019234657288, 0.0815976932644844, -0.2186870127916336, 0.15021277964115...
to handle for `MySQL`? Many tables or many databases? There should be no significant performance difference between multiple tables in a single database versus multiple tables in separate databases. In MySQL, databases (standard SQL uses the term "schema" for this) serve chiefly as a namespace for tables. A database h...
[ 0.06349090486764908, 0.25703898072242737, 0.3083312213420868, 0.48409879207611084, -0.07401928305625916, -0.18524305522441864, 0.01577753946185112, -0.10678563266992569, -0.32683271169662476, -0.6156662106513977, -0.13390766084194183, 0.21889987587928772, -0.07799665629863739, 0.0126382140...
MySQL Server). You just have to qualify the table name: ``` SELECT * FROM database17.accounts_table; ``` This is purely a syntactical difference. It should have no effect on performance. Regarding storage, you can't organize tables into a file-per-database as @Chris speculates. With the MyISAM storage engine, you a...
[ -0.13633309304714203, 0.23509584367275238, 0.2985996603965759, 0.19436591863632202, -0.08665762096643448, 0.07297983020544052, 0.058243393898010254, 0.06307657808065414, -0.45842429995536804, -0.9753419756889343, -0.034062664955854416, 0.2467409074306488, -0.3700406849384308, 0.15468780696...
single database versus many databases. There aren't many MySQL configuration parameters that work per database. Most parameters that affect server performance are server-wide in scope. Regarding backups, you can specify a subset of tables as arguments to the `mysqldump` command. It may be more convenient to back up l...
[ 0.14130094647407532, -0.022485343739390373, 0.33142971992492676, 0.4941531717777252, 0.03091978095471859, -0.09210175275802612, -0.014499025419354439, 0.15096530318260193, -0.5147979259490967, -0.6075204014778137, -0.12368956208229065, 0.5462266206741333, -0.33605924248695374, 0.1340070068...
re [question non-random-salt-for-password-hashes](https://stackoverflow.com/questions/536584/non-random-salt-for-password-hashes) Mr Potato Head states that the use of md5 instead of SHA-512 makes generating rainbow tables easier? I'd have thought that once your rainbow table is generated that the algorithm used is irr...
[ -0.07550495117902756, 0.24302075803279877, 0.3634938597679138, -0.11568523198366165, -0.04718665033578873, -0.060933370143175125, 0.2810989320278168, -0.449386328458786, -0.37320783734321594, -0.2848389148712158, -0.259877473115921, 0.6671611070632935, -0.2849559783935547, 0.14381812512874...
You Need To Know About Secure Password Schemes](http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html) touches on this briefly. It starts out with a mini-rant about people misunderstanding rainbow tables and the actual level of danger they present, but then turns...
[ 0.7076557874679565, -0.06178537383675575, 0.2743164896965027, 0.08977743983268738, -0.1390104442834854, -0.5185542702674866, 0.24033063650131226, -0.17993660271167755, -0.3517490327358246, -0.25637286901474, 0.09134184569120407, 0.6526697874069214, -0.09840437769889832, 0.08276580274105072...
will identify it exactly. (I say "final" because the output of MD5-only will look the same as the end result of SHA512-then-MD5, since the last step is the same in both cases.) More practically, though, anyone who can steal your password database can probably steal your source code as well, so they can just look at yo...
[ 0.12373493611812592, -0.2815200090408325, 0.16184848546981812, 0.21329475939273834, 0.04914923757314682, -0.21343182027339935, 0.1383487731218338, -0.13617505133152008, -0.004277929197996855, -0.5206559300422668, -0.30096182227134705, 0.5705481767654419, -0.009850162081420422, 0.0976394712...
We have a signon script that requires a Windows password in order to access and validate against the SAS metadata server. The problem is that if the windows password is changed, and the script is run a few without being updated, then the user gets locked out and has to call IT support for a password reset. What is th...
[ 0.31774553656578064, 0.07853223383426666, 0.3584451675415039, -0.12731829285621643, 0.29507991671562195, -0.3154658377170563, 0.5313729643821716, -0.15698745846748352, 0.06414234638214111, -0.5025606751441956, -0.15964263677597046, 0.2843278646469116, -0.25215572118759155, -0.0858278721570...
done! I normally use a ServletHolder, like this: ``` WebAppContext context = new WebAppContext(); ServletHolder servletHolder = new ServletHolder(MyServlet.class); servletHolder.setInitParameter("cacheControl","max-age=0,public"); context.addServlet(servletHolder, "myservletpath"); ``` While this does not *exactly*...
[ 0.3550946116447449, -0.015402859076857567, 0.654341995716095, -0.05797285959124565, 0.23155370354652405, -0.20429447293281555, 0.427888959646225, -0.6176428198814392, -0.33354055881500244, -0.555959165096283, -0.41404059529304504, 0.28234678506851196, -0.19428811967372894, 0.12308005243539...
I create a graph based visual applicaion using a Netbens Visual Library. Can somebody post a code sample that enables a selection of nodes with mouse clicks (and Ctrl key fo multiple selection) ? Thanks in advance. <http://graph.netbeans.org/examples.html> contains many well written examples. Don't miss **test.action...
[ 0.34685811400413513, -0.11623626947402954, 0.07031718641519547, 0.27414172887802124, 0.07022223621606827, -0.10541237145662308, 0.38994038105010986, -0.1768541932106018, -0.20646709203720093, -0.7284742593765259, 0.32580235600471497, 0.08723916113376617, -0.27500733733177185, 0.09160031378...
I'm creating my first WPF application and I wanted to understand if there is some kind of best practice when mixing functionality from the System.Windows.Forms namespace. Basically I want to have a popup window that opens by default in the bottom right hand corner of the users monitor. I can't find a Screen.PrimaryS...
[ 0.5070362687110901, -0.0019950540736317635, 0.33989760279655457, -0.08059528470039368, -0.04874322935938835, -0.18819065392017365, -0.046574439853429794, -0.29649850726127625, -0.35658639669418335, -0.9848628044128418, 0.12847991287708282, 0.24814365804195404, -0.31480246782302856, 0.17544...
that I can use this new WPF Window. Is there anything wrong with this approach? EDIT: I have actually found a property that returns information of the primary screen without referencing Windows Forms. The property is SystemParameters.WorkArea, my question of mixing references does still stand though. <http://graph.n...
[ 0.3528364300727844, -0.1374075710773468, 0.329245388507843, 0.21695592999458313, -0.09792904555797577, -0.07006873935461044, 0.4997796416282654, -0.3007127642631531, -0.35322707891464233, -0.7715215086936951, 0.30346009135246277, 0.32104629278182983, -0.2482874095439911, 0.0595168620347976...
I have a CSV output on one of my applications. This produces a file from of web form data. In some cases I am getting a carriage return character in my notes field. This causes an error when importing the file. I would like to remove this character. The issue appears to be happening when users paste information into ...
[ 0.035428959876298904, 0.16873735189437866, 0.4902229905128479, 0.019212214276194572, -0.15740859508514404, -0.20547902584075928, 0.09018730372190475, 0.12446912378072739, 0.12564806640148163, -0.8018145561218262, 0.17411814630031586, 0.2391657531261444, -0.39489835500717163, 0.365105330944...
be getting through. SQL ``` REPLACE(Fieldname), CHAR(13) + CHAR(10), ' ') AS new_Fieldname ``` It may be best to replace the characters separately, as they do not always occur together or in that order: ``` REPLACE(REPLACE(Fieldname, CHAR(13),' '), CHAR(10), ' ') AS new_Fieldname ```
[ 0.06816166639328003, 0.27211689949035645, 0.3389088213443756, -0.29315781593322754, 0.15617284178733826, -0.08426231145858765, 0.3266628682613373, -0.004395967349410057, 0.07978568226099014, -0.665604829788208, -0.31629475951194763, 0.475728839635849, -0.10675680637359619, 0.00685277627781...
Lets say I have projects x and y in brother directories: projects/x and projects/y. There are some utility funcs common to both projects in myutils.py and some db stuff in mydbstuff.py, etc. Those are minor common goodies, so I don't want to create a single package for them. Questions arise about the whereabout...
[ 0.6603524684906006, 0.11648791283369064, -0.1911083459854126, 0.07705757766962051, -0.3055153787136078, -0.21738213300704956, 0.33003419637680054, 0.014413584023714066, -0.24345536530017853, -0.47044965624809265, 0.1756191849708557, 0.42186957597732544, -0.33001506328582764, 0.047666650265...
both projects, and the effect would be the same. You'll never do it right for all instalation scenarios and platforms if you do it by mangling with PYTHONPATH and custom imports. Just create another package and be done in no time.
[ 0.5453924536705017, -0.22876933217048645, -0.1269494742155075, 0.2793639004230499, 0.12597976624965668, -0.2130245417356491, 0.2362372875213623, -0.006378533318638802, -0.14594100415706635, -0.5361959338188171, -0.06726381182670593, 0.6625813841819763, -0.3503096103668213, -0.0798974782228...
I have a dropdownlist that displays time. For example **8:00AM** or **8:30AM**. When I save this time to database, I want to save as todays date + time. eg: **8:00AM** as `03/30/2009 8:00:00:000`. Can anybody give appropriate code to convert as shown above? I tried ``` Convert.ToDateTime(ddlStartTime.SelectedItem.T...
[ 0.2714921236038208, -0.1807246059179306, 0.6949040293693542, -0.10243923217058182, 0.10410640388727188, 0.10717114806175232, 0.4169752597808838, -0.31322163343429565, -0.3127029538154602, -0.5831725001335144, -0.01773705892264843, 0.6563793420791626, 0.08905413001775742, 0.3171738088130951...
0 End If Dim dt As DateTime = DateTime.Today.AddHours(hours + ampm).AddMinutes(minutes) ```
[ 0.6762534976005554, -0.1087431013584137, 0.5152336359024048, -0.24172958731651306, 0.186593160033226, -0.016790449619293213, 0.13309918344020844, -0.012966396287083626, -0.012941140681505203, -0.48581662774086, -0.23629732429981232, 0.437205970287323, -0.062133900821208954, 0.3749986588954...
Say if I have a controller, profile, which has just two actions. The first one is `list`, which will just show the list of names. I want these names to be links which will then take you to a page that shows the full profile. So I need a second action, `view`, which can then bed fed a parameter to indicate which profile...
[ 0.21728797256946564, -0.5437832474708557, 0.34557071328163147, 0.14413736760616302, 0.07781793922185898, -0.010238606482744217, -0.22375676035881042, -0.027012094855308533, -0.4558190703392029, -0.6577262282371521, 0.10245230793952942, 0.6056293249130249, -0.37945273518562317, 0.2316853255...
then make the appropriate database queries. What changes do I have to make to routes.rb for this to happen? Cheers. I'd rather use the default :controller/:action/:id route to protect against cases where there are 2 John's in the list. To have a custom route like you mentioned edit Routes.rb to include a new one `...
[ 0.1418960839509964, 0.16972795128822327, 0.6894428730010986, -0.0110014034435153, -0.12355499714612961, -0.024124449118971825, 0.1925540566444397, -0.6143236756324768, -0.5803417563438416, -0.4931873083114624, 0.09208344668149948, 0.5480318665504456, -0.24420899152755737, 0.026749815791845...
url, e.g. it has to match /SomeRegexpToValidateNames/ ``` map.connect ':controller/:action/:user_name', :requirements => {:user_name => /\w+/} ```
[ -0.21757923066616058, -0.12381744384765625, 0.7513721585273743, 0.3950827121734619, -0.05580827221274376, -0.27269116044044495, -0.22075578570365906, 0.2986295521259308, 0.010585159994661808, -0.6735418438911438, -0.23299671709537506, -0.056189391762018204, -0.11554678529500961, 0.46001759...
Imagine these two classes: ``` class Part { public string Name { get; set;} public int Id { get; set; } } class MainClass { public Part APart { get; set;} } ``` How can I bind MainClass to a combo box on a WinForm, so it displays Part.Name (`DisplayMember = "Name";`) and the selected item of the combo sets the A...
[ -0.16640853881835938, -0.5562162399291992, 0.11340809613466263, 0.042461197823286057, -0.00526000140234828, 0.02279883623123169, 0.26050183176994324, -0.4190433621406555, 0.06632595509290695, -0.6534631252288818, -0.2817327082157135, 0.3993607461452484, -0.23385019600391388, 0.204685926437...
for is to have the `ValueMember` (= `ComboBox.SelectedItem`) be a reference to the object itself, while `DisplayMember` is a single property of the item, correct? As far as I know, there's no good way to do this without creating your own `ComboBox` and doing the binding yourself, due to the way `ValueMember` and `Displ...
[ 0.10530773550271988, -0.18882979452610016, 0.09681538492441177, 0.03477928042411804, -0.09519845247268677, -0.09040502458810806, 0.22137360274791718, -0.6525242328643799, -0.1764909327030182, -0.42846590280532837, -0.16101746261119843, 0.3465866148471832, -0.37805846333503723, 0.2551141381...
new property in Part to return a reference to itself. Set the 'ValueMember' to the new property and 'DisplayMember' to `"Name"`. It may feel like a bit of a hack, but it should work. 3. Do funny things with your `APart` getter and setter. You'll lose some strong-typing, but if you make `APart` an object and `MainClass`...
[ 0.05363850295543671, -0.16893288493156433, 0.25937846302986145, 0.13103891909122467, -0.10744675993919373, -0.23527106642723083, 0.14161813259124756, -0.5919471979141235, -0.1782016158103943, -0.5462377667427063, -0.402787983417511, 0.5214112997055054, -0.39353442192077637, 0.2539936006069...
{ if(value is int) _APart = MyPartCollection.Where(p=>p.Id==value).Single(); else if(value is Part) _APart = value; else throw new ArgumentException("Invalid type for APart"); } } ```
[ 0.1390012949705124, 0.07562925666570663, 0.16902263462543488, -0.18486909568309784, -0.025485211983323097, 0.024555960670113564, 0.2797994315624237, -0.4554470479488373, -0.1372743397951126, -0.21041440963745117, -0.5296871066093445, 0.4029514789581299, -0.2536620795726776, 0.4070521593093...