text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Is there any benefit to explicitly using the StoredProcedure CommandType as opposed to just using a Text Command? In other words, is ``` cmd = new SqlCommand("EXEC StoredProc(@p1, @p2)"); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@p1", 1); cmd.Parameters.Add("@p2", 2); ``` any worse than ``` cmd = new...
[ 0.25119107961654663, 0.24438007175922394, 0.34994208812713623, -0.2116803526878357, -0.06929641216993332, 0.21346287429332733, 0.20858724415302277, -0.15186567604541779, -0.16600435972213745, -0.4421611726284027, 0.0008476811344735324, 0.6406592726707458, -0.43064671754837036, 0.2185961604...
processes that ran over night. Many of them simply involved running a stored procedure. We used to schedule these using sql server jobs, but moved away from it to instead call the procedures from a .Net program. This allowed us to keep *all* our scheduled tasks in one place, even the ones that had nothing to do with Sq...
[ 0.3697516620159149, -0.20650477707386017, 0.3424491882324219, 0.14369173347949982, 0.027484135702252388, 0.026350555941462517, 0.1282324194908142, -0.09576800465583801, -0.5024645328521729, -0.23887132108211517, -0.009141584858298302, 0.5700072050094604, -0.30070021748542786, 0.11786241084...
and the .Net program will receive and log those. What we learned was that `CommandType.StoredProcedure` would *always* buffer these messages into batches of about 50. The .Net code wouldn't see any log events until the procedure finished or flushed the buffer, no matter what options you set on the connection or what yo...
[ 0.22526590526103973, -0.22633762657642365, 0.21670472621917725, -0.027144143357872963, -0.2412852942943573, 0.003226872766390443, 0.17274466156959534, -0.015346590429544449, -0.22038815915584564, -0.6315634846687317, -0.05280064046382904, 0.3926141560077667, -0.4098346531391144, -0.1446126...
Being a newbie to Lisp I'm wondering if the Lisp syntax could be "fixed"? Some people say the syntax in Lisp is one of its biggest strengths. I don't quite understand this. Isn't it possible to replace "obvious" parentheses with a combination of white spaces, new lines and indenting? Just like in Python? It looks ...
[ 0.23991958796977997, 0.13264049589633942, -0.010729801841080189, -0.04620847851037979, -0.1264924854040146, -0.2521617114543915, -0.16149064898490906, 0.17171123623847961, -0.43743014335632324, -0.42575544118881226, 0.15117612481117249, 0.7735521793365479, -0.7053408026695251, -0.279640555...
example: ``` (defun factorial (x) (if (= x 0) 1 (* x (factorial (- x 1))))) ``` Why not: ``` defun factorial (x) if (= x 0) 1 * x factorial - x 1 ``` e.g. close parentheses at the end of line, and always open them on new lines. Only the 1 would be ambiguous...
[ 0.019023366272449493, 0.03536935895681381, 0.2683364152908325, -0.2454851269721985, 0.00817791186273098, -0.23054277896881104, 0.2576843500137329, -0.40470829606056213, -0.054699722677469254, -0.314789354801178, -0.6840945482254028, 0.6240710020065308, -0.48137009143829346, -0.388815432786...
(1) - but we could introduce an exception - single tokens are not "listified". Could this work? Edit: Thank you all! I see now there are some [links](http://www.lispin.org/wiki?page=default/links) at the lispin [site](http://www.lispin.org). What you suggest appears to have been implemented in ~~[Lispin](http://www...
[ -0.036750420928001404, 0.15615224838256836, 0.2312198430299759, 0.10782820731401443, -0.20727600157260895, -0.15100090205669403, 0.3151967525482178, -0.20696233212947845, -0.4309141933917999, -0.4927471876144409, -0.2324775606393814, 0.24639631807804108, -0.32169198989868164, -0.2301477342...
I have started to think in RoR as an option to develop my applications, but I don't know much about it. I usually deploy my applications to Windows XP or Vista based PCs and use SQL Server as database. Which are the system requirements to develop a Ruby on Rails application? Even a year ago, Ruby on Rails application...
[ 0.32233819365501404, 0.269930362701416, 0.11186591535806656, 0.1387011706829071, 0.07964876294136047, -0.24941742420196533, 0.21464650332927704, 0.2949123680591583, -0.27063435316085815, -0.7096704840660095, 0.1979411095380783, 0.6639550924301147, -0.03855819255113602, 0.06468786299228668,...
is probably a Linux (or BSD machine) running Apache and Phusion Passenger. Apache should be installed by default on most Linux servers, and Passenger has a nice [command-line installation tool](http://www.modrails.com/install.html). For a database, I generally use MySQL, though PostgreSQL might be more suitable if you...
[ -0.07237670570611954, -0.004111948423087597, 0.45793139934539795, 0.2358873039484024, 0.15029668807983398, -0.23900394141674042, -0.0855429470539093, 0.007824445143342018, -0.3062189519405365, -0.5175685286521912, 0.09379538148641586, 0.5205740928649902, -0.21233949065208435, 0.08974160999...
wrong. The advantage of deploying on Windows is that you already understand it. The advantage to deploying on Linux is that lots of people are familiar with that setup, and will be able to help you past the most common problems. If you do decide to deploy on Windows, I'd make sure that you find a good support communit...
[ 0.4306981861591339, -0.06254417449235916, -0.028430745005607605, 0.23995675146579742, 0.043705184012651443, -0.36460810899734497, 0.3613540828227997, 0.13587816059589386, -0.28940945863723755, -0.7956956624984741, 0.008706408552825451, 0.7157226800918579, -0.15406636893749237, -0.179845988...
and follow them.)
[ 0.5013058185577393, 0.22142428159713745, 0.1302584409713745, 0.034130726009607315, 0.24102945625782013, 0.21947285532951355, 0.47443246841430664, -0.03557728976011276, -0.20981505513191223, -0.20792461931705475, -0.40238550305366516, 0.4041823744773865, -0.31398805975914, -0.16238087415695...
I have a div of class `example` In JavaScript I have: ``` var selectWithThis = 'example' ``` Using this variable how would I write a `$()` selector to select this div? ``` var elements = $('.' + selectWithThis); ``` Note that it returns an array of all elements with the same class. If there is only one element, s...
[ -0.0284039918333292, 0.11463002860546112, 0.10690592229366302, -0.33714044094085693, -0.2214173972606659, 0.02870727702975273, 0.1699497401714325, -0.4540831744670868, 0.2003067284822464, -0.5536752343177795, 0.10078322142362595, 0.41313040256500244, -0.4668363928794861, -0.067924678325653...
I have a List<> in my program, filled with my custom class. I want to be able to extract an object from the list by simply specifying an integer, then returning all objects that have an integer property set to that integer. I was thinking of doing it like this: ``` int exampleint = 5; List<MyClass> extract = new List<...
[ 0.32464781403541565, -0.08156538009643555, 0.36987149715423584, -0.09289389848709106, -0.2591454088687897, 0.27142879366874695, 0.12193983793258667, -0.22046063840389252, -0.5337755680084229, -0.5749209523200989, 0.23440591990947723, 0.4874609112739563, -0.16079124808311462, 0.155260384082...
extract = list.FindAll(delegate(int obj) { return obj.Number == exampleint; }); ``` should in fact be this: ``` List<MyClass> extract = list.FindAll(new Predicate<MyClass>(delegate(MyClass obj) { return obj.Number == exampleint; })); ``` Your first example gave me errors. But thanks for pointing me in the right di...
[ -0.4402574896812439, -0.2959209978580475, 0.6130736470222473, -0.39305827021598816, -0.043952733278274536, 0.1898989975452423, 0.5331834554672241, -0.2733248472213745, -0.36237844824790955, -0.4298558235168457, -0.13985422253608704, 0.7071581482887268, -0.302654892206192, -0.15482155978679...
Is there any way to do it? Thanks for answering. I did found your explanations and link suggestions interesting and encouraging. Anyway, I did not make myself clear with my question. What I did want to know was how to create *any* property, even without knowing it's name. I did read several docs and tutorials until I...
[ 0.5390920042991638, 0.14907419681549072, 0.18110422790050507, 0.37171459197998047, 0.10449696332216263, -0.21169114112854004, 0.20170602202415466, -0.06139529123902321, -0.20903770625591278, -0.2607029378414154, -0.06887870281934738, 0.3235483467578888, -0.07684535533189774, 0.079723656177...
I have a form which gets introduced via XHR and I need to be able to bind an event on it, for submit. I've downloaded the jquery.form.js plugin. What's the best way to perform a late binding so that I can do something such as: ``` $(document).ready(function() { // bind 'myForm' and provide a simple callback ...
[ 0.42465174198150635, -0.05572538077831268, 0.6237615942955017, -0.06400732696056366, -0.1175689846277237, -0.37616392970085144, -0.021197237074375153, -0.04022613540291786, 0.17232392728328705, -0.6782049536705017, -0.06524062156677246, 0.6017535924911499, -0.021881820634007454, 0.04326440...
}); ``` Unfortunately since the form isn't readily available when the DOM first populates, this won't work. \*\* EDIT \*\* I've tried binding to the form AFTER it is retrieved via XHR and haven't had much luck. Here's how it looks: ``` $.get("foo.php", function(data) { $('#my_form').ajaxForm(function() { ...
[ 0.210233673453331, 0.04795880243182182, 0.6516607999801636, -0.10891850292682648, -0.2907453775405884, -0.32385265827178955, 0.36852675676345825, -0.1452597677707672, -0.001005611033178866, -0.5971682071685791, -0.07322589308023453, 0.8515433073043823, -0.3301318287849426, 0.03709161281585...
call this after the form is injected into DOM. Another way to do this is to using `live` binding from [jquery](http://docs.jquery.com/Events/live#typefn) ``` $('#myform').live('submit', function(){ $(this).ajaxSubmit(function(){ alert('Thanks for your comment'); }); return false }); ``` Any way you pick, you m...
[ 0.3750930726528168, -0.26872214674949646, 0.5290716886520386, -0.16869425773620605, -0.06883978098630905, -0.450471431016922, 0.17207810282707214, -0.2487376183271408, -0.16148224472999573, -0.4986169636249542, -0.3084123134613037, 0.74004065990448, -0.276134729385376, 0.007299959193915129...
I'm calling my webservice from a web page and getting a timeout despite setting very high values in my web.config files. This occurs intermittently when the file is usually pretty large but ***yet the file is still getting uploaded completely*** (as if the timeout DID NOT occur). Here is a function in my .aspx file whi...
[ 0.30711671710014343, -0.044506657868623734, 0.5076380372047424, -0.16867277026176453, -0.1668573021888733, -0.1762496680021286, 0.5074885487556458, -0.02674708142876625, -0.4260329306125641, -1.0231760740280151, 0.06715723127126694, 0.42585209012031555, -0.2032768279314041, 0.3636952340602...
WSproxyProject.ASMXProxy.FileService(); try { BinaryReader b = new BinaryReader(postedFile.InputStream); byte[] binData = b.ReadBytes(numBytes); strURI = client.UploadFile(binData, fileNameOnly, binData.Length); txtURI.Text = strURI; LogText("SUCCESS: " + fileNameOnly + "...
[ 0.07774719595909119, -0.31767258048057556, 0.4232000410556793, -0.2760937511920929, -0.01881345361471176, 0.11778637766838074, 0.5582559108734131, -0.28714948892593384, -0.36811721324920654, -0.5588027238845825, -0.4219798147678375, 0.6345512270927429, -0.41803285479545593, 0.1702656298875...
that my web service on localhost calls another web service which actually stores the final data. I have the following executionTimeout setting in of the web.config in all of the following places: 1. web.config on my web client project (caller of myWebService) 2. web.config on myWebService (caller of vendorWebService)...
[ 0.22900430858135223, 0.14283300936222076, 0.5233953595161438, -0.2506801187992096, 0.34229281544685364, 0.12122713774442673, 0.6124261617660522, -0.3215295076370239, -0.22614815831184387, -0.7745112776756287, -0.04634422808885574, 0.5229738354682922, -0.1929190307855606, 0.3389139473438263...
= 9999999; try ... ``` Perhaps you would also need to set similar timeout properties to other Web Services that the FileService uses. I had to do that for a Web Service call that utilized an under powered development database. I'd rather have a Web Service prepared to execute longer than needed than throw an...
[ 0.24886801838874817, 0.1992437243461609, 0.2930245101451874, -0.2247978001832962, 0.15988948941230774, -0.15181799232959747, 0.2689990699291229, 0.12370949983596802, -0.21723906695842743, -0.47849926352500916, 0.06905094534158707, 0.5242478847503662, -0.16228878498077393, 0.081123866140842...
Assuming I'm not using the lock statement, is this a bad practice? ``` public static class Foo { public static string Bar() { bool working; while (working) { // Loop until ready to run. } working = true; // Do stuff here. working = false; return "done." } } ``` Edit - ...
[ 0.7526801228523254, 0.32607346773147583, 0.25564855337142944, -0.4541528820991516, 0.23040030896663666, -0.333524227142334, 0.5650567412376404, -0.14809028804302216, -0.303616464138031, -0.32528990507125854, -0.25979432463645935, 0.5729353427886963, -0.5063419342041016, 0.2450767606496811,...
work. Loop is a CPU consuming process. I mean if everything you do is just waiting. It is not a good.
[ 0.9110283851623535, -0.14031586050987244, -0.02597113884985447, 0.17931927740573883, 0.009619010612368584, -0.11455076187849045, 0.20994770526885986, 0.2271718531847, -0.26108285784721375, -0.2818601131439209, 0.4358407258987427, 0.23775875568389893, -0.33969035744667053, 0.326559573411941...
I'm trying to control an instance of the [JW FLV player](http://www.longtailvideo.com/players/jw-flv-player/) player using jquery. What I want to do is have a series of links which when clicked load an XML playlist into the player. By following the tutorial [here](http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/J...
[ 0.20257198810577393, -0.03775215893983841, 0.6998528838157654, -0.3192655146121979, 0.1967688947916031, -0.09930353611707687, -0.013409336097538471, -0.3230048716068268, -0.19241277873516083, -0.6906543970108032, -0.07178140431642532, 0.7920601963996887, -0.379690557718277, 0.2753499448299...
do is have my anchors look like this: ``` <a class="media" href="#" rel="path/to/playlist.xml">load playlist</a> ``` And then use jquery to find the anchors with class="media", read the value of the element's rel attribute and then bind a click event to it which triggers an appropriate function. Alas this is beyond ...
[ 0.23964278399944305, -0.07192017138004303, 0.4234270453453064, -0.24884845316410065, 0.1683131605386734, -0.361624538898468, 0.194691464304924, -0.4692680537700653, 0.06106181815266609, -0.3783016502857208, -0.09449773281812668, 0.8807501196861267, -0.46458786725997925, -0.0177695788443088...
you can explain things a bit that would be extra awesome. What you're doing seems correct to me, although I'm not sure variable "player" is defined there; it depends on the context. What you can do is something like ``` $('a.media').click(function () { var player = $("#player-id"); if(player.length == 1){ pla...
[ 0.34130677580833435, -0.3273310661315918, 0.3725586235523224, -0.1507224440574646, 0.219265878200531, -0.38636788725852966, 0.10083933919668198, -0.3627212345600128, -0.3555556535720825, -0.6191880106925964, -0.14087113738059998, 0.778744637966156, -0.4565313160419464, 0.3299424946308136, ...
Empirically, it seems that Python's default list sorter, when passed a list of tuples, will sort by the first element in each tuple. Is that correct? If not, what's the right way to sort a list of tuples by their first elements? It automatically sorts a list of tuples by the first elements in the tuples, then by the se...
[ -0.11237657815217972, -0.03871314600110054, 0.21845349669456482, -0.16552375257015228, -0.3522420823574066, 0.34474119544029236, 0.2978253662586212, -0.08063250035047531, -0.25856178998947144, -0.3091055750846863, -0.4584738314151764, 0.2688388526439667, -0.41445064544677734, -0.1505378633...
I'm looking into doing inter-module communication with DotNetNuke 4.8.4 - and am wondering if anyone has any good examples of doing this. I understand that you implement IModuleCommunicator on the sender, and IModuleListener on the receiver - but don't see a way to tie them together besides just dropping them both on...
[ 0.30309149622917175, 0.06079054996371269, 0.561416506767273, -0.10633785277605057, -0.2894211411476135, -0.16175872087478638, 0.30361050367355347, -0.2704594135284424, -0.37893739342689514, -0.5459346175193787, 0.07269550859928131, 0.857611894607544, -0.37982067465782166, 0.112294770777225...
are some of the main takeaways: 1. Only works between modules on the same page. 2. AJAX considerations - probably won't work with partial postbacks 3. Events raised are sent to any module that implements IModuleListner, so you have to be sure that you're consuming the right thing. Here is an example of sending inform...
[ 0.3133971095085144, 0.08947058767080307, 0.3102460205554962, -0.1831805408000946, -0.02973492257297039, -0.20161625742912292, 0.20264723896980286, -0.07516802102327347, -0.3545134365558624, -0.5522030591964722, -0.18360163271427155, 0.5995734333992004, -0.39457911252975464, 0.1776712387800...
when setting up the the EventArgs to be consumed.
[ 0.00026671463274396956, 0.04275032877922058, 0.24060475826263428, 0.18112055957317352, -0.18600870668888092, -0.3711329698562622, -0.1997361183166504, 0.07421024888753891, 0.009851276874542236, -0.4095883369445801, -0.15558674931526184, 0.7457188963890076, 0.30231279134750366, -0.280610561...
Let's say I create a class with a property: ``` public class User { private string _userID; public string UserID { get { return _userID; } set { _userID = value; } } } ``` What do I have to do with the class and property to be able to have a method attached to the UserID property, such as a ...
[ -0.011613715440034866, 0.20184597373008728, 0.5149837732315063, -0.17341360449790955, 0.13886921107769012, 0.13352370262145996, 0.16161949932575226, -0.2472873032093048, 0.10271299630403519, -0.8092097640037537, -0.1557123363018036, 0.5171895027160645, -0.3218272924423218, 0.35485947132110...
a method to put Xml tags around the value of the UserID, the part that is eluding me is how to make the method work with the property using the "dot" syntax. --- All of these answers are useful, and thanks to everyone for contributing. In fact, the answer I marked as "accepted" was precisely what I was looking for. I...
[ 0.2913907766342163, -0.04896039888262749, 0.44315409660339355, 0.26168182492256165, -0.2436714470386505, -0.25642237067222595, 0.4199105501174927, -0.3601786196231842, -0.023337751626968384, -0.47319668531417847, 0.0022010761313140392, 0.28897595405578613, -0.07126595079898834, -0.09126854...
to apply the method ToXml() to all string properties in the class. Just what the doctor ordered. I am quite familiar with XmlSerialization, but in this case needed to avoid it for various reasons. You have to add the method to the **type** of the property. In this case the UserID is a string, so that will mean adding i...
[ 0.120792917907238, -0.13519665598869324, 0.5075076818466187, 0.019495030865073204, 0.12900659441947937, -0.2003185898065567, 0.12826642394065857, -0.14789924025535583, -0.030879536643624306, -0.44611451029777527, -0.10521791130304337, 0.6428555846214294, -0.5437982678413391, 0.378004789352...
{ return string.Format("<{0}>{1}</{0}>", elementName, s); } } ``` This doesn't exactly match your function signature, but it's something that makes a little more sense to attach to the larger string class. The only other option is to use a different underlying type to hold your UserID, perhaps a custom cla...
[ 0.10788818448781967, -0.12632831931114197, 0.28156954050064087, 0.14663328230381012, -0.24779754877090454, -0.20722167193889618, 0.0871436819434166, -0.15451687574386597, -0.19996531307697296, -0.6731216907501221, -0.141556516289711, 0.45694229006767273, -0.33794963359832764, 0.01170453615...
to read or write the class. ``` [Serializable] public class User { private string _userID; [XmlElement()] public string UserID { get { return _userID; } set { _userID = value; } } } ```
[ -0.2068444937467575, -0.009093566797673702, 0.43862512707710266, 0.05502156913280487, 0.02819778025150299, -0.058143455535173416, 0.12720756232738495, -0.041673365980386734, -0.04476887732744217, -0.7489503026008606, -0.43900102376937866, 0.5161309838294983, -0.3853408098220825, 0.23199439...
Disclaimer: I **did** check other questions that seemed related, but this one is much broader and less specific, its goals are completely different, too (so, please do read first before deleting!): Now, while there's "[How To Ask Questions The Smart Way](http://www.catb.org/~esr/faqs/smart-questions.html)", and also "...
[ 0.35906317830085754, -0.15138038992881775, 0.30736786127090454, 0.46490970253944397, 0.04634352773427963, -0.4998396635055542, 0.06291890144348145, -0.22033178806304932, -0.2775595486164093, -0.46932142972946167, -0.10594239085912704, 0.5914636850357056, -0.054928407073020935, -0.318341135...
pointed out in such a guide? The goal would be to come up with a preferably comprehensive list of general guidelines about contributing to open source projects in general, written for new users/contributors who are eager to get involved. Ideally, open source projects could simply point new contributors to the stacko...
[ 0.5675891637802124, 0.2479708343744278, 0.02655027061700821, 0.20694133639335632, -0.15456056594848633, -0.13777285814285278, 0.11019957810640335, -0.15377329289913177, -0.1725653111934662, -0.5581567883491516, -0.1376664936542511, 0.6399201154708862, 0.041899245232343674, -0.0577164590358...
sure you like the subject, the tech used, etc. 2. Make sure you can hack it. Joining a project that's extremely domain-specific or just technically challenging can be demotivating. 3. Make sure you have the time to actually contribute. I ritually boot (and get booted) off open-source projects when very little activity ...
[ 1.009071946144104, 0.11219102144241333, -0.2842375636100769, 0.2646862268447876, -0.26791033148765564, -0.7074571847915649, 0.3857182264328003, 0.3526977598667145, -0.1046580970287323, -0.42564907670021057, -0.1322477012872696, 0.5629377961158752, 0.3187839090824127, -0.14838330447673798, ...
My question is in regards to developing code for the iPhone / iTouch. What with Apple's transition to the Intel platform for their chip, it is obviously now possible to run their OS on a PC. So, with that, and my inherently cheap nature, I was wondering if it was possible to bypass the purchase of a refurbished Mac b...
[ 0.5232536792755127, 0.1470176726579666, -0.11561618000268936, 0.42284148931503296, 0.49780648946762085, 0.26925522089004517, 0.4332060217857361, 0.19122684001922607, -0.2200392484664917, -0.3676896393299103, 0.3257260322570801, 0.5387085676193237, 0.1626977026462555, -0.26028895378112793, ...
be better to purchase a Mac... Yes, it's totally possible. I developed my first app on a Dell running the iATKOS OSX patch. Whether it's worth it or not really comes down to how difficult it is to get a hackintosh install (Kalyway / iATKOS) running on your PC. With some PCs it's trivial and everything works. For other...
[ 0.35896846652030945, 0.04102453216910362, 0.07015629857778549, 0.6366171836853027, 0.3550759553909302, 0.1813642382621765, 0.11932981014251709, 0.5387523770332336, 0.13616769015789032, -0.8688150644302368, -0.012077818624675274, 0.9268665909767151, -0.15465153753757477, -0.0802213773131370...
your PC and do some research on the various OSX86 forums. Assuming you get everything working the only future concern is software updates. iPhone SDKs generally require the very latest OSX update (e.g. 10.5.6), but installing updates on hackintoshes with patched kernels is a nightmare. If you enjoy tinkering with thi...
[ 0.3428148627281189, 0.14036503434181213, 0.24515122175216675, 0.3154132664203644, 0.3135354220867157, -0.03472389653325081, 0.37282437086105347, 0.459169864654541, -0.06906799226999283, -0.715718686580658, -0.11990534514188766, 1.1242103576660156, -0.2165883630514145, -0.1540127694606781, ...
I understand the differences between a multithreaded program and a program relying on inter-machine communication. My problem is that I have a nice multithreaded program written in 'C' that works and runs really well on an 8-core machine. There is now opportunity to port this program to a cluster to gain access to more...
[ 0.20953980088233948, 0.43845120072364807, -0.08084430545568466, 0.2119588553905487, 0.0751635730266571, 0.09612389653921127, 0.3551689088344574, 0.3742455542087555, -0.1537199467420578, -0.5371819734573364, -0.144973486661911, 0.6072525978088379, -0.2237679809331894, 0.14519591629505157, ...
isn't an option. Depending on how your software is written, there may or may not be advantages to going to MPI over keeping your pthread implementation. Unfortunately (or fortunately), message passing is a very different beast than pthreading - the basic assumption is quite different. I love [this quote from Joshua Ph...
[ 0.13329850137233734, -0.1709931194782257, 0.1116488054394722, 0.12302300333976746, -0.21547167003154755, 0.016464801505208015, 0.38959845900535583, 0.08254165202379227, -0.19636894762516022, -0.7453133463859558, 0.074562206864357, 0.6780252456665039, -0.14436857402324677, -0.12797071039676...
is likely to confuse her – she might erase it, not notice it, or accidentally prioritize it incorrectly." Unfortunately, the way you share data is very different. There is no direct access to data in other threads (since it can be on other machines), so it can be a very daunting task to migrate from pthreads to MPI. O...
[ 0.40377435088157654, -0.2352791428565979, 0.17773738503456116, 0.4494079649448395, 0.2732362747192383, 0.16654756665229797, 0.12948021292686462, -0.008132013492286205, -0.6123744249343872, -0.5642897486686707, 0.061175648123025894, 0.07490454614162445, -0.038856931030750275, 0.459878027439...
by switching. It can be worthwhile as a learning experience (you learn a LOT about synchronization and threading by working in MPI), but may not be practical if the gains will be minor.
[ 0.6820125579833984, -0.4533376395702362, 0.19548270106315613, 0.5982992649078369, 0.09789968281984329, -0.19772985577583313, 0.09603220969438553, -0.17537058889865875, -0.5684717297554016, -0.486646443605423, 0.09578496962785721, 0.1689905822277069, -0.32443973422050476, -0.107148997485637...
We are currently designing a business application that has two primary requirements for it's UI: 1) run on the **Desktop (WPF)** for enterprise users to provide a rich user interface, interoperate with other applications, access the filesystem, work offline, work with special local hardware, etc. 2) run on **ASP.NET/...
[ 0.5125313401222229, -0.001370532438158989, 0.4943946599960327, 0.05025562271475792, -0.004765340127050877, -0.13384103775024414, -0.07840757071971893, -0.2861795127391815, -0.045707859098911285, -0.9630864262580872, -0.18998773396015167, 0.46776723861694336, -0.1689341515302658, -0.0735160...
options do we have to reach this goal? Is there a pattern that works well with both technologies? Update: Thanks for the answers even though they don't include the one I was looking for! :) I don't think **UI generators** are a good option. Like Eduardo pointed out you will probably end up with problems in both worl...
[ 0.8734596967697144, -0.0437740795314312, 0.13115294277668, 0.4890170693397522, -0.055056989192962646, 0.22298194468021393, 0.2709822654724121, -0.14282147586345673, -0.3420133888721466, -0.9753217697143555, 0.4789355397224426, 0.48422691226005554, 0.11683754622936249, -0.209182009100914, ...
you were very disciplined in this approach (i.e. not mixing presentation stuff with behavior stuff), you'd probably be farther down the road. You might consider investigating the various DSL toolkits that have cropped up, the idea being to create a simple "language" to describe your UI at a high level and generate a r...
[ 0.8238672614097595, -0.10346651822328568, 0.07196129858493805, 0.0807422325015068, -0.1068405732512474, -0.10806936770677567, 0.043889496475458145, -0.017533084377646446, -0.4209733307361603, -0.7422849535942078, 0.35732799768447876, 0.17187750339508057, -0.10053486377000809, -0.0754378512...
I am looking for free/open or closed forum software for asp.net. Most of the ones I have found require PHP and MySql. <http://www.yetanotherforum.net/> - Yet Another Forum is a pretty popular ASP.NET based forum package.
[ 0.5048041939735413, -0.030092207714915276, 0.1269405633211136, 0.45042160153388977, 0.008171158842742443, -0.156728595495224, -0.02795156091451645, 0.5120599865913391, -0.0495193675160408, -0.477993369102478, 0.3861786723136902, 0.3542085886001587, 0.25258973240852356, 0.2863386273384094, ...
I have an app that was compiled with the built-in Eclipse "Compile" task. Then I decided to move the build procedure into Ant's `javac`, and the result ended being smaller files. Later I discovered that adjusting the debuglevel to `"vars,lines,source"` I could embed the same debug information that Eclipse did, and in ...
[ 0.29146286845207214, 0.0012425490422174335, 0.16111306846141815, -0.13542026281356812, -0.3525178134441376, 0.14764858782291412, 0.27330878376960754, -0.2655150592327118, -0.20514845848083496, -0.7418708801269531, 0.20932693779468536, 0.237920343875885, -0.3391355872154236, 0.1269069612026...
internal layout or size? And how can you compare compiled .class files? THere is no required order for things such as the order of the constant pool entries (essentially all of the symbol info) as well as the attributes for each field/method/class. Different compilers are free to write out in whatever order they want...
[ 0.31892406940460205, 0.10778852552175522, -0.18002459406852722, 0.2531045377254486, -0.11133737862110138, 0.13442178070545197, -0.029746154323220253, -0.19108213484287262, -0.3762257397174835, -0.7866199612617493, 0.1793622076511383, 0.3392215371131897, 0.009453360922634602, 0.047532983124...
I need to pull data from an xls, I also need have the user be able to change the location of the file it will. So an OleDbConnection seemed like a good start, and it was until the first merged cell. This works for all but the merged cells: ``` OleDbCommand cmd = new OleDbCommand(); cmd.Connection = new OleDbConnectio...
[ -0.09750387072563171, 0.02386878803372383, 0.7528685927391052, -0.19593362510204315, 0.16817361116409302, -0.13043272495269775, 0.3176175355911255, -0.24351279437541962, -0.15037204325199127, -0.5372022390365601, -0.286363810300827, 0.5812166333198547, -0.5203536152839661, 0.14835280179977...
to other ways of pulling data from the xls. Or even if there was a command I could run on the xls to remove the mirged cells that might work. I think it's just because you have to enclose the Extended Properties in quotes if you have more than one ``` OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\t...
[ 0.09558533877134323, 0.12071318924427032, 0.5531735420227051, 0.09680456668138504, -0.20645278692245483, 0.07608147710561752, 0.1221374124288559, -0.3516274690628052, -0.04401295259594917, -0.3063957095146179, -0.15498726069927216, 0.6556025743484497, -0.47032463550567627, 0.08530559390783...
I am trying to determine, how I should implement local time in a web-app. All users are logged in, there are no anonymous users. They will need to see all time-values in their local time. Is this how it should be done? 1. All DateTime values are saved as UTC-time in database 2. Each user has a UTC-Offset value stored...
[ 0.5269555449485779, -0.0846354067325592, 0.5358548760414124, 0.026477932929992676, 0.29364675283432007, 0.05651921406388283, 0.25628092885017395, 0.03706034645438194, -0.12815120816230774, -0.7225157022476196, 0.1080135852098465, 0.458918035030365, -0.2760734260082245, -0.10107281804084778...
full time zone information. You should store their [Olson time zone ID](http://en.wikipedia.org/wiki/Zoneinfo), e.g. "Europe/London". Then you can display any UTC time in the local time, taking into account historical changes, daylight savings etc. EDIT: It looks like the `TimeZoneInfo` ID isn't actually in the normal...
[ 0.3989803194999695, -0.33476197719573975, 0.8833560347557068, 0.0791979506611824, 0.19379618763923645, -0.19441638886928558, 0.2051149606704712, 0.3481789827346802, -0.33611541986465454, -0.40945181250572205, -0.4880189001560211, 0.0317339189350605, -0.06803575903177261, -0.132358416914939...
trying to guess it first through JavaScript) - they will have more information than you do. You should investigate the [TimeZoneInfo](http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx) class for more on this - I can't say I've used it much myself, but it's the way to go as of .NET 3.5. In particular, [F...
[ 0.05017034336924553, -0.1201959028840065, 0.4338625371456146, 0.1966821849346161, 0.19449345767498016, -0.10882435739040375, -0.06420158594846725, 0.11795385926961899, -0.10924940556287766, -1.0064045190811157, 0.010757618583738804, 0.25949689745903015, 0.11553402990102768, -0.095444828271...
I'm going to be writing a program which has some web services in it that use XML to pass data back and forth. The format of the XML is predefined - I can't change it to suit my needs - but in code I can handle the data any way I want. My question: Is it better for me to handle the data structure in code as an XML tree...
[ 0.46747109293937683, 0.23949196934700012, 0.048205453902482986, 0.11609683930873871, -0.031225496903061867, -0.048210930079221725, -0.09824543446302414, 0.006853811908513308, -0.16405339539051056, -0.5872551798820496, 0.04079399257898331, 0.3097057044506073, 0.08314674347639084, 0.03789107...
myself, but I don't want to unintentionally bias anyone's answers. This is a language-agnostic question, but if there's any language considerations you have I'd like to hear it. Edit: To clarify, the XML format itself is setup in a logical manner. The object in the language wouldn't differ much from it. For example, i...
[ 0.6642590165138245, 0.2673746347427368, 0.09686516225337982, 0.2470809668302536, 0.1294732242822647, -0.06108934059739113, -0.15753786265850067, -0.06927906721830368, -0.08144715428352356, -0.36226677894592285, -0.07104535400867462, 0.35564932227134705, 0.1620105803012848, 0.05692382901906...
</ownershipDates> </car> ``` Without context, it's hard to say. But I'm guessing you'll have an easier time working with a native data structure. If the XML schema ever changes or you're required to work with a different format, you would have decoupled those those changes from the rest of your program. So probably g...
[ 0.3845697045326233, 0.3230544924736023, 0.0707182064652443, 0.34935569763183594, 0.17189621925354004, 0.015934981405735016, -0.27559399604797363, -0.0051970407366752625, -0.29925739765167236, -0.3747694194316864, -0.10419966280460358, 0.41280046105384827, 0.30014073848724365, 0.15879599750...
Need: Find a way to add a valid tag/attribute/property to a normal html control. What I have is some javascript/jquery adding a click event to a link that will show or hide a div. The idea is to do this using $(document).ready and an anonymous method to create the method called by onClick at the page load. When clicke...
[ 0.33910560607910156, 0.09525609016418457, 0.4112800359725952, 0.14031830430030823, -0.05763281136751175, -0.3689935505390167, 0.11290986835956573, -0.07992091774940491, 0.09046418964862823, -0.7346512079238892, -0.005838465411216021, 0.558967649936676, -0.4827040135860443, -0.0421276576817...
class="showItLink" textToShow="This is the text to show">HI</a> ``` so that I can do this: ``` $(document).ready ( function() { $("..showItLink").click ( function(event) { var containerPosition; var createdDiv; //see if the div already exists createdDiv = $(t...
[ 0.34157758951187134, -0.21694239974021912, 0.6747545003890991, -0.16975043714046478, 0.07224084436893463, 0.009322460740804672, 0.09332790970802307, -0.1968792974948883, -0.017605669796466827, -0.6452280282974243, -0.22247759997844696, 0.3050825595855713, -0.2372242957353592, 0.35210204124...
//This is where the attribute is used so that the CreateDiv //method can take the textToShow and fill the div's innerText //with it V V V V V V createdDiv = CreateDiv(this.textToShow, "postComment"); $(this).append(createdDiv);
[ 0.3325998783111572, -0.24350319802761078, 0.624570906162262, -0.11282319575548172, -0.13026946783065796, 0.19895783066749573, 0.17906135320663452, -0.22921206057071686, 0.05252635106444359, -0.392944872379303, -0.14490363001823425, 0.3142126500606537, -0.3304847180843353, 0.441707462072372...
$(this).children(".postComment").hide(); } $(createdDiv).toggle(); event.preventDefault(); } ); } ); ``` Now besides not being xhtml valid (meh), this only works in IE. Firefox just says it doesn't exist. (this.textToShow) I could use something like rel or rev, but that seems just...
[ 0.2972775101661682, 0.16330519318580627, 0.7266420722007751, -0.14304299652576447, -0.0791245624423027, -0.2562481462955475, 0.5281868577003479, -0.295578271150589, -0.030288636684417725, -0.6277762055397034, -0.39038923382759094, 0.5633631348609924, -0.4284338355064392, 0.0815068110823631...
JQuery, just get and set the attributes with .attr(). Get: this.attr("textToShow") Set: this.attr("textToShow", value)
[ -0.043433669954538345, -0.028972391039133072, 0.5654723048210144, 0.14482545852661133, 0.014187072403728962, -0.15287312865257263, 0.15841782093048096, -0.0901448056101799, 0.12042268365621567, -0.536840558052063, -0.16245628893375397, 0.8401000499725342, -0.29065728187561035, -0.262738108...
select() is defined as : ``` int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); ``` *nfds* represents the highest file descriptor in all given sets plus one. I would like to know why is this data required for select() when the fd\_set information is available. If th...
[ -0.013892804272472858, -0.47633153200149536, 0.23916229605674744, -0.18551138043403625, 0.2591448128223419, 0.21351993083953857, -0.29881903529167175, -0.38178586959838867, -0.34165993332862854, -0.585443913936615, -0.2869175970554352, 0.5280962586402893, -0.3879198729991913, -0.0713467597...
as a bitfield. In other words, executing ``` fd_set foo; FD_CLEAR(&foo); FD_SET(&foo, 3); ``` Sets foo to decimal value 8 - it sets the fourth-least-singificant bit to 1 (remember that 0 is a valid descriptor). ``` FD_SET(&foo, 3); ``` is equivalent to ``` foo |= (1 << 3); ``` So in order for select to work r...
[ 0.07601632177829742, -0.27389082312583923, 0.21394214034080505, -0.24070149660110474, 0.19208140671253204, -0.04432493820786476, -0.06898045539855957, -0.30441930890083313, 0.024839654564857483, -0.3136248290538788, -0.45112717151641846, 0.7146688103675842, -0.4146451950073242, -0.19109338...
set and n = 10 is interpreted as "A set with 10 entries (fds 0-9). Entries 4, 8, and 9 are true (monitor them). Entries 1,2,3,5,6,7 are false (don't monitor them). Any fd value greater than 9 is simply not in the set period."
[ 0.13104042410850525, -0.06487098336219788, 0.2156408429145813, -0.07114017754793167, 0.134210467338562, 0.25831139087677, 0.10917418450117111, -0.09635570645332336, -0.2223387509584427, -0.14773936569690704, -0.4839637875556946, 0.29873430728912354, -0.27980950474739075, 0.2647720873355865...
I realize this might be more of a math problem. To draw the lines for my rectangles I need to solve for their corners. I have a rectangle center at (x,y) With a defined Width and Height. ![](https://i31.photobucket.com/albums/c399/Bolt986/Rectangle-Drawing.jpg) To find the blue points on a non rotated rectangle on t...
[ 0.09377190470695496, -0.2824929356575012, 0.7989825010299683, -0.04130849987268448, -0.06628906726837158, 0.2587604522705078, -0.15396220982074738, -0.4000604450702667, -0.17527268826961517, -0.7857258319854736, -0.1459905356168747, 0.505970299243927, -0.027728237211704254, 0.1339379698038...
the centre point to 0,0 X' = X-x Y' = Y-y Then rotate for an angle of A X'' = (X-x) \* cos A - (Y-y) \* sin A Y'' = (Y-y) \* cos A + (X-x) \* sin A Again transform back the centre point to x,y X''' = (X-x) \* cos A - (Y-y) \* sin A + x Y''' = (Y-y) \* cos A + (X-x) \* sin A + y Hence compute for all 4 points...
[ -0.43822064995765686, -0.03685345500707626, 0.7950135469436646, -0.28435447812080383, -0.45596620440483093, 0.2219482660293579, -0.08493585884571075, -0.3212733268737793, -0.1324133723974228, -0.3731757402420044, -0.3970833122730255, 0.12501390278339386, -0.13613218069076538, 0.59347075223...
A + y where x, y are the centre points of rectangle and X,Y are the corner points You have n't defined correctly even the corner points when Angle is 0 as I have given in the comments. After substituting you will get ``` UL = x + ( Width / 2 ) * cos A - ( Height / 2 ) * sin A , y + ( Height / 2 ) * cos A + ( Wid...
[ -0.06553155183792114, 0.1123138815164566, 0.7110349535942078, -0.5040140748023987, -0.519810140132904, 0.2522234320640564, -0.03461627662181854, -0.5405102372169495, -0.08437582850456238, -0.4299825131893158, 0.027680642902851105, 0.22131720185279846, -0.2500428855419159, 0.304199844598770...
/ 2 ) * sin A , y + ( Height / 2 ) * cos A - ( Width / 2 ) * sin A BL = x + ( Width / 2 ) * cos A + ( Height / 2 ) * sin A , y - ( Height / 2 ) * cos A + ( Width / 2 ) * sin A BR = x - ( Width / 2 ) * cos A + ( Height / 2 ) * sin A , y - ( Height
[ 0.09786956012248993, 0.3555738627910614, 0.6248939037322998, -0.6852970719337463, -0.4520346522331238, 0.36456596851348877, 0.32625406980514526, -0.7179831862449646, -0.23175004124641418, -0.29021990299224854, -0.2069450467824936, 0.43005257844924927, -0.08354567736387253, 0.16888123750686...
/ 2 ) * cos A - ( Width / 2 ) * sin A ``` I think this suits your solution.
[ -0.006468724925071001, 0.20325107872486115, 0.35221996903419495, -0.6783318519592285, -0.20687457919120789, 0.24332192540168762, 0.2848329544067383, -0.1369290053844452, -0.14460045099258423, -0.4493105709552765, -0.17240840196609497, 0.508497953414917, 0.01403025072067976, -0.126572072505...
Most online judges have some sort of system to measure execution time and memory consumption. An example is shown [here](http://acm.timus.ru/status.aspx). How is it done? Is there a simple UNIX utility I can use to run similar tests on my own programs? Valgrind with all it's tools will give you some info: * `cachegrin...
[ 0.1853417009115219, -0.013173561543226242, 0.15628311038017273, 0.24200478196144104, -0.0625554770231247, -0.175019770860672, 0.2769716680049896, -0.26170849800109863, -0.18605713546276093, -0.6804012060165405, 0.2451254278421402, 0.8679590225219727, 0.28108543157577515, -0.115850843489170...
interested in low level details and the real hardware counters yourself then have a look at the [perfmon2](http://perfmon2.sourceforge.net/) which has some chances of getting into mainstream kernel some time in the future. And search old questions - there are many posts on this subject.
[ 0.4516567885875702, -0.04989495500922203, 0.1229427382349968, 0.34447166323661804, -0.007877783849835396, -0.13365055620670319, -0.021521931514143944, 0.365482896566391, -0.23895621299743652, -0.4514658749103546, -0.19219525158405304, 0.7036810517311096, 0.23765777051448822, -0.01091522723...
For some mysterious reason, Google has indexed both these adresses, that lead to the same page: **/something/some-text-1055.html** and **/index.php?pg=something&id=1055** (short notice - the site has had friendly urls since its launch, I have no idea how google found the "index.php?" url - there are "unfriendly" ur...
[ 0.4444041848182678, 0.1916184276342392, 0.4696643650531769, 0.36245474219322205, -0.18739436566829681, -0.2739246189594269, 0.48442426323890686, 0.3590293526649475, -0.3982868194580078, -0.5497699975967407, 0.1175834909081459, 0.42722272872924805, -0.08257140964269638, 0.3522753119468689, ...
lots of CMS systems creating unintended pages/links making it likely that at some point those links were exposed is the most likely culprit. It's also possible your administration area isn't as secure as you think, the google bot got through that way. The well-behaved, and [google recommended](http://www.google.com/su...
[ 0.3178042769432068, 0.2077101767063141, 0.22073514759540558, 0.23294568061828613, -0.11121866852045059, -0.31045660376548767, 0.5071680545806885, -0.0297490693628788, -0.3755882680416107, -0.7895662784576416, 0.0868106484413147, 0.43149977922439575, -0.3809884488582611, -0.0150395520031452...
the spiders or other **automated programs** "Hey, please don't look at this stuff. These aren't the URLs you're looking for" 3. Google apparently [allows you to specify](http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html) a canonical URL now via a <link /> tag in the top of your page. Consid...
[ 0.5711662173271179, 0.05149395763874054, 0.638329803943634, 0.307612806558609, -0.31269320845603943, -0.3640899062156677, 0.5508795380592346, 0.13786448538303375, -0.4393787384033203, -0.4174388647079468, -0.1697600781917572, 0.5901135206222534, -0.3609503209590912, 0.12587372958660126, ...
``` FROM [TABELA DE PRODUTOS/ESTOQUE] AS T1 , [TABELA DE PRODUTOS] AS T2 , [TABELA DE MOVIMENTAÇÃO DE ESTOQUE] AS T3 , [TABELA DE FORNECEDORES] AS T4 , [TABELA DE PRODUTOS/ESTOQUE] AS T5 WHERE (((T1.Produto)=[T2].[ID]) ETC ``` So, how can I add a JOIN between those tables ? I need a left join, like: ``` FROM [TABEL...
[ 0.02681163139641285, 0.12973816692829132, 0.3909207582473755, 0.048026274889707565, 0.048318713903427124, 0.13346657156944275, -0.3628237545490265, -0.09496089071035385, -0.19736652076244354, -0.2605343461036682, -0.18340440094470978, 0.4552648067474365, -0.2138066440820694, -0.05264984071...
[TABELA DE PRODUTOS/ESTOQUE] AS T1, [TABELA DE PRODUTOS] AS T2, [TABELA DE MOVIMENTAÇÃO DE ESTOQUE] AS T3A, [TABELA DE FORNECEDORES] AS T4,
[ -0.06131487339735031, -0.23615364730358124, 0.4310709238052368, -0.05091815069317818, -0.1702582985162735, 0.6693465113639832, 0.23637470602989197, 0.011080068536102772, 0.03769373893737793, -0.13665667176246643, -0.24578875303268433, 0.6757842302322388, -0.0161430723965168, -0.20421162247...
[TABELA DE PRODUTOS/ESTOQUE] AS T5, LEFT JOIN [TABELA DE MOVIMENTAÇÃO DE ESTOQUE] AS T3B ON T1.ID=T3B.ID WHERE (((T1.Produto)=[T2].[ID]) ```
[ -0.31695660948753357, -0.13976426422595978, 0.4069000780582428, -0.1513315588235855, 0.04333053529262543, 0.263750284910202, -0.11005636304616928, -0.15895003080368042, -0.05016423761844635, -0.12218508124351501, -0.2860570549964905, 0.5650392770767212, -0.12010164558887482, 0.088888019323...
I would like to audit when a user has experienced an idle timeout in my Django application. In other words, if the user's session cookie's expiration date exceeds the SESSION\_COOKIE\_AGE found in settings.py, the user is redirected to the login page. When that occurs, an audit should also occur. By "audit", I mean a r...
[ 0.4547257423400879, 0.38166606426239014, 0.15730687975883484, -0.09985452145338058, 0.06435585767030716, -0.5032116174697876, 0.2829079329967499, -0.10121548920869827, -0.4515264928340912, -0.6346203088760376, 0.17689599096775055, 0.573678195476532, -0.05771073326468468, 0.1444395929574966...
an idle timeout or some other event. From what I can tell, I would need to work with the "django\_session" table. However, the records in this table cannot be associated with that user because the sessionid value in the cookie is reset when the redirect occurs. I'm guessing I'm not the first to encounter this dilemm...
[ 0.3380495309829712, -0.11300979554653168, 0.18017058074474335, 0.018352527171373367, 0.223861426115036, -0.285679429769516, 0.3191646635532379, 0.16354410350322723, -0.4826008677482605, -0.5005906820297241, 0.056431498378515244, 0.9140103459358215, -0.32263845205307007, 0.06836547702550888...
at the sessions framework: 1. When a new visitor requests an application URL, a new session is generated for them - at this point, they're still anonymous (`request.user` is an instance of AnonymousUser). 2. If they request a view that requires authentication, they're redirected to the login view. 3. When the login vi...
[ 0.4707951247692108, 0.049267932772636414, 0.3325302302837372, 0.007843014784157276, -0.20545651018619537, -0.21077179908752441, 0.4018082916736603, -0.15332794189453125, -0.24222376942634583, -0.5822025537490845, -0.2643786072731018, 0.5207688212394714, -0.2887811064720154, 0.1657961457967...
using the default database-backed sessions, provided by `django.contrib.sessions.backends.db`). The id of the new session is saved in the `settings.SESSION_COOKIE_NAME` cookie. 5. When the user types in their username and password and submits the form, they are authenticated. If authentication succeeds, the `login` met...
[ 0.3321481943130493, 0.10727470368146896, 0.22919858992099762, 0.0881877914071083, 0.08184640854597092, -0.30893564224243164, 0.3123244345188141, -0.17082688212394714, -0.25702083110809326, -0.563745379447937, -0.4146054685115814, 0.7009952664375305, -0.18457046151161194, 0.2679892480373382...
Both these methods should delete the previous session (for the anonymous user), and call `SessionStore.create` to create a new session. 6. At this point, the user is authenticated, and they have a new session. Their ID is saved in the session, along with the backend used to authenticate them. The session middleware sav...
[ 0.2384832799434662, 0.1606946438550949, 0.4057483375072479, 0.05269702151417732, 0.0514502115547657, -0.42410972714424133, 0.37370067834854126, -0.22949589788913727, -0.346671998500824, -0.6497096419334412, -0.15271064639091492, 0.5808504819869995, -0.09576737135648727, 0.4688788652420044,...
session cookie expires, it is silently deleted by the browser. Building on [Alex Gaynor's suggestion](http://groups.google.co.in/group/django-users/browse_thread/thread/7ada69977dcc13f0#msg_10175bb52e35b113), I think I've come up with another approach, that seems to do what you're asking, though it's still a little ro...
[ 0.2031189203262329, 0.30819666385650635, 0.2826409935951233, 0.10632491111755371, 0.04552643001079559, -0.5913925766944885, 0.6102253794670105, -0.06542226672172546, -0.3383995294570923, -0.46156397461891174, -0.05349212884902954, 0.4392578601837158, -0.1938469409942627, 0.1683314740657806...
if both cookies exist, and have the same value, this is an active session Here's the code so far: *sessionaudit.middleware.py*: ``` from django.conf import settings from django.db.models import signals from django.utils.http import cookie_date import time session_expired = signals.Signal(providing_args=['previous_s...
[ -0.0040823426097631454, 0.08611045032739639, 0.39728954434394836, -0.16388393938541412, -0.24092471599578857, -0.20575274527072906, 0.34271854162216187, -0.4068535268306732, -0.4390243589878082, -0.6006594300270081, -0.04662279784679413, 0.807292103767395, -0.15371380746364594, -0.04841298...
print "** Got new user **" elif audit_cookie and session_key is None: print "** User session expired, Session ID: %s **" % audit_cookie session_expired.send(self.__class__, previous_session_key=audit_cookie) elif audit_cookie == session_key: print "** User session act...
[ -0.2138030081987381, 0.33915427327156067, 0.4363538920879364, -0.21659937500953674, -0.030802657827734947, 0.08360138535499573, 0.44545719027519226, -0.4200909733772278, -0.4007761478424072, -0.4818890690803528, -0.25667616724967957, 0.8540968298912048, -0.22564014792442322, -0.19957739114...
if request.session.session_key: audit_cookie = request.COOKIES.get(AUDIT_COOKIE_NAME, None) if audit_cookie != request.session.session_key: # New Session ID - update audit cookie: max_age = 60 * 60 * 24 * 365 # 1 year
[ 0.3810659646987915, 0.27003762125968933, 0.7089685797691345, -0.14322151243686676, 0.30127328634262085, -0.27129507064819336, 0.3174503445625305, -0.031142259016633034, -0.6091395020484924, -0.4806866943836212, -0.1485358327627182, 0.26962119340896606, 0.20506443083286285, 0.32176131010055...
expires_time = time.time() + max_age expires = cookie_date(expires_time) response.set_cookie( AUDIT_COOKIE_NAME, request.session.session_key,
[ 0.156199112534523, 0.1866108626127243, 0.8939907550811768, -0.034853626042604446, 0.3111913204193115, -0.11968696117401123, 0.1662234216928482, -0.12352912873029709, -0.5233505368232727, -0.5686712265014648, -0.17869390547275543, 0.35281768441200256, 0.017294472083449364, 0.437289446592330...
max_age=max_age, expires=expires, domain=settings.SESSION_COOKIE_DOMAIN, path=settings.SESSION_COOKIE_PATH, secure=settings.SESSION_COOKIE_SECURE or None
[ -0.03999935835599899, 0.21053823828697205, 0.5643515586853027, 0.20821115374565125, 0.7760985493659973, -0.017552077770233154, 0.2165493220090866, 0.25214096903800964, -0.4398488700389862, -0.5871887803077698, -0.1731567531824112, 0.47508305311203003, -0.08943460136651993, 0.37874054908752...
) return response ``` *audit.models.py*: ``` from django.contrib.sessions.models import Session from sessionaudit.middleware import session_expired def audit_session_expire(sender, **kwargs): try: prev_session = Session.objects.get(session_key=kwargs['previous_session_key']) prev_session...
[ 0.04469093680381775, 0.08579189330339432, 0.7412331104278564, -0.1610909253358841, -0.08629100024700165, 0.20067192614078522, 0.44591423869132996, -0.5536956191062927, -0.39062920212745667, -0.6009390950202942, -0.6386831402778625, 0.8946667909622192, -0.18626876175403595, -0.0646484419703...
... ) ``` If you're using this, you should implement a custom logout view, that explicitly deletes the audit cookie when the user logs out. Also, I'd suggest using the django signed-cookies middleware (but you're probably already doing that, aren't you?) OLD: ---- I think you should be able to do this using a custo...
[ 0.4848271906375885, 0.46150198578834534, 0.16664889454841614, -0.08402281999588013, -0.15813525021076202, -0.3225313723087311, 0.22542250156402588, -0.40126410126686096, -0.25427114963531494, -0.5949318408966064, 0.03566557168960571, 0.5070396661758423, -0.379061758518219, 0.09340105205774...
new session, if we have a new user * Generate a new session, if the current user's session has expired What we want to do is override this method, so we can send a signal whenever it is called. """ def create(self): # Save the current session ID: prev_session_id = self.session_key ...
[ 0.43753376603126526, -0.14620700478553772, 0.34463146328926086, -0.015201088972389698, 0.30193111300468445, -0.349425733089447, 0.5456125736236572, 0.029501361772418022, -0.28619852662086487, -0.6892832517623901, -0.18504191935062408, 0.4689057767391205, -0.37410837411880493, 0.25648254156...
super(SessionStore, self).create() # We should have a new session - raise 'session_created' signal: session_created.send(self.__class__, previous_session_key=prev_session_id, new_session_key=self.session_key) ``` Save the code above as 'customdb.py' and add that to your django project. In your setting...
[ 0.444970041513443, -0.12027740478515625, 0.6911654472351074, -0.20506758987903595, -0.14418575167655945, -0.0977502390742302, 0.3907029628753662, -0.3123015761375427, -0.5699725151062012, -0.6156032681465149, -0.15378126502037048, 0.8315678834915161, -0.4139206111431122, 0.1029907464981079...
user try: prev_session = Session.objects.get(kwargs['previous_session_key']) prev_session_data = prev_session.get_decoded() user_id = prev_session_data['_auth_user_id'] # do something with the user_id except Session.DoesNotExist: # new user; do something else... session_...
[ -0.03656761720776558, 0.055868860334157944, 0.6434575915336609, -0.024162698537111282, 0.3061943054199219, 0.0352899432182312, 0.7400954365730286, -0.30065491795539856, -0.40683043003082275, -0.8342683911323547, -0.3924231231212616, 0.8142949938774109, -0.38579028844833374, -0.124834664165...
I've inherited a Java web-services code-base (BEA/Oracle Weblogic) and need to start/launch an external background application from a web-service. I've already tried: ``` ProcessBuilder pb = new ProcessBuilder(arg); pb.start(); ``` as well as: ``` Runtime.exec(cmdString); ``` But am experiencing strange behavior...
[ 0.48405104875564575, 0.36597511172294617, 0.2789998948574066, -0.12835592031478882, 0.22641736268997192, -0.18140557408332825, 0.06240887567400932, 0.06243213638663292, -0.35632145404815674, -0.5929956436157227, -0.012119447812438011, 0.39676138758659363, 0.038827795535326004, 0.2518836557...
for completion (using `waitfor()`) in the webservice will not be an ideal scenario. * Yes, the process we are trying to start from the webservice was created by a fellow team member [cue: your eyes roll... now] *I have had success* when I use process builder to start a bash script, where the external application is la...
[ 0.4249998927116394, 0.19349414110183716, 0.21861489117145538, -0.03427862375974655, 0.1391347348690033, -0.027103658765554428, 0.44884705543518066, -0.5278207659721375, -0.37860116362571716, -0.8074833750724792, -0.2294260561466217, 0.48443928360939026, -0.00407872349023819, 0.308715671300...
the buffer is full (that is really small, 4KB or less). I recommend you to invoke ProcessBuilder.redirectErrorStream() before starting the process. Then, after that, create a thread with the run() method along the lines of: ``` public void run() { BufferedReader reader = new BufferedReader(new InputStrea...
[ -0.04902267828583717, -0.25676849484443665, 0.8297027945518494, -0.4114514887332916, 0.20711387693881989, 0.2539577782154083, 0.165972501039505, -0.09620250761508942, -0.11201032251119614, -0.6282104253768921, -0.09088164567947388, 0.4069615304470062, -0.2661578059196472, 0.335426568984985...
Assuming you have been involved in an open source project (GPL'ed) that has been around for as long as 5-10 years, during this time it has been fairly successful - despite a good handful of commercial/proprietary alternatives. Now, you've come to realize that the long term contributors would like to leverage the proje...
[ 0.5714096426963806, 0.29664236307144165, -0.22507019340991974, 0.020037567242980003, -0.051053084433078766, -0.397887647151947, -0.2629833221435547, 0.2170206755399704, -0.14186426997184753, -0.34799331426620483, -0.10227380692958832, 0.6666638851165771, 0.12049711495637894, -0.03146907687...