text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
but I was wondering if there's a best-practice or other general recommendations. So here's my 2c: 1. Just use long and try-to-be-unique names. That's ugly and not full-proof, but is simple in concept. 2. Use an iframe. But as mentioned, I don't want to use an iframe for several reasons. I want the widget to inherit st...
[ 0.3829513192176819, 0.2643122375011444, 0.2619529068470001, -0.04404981806874275, -0.17971473932266235, -0.27279776334762573, 0.05634578317403793, -0.030965665355324745, 0.019236762076616287, -0.7156633138656616, -0.1945563554763794, 0.2517153322696686, -0.3486683666706085, -0.130967959761...
This solution, while elegant, still does not work for me b/c first, it only solves the JS name clashed but not the DOM ID ones or CSS class names and second, I also use jsonp for which I need to provide a callback function name, which eventually needs to be in the global scope, so it cannot be nested in the anonymous f...
[ -0.26060429215431213, 0.07639618217945099, 0.4257994294166565, 0.06866597384214401, -0.19318322837352753, 0.060799695551395416, 0.15959061682224274, -0.4484248757362366, -0.23946115374565125, -0.6757158041000366, -0.09977424144744873, 0.5910521149635315, -0.48929500579833984, -0.0697844177...
and can generate guaranteed to be unique namespaces. Javascript namespaces: <http://www.codeproject.com/KB/scripting/jsnamespaces.aspx> It is heavily used in several javascript frameworks/libraries, such as YUI: <http://developer.yahoo.com/yui/yahoo/>
[ 0.3045821487903595, -0.02790149301290512, -0.059888653457164764, -0.018266232684254646, -0.2961813807487488, 0.0032013796735554934, -0.23495745658874512, -0.13819721341133118, 0.05833078920841217, -0.5727025270462036, -0.22450947761535645, 0.03979708254337311, -0.14951510727405548, 0.12761...
I have a input checkbox that is checked and disabled when some JS runs on page load. ``` <input name="selectUnionDues" id="selectUnionDues" type="checkbox" checked="checked" runat="server" /> ``` When I get the value of the checkbox by using (on the server side) ``` this.selectUnionDues.checked //returns false ``...
[ 0.1306159496307373, 0.21894970536231995, 0.45273685455322266, -0.11781975626945496, -0.12221042811870575, -0.09213445335626602, 0.32454708218574524, -0.33475708961486816, -0.14826670289039612, -0.6713550090789795, -0.17106211185455322, 0.24722835421562195, -0.28845325112342834, 0.124555848...
The following Python code uses BeautifulStoneSoup to fetch the LibraryThing API information for Tolkien's "The Children of Húrin". ``` import urllib2 from BeautifulSoup import BeautifulStoneSoup URL = ("http://www.librarything.com/services/rest/1.0/" "?method=librarything.ck.getwork&id=1907912" ...
[ -0.09774672985076904, 0.4466002881526947, 0.6468505263328552, -0.1300535947084427, -0.29993051290512085, 0.2545483708381653, 0.3821941614151001, -0.44751685857772827, 0.04303422197699547, -0.20550189912319183, -0.3696286380290985, 0.07090742141008377, -0.14605437219142914, 0.17412205040454...
I need to do to get the expected output. Help would be greatly appreciated. In the source of the web page it looks like this: `The Children of H&Atilde;&ordm;rin`. So the encoding is already broken somewhere on their side before it even gets converted to XML... If it's a general issue with all the books and you need t...
[ 0.4315815269947052, 0.3066243529319763, 0.29120197892189026, 0.2056131660938263, 0.10402040928602219, 0.13402502238750458, 0.22717472910881042, -0.031213954091072083, -0.0018666087416931987, -0.6414233446121216, -0.3850853443145752, 0.08908812701702118, 0.17760103940963745, 0.1003188490867...
I am developing a Digg like site and I want the title of the comments page to match the link title, here its the comments file code: ``` class CommentsPage extends Page { function __construct($title = '') { $this->setTitle($title); } function header() { parent::header(); } ...
[ 0.3730573058128357, 0.18078279495239258, 0.5989782214164734, -0.31428998708724976, -0.23049594461917877, -0.3297792673110962, 0.19875046610832214, -0.2856762409210205, 0.07071864604949951, -0.6004390120506287, -0.4675014913082123, 0.3439120352268219, -0.2985053062438965, 0.2051822543144226...
if(!empty($article)) { ?> <div class="news_item"> <a href="/index.php?action=vote&param=<?php echo $article->getId(); ?>"><img alt="vote button" class="vote_button" height="10" src="assets/images/vote2.png" width="10" class="border_less" /></a> <h2 class="...
[ -0.05900074169039726, -0.22322586178779602, 0.67683345079422, -0.009089615195989609, 0.02291581779718399, 0.10873610526323318, 0.03773021697998047, -0.634450376033783, -0.36497926712036133, -0.47284603118896484, -0.5781139135360718, 0.24802114069461823, -0.23272296786308289, -0.07154373079...
<span class="news_item_url">(<?php echo $article->getUrlDomain(); ?>)</span> <div class="news_item_info"><?php $points = $article->getPoints(); echo $points > 1 ? "$points points" : "$points point"; ?> by <a href="/index.php?action=user&param=<?php echo $article->getUsername(); ?>"><?php echo $article->...
[ 0.11582774668931961, 0.045782312750816345, 0.5702375769615173, -0.04675089567899704, -0.3950997292995453, 0.182582288980484, 0.2850668132305145, -0.9262045621871948, -0.5600989460945129, -0.1528988629579544, -0.4885266423225403, 0.3092908263206482, -0.2910694479942322, -0.14269359409809113...
$this->showSubmitForm($article); } ``` I understand I have to change "$this->setTitle($title);" for something with this: $article->getTitle(); but I have tried different things and just shows errors. I think I was not clear enough: the title on top of the page to change and be the same as the news item title...
[ 0.1874077320098877, 0.2941749393939972, 0.6396008729934692, -0.2796584367752075, -0.13091151416301727, -0.3022862672805786, 0.25844013690948486, -0.13358747959136963, -0.14407142996788025, -0.7028639316558838, -0.32912829518318176, 0.6942570209503174, -0.5330535769462585, 0.267300605773925...
Article::getById($article_id); if(!empty($article)) { $this->setTitle($article->getTitle()); } else { //Throw an exception } } function header() { parent::header(); }
[ 0.21285586059093475, -0.008580172434449196, 0.440635085105896, -0.25124138593673706, 0.004642084240913391, -0.4494546949863434, 0.25225985050201416, -0.5501556396484375, 0.09640106558799744, -0.5171802639961243, -0.5042239427566528, 0.5611212849617004, -0.5413721203804016, 0.14204244315624...
function showAllComments($param) { if(!empty($this->article)) { ?> <div class="news_item"> <a href="/index.php?action=vote&param=<?php echo $this->article->getId(); ?>"><img alt="vote button" class="vote_button" height="10" src="assets/images/vote2.png" width="10"...
[ 0.03132065013051033, -0.04290803521871567, 0.8112536668777466, -0.258858323097229, -0.41578420996665955, 0.11504083126783371, 0.23186302185058594, -0.8521599769592285, -0.3108868896961212, -0.3723747134208679, -0.2958429455757141, 0.3762166202068329, -0.5332238674163818, 0.0161458104848861...
<span class="news_item_url">(<?php echo $this->article->getUrlDomain(); ?>)</span> <div class="news_item_info"><?php $points = $this->article->getPoints(); echo $points > 1 ? "$points points" : "$points point"; ?> by <a href="/index.php?action=user&param=<?php echo $this->article->getUsername(); ?>"><?p...
[ 0.11514215171337128, 0.06118360906839371, 0.5090921521186829, -0.02922808937728405, -0.42815032601356506, 0.08735436201095581, 0.27207836508750916, -0.8969881534576416, -0.5237157344818115, -0.2080455869436264, -0.4431067705154419, 0.2997547686100006, -0.22149066627025604, -0.0798203870654...
<?php $this->showSubmitForm($this->article); } } ```
[ 0.23819689452648163, 0.2973019480705261, 0.45704641938209534, -0.2954494059085846, -0.19172316789627075, -0.36042243242263794, 0.28619953989982605, -0.042925648391246796, 0.09401246160268784, -0.37546101212501526, -0.3908439874649048, 0.5713914632797241, -0.4401208758354187, 0.212599888443...
I have some input checkboxes that are being dynamically generated in a `$.post` callback function. Then i have a `$().change()` call that does things when the value is changed (alerts some info). However, for the dynamically generated inputs, the .change() does not work. There are other inputs that work that are hardco...
[ 0.2576258182525635, 0.08905764669179916, 0.4738922119140625, -0.2365826964378357, -0.03193466737866402, -0.06635484844446182, 0.13318143784999847, -0.4488740563392639, 0.09682122617959976, -0.5928598046302795, -0.059011656790971756, 0.35328805446624756, -0.24611161649227142, -0.09431000053...
writeMe = "<input type='checkbox' name='foo' value='" + data + "'>" + data; $("#insert").html(writeMe); }, "json"); $("input[name=foo]").change(function(){ alert($(this).attr("value")); }) }); </script> </head> <body> <div id="insert"></div> <input type="...
[ 0.030859576538205147, -0.02074458822607994, 0.6051439046859741, -0.513671875, 0.10820869356393814, 0.13924817740917206, 0.35907065868377686, -0.538870632648468, 0.1258116364479065, -0.46664848923683167, -0.2195129096508026, 0.5602317452430725, -0.5739122629165649, -0.09046395868062973, 0...
alert($(this).attr("value")); }) ``` doesn't have any effect because at the time it executes, there are no elements that match $("input[name=foo]") because the $.post() callback hasn't happened yet.
[ 0.08203302323818207, -0.06317880749702454, 0.5209335088729858, -0.44091686606407166, 0.35127580165863037, -0.3286034166812897, 0.40643763542175293, -0.22887568175792694, -0.01648618094623089, -0.20682105422019958, -0.33646541833877563, 0.6565337777137756, -0.6261151432991028, 0.11877264827...
I have a server that hosts a bunch of sites in PHP5. I have an old site that was designed for PHP4 that I also need on the server. Originally, I was just going to port the code to PHP5, but have discovered that process is more intense that I have time for so I need to have PHP4 and PHP5 running on the same Server 2008...
[ 0.5400612950325012, 0.2904781997203827, 0.027926834300160408, 0.048919737339019775, -0.25778815150260925, -0.23523090779781342, 0.22701768577098846, 0.10359225422143936, -0.2426120638847351, -0.7317582964897156, 0.44759270548820496, 0.48506951332092285, -0.16341176629066467, 0.404074132442...
seem to find that article anywhere. Does anyone know how to run PHP4 and PHP5 parallel on IIS7, or how to specify which PHP.ini file to load for different version of PHP? Thanks, Ryan. I haven't run php4 and php5 in parallel, but for the php.ini question: PHP *should* look for the PHP.ini file in * the php directory...
[ 0.2605060338973999, 0.1479751169681549, 0.13221679627895355, 0.262372225522995, -0.12129770964384079, -0.32808515429496765, 0.6687102317810059, 0.5206921696662903, -0.5269952416419983, -0.7999924421310425, 0.18301470577716827, 0.592725396156311, 0.04136365279555321, 0.006628085859119892, ...
Is it possible to use the LINQ types and extension methods in IronPython? If so how? And also is there often more pythonic to do the same thing? IronPython 2.7 finally bridges this gap with the `clr.ImportExtensions` method which adds the extension methods from a namespace to the target types e.g. ``` >& 'C:\Program...
[ 0.10717443376779556, 0.16283224523067474, 0.6576370596885681, -0.05478295311331749, 0.166333869099617, 0.2606408894062042, -0.025968261063098907, -0.3569566607475281, -0.05610638111829758, -0.5539647340774536, -0.3403562307357788, 0.6270318627357483, -0.42727676033973694, -0.11600121110677...
'IsReadOnly', 'IsSynchronized', 'Item', 'LastIn dexOf', 'MemberwiseClone', 'ReferenceEquals', 'Remove', 'RemoveAll', 'RemoveAt', 'RemoveRange', 'Reverse', 'Sort', 'Sync Root', 'ToArray', 'ToString', 'TrimExcess', 'TrueForAll', '__add__', '__class__', '__contains__', '__delattr__', '__doc_ _', '__format__', '__getattrib...
[ -0.388177752494812, 0.1128869354724884, 0.5433964729309082, 0.17816302180290222, 0.23369532823562622, 0.6112328767776489, 0.03156871348619461, -0.05751925706863403, 0.033272743225097656, -0.5377421379089355, -0.46011319756507874, 0.4294604957103729, -0.038018494844436646, 0.098009712994098...
'ReferenceEquals', 'Remove', 'RemoveAll', 'RemoveAt', 'RemoveRange', 'Reverse', 'Select', 'SelectMany', 'Sequen ceEqual', 'Single', 'SingleOrDefault', 'Skip', 'SkipWhile', 'Sort', 'Sum', 'SyncRoot', 'Take', 'TakeWhile', 'ToArray', ' ToDictionary', 'ToList', 'ToLookup', 'ToString', 'TrimExcess', 'TrueForAll', 'Union', '...
[ -0.16949616372585297, -0.20852765440940857, 0.6459342241287231, 0.12081676721572876, 0.10063489526510239, 0.5713808536529541, -0.006032796110957861, -0.4110267162322998, -0.02626233547925949, -0.4402809143066406, -0.25445669889450073, 0.4041964113712311, -0.2502775490283966, -0.04395936056...
How can I do this in WPF's code-behind? ``` <Grid Background="{DynamicResource {x:Static SystemColors.DesktopBrushKey}}"/> ``` I just found an ugly solution: ``` grid1.SetResourceReference( Control.BackgroundProperty, SystemColors.DesktopBrushKey); ``` I hope someone will post a better one (I'd like to see...
[ 0.14025554060935974, -0.23532404005527496, 0.4154720902442932, 0.005487081129103899, 0.07091958075761795, -0.2452167570590973, 0.3918382227420807, -0.09267353266477585, -0.07427967339754105, -0.9595638513565063, 0.06258946657180786, 0.5370737910270691, -0.4672069251537323, 0.16168765723705...
I need a regex or function that can remove the ENCODED HTML tags from a database record. I have text in a database that is being stored (from TinyMCE) as encoded HTML. The code has the 'less than'; and 'greater than'; tags encoded. I would like to remove all the encoded tags and HTML and just leave the plain text and...
[ 0.4422007203102112, -0.07096488773822784, 0.4097169041633606, 0.11235997080802917, 0.07174888253211975, -0.10398564487695694, 0.2666388154029846, -0.01073508057743311, 0.024628661572933197, -0.6818183064460754, -0.17023241519927979, 0.6040219664573669, -0.3036207854747772, 0.22578445076942...
that relies on already present PHP functionality is a better choice. First, let's turn the encoded HTML entities back into greater than and less than signs with [htmlspecialchars\_decode](http://us2.php.net/manual/en/function.htmlspecialchars-decode.php). ``` $string = htmlspecialchars_decode($string); ``` This sho...
[ 0.49245062470436096, 0.353681743144989, 0.7115578651428223, -0.020564058795571327, -0.11716973036527634, -0.014837406575679779, 0.12519334256649017, -0.5843693614006042, 0.03711770102381706, -0.5457383394241333, -0.05159655585885048, 0.35653120279312134, -0.28832319378852844, -0.1404364854...
I'm using the FlexGantt Javax Swing package (<http://www.dlsc.com/>) to display some Gantt charts. The trouble I'm having is that I can't figure out how to change the color of a DefaultTimelineObject that I've extended into my own class. Actually, about the only colors I seem able to change are the ones that are for th...
[ 0.2168189436197281, 0.0984683707356453, 0.2433544099330902, -0.3070259094238281, -0.14536838233470917, 0.0506967194378376, 0.21776700019836426, -0.14164096117019653, -0.3174196779727936, -0.9417029619216919, 0.0032925852574408054, 0.5674608945846558, -0.4005592465400696, 0.0066463248804211...
Say I have the string "User Name:firstname.surname" contained in a larger string how can I use a regular expression to just get the firstname.surname part? Every method i have tried returns the string "User Name:firstname.surname" then I have to do a string replace on "User Name:" to an empty string. Could back refer...
[ 0.05713266506791115, 0.3774057924747467, 0.6692000031471252, -0.25118809938430786, 0.180069237947464, -0.08908744901418686, 0.046494729816913605, -0.5517174601554871, -0.0716513991355896, -0.4567759931087494, -0.24687795341014862, 0.5040187239646912, -0.1685856580734253, 0.2565608620643616...
at the beginning of a group in parentheses (e.g. `(?<something>...)`) allows you to get the value from the match using `something` as a key (e.g. from `m.Groups["something"].Value`) If you didn't want to go to the trouble of naming your groups, you could say ``` Match m = Regex.Match("User Name:first.sur", @"User Nam...
[ -0.1435220092535019, -0.0051785982213914394, 0.3994791805744171, -0.24642910063266754, -0.1660885363817215, -0.26306411623954773, -0.026022257283329964, -0.6171243190765381, -0.17985299229621887, -0.4943747818470001, -0.3636760115623474, 0.31331393122673035, -0.2603202760219574, 0.06760308...
I have a program that displays messages posted to a forum. Right now, I am using the Response.Write method in the code behind to insert the HTML I want. But I would much rather avoid putting HTML in the code behind (because it is not in the spirit of the whole code behind/design separation feature of .NET). I would lik...
[ 0.14187169075012207, 0.13632400333881378, 0.4781983196735382, 0.06947427242994308, -0.04887240007519722, 0.13905900716781616, -0.3143102526664734, 0.23584634065628052, -0.355979859828949, -0.8212413191795349, 0.2308969348669052, 0.07257023453712463, -0.32568827271461487, -0.022529006004333...
Table Column 2 Username: [UserName]       [MessageSubject] Posted on: [PostDate] User Rating: [UserRating] But the only thing I can seem to accomplish is: Username: [UserName]Posted On: [PostDate] User Rating [UserRating][MessageSubject], without links or formatting. How do I put paragraphs, line breaks...
[ -0.3267432153224945, 0.15516062080860138, 0.8550096750259399, -0.21610765159130096, -0.3736060857772827, 0.02007482759654522, 0.0171048641204834, -0.36988142132759094, -0.202969491481781, -0.5580011010169983, -0.10586737841367722, 0.2532678246498108, -0.385670006275177, -0.1325965970754623...
= "Username:"; cell1.Controls.Add(label1); TextBox textBox1 = new TextBox(); textBox1.ID = "userNameTextBox"; cell2.Controls.Add(textBox1); // and so on... myPlaceholder.Controls.Add(table); ``` would be equivalent to: ``` <asp:Table runat="server"> <asp:TableRow runat="server"> <asp:TableCell runat="server"> ...
[ -0.15773503482341766, -0.03228943794965744, 0.5443066954612732, -0.13349385559558868, 0.02577095851302147, -0.026980126276612282, 0.26202648878097534, -0.3589669466018677, -0.15726642310619354, -0.6597262620925903, -0.18652759492397308, 0.30766382813453674, -0.3968043029308319, -0.06210465...
I am getting an error when trying to access a web service via soap ``` soap_client = SOAP::WSDLDriverFactory.new("http://api.upsidewireless.com/soap/Authentication.asmx?WSDL") driver = soap_client.createDriver @p = driver.GetParameters(:username => 'uname', :password => 'pword') #ERROR => wrong number of arguments (1 ...
[ 0.21501542627811432, 0.12683254480361938, 0.4286033511161804, 0.011875927448272705, -0.2334364801645279, 0.21600273251533508, 0.5089125633239746, -0.17013640701770782, -0.15864184498786926, -0.9528700709342957, 0.34191709756851196, 0.35200557112693787, -0.31875523924827576, 0.5994343757629...
I designed a class which creates XML for a POST in order to call an API call to a third party API. The class has helper methods; One to form the HttpWebRequest and then one to send it. My question is this: Should the response (which ultimately I'm going to shove into an XMLReader and parse it to get the values) be ret...
[ 0.15130287408828735, -0.13527968525886536, 0.3480190634727478, 0.09696824848651886, -0.3267476260662079, 0.1755737066268921, -0.11392468959093094, -0.22378282248973846, 0.18482916057109833, -0.5344511270523071, 0.05441467836499214, 0.35378795862197876, -0.2833901643753052, 0.21133837103843...
pass that HttpWebResponse or XMLReader (if i decide to first shove that response into a reader instead) to an entirely different class called APIMethodResponse that holds the values that came back in the Response? I'm thinking about SOLID and just basic class design here. I'm not sure which way to go with it in terms ...
[ 0.31754034757614136, -0.4113754630088806, 0.4000760614871979, 0.28759855031967163, -0.6612952947616577, -0.10228406637907028, 0.17607732117176056, -0.21090318262577057, -0.0071646301075816154, -0.48572012782096863, 0.09071996808052063, 0.6266905665397644, -0.30771008133888245, 0.0109209967...
POST is created via a method that creates the necessary nodes and data to send as the POST for the UdpateCustomer method call WSDLDriver is deprecated (called from createDriver). You should use 'create\_rpc\_driver'. I get back a response with that method from your example. Is there some reason not to use 'create\_rpc\...
[ 0.3711346387863159, -0.015726352110505104, 0.3590637743473053, 0.11714146286249161, -0.1831483393907547, 0.12119235098361969, 0.0862438827753067, 0.016020730137825012, -0.14839334785938263, -0.6106621623039246, -0.014939849264919758, 0.021027350798249245, -0.5615857243537903, 0.64439916610...
is there an equivalent to the C++ method `istream::putback(char)` for OCaml? How could I add a character to the beginning of *stdin*? You cannot do it with an `in_channel` or with `Stream.t`. Here are some suggestions: 1. If you are putting back a character you had read, you might want to use use `peek` to examine th...
[ 0.16601291298866272, -0.20928768813610077, 0.013673714362084866, -0.07706562429666519, -0.23513992130756378, -0.020565824583172798, 0.17717920243740082, -0.08111535012722015, 0.011388061568140984, -0.4975329041481018, 0.17987599968910217, 0.5601552128791809, -0.42485010623931885, 0.0134629...
a zipper or stack or some other structure that allows pushing characters back.
[ -0.6046789288520813, -0.2674691677093506, 0.008139949291944504, 0.2994557321071625, -0.01900409162044525, 0.25706037878990173, -0.24749259650707245, -0.11163869500160217, -0.4083876311779022, -0.3615117371082306, -0.8085983395576477, -0.037573568522930145, -0.06015658378601074, -0.16731335...
``` package abc; class DependencyDataCollection { private int sNo; private String sessionID; private int noOfDependency; private int noOfRejection; private int totalValue; /** Creates a new instance of DependencyDataCollection */ public DependencyDataCollection(int sNo, String sessionID, i...
[ 0.17450791597366333, -0.031072299927473068, 0.16440348327159882, -0.45368534326553345, 0.2072967141866684, 0.07616272568702698, 0.5519205331802368, -0.27971211075782776, -0.09342876821756363, -0.32691797614097595, -0.5670834183692932, 0.7758010029792786, -0.5788747668266296, 0.158847570419...
= noOfRejection; this.totalValue = totalValue; } public int getSNo() { return sNo; } public String getSessionID() { return sessionID; } public int getNoOfDependency() { return noOfDependency; } public int getNoOfRejection() {
[ -0.23206214606761932, -0.45398154854774475, 0.4286893904209137, -0.1274600774049759, 0.1584782749414444, -0.021295076236128807, 0.572963297367096, -0.18151697516441345, -0.47071191668510437, -0.3807985484600067, -0.5595785975456238, 0.6538007855415344, -0.06178828701376915, 0.1533959954977...
return noOfRejection; } public int getTotalValue() { return totalValue; } } public class DependencyStack { LinkedList lList; /** Creates a new instance of DependencyStack */ public DependencyStack() { lList = new LinkedList(); } public void add(int sNo, Strin...
[ -0.01637054607272148, -0.511441171169281, 0.7833643555641174, -0.38104531168937683, 0.2401902973651886, 0.10405711829662323, 0.3287745416164398, -0.13893799483776093, -0.26833686232566833, -0.6597540974617004, -0.4218911826610565, 0.6923174858093262, -0.4440688192844391, 0.0288266837596893...
lList.add(new DependencyDataCollection(sNo,sessionID,noOfDependency,noOfRejection,totalValue)); } public int size() { return lList.size(); } public void show() { for(int i=0;i<lList.size();i++) { DependencyDataCollection ddc = (DependencyDataCollection)lList...
[ 0.22957293689250946, -0.3964250087738037, 0.9360963106155396, -0.6110875010490417, 0.1851734071969986, 0.012485736049711704, 0.14184726774692535, -0.3976283669471741, -0.16955147683620453, -0.716751754283905, -0.5436784029006958, 0.7900261282920837, -0.2319638878107071, 0.11979067325592041...
} } public int returnIndexOfSession(String sessionID) { DependencyDataCollection ddc = null; for(int i=0;i<lList.size();i++) { ddc = (DependencyDataCollection)lList.get(i); if(ddc.getSessionID().equals(sessionID)) break;
[ -0.06684320420026779, -0.3637802302837372, 0.6742268800735474, -0.309828519821167, 0.2599593997001648, -0.03468163311481476, 0.49553003907203674, -0.3597373962402344, -0.17840220034122467, -0.413987934589386, -0.36596977710723877, 0.693915069103241, -0.3217341899871826, 0.4144234359264374,...
} return ddc.getSNo(); } public static void main(String args[]) { DependencyStack ds = new DependencyStack(); ds.add(1,"a",0,0,0); ds.add(2,"b",0,0,0); ds.show(); //System.out.println(ds.returnIndexOfSession("a")); // DependencyDataCollection ddc = n...
[ -0.09990987926721573, -0.27179059386253357, 0.6052684783935547, -0.29670870304107666, 0.01501544751226902, -0.024513544514775276, 0.2587345242500305, -0.23474933207035065, -0.15097147226333618, -0.575656533241272, -0.3390723466873169, 0.5044601559638977, -0.6088942289352417, 0.524984121322...
in java which is using inbuilt linkedlist class from java.util package. The linked list is used to store different amount of data using DependencyDataCollection Class.. **Now my question is** > 1) Please evaluate this program, > and temme am i respecting all java > concepts like private member > access,which i ha...
[ -0.31988927721977234, 0.00980855617672205, 0.07536351680755615, -0.14457769691944122, -0.3681299090385437, -0.3143283724784851, 0.2979397177696228, -0.33211809396743774, -0.2653338313102722, -0.6722423434257507, -0.11222325265407562, 0.2969907224178314, -0.4013453423976898, 0.0042794086039...
data as "b" or "a". What could be the shortest inbuilt method which can do so, as i have made a function named "public int returnIndexOfSession(String sessionID)" which makes use of for loop, i find this very time consuming.. Is there any other way out.. Please evaluate and guide as i am a newbie in java. Here are the...
[ 0.17081575095653534, 0.08008264005184174, 0.22934210300445557, -0.17972935736179352, 0.07982565462589264, -0.057538703083992004, 0.46938326954841614, -0.4322856664657593, -0.1064237430691719, -0.6484466791152954, -0.11143109947443008, 0.852773904800415, -0.5207929015159607, 0.1822139918804...
you had noset methods so it was safe, but always try to make things final. private final int sNo; private final String sessionID; private final int noOfDependency; private final int noOfRejection; private final int totalValue; public DependencyDataCollection(final int sNo, ...
[ -0.1591382920742035, -0.4188844561576843, 0.32347989082336426, -0.08247371017932892, -0.11740268766880035, 0.06337692588567734, 0.4495637118816376, -0.031341515481472015, -0.01093877200037241, -0.27804890275001526, -0.31491756439208984, 0.7103910446166992, -0.14786452054977417, 0.137964427...
final int noOfDependency, final int noOfRejection,
[ -0.5171480178833008, 0.16416962444782257, 0.31460559368133545, -0.43847039341926575, -0.33852419257164, 0.5238324999809265, 0.4521774351596832, -0.18813954293727875, 0.018678614869713783, -0.6069082617759705, -0.3191482424736023, 0.3274540901184082, -0.15484532713890076, 0.0342287458479404...
final int totalValue) { this.sNo = sNo; this.sessionID = sessionID; this.noOfDependency = noOfDependency; this.noOfRejection = noOfRejection; this.totalValue = totalValue;
[ -0.653922975063324, -0.39017120003700256, 0.5711336731910706, -0.3151082694530487, 0.08896049112081528, 0.1751209944486618, 0.7963566184043884, -0.20510518550872803, -0.16651348769664764, -0.2512442171573639, -0.5370181798934937, 0.6465718150138855, -0.1696242392063141, 0.09477252513170242...
} public int getSNo() { return sNo; } public String getSessionID() { return sessionID; } public int getNoOfDependency() { return noOfDependency; } public int getNoOfRejection() { return noOfRejection; } public
[ -0.17836177349090576, -0.39447927474975586, 0.18413574993610382, 0.03661287948489189, 0.2194206416606903, -0.13483336567878723, 0.4353127181529999, -0.042260199785232544, -0.40527042746543884, -0.4883338510990143, -0.5650777220726013, 0.6576821804046631, -0.15564581751823425, 0.13077442348...
int getTotalValue() { return totalValue; } } class DependencyStack { // change the type to be as generic as poosible - List interface // added generics so you get compile time safety and don't use casts later on // renamed it to something meaningful private final List<DependencyDataColl...
[ 0.178823322057724, -0.5329604744911194, 0.44734907150268555, -0.04679657891392708, -0.20595377683639526, -0.0033518329728394747, 0.29749956727027893, -0.24028562009334564, -0.13136304914951324, -0.5801289081573486, 0.01706472970545292, 0.5425148606300354, -0.5303086638450623, 0.04970352351...
{ dependencies = new ArrayList<DependencyDataCollection>(); } // your Stack shouldn't know how to make the collections... (in my opinion) public void add(final DependencyDataCollection ddc) { dependencies.add(ddc); } public int size() { return dependencies.size(); ...
[ 0.2830306589603424, -0.34738248586654663, 0.7570768594741821, -0.2570670247077942, 0.06920936703681946, -0.002237098990008235, 0.11179693043231964, -0.40559080243110657, -0.3584110736846924, -0.5701663494110107, 0.09651294350624084, 0.8843110203742981, -0.4034394323825836, 0.11415558308362...
// will want to write to a file or a writer instead of a stream public void show() { show(System.out); } public void show(final OutputStream out) { show(new OutputStreamWriter(out)); } public void show(final Writer writer) { show(new PrintWriter(writer)); } ...
[ 0.2513444423675537, -0.04708349332213402, 0.4745631515979767, -0.3916662037372589, 0.14035066962242126, 0.3973900079727173, 0.04599390923976898, -0.24648945033550262, -0.08969870209693909, -0.554572582244873, -0.31805554032325745, 0.17255926132202148, -0.46553468704223633, 0.47303080558776...
// use the new for-each instead of the old style for loop // this also uses an iterator which is faster than calling get // (well on an ArrayList it probably is about the same, but a LinkedList it'll be faster) for(final DependencyDataCollection ddc : dependencies) { writer.p...
[ 0.16570158302783966, -0.31667953729629517, 0.35385918617248535, -0.32627072930336, 0.05228125676512718, -0.06204218789935112, 0.495235800743103, -0.33521854877471924, -0.1523108035326004, -0.5002148151397705, -0.11330503225326538, 0.623005747795105, -0.36785054206848145, 0.0525307841598987...
+ " " + ddc.getSessionID() + " " + ddc.getNoOfDependency() + " " +
[ -0.4138205051422119, 0.013165527023375034, 0.37167641520500183, -0.023681728169322014, -0.0337463840842247, -0.2016598880290985, 0.063618004322052, -0.4390680491924286, 0.018934305757284164, -0.5777909755706787, -0.7202613353729248, 0.4386333227157593, -0.3687300980091095, 0.20400778949260...
ddc.getNoOfRejection() + " " + ddc.getTotalValue()); } } public int returnIndexOfSession(final String sessionID) { DependencyDataCollection foundDDC; final int
[ -0.22611233592033386, -0.26360681653022766, 0.5543178915977478, -0.11258251965045929, 0.2605116665363312, -0.14087632298469543, 0.5765845775604248, -0.15679587423801422, -0.017523091286420822, -0.48114213347435, -0.40459173917770386, 0.7741146087646484, -0.21942837536334991, 0.462751150131...
retVal; foundDDC = null; for(final DependencyDataCollection ddc : dependencies) { if(ddc.getSessionID().equals(sessionID)) { foundDDC = ddc; break;
[ -0.05896047130227089, -0.2730635404586792, 0.8506481051445007, -0.16172218322753906, 0.2526516914367676, -0.07637826353311539, 0.6856251955032349, -0.45163694024086, -0.15399028360843658, -0.270891934633255, -0.4831801652908325, 0.6453387141227722, -0.40279170870780945, 0.49697673320770264...
} } // deal with the fact that you might have not found the item and it would be null. // this assumes -1 is an invalid session id if(foundDDC == null) { retVal = -1; } else
[ 0.21110908687114716, -0.1449858844280243, 0.2702137529850006, 0.16895820200443268, 0.25793328881263733, -0.1816399097442627, 0.6245554089546204, -0.31636345386505127, -0.30935826897621155, -0.23648779094219208, -0.3599764406681061, 0.5823909640312195, -0.24043376743793488, 0.20581015944480...
{ retVal = foundDDC.getSNo(); } return (retVal); } public static void main(final String[] args) { DependencyStack ds = new DependencyStack(); ds.add(new DependencyDataCollection(1,"a",0,0,0)); ds.add(new DependencyDataCollection(1,"a",0,0,0)); ds...
[ -0.08999323844909668, -0.37634754180908203, 1.0001481771469116, -0.3062596917152405, 0.10923542082309723, 0.14569786190986633, 0.6253296732902527, -0.42476046085357666, -0.29879555106163025, -0.42545032501220703, -0.6616400480270386, 0.48466798663139343, -0.44683876633644104, 0.45772263407...
DependencyDataCollection ddc = new DependencyDataCollection(1,"a",0,0,0); // System.out.println(ds.indexOf(ddc)); } } ``` Edit: This one will speed up the lookups (and deletes). ``` class DependencyStack { // A Map provides quick lookup private final Map<String, DependencyDataCollection> depende...
[ -0.006131969857960939, -0.3368396461009979, 0.7865866422653198, -0.1388542205095291, 0.13725660741329193, -0.2894015610218048, 0.18569888174533844, -0.40875673294067383, -0.36514782905578613, -0.6917374134063721, -0.11266576498746872, 0.6386056542396545, -0.5848710536956787, 0.154249042272...
shouldn't know how to make the collections... (in my opinion) public void add(final DependencyDataCollection ddc) { if(ddc == null) { throw new IllegalArgumentException("ddc cannot be null"); } dependencies.put(ddc.getSessionID(), ddc); } public int size() ...
[ 0.5781864523887634, -0.2896043062210083, 0.5094963312149048, -0.13519777357578278, 0.3324601948261261, -0.15165336430072784, 0.3307718336582184, -0.34485557675361633, -0.3501121997833252, -0.3447206914424896, -0.2534993290901184, 0.6527915000915527, -0.4162038266658783, 0.2783133089542389,...
} // the next 3 methods are just convenience since you don't know if someione // will want to write to a file or a writer instead of a stream public void show() { show(System.out); } public void show(final OutputStream out) { show(new OutputStreamWriter(out)); } pu...
[ 0.12632045149803162, -0.022434499114751816, 0.4618515968322754, -0.3458566963672638, 0.0016308932099491358, 0.16781359910964966, 0.11677680909633636, -0.27068182826042175, -0.09079071134328842, -0.5243582725524902, -0.11319386214017868, 0.32982558012008667, -0.44708189368247986, 0.42135334...
show(new PrintWriter(writer)); } public void show(final PrintWriter writer) { // use the new for-each instead of the old style for loop // this also uses an iterator which is faster than calling get // (well on an ArrayList it probably is about the same, but a LinkedList it'll be fa...
[ 0.17343494296073914, -0.07897455990314484, 0.531173825263977, -0.4859201908111572, -0.158299520611763, 0.0142999067902565, 0.274087518453598, -0.5476388335227966, -0.03906119987368584, -0.5344254970550537, -0.1403302103281021, 0.3847067058086395, -0.5682612061500549, 0.26529568433761597, ...
{ writer.println(ddc.getSNo() + " " + ddc.getSessionID() + " " + ddc.getNoOfDependency() + "
[ -0.36429691314697266, 0.0645504742860794, 0.25187960267066956, -0.12894576787948608, 0.3340739905834198, 0.1819118857383728, 0.6377378702163696, -0.08328726887702942, -0.029177648946642876, -0.6019314527511597, -0.4342389404773712, 0.618036150932312, -0.32682156562805176, 0.288703054189682...
" + ddc.getNoOfRejection() + " " + ddc.getTotalValue()); } } public int returnIndexOfSession(final String sessionID) { final DependencyDataCollection ddc;
[ -0.09268859028816223, -0.33091238141059875, 0.5711665749549866, -0.16315650939941406, 0.2110482156276703, -0.10233840346336365, 0.6215255856513977, -0.23151151835918427, 0.011399966664612293, -0.36463817954063416, -0.4454987049102783, 0.8639736771583557, -0.27458640933036804, 0.45524650812...
final int retVal; if(sessionID == null) { throw new IllegalArgumentException("sessionID cannot be null"); } // get it if it exists, this is much faster then looping through a list
[ 0.1486930400133133, -0.39275944232940674, 0.5029774308204651, 0.030592361465096474, 0.11660440266132355, 0.06437185406684875, 0.7875449061393738, -0.36506345868110657, -0.4131292998790741, -0.10387037694454193, -0.30223751068115234, 0.6403944492340088, -0.398566335439682, 0.091751791536808...
ddc = dependencies.get(sessionID); // deal with the fact that you might have not found the item and it would be null. // this assumes -1 is an invalid session id if(ddc == null) { retVal = -1; } else {
[ 0.32595527172088623, -0.24461685121059418, 0.48651808500289917, 0.18171605467796326, 0.09368414431810379, -0.13561654090881348, 0.6228834390640259, -0.35841795802116394, -0.4336490035057068, -0.2944990396499634, -0.41539305448532104, 0.6405666470527649, -0.28153157234191895, 0.320780009031...
retVal = ddc.getSNo(); } return (retVal); } public static void main(final String[] args) { DependencyStack ds = new DependencyStack(); ds.add(new DependencyDataCollection(1,"a",0,0,0)); ds.add(new DependencyDataCollection(1,"a",0,0,0)); ds.show(); /...
[ -0.015214352868497372, -0.4254211187362671, 1.053385615348816, -0.27132725715637207, -0.06979621201753616, 0.19423167407512665, 0.6757261157035828, -0.4935673177242279, -0.3143466114997864, -0.4219360947608948, -0.6201788187026978, 0.46029132604599, -0.47136390209198, 0.48841509222984314, ...
DependencyDataCollection ddc = new DependencyDataCollection(1,"a",0,0,0); // System.out.println(ds.indexOf(ddc)); } } ```
[ 0.059965942054986954, -0.18704921007156372, 0.6711715459823608, -0.13146834075450897, 0.27657580375671387, -0.09349682927131653, 0.21466076374053955, -0.13278773427009583, -0.16197119653224945, -0.6364408135414124, -0.27013593912124634, 0.6399972438812256, -0.4391394853591919, 0.6223951578...
Is there a way to convert a character to an integer in C? For example, from `'5'` to 5? As per other replies, this is fine: ``` char c = '5'; int x = c - '0'; ``` Also, for error checking, you may wish to check isdigit(c) is true first. Note that you cannot completely portably do the same for letters, for example:...
[ -0.015225696377456188, 0.19977235794067383, 0.18949174880981445, -0.11599073559045792, 0.0065326024778187275, 0.22803479433059692, 0.2075594812631607, -0.06389566510915756, -0.19815576076507568, -0.2387811541557312, -0.33626624941825867, 0.5731374621391296, -0.04989068582653999, -0.0736338...
I want to create a simple 'scorecard' like mechanism for some card/parlor style games. The trick is I want this to be a visually stimulating application (WPF/Flash style animations etc.) and available on Mac, Windows and some mobile clients eventually. Any thoughts on framework? Silverlight would be great if I could ru...
[ 0.2763250470161438, -0.0008669645176269114, 0.45437681674957275, 0.18840977549552917, 0.03039189614355564, 0.08990232646465302, -0.06255079060792923, -0.0934334546327591, -0.11244572699069977, -0.7375046014785767, 0.15815603733062744, 0.6426664590835571, -0.20145833492279053, -0.0645249709...
I'm ultimately trying to install PEAR so I can easily install PHPUnit. I want to set up a Mac, Apache, MySQL, PHP, PHPUnit development environment so I can test locally. I already have Apach, MySQL and PHP working. Now all I need is PHPUnit, which means I need PEAR to install it. I have searched all over, and there ar...
[ 0.5807279944419861, 0.3743530213832855, -0.13347657024860382, -0.07923781126737595, -0.26725858449935913, 0.42564845085144043, 0.44909682869911194, 0.20820294320583344, -0.02811969444155693, -0.6067237854003906, 0.21458742022514343, 0.7397825717926025, -0.008251435123383999, -0.13028118014...
set up as it should be, so if you could include the "default" Mac OS X 10.5 include paths, or a simple explanation of where everything should go, I would appreciate it. Following [this](http://clickontyler.com/blog/2008/01/how-to-install-pear-in-mac-os-x-leopard/) tutorial I do the following: ``` curl http://pear.php...
[ 0.4315522015094757, -0.009208358824253082, 0.3538883626461029, -0.10453584045171738, -0.18412746489048004, 0.10143075883388519, 0.35346871614456177, -0.4415454864501953, -0.32508838176727295, -0.6256248354911804, -0.4047587215900421, 0.4588738679885864, -0.3762308657169342, -0.327533960342...
: $php_dir/data 7. Tests base directory : $php_dir/tests ``` I change the `Installation prefix` to be `/usr/local`, press enter to continue, type `Y` to also install `PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2`. Eventually, everything is installed. Next... On the first try, I think `include_path` was...
[ 0.6058202385902405, 0.21852558851242065, -0.00668533006682992, -0.3561004102230072, -0.07682469487190247, -0.27635911107063293, 0.5248427391052246, 0.059174176305532455, 0.07298970222473145, -0.5780155658721924, -0.14514285326004028, 0.7243255376815796, -0.36858755350112915, 0.056327354162...
just specified: </usr/local/PEAR> If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working. Would you like to alter php.ini </private/etc/php.ini>? [Y/n] : ``` I type `Y` and let pear automatically update my include path: ``` php.ini ...
[ 0.41504594683647156, -0.09092887490987778, 0.15676183998584747, -0.2061527669429779, 0.0991663858294487, -0.047387637197971344, 0.4435449540615082, -0.012508366256952286, -0.2170918881893158, -0.532232403755188, -0.2278478592634201, 0.5325954556465149, -0.388067364692688, -0.01415078621357...
currently in your PATH, so you need to ** use '/usr/local/bin/pear' until you have added ** '/usr/local/bin' to your PATH environment variable. Run it without parameters to see the available actions, try 'pear list' to see what packages are installed, or 'pear help' for help. For more information about PEAR, see: ...
[ 0.18097150325775146, -0.07545648515224457, 0.30155277252197266, 0.11866027861833572, -0.11675950139760971, -0.24709787964820862, 0.601304829120636, 0.11769566684961319, -0.4947981834411621, -0.48273220658302307, -0.2582521140575409, 0.4548685848712921, -0.5375881791114807, -0.1694981157779...
but if I understand correctly, PEAR is trying to create its own temp directory for installation, then it's going to delete it when it's finished. So I should not have created this symbolic link since it's going to try to delete the temp directory when the installation has finished. There's a few things that could be go...
[ 0.7217579483985901, 0.013936652801930904, -0.011774884536862373, 0.2297646701335907, -0.40041014552116394, 0.06473162025213242, 0.13347648084163666, 0.061579786241054535, -0.36948537826538086, -0.6919621825218201, 0.35602855682373047, 0.47458451986312866, -0.2421826273202896, -0.1808656752...
needed for that library, and any other PEAR libraries the library you're installing rely on (sorry about that sentence, but I'm not sure there's a better way to say that). This include path is set in your php.ini files (one file for your command line php, another for yoru web server php; often the same file). The seco...
[ 0.36655524373054504, -0.02825339324772358, -0.008314172737300396, 0.14365065097808838, 0.033485569059848785, 0.10750149190425873, 0.08147892355918884, 0.10783525556325912, -0.12945520877838135, -0.6674561500549316, 0.11767834424972534, 0.7208501100540161, -0.05882378667593002, -0.190572097...
make sure that 1. The php.ini file for your website has the PEAR directory in its include path 2. The php.ini file for your command line php application has the PEAR directory in its include path 3. Your shell application (terminal, likely BASH in you're on OS X) has the PEAR directory in its include path So, for num...
[ 0.10092989355325699, 0.26401445269584656, 0.0008188120555132627, -0.23853346705436707, -0.1458529531955719, 0.11729566752910614, 0.4762186110019684, -0.03413083776831627, -0.1381688117980957, -0.6060452461242676, -0.056102488189935684, 0.46057870984077454, -0.2816164195537567, -0.100289352...
your PEAR directory (don't remove the other paths, just add yours). For number 2, run the following from your command line ``` php -r "phpinfo();" | grep '.ini' ``` A bunch of lines will print out, look for the one that reads something like "Loaded Configuration File". Open this file in a text editor, look for the ...
[ 0.2764303982257843, 0.15226610004901886, 0.045212991535663605, -0.13361850380897522, -0.18240457773208618, 0.08222855627536774, 0.4022323489189148, 0.13819800317287445, 0.013738282956182957, -0.4505446255207062, 0.030695568770170212, 0.9751439690589905, -0.4578654170036316, -0.194314822554...
to ``` ** The 'pear' command is not currently in your PATH, so you need to ``` There should be a file in your home directory named '.bash\_profile'. It's a hidden file, so it won't showup in the Finder. Open it with a text editor. If you're having trouble because this is a hidden file, use the command line pico edit...
[ 0.40881165862083435, 0.16409221291542053, 0.22001448273658752, -0.03968680277466774, -0.13110609352588654, -0.06767307221889496, 0.32916778326034546, 0.1290561705827713, -0.29344332218170166, -0.7949716448783875, -0.15337394177913666, 0.8959010243415833, -0.13135114312171936, 0.09776798635...
in this folder. Add the following line to the bottom of .bash\_profile ``` export PATH=/usr/local/bin:$PATH ``` This is, more or less, equivilant to the following PHP code ``` $PATH = '/usr/local/bin:'.$PATH ``` You're adding /usr/local/bin as the first colon-delimited place to look for command, and then adding t...
[ -0.08226359635591507, 0.09221257269382477, 0.5950546264648438, -0.10058309882879257, -0.06478027254343033, 0.12115588039159775, 0.3669668138027191, 0.22639138996601105, -0.17327755689620972, -0.9003831148147583, -0.06682470440864563, 0.629891574382782, -0.040988389402627945, -0.17663472890...
I was wondering if the type of javascript errors can be grouped into different categories and if there was an easy way of debugging them. While working on a ASP.NET application, I generally see 2 different types of JS errors: 1. Ones that say "Error occurred in xx. Do you want to debug"? 2. Ones that show errors with ...
[ 0.4233934283256531, 0.38699835538864136, -0.305742084980011, 0.022295581176877022, -0.27154430747032166, 0.07310861349105835, 0.5323724746704102, 0.1139192059636116, -0.23371285200119019, -0.6997109055519104, 0.17385146021842957, 0.6336312890052795, -0.3364042043685913, 0.07788637280464172...
setup to automatically open the line that caused the error in VS when I am not in debug mode? (We have a large .NET solution and to get to the JS debugger, I have to start in debug mode (The script explorer does not show up if I simply attach the debugger later)) ``` There certainly is: [Firebug](http://www.getfirebug...
[ 0.6647859215736389, 0.08618409931659698, -0.004862898029386997, -0.08305741101503372, 0.008286163210868835, -0.5171447992324829, 0.60455721616745, -0.08228524774312973, -0.1853477656841278, -0.8258633613586426, -0.20760087668895721, 1.0010912418365479, -0.5003087520599365, -0.1898607760667...
however. Just get Firebug and you'll wonder how you ever developed without it before.
[ 0.27289220690727234, 0.40572428703308105, 0.0037850174121558666, 0.2850716710090637, -0.11660964787006378, -0.5106770992279053, 0.29487451910972595, 0.3339221179485321, 0.31794473528862, -0.2847997844219208, 0.04223104566335678, 0.5710916519165039, 0.0933721661567688, 0.2002474069595337, ...
I'm trying to access some web services in an iPhone application. If I `GET` to the .asmx page, I authenticate and get the WSDL as expected. However, if I `POST` to the .asmx page, setting the SOAPAction, Content-Type, Content-Length, and HTTPBody, I just keep getting `didReceiveAuthenticationChallenge` messages. Add...
[ 0.31901815533638, 0.25402048230171204, 0.3762558400630951, -0.0009170766570605338, -0.28171515464782715, -0.3165320158004761, 0.6892829537391663, -0.20223985612392426, -0.05117206275463104, -0.8594703674316406, 0.1663263887166977, 0.47445768117904663, 0.0004570433811750263, 0.1599706858396...
tediousness: Someone who has already done it! [ASIHTTPRequest](http://allseeing-i.com/ASIHTTPRequest-CFNetwork-wrapper-for-HTTP-requests) **Update: There is a [workaround for iOS 4](http://github.com/pokeb/asi-http-request/issues#issue/52) that allows for NTLM authentication again**
[ 0.07471266388893127, -0.14107275009155273, 0.4899255335330963, 0.0254961047321558, -0.05604339763522148, -0.3508995771408081, 0.6563379764556885, -0.27240556478500366, -0.44664931297302246, -0.3431219756603241, -0.33756908774375916, 0.5921940803527832, -0.1782345324754715, -0.3961857855319...
I'm building software for a company that sells hardware devices. They want the software to be able to locate all devices on the network without restricting either of their IPs. What's the best way to do this? I'm thinking the hardware could subscribe to a "known" multicast address, have the software broadcast to it an...
[ 0.5853554606437683, 0.21319495141506195, 0.28938454389572144, 0.2515484392642975, 0.5893868803977966, -0.07653435319662094, 0.18909434974193573, 0.10800060629844666, -0.096577487885952, -0.8294889330863953, 0.18756839632987976, 0.5760433673858643, -0.23206669092178345, 0.24343325197696686,...
this protocol once I've got devices in the wild. Please advise. [Universal Plug and Play](http://en.wikipedia.org/wiki/Universal_Plug_and_Play), Bonjour or other [Zero configuration networking](http://en.wikipedia.org/wiki/Zeroconf) techniques.
[ 0.5132367014884949, -0.2917608916759491, 0.23440098762512207, 0.26008740067481995, 0.12803643941879272, -0.7306060194969177, 0.042760856449604034, 0.0766778364777565, -0.2505064308643341, -0.36502039432525635, -0.15479929745197296, 0.7562354207038879, -0.39090844988822937, -0.1421862244606...
When modelling classes, what is the preferred way of initializing: 1. Constructors, or 2. Factory Methods And what would be the considerations for using either of them? In certain situations, I prefer having a factory method which returns null if the object cannot be constructed. This makes the code neat. I can simp...
[ 0.2583870589733124, -0.07713590562343597, -0.4157460331916809, 0.08085734397172928, -0.33015164732933044, 0.16964006423950195, 0.16525574028491974, -0.054427120834589005, -0.17419221997261047, -0.7377515435218811, 0.2128979116678238, 0.5884106159210205, -0.3052447438240051, -0.011751766316...
the case where a record with the specified id does not exist, the constructor throws a RecordNotFoundException. In this case I will have to enclose the construction of all such classes within a try..catch block. In contrast to this I can have a static factory method on those classes which will return null if the recor...
[ 0.14172790944576263, 0.0646541640162468, -0.2680400609970093, -0.12541930377483368, 0.055514294654130936, -0.05305891111493111, 0.4092746376991272, -0.273261696100235, -0.3333907127380371, -0.4467344582080841, -0.21495765447616577, 0.26840606331825256, -0.49842527508735657, 0.2277452051639...
a class wants its subclasses to specify the objects it creates * classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate
[ 0.18483731150627136, -0.3312183618545532, -0.3131755292415619, 0.55598384141922, -0.039724308997392654, -0.008988237008452415, 0.17407047748565674, 0.08153196424245834, -0.29375967383384705, -0.5119091272354126, -0.4369976222515106, -0.03424444794654846, -0.08616112917661667, 0.46693417429...
I have a situation where I would like to elevate the permissions I have in a web environment so that I can access a serial device. The specific case is where I have a web interface for configuring a modem that comes up on `/dev/ttyUSB[0-9]`. Zero or more modems will be plugged in by an end user. I am writing some s...
[ 0.45991167426109314, 0.20962923765182495, 0.32775089144706726, 0.20890508592128754, 0.2327003926038742, -0.24303407967090607, 0.10078193992376328, -0.0047630383633077145, -0.44249868392944336, -0.5834766626358032, -0.05294513702392578, 0.613247275352478, -0.22440467774868011, 0.37470534443...
baudrate=115200, timeout=10) ser.write('AT+CGSN\r\n') imei = ser.readline() ``` The problem is that `pyserial` does this: `self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)` to open the serial port, where portstr is `/dev/ttyUSB0`, but it does it as the `nobody` user, which is unprivileged. Serial...
[ 0.12238816171884537, 0.21489281952381134, 0.6345675587654114, -0.08552920818328857, 0.1139773279428482, -0.027308914810419083, 0.37722936272621155, -0.11162321269512177, -0.32046204805374146, -0.47710853815078735, -0.36074429750442505, 0.595727801322937, -0.17373228073120117, 0.31590276956...
appreciated!) * Using another API or piece of software I have not considered. Configure a *udev* rule to *chgrp* the new device to *nobody*, if it is acceptable that every access via the web interface be permitted the same access to the device. Here's what I put in my *eee-bpw* package in file */etc/udev/rules.d/99-bpw...
[ 0.37387824058532715, -0.010548895224928856, 0.572533130645752, -0.06652137637138367, 0.3814501166343689, -0.5395026803016663, 0.03770316392183304, -0.25960731506347656, -0.3102158010005951, -0.31967899203300476, -0.12386142462491989, 0.8728728294372559, -0.09531384706497192, -0.33488667011...
I'm using **Delphi 2009** not that it has a large affect on what I'm doing. I think I would run into the same if I was still on **2007**. I have a scsi call that outputs data to a pointer (wrong way of looking at it but i have trouble explaining that). Originally I used **Move** to populate a **Static Array of Byte**...
[ 0.011434161104261875, 0.07271138578653336, 0.671101450920105, -0.20353201031684875, -0.13785183429718018, 0.033183179795742035, 0.04129568114876747, 0.25497955083847046, -0.5406413078308105, -0.8342131972312927, 0.1086203083395958, 0.39212676882743835, -0.2695556581020355, 0.10267009586095...
but have mad access violations others have no errors but get invalid data. Adding **setlength** to the array and then using **move**, causes first to have an empty array of set length and then second not be able to access the data via like **OutputData[0]** like I did when it was static, in the debugger after the move...
[ 0.20995202660560608, -0.02721245028078556, 0.11961062252521515, 0.1497182697057724, -0.0601181834936142, -0.17170199751853943, 0.538847029209137, -0.382828950881958, -0.2894468903541565, -0.5078523755073547, 0.17267847061157227, 0.7412249445915222, -0.5358054041862488, 0.15759865939617157,...
byte; I: Integer; begin GetMem(Output, OutputLength.Value); if SendPSPQuery(Char(DriveLetter[1]), cbxQuery.Items.IndexOf(cbxQuery.Text), Output, OutputLength.Value) = 0 then begin OutputData := @Output; for I := 0 to OutputLength.Value - 1 do begin edtString.Text := edtString.Text + Char(OutputDat...
[ -0.16139905154705048, -0.029047667980194092, 0.5502307415008545, -0.06044289842247963, 0.0471390001475811, 0.2184923142194748, 0.36381253600120544, -0.22387966513633728, -0.3682304918766022, -0.5781716704368591, -0.09670975059270859, 0.7187179327011108, -0.18665072321891785, 0.160659283399...
[the `Move` procedure](http://www.delphibasics.co.uk/RTL.asp?Name=Move), you need to pass the *first element* of the array. For example: ``` var Source: Pointer; SourceSize: Integer; Destination: array of Byte; SetLength(Destination, SourceSize); Move(Source^, Destination[0], SourceSize); ``` Notice also that...
[ -0.2072843462228775, -0.1184525415301323, 0.5190799832344055, -0.3030793070793152, -0.11065684258937836, -0.1962026059627533, -0.11263467371463776, -0.03209289163351059, -0.3785804808139801, -0.4639761447906494, -0.21427908539772034, 0.34785953164100647, -0.31280601024627686, -0.0067118331...
4, which is when dynamic arrays were introduced. And `Move` has had the same strange [untyped parameter](http://www.cs.wisc.edu/~rkennedy/untyped) syntax forever. --- Do not allocate your own memory with `GetMem` and then type-cast to make the compiler think that what you have is a dynamic array. **It's not**. Dynami...
[ -0.059088390320539474, -0.2259385585784912, 0.335410475730896, 0.0572563037276268, -0.18577030301094055, -0.21681693196296692, 0.3058137595653534, -0.2523031532764435, -0.737646222114563, -0.14092691242694855, -0.3304271697998047, 0.3254735469818115, -0.3993881642818451, 0.2935637533664703...
data directly into a dynamic array. Here's some code to do it: ``` var Output: array of Byte; SetLength(Output, OutputLength.Value); if SendPSPQuery(Char(DriveLetter[1]), cbxQuery.Items.IndexOf(cbxQuery.Text), @Output[0], OutputLength.Value) = 0 then ``` No need to ...
[ -0.088443823158741, -0.09949800372123718, 0.5145893096923828, -0.12066993117332458, 0.034162845462560654, 0.0973130315542221, 0.20423074066638947, -0.25876814126968384, -0.32700029015541077, -0.24459810554981232, -0.2827482223510742, 0.4284606873989105, -0.45116275548934937, 0.156105056405...