text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
shape? There is no such thing as a true square wave, and even the sine wave will likely have a few very quiet artifacts at other frequencies. If it's accuracy of frequency that matters, you are reliant on the stability and accuracy of the clock in your sound card. Having said that, I would imagine that the accuracy wou...
[ 0.508025586605072, -0.07211621850728989, 0.09325315058231354, -0.11703445017337799, -0.11661204695701599, 0.40812599658966064, 0.05889750272035599, -0.5116722583770752, -0.025144025683403015, -0.6120644807815552, 0.12177521735429764, 0.4742916226387024, 0.017025010660290718, 0.204121500253...
short.MaxValue; double frequency = 1000; for (int n = 0; n < buffer.Length; n++) { buffer[n] = (short)(amplitude * Math.Sin((2 * Math.PI * n * frequency) / sampleRate)); } ```
[ 0.13382531702518463, -0.29926058650016785, 0.3130652606487274, -0.15311357378959656, 0.09875529259443283, 0.2959135174751282, 0.3755226731300354, -0.5635062456130981, -0.13875672221183777, -0.38112547993659973, -0.16772422194480896, 0.4121852219104767, -0.12954816222190857, 0.1067944467067...
I'm using VS2008 for a C++ project. The code is quite old and has passed through many hands. There are several classes hierarchies, functions, enums and so on which are no longer being used. Is there a way to get the compiler/linker to list out identifiers which have been declared or defined but are not being referred...
[ 0.4691869914531708, 0.10306515544652939, 0.01885175332427025, 0.13452063500881195, 0.11990536749362946, -0.30102449655532837, 0.12392637878656387, 0.14506873488426208, -0.22547416388988495, -0.5647094249725342, 0.03848952427506447, 0.12826599180698395, -0.19631560146808624, 0.1403002887964...
I need to know the maximum length of a textbox in ssrs. How much data can it accomodate? The max length is 32k.
[ -0.059374481439590454, -0.14459684491157532, 0.3832302689552307, 0.2199459671974182, -0.12873980402946472, -0.0925590768456459, 0.36709725856781006, -0.03754184767603874, -0.3586590588092804, -0.3763292133808136, 0.13373416662216187, 0.3512197732925415, -0.08064663410186768, -0.00259802048...
I'm writing a C++ client which is using libcurl for communicating with a PHP script. The communication should be session based, and thus the first task is to login and make the PHP script set up a session. I'm not used to working with sessions either from C++ or PHP. I basically know that it has to do with cookies an...
[ 0.3082885146141052, 0.4589696228504181, 0.19888697564601898, -0.1827830970287323, -0.2269737273454666, -0.4120577275753021, 0.27571913599967957, -0.007170403841882944, -0.26793548464775085, -0.7544558644294739, 0.027477063238620758, 0.597240686416626, -0.35187944769859314, -0.1361415386199...
picture just from the documentation of CURLOPT\_COOKIESESSION for instance. Anybody who has done this, please share a simple piece of code which shows the concept. Regards Robert As far as I understand it, CURL will handle session cookies automatically for you if you enable cookies, as long as you reuse your CURL ha...
[ 0.14108063280582428, -0.039900630712509155, 0.5110442638397217, -0.18273182213306427, -0.15744972229003906, -0.329318106174469, 0.6392739415168762, -0.4286830425262451, -0.2414444535970688, -0.629855751991272, -0.3568691611289978, 1.04209566116333, -0.2142813801765442, -0.5055930018424988,...
== CURLE_OK ); // The cookies are actually saved here. curl_easy_cleanup( Handle ); ``` I'm not positive that you need to set both COOKIEFILE and COOKIEJAR, but the documentation makes it seem that way. In any case, you have to set one of the two in order to enable cookies at all in CURL. You can do something as sim...
[ 0.15222300589084625, 0.0539657287299633, 0.3658251464366913, -0.21931762993335724, 0.05473305657505989, -0.48297494649887085, 0.4596802592277527, -0.007142387330532074, -0.385362833738327, -0.7748041749000549, -0.2634698748588562, 0.857090413570404, -0.46830809116363525, -0.339273631572723...
I have a Python script that needs to execute an external program, but for some reason fails. If I have the following script: ``` import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input(); ``` Then it fails with the following error: > 'C:\Temp\a' is not recognized as an internal or external command, operabl...
[ 0.18168900907039642, 0.4259299039840698, 0.22737281024456024, -0.21126161515712738, 0.2225973755121231, 0.049087416380643845, 0.8058086037635803, -0.19242531061172485, -0.04723446071147919, -0.500773012638092, -0.23672305047512054, 0.5785554647445679, -0.24594950675964355, 0.11751886457204...
that does a job and then just exits, but I need to wait for it to complete. Also note, moving the program to a non-spaced path is not an option either. --- This does not work either: ``` import os; os.system("'C:\\Temp\\a b c\\Notepad.exe'"); raw_input(); ``` Note the swapped single/double quotes. With or withou...
[ -0.11537874490022659, 0.18490073084831238, 0.4796709418296814, -0.18482345342636108, 0.3412804901599884, -0.10037043690681458, 0.25706151127815247, -0.3117249011993408, -0.043323080986738205, -0.556113064289093, -0.41571351885795593, 0.7048342823982239, -0.28961727023124695, -0.06164332851...
I've run into a problem trying to return an object that holds a collection of childobjects that again can hold a collection of grandchild objects. I get an error, 'connection forcibly closed by host'. Is there any way to make this work? I currently have a structure resembling this: pseudo code: ``` Person: IEnumerab...
[ -0.16805198788642883, 0.20150749385356903, 0.3623829185962677, -0.09918148070573807, 0.16784049570560455, 0.025361299514770508, 0.47834211587905884, -0.0037360601127147675, -0.2593243718147278, -0.7383624911308289, -0.1875777691602707, 0.337865948677063, -0.2169562131166458, 0.637768685817...
it turns bad. Also in my client service reference i picked the generic list as my collection type. I just want to emphasize, **only one of my operations/methods fail with this error - the rest of them work perfectly**. EDIT (more detailed error description): ``` [SocketException (0x2746): An existing connection was f...
[ -0.015155036933720112, 0.2512817680835724, 0.5379114747047424, -0.031521666795015335, -0.09706684947013855, 0.023638302460312843, 0.517004132270813, 0.04085739329457283, -0.3257809281349182, -0.7455158829689026, -0.18092508614063263, 0.4107057452201843, -0.40521976351737976, 0.436873406171...
the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.] ``` I tried looking for logs but i can't find any... also i'm using a WSHttpBinding and an http endpoint. As a note, you need to learn how to...
[ 0.3885503113269806, -0.07498051971197128, 0.3870856761932373, 0.2986835837364197, -0.1658257246017456, -0.6686451435089111, 0.4014696180820465, -0.00661795400083065, -0.32780227065086365, -0.74456387758255, 0.24606481194496155, 0.46263447403907776, -0.04076048359274864, 0.04039581865072250...
when there's a server WCF error, the client is unlikely to get useful data out.)
[ 0.10539104044437408, 0.09039071947336197, 0.37023353576660156, 0.14738427102565765, 0.2054353952407837, 0.00915804598480463, 0.40501105785369873, 0.030031368136405945, -0.23754915595054626, -0.33451101183891296, -0.04226439818739891, 0.47188693284988403, -0.09066928923130035, -0.0097700105...
REBOL has no built-in way to perform list comprehensions. However, REBOL has a powerful facility (known as `parse`) that can be used to create domain-specific languages (DSLs). I've used `parse` to create such a mini-DSL for list comprehensions. In order to interpret the expression, the block containing the comprehensi...
[ -0.17429590225219727, 0.10204938054084778, 0.46218276023864746, -0.11287996917963028, -0.3763245940208435, -0.0923440083861351, 0.5493056178092957, -0.07640792429447174, -0.17909874022006989, -0.2502753734588623, -0.3297080993652344, 0.54367595911026, -0.5616201758384705, -0.02633506618440...
language that requires a keyword or function for list comprehensions. They are pure syntactic sugar wherever they exist. Unfortunately I don't have that option. So, seeing that I must have a function, what's a good, succinct, logical name for it? How about `select`? `select [(a * b) for a in 1x100 for b in 4x10 where ...
[ -0.1831469088792801, 0.1558467149734497, 0.25452232360839844, -0.11468026041984558, -0.06031112000346184, 0.38031038641929626, 0.40198639035224915, 0.04986457899212837, -0.19629955291748047, -0.4347580373287201, -0.11684887856245041, 0.11480745673179626, -0.45849329233169556, -0.3125579953...
In my asp.net mvc app I want to check if a certain url returns a valid response. Therefor I send the url to a method that tests the HttpWebRequest.GetResponse() On my dev server (vs2008) it works just fine. When deployed on production server however, it returns a Bad Request. The method is never hit and my asp.net cus...
[ 0.07766665518283844, -0.04945710673928261, 0.5531964898109436, 0.029339969158172607, -0.2861335277557373, 0.09570956975221634, 0.6884011626243591, -0.04076728597283363, -0.2974436283111572, -0.8587985038757324, 0.10811974853277206, 0.5094453692436218, -0.2474348247051239, 0.042429845780134...
the checkUri I recreate the uri by adding the http:// and then check if the Host of this uri is the host I expected (in my example the request.url.host). Then I make the httpwebrequest with the Uri I created and check the request for a response.
[ 0.1660527139902115, -0.05798732489347458, 0.5181001424789429, -0.021241210401058197, -0.13404664397239685, -0.09605473279953003, 0.047144584357738495, -0.07580893486738205, 0.4309561550617218, -0.6524837613105774, -0.15310250222682953, 0.34919965267181396, -0.19719025492668152, 0.216215491...
I know many people who use computers every day, who do not know how to select multiple items in a HTML select box/list. I don't want to use this control in my pages any more: ``` Please pick 3 options: <select name="categories" size="10" multiple="yes"> ``` So what user-friendly alternatives do you suggest? Perhaps ...
[ 0.37590137124061584, -0.04394060745835304, 0.16820433735847473, 0.16525091230869293, -0.052274953573942184, 0.4525080621242523, 0.045725155621767044, -0.18517877161502838, -0.6251766681671143, -0.6835753321647644, 0.2714473009109497, 0.248153954744339, -0.4950017035007477, 0.09411172568798...
make sure the person picks at least 1 item and not more than 3. It's not about detecting how many options they have picked, the problem is more about how to convey this to the user in a friendly way! **Edit:** I suppose I could use tags, like right here on stackoverflow, but I feel these are less appropriate if the us...
[ 0.5078248977661133, -0.24573728442192078, -0.015365084633231163, 0.23554439842700958, -0.04946106672286987, -0.15631432831287384, 0.2160656452178955, -0.09344673901796341, -0.32463333010673523, -0.7726795077323914, -0.034883029758930206, 0.5743931531906128, -0.18580161035060883, -0.3539626...
css (Or some other attribute) during submission to determine the selections. This would allow the user to simply select an item by clicking, and deselect by clicking, rather than the standard Ctrl+Click requirement.
[ 0.1410803496837616, -0.21532292664051056, 0.16649600863456726, 0.40402472019195557, -0.28191280364990234, 0.14242978394031525, -0.11440717428922653, -0.24685844779014587, -0.24162499606609344, -0.41553887724876404, -0.30101847648620605, 0.04867735132575035, -0.22417448461055756, 0.22212828...
I would like to create (in code) tree of controls that would render as a table with several TBODY tags, i.e.: ``` <TBODY> <TR> <TD></TD> </TR> <TR> <TD></TD> </TR> </TBODY> ``` I tried both Table and HtmlTable controls but had no success. Any clues? How are you generating your data? Y...
[ 0.3245050311088562, -0.20586024224758148, 0.16495293378829956, 0.4911908805370331, -0.1395750641822815, 0.24170717597007751, -0.17856550216674805, -0.3971443474292755, -0.20419271290302277, -0.713410496711731, 0.1983833611011505, 0.2546536326408386, -0.46527957916259766, 0.0015914984978735...
C# you can use the HtmlGenericControl (<http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlgenericcontrol.aspx>), you'll need to provide a tag type in the constructor.
[ 0.3139289915561676, 0.06710922718048096, 0.379517138004303, -0.06254702061414719, -0.07035057246685028, -0.3841511607170105, -0.04572492837905884, 0.08620164543390274, -0.15898171067237854, -0.29028478264808655, -0.5585669279098511, 0.5553851127624512, -0.5605525374412537, -0.2656685411930...
I recently built a program that parses a remote file from **\some\_server\c$\directory\file.xls** and it works fine on my local machine as just a normal aspx page. > Then I put the program into web part > form on my VM SharePoint server and I > get this error: Access to the path > '\some\_server\c$\directory\file....
[ 0.12285501509904861, 0.24614253640174866, 0.11293141543865204, 0.0815739631652832, -0.13665297627449036, -0.031693484634160995, 0.4843204915523529, 0.14270631968975067, 0.025300748646259308, -0.644319474697113, 0.2665684223175049, 0.5950572490692139, -0.1221865639090538, 0.4220538735389709...
right, SharePoint doesn't run with trust to do this. Changing the trust level for SharePoint in it's web.config from WSS\_Medium to Full is the quick solution, but there are security implications..
[ 0.3767141103744507, 0.018931878730654716, 0.3965751826763153, 0.26557332277297974, 0.16224943101406097, -0.4402458369731903, 0.28641363978385925, -0.008387194015085697, 0.038852397352457047, -0.6009917259216309, 0.055334825068712234, 0.720943808555603, -0.0799107477068901, 0.01172257307916...
I have a very simple question. I want to test whether a particular port is currently under use or not. For this, I want to bind a TCP socket to the port, if the connection is refused means the port is in use and if not that mean the port is free. Can someone please tell me how can I write the TCP socket code in C? I a...
[ 0.47468632459640503, 0.22744175791740417, 0.3436436653137207, 0.279227614402771, 0.031477998942136765, -0.2954147160053253, -0.02225048840045929, -0.04036957398056984, 0.009519082494080067, -0.9865760803222656, -0.13172870874404907, 0.6307891607284546, -0.33551764488220215, 0.2153910100460...
where the address is already in use. ``` #include <stdio.h> #include <sys/socket.h> #include <netinet/in.h> #define PORT 12345 int main() { struct sockaddr_in addr; int fd; fd = socket(AF_INET, SOCK_STREAM, 0); if(fd == -1) { printf("Error opening socket\n"); return -1; } addr.sin_port = ...
[ -0.27036499977111816, 0.029677167534828186, 0.620614230632782, -0.4391699433326721, 0.16828061640262604, 0.19272148609161377, 0.6741319298744202, -0.5977403521537781, -0.12313800305128098, -0.6420968174934387, -0.3257746994495392, 0.45706143975257874, -0.3570294678211212, 0.133492514491081...
In writing some test code I have found that Selector.select() can return without Selector.selectedKeys() containing any keys to process. This is happening in a tight loop when I register an accept()ed channel with ``` SelectionKey.OP_READ | SelectionKey.OP_CONNECT ``` as the operations of interest. According to the ...
[ 0.05807091295719147, -0.04290753975510597, 0.4213348925113678, -0.25995710492134094, 0.36976805329322815, -0.05364146828651428, 0.13095033168792725, -0.2866685390472412, -0.14433805644512177, -0.7435745596885681, -0.21313294768333435, 0.6903704404830933, -0.3672262728214264, 0.201343521475...
to initiate these returns. Any ideas as to what is causing this behaviour? Short answer: remove `OP_CONNECT` from the list of operations you are interested in for the accepted connection -- an accepted connection is already connected. I managed to reproduce the issue, which might be exactly what's happening to you: ...
[ -0.04463907703757286, -0.4489578306674957, 0.879923403263092, -0.07181219756603241, 0.20796725153923035, 0.031097281724214554, 0.5196930170059204, -0.3408869206905365, -0.4677523672580719, -0.6839465498924255, -0.2122325301170349, 0.5284776091575623, -0.4425208866596222, 0.3716044127941131...
" + clientChannel); final Selector selector = Selector.open(); clientChannel.configureBlocking(false); final SelectionKey clientKey = clientChannel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_CONNECT); System.out.println("Selecting..."); System.out.println(selector.select()); Syst...
[ -0.3685579299926758, -0.3321453928947449, 0.6810537576675415, -0.4495071768760681, -0.049022842198610306, -0.003572483779862523, 0.3726133108139038, -0.5052917003631592, -0.4321698546409607, -0.9011597633361816, -0.27871814370155334, 0.5346834659576416, -0.34301868081092834, 0.297083944082...
as Sun's JVM 1.5.0\_05 and 1.4.2\_04 on Linux 2.6.
[ -0.017053691670298576, -0.06937093287706375, 0.4906795620918274, -0.34291791915893555, -0.14506421983242035, -0.3641306161880493, 0.07410319894552231, -0.13065016269683838, -0.02773446775972843, -0.6537750959396362, -0.40520474314689636, 0.45782381296157837, -0.333528071641922, 0.102299362...
In PostgreSQL 8.3 database I have "bookings" table referencing "booking\_transactions" table by ID. So that each booking belongs to a single transaction. It's possible to delete bookings from the database. How can I make sure that a "booking\_transactions" row is automatically deleted when all the "bookings" referenci...
[ -0.15080605447292328, -0.07425181567668915, 0.3490321636199951, -0.29124605655670166, 0.2316158413887024, -0.026489289477467537, -0.10137289762496948, -0.11235012114048004, -0.05525117367506027, -0.529468297958374, 0.2087920904159546, 0.45715975761413574, -0.7640631198883057, 0.22440114617...
step through all the files in the directory. If it needs more information about one of them it calls stat().
[ 0.37694695591926575, -0.34619781374931335, 0.09844696521759033, -0.015181208960711956, 0.2248602658510208, -0.22921763360500336, 0.05037325248122215, -0.11967142671346664, -0.1969437450170517, -1.0109190940856934, -0.059783969074487686, 0.25587186217308044, -0.03982306271791458, 0.06615725...
I'm starting to investigate T4 for Code Generation. I get that you have a basic template in which you can embed little chunks of c#/vb which can perform clever stuff... ``` <#@ template language="VB" debug="True" hostspecific="True" #> <#@ output extension=".vb" debug="True" hostspecific="True" #> Imports System <#Fo...
[ 0.40846940875053406, 0.04606086388230324, 0.5131298303604126, 0.057356443256139755, -0.017349183559417725, -0.17000456154346466, 0.1695902794599533, -0.2503427565097809, -0.356327623128891, -0.815589964389801, -0.11629106849431992, 0.41735029220581055, -0.1672871708869934, 0.21962781250476...
I would like to be able to write my main block thus... ``` <#@ template language="VB" debug="True" hostspecific="True" #> <#@ output extension=".vb" debug="True" hostspecific="True" #> Imports System <# For Each BaseTableName as String in New String(){"Table1","Table2"} WriteRecDataInterface(BaseTableName) ...
[ 0.32173460721969604, 0.14730331301689148, 0.48501986265182495, -0.07027848064899445, -0.017662039026618004, -0.1136593371629715, 0.3842073678970337, -0.42156708240509033, -0.16330952942371368, -0.8848077654838562, 0.1505398452281952, 0.4651918411254883, -0.1000915914773941, 0.2545135319232...
an example with C#: ``` <#@ template language="C#" #> <# HelloWorld(); #> <#+ private string _field = "classy"; private void HelloWorld() { for(int i = 1; i <= 3; i++) { #> Hello <#=_field#> World <#= i #>! <#+ } } #> ```
[ 0.04337137192487717, -0.12247778475284576, 0.18359997868537903, -0.2580297589302063, 0.11569469422101974, -0.19134025275707245, 0.1924600750207901, -0.053621333092451096, 0.04482812434434891, -0.5148380398750305, -0.19086430966854095, 0.5278559923171997, -0.5074926614761353, 0.160321041941...
I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use `hasattr` like this: ``` class Foo(object): @classmethod def singleton(self): if not hasattr(self, 'instance'): self.instance = Foo() re...
[ 0.17734742164611816, 0.05737289413809776, -0.13287104666233063, -0.010158496908843517, 0.008503708057105541, -0.2538314163684845, 0.27715519070625305, -0.1025104895234108, -0.19204792380332947, -0.7158563733100891, 0.034779541194438934, 0.537047803401947, -0.28661850094795227, 0.2989752590...
return self.instance except AttributeError: self.instance = Foo() return self.instance ``` Is one method better of the other? **Edit:** Added the `@classmethod` ... But note that the question is *not* about how to make a singleton but how to check the presence of a member in an object...
[ -0.12309718132019043, -0.03298535197973251, -0.04968913272023201, -0.09249583631753922, -0.2007201761007309, -0.030150918290019035, 0.37151968479156494, -0.23661476373672485, -0.014978018589317799, -0.4229433834552765, 0.12825065851211548, 0.520733654499054, -0.37501001358032227, 0.0748631...
`Foo`, the same each time. And, typically, the method is called many times. These are two different methodologies: №1 is LBYL (look before you leap) and №2 is EAFP (easier to ask forgiveness than permission). Pythonistas typically suggest that EAFP is better, with arguments in style of "what if a process creates the f...
[ 0.2422763556241989, -0.07713546603918076, -0.18614859879016876, -0.2533108592033386, -0.24857307970523834, 0.025346267968416214, 0.5313244462013245, -0.2829093933105469, -0.5116618871688843, -0.1646742820739746, -0.2523931562900543, 0.27053889632225037, -0.48149943351745605, -0.34459611773...
cheap in CPython while creating an exception (the `raise` keyword and internal exception creation) is what is relatively expensive— using method №2 the exception would be raised only once; afterwards, you just use the property.
[ 0.10469576716423035, -0.09265070408582687, 0.08926787227392197, 0.2594022750854492, 0.05521152913570404, -0.16558296978473663, 0.12475432455539703, -0.30613866448402405, -0.2311600297689438, -0.4997636079788208, -0.07467159628868103, 0.4291815459728241, 0.08645325154066086, -0.083296604454...
According to this <http://perldoc.perl.org/UNIVERSAL.html> I shouldn't use UNIVERSAL::isa() and should instead use $obj->isa() or CLASS->isa(). This means that to find out if something is a reference in the first place and then is reference to this class I have to do ``` eval { $poss->isa("Class") } ``` and check...
[ 0.25258663296699524, 0.25339922308921814, 0.43517062067985535, -0.19490444660186768, -0.23997747898101807, -0.04688657075166702, 0.18074026703834534, -0.11339934170246124, -0.3380393385887146, -0.4714607894420624, -0.08874098211526871, 0.751034140586853, -0.4789659082889557, 0.278219372034...
ampersands and potentially long lines? The primary problem is that if you call `UNIVERSAL::isa` directly, you are bypassing any classes that have overloaded `isa`. If those classes rely on the overloaded behavior (which they probably do or else they would not have overridden it), then this is a problem. If you invoke `...
[ 0.14391960203647614, 0.06983683258295059, 0.2583816945552826, 0.32178232073783875, -0.15177462995052338, -0.01858288049697876, 0.411889910697937, -0.2939598560333252, -0.04641445353627205, -0.19149987399578094, -0.2751694619655609, 0.8279613256454468, -0.2893569767475128, 0.302034318447113...
different behavior for non-blessed references and simple scalars. So your example that doesn't check whether `$ref` is blessed is not doing the right thing, you're ignoring an error condition and using `UNIVERSAL`'s alternate behavior. In certain circumstances this can cause subtle errors (for example, if your variable...
[ 0.4521355628967285, 0.1614992618560791, 0.3596385419368744, -0.21547746658325195, -0.10603094846010208, -0.22858352959156036, 0.19382217526435852, -0.1872696876525879, -0.14988091588020325, -0.33077389001846313, -0.3048947751522064, 0.7833322882652283, -0.6667912006378174, 0.08140923827886...
Recently our company has started measuring the cyclomatic complexity (CC) of the functions in our code on a weekly basis, and reporting which functions have improved or worsened. So we have started paying a lot more attention to the CC of functions. I've read that CC could be informally calculated as 1 + the number of...
[ 0.0014475092757493258, 0.061787672340869904, -0.06453785300254822, 0.3882492184638977, -0.06822935491800308, 0.13568048179149628, -0.009672279469668865, -0.40828487277030945, -0.5191604495048523, -0.43329182267189026, 0.1576632559299469, 0.47313690185546875, -0.2597857117652893, 0.23795096...
is the CC of the following code fragments? 1) ``` for (int i = 0; i < 3; i++) Console.WriteLine("Hello"); ``` And ``` Console.WriteLine("Hello"); Console.WriteLine("Hello"); Console.WriteLine("Hello"); ``` They both do the same thing, but does the first version have a higher CC because of the for statement? ...
[ 0.21184544265270233, -0.013808096759021282, 0.21973784267902374, 0.08762910962104797, 0.07349804788827896, -0.4250946342945099, 0.024844765663146973, -0.3207843601703644, -0.24158194661140442, -0.2660873830318451, -0.31167200207710266, 0.40845826268196106, -0.3822352886199951, 0.2033336907...
fragment higher because it has 3 decision points/if statements? 3) ``` if (condition1) { Console.WriteLine("one"); if (condition2) Console.WriteLine("one and two"); } ``` And ``` if (condition3) Console.WriteLine("fizz"); if (condition4) Console.WriteLine("buzz"); ``` These two code fra...
[ 0.12547697126865387, -0.1410403549671173, 0.15618827939033508, 0.4431837201118469, -0.005645028315484524, -0.09654343128204346, 0.10373547673225403, -0.47523826360702515, -0.3296959102153778, -0.5591021776199341, -0.13218291103839874, 0.3534031808376312, -0.0251786932349205, 0.306340306997...
a higher CC. 2. Yes-maybe, your first example has multiple decision points and thus a higher CC. (See below for explanation.) 3. Yes-maybe. Obviously they have the same number of decision points, but there are different ways to calculate CC, which means ... ... if your company is measuring CC in a specific way, then y...
[ 0.6541358828544617, 0.12731745839118958, 0.29657241702079773, 0.7244915962219238, -0.11819326877593994, -0.367948442697525, -0.4130149483680725, -0.2512284517288208, -0.5157978534698486, -0.23483391106128693, 0.32333630323410034, 0.5798280835151672, -0.011616078205406666, -0.07897401601076...
use. The bigger problem is what others have mentioned, that your company seems to be focusing more on CC than on the code behind it. In general, sure, below 5 is great, below 10 is good, below 20 is okay, 21 to 50 should be a warning sign, and above 50 should be a big warning sign, but those are guides, not absolute ...
[ 0.9566085338592529, 0.35520705580711365, 0.26132604479789734, 0.2747439444065094, 0.26686224341392517, -0.620110273361206, 0.23718193173408508, -0.08714888989925385, -0.4969092607498169, -0.451558917760849, 0.0791611522436142, 0.4624471366405487, -0.1013609990477562, 0.02882152982056141, ...
written that way, and it's not feasible (for any number of reasons) to refactor it. If you use tools to refactor your code to reduce CC, make sure you understand what the tools are doing, and that they're not simply shifting one problem to another place. Ultimately, you want your code to have few defects, to work prop...
[ 0.6635504961013794, 0.522500216960907, 0.02299874648451805, 0.3134309649467468, 0.13214753568172455, -0.35329651832580566, 0.13542942702770233, -0.03978380933403969, -0.34409278631210327, -0.3674418032169342, -0.1128542572259903, 0.47351595759391785, -0.07800713926553726, 0.018769167363643...
your code (and perhaps get them to examine their policy).
[ 0.6889790296554565, 0.23726126551628113, -0.1328684687614441, 0.3569086194038391, 0.11886139214038849, -0.14755065739154816, 0.40100744366645813, -0.15930062532424927, 0.0441654808819294, -0.6078729629516602, -0.1469186395406723, 0.7220441102981567, 0.06755145639181137, -0.2581524848937988...
We're developing an EPiServer-based website and trying to deploy our latest build onto a WinXP IIS6 box. When browsing to site, we're getting the following stack trace ``` [ClassFactoryException: ClassFactory not initialized] EPiServer.BaseLibrary.ClassFactory.get_Instance() +123 EPiServer.BaseLibrary.Context.g...
[ -0.009112733416259289, 0.12998351454734802, 0.6012044548988342, -0.06500890851020813, -0.13956767320632935, 0.18973736464977264, 0.4700932204723358, -0.7455556392669678, -0.39492809772491455, -0.6761622428894043, -0.3608119487762451, 0.29055970907211304, -0.5356236100196838, 0.002808658871...
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 EPiServer.WorkflowFoundation.WorkflowSystem.RegisterServices(IWorkflowManager manager, WorkflowSettingsElement configuration) +338 EPiServer.WorkflowFoundation.WorkflowSystem.Init(HttpApplication context) +240 System.Web.HttpApplication.InitModu...
[ -0.5379401445388794, -0.26395565271377563, 0.53681480884552, 0.1544969528913498, -0.2589910626411438, 0.406718373298645, 0.4128749668598175, -0.5763511061668396, -0.4769606590270996, -0.7939155101776123, -0.22997461259365082, 0.25904783606529236, -0.383608877658844, 0.011282467283308506, ...
Are there any tools to transform SVG (XML) data to Canvas friendly input? No I don't think so. SVG is actually rather different to Canvas. SVG is a vector graphics description language, whereas Canvases are programmatically "drawn" by sets of instructions. Also, Canvas isn't actually vector based at all. Take a look a...
[ 0.6289982199668884, -0.28889229893684387, 0.16737009584903717, 0.07385943830013275, -0.5347007513046265, 0.01973137818276882, -0.2695046663284302, -0.06622771918773651, -0.2743195593357086, -0.6220940947532654, 0.2776234745979309, 0.5932505130767822, -0.2597692012786865, -0.206690728664398...
Does anybody know how to redirect parent page from an ajax call? I made an ajax call to the server and from the controller function that handles the call, I want to go to another page. Usually this function updates an element from current page, but in some cases I want to redirect browser to another page. If you want t...
[ 0.3844964802265167, 0.2356114387512207, 0.3249666392803192, 0.21070028841495514, -0.05748215317726135, -0.16915085911750793, 0.183523029088974, 0.3013547956943512, -0.41390976309776306, -0.4500080347061157, 0.1914718747138977, 0.5110631585121155, -0.08998928219079971, 0.008729590103030205,...
Suppose you have: ``` A-B-C ``` Now your build/test fails. The fix should be merged in A. My current work-flow is like this: ``` $ git commit -m "fixA" A-B-C-fixA $ git rebase -i A~1 ``` And squash fixA in A, result in: ``` A'-B-C ``` Is there a command to do something like: ``` A-B-C + (index with fix fo...
[ -0.013964565470814705, 0.21329207718372345, 0.30355963110923767, -0.22951024770736694, 0.18427401781082153, 0.045998260378837585, 0.10319112986326218, -0.01572370156645775, -0.4434283971786499, -0.527556836605072, -0.27773502469062805, 0.9000674486160278, -0.6762880086898804, -0.1362480074...
also the `--fixup` and `--squash` options for [`commit`](https://www.kernel.org/pub/software/scm/git/docs/git-commit.html) to make things easier. With some aliasing you can probably even get the whole thing into a single command. I'd suggest upgrading to the newest Git for maximum awesomeness: ``` git/Documentation/R...
[ -0.01312644686549902, -0.06503354758024216, 0.2873944044113159, 0.11552335321903229, -0.017271721735596657, -0.013695446774363518, 0.5361597537994385, -0.07247941195964813, -0.47201162576675415, -0.5538468956947327, -0.3620451092720032, 0.9652055501937866, -0.2748555541038513, -0.248318925...
the command line. 1.7.3.txt- -- 1.7.4.txt: * "git commit" learned --fixup and --squash options to help later invocation 1.7.4.txt- of the interactive rebase. -- 1.7.4.txt: * "git rebase --autosquash" can use SHA-1 object names to name which 1.7.4.txt: commit to fix up (e.g. "fixup! e83c5163"). 1.7.4.txt- ```
[ -0.14339901506900787, 0.1642070859670639, 0.3063645362854004, -0.16991974413394928, 0.03704579174518585, 0.05504004284739494, 0.5019601583480835, -0.004571990575641394, -0.1964695155620575, -0.7496294975280762, -0.4773772656917572, 0.9000635147094727, -0.58541339635849, -0.1494528651237487...
What is the correct (most efficient) way to define the `main()` function in C and C++ — `int main()` or `void main()` — and why? And how about the arguments? If `int main()` then `return 1` or `return 0`? --- *There are numerous duplicates of this question, including:* * [What are the valid signatures for C's `main(...
[ -0.24415341019630432, 0.10810566693544388, 0.3306560218334198, -0.013242038898169994, 0.09859057515859604, 0.029324855655431747, 0.11532876640558243, -0.10014892369508743, -0.294901967048645, -0.08311937004327774, -0.45644912123680115, 0.6434440612792969, -0.2995290458202362, -0.1647982150...
[`int main()` vs `void main()` in C](https://stackoverflow.com/questions/9356510/int-main-vs-void-main-in-c) Related: * [C++ — `int main(int argc, char **argv)`](https://stackoverflow.com/questions/5191965/c-int-mainint-argc-char-argv) * [C++ — `int main(int argc, char *argv[])`](https://stackoverflow.com/questions/5...
[ -0.5229650139808655, 0.1498626172542572, 0.46983790397644043, -0.35671162605285645, 0.0426967479288578, 0.049533747136592865, 0.22593635320663452, 0.04246368631720543, -0.23338542878627777, -0.13132816553115845, -0.6679201722145081, 0.2334231287240982, -0.27509933710098267, 0.0881788507103...
there is no standard for how non-zero codes are interpreted. As noted by others, `void main()` is prohibited by the C++ standard and should not be used. The valid C++ `main` signatures are: ``` int main() ``` and ``` int main(int argc, char* argv[]) ``` which is equivalent to ``` int main(int argc, char** argv) ...
[ 0.18863867223262787, 0.18823303282260895, 0.16239941120147705, -0.30816322565078735, -0.10907752811908722, -0.03379762917757034, 0.3085734248161316, -0.09167366474866867, -0.029420649632811546, 0.125399649143219, -0.26538917422294617, 0.6303327083587646, -0.4113173186779022, 0.081216149032...
is not an issue with the `main` function. It can only be entered and left once (marking the program's start and termination) according to the C++ standard. For C, re-entering `main()` is allowed, but should be avoided.
[ 0.040745098143815994, 0.10431348532438278, 0.14570528268814087, -0.45572465658187866, 0.1161281168460846, -0.23486757278442383, 0.26151299476623535, 0.36554184556007385, -0.09663937985897064, -0.048967260867357254, -0.5293992757797241, 0.32385969161987305, -0.26204901933670044, 0.182747617...
My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is. More here : <http://www.openplans.org/projects/deliverance/introduction> In theory, the system sounds great when you wan...
[ 1.0119225978851318, -0.3135133981704712, 0.32532811164855957, -0.027597885578870773, -0.10166371613740921, 0.15909001231193542, -0.14347471296787262, 0.41773590445518494, -0.15807822346687317, -0.522996187210083, 0.053423646837472916, 0.018904278054833412, -0.14027033746242523, -0.03829791...
real world :-) Having used Plone professionally for the last 4 years or so, and Deliverance on 4 commercial sites, I would advise all new front end developers (and old hands alike) to use Deliverance to theme Plone sites. It is *much* easier to learn (a couple of weeks Vs couple of months) and potentially much more po...
[ 0.39665669202804565, -0.055361516773700714, 0.5635519027709961, 0.04057919979095459, 0.3283670246601105, 0.05615578964352608, 0.30651965737342834, 0.37227216362953186, -0.008167828433215618, -0.570455014705658, -0.2622299790382385, 0.366146445274353, 0.03734428063035011, 0.0163656305521726...
the time invested is easily transferable.
[ 0.176811084151268, 0.3355378806591034, 0.08590693771839142, 0.258172869682312, 0.2931470572948456, 0.1758251190185547, -0.20457035303115845, -0.032021183520555496, -0.1896575689315796, -0.7212927341461182, -0.31956490874290466, 0.3000774681568146, 0.4758283793926239, 0.14877547323703766, ...
In my MFC program I am using a splitter to create two panes. I now want to split one of these panes in half again and put in another view, can someone talk me through how to do it or point me in the direction of some code? I would prefer to code it myself so I am not interested in custom derived classes unless they ar...
[ 0.23295192420482635, 0.030675198882818222, 0.5573524236679077, -0.12361761182546616, 0.100023552775383, 0.3719441890716553, -0.02686803787946701, -0.12090673297643661, -0.40049052238464355, -0.9355525374412537, -0.13948480784893036, 0.2981407940387726, -0.44964364171028137, 0.2779273390769...
the bottom row of the first m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(1, 0)); // Create views for the bottom splitter m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CView2), CSize(100, 100), pContext); m_wndSplitter2.CreateView(0, 1, RUNTIME_CLASS(CView3), CSize(1...
[ -0.09400901943445206, -0.10721743851900101, 0.6525426506996155, 0.06817582994699478, 0.06463833153247833, 0.34448373317718506, -0.0644126832485199, -0.03689051792025566, -0.19392690062522888, -0.9580046534538269, -0.14544865489006042, 0.5097146034240723, -0.2189711183309555, 0.133912906050...
In my current 32-bit application, I check (very occasionally) for overflow by doing operations on 64-bit integers. However, on 64-bit systems there does not seem to be a standard 128-bit integer. Is there a simple way of checking for overflow, or a way of getting 128-bit integers, which works on all OSes and compilers...
[ 0.01177188940346241, 0.4105518162250519, 0.14575469493865967, 0.07519175857305527, -0.041499700397253036, -0.22087718546390533, -0.00404411880299449, -0.12158115953207016, -0.5711579918861389, -0.3056558072566986, -0.09749594330787659, 0.4770510494709015, -0.2691028118133545, 0.01437824778...
as well (not all of the techniques discussed use the next larger integer type to handle the overflow).
[ -0.37884843349456787, -0.11107035726308823, 0.2752177119255066, -0.05404137074947357, 0.08462227135896683, -0.01914745569229126, -0.12180612981319427, -0.09989935904741287, -0.12878376245498657, -0.23867347836494446, -0.2979396879673004, 0.44081830978393555, -0.07421454787254333, 0.0514448...
Anybody in the know of a viewer (or Notepad++ plugin) that can read txt files in a streaming way? I would like to see for example the last 10 lines of a txt file that gets appended continiously. [Tail for Win32](http://tailforwin32.sourceforge.net/) is a simple open-source program I've been using for a couple of years ...
[ 0.5672525763511658, -0.24849988520145416, 0.36181116104125977, -0.0784553661942482, -0.13554739952087402, -0.502501904964447, 0.371966689825058, 0.2218445986509323, -0.168966144323349, -0.7638638615608215, 0.11698781698942184, 0.7434964776039124, -0.14758476614952087, -0.21792441606521606,...
We are in the process of moving our SVN repositories from one machine to another one, and with it will come a new domain name for the new repo. The problem is, that within the repository, there are lots of svn:externals references to other projects within the repository. So for example, we have projectA, which has in t...
[ 0.17208217084407806, 0.19823606312274933, 0.42838919162750244, -0.057060666382312775, -0.10780756175518036, -0.029213231056928635, 0.21137765049934387, 0.13494272530078888, -0.5124210715293884, -0.6760886907577515, -0.1759296953678131, 0.25067704916000366, -0.024366965517401695, 0.36263561...
go through the repository history and rewrite all of the old URLs, so that we can still check out older revisions of these projects without having broken links. How would I go about doing this? As you indicated that you still want to be able to check out older revisions, the only solution is really to "rewrite" the en...
[ 0.46344175934791565, 0.0900210365653038, 0.42151719331741333, 0.07283388823270798, 0.05597624182701111, -0.2873242199420929, 0.4480631649494171, -0.324743390083313, -0.35295578837394714, -0.5966829657554626, -0.25478261709213257, 0.4797287583351135, -0.19371244311332703, 0.3620342314243316...
change the svn:externals URLs. **This is the most difficult part**: Assuming the repository contains binary data as well, opening the dump file in a plain text editor will most likely corrupt the dump file. I've had good experiences using a so-called "hex-editor", for instance the [Freeware Hex Editor XVI32](http://www...
[ 0.1555834859609604, 0.19196483492851257, 0.2892173230648041, -0.18396542966365814, -0.2678510248661041, -0.21915274858474731, 0.48983871936798096, -0.05700976774096489, -0.18741977214813232, -0.5287802219390869, -0.20400691032409668, 0.7019563317298889, -0.3590332865715027, 0.2895231544971...
these sort of problems in the future: <http://subversion.tigris.org/svn_1.5_releasenotes.html#externals>
[ 0.3922567069530487, 0.020210016518831253, 0.17697571218013763, -0.014091212302446365, 0.13131166994571686, -0.2051202356815338, 0.3549416661262512, 0.16526830196380615, -0.36493462324142456, -0.3630967140197754, -0.07673521339893341, 0.6046450734138489, -0.3452511429786682, 0.2223446816205...
I'm trying to start using LINQ and specifically LINQ to SQL but I'm having some difficulties I've tried this with SqlMetal and now using the database table designer in Visual Studio and I keep getting similar errors, like in this code, using the data context I created with the database layout designer in VS2008. ``` ...
[ -0.02997743897140026, 0.07790984958410263, 0.6336202621459961, -0.21988354623317719, -0.14756879210472107, -0.03639925271272659, 0.31232208013534546, -0.33632993698120117, -0.19822251796722412, -1.0582172870635986, -0.15144114196300507, 0.4896679222583771, -0.6287186145782471, 0.2625989019...
if (usn == "" || pss == "") return; DataClassesDataContext dc = new DataClassesDataContext(); var user = from u in User where u.UserName == usn select u; } } } ``` I get
[ -0.39619314670562744, -0.3564435541629791, 0.5201271176338196, -0.16723434627056122, 0.3738505244255066, -0.0877978503704071, 0.3632357716560364, -0.2264203429222107, 0.15746071934700012, -0.7171645164489746, -0.53671795129776, 0.5521758198738098, -0.042442526668310165, 0.49658283591270447...
an error on the where saying: Could not find an implementation of the query pattern for source type 'System.Security.Principal.IPrincipal'. And also: 'Where' not found. I had something similar to this when I tried to use the results of SqlMetal. I deleted that source and started over using the designer. I must be miss...
[ 0.16043750941753387, 0.09187641739845276, 0.2055979073047638, 0.22168086469173431, 0.11259534955024719, -0.12107411026954651, 0.18054398894309998, -0.03230205550789833, -0.5151005387306213, -0.6087597012519836, 0.1428871899843216, 0.37916871905326843, -0.3705398142337799, 0.286954104900360...
where u.UserName == usn select u; ```
[ -0.2414880096912384, 0.1293756663799286, 0.3514285981655121, -0.12566977739334106, 0.30122846364974976, 0.07252238690853119, 0.2247963845729828, 0.1852066069841385, -0.04569833725690842, -0.4874330759048462, -0.44337573647499084, 0.36473074555397034, -0.3130215108394623, 0.4839680194854736...
Does anyone have a simple, efficient way of checking that a string doesn't contain HTML? Basically, I want to check that certain fields only contain plain text. I thought about looking for the < character, but that can easily be used in plain text. Another way might be to create a new System.Xml.Linq.XElement using: `...
[ 0.4083561897277832, 0.2215244024991989, 0.1610427349805832, 0.11609326303005219, -0.021259212866425514, -0.19152820110321045, 0.19558577239513397, 0.015450576320290565, -0.29372531175613403, -0.436270534992218, -0.08664481341838837, 0.2479715496301651, -0.41540518403053284, 0.1503616869449...
string input) { try { XElement x = XElement.Parse("<wrapper>" + input + "</wrapper>"); return !(x.DescendantNodes().Count() == 1 && x.DescendantNodes().First().NodeType == XmlNodeType.Text); } catch (XmlException ex) { return true; } } ``` One problem I found was that p...
[ -0.11063774675130844, -0.12825323641300201, 0.5327526926994324, -0.2454969733953476, 0.052099939435720444, 0.17428873479366302, 0.28896626830101013, -0.4314059913158417, 0.017996670678257942, -0.417392373085022, -0.33304542303085327, 0.26617875695228577, -0.3371656537055969, 0.125437453389...
first needs to have the ampersands and less than characters converted to their equivalent XHTML entities. I wrote another extension method to do that: ``` public static string ConvertXHTMLEntities(this string input) { // Convert all ampersands to the ampersand entity. string output = input; output = output...
[ 0.03930729627609253, -0.12353309988975525, 0.6783790588378906, -0.1936817616224289, -0.1295972317457199, 0.18180441856384277, 0.08304577320814133, -0.6510456800460815, -0.06582129001617432, -0.3770059645175934, -0.11137895286083221, 0.7565210461616516, -0.48857107758522034, -0.027013225480...
take a user submitted string and check that it doesn't contain HTML using the following code: ``` bool ContainsHTML = UserEnteredString.ConvertXHTMLEntities().ContainsXHTML(); ``` I'm not sure if this is bullet proof, but I think it's good enough for my situation.
[ 0.14341697096824646, 0.3357621729373932, 0.3293305039405823, -0.1442434936761856, -0.09903181344270706, -0.4264265298843384, 0.37442994117736816, -0.10878080874681473, 0.10567343235015869, -0.5082702040672302, -0.2106803059577942, 0.23890870809555054, -0.43871238827705383, 0.03333653509616...
I'm writing a page that can use a couple of different themes, and I'm going to store some information about each theme in the web.config. Is it more efficient to create a new sectionGroup and store everything together, or just put everything in appSettings? **configSection solution** ``` <configSections> <secti...
[ 0.10314267128705978, 0.12656258046627045, 0.7999041080474854, 0.00665559945628047, -0.0024699822533875704, 0.07281143218278885, -0.0731077566742897, -0.27058517932891846, -0.5204775333404541, -0.789755642414093, -0.09725424647331238, -0.03663346916437149, -0.20251744985580444, 0.0686744898...
</Themes> </SchedulerPage> ``` To access values in the configSection, I am using this code: ``` NameValueCollection themes = ConfigurationManager.GetSection("SchedulerPage/Themes") as NameValueCollection; String SchedulerTheme = themes["UB"]; ``` **appSettings solution** ``` <appSettings> <add key="PI...
[ -0.06260869652032852, 0.1080733984708786, 0.6240236163139343, -0.07183001935482025, 0.14843405783176422, 0.15347425639629364, 0.0897408053278923, -0.4070020616054535, -0.3730776906013489, -0.8758634328842163, -0.199111670255661, 0.45010411739349365, -0.3131811022758484, 0.189162015914917, ...
like ``` public class MonitoringConfig : ConfigurationSection { [ConfigurationProperty("smtp", IsRequired = true)] public string Smtp { get { return this["smtp"] as string; } } public static MonitoringConfig GetConfig() { return ConfigurationManager.GetSection("appMonitoring") as MonitoringConfig ...
[ 0.30596378445625305, -0.20455655455589294, 0.6477301716804504, 0.08879323303699493, 0.3936101198196411, -0.3140753507614136, 0.1971316784620285, 0.051900383085012436, -0.46607303619384766, -0.7820979952812195, -0.29824110865592957, 0.7952778339385986, -0.6276350021362305, 0.180660322308540...
Of the two methods below, which do you prefer to read? Is there another (better?) way to check if a flag is set? ``` bool CheckFlag(FooFlag fooFlag) { return fooFlag == (this.Foo & fooFlag); } ``` And ``` bool CheckFlag(FooFlag fooFlag) { return (this.Foo & fooFlag) != 0; } ``` --- Please vo...
[ 0.24556627869606018, 0.040102556347846985, 0.4115868806838989, -0.17805512249469757, -0.15532059967517853, -0.06624656915664673, 0.2421448528766632, -0.47672906517982483, 0.11602473258972168, -0.4109848439693451, -0.1801854968070984, 0.600674033164978, -0.494667112827301, -0.32250344753265...
are set (this.Foo & fooFlag) != 0 // result is true if any bits in fooFlag are set ```
[ 0.19459690153598785, 0.1828915774822235, 0.4220319986343384, -0.35234078764915466, 0.2044600397348404, -0.06463353335857391, 0.2582556903362274, -0.38943785429000854, 0.10806763172149658, -0.08940853923559189, -0.49062010645866394, 0.5517419576644897, -0.49719130992889404, -0.1086176708340...
I am constructing a search page with a textbox and a button for now, and probably a dropdown to filter results later on. I have my button's PostBackUrl set to my search page (~/search.aspx). Is there an easy way to pass the value in the text box to the search page? If you have the PostBackUrl set on your button, then t...
[ 0.042923904955387115, 0.29309481382369995, 0.6781097054481506, -0.22453264892101288, 0.16104237735271454, 0.1291063278913498, 0.15495558083057404, -0.17344103753566742, -0.23707416653633118, -0.8335208892822266, -0.1514582484960556, 0.3952018916606903, -0.047726623713970184, 0.121471263468...
null) { TextBox SourceTextBox = (TextBox)Page.PreviousPage.FindControl("TextBox1"); if (SourceTextBox != null) { Label1.Text = SourceTextBox.Text; } } ``` That is one way. There are some shortcuts too, such as using the PreviousPageType directive at the top of your search.aspx page: ...
[ -0.15025797486305237, -0.18438856303691864, 0.5025858879089355, -0.1661972850561142, -0.019092265516519547, 0.0019122895319014788, 0.6965376734733582, -0.27335435152053833, -0.21658329665660858, -0.8093129396438599, -0.3098958730697632, 0.5479640364646912, -0.3326983153820038, 0.0816792771...
For debugging purposes, I need to recursively search a directory for all files which start with a UTF-8 byte order mark (BOM). My current solution is a simple shell script: ``` find -type f | while read file do if [ "`head -c 3 -- "$file"`" == $'\xef\xbb\xbf' ] then echo "found BOM in: $file" fi do...
[ -0.18535183370113373, 0.23832042515277863, 0.300859272480011, -0.3270336985588074, 0.013629856519401073, -0.09460878372192383, 0.6295157074928284, -0.21508751809597015, 0.07034538686275482, -0.29603391885757446, -0.23516494035720825, 0.7122063636779785, -0.4301597774028778, 0.1050995737314...
break, but such files are not to be expected anyway. Is there any shorter or more elegant solution? Are there any interesting text editors or macros for text editors? What about this one simple command which not just finds but clears the nasty BOM? :) ``` find . -type f -exec sed '1s/^\xEF\xBB\xBF//' -i {} \; ``` ...
[ 0.03342089802026749, 0.3207132816314697, 0.23831503093242645, 0.10231389850378036, 0.1730615347623825, -0.2931404709815979, 0.37783369421958923, 0.02651994675397873, -0.5718780159950256, -0.29675421118736267, -0.46050789952278137, 0.5723701119422913, -0.5399051308631897, -0.111861452460289...
Sometimes I have made some local changes and for whatever reason don't want to commit them to the source repository. In this case I like to zip up and save off my changes on my local file system until I am ready to commit them at a later date. I recall that in an earlier version of eclipse, there was a context sensiti...
[ 0.32128071784973145, -0.15110832452774048, 0.17991334199905396, -0.15570120513439178, -0.249675452709198, 0.2006179243326187, 0.0627627968788147, -0.01310309674590826, -0.3211773931980133, -0.9044293761253357, 0.1117296889424324, 0.7656558752059937, -0.2092692255973816, -0.0274835061281919...
where that option is still available from the Synchronize view anymore and manually selecting the files in the Navigator/Package Explorer view is tedious. Is there an easy way to export a selection of files within the Synchronize view? It's not on the context menu, but going to the Navigate menu up top and selecting "S...
[ 0.08125901222229004, -0.2243923544883728, 0.23214010894298553, 0.17593790590763092, 0.03584432601928711, -0.14313717186450958, 0.24613402783870697, 0.18988780677318573, -0.11330956220626831, -0.5846352577209473, 0.010757217183709145, 0.7500754594802856, -0.37771081924438477, 0.127768382430...
Wow, I just got back a huge project in C# from outsourced developers and while going through my code review my analysis tool revealed bunches of what it considered bad stuff. One of the more discouraging messages was: ``` Exceptions.DontSwallowErrorsCatchingNonspecificExceptionsRule : 2106 defects ``` The develope...
[ 0.5811389088630676, 0.8096445798873901, -0.25203055143356323, 0.09968776255846024, -0.02381906285881996, -0.42971959710121155, 0.6073923707008362, 0.22152146697044373, -0.22366155683994293, -0.4410029947757721, 0.1268586665391922, 0.34947463870048523, -0.35675960779190063, 0.29812645912170...
record was being saved to the database, and in this case, if an exception was ignored, the user would get back an okay prompt, think everything was okay, and continue on with their work. In reality, their work was never saved. I think this is absolutely the most horrible kind of error. In this case, they are completely...
[ 0.5001668930053711, 0.3846936821937561, -0.25899738073349, 0.33481013774871826, 0.27264395356178284, -0.19940736889839172, 0.5573926568031311, 0.3300805687904358, -0.5755584836006165, -0.3053319454193115, 0.16133850812911987, 0.22122761607170105, -0.40296104550361633, 0.1368846595287323, ...
however, generally it is only specific exceptions that you are able to safely ignore. As noted by [Konrad Rudolph](https://stackoverflow.com/questions/204814/is-there-any-valid-reason-to-ever-ignore-a-caught-exception#204827), you might have to catch and swallow an error as part of a framework; and as noted by [osp70](...
[ 0.09419066458940506, 0.18621332943439484, -0.2183017134666443, -0.027110442519187927, 0.10149470716714859, -0.3743196129798889, 0.3031725287437439, 0.04711306840181351, -0.6067267060279846, -0.20429186522960663, -0.12198677659034729, 0.25967642664909363, -0.5793149471282959, -0.08409243077...
to ignore due to... } catch (System.Exception ex) { // Exception handling } ``` In the case of your application, is sounds like something similar might apply in some cases; but the example you give of a database save returning an "OK" even when there is an exception is not a very good sign.
[ 0.28855088353157043, 0.10551412403583527, 0.07189224660396576, -0.04992217943072319, 0.23031464219093323, -0.43573808670043945, 0.44445639848709106, 0.0994088426232338, -0.2950500249862671, -0.39966002106666565, -0.34189116954803467, 0.4826340973377228, -0.5725473165512085, 0.2528561949729...
With so many languages and frameworks that exist, and with new ones appearing all the time, I don't have the time to download, install, and configure each one to evaluate it. In the past I've run across webapps that allow one to write or paste code into a window, and see the results in realtime in the browser, usually ...
[ 0.6163941621780396, -0.07133004069328308, -0.08886764943599701, 0.47419029474258423, -0.10004258900880814, -0.05151171237230301, 0.0029281682800501585, 0.21968013048171997, -0.0960860550403595, -0.5985332131385803, 0.21457140147686005, 0.47029104828834534, 0.16475212574005127, -0.317531526...
Earth, Language, etc). But it turns out that it contains a few hidden gems: In addition to their apps, you can try out the many Javascript libraries that they host including [jQuery](http://code.google.com/apis/ajax/playground/#jquery), [jQuery UI](http://code.google.com/apis/ajax/playground/#jqueryui), [MooTools](http...
[ 0.3948799967765808, 0.13876831531524658, -0.003102449234575033, 0.354595810174942, -0.003810113063082099, 0.39120498299598694, 0.0781649649143219, 0.21970398724079132, -0.09238301217556, -0.6462302207946777, -0.0032500210218131542, 0.4203011691570282, 0.23840251564979553, -0.27004155516624...
code to use it as a sandbox. There are examples for Javascript, DOM scripting, Ajax, SQL, ADO, ASP and ASP.NET. [JS Bin](http://jsbin.com) is a sandbox for Javascript and CSS testing, with built in support for many scripting libraries, including jQuery, script.aculo.us, YUI, MooTools and dojo. So you can try out exam...
[ 0.772993803024292, -0.2134813666343689, -0.3266946077346802, 0.32477623224258423, -0.3781209886074066, -0.18322524428367615, 0.17534460127353668, -0.03449387475848198, -0.19285151362419128, -0.9767690300941467, -0.030414192005991936, 0.20583698153495789, -0.12030433863401413, 0.04138017445...
can customize many aspects of the interface, including the JS libraries that you want to include, several CSS features (like adding a reset.css), and other bonuses like Emmet and Vim key bindings. [Try Ruby](http://tryruby.hobix.com/) is an very basic interactive tutorial that introduces Ruby to the complete novice. I...
[ 0.2763037383556366, 0.09157279878854752, 0.5273318290710449, 0.06769775599241257, -0.17970599234104156, -0.32109740376472473, 0.6411768198013306, -0.04533889517188072, -0.05724970996379852, -0.4055962562561035, -0.18306291103363037, 0.1984708160161972, -0.007541024591773748, 0.102054953575...
dozens of open source software packages and allows you to try out both the front end and the administrative backend functions of the most popular portals, blogs, image galleries, and forums. You have full admin rights and can change any of the content on each of the packages, and then see the results of those changes f...
[ 0.26004108786582947, -0.13279780745506287, 0.5394718050956726, 0.09180960804224014, -0.28330567479133606, 0.04880218952894211, -0.10995253175497055, 0.030083181336522102, -0.2811789810657501, -0.6001912951469421, -0.15404269099235535, 0.5178685188293457, -0.28282293677330017, -0.3405237197...