text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I'd like to set up commit emails on a project I'm work on, as described here: <http://producingoss.com/en/vc.html#commit-emails> That is, use a post commit hook to send an email to a list containing the commit title/log and diff of the changes. What's the easiest way on a Linux machine to set this up? When creatin...
[ 0.7723253965377808, -0.1034773588180542, 0.1900489628314972, -0.15982268750667572, -0.12852789461612701, -0.020191723480820656, -0.08920742571353912, 0.06402793526649475, -0.20275168120861053, -0.7957386374473572, -0.04430101811885834, 0.32303711771965027, -0.33680295944213867, 0.151391491...
executable (`chmod a+x`). When you run the `commit-email.pl` script without any arguments you will see an usage screen with extra options that allow for example to modify the subject line or the From address. Please note that is case of Debian the `commit-email.pl` script is located in an optional `subversion-tools` ...
[ 0.1613871157169342, 0.018926206976175308, 0.12319318950176239, -0.0048071336932480335, -0.1837778389453888, -0.3396187722682953, 0.0822799801826477, 0.4167037308216095, -0.0038854663725942373, -0.5665587782859802, -0.47299423813819885, 0.5021330714225769, -0.6562387347221375, 0.06774961948...
I have two pdf or postscript files (I can work with either one). What I want to do is merge each page on top of the other so that page1 of document A will be combined with page 1 of document B to produce page 1 of the output document. This isn't something I necessarily want need to do programatically, although that wou...
[ 0.5461671352386475, -0.004291185177862644, 0.3473975956439972, 0.036932628601789474, 0.05369208753108978, -0.03264593333005905, -0.0935448482632637, -0.16285431385040283, -0.29386839270591736, -0.8242478370666504, 0.04316120222210884, 0.5011613965034485, -0.22857040166854858, -0.2226566225...
have multiple pages, you can use the [`multibackground`](https://www.pdflabs.com/docs/pdftk-man-page/#dest-op-multibackground) command instead.
[ 0.08877838402986526, -0.24527637660503387, 0.24886010587215424, 0.40828800201416016, -0.07528287172317505, -0.17426428198814392, 0.1918039619922638, -0.08914706110954285, -0.6863471865653992, -0.6862580180168152, -0.4375477731227875, 0.6278966665267944, -0.07162624597549438, 0.261597603559...
Couldn't a DSL be as simple as an API and therefore not need a parser? Or am I misunderstanding what a domain specific language really is? I thought it referred to any organized set of rules for solving a particular domain problem. An API would seem to fit that definition, right? You can embed a DSL within a more gener...
[ 0.33161553740501404, -0.05779562145471573, 0.09616243094205856, 0.5767293572425842, -0.1776951551437378, -0.18462766706943512, 0.11261769384145737, -0.175510972738266, -0.14887505769729614, -0.27759748697280884, -0.10687397420406342, 0.4011422097682953, -0.5025892853736877, 0.1639080345630...
be a larger undertaking, and is often not necessary.
[ 0.7026661038398743, 0.024984968826174736, -0.24638840556144714, 0.021090414375066757, 0.12990625202655792, -0.023661823943257332, 0.3309653103351593, 0.01591825857758522, 0.04799000173807144, -0.68766850233078, -0.5772904753684998, 0.31318044662475586, 0.16261734068393707, -0.1988991498947...
``` public interface IProcessor<T> { void Process(T instance); } foreach(AbstractType instance in myClass.SomeCollection) OnProcess(instance); public void OnProcess<T>(T instance) { IProcessor<T> processor = unityContainer.Resolve<IProcessor<T>>(); processor.Process(instance); } ``` The problem with th...
[ -0.15884511172771454, 0.16282398998737335, 0.3847808241844177, -0.0058051287196576595, 0.1054992601275444, 0.2264232188463211, 0.15255972743034363, -0.3320506513118744, -0.17204034328460693, -0.7665619850158691, -0.12299109250307083, 0.33566850423812866, -0.4945349097251892, 0.185413479804...
invoke the Process method. Both of these approaches feel a bit "unclean". Can anyone think of a way I can do this without having to resort to these practices? Thanks Pete 2 will be a performance killer (the necessary dynamic/relection **invoke** in particular is slow) 1 is a common answer to this problem, especial...
[ -0.01245809718966484, 0.1458411067724228, 0.27990737557411194, -0.062432337552309036, -0.23892159759998322, -0.05683669075369835, 0.5278351306915283, -0.5450515747070312, 0.08120205253362656, -0.5608920454978943, -0.015492522157728672, 0.6006165742874146, -0.3394731283187866, 0.00310364621...
similar reasons, it might be helpful to expose the `T` as a `Type` on the `IProcessor`: ``` public interface IProcessor { void Process(object instance); Type InstanceType {get;} } public interface IProcessor<T> : IProcessor { void Process(T instance); } class SomeClass: IProcessor<int> { public void Pr...
[ 0.11771190166473389, -0.1546398252248764, 0.31335586309432983, 0.12528300285339355, 0.03587210178375244, 0.3145862817764282, 0.042924534529447556, -0.22607211768627167, -0.2710946500301361, -0.8504836559295654, -0.27951109409332275, 0.5693492293357849, -0.4043585956096649, 0.33258494734764...
base-class might allow you to avoid some of this per-implementation: ``` abstract class SomeBase<T> : IProcessor<T> { public void Process(T instance) { OnProcess(instance); } Type IProcessor.InstanceType {get {return typeof(T);}} void IProcessor.Process(object instance) { Proces...
[ 0.07734807580709457, 0.07277018576860428, 0.1727663278579712, 0.17541591823101044, 0.18147145211696625, 0.16497038304805756, -0.03206326439976692, -0.20849522948265076, -0.24170884490013123, -0.5465192198753357, -0.19054296612739563, 0.5036445260047913, -0.4831641614437103, 0.2464384883642...
I have the following scenario: I have an edit page, which can be called from different pages. These pages could be the detail view for the current entity, or the list view for the entities (with or without a search in the route). HOW do I cleanly redirect to the original calling page using the MVC framework? Of cours...
[ 0.4332045018672943, 0.13315193355083466, 0.6552962064743042, -0.0015173574211075902, -0.13962619006633759, -0.07649264484643936, 0.33408835530281067, -0.05767745152115822, -0.11697380244731903, -0.7143497467041016, -0.024476459249854088, 0.3861890733242035, -0.12213267385959625, 0.22856374...
the previous page in a controller context? If I have that, I could store that temporarily and pass that to the redirect. [Do not use TempData when not redirecting.](http://blogs.teamb.com/craigstuntz/2009/01/23/37947/) One AJAX request from your edit page, and the TempData will go away. Tomas is right that a hidden el...
[ -0.01875830627977848, -0.1678321659564972, 0.45312991738319397, 0.4012475609779358, -0.06991957128047943, -0.3785020112991333, 0.5834115147590637, 0.0489124096930027, -0.41986382007598877, -0.672219455242157, -0.2338791936635971, 0.4434810280799866, -0.4873005151748657, 0.4399051070213318,...
Let's say I have two classes like the following: ``` Class A { public: .. private: int length; } Class B: public Class A { public: .. private: float length; } ``` What I would like to know is: 1. Is *overriding of base class data members* allowed? 2. If yes, is it a good practice? 3. If no, what is the best way...
[ 0.25655895471572876, 0.00840093195438385, -0.0985034853219986, 0.02528059110045433, -0.0478205680847168, -0.2888690233230591, 0.15483371913433075, -0.12008535116910934, -0.16856208443641663, -0.5065577626228333, -0.03109034150838852, 0.6436886787414551, -0.3576385974884033, 0.2296755760908...
can use templatized members i.e., generic members instead of overriding the members. You can also declare a VARIANT(COM) like union. ``` struct MyData { int vt; // To store the type union { LONG
[ 0.3287820518016815, -0.5273757576942444, 0.2019919604063034, 0.025049502030014992, 0.2179456651210785, 0.1410006284713745, 0.16586121916770935, -0.07973361015319824, -0.09902676194906235, -0.3473568260669708, -0.180071622133255, 0.42435818910598755, -0.4012818932533264, 0.46009689569473267...
lVal; BYTE bVal; SHORT iVal; FLOAT fltVal; . . } }; ```
[ -0.1742689162492752, 0.05067603662610054, 0.4968048334121704, -0.47016289830207825, 0.17494283616542816, 0.14301936328411102, -0.022654708474874496, 0.0181108471006155, -0.03418600931763649, -0.28260090947151184, -0.5532041192054749, 0.6513526439666748, -0.17790459096431732, 0.161035507917...
Let's say I have two strings: a and b. To compare whether a and be have the same values when case is ignored, I've always used: ``` // (Assume a and b have been verified not to be null) if (a.ToLower() == b.ToLower()) ``` However, using Reflector, I've seen this a few times in the .NET Framework: ``` // (arg three...
[ 0.3713989555835724, 0.16106967628002167, 0.09998258948326111, -0.37646275758743286, -0.540271520614624, 0.1416940689086914, 0.4290703237056732, -0.18324194848537445, 0.17724330723285675, -0.5808734893798828, 0.12270274758338928, 0.522305965423584, 0.036608532071113586, 0.18449458479881287,...
should explain things. Essentially, the reason is for compatibility across different cultures settings.
[ 0.34997034072875977, 0.22987373173236847, -0.251408189535141, 0.41821566224098206, 0.2179241180419922, -0.2088276445865631, 0.3522312343120575, -0.029751205816864967, 0.08675547689199448, -0.5453352928161621, -0.03918834775686264, 0.2642784118652344, -0.344584196805954, 0.03441269695758819...
I would like to learn some SAS because I am interested in a few industries that tend to use it exclusively. However, I don't want to get stuck with a resource that assumes I know nothing about statistical programming. Is there a good guide for programmers with statistics experience in R? Thanks, Steven Robert A Muench...
[ 0.43540385365486145, 0.27766069769859314, -0.33457043766975403, 0.14577151834964752, -0.1346166580915451, -0.296230673789978, 0.38917580246925354, 0.10634841024875641, -0.21359603106975555, -0.5354843139648438, -0.1816530078649521, 0.25652119517326355, 0.01479319017380476, -0.2500135302543...
in all three languages. It will also work well if you know R and want to back into SAS. It started as a free manuscript and then Springer helped him flesh it out into a full book. Here's some links: * [Muenchen's site](http://rforsasandspssusers.com/) * [R for SAS and SPSS Users](https://rads.stackoverflow.com/amzn/cl...
[ -0.07651767879724503, 0.15346547961235046, 0.18013602495193481, -0.19667206704616547, -0.12214955687522888, 0.11513877660036087, 0.4876724183559418, -0.39226600527763367, -0.11344267427921295, -0.4883773624897003, -0.5194877982139587, 0.27058812975883484, 0.0059319157153368, -0.17849935591...
one of the SAS tools. I learned SAS programming in graduate school and wrote programs in it for years. To me SAS was a language. I remember having a really awkward cocktail talk with the wife of a friend who told me she was learning SAS. I was excited and started talking about PROC statements and DATA STEP programming....
[ -0.20031356811523438, 0.20906150341033936, -0.4459437131881714, -0.09147996455430984, -0.44922032952308655, 0.11559558659791946, 0.3502022325992584, 0.33815354108810425, -0.011247748509049416, -0.5715612769126892, 0.24575549364089966, 0.29909318685531616, -0.10804032534360886, -0.273231744...
was learning to use. I soon realized that when people talk about using SAS it is about as specific as 'using Microsoft.' So it is worth brushing up on the suite of SAS BI tools, Data Mining tools, etc. I think they all have SAS language underneath them, but don't assume someone is talking about SAS programming just 'ca...
[ 0.24088849127292633, 0.3344244658946991, -0.29288849234580994, -0.07750950008630753, -0.46423083543777466, -0.17670835554599762, 0.3241162598133087, 0.4153847396373749, -0.022342655807733536, -0.5626515746116638, -0.1586841493844986, 0.4157644212245941, -0.00013436055451165885, 0.030384661...
I recently started attending two classes in school that focus on networking, one regarding distributed systems and another regarding computer networks in general. After completing the first labs for the two classes, I now have a pretty good understand of network protocol and socket concepts with both C and Java. Now I...
[ 0.3362089693546295, 0.20561043918132782, -0.06383760273456573, 0.20119506120681763, 0.18581463396549225, -0.08500108867883682, 0.0017357836477458477, 0.14543060958385468, -0.2940394878387451, -0.8553248047828674, 0.3178030848503113, 0.3878972828388214, 0.31157904863357544, 0.13167293369770...
all book about Network Programming is too detailed to start with and contains library to encapsulate the real socket programming. I would recommend to start with the [Beej's Guide to Network Programing](http://beej.us/guide/bgnet/) and then move to the [TCP/IP Sockets in C.](https://rads.stackoverflow.com/amzn/click/...
[ 0.32896995544433594, 0.22217175364494324, -0.05646616220474243, 0.25165432691574097, -0.3402261734008789, -0.28583574295043945, -0.0393863208591938, -0.03554201126098633, -0.08956962823867798, -0.5591180920600891, 0.054270412772893906, 0.5316464304924011, -0.07880882173776627, 0.0843909233...
I've got a number of scripts that use common definitions. How do I split them in multiple files? Furthermore, the application can not be installed in any way in my scenario; it must be possible to have an arbitrary number of versions concurrently running and it must work without superuser rights. Solutions I've come up...
[ 0.5728451013565063, 0.3708859980106354, -0.04435252025723457, 0.11824619024991989, 0.15769994258880615, -0.003746551228687167, 0.22860553860664368, -0.07258179038763046, -0.3456665277481079, -0.8962965607643127, 0.009557600133121014, 0.4036145508289337, -0.36957481503486633, 0.246301293373...
in its own directory**, write a `__init__.py` that imports all submodules and finally use `from . import` to load them. Keeps code organized, but it's a little bit of overhead to maintain `__init__.py` and qualify names. * **Add the library directory to `sys.path` and `import`.** I tend to this, but I'm not sure whethe...
[ 0.2757272720336914, -0.05541401728987694, 0.3724617660045624, 0.013177224434912205, -0.03976263850927353, -0.11737775802612305, 0.2242073118686676, -0.09323391318321228, -0.1599837988615036, -0.8965169191360474, -0.202501118183136, 0.5514464378356934, -0.3222461938858032, -0.23729491233825...
needs superuser rights and impacts other applications and is hence not applicable in my case. What is the best method? Adding to sys.path (usually using site.addsitedir) is quite common and not particularly frowned upon. Certainly you will want your common working shared stuff to be in modules somewhere convenient. I...
[ 0.4822777807712555, -0.19522897899150848, 0.4216204583644867, 0.013884169049561024, 0.020326513797044754, -0.3569030165672302, -0.058044303208589554, -0.23732970654964447, -0.5489209890365601, -0.6846344470977783, -0.3030100464820862, 0.6384550929069519, -0.3772464096546173, -0.03487795963...
What is the best way to automate the encryption of my c#.net application configuration file without interfering with the normal operations of the application? * Here is Microsoft's [recommendation](http://msdn.microsoft.com/en-us/library/ms998280.aspx). * Don't encrypt the whole file, obviously. Just encrypt sensitive ...
[ 0.16180017590522766, 0.13004139065742493, 0.184644415974617, 0.19832530617713928, 0.1636269986629486, -0.2155279666185379, 0.33036381006240845, -0.01555950753390789, -0.112540602684021, -0.7153140306472778, -0.3756122887134552, 0.6999852657318115, -0.4375291168689728, -0.1948995739221573, ...
When using the `rm` command to delete files in Powershell, they are permanently deleted. Instead of this, I would like to have the deleted item go to the recycle bin, like what happens when files are deleted through the UI. How can you do this in PowerShell? Here is a shorter version that reduces a bit of work ``` $...
[ -0.0484563484787941, -0.039251696318387985, 0.3761179745197296, 0.015605175867676735, 0.17551586031913757, -0.3450545370578766, 0.39591601490974426, -0.36752474308013916, -0.24554945528507233, -0.31854933500289917, -0.2622188925743103, 0.8391387462615967, -0.5104220509529114, 0.39270597696...
While creating and inserting DOM element's, it seems that the functions used for the task are returning before the elements show in the page. Before starting to insert the elements I set the display property of a div to 'block' and after inserting the elements I set the property to 'none', the problem is, the indicato...
[ -0.04628351703286171, 0.0077988808043301105, 0.5636780261993408, -0.35881951451301575, 0.04660004377365112, 0.09668590873479843, 0.5166490077972412, -0.7409648895263672, -0.05964108556509018, -0.6019021272659302, -0.3882848918437958, 0.2175234705209732, -0.45058581233024597, 0.218058258295...
container.appendChild(para); } $('loading').className="hidden"; ``` It appears as createElement and/or appendChild run asynchronously, so I'm hiding the indicator almost immediately? I believe that the DOM won't refresh until after the script has finished running. To make it run asynchronously, you could try...
[ 0.4058390259742737, -0.1053481325507164, 0.42659249901771545, -0.3801819682121277, 0.1613137125968933, -0.06662619858980179, 0.4432118535041809, -0.3787032961845398, -0.06329423934221268, -0.621436357498169, -0.14040660858154297, 0.5547820925712585, -0.39311784505844116, 0.2191201746463775...
Is there any documentation on the parameters to WebForm\_PostBackOptions? I can't find anything by Googling. There is no official documentation on this. However if you look at the javascript source code you will see this: ``` function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, act...
[ 0.08538458496332169, 0.05925438180565834, 0.0009669637074694037, -0.16907630860805511, -0.3243951201438904, 0.11540099233388901, -0.0050433846190571785, 0.20979680120944977, -0.4857756793498993, -0.18630656599998474, 0.0012500890297815204, 0.6533159017562866, -0.15504473447799683, -0.09947...
Lambda calculus of course is quite elegant, but doesn't it bother you that there is this asymmetry between input and output of a function? I.e. you can make the function take two parameters (by returning a function) but you can't make it return two values. I don't think we could find it in [The Book](http://en.wikipedi...
[ -0.076754130423069, -0.06372702121734619, -0.1571754366159439, 0.15663138031959534, -0.10749804973602295, 0.010985344648361206, -0.06571347266435623, 0.04065634310245514, 0.0234791561961174, -0.16527138650417328, 0.218621164560318, 0.697533130645752, -0.4876583218574524, -0.172997564077377...
this is a rather basic java question I have an array containing String that i want to sort using java.util.Arrays.sort when i write ``` String[] myArray = {"A","B","C"}; java.util.Arrays.sort(myArray); ``` it gets sorted correctly however when i have ``` String[] myArray = new String[10]; myArray[0] = "A"; myArr...
[ -0.023620005697011948, 0.2240152657032013, 0.2500174045562744, -0.20786389708518982, -0.18684084713459015, -0.04980480670928955, 0.45109573006629944, -0.3666341006755829, -0.07086466997861862, -0.6686094999313354, -0.046703170984983444, 0.19338150322437286, -0.3654170036315918, -0.07616358...
I want to make my WPF application open the default browser and go to a certain web page. How do I do that? For desktop versions of .NET: ```cs System.Diagnostics.Process.Start("http://www.webpage.com"); ``` For .NET Core, the default for [`ProcessStartInfo.UseShellExecute`](https://learn.microsoft.com/en-us/dotnet/a...
[ 0.6087719202041626, 0.2257310003042221, 0.721868634223938, -0.23470696806907654, 0.2288459986448288, -0.11580988764762878, 0.40892547369003296, -0.37200576066970825, -0.12545475363731384, -0.6850833296775818, -0.10008086264133453, 0.5720847845077515, -0.08493396639823914, 0.022878780961036...
are usable for UWP).
[ 0.17109644412994385, -0.1273452192544937, 0.5497023463249207, 0.02783442847430706, 0.2405969798564911, -0.05573797971010208, 0.09715786576271057, -0.1671455204486847, -0.11904075741767883, -0.3568772077560425, -0.4107412099838257, 0.569496750831604, -0.019330983981490135, -0.04848667979240...
I am currently working on a project with which I need to program up a bit of a proof of concept app. I have written PoC apps before but they have only been really small and haven't really had lots of layers where as the app I'm writing now has a: * Form layer - talks to data layer. * Data layer - talks to Database and...
[ 0.33763033151626587, 0.3213488757610321, 0.42343869805336, 0.2823629379272461, 0.057294052094221115, 0.3345791697502136, 0.04505864530801773, -0.004766811151057482, -0.22301600873470306, -0.7834212183952332, 0.13025224208831787, 0.39269518852233887, 0.023749763146042824, -0.240903005003929...
that is needed, without needing to invest a lot of time in writing the PoC. I already have the idea in my head on how it should all go together but I'm having a bit of trouble showing my team mates what I mean. Can anyone recommend any tips/tricks when coding up PoCs? Or would there be a better way to explain what I ...
[ 0.687473475933075, 0.2555529475212097, -0.14473594725131989, 0.17064273357391357, 0.19625161588191986, 0.24378807842731476, -0.08342193812131882, 0.04408087208867073, -0.23375962674617767, -0.6687192916870117, 0.1932385116815567, 0.5372531414031982, 0.2881850600242615, -0.3182239234447479,...
be used in the final product, thus forcing it to be rewritten as production-quality. Some ideas I've used: * Write a pre-scripted network client using shell scripts (`netcat` and a lot of `bash`) * Write a server in Python, Ruby, or another RAD language you're familiar with * Use a technology that is simpler than your...
[ 0.8126568794250488, 0.08414363116025925, 0.15384450554847717, 0.05632058531045914, -0.052693501114845276, -0.34665828943252563, 0.18463055789470673, 0.22537826001644135, 0.08051984012126923, -0.6234666109085083, -0.3548792600631714, 0.5424548983573914, -0.14680859446525574, 0.1289332211017...
as a static HTML page (no styling or anything, ugly as sin) * If possible replace any remote interactions (database, network) with local object interactions, with handwaving to say "really these two steps would occur separately"
[ 0.07435984164476395, -0.21706925332546234, 0.35611850023269653, -0.055418677628040314, -0.37488314509391785, -0.2976541817188263, 0.7035312056541443, 0.3348672688007355, -0.4306282699108124, -0.6287490725517273, -0.4449624717235565, 0.032518111169338226, -0.4144403636455536, -0.01105436030...
I want to include a silverlight application (.xap file) inside a HTML page. Using these [MSDN instructions](http://msdn.microsoft.com/en-us/library/cc189089(VS.95).aspx) I create this HTML page: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xml...
[ 0.4473014771938324, 0.4171786308288574, 0.6468693614006042, -0.01591665670275688, -0.29299211502075195, 0.0022129605058580637, 0.1074218675494194, -0.6361081600189209, -0.12675908207893372, -0.3520265817642212, -0.04569989815354347, 0.04488051310181618, -0.22826315462589264, 0.206231415271...
style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object> </body> </html> ``` but when I view it in Firefox I get a pop-up asking if I want to run the .xap file: [alt t...
[ 0.6177579164505005, 0.2858097553253174, 0.8740298748016357, -0.15796025097370148, -0.14310117065906525, -0.3931286334991455, 0.29162487387657166, -0.28541186451911926, -0.24500903487205505, -0.351337730884552, -0.0043671829625964165, 0.27425092458724976, -0.49995294213294983, -0.1003155261...
MIME type of application/x-silverlight-app for the XAP extension?
[ 0.679614782333374, -0.016465162858366966, 0.18070630729198456, 0.18155290186405182, 0.14380992949008942, -0.06486086547374725, 0.4902224838733673, 0.13048438727855682, -0.13604788482189178, -0.11076617240905762, -0.18034137785434723, 0.285641074180603, -0.45169657468795776, -0.253283023834...
consider this simple servlet sample: ``` protected void doGet(HttpServletRequest request, HttpServletResponse response){ Cookie cookie = request.getCookie(); // do weird stuff with cookie object } ``` I always wonder.. if you modify the object `cookie`, is it by object or by reference? > if you modify the ob...
[ 0.1418696492910385, 0.004487336613237858, 0.009137066081166267, 0.02178511954843998, 0.05709409341216087, -0.35293471813201904, 0.2938123047351837, -0.0376884900033474, -0.20111291110515594, -0.4984203279018402, -0.29149308800697327, 0.2811656594276428, -0.5761650204658508, 0.3641387522220...
e.g. by calling `cookie.setSomeProperty(otherValue)`, then you are of course modifying the object itself. Take a look at these previous related questions for more information: * [Java, pass-by-value, reference variables](https://stackoverflow.com/questions/498747/java-pass-by-value-reference-variables) * [Is Java pas...
[ 0.12638981640338898, -0.09620419144630432, 0.18504314124584198, -0.02689995989203453, -0.0026289974339306355, -0.23052720725536346, 0.2534157335758209, -0.179697647690773, -0.33259710669517517, -0.4318896234035492, -0.39761704206466675, 0.367093563079834, -0.5079487562179565, 0.16146782040...
I do not see "Create GUID" option under the menu item Tools -> . I am using Visual Studio 2005 . Do I have to install anything for that . It's likely missing because the profile you chose does not include that particular option. Try the following 1. Tools -> Import and Export Settings 2. Select "Reset all Settings" a...
[ 0.16288401186466217, 0.17128261923789978, 0.28752413392066956, -0.15923286974430084, -0.15917831659317017, -0.1057480201125145, 0.30832958221435547, -0.010691944509744644, 0.09912128001451492, -0.8749078512191772, -0.03990452364087105, 1.0893430709838867, -0.19582468271255493, -0.083154775...
How do you create a main window that fills the entire desktop **without covering (or being covered by) the task bar** and **without being maximized**? I can find the entire screen size with and set the main window accordingly with this: ``` window = gtk.Window() screen = window.get_screen() window.resize(screen.get_wi...
[ 0.04132509231567383, -0.1036539301276207, 0.16073529422283173, -0.14076878130435944, 0.05357832461595535, -0.00023084059648681432, 0.22516533732414246, -0.06801953911781311, -0.2996967136859894, -0.8862755298614502, -0.16106277704238892, 0.6601179242134094, -0.1163187250494957, 0.031896721...
able to remember where it was when it is unmaximized. So before I show you this hideous hack, I urge you to consider using proper maximization and just be happy with it. So here goes: ``` import gtk # Even I am ashamed by this # Set up a one-time signal handler to detect size changes def _on_size_req(win, req): ...
[ 0.09292173385620117, -0.01057240180671215, 0.425381600856781, 0.051029764115810394, 0.07557187974452972, -0.12481547892093658, 0.23967015743255615, -0.11878720670938492, -0.22286732494831085, -0.7912851572036743, -0.294078528881073, 0.6685190200805664, -0.47521233558654785, 0.0180456973612...
then maximise it w = gtk.Window() w.show_all() w.connection_id = w.connect('size-request', _on_size_req) # Maximizing will fire the signal handler just once, # unmaximize, and then resize to the previously set size for maximization. w.maximize() # run this monstrosity gtk.main() ```
[ 0.08398287743330002, -0.31068313121795654, 0.689060389995575, -0.07973752170801163, -0.02116541378200054, -0.17987199127674103, 0.36090779304504395, -0.4852699935436249, -0.05845719203352928, -0.5438759922981262, -0.0291044432669878, 0.7981557846069336, -0.49934765696525574, -0.18161964416...
I need to access the assembly of my project in C#. I can see the GUID in the 'Assembly Information' dialog in under project properties, and at the moment I have just copied it to a const in the code. The GUID will never change, so this is not that bad of a solution, but it would be nice to access it directly. Is there...
[ 0.2936653196811676, 0.2636454701423645, 0.35843411087989807, -0.4113978147506714, 0.23501592874526978, 0.05452137440443039, 0.4345163404941559, -0.08323805779218674, -0.07595273852348328, -0.696993887424469, -0.09948315471410751, 0.5295669436454773, -0.4624890983104706, 0.28766965866088867...
var attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute),true)[0]; var id = attribute.Value; Console.WriteLine(id); } ```
[ -0.25534623861312866, 0.018818071112036705, 0.42178964614868164, -0.18316304683685303, 0.1922864466905594, 0.06866692006587982, 0.38585278391838074, -0.5117826461791992, 0.2883508503437042, -0.49428632855415344, -0.23429402709007263, 0.7780017256736755, -0.3277900815010071, 0.1350587606430...
My experiences with web-frameworks was that they are relative "unstable". Not that they crash but that there are quite a few changes which then force one to reprogram ones code. I wonder what web development packages you've used and how much work it was/is to maintain that code? "Changes are a part of the requirement."...
[ 0.6534221172332764, 0.5514922142028809, -0.09243733435869217, 0.2010887861251831, -0.04388568177819252, -0.32753986120224, 0.4721204936504364, -0.20553115010261536, -0.0805782899260521, -0.539325475692749, 0.11615874618291855, 0.6342607736587524, -0.220498189330101, -0.04149888828396797, ...
- Struts - few AJAX frameworks These are very basic one used. Most the other ones are self developed and once the design of the web package is done, we don't change the design.
[ 0.3597360849380493, 0.028217317536473274, 0.27531081438064575, 0.48634421825408936, -0.4059322476387024, -0.251110702753067, 0.22686609625816345, -0.31836068630218506, 0.04090119153261185, -0.536561906337738, 0.29115086793899536, 0.348114550113678, -0.3509552776813507, -0.2497226595878601,...
Is it possible to show calendar as shown below using jquery datepicker. ``` OCT-2009 Mon Tue Wed Thur Fri Sat Sun 28 29 30 1 2
[ 0.21466116607189178, 0.43108299374580383, 0.6981961131095886, -0.3357984721660614, -0.5000917315483093, 0.19597665965557098, 0.12594878673553467, 0.6429244875907898, -0.30098065733909607, -0.12557066977024078, -0.13730329275131226, 0.241037517786026, 0.464078426361084, 0.3914789855480194, ...
3 4 5 6 7 8 9 10 11 12 13 14 15 16
[ -0.6014447808265686, 0.666968584060669, 0.07781080901622772, -0.5249713063240051, -0.14489932358264923, 0.33526891469955444, 0.4957332909107208, -0.04479483142495155, -0.3778136670589447, -0.6137118339538574, -0.1337098628282547, -0.03969592973589897, -0.04792499914765358, 0.22381883859634...
17 18 19 20 21 22 23 24 25 26 27 28 29 30
[ 0.2562074363231659, 0.1450410634279251, 0.25459155440330505, -0.2650136649608612, -0.1356462687253952, 0.4870480000972748, 0.5591872930526733, -0.2727011442184448, -0.2756759226322174, -0.5929907560348511, -0.0054836212657392025, 0.12060442566871643, 0.0028826664201915264, -0.2189618945121...
31 1 ``` First four dates are from previous month and the last date is from next month. I want to generate datepicker calendar in this format only for all months. "Changes are a part of the requirement." I dont think that the web packages that we design changes a lot. If it changes, then it is a bad design. If ...
[ 0.5396175980567932, 0.12035300582647324, 0.4598389267921448, -0.0859626978635788, 0.12629123032093048, -0.2485673576593399, 0.20874769985675812, 0.03010181337594986, -0.04918909817934036, -0.5942208766937256, 0.03376312926411629, 0.2814124822616577, -0.4029523730278015, -0.1662977933883667...
ones are self developed and once the design of the web package is done, we don't change the design.
[ 0.45579540729522705, -0.0294040497392416, 0.09822656214237213, 0.373735249042511, 0.21958567202091217, -0.10922133922576904, -0.04774156212806702, 0.15769410133361816, 0.028865016996860504, -0.5345059633255005, -0.12713655829429626, 0.2319994568824768, -0.13292665779590607, -0.111173689365...
StringBuilder has a reputation as being a faster string manipulation tool than simply concatenating strings. Whether or not that's true, I'm left wondering about the results of StringBuilder operations and the strings they produce. A quick jaunt into Reflector shows that StringBuilder.ToString() doesn't always return ...
[ 0.5207437872886658, 0.23292450606822968, 0.4387553036212921, -0.3478076159954071, -0.12854309380054474, -0.14848972856998444, 0.2517358660697937, -0.43773600459098816, -0.34876367449760437, -0.2527737021446228, -0.06776398420333862, 0.46423014998435974, -0.14428189396858215, 0.395155876874...
newNewString different string instances or the same? I've tried to figure this out via reflector, and I'm just not quite understanding everything. How about this code? ``` StringBuilder sb = new StringBuilder("Foo\n"); StringReader sr = new StringReader(sb.ToString()); string s = sr.ReadLine(); sb.Append("Bar\n"); s ...
[ 0.04109009727835655, -0.18079955875873566, 0.5862744450569153, -0.3466167151927948, -0.06203867122530937, -0.1271428018808365, 0.44763725996017456, -0.42928528785705566, -0.5627536773681641, -0.3909502923488617, -0.04918336123228073, 0.5566852688789368, -0.46210774779319763, 0.267603486776...
internally but at the end of the day it won't return a string to you and then subsequently mutate it in a way that is visible to your code. As to whether subsequent calls to StringBuilder.ToString() returns the same instance of a String or a different String with the same value, that is implementation dependent and y...
[ 0.35038599371910095, -0.18850375711917877, 0.3414038121700287, -0.20777244865894318, 0.0303268413990736, -0.1887345165014267, 0.5724977254867554, -0.1288759410381317, -0.2551007568836212, -0.7518664002418518, -0.14228293299674988, 0.6283727288246155, -0.18939918279647827, 0.327332764863967...
Previously, when I needed to store a number of related variables, I'd create a class. ```js function Item(id, speaker, country) { this.id = id; this.speaker = speaker; this.country = country; } var myItems = [new Item(1, 'john', 'au'), new Item(2, 'mary', 'us')]; ``` But I'm wondering if this is a good practic...
[ 0.12995438277721405, 0.029960326850414276, 0.3090541660785675, -0.006131594534963369, -0.04271075502038002, 0.4456515312194824, 0.49550411105155945, -0.13619449734687805, -0.2881508469581604, -0.6512132287025452, -0.32021597027778625, 0.4122343063354492, -0.2820527255535126, 0.388828307390...
make a struct factory. ``` function makeStruct(names) { var names = names.split(' '); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } } return constructor; } var Item = makeStruct("id speaker country"); var row = new Item(1,...
[ 0.35677221417427063, 0.03578536957502365, 0.5009098052978516, -0.4082126319408417, 0.04517986625432968, 0.5071248412132263, 0.6699778437614441, -0.2018124759197235, -0.13112948834896088, -0.5179080367088318, -0.5574374198913574, 0.3868241310119629, -0.5974395871162415, 0.4506750702857971, ...
I am relatively new to jQuery and web development. I am using jQuery UI Tabs to create tabs. But I want the contents to be loaded only when I select a particular tab. OK, I assume when the user clicks a tab, you intend to fetch content dynamically, via AJAX. This really involves two things, **setting an onclick even ...
[ 0.17224186658859253, -0.04037728160619736, 0.32739484310150146, 0.02362043410539627, -0.350812703371048, -0.3060518801212311, -0.01118853036314249, 0.1705503761768341, -0.22222581505775452, -0.638170063495636, 0.04386535659432411, 0.6672326326370239, -0.107791006565094, 0.02239921875298023...
your *my\_tab* tab: ``` $(".my_tab").bind("click", handle_tab_click); ``` Your *handle\_tab\_click()* function will be given an *event* argument which will be able to provide you with information on the element that fired the event (in this case, the element with class name *my\_tab*). ``` function (event) { if...
[ -0.06457865238189697, 0.04848688468337059, 0.34021562337875366, -0.11803149431943893, -0.1667984426021576, 0.05029261112213135, 0.19206087291240692, -0.2911075949668884, -0.29273760318756104, -0.3330407440662384, -0.019602861255407333, 0.7351685166358948, -0.29729586839675903, -0.045164637...
tab was clicked (in order to fetch the appropriate information). In the following snippet, we're invoking the remote script *myscript.php*, supplying the HTTP GET argument *tab\_clicked=my\_tab* and calling the function *tab\_fetch\_cb* when the script returns. The final parameter is the type of data being returned (it...
[ -0.11414157599210739, 0.013207093812525272, 0.7642532587051392, -0.10413756966590881, -0.3103131651878357, 0.05904101952910423, -0.1452065408229828, -0.21798387169837952, -0.12100040167570114, -0.6192002892494202, -0.016422104090452194, 0.47040945291519165, -0.1916787326335907, 0.259234130...
// returned from myscript.php here } ``` You can read more about the JQuery *get* function [here](http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype), and JQuery ajax functions [here](http://docs.jquery.com/Ajax) I'm sorry I can't be more specific in my examples, but a lot of the processing is really dependa...
[ 0.14095231890678406, 0.3273242115974426, 0.20170874893665314, 0.15374523401260376, -0.26873353123664856, -0.3022700250148773, 0.24593807756900787, 0.5037904381752014, -0.3555976152420044, -0.7940348982810974, -0.08668764680624008, 0.8132234215736389, 0.20933501422405243, -0.095793478190898...
I'm having an PHP application running on IIS7. I want to secure particular folder by modifying `web.config`. I don't want to use `<location>` tag in config as this will redirect users to login page. Rather then, I'd like to implement `HttpNotFoundHandler`. Say for example, <http://domain.com/SecureFolder> is the direc...
[ 0.2508731782436371, 0.0821777731180191, 0.25711196660995483, -0.011173032224178314, -0.018201397731900215, -0.32826006412506104, 0.2975384593009949, 0.05055722966790199, -0.2857089340686798, -0.9745299816131592, -0.01445548702031374, 0.4339269697666168, -0.2826176881790161, 0.3970271050930...
<appSettings /> <system.web> <customErrors mode="RemoteOnly"></customErrors> <httpHandlers> <add path="~/securefolder" verb="*" type="System.Web.HttpNotFoundHandler" validate="true"/> </httpHandlers> </system.web> </configuration> ``` OK, I assume when the user clicks a tab, you inten...
[ -0.20240800082683563, -0.028805265203118324, 0.7441391944885254, 0.025638476014137268, -0.05119834095239639, 0.029217330738902092, -0.11356651782989502, -0.03465006500482559, -0.4726281464099884, -0.45803573727607727, -0.19385740160942078, 0.768864631652832, -0.38503485918045044, -0.343390...
fire. Here's an example of binding the *onclick* event to your *my\_tab* tab: ``` $(".my_tab").bind("click", handle_tab_click); ``` Your *handle\_tab\_click()* function will be given an *event* argument which will be able to provide you with information on the element that fired the event (in this case, the element ...
[ -0.002199088456109166, 0.17341719567775726, 0.2840503454208374, -0.1751975268125534, -0.2588600516319275, -0.13970893621444702, 0.3173111379146576, -0.555525004863739, -0.2248656153678894, -0.38837143778800964, -0.10165981948375702, 0.8480357527732849, -0.27691853046417236, -0.171580627560...
to invoke a remote script while supplying information about which tab was clicked (in order to fetch the appropriate information). In the following snippet, we're invoking the remote script *myscript.php*, supplying the HTTP GET argument *tab\_clicked=my\_tab* and calling the function *tab\_fetch\_cb* when the script r...
[ 0.06669765710830688, -0.04280836135149002, 0.5824483633041382, -0.024632716551423073, -0.2674384117126465, -0.0017827219562605023, -0.02535119839012623, -0.34428074955940247, 0.043220460414886475, -0.6233550310134888, -0.12401285767555237, 0.6444665193557739, -0.12729232013225555, 0.122199...
// populate your newly opened tab with information // returned from myscript.php here } ``` You can read more about the JQuery *get* function [here](http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype), and JQuery ajax functions [here](http://docs.jquery.com/Ajax) I'm sorry I can't be more specific in my...
[ 0.19592255353927612, 0.3927949070930481, 0.283001184463501, 0.07172083854675293, -0.2539035677909851, -0.2460891604423523, 0.2414400428533554, 0.6135973930358887, -0.3821869492530823, -0.759954571723938, -0.0693584680557251, 0.7913198471069336, 0.10227800160646439, -0.08197106420993805, ...
Is there an equivalent in Java to the passing on const references in C++? Isn't leaving out the "constness" misleading in regard to the method signature? No, there isn't. Java "final" is not an exact equivalent of C++ "const". The following (delayed initialization of a final variable) works in Java: ``` final doub...
[ 0.0584418959915638, -0.4086233675479889, 0.34114325046539307, -0.3149363100528717, -0.3358149826526642, -0.07725135236978531, 0.1875949501991272, -0.1254095584154129, -0.1265682578086853, -0.3707132935523987, -0.1425127387046814, 0.44002920389175415, -0.33879268169403076, 0.227034509181976...
inside any anonymous class created inside your method. PS. I was first disappointed by the lack of "const" in Java but later learned to live with "final". PS2. The Java glossary (<http://mindprod.com/jgloss/immutable.html>) linked to in this thread has one thing wrong: no, you are not given a 100% guaranntee that the...
[ 0.2719372808933258, -0.22686892747879028, 0.17731210589408875, -0.21015216410160065, -0.2074916660785675, -0.10438273102045059, 0.5272753238677979, -0.22169183194637299, -0.06177442893385887, -0.5645368695259094, 0.042889948934316635, 0.06131655350327492, -0.5964678525924683, 0.07465821504...
the register, it will be truncated and change its value. As Joel Spolsky says, "abstraction has sprung a leak".
[ 0.15250535309314728, -0.17529791593551636, -0.22090299427509308, 0.2290915846824646, 0.14777690172195435, 0.06869307160377502, 0.14427724480628967, -0.07684403657913208, -0.004075140692293644, -0.1743791103363037, -0.1565583497285843, 0.43165504932403564, -0.35076093673706055, 0.2609876096...
I come from a c# background where everything has its own namespace, but this practice appears to be uncommon in the c++ world. Should I wrap my code in it's own namespace, the unnamed namespace, or no namespace? Many C++ developers do not use namespaces, sadly. When I started with C++, I didn't use them for a long time...
[ 0.6463361382484436, 0.30100008845329285, -0.14450286328792572, -0.09642694890499115, -0.2807892858982086, 0.06047403812408447, 0.27436089515686035, 0.18374289572238922, 0.006856075022369623, -0.6556552648544312, -0.12485912442207336, 0.2270776480436325, -0.09318502992391586, 0.035785742104...
that, but it requires you to type that prefix all over again, even though when it can be deduced from the context which declarations you mean. Namespaces have a hierarchic order. Names that are lexically closer to the point that reference them are found earlier. So if you reference "Window" within your GUI framework, i...
[ -0.008387496694922447, 0.029472459107637405, 0.1312226951122284, 0.30615806579589844, -0.048222821205854416, -0.13950851559638977, 0.15800157189369202, 0.10770519822835922, -0.17861871421337128, -0.9537626504898071, -0.34510013461112976, 0.37243083119392395, -0.1859070509672165, 0.12093148...
front by importing all names, or selectively only some of them into the current scope ("using declaration"). Nowadays, I don't do any project anymore without using them. They make it so easy not to type the same prefix all over again, but still have good organization and avoidance of name-pollution of the global name...
[ 0.46462583541870117, 0.3156064748764038, 0.17294055223464966, -0.05048617720603943, -0.328665167093277, 0.0896415039896965, 0.01661386713385582, 0.11799784749746323, -0.13910850882530212, -0.46441859006881714, -0.13464932143688202, 0.4373958110809326, 0.00232656835578382, 0.298063397407531...
I'm currently trying out some questions just to practice my programming skills. ( Not taking it in school or anything yet, self taught ) I came across this problem which required me to read in a number from a given txt file. This number would be N. Now I'm suppose to find the Nth prime number for N <= 10 000. After I f...
[ 0.38499608635902405, 0.21688897907733917, 0.3663092851638794, -0.10223966091871262, -0.05447757616639137, 0.42426764965057373, 0.21868912875652313, -0.009814199060201645, -0.3199731707572937, -0.5752888321876526, 0.35448986291885376, 0.34826648235321045, -0.23806853592395782, 0.15509890019...
array to save previously found prime numbers so as to use them to check against future numbers. Even when my array was size 100, as long as the input integer was roughly < 15, the program crashes. ``` #include <cstdio> #include <iostream> #include <cstdlib> #include <fstream> using namespace std; int main() { ifs...
[ -0.06511414051055908, 0.03022778406739235, 0.5424107909202576, -0.3462434411048889, 0.12303067743778229, 0.20028972625732422, 0.26862478256225586, -0.41648203134536743, -0.14290788769721985, -0.5594333410263062, 0.1473502814769745, 0.5124626159667969, -0.5301967859268188, 0.057141136378049...
case 1: { write << 2 << endl; break; } case 2: { write << 3 << endl; break;
[ -0.5359438061714172, -0.15988066792488098, 0.06821943074464798, -0.2571113109588623, 0.18028110265731812, -0.08192374557256699, 0.224969282746315, -0.3750769793987274, 0.09047437459230423, -0.2582411766052246, -0.6106940507888794, 0.39638811349868774, -0.46266692876815796, -0.1867100000381...
} case 3: { write << 5 << endl; break; } case 4: { write << 7 << endl;
[ -0.4230991005897522, -0.13384808599948883, 0.3207637667655945, -0.2716033160686493, 0.4073910415172577, -0.04526710882782936, 0.2571173906326294, -0.2647310495376587, 0.04831688478589058, -0.27480754256248474, -0.6652577519416809, 0.5487960577011108, -0.3364339768886566, 0.0461915917694568...
break; } default: { for (int a = 10; a <= 1000000; a++) { check = false; if (((a % 2) != 0) && ((a % 3) != 0) && ((a % 5) != 0) &&
[ -0.04312264174222946, -0.07380715757608414, 0.028789322823286057, -0.2775220274925232, 0.4886285066604614, 0.03811440244317055, 0.8164541125297546, -0.2937406003475189, -0.19324582815170288, 0.012803837656974792, -0.596061110496521, 0.44769400358200073, -0.3065090775489807, 0.0142574030905...
((a % 7) != 0)) // first filter { for (int d = 0; d <= b; d++) { c = num[d];
[ 0.08268775045871735, -0.7826518416404724, 0.14686577022075653, -0.4825233817100525, 0.013215801678597927, 0.004833321552723646, 0.2225732058286667, -0.4469364881515503, 0.21314649283885956, -0.6539708375930786, -0.4222819209098816, 0.6294609308242798, -0.6688314080238342, -0.23089253902435...
if ((a % c) == 0) { check = true; // second filter based on previous recorded primes in array break;
[ 0.22815968096256256, -0.34044042229652405, -0.18448221683502197, -0.4080319404602051, 0.29394927620887756, -0.184294655919075, 0.3424285054206848, -0.6087278127670288, 0.2783922553062439, -0.29693564772605896, -0.30173763632774353, 0.6494829058647156, -0.6573101878166199, -0.09594829380512...
} } if (!check) { e = a; if (b <= 100) {
[ 0.1874905675649643, 0.07823137193918228, 0.1033887192606926, -0.5151935815811157, 0.4962114691734314, -0.1684523969888687, 0.4039716422557831, -0.33338576555252075, 0.5217941999435425, -0.18388409912586212, -0.36023181676864624, 0.7254920601844788, -0.24393635988235474, -0.240476593375206,...
num[b] = a; } b = b + 1; }
[ -0.10975342988967896, 0.15283219516277313, -0.2890549600124359, -0.5226736068725586, -0.16734114289283752, 0.035097554326057434, 0.25153592228889465, -0.20203815400600433, -0.0451030507683754, 0.14849068224430084, -0.27615290880203247, 0.2282107174396515, -0.23341071605682373, 0.2021939158...
} if ((b) == (prime - 4)) { write << e << endl; break; }
[ -0.07913313806056976, -0.0005714315338991582, 0.09840650111436844, -0.4641350209712982, 0.46392858028411865, -0.157136932015419, 0.35072919726371765, -0.345370352268219, 0.10896258056163788, -0.1956941932439804, -0.6363288760185242, 0.6406629085540771, -0.42905113101005554, 0.1435351371765...
} } } trial.close(); write.close(); return 0; } ``` I did this entirely base on my dummies guide and myself so do forgive some code inefficiency and general newbie-ness of my algorithm. Also for up to 15 it displays the prime numbers correctly. Could anyone tell me how I should go about impr...
[ 0.340140163898468, 0.37719032168388367, 0.44532838463783264, -0.19868722558021545, 0.19641514122486115, 0.21868087351322174, 0.39801084995269775, -0.33541446924209595, -0.29946455359458923, -0.7691798210144043, 0.17630931735038757, 0.9232417941093445, -0.3218860328197479, -0.24010583758354...
<cstdlib> #include <fstream> using namespace std; int main() { ifstream trial; trial.open("C:\\Users\\User\\Documents\\trial.txt"); int prime, e; trial>>prime; ofstream write; write.open("C:\\Users\\User\\Documents\\answer.txt"); int num[10000], currentPrime, c, primePrint; bool check; currentPrime=0; num[currentPri...
[ -0.22277796268463135, -0.34780582785606384, 0.5180294513702393, -0.30785468220710754, 0.18320639431476593, 0.02077825926244259, 0.2518481910228729, -0.5732342600822449, -0.2239026129245758, -0.5235455632209778, -0.35921916365623474, 0.25363224744796753, -0.47177645564079285, 0.127732098102...
(!check) { e=currentInt; if( currentInt!= 2 ) { num[currentPrime]= currentInt;} currentPrime = currentPrime+1;} if(currentPrime==prime) { write<<e<<endl; break;} } trial.close(); write.close(); return 0; } ``` This is the finalized version base on my original code. It works perf...
[ 0.06370171159505844, -0.06558262556791306, 0.7447865605354309, -0.3203352391719818, 0.3165105879306793, -0.1269107311964035, 0.3791685104370117, -0.6386844515800476, 0.0007291270303539932, -0.4183582067489624, 0.03770582005381584, 0.6399774551391602, -0.1817612648010254, 0.2368012815713882...
Slowly getting the hang of List matching and tail recursion, I needed a function which 'stitches' a list of lists together leaving off intermediate values (easier to show than explain): merge [[1;2;3];[3;4;5];[5;6;7]] //-> [1;2;3;4;5;6;7] The code for the List.merge function looks like this: ``` ///Like concat, but ...
[ 0.12145822495222092, -0.42316025495529175, 0.4910888075828552, -0.2553063929080963, -0.2551121413707733, -0.07087461650371552, 0.2558203339576721, -0.48202818632125854, -0.19374260306358337, -0.6614953875541687, -0.04160319268703461, 0.38528889417648315, -0.6947788000106812, 0.151391744613...
match acc with | [] -> loop (acc @ h) t | _ -> loop (acc @ (List.tl h)) t //first time omit first value loop [] lst ``` *(OK, it's not quite like concat, because it only handles two levels of list)* Question: How to do this for a Seq of Seqs (without using a mutable flag)? **UPDATE** (re...
[ -0.04344363883137703, -0.33986273407936096, 0.44138357043266296, 0.14204101264476776, -0.03289920464158058, -0.21071097254753113, 0.22687920928001404, -0.6110325455665588, -0.07732411473989487, -0.6351948380470276, 0.3457699120044708, 0.32078438997268677, -0.4459483027458191, -0.0701433122...
'segments' which are based on an option type: ``` type SegmentDef = Straight of float | Curve of float * float let Project sampleinterval segdefs = //('clever' code here) ``` When I do a List.map (Project 1.) ListOfSegmentDefs, I get back a list where each segment begins on the same point where the previous segment ...
[ 0.1913653165102005, -0.0047368681989610195, 0.4389829635620117, -0.10604799538850784, 0.01564968004822731, 0.28047072887420654, 0.2031366378068924, -0.5097960233688354, -0.38445165753364563, -0.7573505640029907, -0.12166524678468704, -0.030788345262408257, -0.32830458879470825, 0.314706087...
num[10000], currentPrime, c, primePrint; bool check; currentPrime=0; num[currentPrime] = 2; currentPrime=1; for(int currentInt=2; currentInt<=1000000; currentInt++) {check = false; for( int arrayPrime=0; arrayPrime<currentPrime; arrayPrime++) { c=num[arrayPrime]; if ((currentInt%c)==0) { check =...
[ 0.08955182880163193, -0.5233865976333618, 0.2128760814666748, -0.31072112917900085, 0.26263099908828735, 0.24284662306308746, 0.2689371407032013, -0.6025918126106262, -0.016915610060095787, -0.3603188991546631, -0.28798776865005493, 0.5401473045349121, -0.3743181824684143, 0.12580342590808...
if( currentInt!= 2 ) { num[currentPrime]= currentInt;} currentPrime = currentPrime+1;} if(currentPrime==prime) { write<<e<<endl; break;} } trial.close(); write.close(); return 0; } ``` This is the finalized version base on my original code. It works perfectly and if you want to increase t...
[ -0.0495833195745945, -0.12892957031726837, 0.7942548990249634, -0.388028621673584, 0.3528319299221039, -0.10143941640853882, 0.28512561321258545, -0.6996327042579651, -0.05512833595275879, -0.35925349593162537, 0.1284169852733612, 0.6119035482406616, -0.1648194044828415, 0.2167098671197891...
what would happen if I spin off a thread to execute a long-running process right before the ASP.NET page lifecycle completes? Will the ASP.NET runtime kill the thread? Can this lead to undefined behaviour? Here's a sample of the code, which spins the background thread in the Page\_Load event. Is this a safe thing to d...
[ 0.42250892519950867, -0.05218067020177841, 0.4003099203109741, -0.17570677399635315, 0.1866522878408432, -0.21362894773483276, 0.4499393403530121, -0.2704760730266571, -0.2626524567604065, -0.4050096869468689, -0.026116348803043365, 0.6020218729972839, -0.42355069518089294, 0.2942989170551...
code doing some time consuming logging in a separate thread. It seems to work well, but I haven't tested it in a production enviroment. The only difference between your code and mine is that I used the thread pool instead of setting up a new thread. You will probably make copies of any request data and other page inf...
[ 0.8115485906600952, -0.11921864002943039, 0.012536522932350636, 0.30708426237106323, -0.0759599357843399, -0.0945446789264679, 0.2296522557735443, 0.11177457123994827, -0.22651763260364532, -0.5467701554298401, 0.5089970231056213, 0.5081080198287964, -0.14855988323688507, -0.01397939212620...
We plan to install a Subversion repository in an environment where the network is quite slow on its own. The previous VCS used there was VSS, and it was a nightmare to use it (not only because of its "feature"). So, my question is the choice between Svnserve and the apache module. I know that the apache module will be...
[ 0.3414098918437958, -0.3519633114337921, 0.5143951177597046, 0.1709771305322647, -0.04539857432246208, -0.23711858689785004, 0.25417840480804443, 0.019450802356004715, -0.24097685515880585, -0.5941811203956604, 0.06027272716164589, 0.3185387849807739, 0.035468485206365585, 0.24010916054248...
In most cases, if the version control system Subversion's performance is discussed, the topics revolve around the repository backends used (Berkeley DB (bdb) vs. FSFS) and tuning some server software or even hardware parameters. > > > It seems to be less known that the choice of the server variant used - the Apache S...
[ 0.056516095995903015, -0.3875395357608795, 0.25028306245803833, 0.021814193576574326, -0.47933658957481384, -0.17252297699451447, 0.5407062768936157, -0.301957905292511, -0.2288462072610855, -0.4915415346622467, -0.16669034957885742, 0.3526407778263092, -0.19576504826545715, 0.080163180828...
performance was 30% to 400% slower than svnserve's. svnserve's performance was close to local direct accesses to the repository using the svn command line tools. > > > The most significant performance penalty was measured during svn log and svn merge operations against the mod\_dav\_svn server - you'll notice worse s...
[ 0.07447471469640732, 0.02192319743335247, 0.3165031969547272, -0.28768298029899597, -0.4572557508945465, 0.007147671654820442, 0.5661760568618774, -0.3797203004360199, -0.15243946015834808, -0.6765948534011841, -0.002471531042829156, 0.47279590368270874, 0.04783587157726288, -0.05098652094...