text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
answer I solved, thanks. In case anyone's interested, [bouncycastle](http://www.bouncycastle.org/) did the trick, just took me some time due to lack of knowledge from on my side and documentation. This is the code: ``` var bytesToDecrypt = Convert.FromBase64String("la0Cz.....D43g=="); // string to decrypt, base64 enc...
[ -0.5311647057533264, 0.2606378197669983, 0.5708814859390259, -0.0034574351739138365, -0.10631591081619263, 0.4316404163837433, 0.38603001832962036, -0.5334379076957703, -0.10047969222068787, -0.36556077003479004, -0.44540366530418396, 0.11109631508588791, -0.3938239514827728, 0.11285312473...
I had svnserve configured to look at directory "Foo" for the repository it served. Now I changed the configuration from one repository to multiple repositories, all contained in one directory "Bar". I reconfigured svnserve to look at "Bar", but now my client can't find any repositories. What am I doing wrong? Do I need...
[ 0.1135963499546051, 0.13536666333675385, 0.4578854739665985, -0.29655101895332336, 0.034365806728601456, 0.35515961050987244, 0.24653567373752594, -0.11377818882465363, -0.4431208074092865, -0.6040997505187988, -0.011730155907571316, 0.5006325244903564, -0.27928662300109863, 0.238948822021...
repository URL. Another solution would be to fire up multiple SVN servers with different ports using the --listen-port parameter. That would also change your URL. Yet another alternative is just adding new projects to your single existing repository; note that you'll have a single repository configuration this way --...
[ 0.2672635316848755, -0.06765130162239075, 0.1896364837884903, 0.5000958442687988, -0.20735086500644684, -0.25379833579063416, 0.30024826526641846, 0.12016208469867706, -0.41449424624443054, -0.5873706340789795, -0.14841270446777344, 0.42796462774276733, -0.1851457953453064, 0.5732606053352...
I am using UIImagePicker to take photo and save the photo. But appears the photo it takes was truncated on top and bottom, which was top and bottom menu when UIImagePicker taking the photo. I am wondering how to take the whole screen of the photo. Thanks. The UIImagePicker crops all images to 320x320 if you allow edit...
[ 0.1664355993270874, -0.32406550645828247, 0.5069451332092285, 0.07040026783943176, -0.12812887132167816, 0.09959989786148071, -0.11151175945997238, 0.011208983138203621, -0.4208998382091522, -1.0223093032836914, 0.0673697292804718, 0.4631551504135132, -0.11049631983041763, -0.1023990511894...
How long does it take for an experienced Windows programmer to learn writing simple software for Mac OS X? Where does one start and what tools will be necessary? [THIS](https://rads.stackoverflow.com/amzn/click/com/0321503619). I came from a Win32 API background programming lately a lot in C# and I was able to pick u...
[ 0.5191115140914917, 0.16111618280410767, 0.013951156288385391, 0.03153778240084648, -0.12659482657909393, -0.14345575869083405, 0.3382539451122284, 0.1806228756904602, -0.2460462749004364, -0.7866654396057129, 0.18472306430339813, 0.7477948665618896, 0.21454951167106628, -0.139889374375343...
about 2 weeks to come up to speed and write simple applications. I think this is because the language and API are easy to learn and use and [Aaron Hillegass](http://www.bignerdranch.com/instructors/hillegass.shtml)'s [book](https://rads.stackoverflow.com/amzn/click/com/0321503619) was a big help.
[ -0.03687237575650215, 0.19815810024738312, -0.039989884942770004, 0.11881998926401138, 0.2210429459810257, -0.1299281120300293, 0.48462313413619995, -0.3114827871322632, -0.29952165484428406, -0.35466453433036804, -0.11594405025243759, 0.5963006615638733, 0.13886405527591705, -0.3674812316...
Hey! I was looking at this code at <http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html> I noticed that in some situations they used hex numbers, like in line 134: ``` for (j = 1; val && j <= 0x80; j <<= 1, q++) ``` Now why would they use the 0x80? I am not that good with hex but I found an online he...
[ 0.2489406019449234, 0.45142069458961487, 0.366764098405838, -0.002742470009252429, -0.07537641376256943, 0.2057730108499527, 0.09119327366352081, 0.011966435238718987, -0.5177321434020996, -0.5199949145317078, 0.19074177742004395, 0.4581044316291809, -0.22008487582206726, 0.061311535537242...
result to 0?? Why not just use the number? Can anyone please explain and please do give examples of other situations. Also I have seen large lines of code where it's just hex numbers and never really understood why :( In both cases you cite, the bit pattern of the number is important, not the actual number. For exam...
[ 0.0447130911052227, -0.2518259286880493, 0.3857572078704834, -0.018943632021546364, 0.0057324981316924095, 0.2513993978500366, 0.028066260740160942, -0.043904997408390045, -0.20677721500396729, -0.1814235895872116, -0.06668604165315628, 0.35176560282707214, -0.17554867267608643, 0.19424879...
but it's a bit clearer in Hex: `0x01`, `0x02`, `0x04`, `0x08`, `0x10`, `0x20`, `0x40`, and `0x80`. In the second example, the goal was to remove the lower two bytes of the value. So given a value of 1,234,567,890 we want to end up with 1,234,567,168. In hex, it's clearer: start with `0x4996:02d2`, end with `0x4996:...
[ 0.047078393399715424, 0.15688297152519226, 0.24501805007457733, -0.1261046677827835, -0.15563161671161652, 0.47167015075683594, -0.0012353566708043218, -0.055146727710962296, -0.2696186900138855, -0.5564818382263184, -0.16228649020195007, 0.05779844522476196, -0.18421335518360138, 0.122988...
I got dtd in file and I cant remove it. When i try to parse it in Java I get "Caused by: java.net.SocketException: Network is unreachable: connect", because its remote dtd. can I disable somehow dtd checking? You should be able to specify your own EntityResolver, or use specific features of your parser? See [here](http...
[ -0.08722046762704849, 0.19094783067703247, 0.4485679268836975, -0.14901167154312134, -0.09438244998455048, 0.03185087442398071, 0.4146418571472168, -0.23285488784313202, -0.20582915842533112, -0.5284999012947083, -0.3211583197116852, 0.5435402393341064, -0.5792093276977539, 0.3803505599498...
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) throw...
[ -0.08975249528884888, -0.013472900725901127, 0.44324737787246704, -0.05559062212705612, 0.31521090865135193, 0.3376767039299011, 0.5399109125137329, -0.5937379002571106, -0.13654394447803497, -0.3326718509197235, -0.2028997540473938, 0.3144422471523285, -0.24190601706504822, 0.353045433759...
", " + systemId); return new InputSource(new StringReader("")); } }); Document document = builder.parse(new File("src/foo.xml")); XPathFactory xpathFactory = XPathFactory.newInstance(); XPath xpath = xpathFactory.newXPath(); String content = xpath.eval...
[ 0.17426268756389618, 0.10034190118312836, 1.0090113878250122, -0.3835495114326477, 0.04930092394351959, 0.21858491003513336, 0.4404807686805725, -0.5425226092338562, 0.06587281823158264, -0.8004754781723022, -0.4706069827079773, 0.6775382161140442, -0.5139572620391846, 0.22323350608348846,...
.getDocumentElement()); System.out.println(content); } } ``` Hope this helps...
[ 0.11943206936120987, -0.053862761706113815, 0.5385026931762695, -0.09761413186788559, 0.5035033226013184, -0.340448260307312, 0.25948843359947205, 0.010947509668767452, -0.07751186192035675, -0.6898028254508972, -0.4775294363498688, 0.7911660671234131, -0.22980889678001404, 0.0741830617189...
Is there any sort of "out of the box" system within SharePoint (i.e. MOSS 2007) that is useful for tracking/managing permissions. We've got a relatively small installation, but I can easily see special permissions for special users/sites getting out of hand. I'm hoping there's something pre-baked into SharePoint that w...
[ 0.412091463804245, -0.006883483380079269, -0.2704221308231354, 0.015900766476988792, 0.07002745568752289, -0.13232044875621796, -0.03586525470018387, 0.13374443352222443, -0.3623572289943695, -0.44658124446868896, 0.04688160866498947, 0.26624971628189087, -0.0011007784632965922, -0.1357862...
other goodies included as well. The best part of it all is that it's FREE. :-)
[ 0.43811607360839844, 0.1294650435447693, 0.07587157934904099, 0.36844855546951294, 0.05821145325899124, -0.2758367657661438, 0.3946431279182434, 0.5204073190689087, -0.18364836275577545, -0.06217341870069504, -0.024721164256334305, 0.7125341892242432, -0.08637910336256027, -0.2439003884792...
do you know any not strict xpath for java? (I want it to not check dtd and schema) and it would be cool if it dont care about correct xml. You don't need to schema valid XML to use XPath. For non-well-formed XML, then I think you have two options: * generate a valid DOM tree from the file. Suggest sucking the file thr...
[ 0.5313650369644165, -0.229757159948349, 0.30890533328056335, 0.2133733630180359, -0.18914152681827545, -0.2352776676416397, 0.2700600326061249, 0.02738233096897602, 0.08764532953500748, -0.565797746181488, 0.08599621802568436, 0.9089213013648987, -0.17972193658351898, -0.005752167198807001...
I'm trying to select a column from a single table (no joins) and I need the count of the number of rows, ideally before I begin retrieving the rows. I have come to two approaches that provide the information I need. **Approach 1:** ``` SELECT COUNT( my_table.my_col ) AS row_count FROM my_table WHERE my_table.foo =...
[ -0.20335790514945984, 0.3615688979625702, 0.9154791831970215, -0.3604651093482971, 0.08678894490003586, 0.43520745635032654, -0.24926501512527466, -0.4196808934211731, -0.16386248171329498, -0.8829452395439148, -0.15615029633045197, 0.3568653464317322, -0.5023873448371887, 0.01078943349421...
WHERE my_table.foo = 'bar' ) AS row_count FROM my_table WHERE my_table.foo = 'bar' ``` I am doing this because my SQL driver (SQL Native Client 9.0) does not allow me to use SQLRowCount on a SELECT statement but I need to know the number of rows in my result in order to allocate an array before assigning informati...
[ -0.06356218457221985, 0.42500966787338257, 0.5436043739318848, -0.4362603724002838, 0.02520269900560379, 0.14249064028263092, -0.07599575817584991, -0.0712493360042572, -0.34099116921424866, -0.2880583703517914, 0.23355580866336823, 0.33657851815223694, -0.3083990812301636, 0.4757803976535...
of my program. I am concerned that the following scenario might occur: * SELECT for count occurs * Another instruction occurs, adding or removing a row * SELECT for data occurs and suddenly the array is the wrong size. -In the worse case, this will attempt to write data beyond the arrays limits and crash my progr...
[ 0.060580167919397354, 0.024265481159090996, 0.3434710204601288, -0.035632893443107605, 0.047356847673654556, -0.013906676322221756, 0.2417595088481903, -0.24583731591701508, -0.09245619177818298, -0.4220133423805237, 0.18548953533172607, 0.5726399421691895, -0.31937748193740845, 0.04305150...
that asked, I am using Native C++ with the aforementioned SQL driver (provided by Microsoft.) There are only two ways to be 100% certain that the `COUNT(*)` and the actual query will give consistent results: * Combined the `COUNT(*)` with the query, as in your Approach 2. I recommend the form you show in your example,...
[ 0.1518651843070984, 0.09572865068912506, 0.39827024936676025, 0.01201680488884449, -0.16133855283260345, -0.14662201702594757, 0.08188196271657944, -0.30759596824645996, -0.040835462510585785, -0.650631844997406, 0.2458987683057785, 0.6816192865371704, -0.32046666741371155, -0.154392182826...
other clients to become visible in your current transaction. Read the MSDN documentation on [`SET TRANSACTION ISOLATION`](http://msdn.microsoft.com/en-us/library/ms173763.aspx) for more details.
[ 0.2869017720222473, -0.15280219912528992, 0.18572436273097992, -0.028782937675714493, 0.12828072905540466, -0.22617918252944946, 0.07346675544977188, 0.30911388993263245, -0.567066490650177, -0.6950477957725525, -0.040529362857341766, 0.5738444924354553, -0.3800119161605835, -0.14208054542...
I have this table in an Oracle DB which has a primary key defined on 3 of the data columns. I want to drop the primary key constraint to allow rows with duplicate data for those columns, and create a new column, 'id', to contain an auto-incrementing integer ID for these rows. I know how to create a sequence and trigger...
[ 0.314844012260437, 0.4527261257171631, 0.23883701860904694, -0.01983519084751606, -0.06812998652458191, 0.10073419660329819, 0.020763976499438286, -0.40092742443084717, 0.027951179072260857, -0.3228449821472168, 0.20918507874011993, 0.3098861277103424, -0.3633687198162079, 0.22408509254455...
sequence: ``` update mytable set id = mysequence.nextval; ```
[ -0.3134123980998993, 0.09887782484292984, 0.47438496351242065, -0.20614653825759888, 0.3233829140663147, 0.08856994658708572, -0.019631292670965195, 0.09449111670255661, 0.08878631889820099, -0.9910122752189636, -0.28437599539756775, 0.5287390947341919, -0.24535445868968964, 0.343243122100...
I am attempting to deploy .NET 2.0 web services on IIS that has both 1.0 and 2.0 installed. This web server primarily serves a large .NET 1.0 application. I have copied by .NET 2.0 web service project to the server and have created a virtual directory to point to the necessary folder. When I set the ASP.NET version...
[ 0.4429425299167633, 0.0035169865004718304, 0.42146748304367065, -0.27570652961730957, 0.09099999815225601, -0.3203860819339752, 0.42180684208869934, -0.02792254649102688, -0.10297530889511108, -0.9303051233291626, -0.29658350348472595, 0.4685364365577698, -0.269172340631485, 0.132468432188...
full application error. I have anonymous access enabled (with a username / password) and have authenticated access checked as "Integrated Windows Authentication) How can I configure IIS so that I am not prompted for a password while having ASP.NET version set to 2.0? Thanks... **EDIT** I had major connection probl...
[ 0.0778966173529625, 0.09925950318574905, 0.34645184874534607, -0.10169747471809387, -0.11790306866168976, -0.0824853852391243, 0.6220161318778992, -0.34095558524131775, 0.18718695640563965, -0.5885334610939026, -0.03489595651626587, 0.6383327841758728, -0.4217703342437744, -0.0122008472681...
used in reflective programming with generics, when you have a Class instance for some variable type. You could use it like this: ``` public <T> Set<T> find(Class<T> clz, Filter criteria) { List<?> raw = session.find(clz, criteria); /* A legacy, un-generic API. */ Set<T> safe = new HashSet<T>(); for (Object o : r...
[ 0.5046266913414001, -0.12116680294275284, 0.25870656967163086, -0.023525459691882133, -0.29890531301498413, -0.2331700474023819, 0.14504480361938477, -0.3369579017162323, -0.15088483691215515, -0.5608425140380859, 0.039656564593315125, 0.9777721762657166, -0.37389612197875977, 0.2603092789...
to List<Widget>`, meaning that in the ellipsis, someone could have added a `Gadget` to the raw list, which will eventually cause a `ClassCastException` when the caller iterates over the returned list of (supposed) `Widget` instances.
[ 0.11582503467798233, -0.0838291347026825, 0.24465928971767426, -0.1570969969034195, -0.2639126777648926, 0.08019506931304932, 0.25273388624191284, -0.008035872131586075, -0.0363275520503521, -0.40678462386131287, -0.37765243649482727, 0.5965211391448975, -0.6106979846954346, 0.230028465390...
I've been developing a simple website using asp.net MVC and I'm starting to add some JQuery\JSON goodness. My problem is up until now all my 'Views' have been strongly typed and I've been building the view based on data from ViewData.Model.MyViewsData. Now once the view has been rendered and I do a Ajax style request...
[ 0.11886933445930481, 0.06866588443517685, 0.5719134211540222, -0.012658615596592426, -0.29922863841056824, 0.08878765255212784, 0.27334293723106384, 0.2083442509174347, -0.2006470263004303, -0.8348612785339355, 0.11558172851800919, 0.7177695631980896, 0.051876068115234375, 0.18429073691368...
always fetch the data back using Jquery\JSON and forget about using ViewData or do some sort of partial rendering of my view?! Any tutorials or samples would be most appreciated. Many Thanks I use jQuery and Monorail for an MVC framework - and we use both approaches. [Here's an example for the jquery approach](https...
[ 0.09127528965473175, -0.41284921765327454, 0.45666947960853577, 0.11874882876873016, -0.4061703383922577, -0.07109596580266953, 0.03988318517804146, -0.20268487930297852, -0.3332172930240631, -0.5490162968635559, -0.14395903050899506, 0.9056007266044617, -0.30958667397499084, -0.4426170587...
control contents, simply apply the html returned in the partial view (ensuring the layout is cancelled as you don't want menus etc just a html fragment).
[ 0.05587555095553398, -0.1865624636411667, 0.318231999874115, 0.40133360028266907, -0.10762272775173187, -0.5055115818977356, 0.18947049975395203, 0.1371576339006424, -0.12341678142547607, -0.469346821308136, -0.6021212339401245, 0.6284551024436951, -0.3378489017486572, -0.02646707743406295...
Did Microsoft abandon support for Windows Presentation Foundation (WPF) on Visual Studio 2005? There was the a Community Technology Preview (CTP) for the WPF and WCF, but [it's no longer available](http://tinyurl.com/5hn2yd) for download. There are [released extensions for Windows Workflow Foundation](http://www.micro...
[ -0.021723443642258644, -0.0556238517165184, 0.5181092023849487, -0.10272233188152313, -0.4952285587787628, 0.0646289512515068, 0.24565143883228302, -0.3135787546634674, -0.429671972990036, -0.27342090010643005, -0.20186002552509308, 0.5660597681999207, -0.2935340404510498, 0.03555011749267...
I have several arrays of arrays or arrays of dicts that I would like to store in my iPhone app. This lists are static and won't be modified by the app or users. Occasionally they may be displayed but more likely they'll be iterated over and compared to some input value. Would the best way to store these arrays be a Cor...
[ 0.5571867823600769, 0.0805022194981575, 0.233675017952919, 0.3271530270576477, -0.004267099313437939, 0.223748579621315, 0.04684765636920929, 0.14110122621059418, -0.25779905915260315, -0.6982289552688599, 0.20917506515979767, 0.2777193486690521, -0.2737196385860443, 0.03699434548616409, ...
take. I would do the following: ``` @implementation DataSource + (NSArray *)someData { static NSArray *data = nil; if (!data) { data = [[NSArray arrayWithObjects:..., nil] retain]; } return data; } @end ``` Additional arrays or arrays of dicts would be added as class methods on that class.
[ 0.06496251374483109, -0.5486041307449341, 0.15791215002536774, -0.18350709974765778, 0.03470630198717117, -0.28340575098991394, 0.09566982090473175, -0.2622939944267273, 0.16605094075202942, -0.46309709548950195, -0.0975143238902092, 0.4876609742641449, -0.570002019405365, 0.15303796529769...
What do you think of using a metric of function point to lines of code as a metric? It makes me think of the old game show "Name That Tune". "I can name that tune in three notes!" I can write that functionality in 0.1 klocs! Is this useful? It would certainly seem to promote library usage, but is that what you want? ...
[ 0.5201330184936523, 0.2583189308643341, 0.13093434274196625, 0.3030188977718353, -0.23841294646263123, -0.005388926714658737, 0.26160746812820435, -0.07358652353286743, -0.09464246779680252, -0.4284668564796448, 0.3991352617740631, 0.32908526062965393, 0.07893184572458267, 0.04156009480357...
function points per kloc is going to encourage everyone to write their code as briefly as they possibly can, which goes beyond concise and into cryptic. It will also encourage people to join adjacent lines of code into one line, even if said joining would not otherwise be desirable, just to reduce the number of lines o...
[ 0.11496849358081818, 0.11403588950634003, 0.6592637300491333, 0.23775792121887207, 0.0030478325206786394, -0.2035001814365387, 0.4973740875720978, -0.15727220475673676, -0.06563308835029602, -0.5416437387466431, -0.4441308081150055, -0.2210199534893036, -0.05373670533299446, -0.03708040714...
I am trying to set the permissions of a folder and all of it's children on a vista computer. The code I have so far is this. ``` public static void SetPermissions(string dir) { DirectoryInfo info = new DirectoryInfo(dir); DirectorySecurity ds = info.GetAccessControl(); ...
[ 0.30207008123397827, -0.1816100925207138, 0.6917914152145386, -0.17949984967708588, 0.4093879461288452, -0.3014543950557709, 0.3380615711212158, -0.232147678732872, 0.031382735818624496, -0.7218149304389954, -0.2948760986328125, 0.8213175535202026, -0.49165794253349304, 0.28517717123031616...
FileSystemRights.FullControl, InheritanceFlags.ContainerInherit, PropagationFlags.None,
[ -0.4113060235977173, -0.3509676456451416, 0.3936919569969177, 0.2877994179725647, 0.011346185579895973, 0.03822089359164238, -0.06184246763586998, 0.2071835845708847, -0.4933466911315918, -0.6239094734191895, -0.3863748610019684, 0.33275049924850464, -0.38228729367256165, 0.471620798110961...
AccessControlType.Allow)); info.SetAccessControl(ds); } ``` However it's not working as I would expect it to. Even if I run the code as administrator it will not set the permissions. The folder I am working with is located in C:\ProgramData\<my folder> and I can manually change th...
[ 0.12911251187324524, 0.17072899639606476, 0.6636718511581421, 0.05493752285838127, 0.5678179264068604, -0.4253944456577301, 0.14866085350513458, 0.1484987586736679, -0.22720091044902802, -0.8593473434448242, -0.2016148567199707, 0.638453483581543, -0.10158869624137878, 0.5398529171943665, ...
direction. So the answer is two fold. First off a sub folder was being created before the permissions were set on the folder and I needed to or in one more flag on the permissions to make it so both folders and files inherited the permissions. ``` public static void SetPermissions(string dir) { Dir...
[ 0.23088034987449646, -0.6256993412971497, 0.9698746800422668, 0.10827792435884476, 0.3384421765804291, -0.22627246379852295, 0.15937133133411407, -0.23868708312511444, -0.014760006219148636, -0.30971917510032654, -0.13680310547351837, 0.8127208948135376, -0.3573877811431885, 0.480827480554...
ds.AddAccessRule(new FileSystemAccessRule(@"BUILTIN\Users", FileSystemRights.FullControl, InheritanceFlags.ObjectInherit |
[ -0.26339948177337646, -0.24986128509044647, 0.7310549020767212, 0.11919791996479034, 0.11197853088378906, -0.126729816198349, 0.4202253222465515, -0.27415603399276733, -0.2750708758831024, -0.8055039048194885, -0.25116950273513794, 0.3512357771396637, -0.3491002917289734, 0.405271261930465...
InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); info.SetAccessControl(ds); } ``` After that every thing appears to be working.
[ -0.17625504732131958, -0.18510468304157257, 0.26133012771606445, 0.050003912299871445, 0.13934248685836792, -0.47135716676712036, 0.15745405852794647, -0.0849626213312149, -0.17228886485099792, -0.5354924201965332, -0.23554159700870514, 0.653670608997345, -0.2134675830602646, 0.11519041657...
I am looking for a way to maintain PHP sessions across multiple domains on the same server. I am going to be integrating my sites with a Simple Machines Forum so I will need to use MySQL based sessions. Thanks! Depending upon your preferred method of modifying PHP variables (Apache's config, .htaccess), change the sess...
[ 0.5579053163528442, 0.1109704077243805, 0.573448896408081, 0.18032468855381012, -0.3254871666431427, -0.2427380532026291, 0.44258829951286316, 0.048091087490320206, -0.3989548683166504, -0.6789196133613586, 0.4041464924812317, 0.3441688120365143, -0.06329752504825592, 0.45822271704673767, ...
think it is only necessary to choose a common domain name (ie domain1.com). I have never tried this, so I cannot verify that it works, but the logic seems accurate. There is also a method to set the variables direction in PHP described at <http://us.php.net/manual/en/function.session-set-cookie-params.php>. The docume...
[ 0.4074694514274597, 0.01513228751718998, 0.3823394775390625, 0.12156440317630768, 0.09682538360357285, -0.07861221581697464, 0.3971301019191742, -0.16555067896842957, -0.42295894026756287, -0.4017332196235657, 0.15669867396354675, 0.4461398720741272, -0.16669587790966034, 0.061227738857269...
In my Rails controller, I'm creating multiple instances of the same model class. I want to add some RSpec expectations so I can test that it is creating the correct number with the correct parameters. So, here's what I have in my spec: ``` Bandmate.should_receive(:create).with(:band_id => @band.id, :user_id => @user....
[ 0.05898432433605194, -0.33284950256347656, 0.34461718797683716, -0.2726638615131378, -0.033583953976631165, -0.05667208135128021, 0.2021486610174179, -0.9105507731437683, -0.014996609650552273, -0.7148242592811584, 0.38600650429725647, 0.42535755038261414, -0.34504812955856323, -0.07179381...
run the example, I get the following error: ``` Spec::Mocks::MockExpectationError in 'BandsController should create all the bandmates when created' Mock 'Class' expected :create with ({:band_id=>1014, :user_id=>999, :position_id=>1, :is_leader=>true}) but received it with ({:band_id=>1014, :user_id=>"2222", :position...
[ 0.2660655975341797, 0.11615210026502609, 0.22709515690803528, -0.20879890024662018, 0.00036031613126397133, -0.05139082670211792, 0.3841553032398224, -0.5592420697212219, -0.14419282972812653, -0.6112785935401917, 0.14294645190238953, 0.6603398323059082, -0.39591893553733826, -0.0635613277...
add `.ordered` to the end of each of your expectations.
[ 0.36875417828559875, 0.22386863827705383, 0.1602446436882019, 0.02326144091784954, 0.1771204024553299, -0.1971147060394287, 0.03942899405956268, 0.02119767852127552, 0.13708223402500153, -0.5229250192642212, 0.030786162242293358, 0.5997228622436523, -0.17414331436157227, -0.169451355934143...
Wanna write a RegEx to validate a driving license. if it doesn't start with (US, CA, CN) then it has to be followed with XX and after that with any number of Alpha numeric letters. So for example if the driving license starts with GB then it has to be followed with XX GBXX12345363 However if it starts with US then ...
[ 0.636093258857727, 0.5614655017852783, 0.7506107091903687, 0.26286962628364563, -0.06850828230381012, -0.10637003928422928, 0.07737666368484497, 0.19459955394268036, -0.21800118684768677, -0.10254895687103271, 0.22900229692459106, 0.4615418016910553, 0.1115889698266983, 0.1577586680650711,...
get things you don't want): * Has to start with two capital letters * If those first two letters are either US, CA or CN, the rest has to be alphanumeric and of unspecified length * If those first two letters are none of US, CA or CN, then the next two letters have to be X, the rest after that has to be alphanumeric a...
[ -0.10381344705820084, -0.29393690824508667, 0.5367696285247803, 0.1020953357219696, 0.09984349459409714, 0.4559136927127838, 0.4306289255619049, -0.08855150640010834, -0.21417541801929474, -0.21305076777935028, -0.6894682049751282, 0.5429482460021973, 0.06995601952075958, -0.18161056935787...
more alphanumeric characters And it matches either the first part or the second one
[ -0.006527871824800968, -0.015642862766981125, 0.1000928282737732, 0.08919373899698257, -0.12072445452213287, 0.18730255961418152, -0.14103399217128754, -0.031953174620866776, -0.023121150210499763, -0.6215426921844482, -0.3256106972694397, 0.12534475326538086, -0.24561765789985657, -0.1242...
Can anoyne recommend a good library that will let me easily read/write private member fields of a class? I was looking through apache commons, but couldnt see it. I must be getting blind ? Edit: Asking questions on the border of legalities always give these questions of "why"? I am writing several javarebel plugins fo...
[ 0.35234302282333374, 0.1309395432472229, -0.0938095971941948, -0.0442274734377861, -0.32833731174468994, -0.4015680253505707, 0.37420427799224854, -0.28743770718574524, -0.10194626450538635, -0.33915939927101135, 0.1528785675764084, 0.5780250430107117, -0.36045655608177185, -0.017592504620...
* * @return the name */ public final String getName() { return name; } /** * Sets the name Field with the name input value. * * @param name the name to set */ public final void setName(String name) { this.name = name;
[ 0.16404175758361816, -0.03740844503045082, 0.496755987405777, -0.19819653034210205, 0.03792338818311691, 0.12346607446670532, 0.1859162151813507, -0.4787236154079437, -0.1065373495221138, -0.28632867336273193, -0.5810067653656006, 0.5422994494438171, -0.3020400404930115, 0.2738359272480011...
} private String name; } ``` Now the Reflection Code: ``` import java.lang.reflect.Field; .... Foo foo = new Foo(); foo.setName("old Name"); String fieldName = "name"; Class class1 = Foo.class; try { System.out.println(foo.getName()); Field field = class1.getDeclaredField(fieldName); field.set...
[ 0.39348700642585754, 0.09880420565605164, 0.08978170901536942, -0.2902938425540924, 0.4142170548439026, 0.02377985045313835, 0.6576358675956726, -0.5348710417747498, -0.35290825366973877, -0.22587016224861145, -0.3675922751426697, 0.5861768126487732, -0.4194395840167999, 0.3736671209335327...
I started off programming in Basic on the [ZX81](http://en.wikipedia.org/wiki/ZX81), then [BASICA](http://en.wikipedia.org/wiki/IBM_BASICA), [GW-BASIC](http://en.wikipedia.org/wiki/GW-BASIC), and [QBasic](http://en.wikipedia.org/wiki/QBasic). I moved on to C (Ah, Turbo C 3.1, I hardly knew ye...) When I got started in...
[ 0.38997766375541687, 0.2548646628856659, -0.15798480808734894, -0.061615873128175735, -0.5292840600013733, 0.0014447233406826854, 0.14083243906497955, -0.018720921128988266, 0.03455968201160431, -0.1803237646818161, -0.18804581463336945, 1.0254616737365723, -0.38956841826438904, -0.0016672...
my own on-chip BASIC interpretor, but I wonder if there's need for BASIC now that Lua and Python are easily embeddable, and just as approachable as BASIC. * What, if any, are the advantages BASIC has over other languages? * Why is it still around? * If I decide to make a general purpose microcontroller board with an i...
[ 0.20018041133880615, 0.2618715465068817, -0.32777658104896545, 0.18089956045150757, -0.19745251536369324, 0.08360880613327026, 0.2264329493045807, 0.47427332401275635, -0.3459084630012512, -0.3028500974178314, 0.021444570273160934, 0.6103538870811462, -0.0076731471344828606, 0.099409118294...
KB. In the days of a DG Nova this was a win as you could use systems like Business BASIC to build a multiuser application on a machine with 64K of RAM (or even less). BASIC (VB in particular) is a legacy system and has a large existing code-base. Arguably VB is really a language (some would say a thin wrapper over COM...
[ 0.22024114429950714, 0.2651926875114441, 0.1831883043050766, 0.025329137220978737, -0.3164830803871155, 0.1495271474123001, 0.17442584037780762, -0.03816709294915199, -0.428924560546875, -0.07292221486568451, -0.02011149376630783, 0.37360695004463196, -0.17447391152381897, 0.45541730523109...
(note that VB.Net is not really BASIC but just has a VB-like syntax. The type system is not broken in the way that VB's was.) What *is* missing from the computing world is a *relevant* language that is easy to learn and tinker with and has mind-share in mainstream application development. I grew up in the days of 8-bi...
[ 0.43534478545188904, 0.43598341941833496, -0.13317768275737762, 0.15273751318454742, -0.24182827770709991, -0.16710101068019867, 0.44120049476623535, 0.45589902997016907, -0.3581046760082245, -0.5595607757568359, -0.015733959153294563, 0.28948667645454407, -0.20976637303829193, 0.159700110...
and have a bigger hump to learn. You can see people pontificating on how kids can't learn to program as easily as they could back in the days of BASIC and 8-bit computers and I think that argument has some merit. There is something of a hole left that makes programming just that bit harder to get into. Toy languages ar...
[ 0.31241029500961304, 0.3878703713417053, -0.11529479175806046, 0.38825860619544983, 0.26632148027420044, 0.11517544090747833, 0.24910999834537506, 0.6784321665763855, -0.2470979243516922, -0.6682045459747314, 0.07095527648925781, 0.6333355903625488, 0.016852613538503647, 0.2969297766685486...
to learn but still allows them to write relevant programmes (or even games) that they might actually want. It also has to be widely perceived as relevant. The closest thing I can think of to this is Python. It's not the only example of a language of that type, but it is the one with the most mind-share - and (IMO) a p...
[ 0.5068384408950806, 0.11316811293363571, -0.09758944809436798, 0.023375732824206352, -0.004861014429479837, -0.08352098613977432, 0.0511874258518219, 0.6146132946014404, -0.22326304018497467, -0.46108418703079224, -0.22696441411972046, 0.640030026435852, -0.027770528569817543, -0.237953692...
I've been asked to display the 'correct' time on our website which I frankly feel is rather pointless as 'correct' can be interpretted in such a variety of ways. Our current method definately results in an inaccurate time as it uses a server control rendering JavaScript that runs onload using the datetime from the ser...
[ 0.47442296147346497, 0.41779229044914246, 0.451410710811615, -0.032370299100875854, 0.12026309221982956, 0.07714542746543884, 0.4281456768512726, 0.10009673982858658, -0.14240792393684387, -0.6256580948829651, 0.293328195810318, 0.29680335521698, -0.04659052565693855, 0.2035161554813385, ...
time and who knows compared to the client PC. So to get the 'correct' time shown I could; * Use local PC time and pass new Date() to the JavaScript clock object. Pros: Should be as close to the PC clock as possible. Cons: Not sure how accurate the PC clock is let alone in which timezone. * Use web service for TCP req...
[ 0.2119746059179306, -0.156631737947464, 0.9037806391716003, 0.16518646478652954, 0.17889033257961273, 0.12656831741333008, 0.26270538568496704, -0.019530031830072403, -0.15797214210033417, -0.8552612662315369, 0.14514890313148499, 0.6920598149299622, -0.06354763358831406, 0.109311491250991...
clock is out will still have mismatch. Do I implement my own web service or use something like; [Earth Tools](http://www.earthtools.org/webservices.htm) or World Time Web Service (**EDIT:** link removed - now 404) Here's a blog post from [Jon Galloway on Atomic Clock Web Service](http://weblogs.asp.net/jgalloway/arch...
[ 0.40038126707077026, 0.18838495016098022, 0.3089318871498108, -0.00829858798533678, 0.043543316423892975, -0.16492487490177155, 0.17863880097866058, -0.1504826694726944, -0.3334808051586151, -0.4565325379371643, 0.2962450087070465, 0.3992089033126831, -0.08044934272766113, 0.16680726408958...
accurate time to clients in an auction web app. You can send the current server time with the page and have the javascript initialize right away without waiting for the rest of the page to load. So the, you only are dealing with network latency which in the worst case is not likely to be more than a couple of seconds. ...
[ 0.4399726688861847, -0.10071822255849838, 0.6905402541160583, 0.3457210063934326, 0.09085488319396973, -0.15311183035373688, 0.45842909812927246, -0.21843302249908447, 0.004019355867058039, -0.896466851234436, 0.532543420791626, 0.7783046960830688, 0.1803598403930664, -0.3396484851837158, ...
bad JS clock code. (Hint: Date() good, setTimeout() bad.) If you have an application that users are going to be sitting on for a long time, just refresh your time sync either by reloading the page or Ajax. I wouldn't worry about time zones, just use UTC time so there is no confusion about what time things will happen...
[ 0.5182438492774963, -0.12006379663944244, 0.21426065266132355, 0.1827063262462616, 0.027965566143393517, -0.21883301436901093, 0.6642192006111145, 0.8307072520256042, -0.06441889703273773, -0.8551939725875854, -0.1562146544456482, 0.47946423292160034, -0.2792467176914215, 0.012928835116326...
I need to resize PNG, JPEG and GIF files. How can I do this using Java? After loading the image you can try: ``` BufferedImage createResizedCopy(Image originalImage, int scaledWidth, int scaledHeight, boolean preserveAlpha) { System.out.println("resizing..."); int imageTyp...
[ 0.14230893552303314, -0.05548412725329399, 0.6359318494796753, -0.18948960304260254, -0.04628262296319008, 0.3268953859806061, 0.3723483979701996, -0.5838773846626282, 0.1396392434835434, -0.8181180357933044, -0.07654868811368942, 0.5953219532966614, -0.32141393423080444, 0.176662340760231...
Graphics2D g = scaledBI.createGraphics(); if (preserveAlpha) { g.setComposite(AlphaComposite.Src); } g.drawImage(originalImage, 0, 0, scaledWidth, scaledHeight, null); g.dispose(); return scaledBI; } ```
[ -0.10924523323774338, -0.3452458381652832, 0.6185243725776672, -0.16662149131298065, -0.12760381400585175, 0.23413293063640594, 0.1452929675579071, -0.3353877067565918, 0.07276903092861176, -0.5709494948387146, -0.23889757692813873, 0.5455825328826904, -0.6083239912986755, -0.0473925918340...
I'm working on a site which contains a whole bunch of mp3s and images, and I'd like to display a loading gif while all the content loads. I have no idea how to achieve this, but I do have the animated gif I want to use. Any suggestions? Typically sites that do this by loading content via ajax and listening to the `...
[ 0.4597446918487549, -0.009721685200929642, 0.30474695563316345, -0.005684230010956526, -0.09103561192750931, -0.24250368773937225, -0.04670564457774162, 0.018200404942035675, -0.3072235882282257, -0.6904783248901367, -0.14594705402851105, 0.8096906542778015, -0.2061004787683487, 0.00404053...
= true; // request your data... var req = new XMLHttpRequest(); req.open("POST", url, true); req.onreadystatechange = function () { if (req.readyState == 4 && req.status == 200) { // content is loaded...hide the gif and display the content... if (req.responseText) { ...
[ 0.30962666869163513, -0.24698896706104279, 0.996343195438385, -0.0042596617713570595, 0.1912550926208496, 0.0010617078514769673, 0.29763033986091614, -0.47098076343536377, 0.014804772101342678, -0.5181179642677307, -0.7679796814918518, 0.6187911629676819, -0.27485382556915283, 0.1122661978...
document.getElementById('loadingImg').visible = false; } } }; request.send(vars); } ``` There are plenty of 3rd party javascript libraries that may make your life easier, but the above is really all you need.
[ 0.2992801368236542, -0.09724543988704681, 0.3337092101573944, -0.0007083981181494892, 0.023426882922649384, -0.4546288251876831, 0.4851550757884979, -0.1696484386920929, -0.10195820033550262, -0.7729034423828125, -0.211341992020607, 0.7951829433441162, -0.3165041506290436, 0.03560471162199...
I found [a posting on the MySQL forums from 2005](http://forums.mysql.com/read.php?100,22967,22967), but nothing more recent than that. Based on that, it's not possible. But a lot can change in 3-4 years. What I'm looking for is a way to have an index over a view but have the table that is viewed remain unindexed. Ind...
[ 0.10958874225616455, 0.06440882384777069, 0.35509228706359863, 0.1424010843038559, -0.110487200319767, 0.013590679503977299, 0.22424933314323425, 0.31970247626304626, -0.40513327717781067, -0.5858187675476074, 0.48516711592674255, 0.27809780836105347, -0.04995418339967728, 0.20210622251033...
wouldn't help you in this situation anyway. Whether the index is on the view or on the underlying table, it would need to be written and updated at some point during an update of the underlying table, so it would still cause the write speed issues. Your best bet would probably be to create summary tables that get upda...
[ 0.2437569946050644, 0.05834262818098068, 0.31355997920036316, 0.25810882449150085, 0.10738310217857361, 0.10644374042749405, 0.10015308111906052, 0.04695930704474449, -0.2641637623310089, -0.6162886619567871, 0.3429501950740814, 0.7623758316040039, 0.10760058462619781, -0.03657303750514984...
My knowledge about implementing a parser is a bit rusty. I have no idea about the current state of research in the area, and could need some links regarding recent advances and their impact on performance. General resources about writing a parser are also welcome, (tutorials, guides etc.) since much of what I had le...
[ 0.022801948711276054, 0.3481777310371399, -0.26331666111946106, 0.03856654465198517, -0.5093221068382263, -0.210286483168602, 0.4985790252685547, 0.18985901772975922, -0.20555910468101501, -0.46551570296287537, -0.13565334677696228, 0.37100741267204285, -0.41804853081703186, -0.50144958496...
you've answered your own question. If you're looking for other parser generators you could also check out boost::spirit (<http://spirit.sourceforge.net/>). Depending on what you're trying to achieve you might also want to consider a DSL, which you can either parse yourself or write in a scripting language like boo, r...
[ 0.43802329897880554, -0.14037184417247772, 0.19649066030979156, 0.3081449270248413, -0.05678924545645714, -0.3655855655670166, 0.491222083568573, -0.27646195888519287, -0.3073827028274536, -0.4144020974636078, -0.3156386613845825, 0.4789820909500122, -0.076846182346344, -0.2183654904365539...
I have a somewhat complicated branching structure at work (at least for me). It is something like this: ``` Main | 1 | 2 | \ 3 \ Ver2 | 1 | \ 2 \ | ProjectA 3 | 1 ``` There are 2 branches off
[ 0.16191603243350983, -0.08129940927028656, 0.4339207708835602, -0.33581432700157166, 0.007218621671199799, 0.027161981910467148, 0.30660995841026306, 0.20302626490592957, -0.26560553908348083, -0.15454870462417603, 0.0692022442817688, 0.05783427134156227, -0.14833998680114746, 0.4891509413...
of main. "Ver2" which has everyone's changes for the next version, and "ProjectA" which is my work. My question is: Is there a way to create a config spec that knows what has been merged so I get: 1. Anything from ProjectA that has not been merged 2. If the LATEST from ProjectA has been merged to Ver2, then get the L...
[ 0.28463438153266907, -0.2992597818374634, 0.38795551657676697, -0.07494551688432693, -0.06845852732658386, -0.18033477663993835, 0.12763066589832306, -0.25153031945228577, -0.23825868964195251, -0.3760969638824463, -0.26552319526672363, 0.5895697474479675, -0.4230966567993164, 0.1377603113...
would want to see version 3 on Ver2. However, if I have not yet merged those files, I would want version 1 from ProjectA in my view. Mentioning the dragon book and antlr means you've answered your own question. If you're looking for other parser generators you could also check out boost::spirit (<http://spirit.sourcef...
[ 0.26411882042884827, -0.10332158207893372, 0.3108633756637573, 0.2106981724500656, -0.2224283069372177, -0.4458206593990326, 0.523257851600647, -0.29888466000556946, -0.2295432984828949, -0.4243597984313965, -0.22814065217971802, 0.6092637181282043, -0.1274607926607132, -0.3437050879001617...
I'm looking for a good reader/writer lock in C++. We have a use case of a single infrequent writer and many frequent readers and would like to optimize for this. Preferable I would like a cross-platform solution, however a Windows only one would be acceptable. Newer versions of [boost::thread](http://www.boost.org/doc/...
[ 0.009756493382155895, 0.308430939912796, 0.44686219096183777, 0.04278378561139107, -0.10823763161897659, -0.027254115790128708, 0.18354982137680054, -0.27923232316970825, -0.10102833062410355, -0.4971373975276947, -0.1817811131477356, 0.8018105030059814, -0.4332796037197113, 0.034410294145...
I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns. None of the wxDC objects allow me to ...
[ 0.486491858959198, -0.048785921186208725, 0.16395489871501923, 0.2160417139530182, 0.00007092569285305217, -0.27734118700027466, 0.08627647906541824, 0.20238670706748962, -0.23089303076267242, -0.5375332832336426, 0.16082443296909332, 0.42274010181427, -0.3195333480834961, 0.32045683264732...
think this will work. You need the handle (HWND) for the external window, not the DC. ``` window = wx.Frame(None, -1, '') window.AssociateHandle(hwnd) dc = wx.WindowDC(window) ```
[ 0.27502256631851196, -0.0034710830077528954, 0.5813572406768799, -0.18410657346248627, 0.10834359377622604, 0.028546076267957687, 0.15642306208610535, -0.3012706935405731, -0.1903722584247589, -0.5317805409431458, -0.018353691324591637, 0.6210166811943054, -0.42479440569877625, 0.196893364...
I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like: ``` public Decimal DiscountPrice { get { return this.Price - this.Discount; } } ``` Would have a test like: ``` [TestMethod] public void Test_DiscountPrice { ...
[ 0.5459697842597961, 0.1023065522313118, -0.01364208199083805, 0.08354107290506363, 0.08661898225545883, 0.2810746133327484, -0.06423886120319366, -0.3134499192237854, 0.02703818865120411, -0.440540611743927, 0.004958088044077158, 0.9292339086532593, 0.21783719956874847, 0.01038801856338977...
you have 3-4 layers above your code (Business Request, Requirements Document, Architecture Document), where the actual defined business rule (Discount Price is Price - Discount) could be misdefined. If that's the situation, your unit test means nothing to you. Additionally, your unit test is another point of failure:...
[ 0.4134503901004791, 0.02292758598923683, 0.2777397334575653, 0.08405369520187378, 0.15717215836048126, 0.20543017983436584, 0.03544622287154198, -0.42005181312561035, -0.09145741164684296, -0.4924338459968567, -0.19422520697116852, 0.8888661861419678, 0.25423601269721985, 0.277680695056915...
two years into the application's life, when maintenance developers are maintaining it. Now the business changes its rule, and the test breaks again, some rookie developer then fixes the test incorrectly...we now have another point of failure. All I see is more possible points of failure, with no real beneficial return...
[ 0.4346933364868164, 0.18983802199363708, 0.037159353494644165, 0.21492423117160797, 0.2449248731136322, -0.09066043049097061, 0.4185546338558197, 0.15190260112285614, 0.05480694770812988, -0.3248762786388397, 0.34148094058036804, 0.5427852869033813, 0.3804043233394623, 0.25508391857147217,...
stay progressive, but it just doesn't make sense to me. EDIT: A couple people keep mentioned that testing helps enforce the spec. It has been my experience that the spec has been wrong as well, more often than not, but maybe I'm doomed to work in an organization where the specs are written by people who shouldn't be w...
[ 0.6715596318244934, 0.3158450424671173, 0.12588930130004883, 0.4513780474662781, -0.17030461132526398, -0.2971931993961334, 0.4166853129863739, -0.11362970620393753, -0.18005236983299255, -0.2795902490615845, 0.17080336809158325, 0.753174364566803, 0.04022446274757385, -0.1486453115940094,...
be tested. When you have 20 similar tests, making a (tested) subroutine means your main test is 20 simple invocations of the subroutine which is much more likely to be correct. Third, some would argue that [TDD](http://en.wikipedia.org/wiki/Test-driven_development) addresses this concern. That is, if you just write 20...
[ 0.712705671787262, 0.29141902923583984, -0.2910589575767517, 0.14354786276817322, -0.04796358942985535, 0.010043664835393429, 0.6619718074798584, -0.42236992716789246, -0.07105621695518494, -0.5626757740974426, -0.000658669916447252, 0.6002762913703918, -0.18681107461452484, -0.20624774694...
to address your concern.
[ 0.2762107849121094, 0.10300454497337341, -0.00857273768633604, -0.08603866398334503, -0.16270017623901367, 0.22691194713115692, 0.00039265063242055476, 0.07084951549768448, 0.22871895134449005, -0.5819514393806458, 0.005654885433614254, 0.19846348464488983, -0.5479708313941956, -0.14018182...
Here's the quick and skinny of my issue: ``` $("a").toggle(function() { /*function A*/ }, function() { /*function B*/ }); ``` Inside `function A` a form is displayed. If the user successfully completes the form, the form is hidden again (returning to it's original state). Inside `function B` the same form is hidden....
[ 0.3507300317287445, 0.16697968542575836, 0.373541921377182, -0.27458709478378296, 0.3695020377635956, -0.09863486140966415, 0.33806732296943665, -0.22160543501377106, 0.00894851889461279, -0.5638895034790039, -0.2998691201210022, 0.5843538045883179, -0.3269321322441101, 0.11081250756978989...
on the link ***twice*** before returning to the toggle state that displays the form. Is there anyway to programmatically reset the toggle switch to its initial state? jQuery has two `.toggle()` methods: [`.toggle()`](http://api.jquery.com/toggle/) > Toggles each of the set of matched > elements. If they are shown, ...
[ 0.13356620073318481, -0.2251029759645462, 0.7128450274467468, -0.1862129420042038, -0.04434875026345253, -0.09563255310058594, 0.29857251048088074, -0.3321514129638672, -0.13504761457443237, -0.6223496794700623, -0.06324637681245804, 0.6444942951202393, -0.5526442527770996, -0.040312513709...
Imagine I have these python lists: ``` keys = ['name', 'age'] values = ['Monty', 42, 'Matt', 28, 'Frank', 33] ``` Is there a direct or at least a simple way to produce the following list of dictionaries ? ``` [ {'name': 'Monty', 'age': 42}, {'name': 'Matt', 'age': 28}, {'name': 'Frank', 'age': 33} ] `...
[ 0.10168114304542542, 0.39214396476745605, 0.20005719363689423, -0.17032845318317413, 0.21205273270606995, 0.26684972643852234, 0.5970734357833862, -0.25600433349609375, -0.1895241141319275, -0.46884873509407043, -0.27080750465393066, 0.21076184511184692, -0.32288360595703125, -0.2749224901...
Let's say you have several maintenance branches for existing releases of your software. Some developers are making direct changes in the maintenance branches, and merging periodically into the trunk. Now comes an extensive refactoring in the trunk codeline, scheduled for an upcoming major release. But this makes the ma...
[ 0.5342071652412415, 0.2619532346725464, 0.14607447385787964, 0.12831664085388184, 0.3745556175708771, -0.15642179548740387, 0.1592179536819458, 0.14142915606498718, -0.2733011841773987, -0.3961292803287506, -0.223845973610878, 0.5124890208244324, 0.00008594521204940975, 0.19704119861125946...
trunk. There are several possibilities: 1. The code in the trunk has not changed and the patch applies without conflict. 2. The code in the trunk has changed and the patch applies, but with a manual merge needed. 3. The code in the trunk has completely changed and the patch cannot apply. The developer must evaluate wh...
[ -0.01531798206269741, -0.09983213990926743, 0.038600850850343704, 0.19309081137180328, 0.2530527412891388, 0.20897100865840912, 0.43414169549942017, -0.3256162405014038, -0.3253646194934845, -0.33400464057922363, -0.6454203724861145, 0.7445272207260132, -0.18011879920959473, -0.25958091020...
cannot himself determine whether the same problem might exist in the trunk, then he should enter an issue into the issue tracking system. This issue would direct the trunk developers to consider the reason for the patch in the maintenance branch and whether the same defect might still exist. Entering a new issue for a ...
[ 0.1903412938117981, 0.21731708943843842, 0.21662506461143494, 0.34331873059272766, 0.11483638733625412, -0.2649134695529938, 0.45089206099510193, -0.03232801705598831, -0.32923102378845215, -0.663628876209259, -0.4109043478965759, 0.6145856976509094, -0.15957434475421906, -0.02299283072352...
and will need to work with the new trunk. Having at least a basic level of familiarity will be of great benefit.
[ 0.25753358006477356, 0.2862003445625305, 0.18962351977825165, 0.3593396544456482, 0.3309832811355591, 0.08364180475473404, 0.049408379942178726, -0.08050549030303955, -0.06466149538755417, -0.5434349179267883, -0.12585969269275665, 0.5717212557792664, 0.5419883131980896, -0.214866206049919...
My situation ============ * Input: a set of rectangles * each rect is comprised of 4 doubles like this: (x0,y0,x1,y1) * they are not "rotated" at any angle, all they are "normal" rectangles that go "up/down" and "left/right" with respect to the screen * they are randomly placed - they may be touching at the edges, ove...
[ 0.1962823122739792, -0.014559250324964523, 0.7353305220603943, 0.053052324801683426, 0.19141975045204163, 0.28071123361587524, 0.009557412005960941, -0.23792743682861328, -0.42423203587532043, -0.8502355813980103, 0.18465138971805573, 0.3924858570098877, -0.08080919831991196, -0.0984214320...
be the intersection) * I don't need the geometry of the overlap - just the area (example: 4 sq inches) * Overlaps shouldn't be counted multiple times - so for example imagine 3 rects that have the same size and position - they are right on top of each other - this area should be counted once (not three times) Example ...
[ 0.02511507272720337, 0.030192846432328224, 0.6805425882339478, -0.039710335433483124, -0.16079363226890564, 0.2353612631559372, 0.19748075306415558, -0.3271365165710449, -0.22554758191108704, -0.6211100220680237, 0.16169247031211853, 0.24710652232170105, -0.4779590368270874, 0.169439032673...
BBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBB-----------CCCCCCCC BBBBBB-----------CCCCCCCC BBBBBB-----------CCCCCCCC
[ 0.1615389883518219, 0.7460629940032959, 0.36348432302474976, -0.0961117148399353, -0.1867464929819107, 0.1381780505180359, -0.4354820251464844, 0.03421320393681526, -0.5367586016654968, 0.2547818124294281, -0.17931675910949707, 0.24621081352233887, -0.5224197506904602, 0.23758776485919952,...
CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC ``` An efficient way of computing this area is to use a sweep algorithm. Let us assume that we sweep a vertical line L(x)
[ 0.24302887916564941, -0.08826752007007599, 0.5118898749351501, -0.06898586452007294, -0.0541691891849041, 0.033034343272447586, -0.22781647741794586, -0.2382970154285431, -0.26560458540916443, -0.4734112322330475, -0.03466054052114487, 0.23261265456676483, -0.11136218905448914, 0.247531831...
through the union of rectangles U: * first of all, you need to build an event queue Q, which is, in this case, the ordered list of all x-coordinates (left and right) of the rectangles. * during the sweep, you should maintain a 1D datastructure, which should give you the total length of the intersection of L(x) and U....
[ -0.2130098044872284, -0.6045893430709839, 0.4186588227748871, -0.06567367166280746, -0.18400616943836212, 0.1814277023077011, 0.027304407209157944, -0.2927439510822296, -0.43036824464797974, -0.794589638710022, -0.19194529950618744, 0.028221603482961655, -0.4031808078289032, 0.267663240432...
L between events q and q' is exactly l(q)\*(q' - q). * you just have to sum up all these swept areas to get the total one. We still have to solve the 1D problem. You want a 1D structure, which computes dynamically a union of (vertical) segments. By dynamically, I mean that you sometimes add a new segment, and sometime...
[ 0.06197025999426842, -0.558945894241333, 0.3533572852611542, -0.021272074431180954, -0.09045716375112534, 0.12199582159519196, 0.09405764192342758, -0.20127752423286438, -0.4979390799999237, -0.646878719329834, -0.0033567266073077917, 0.19612400233745575, -0.46366918087005615, 0.0833700373...
the union for each event). If you want something more efficient, you just need to adapt it a bit: * assuming that you know the union of segments S1...Sn consists of disjoints segments D1...Dk. Adding Sn+1 is very easy, you just have to locate both ends of Sn+1 amongs the ends of D1...Dk. * assuming that you know the u...
[ -0.10476220399141312, -0.5352602005004883, 0.2550850510597229, 0.06901315599679947, -0.32088640332221985, 0.29235056042671204, 0.0007756220293231308, -0.4438685476779938, -0.3736185133457184, -0.6812254190444946, -0.30719080567359924, 0.11755061894655228, -0.3980822265148163, 0.33958998322...
use sorted sets with log-time location queries to represent D1...Dk, this is probably the most efficient non-specialized method you can get.
[ -0.0695217177271843, -0.16944082081317902, -0.03788972273468971, 0.2322235256433487, -0.10940299183130264, -0.17455191910266876, -0.09616106003522873, -0.3086918890476227, -0.3693245053291321, -0.5872647762298584, -0.21414247155189514, 0.10873761773109436, -0.2912767827510834, 0.0977693423...
Does anyone know of a decent UML standards guide? My company currently relies on UML 2.0 (rightly or wrongly) to do the majority (read *all*) of their design work. I have been asked to come up with a draft 'best practice' guide to help other developers develop better models. The main problem I face is that Im slightly...
[ 0.46565449237823486, 0.2549693286418915, 0.30182328820228577, -0.010440104641020298, -0.25831857323646545, -0.1229037344455719, 0.3512759208679199, 0.11039106547832489, -0.20808811485767365, -0.6369413733482361, 0.02144639752805233, 0.5363049507141113, 0.05635295808315277, -0.1278976052999...