text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
<a href="<?php echo $offer1link ?>" target="blank"><img src="<?php echo $offer1logo ?>" alt="<?php echo $offer1name ?>"></a></div> <div class="box_rating"> Rating:<span class="star_rating"><img src="<?php echo $offer1star1 ?>" alt=""></span><br> ...
[ -0.15484650433063507, 0.16522827744483948, 0.39018714427948, -0.5374503135681152, -0.4018417298793793, 0.26942136883735657, 0.4079008102416992, -0.8364525437355042, -0.1744394302368164, -0.4085516333580017, -0.18898944556713104, 0.3459063172340393, -0.04279867932200432, -0.0738898664712905...
class="rating_review"><a href="<?php echo $offer1link ?>" target="blank">Go to Site</a> | <a href="<?php echo $offer1anchor ?>">Review</a></div> </div> <br style="clear: both;"> </div> ``` Oh and thanks in advance for any help you can give. Anyone...
[ 0.10505634546279907, 0.05911313742399216, 0.05530337989330292, -0.05367913097143173, 0.0009369092877022922, -0.13013677299022675, 0.27542757987976074, -0.328127920627594, -0.024946866557002068, -0.613297700881958, -0.2857228219509125, 0.3565128445625305, 0.07628293335437775, 0.170570120215...
helps me is the greatest. I feel bad cause sometimes two people answer the question and I can't give the green check to both. The type of include you are trying to do is blocked by default, not to say that it is dangerous. You are trying to include a remote file. If your script is in the same machine as the "values.p...
[ 0.006654092110693455, 0.07713823765516281, 0.3112582564353943, 0.18911708891391754, 0.15878476202487946, -0.09898102283477783, 0.7410268187522888, -0.12621992826461792, -0.1120900809764862, -0.6223418712615967, 0.16138732433319092, 0.7785496711730957, 0.13080179691314697, -0.07361900061368...
you still want to include a remote file you must set the following directives in your php.ini ``` allow_url_fopen = 1 allow_url_include = 1 ```
[ 0.44371497631073, 0.1079598069190979, 0.5443086624145508, -0.11795888096094131, 0.43884772062301636, -0.4278394281864166, 0.25566837191581726, -0.181830033659935, -0.05134199932217598, -0.3897697627544403, -0.18630892038345337, 0.4293345510959625, -0.35553398728370667, 0.011176908388733864...
While I see the relevance of "web" in the phrase "web stack," I'm left wondering what "stack" refers to in this context. It refers to the components or technologies/languages/operating sytems/etc used to build a web site. For instance the "LAMP" stack is: Linux, Apache, MySQL, PHP
[ 0.6660482287406921, 0.13116341829299927, 0.3388655185699463, 0.31976935267448425, 0.07109335064888, -0.4175926446914673, -0.24277305603027344, 0.003183938330039382, -0.4715445935726166, -0.24657447636127472, -0.16297246515750885, 0.20298150181770325, -0.29857537150382996, 0.192272230982780...
I am looking for a way to position a div (it would be a pop-up that would be activated by a user hovering and/or clicking much like lightbox) over an a split iframe where the top iframe is content from my server and the bottom iframe is content from another server. Like this: ``` ------------------------------------...
[ 0.48285824060440063, -0.04861614480614662, 0.5150556564331055, -0.08861012756824493, -0.11934681236743927, -0.24497993290424347, -0.2515091300010681, 0.2426776885986328, -0.057064998894929886, -0.689873218536377, -0.03548717498779297, 0.017033729702234268, -0.34637001156806946, 0.423863679...
Upper | | | | ------------------- | | |
[ -0.9343825578689575, 0.0696253776550293, 0.47951874136924744, 0.22394967079162598, 0.07052265107631683, 0.5596283674240112, 0.3793635964393616, -0.3051210045814514, -0.02655106969177723, -0.8335518836975098, -0.37859728932380676, 0.18801939487457275, -0.024585610255599022, -0.2436525970697...
DIV | | --------- -------| | | | | | -------------------- |
[ -0.32478058338165283, -0.07508827745914459, 0.568110466003418, -0.13612933456897736, 0.10200634598731995, 0.14257916808128357, -0.014204604551196098, -0.26842203736305237, 0.19638386368751526, -0.4334952235221863, -0.30776792764663696, 0.45669570565223694, -0.15585404634475708, 0.210613355...
| | | Lower | |
[ -0.523348867893219, 0.4186853766441345, 0.3100455105304718, -0.3594142198562622, 0.059588927775621414, 0.137114480137825, 0.5229100584983826, -0.18622304499149323, -0.058309558779001236, -0.47666946053504944, -0.16392040252685547, 0.2572655975818634, -0.15573158860206604, -0.09050478786230...
| ---------------------------------------- ``` Basically it looks like a box that is split horizontally between the top (upper) and bottom (lower; the external content) and a DIV that hovers over the two so there is overlap on both the top and the bottom. By the way, I also posted another question re: ajax versus i...
[ 0.3045412003993988, 0.24514858424663544, -0.024218088015913963, 0.20478108525276184, -0.25604701042175293, -0.16249026358127594, -0.0391094945371151, 0.10571835935115814, -0.09733960777521133, -0.6713519096374512, 0.22255539894104004, 0.3146962821483612, -0.02734505385160446, -0.2314687371...
you are asking for. I would try to avoid z-index as much as possible because once you head down that road you are committed to it in ways that may become painful. (Just so you know I tested this in Firefox 3 and IE 6). Here is the code - I have two rules for the #pop div, the first is purely the presentation, the sec...
[ 0.591463029384613, -0.10913874953985214, 0.7246692180633545, 0.026615550741553307, -0.08640437573194504, -0.10590743273496628, -0.18137043714523315, -0.49929335713386536, -0.07225999236106873, -0.5444959998130798, -0.16798478364944458, 0.7980996966362, -0.20474477112293243, -0.249129340052...
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <style type="text/css"> iframe { width:500px; height:200px; } #pop { width:400px; height:300px; background:#ff9; } #pop { position:absolute; top:50px; left:50px; } </style> </head> <body> ...
[ -0.007916687987744808, -0.35914769768714905, 1.002566933631897, 0.02962338738143444, -0.29295095801353455, 0.24495214223861694, 0.05969513952732086, -0.264736533164978, -0.19957534968852997, -0.4665437340736389, -0.3335876166820526, 0.3044041097164154, -0.12329471111297607, -0.079765625298...
<div> <iframe src="content.html"></iframe> </div> <div> <iframe src="http://www.google.com"></iframe> </div> </body> </html> ```
[ 0.2930885851383209, -0.036705516278743744, 0.7142235040664673, -0.044262249022722244, -0.37050172686576843, 0.05314479023218155, -0.005793104879558086, -0.18912047147750854, -0.13065770268440247, -0.7161489129066467, -0.23375216126441956, 0.20338179171085358, -0.06496784090995789, 0.010717...
Any suggestion to detect flaws in VB6 components running under IIS. IIS becomes unstable and after some time enter in a state of hang. The problems occur in the most part only in the production environment. We have many modules running. Probably there are components with bugs and need to identify them. Thanks in advanc...
[ 0.17484399676322937, -0.21132661402225494, 0.2974432706832886, 0.058952171355485916, -0.10018865019083023, -0.25458741188049316, 0.07991836965084076, -0.5346802473068237, -0.4273681342601776, -0.42031073570251465, -0.13888265192508698, 0.22320100665092468, -0.18064995110034943, -0.02219684...
At my personal website while viewing a single post, i have an overview DIV, and in FF it has no space between the main header and the excerpt, but in IE there is a space there. Any idea on how I can get rid of that? I have FireBug for FF and i installed IE Developer Toolbar on my other PC to try to inspect the code to...
[ 0.18725723028182983, -0.055360227823257446, 0.5749973058700562, -0.1324528604745865, -0.3125607967376709, -0.05694282427430153, 0.2731513977050781, 0.3367358148097992, -0.17799696326255798, -0.5495581030845642, 0.14869247376918793, 0.37149515748023987, -0.1102345809340477, -0.1856680959463...
it to 90% and you see it will go to the top. edit: if you change the width ofthe container of the calendar DEC 19th thing to 80 from 88 it should look better here's what i see in the IE Developer Toolbar <http://imagebin.antiyes.com/451>
[ 0.4278789758682251, -0.33613625168800354, 0.37990036606788635, -0.12565644085407257, -0.39033976197242737, 0.1788441687822342, 0.27236294746398926, -0.11454795300960541, -0.27565306425094604, -0.6712751388549805, 0.31259578466415405, 0.3158116638660431, -0.04983295500278473, -0.24100366234...
I'm trying to run the following commands: ``` replace -x "must " A2input.txt replace -x " a" -f -s ## A2input.txt replace -x to -s ## -a A2input.txt replace -x faith -f "unequivocal" A2input.txt ``` And it'd be nice if I could just alias it to something short and simple like "a", "b", "c", "d", etc... However, some...
[ 0.5237528085708618, 0.29586857557296753, 0.2329038381576538, -0.33582207560539246, 0.02060686983168125, -0.006887686904519796, 0.7371190190315247, -0.13327541947364807, 0.12289325892925262, -0.5127441883087158, 0.03345789015293121, 0.805968165397644, -0.45416831970214844, 0.015157115645706...
double quote in a variable with the string surrounded by single quotes. When I use the variable I up inside single quotes. Example: ``` [11:~] phi% [11:~] phi% set text = 'a quote "' [11:~] phi% alias ec echo '$text' [11:~] phi% ec a quote " [11:~] phi% [11:~] phi% alias ec echo this has '$text' [11:~] phi% ec ...
[ 0.47406241297721863, -0.14248836040496826, 0.26893025636672974, -0.155704066157341, -0.11815725266933441, -0.03655736893415451, 0.3268285095691681, -0.5428342223167419, 0.006777079775929451, -0.11365190893411636, -0.02206498011946678, 0.7114062309265137, -0.7512965798377991, -0.29158973693...
I'm developing a web app in Perl with some C as necessary for some heavy duty number crunching. The main problem I'm having so far is trying to decide if I should use mod-perl, mod-fastcgi or both to run my scripts because I'm having a difficult time trying to analyze the pros and cons of each mod. Can anyone post a s...
[ 0.26181507110595703, -0.263221800327301, 0.24765698611736298, 0.2123088240623474, -0.25889483094215393, -0.26616978645324707, 0.13601648807525635, 0.13060326874256134, -0.2953868508338928, -0.5939124822616577, -0.1718243807554245, 0.7025768756866455, -0.4740893542766571, -0.236047402024269...
knobs to control how many processes will it run simutaneously and not much more. mod\_perl, on the other hand is a platform for development of applications that exposes most Apache internals to you so you can tweak every webserver knob from your code, accelerates CGIs, and [much more](http://perl.apache.org/start/inde...
[ 0.1249842420220375, -0.03178701922297478, 0.590219259262085, 0.3753297030925751, -0.35586073994636536, -0.0865597128868103, 0.0764208734035492, -0.3944284915924072, -0.3612460196018219, -0.4802480936050415, 0.3159851133823395, 0.5056750774383545, -0.20537929236888885, 0.1548178344964981, ...
platform, probably mod\_perl. But probably the sanest option is to run everywhere and use a framework to build the application that'll take care of using the advantages of a particular way of executing if present, like [Catalyst](http://catalystframework.org/).
[ 0.4142366051673889, -0.10679683834314346, 0.09467616677284241, 0.23453114926815033, -0.12474071979522705, -0.17797602713108063, 0.14539015293121338, 0.09256605803966522, -0.2998894155025482, -0.6034342646598816, 0.21506018936634064, 0.25286027789115906, -0.3086838126182556, -0.083705224096...
I need to create a wpf treeviewlist to look something like this: ``` AAAA BBBB ....CCCC ....DDDD .......EEEE FFFFF ``` (where the dots above are indents) I need to do this from vb.net (2008) code. I've spent an embarrassingly long amount of time trying to figure this out, and so far all I’ve got is: vb.net: ...
[ 0.3999282121658325, -0.024844279512763023, 0.7997684478759766, 0.008903691545128822, -0.11293063312768936, 0.053149137645959854, 0.10241846740245819, -0.31717348098754883, -0.3302624821662903, -0.6665902137756348, -0.20278756320476532, 0.4558955132961273, -0.13877534866333008, 0.2682876586...
new TreeViewItem(); parent.Header = "Hey"; child.Header = "There!"; parent.Items.Add(child); treeView1.Items.Add(parent); ```
[ -0.04309035465121269, 0.07236441224813461, 0.4177796542644501, -0.19327208399772644, -0.046278804540634155, 0.015759356319904327, 0.49271875619888306, 0.07688426971435547, -0.4420045018196106, -0.6300708055496216, -0.6720519661903381, 0.0664047822356224, -0.1024593636393547, 0.391464948654...
Is there some command line or AppleScript that I can write/run to make the machine go to sleep automatically or even better, into hibernate mode? I can run the program as root. ``` osascript -e 'tell application "Finder" to sleep' ```
[ 0.18386219441890717, 0.22700180113315582, 0.18809078633785248, -0.1951022893190384, 0.4175851047039032, -0.07441112399101257, 0.2574162185192108, 0.16077403724193573, -0.056506767868995667, -0.5914537906646729, -0.14997772872447968, 0.6329871416091919, -0.171194389462471, -0.06374252587556...
Does GWT has LazyPanel .I can not see it .Please let me know .If it got lazyPanel ,please lemme know version I agree with [rustyshelf](https://stackoverflow.com/questions/383032/gwt-lazy-loading#383188) on the principle of Google search, but since StackOverflow is also a reference in itself, here is a more detailed ans...
[ 0.27270179986953735, -0.021677648648619652, 0.16596467792987823, 0.05820874497294426, -0.35483404994010925, -0.010326085612177849, -0.012007300741970539, -0.035341620445251465, -0.34240543842315674, -0.5643470883369446, -0.11178077757358551, 0.46068352460861206, -0.29224899411201477, -0.10...
contents can significantly improve user experience. --- > [Using the LazyPanel is simple](http://googlewebtoolkit.blogspot.com/2008/11/improving-performance-with-on-demand.html). All you need to do is add the widget that you want to lazily load in the lazy panel, and then call setVisible(true) on the lazy panel to ac...
[ 0.025171758607029915, -0.21242515742778778, 0.4433850347995758, 0.12861593067646027, -0.3331846296787262, -0.2693920135498047, -0.0863894373178482, 0.33494412899017334, -0.34122157096862793, -0.8150296211242676, -0.18871209025382996, 0.5897713899612427, -0.08794236928224564, -0.20617674291...
Background ========== In Visual Studio 2008 Create a new Windows Forms Application, this will create a skeleton project with a class called "Form1". VS2008 automatically creates a Dispose() method. ``` /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true...
[ 0.40060609579086304, -0.07587930560112, 0.04728894308209419, -0.12468615919351578, -0.02673090063035488, -0.0004959728103131056, 0.29270419478416443, -0.6709907054901123, -0.4842563569545746, -0.5232137441635132, -0.18747462332248688, 0.35511648654937744, -0.3821094036102295, 0.04807312786...
components.Dispose(); } base.Dispose(disposing); } ``` I wandered into a coworker's office (a senior developer) - great guy, smart, good design skills for a chat - but I noticed what he was typing - as he navigated the codebase he deleted this section of the Dispose() methods that VS2008 created f...
[ 0.5727527737617493, 0.16141794621944427, -0.03517531231045723, -0.005100301466882229, 0.18095143139362335, -0.20474715530872345, 0.26328539848327637, -0.5828900933265686, 0.04540490359067917, -0.5682552456855774, -0.0002629252558108419, 0.5765537023544312, -0.8320711255073547, 0.2065581977...
components.Dispose(); } ``` So, I asked him why and he said it wasn't necessary to keep it in. The Questions ============= * Is it safe to delete this code? * What are the pros/cons of leaving it in or removing it? **Absolutely don't delete it** if there is the slightest chance of you ever using something l...
[ 0.5093557834625244, 0.2770666778087616, 0.19921822845935822, 0.005248770117759705, 0.30739760398864746, -0.5619012713432312, 0.14443717896938324, -0.1636286973953247, -0.15526847541332245, -0.6606450080871582, -0.22352075576782227, 0.8618016839027405, -0.5167759656906128, 0.600719690322876...
several bits of code which have had this type of bug introduced (pre .NET 2.0 this mechanism didn't work so well), and the resulting intermittent perf problems caused by timers running long after the forms they should update have closed can be a real pain. There is no realistic benefit to deleting this - if no control...
[ 0.422820121049881, -0.043315548449754715, 0.1579294502735138, 0.11828088760375977, 0.12416177988052368, -0.420999139547348, 0.3691962957382202, 0.002390204928815365, -0.31033584475517273, -0.65101557970047, -0.021970201283693314, 0.37496715784072876, -0.5025736689567566, 0.3307730555534363...
I am using Jruby and rails 2.2.2. My problem is I have a migration that is not being correctly written to the database schema. Here is my migration: ``` class CreateNotes < ActiveRecord::Migration def self.up create_table(:notes, :options => 'ENGINE=MyISAM') do |t| t.string :title t.text :body ...
[ -0.09648478031158447, 0.1847696304321289, 0.6614938974380493, -0.16660501062870026, 0.09129147231578827, -0.13038678467273712, 0.3456486463546753, -0.36764973402023315, -0.04665670543909073, -1.0456541776657104, 0.02451060153543949, 0.43673932552337646, -0.29550614953041077, 0.126328930258...
"body" t.datetime "created_at" t.datetime "updated_at" end add_index "notes", ["title", "body"], :name => "title" ``` I have two question: * How do I get `'ENGINE=MyISAM'` into the schema? * Why did my execute statement become `add_index "notes", ["title", "body"], :name => "title"`? and how do I force migratio...
[ 0.2672521471977234, 0.08745994418859482, 0.28832799196243286, -0.008236582390964031, 0.11803247034549713, -0.011462356895208359, 0.35748377442359924, -0.37861645221710205, -0.2736443877220154, -0.7120046019554138, -0.2506623864173889, 0.30181851983070374, -0.36873582005500793, -0.201920703...
anybody tell me what I am doing wrong? As I use foreign key constraints, I use the SQL format for migrations. In *environment.rb*: ``` # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you ha...
[ 0.8669689893722534, 0.5159416198730469, -0.07274472713470459, 0.09267556667327881, 0.10644969344139099, -0.18927261233329773, 0.4527471363544464, -0.0373954251408577, 0.008060247637331486, -0.400958776473999, 0.2287447303533554, 0.5221540331840515, -0.22710615396499634, 0.1642478108406067,...
When testing in any language, how does everybody **phrase their assertion messages**? I see three obvious ways: ``` # assume failure assert (4-2) == 2, "Subtracting 2 from 4 doesn't equal 2" # describe success assert (4-2) == 2, "Subtracting 2 from 4 should equal 2" # be vauge with failure assert (4-2) == 2, "Subtr...
[ 0.3560570776462555, 0.2013159543275833, -0.2237982153892517, 0.0112887192517519, -0.5282840728759766, -0.32060638070106506, 0.7391607165336609, -0.2904330790042877, 0.3505209982395172, -0.3295009434223175, -0.04057936742901802, 0.9091029763221741, 0.14513999223709106, -0.08326547592878342,...
code just outputs ``` Assert Failed: (4-2)==2 : Line 123, File foo.c ``` If you're lucky, you can get a stack dump as well...
[ 0.14908014237880707, 0.22756427526474, 0.035528287291526794, -0.09396239370107651, 0.34452807903289795, -0.03822565823793411, 0.5033750534057617, -0.3134012818336487, -0.11890054494142532, -0.2253684252500534, -0.22199250757694244, 0.7220277786254883, -0.14046452939510345, 0.01454675756394...
Do you know of any examples of MooTools and ASP.NET MVC? See this quick [demo](http://pastebin.me/494ce61eb12fa) here, the key lies to the modal being absolute over the top of the opaque background. The demo dynamically adds the background overlay div and the modal div to the body but you could define these in the html...
[ 0.29825741052627563, -0.2975299060344696, 0.6091545820236206, 0.01522019412368536, -0.056487105786800385, -0.10899824649095535, 0.19173762202262878, -0.13252335786819458, -0.1899729073047638, -0.6578888297080994, -0.2573930025100708, 0.9204012751579285, -0.21222838759422302, -0.34280109405...
in two lines rather than 3 - and without a plugin!! Also it is far easier to define css classes and add these rather than add inline styles to an element in script. Easier to maintain.
[ 0.322928249835968, -0.04509156197309494, 0.2061050832271576, 0.09374868124723434, -0.3673630654811859, -0.013294285163283348, 0.3603483736515045, -0.09222108125686646, -0.10434967279434204, -0.8793748617172241, -0.27889588475227356, 0.21770888566970825, -0.181589275598526, -0.3264943957328...
Is it legal to write instant message software that implements MSN Messener, Yahoo! Messener, or AIM protocols and receive money for it through ads? Stackoverflow is not a layer; Stackoverflow is not your laywer; only your lawyer may provide legal advice. Do not ask Stackoverflow for legal advice. A lot of people do it...
[ 0.4628584086894989, 0.16705507040023804, 0.22911864519119263, 0.06240366771817207, 0.17490464448928833, -0.46401938796043396, 0.17340150475502014, 0.018039708957076073, -0.4189031720161438, -0.36793187260627747, -0.07691331207752228, 0.08148100227117538, -0.2858589291572571, -0.04537473991...
I have build a WPF application where users can drag and drop MP3 files onto a listbox. I need a way to calculate the total duration of the playlist. Any libraries I should use? Or is it possible using only the .NET framework? After lots of theorizing, I found a way to correctly and indisputably calculate a duration of...
[ 0.4926232695579529, -0.2602503001689911, 0.2577723264694214, 0.13508178293704987, -0.14455974102020264, -0.41088616847991943, 0.22684776782989502, -0.5765022039413452, -0.5029895901679993, -0.5272618532180786, 0.2493448704481125, 0.6069241762161255, -0.19376683235168457, -0.075159817934036...
for VBR files. Xing header: not all files have it. Decoding and determining it via PCM size: I have 3+ GB file, I'm not going to wait until it decodes. I read everywhere and all things lead to NAudio. Mark, THANKS for the good effort and clean source! However, a method that is mostly suggested with NAudio is to read...
[ 0.5095431208610535, -0.016949530690908432, 0.38719457387924194, -0.05728926137089729, -0.2015146017074585, -0.36685988306999207, 0.35227200388908386, -0.24228321015834808, -0.2157449722290039, -0.6281765699386597, -0.022235384210944176, 0.6404294371604919, -0.3555397689342499, 0.1748931556...
I found much simpler method. Here it is; is speaks for itself: ``` double GetMediaDuration(string MediaFilename) { double duration = 0.0; using (FileStream fs = File.OpenRead(MediaFilename)) { Mp3Frame frame = Mp3Frame.LoadFromStream(fs); if (frame != null) ...
[ 0.26881691813468933, -0.49688026309013367, 0.7911537885665894, -0.2647128701210022, 0.01647619903087616, -0.12743589282035828, 0.3354748487472534, -0.35169562697410583, -0.28186771273612976, -0.3817121982574463, -0.23101796209812164, 0.8812773823738098, -0.31297582387924194, 0.242941141128...
_sampleFrequency = (uint)frame.SampleRate; } while (frame != null) { if (frame.ChannelMode == ChannelMode.Mono) {
[ 0.4658799469470978, -0.3803074359893799, 0.20833687484264374, -0.00020891372696496546, 0.16252893209457397, -0.016317283734679222, 0.425057977437973, -0.62333083152771, -0.3275923430919647, -0.2965623438358307, -0.06833688914775848, 0.43918147683143616, -0.40041854977607727, 0.302150696516...
duration += (double)frame.SampleCount * 2.0 / (double)frame.SampleRate; } else { duration += (double)frame.SampleCount * 4.0 / (double)frame.SampleRate;
[ 0.5208861231803894, -0.4416050910949707, -0.1609228402376175, -0.16129253804683685, -0.05215105786919594, 0.12389236688613892, 0.34437206387519836, -0.6635850071907043, -0.3266541361808777, -0.02021758258342743, -0.05549372732639313, 0.3692002296447754, -0.2470543384552002, -0.095539309084...
} frame = Mp3Frame.LoadFromStream(fs); } } return duration; } ```
[ 0.13106048107147217, -0.41803380846977234, 0.3167269825935364, -0.2621156871318817, -0.07042013853788376, 0.009785624220967293, 0.3916487693786621, -0.15384919941425323, -0.3962055742740631, -0.4550636112689972, -0.15780776739120483, 0.7057992815971375, -0.2519344687461853, 0.3708271682262...
The ECMA standard defines a hidden, internal property `[[Call]]`, which, if implemented, mean the object is callable / is a function. In Python, something similar takes place, except that you can override it yourself to create your own callable objects: ``` >>> class B: ... def __call__(self, x,y): print x,y ... ...
[ 0.07807726413011551, 0.062143776565790176, 0.14728960394859314, -0.27364981174468994, 0.013030287809669971, -0.19893768429756165, 0.1565784215927124, -0.19976197183132172, -0.18678918480873108, -0.22778470814228058, -0.4610276520252228, 0.5687776803970337, -0.6013371348381042, 0.0057579339...
way I know is to define a function. However, since functions is first class citizens you can add properties to them: ``` function myfunc(){ var myself = arguments.callee; myself.anotherfunc(); } myfunc.avalue=5; myfunc.anotherfunc=function(){ alert(this.avalue); } myfunc(); //Alerts 5 myfunc.anotherfunc(); /...
[ 0.6066675186157227, 0.0031909488607198, 0.7078003883361816, -0.38028934597969055, 0.6329911351203918, -0.15914709866046906, 0.41788944602012634, -0.42957234382629395, 0.23434065282344818, -0.6242146492004395, -0.11035722494125366, 0.5356929898262024, -0.2992614805698395, 0.4563878476619720...
I am implementing a list, and I am wondering about the definition of the IndexOutOfRange. Which one of the following do you think is better? ``` /// <exception cref="IndexOutOfRangeException">if index is less than 0 /// or greater than <see cref="Count"/> public T this[int index] { get { return myArray[index]; } } ``...
[ 0.26282423734664917, -0.045336198061704636, 0.1879829615354538, -0.14915867149829865, -0.21060127019882202, -0.15177081525325775, 0.22148720920085907, -0.28901273012161255, -0.2053786963224411, -0.7305503487586975, 0.03926007077097893, 0.6036345958709717, -0.5496518611907959, -0.0012938900...
topic, but is the second version better than the first by any means? **Slightly OT:** can you encapsulate a list rather than an array, and then everything falls out in the wash since the encapsulated list will generate appropriate exceptions? **Edit:** if you really need the array internally, how about *wrapping it in...
[ 0.2558536231517792, -0.12132864445447922, 0.49376368522644043, 0.18820030987262726, -0.47376787662506104, -0.22254863381385803, 0.1798723191022873, -0.1263275444507599, -0.4618981182575226, -0.5469362735748291, -0.1137736514210701, 0.6485894918441772, -0.14783257246017456, -0.1132268235087...
since it implements the list interface. **Edit again:** actually, *is this a problem at all??* People access your array through the accessor, which is written in a language that you control and so know where array indexing starts from. Even if you call your (say) C# class from a VB.Net caller, the accessor will still...
[ 0.1788407862186432, -0.07542067021131516, 0.2641107141971588, 0.03214428946375847, -0.17738883197307587, -0.12107145041227341, 0.200100839138031, 0.01514347642660141, -0.4715118408203125, -0.5331165194511414, -0.03465177118778229, 0.5856717228889465, -0.2887814939022064, 0.0099532296881079...
I am using xcode 2.4.1 on tiger. When i do below everything is ok. when i do ``` pthread_mutex_t mute; ImageMan() { dibSize=0; mute = PTHREAD_MUTEX_INITIALIZER; } ``` I get these two errors ``` error: expected primary-expression before '{' token error: expected `;' before '{' token ``` I dont know why. H...
[ -0.073136106133461, 0.2199864685535431, 0.29888221621513367, -0.3965442180633545, -0.06473179906606674, 0.21070249378681183, 0.5608233213424683, -0.3071547746658325, -0.28621339797973633, -0.7467965483665466, -0.22259941697120667, 0.4769820272922516, -0.44013139605522156, -0.10769874602556...
integral type. Your `mute=mutex;` is invalid- instead you should use: ``` pthread_mutex_init(&mute, NULL); ``` or if you're allocating mutexes dynamically: ``` m = malloc(sizeof(pthread_mutex_t))); pthread_mutex_init(m, NULL); ```
[ -0.2288021296262741, -0.2631698548793793, 0.5796331167221069, -0.08480150252580643, 0.14000508189201355, 0.001541284378618002, 0.18595768511295319, -0.7708773612976074, -0.0371672585606575, -0.4300040006637573, -0.3869656026363373, 0.8556555509567261, -0.697066605091095, -0.133446455001831...
I've been learning the new ASP.NET MVC framwork lately and I've developed a test site for a friend who runs a "light café" in Sweden. The plan is to release it within a week or so after performing some final adjustments and fixing some security issues. Yesterday I published the site to a webhost running IIS 6, so the...
[ 0.37180662155151367, 0.24526648223400116, 0.5185888409614563, -0.3046775758266449, -0.09759148955345154, -0.3810441792011261, 0.2949275076389313, 0.09571582078933716, -0.41731998324394226, -0.567038357257843, -0.4288847744464874, 0.34522613883018494, -0.18682730197906494, 0.020464453846216...
well in IE7 but not in Firefox 3 and Safari. On the site I use a master page containing a "left content" with a menu. The menu consists of ActionLinks. The problem is that only the first (topmost) link works as a link, the others only look like links but they're unclickable. When I view the source everything looks goo...
[ 0.36648112535476685, 0.01724914088845253, 0.29578691720962524, -0.26443928480148315, -0.008098870515823364, -0.19553425908088684, 0.6243801116943359, 0.11280269175767899, -0.20087388157844543, -0.8151929378509521, -0.23355595767498016, 0.7998894453048706, -0.22706685960292816, -0.232092395...
div is being placed on top of the "links" div so they can't be clicked. Adding a: float: right; To the CSS for #main allows the links to be clicked.
[ 0.18010962009429932, -0.01952195167541504, 0.4835375249385834, -0.09729805588722229, -0.09018232673406601, -0.36330458521842957, 0.008780722506344318, 0.19573663175106049, -0.1387500911951065, -0.36690089106559753, -0.3846750855445862, 0.17550688982009888, -0.37674885988235474, 0.130228623...
I'm implementing saved data on my app by using NSUserDefaults, like this: ``` [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:0],@"mySetting",nil]]; // check int firstLaunch = [[NSUserDefaults standardUserDefaults] integerForKey:@"mySetting"]; ...
[ 0.029465533792972565, 0.2332247644662857, 0.62925785779953, -0.13946828246116638, 0.01447091344743967, 0.3498968183994293, 0.34537017345428467, -0.37110772728919983, -0.21719899773597717, -0.7281355261802673, -0.04420457035303116, 0.8096665740013123, -0.4141771197319031, -0.111128278076648...
that subsequent invocations of `-<type>ForKey:` will return the registered default.
[ -0.03333417326211929, -0.08581440150737762, 0.2411154806613922, -0.2869456112384796, 0.2743667960166931, 0.1782456785440445, 0.3234683871269226, 0.2175712138414383, 0.10540736466646194, -0.27306002378463745, -0.4700861871242523, 0.47605106234550476, -0.11620158702135086, 0.1749749481678009...
Part of the development team I work with has been given the challenge of writing a server for integration with our product. We have some low-level sensor devices that provide a C SDK, and we want to share them over a network for use by people collecting data. Sounds simple, right? Someone would connect a sensor device ...
[ 0.7899619936943054, 0.15120331943035126, 0.522578239440918, 0.2000453621149063, 0.21156221628189087, -0.16855134069919586, -0.1909341961145401, -0.27438589930534363, 0.08261270076036453, -0.43441811203956604, 0.2633071839809418, 0.2451489269733429, -0.3264431953430176, 0.006559955421835184...
simple, language-agnostic network protocol, and a reference implementation in Java. The problem is creating an implementation that will work with our devices that only provide an SDK written in C. We were thinking of doing the following: 1. Create polling threads that collect and store the most recent readings from ea...
[ 0.316204696893692, -0.30667644739151, 0.43310949206352234, 0.5105104446411133, -0.07861248403787613, -0.26472076773643494, -0.1131802573800087, -0.37767845392227173, 0.2665535509586334, -0.477009654045105, 0.3615560233592987, 0.42343220114707947, -0.5561733245849609, -0.2768518030643463, ...
to review, the general requirements are: * Runs on Windows XP/Vista, Linux, and OS X machines * Written in C or C++, to interact with the C SDK we have * Accepts a variable number of simultaneous connections (worker threads) * Must use threads, not forking (don't want to deal with another layer of IPC) Can anyone sug...
[ 0.4494393765926361, 0.13746504485607147, 0.20034554600715637, 0.10676199942827225, 0.00590931810438633, -0.3293800354003906, 0.0352880023419857, -0.11197264492511749, -0.0423152893781662, -0.6015930771827698, -0.0725102648139, 0.5122566223144531, -0.16199351847171783, -0.08654358237981796,...
In [another question](https://stackoverflow.com/questions/377716/javascript-automatic-gettersetters-john-resig-book), a user pointed out that the `new` keyword was dangerous to use and proposed a solution to object creation that did not use `new`. I didn't believe that was true, mostly because I've used [Prototype](htt...
[ 0.24639055132865906, 0.17085659503936768, 0.08630532771348953, 0.08138038963079453, -0.11577768623828888, -0.22803227603435516, 0.5819999575614929, -0.4081059992313385, -0.16208960115909576, -0.3318844437599182, 0.07255393266677856, 0.5710108280181885, -0.0701005831360817, 0.07000869512557...
`new` keyword? What are the advantages and disadvantages of using it? Crockford has done a lot to popularize good JavaScript techniques. His opinionated stance on key elements of the language have sparked many useful discussions. That said, there are far too many people that take each proclamation of "bad" or "harmful"...
[ 0.558872640132904, 0.3371303081512451, -0.052287325263023376, 0.028981361538171768, -0.22464874386787415, -0.2128133624792099, 0.25202256441116333, -0.48917990922927856, -0.018482448533177376, -0.581327497959137, -0.09690999984741211, 0.3970373570919037, -0.29622891545295715, 0.36260703206...
to class-based OO languages, JavaScript's native inheritance technique is a simple and surprisingly effective means of code re-use. And the `new` keyword is the canonical (and only available cross-platform) means of using it. 2. Performance. This is a side-effect of #1: if I want to add 10 methods to every object I cre...
[ 0.11642155796289444, -0.06352172046899796, -0.15775437653064728, 0.018149713054299355, -0.06964023411273956, -0.028880231082439423, 0.14607234299182892, -0.19569388031959534, -0.1376466006040573, -0.7633054852485657, -0.11381401866674423, 0.46072205901145935, -0.2989850342273712, -0.181411...
the prototype), it avoids ballooning each object with separate properties for each method. On slower machines (or especially, slower JS interpreters) when many objects are being created this can mean a significant savings in time and memory. And yes, `new` has one crucial disadvantage, ably described by other answers:...
[ 0.1132255271077156, 0.1488250195980072, -0.02626904286444187, 0.005810404196381569, 0.04286587983369827, -0.07787469774484634, 0.5766521692276001, -0.15322522819042206, -0.1299086958169937, -0.6005681753158569, -0.07471223920583725, 0.438716322183609, -0.2908230721950531, 0.258537560701370...
if ( !(this instanceof foo) ) return new foo(); // constructor logic follows... } ``` Now you can have the advantages of `new` without having to worry about problems caused by accidentally misuse. John Resig goes into detail on this technique in his [Simple "Class" Instantiation](http://ejohn.org/blog/simp...
[ 0.1313009411096573, -0.043898750096559525, -0.20774514973163605, -0.09310218691825867, -0.02058030106127262, -0.29610222578048706, 0.7636774778366089, -0.5004323720932007, -0.3435080051422119, -0.4979853332042694, -0.060287442058324814, 0.7912229895591736, -0.05851663649082184, 0.127194285...
enlightening for those of us who initially dismissed this much-maligned feature as a gimmick). A general-purpose sanity check ------------------------------ You could even add an assertion to the check if the thought of broken code silently working bothers you. Or, as [some](https://stackoverflow.com/users/36866/some...
[ 0.2582530081272125, 0.14849181473255157, 0.2801010310649872, 0.24659869074821472, -0.10167882591485977, -0.34855490922927856, 0.39179039001464844, -0.12881658971309662, -0.17859797179698944, -0.3421976864337921, -0.249776229262352, 0.5938472151756287, -0.13951560854911804, 0.08861255645751...
ES5 taketh away As [Sean McMillan](https://stackoverflow.com/questions/383402/is-javascripts-new-keyword-considered-harmful/383503?noredirect=1#comment7767833_383503), [stephenbez](https://stackoverflow.com/questions/383402/is-javascripts-new-keyword-considered-harmful/383503?noredirect=1#comment21565658_383503) and [...
[ 0.028107797726988792, 0.4537723660469055, 0.34301379323005676, -0.28189602494239807, -0.0008088474278338253, 0.12909337878227234, 0.5542387366294861, -0.3595542311668396, -0.2187032550573349, -0.165444478392601, -0.5586562156677246, 0.4285786747932434, -0.2724843919277191, 0.28126561641693...
// constructor logic that will ONLY be hit // if properly constructed via new } } // bad invocation foo(); // throws, // Uncaught TypeError: class constructors must be invoked with 'new' ``` But what if you don't *want* to use the new sugar? What if you just want to update your perfectly fine old-style prot...
[ 0.19959932565689087, 0.08774691075086594, -0.02953840047121048, -0.10799664258956909, -0.019284840673208237, -0.22026877105236053, 0.5100323557853699, -0.32323503494262695, -0.32785552740097046, -0.3932400345802307, -0.0732598826289177, 0.6269495487213135, -0.4330129623413086, -0.000364003...
throw new Error("Constructor called as a function"); // constructor logic follows... } ``` So whichever approach you choose, you can - with a bit of thought and good hygiene - use `new` without harm.
[ 0.25276613235473633, 0.3639247417449951, -0.23247314989566803, -0.046338845044374466, -0.14515694975852966, -0.06873825937509537, 0.3580859899520874, -0.18025586009025574, -0.07459530979394913, -0.7296574711799622, -0.06581520289182663, 0.7844803929328918, -0.11698895692825317, 0.110323809...
Have created a c++ implementation of the Hough transform for detecting lines in images. Found lines are represented using rho, theta, as described on wikipedia: > "The parameter r represents the distance between the line and the origin, while θ is the angle of the vector from the origin to this closest point " How ca...
[ -0.11039019376039505, 0.018332721665501595, 0.7813948392868042, -0.11328700929880142, -0.1639573723077774, 0.23160485923290253, -0.08398619294166565, -0.5771843791007996, 0.03669370710849762, -0.5367527604103088, 0.06079452484846115, 0.22077172994613647, -0.02280346304178238, 0.28945782780...
intersecting point x,y at a given angle) given the point and the angle (in radians) inline float point2Hough(int x, int y, float theta) { return((((float)x)*cosf(theta))+((float)y)*sinf(theta)); } //get point y for a line at angle theta with a distance from the pole of r intersecting x? bad explanation! >_< inline...
[ -0.40308400988578796, -0.13349424302577972, 0.8938074707984924, -0.2160748541355133, -0.14055776596069336, 0.3053930997848511, 0.32235392928123474, -0.4299798607826233, 0.1541908234357834, -0.5453486442565918, -0.20500624179840088, 0.27909040451049805, -0.3997062146663666, 0.30869722366333...
0?! } return(y); } ``` sorry in advance if this is something obvious.. Looking at the [Wikipedia page](http://en.wikipedia.org/wiki/Hough_transform), I see that the equation of a straight line corresponding to a given given r, θ pair is ``` r = x cosθ + y sinθ ``` Thus, if I understand, given two pairs r1,...
[ -0.34833839535713196, -0.1699456423521042, 0.3960830867290497, -0.25823742151260376, -0.21563248336315155, 0.21055984497070312, 0.2202712595462799, -0.514541506767273, 0.026511982083320618, -0.3302459716796875, -0.07627929002046585, 0.36487212777137756, -0.47905734181404114, 0.309357911348...
b = |r1| X = |x| [cos θ2 sin θ2] |r2| |y| ```
[ -0.18990062177181244, 0.43466246128082275, 0.10092808306217194, -0.4284561276435852, -0.36876505613327026, -0.020609233528375626, 0.24126523733139038, -0.5170691609382629, 0.2138839215040207, -0.03594040125608444, -0.439872145652771, 0.5517750978469849, -0.46578022837638855, 0.063263468444...
I have a Perl hash whose keys start with, or are, numbers. If I use, ``` foreach my $key (sort keys %hash) { print $hash{$key} . "\n"; } ``` the list might come out as, ``` 0 0001 1000 203 23 ``` Instead of ``` 0 0001 23 203 1000 ``` ``` foreach my $key (sort { $a <=> $b} keys %hash) { print $hash{$key...
[ -0.18899549543857574, 0.10089924186468124, 0.47541025280952454, -0.35463330149650574, -0.2641967833042145, 0.3535343408584595, -0.041657596826553345, -0.21988528966903687, -0.15148349106311798, -0.40161338448524475, 0.09098565578460693, 0.1867075115442276, -0.22953610122203827, 0.047840043...
Can any one tell the bit size of **boolean** in Java? It's virtual machine dependent.
[ 0.23685605823993683, 0.17987743020057678, -0.12269145250320435, 0.08610807359218597, -0.177052304148674, -0.1701604276895523, 0.11793670803308487, -0.046048104763031006, -0.2639569342136383, -0.47248104214668274, 0.002784158568829298, 0.3516187071800232, -0.0364108569920063, 0.042957849800...
The built-in `Math.Pow()` function in .NET raises a `double` base to a `double` exponent and returns a `double` result. What's the best way to do the same with integers? Added: It seems that one can just cast `Math.Pow()` result to (int), but will this always produce the correct number and no rounding errors? A prett...
[ 0.21882693469524384, -0.07494921237230301, 0.06628355383872986, -0.05091768875718117, 0.02814832516014576, 0.09140881896018982, 0.32863137125968933, -0.31723979115486145, -0.14916619658470154, -0.24876078963279724, -0.17759454250335693, 0.40298011898994446, -0.15448115766048431, -0.1826757...
ret *= x; x *= x; pow >>= 1; } return ret; } ``` Note that this does not allow negative powers. I'll leave that as an exercise to you. :) **Added:** Oh yes, almost forgot - also add overflow/underflow checking, or you might be in for a few nasty surprises down the road.
[ 0.19063633680343628, 0.005555191542953253, 0.45618391036987305, -0.044727224856615067, 0.08893033862113953, -0.23325230181217194, 0.6734955310821533, -0.2089376449584961, -0.1902439296245575, -0.56610506772995, -0.15053333342075348, 0.7316994071006775, -0.07804685086011887, 0.1386949867010...
I am working on a UNIX box, and trying to run an application, which gives some debug logs to the standard output. I have redirected this output to a log file, but now wish to get the lines where the error is being shown. My problem here is that a simple ``` cat output.log | grep FAIL ``` does not help out. As this ...
[ 0.28514477610588074, 0.407223641872406, 0.014796268194913864, -0.18840861320495605, 0.046944621950387955, -0.05331765487790108, 0.6470022201538086, 0.15972290933132172, -0.11549491435289383, -0.6900762319564819, 0.06088275462388992, 0.5720469951629639, -0.5108749270439148, 0.18383954465389...
to have a single command line (can have pipes) to do the above. grep -A $NUM This will print $NUM lines of trailing context after matches. -B $NUM prints leading context. > man grep is your best friend. So in your case: > cat log | grep -A 3 -B 3 FAIL
[ -0.2802370488643646, -0.19542400538921356, 0.17812636494636536, 0.047553014010190964, 0.1424149125814438, -0.04970657452940941, 0.9674163460731506, -0.22859197854995728, -0.3017333745956421, -0.3696320354938507, -0.283531129360199, 0.3100345730781555, -0.38327479362487793, -0.2108532637357...
I've got a "diagnostics" page in my ASP.NET application which does things like verify the database connection(s), display the current appSettings and ConnectionStrings, etc. A section of this page displays the Assembly versions of important types used throughout, but I could not figure out how to effectively show the v...
[ 0.5762162804603577, 0.15343300998210907, 0.0012487292988225818, 0.18206308782100677, -0.26744136214256287, -0.07183162122964859, 0.39510035514831543, 0.010018141940236092, -0.38936248421669006, -0.7208884954452515, 0.21588046848773956, 0.32347968220710754, -0.07572505623102188, -0.00659976...
extension method gets all referenced assemblies, recursively, including nested assemblies. As it uses `ReflectionOnlyLoad`, it loads the assemblies in a separate AppDomain, which has the advantage of not interfering with the JIT process. You'll notice that there is also a `MyGetMissingAssembliesRecursive`. You can us...
[ 0.1137314885854721, 0.06597182154655457, 0.37437212467193604, -0.1871638149023056, 0.009362228214740753, 0.003974436316639185, 0.22049705684185028, -0.22446297109127045, -0.5155684351921082, -0.49480098485946655, 0.00830523855984211, 0.17934395372867584, -0.4358891546726227, 0.232470899820...
if running in a multi /// threaded environment must use locks. /// </summary> public static class GetReferencedAssemblies { static void Demo() { var referencedAssemblies = Assembly.GetEntryAssembly().MyGetReferencedAssembliesRecursive(); var missingAssemblies = Assembly.GetEntryAssembly().My...
[ 0.3459377586841583, -0.004811064340174198, 0.008364618755877018, 0.06697790324687958, 0.523995041847229, 0.022508807480335236, 0.5954743027687073, -0.3044012784957886, -0.5116111636161804, -0.5666838884353638, -0.3636550307273865, 0.5692760348320007, -0.5227227807044983, 0.6583938002586365...
missingAssemblyNameParent) { MissingAssemblyName = missingAssemblyName; MissingAssemblyNameParent = missingAssemblyNameParent; } public string MissingAssemblyName { get; set; } public string MissingAssemblyNameParent { get; set; } } private static Dictio...
[ 0.45613622665405273, 0.11756359040737152, 0.12986411154270172, -0.3740375339984894, 0.3708677291870117, 0.3750987946987152, 0.5840429663658142, -0.27653244137763977, -0.23652705550193787, -0.12854446470737457, -0.18366704881191254, 0.7373878955841064, -0.4295564591884613, 0.752851665019989...
/// Intent: Get assemblies referenced by entry assembly. Not recursive. /// </summary> public static List<string> MyGetReferencedAssembliesFlat(this Type type) { var results = type.Assembly.GetReferencedAssemblies(); return results.Select(o => o.FullName).OrderBy(o => o).ToList(); } ...
[ 0.11226858198642731, 0.06650956720113754, 0.5097848773002625, -0.3122006952762604, 0.15727680921554565, 0.3428579270839691, 0.3977348506450653, -0.37954947352409363, -0.23311391472816467, -0.6687115430831909, -0.22230766713619232, 0.45302870869636536, -0.4208260178565979, 0.125152230262756...
{ _dependentAssemblyList = new Dictionary<string, Assembly>(); _missingAssemblyList = new List<MissingAssembly>(); InternalGetDependentAssembliesRecursive(assembly); // Only include assemblies that we wrote ourselves (ignore ones from GAC). var keysToRemove = _dependentAssembly...
[ 0.23689241707324982, -0.08280545473098755, 0.7436264157295227, -0.26915398240089417, 0.22278130054473877, 0.44895198941230774, 0.581513524055481, -0.4336346387863159, -0.27537575364112854, -0.33297136425971985, 0.269682377576828, 0.8459204435348511, -0.5213432312011719, 0.21638236939907074...
_dependentAssemblyList.Remove(k.FullName.MyToName()); } return _dependentAssemblyList; } /// <summary> /// Intent: Get missing assemblies. /// </summary> public static List<MissingAssembly> MyGetMissingAssembliesRecursive(this Assembly assembly) { _dependentAssembly...
[ 0.4672899544239044, -0.2346239984035492, 0.6617276668548584, -0.4057960510253906, 0.04197731614112854, 0.09489750117063522, 0.49495431780815125, -0.5896610021591187, -0.35529962182044983, -0.3467840254306793, 0.2272307574748993, 0.8050124645233154, -0.8643363118171692, 0.46793994307518005,...
return _missingAssemblyList; } /// <summary> /// Intent: Internal recursive class to get all dependent assemblies, and all dependent assemblies of /// dependent assemblies, etc. /// </summary> private static void InternalGetDependentAssembliesRecursive(Assembly assembly) { /...
[ 0.054268453270196915, 0.10212524980306625, 0.03040027990937233, -0.16688334941864014, 0.25269731879234314, 0.09447818249464035, 0.41611045598983765, -0.13782671093940735, -0.3714944124221802, -0.1776934117078781, -0.15235112607479095, 0.48598331212997437, -0.6217161417007446, 0.27148219943...
var referencedAssemblies = assembly.GetReferencedAssemblies() .OrderByDescending(o => o.Version); foreach (var r in referencedAssemblies) { if (String.IsNullOrEmpty(assembly.FullName)) { continue; }
[ -0.2223864644765854, -0.12348068505525589, 0.8528488278388977, -0.40859463810920715, 0.6151749491691589, 0.24526388943195343, 0.56772780418396, -0.3157329559326172, -0.22476567327976227, -0.4496080279350281, -0.3908959925174713, 0.5974524617195129, -0.4325682818889618, 0.5126767754554749, ...
if (_dependentAssemblyList.ContainsKey(r.FullName.MyToName()) == false) { try { var a = Assembly.ReflectionOnlyLoad(r.FullName); _dependentAssemblyList[a.FullName.MyToName()] = a;
[ 0.36057305335998535, -0.3254794478416443, 0.29686716198921204, -0.6863001585006714, 0.3620506823062897, 0.278169721364975, 0.8307610154151917, -0.6624575853347778, 0.12825517356395721, -0.20766906440258026, -0.12777726352214813, 0.7519545555114746, -0.5957727432250977, 0.34404003620147705,...
InternalGetDependentAssembliesRecursive(a); } catch (Exception ex) { _missingAssemblyList.Add(new MissingAssembly(r.FullName.Split(',')[0], assembly.FullName.MyToName()));
[ -0.20688635110855103, -0.011486755684018135, -0.03706106171011925, -0.2889382839202881, 0.4771372079849243, 0.1501750349998474, 0.6506847143173218, -0.13222867250442505, -0.21121597290039062, -0.34041836857795715, -0.28276845812797546, 0.414633572101593, -0.4708615243434906, 0.426350891590...
} } } } private static string MyToName(this string fullName) { return fullName.Split(',')[0]; } } ``` Update ====== To make this code thread safe, put a `lock` around it. It's not currently thread safe by default, as it references a shared static global variable to do its...
[ 0.08385250717401505, -0.0870981216430664, 0.34115973114967346, -0.15881676971912384, 0.43848440051078796, -0.26708295941352844, 0.31684035062789917, 0.026003016158938408, 0.02297959104180336, -0.4142915606498718, -0.12736473977565765, 0.38567110896110535, -0.23547494411468506, 0.7204755544...
What do you recommend for displaying URLs and handling views in Rails for cities, regions, countries? i.e: /us/ca/San-Fransisco /countries/us/regions/ca/cities/San-Fransisco Should be able to: List all countries, list all regions within country and list all cities within a region and country. Where would you put c...
[ -0.1864669919013977, -0.11396756768226624, 0.7481512427330017, 0.3492922782897949, -0.13756424188613892, 0.1187748834490776, 0.0943090170621872, 0.18424898386001587, -0.6188911199569702, -0.6955309510231018, -0.06953845173120499, 0.10908374190330505, -0.00901256687939167, 0.007106288336217...
GET /:country_code/regions # GET /regions def index @countries = if params[:country_code] Country.find_by_code(params[:country_code]).regions else Region.all # get all regions if country_code is not set end end end ```
[ -0.32774677872657776, -0.18065057694911957, 0.9977016448974609, 0.3984338939189911, 0.2520562708377838, -0.11159831285476685, 0.31198352575302124, -0.002820816356688738, -0.6042796969413757, -0.8429800868034363, -0.7209268808364868, -0.02489359676837921, -0.009056812152266502, 0.4536813795...
Are methods calls really so slow or is there something wrong in my computer? ``` static void Main(string[] args) { Stopwatch sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 10000000; i++) { double z = Math.Pow(i,2); } Console.WriteLine(sw.ElapsedMilliseconds); sw = Stopwatch.StartNew...
[ 0.13402414321899414, -0.3544704020023346, 0.9088292121887207, -0.1871781349182129, 0.17095082998275757, 0.36439383029937744, 0.30780503153800964, -0.3890094459056854, -0.2127816379070282, -0.6057600975036621, -0.12509578466415405, 0.49545252323150635, -0.2613745927810669, 0.237602218985557...
loop takes 1600 - 1700 milliseconds, while the second loop takes 3100 - 3200 milliseconds in my system (Celeron D 2.53 Ghz 512 MB RAM Windows XP SP3 .NET 3.5). It's a commandline project. I got similar results with VB.Net . EDIT: I think I found the answer. > 1723 13 Is that more like what you'd expect? Yes, that's w...
[ 0.20582231879234314, -0.07732872664928436, 0.13659632205963135, -0.11979815363883972, -0.2374185472726822, -0.019743673503398895, 0.7660239338874817, -0.5159242749214172, -0.20772168040275574, -0.5072974562644958, -0.14073871076107025, 0.3454446792602539, -0.16681338846683502, -0.177681937...
.net framework. EDIT: Thanks for the answers. Reinstalling the framework did not fix the problem. After testing with a virtual machine I got results that made sense. I finally found the problem: Some time ago I installed a profiler called ProfileSharp. I don't know what (or why) the profiler was doing without m...
[ 0.46885350346565247, -0.31464704871177673, 0.1968422681093216, 0.2018185704946518, -0.3388866186141968, -0.4447515606880188, 0.710976779460907, -0.10124281048774719, -0.1889335662126541, -0.8138765096664429, 0.07495059072971344, 0.6124440431594849, -0.5820726752281189, -0.07889773696660995...
profiling new processes" that it's enabled by default. When the profiler closes it's supposed to stop the profiling and indeed does in my tests with the virtual machine, but for some reason once it didn't and started profiling every .net process in the background (System, ASP and Microsoft namespaces are excluded by de...
[ 0.2254583090543747, 0.15272358059883118, 0.2880783975124359, 0.13140669465065002, -0.2592247724533081, -0.41894227266311646, 0.39651620388031006, 0.33086097240448, -0.25367894768714905, -0.49094370007514954, 0.10793620347976685, 0.27555108070373535, -0.12223978340625763, 0.2664704322814941...
We're developing a Python web service and a client web site in parallel. When we make an HTTP request from the client to the service, one call consistently raises a socket.error in socket.py, in read: ``` (104, 'Connection reset by peer') ``` When I listen in with wireshark, the "good" and "bad" responses look very s...
[ 0.3491998612880707, 0.07122872024774551, 0.3668421506881714, 0.10494096577167511, 0.0023430422879755497, 0.17062552273273468, 0.1474466621875763, -0.19185316562652588, -0.22688241302967072, -0.43330118060112, -0.2757970988750458, 0.32141822576522827, -0.29621294140815735, 0.014869305305182...
the server sends a FIN, ACK. The client responds with a FIN, ACK. The server responds ACK. * (Bad request) the server sends a RST, ACK, the client doesn't send a TCP response, the socket.error is raised on the client side. Both the web service and the client are running on a Gentoo Linux x86-64 box running glibc-2.6.1...
[ 0.014891429804265499, 0.1335965394973755, 0.5411111116409302, -0.019087551161646843, -0.14996427297592163, -0.013332103379070759, 0.21375541388988495, 0.04972130060195923, -0.17499972879886627, -0.5838190317153931, -0.10383450984954834, 0.28240177035331726, -0.544792115688324, 0.2054364383...
0.3.1, which is using Python's wsgiref.simple\_server. I ran the WSGI app through wsgiref.validator with no issues. It seems like this should be easy to debug, but when I trace through a good request on the service side, it looks just like the bad request, in the socket.\_socketobject.close() function, turning delegat...
[ -0.04362118989229202, -0.20652316510677338, 0.4053165912628174, -0.2647230327129364, -0.2547823488712311, -0.302948534488678, 0.5828664898872375, -0.13517512381076813, -0.16949982941150665, -0.7354022860527039, -0.14022059738636017, 0.5485468506813049, -0.6195801496505737, 0.21501563489437...
- Looks like server on Linux \*\* I have a MacBook, so I tried running the service on one and the client website on the other. The Linux client calls the OS X server without the bug (FIN ACK). The OS X client calls the Linux service with the bug (RST ACK, and a (54, 'Connection reset by peer')). So, it looks like it's...
[ 0.09158068895339966, 0.19979961216449738, 0.5267732739448547, -0.011331888847053051, -0.006300380453467369, -0.059855442494153976, 0.34399232268333435, 0.19680409133434296, -0.34856095910072327, -0.6283183693885803, -0.0905589833855629, 0.5451850295066833, -0.4293491542339325, 0.2129546999...