text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
out how to make server side calls once a user logged in with Facebook Connect. The key is that the Facebook Connect javascript sets cookies on the client once there's a successful login. You use the values of these cookies to perform API calls on the server. The confusing part was looking at the PHP sample they releas...
[ 0.5399885177612305, -0.006778272334486246, 0.19172751903533936, 0.11820495128631592, 0.06390601396560669, -0.12310098856687546, 0.2946179509162903, -0.2685239315032959, -0.13186313211917877, -0.42170578241348267, 0.3899294435977936, 0.24978011846542358, -0.16292080283164978, -0.24693267047...
logged in with Facebook Connect. Server code: ``` API api = new API(); api.ApplicationKey = Utility.ApiKey(); api.SessionKey = Utility.SessionKey(); api.Secret = Utility.SecretKey(); api.uid = Utility.GetUserID(); facebook.Schema.user user = api.users.getInfo(); string fullName = user.first_name + " " + user.last_na...
[ 0.3256738483905792, -0.39926859736442566, 0.5468706488609314, -0.13409963250160217, 0.18830548226833344, 0.0639713779091835, 0.4152585566043854, -0.1386619359254837, -0.44039687514305115, -0.6795288324356079, -0.15026172995567322, 0.4584680497646332, -0.4363585114479065, -0.14244344830513,...
{ return GetFacebookCookie("session_key"); } public static int GetUserID() { return int.Parse(GetFacebookCookie("user")); } private static string GetFacebookCookie(string name) { if (HttpContext.Current == null) throw new ApplicationException("HttpContext ca...
[ -0.16353166103363037, -0.12533801794052124, 0.7058263421058655, -0.40398526191711426, 0.22809411585330963, 0.038212552666664124, 0.6346456408500671, -0.15471042692661285, 0.23960532248020172, -0.5575370788574219, -0.6361786723136902, 0.691010594367981, -0.5276278257369995, 0.12415638566017...
if (HttpContext.Current.Request.Cookies[fullName] == null) throw new ApplicationException("Could not find facebook cookie named " + fullName); return HttpContext.Current.Request.Cookies[fullName].Value; } } ```
[ -0.2423115372657776, -0.15704414248466492, 0.3558003008365631, -0.24544624984264374, 0.25051164627075195, -0.2845037877559662, 0.48911723494529724, -0.017597991973161697, -0.0763886496424675, -0.5591182708740234, -0.297920286655426, 0.5713496804237366, -0.4447695016860962, 0.09119044989347...
I am using `GridView` in my application for populating datas. Is there any easy way to copy a gridview to datatable ? Actually, in my `GridView` one of the control is textbox. So I can edit that control at any time... What I need is on the button click whatever changes I made in `GridView` has to copy in one data...
[ 0.17840324342250824, -0.02030496671795845, 0.7776628732681274, 0.02920757792890072, -0.03269936516880989, 0.06697928160429001, -0.04403737932443619, -0.16633737087249756, -0.06949776411056519, -0.9961819052696228, 0.09402693808078766, 0.7440703511238098, -0.2717474699020386, 0.224798113107...
i = i + 1 Next ``` Here I am traversing through grid with the help of "for each" loop. I am worrying whether it effects performance? Can you please tel me any other simple method to copy a `GridView` to a datatable html page look like, ``` <asp:GridView ID="Grid1" runat="server" Au...
[ 0.17399141192436218, -0.09190065413713455, 0.3001023232936859, 0.07855822890996933, -0.08714531362056732, -0.22010941803455353, 0.12204393744468689, -0.3362242877483368, -0.04316122084856033, -0.9423242211341858, 0.08307058364152908, 0.3126179575920105, -0.2837110459804535, 0.0217878781259...
<Columns> <asp:TemplateField HeaderText="ID"> <ItemTemplate>
[ 0.012465371750295162, -0.004979678429663181, 0.15442797541618347, -0.059076134115457535, -0.2377139925956726, 0.17431968450546265, -0.03580549359321594, -0.3757317066192627, -0.25162678956985474, -0.47963035106658936, -0.37405285239219666, 0.010314682498574257, -0.30166471004486084, -0.084...
<asp:Label ID="lbl1" runat="server" Text='<%#Bind("ID") %>' CssClass="rowHeader"></asp:Label> </ItemTemplate>
[ -0.30933910608291626, -0.021613486111164093, 0.5078054666519165, -0.05623074620962143, -0.3427816331386566, 0.09227520227432251, 0.1287032514810562, -0.514596700668335, -0.5960774421691895, -0.5382542610168457, -0.2090156525373459, -0.11554224044084549, -0.3111597001552582, 0.2669427394866...
<FooterTemplate> <asp:TextBox ID="txt1" runat="server" Text='<%#Bind("ID") %>'></asp:TextBox>
[ -0.11699537932872772, -0.12875646352767944, 0.36484813690185547, -0.15491153299808502, -0.12922373414039612, 0.40872448682785034, 0.2858229875564575, -0.15318143367767334, -0.2579728364944458, -0.761283814907074, -0.07565956562757492, 0.03733523562550545, -0.1816396713256836, -0.0433811992...
</FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description">
[ 0.031272970139980316, 0.007277595344930887, -0.04750659316778183, 0.007668321952223778, 0.35093027353286743, 0.37630724906921387, 0.07201721519231796, -0.24496270716190338, -0.1991385817527771, -0.8395058512687683, -0.09688394516706467, 0.12551738321781158, 0.037893038243055344, -0.0381573...
<ItemTemplate> <asp:TextBox ID="txt" runat="server" Text='<%#Bind("Description") %>'></asp:TextBox>
[ -0.03792751207947731, -0.02608530782163143, 0.4903094470500946, -0.1303606778383255, -0.378454327583313, 0.2806366980075836, 0.18637821078300476, -0.41620907187461853, -0.34686902165412903, -0.5441341996192932, -0.2650189995765686, 0.20698752999305725, -0.21263174712657928, 0.0837343186140...
</ItemTemplate> <FooterTemplate> <asp:TextBox ID="txt2" runat="server" Text='<%#Bind("Description") %>'></asp:TextBox>
[ -0.10334306955337524, -0.06879346072673798, 0.4452458322048187, -0.045775193721055984, -0.21254166960716248, 0.47294849157333374, 0.10886336863040924, -0.4403831660747528, -0.2708454132080078, -0.68645179271698, -0.07387053966522217, 0.18418321013450623, -0.15442220866680145, -0.0161001421...
</FooterTemplate> </asp:TemplateField>
[ -0.01069619506597519, 0.01131757814437151, -0.0252881720662117, -0.21327067911624908, 0.29076260328292847, 0.5273919105529785, 0.03203431889414787, -0.04572431743144989, -0.3257118761539459, -0.8975068926811218, 0.0027039749547839165, 0.030480919405817986, -0.01879369094967842, -0.13395579...
<asp:TemplateField HeaderText="Comments"> <ItemTemplate> <asp:Label ID="Comments" runat="server" Text='<%#Bind("Comments") %>'></asp:Label>
[ 0.04544159024953842, -0.15710985660552979, 0.3437446653842926, -0.1421692818403244, -0.4044475853443146, 0.028222747147083282, 0.2015572488307953, -0.5904890894889832, -0.15722723305225372, -0.7096188068389893, -0.3510790467262268, 0.052979741245508194, -0.27072498202323914, -0.09376505762...
</ItemTemplate> <FooterTemplate>
[ -0.030821138992905617, 0.18338491022586823, 0.10517111420631409, 0.011144195683300495, -0.0996166542172432, 0.5953628420829773, 0.014699392020702362, 0.12758174538612366, -0.5074313879013062, -0.7714661359786987, 0.24889419972896576, -0.0763598158955574, 0.07037924975156784, -0.02838888950...
<asp:DropDownList ID="Drop1" runat="server"> <asp:ListItem>v1</asp:ListItem>
[ 0.006597581785172224, -0.469279944896698, 0.610344409942627, -0.20592547953128815, -0.07365808635950089, 0.011503021232783794, 0.07369260489940643, -0.08560246974229813, -0.5977852940559387, -0.10466882586479187, -0.4679843485355377, 0.18239183723926544, -0.39438584446907043, -0.1326392740...
<asp:ListItem>v2</asp:ListItem> </asp:DropDownList>
[ -0.1538216918706894, -0.40680035948753357, 0.5146501660346985, -0.32686951756477356, -0.06915533542633057, -0.07994640618562698, 0.15685300529003143, -0.11958666145801544, -0.6222109198570251, -0.15886804461479187, -0.619157075881958, 0.3942033648490906, -0.378714919090271, -0.116789467632...
</FooterTemplate> </asp:TemplateField> </Columns> </asp:GridView>
[ -0.16230107843875885, -0.20238015055656433, 0.3030555248260498, -0.243558868765831, -0.09510602056980133, 0.4890393316745758, -0.14057579636573792, -0.2420925498008728, -0.23225106298923492, -1.0239266157150269, 0.034162916243076324, -0.015859540551900864, -0.03993277996778488, -0.21804623...
<asp:Button ID="btnAdd" runat="server" Text="Add" /> <asp:Button ID="btnSave" runat="server" Text="Save" /> ``` on page load, conn = New OleDb.OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\GDD\_Work\Employee.mdb") ``` If Not Page.IsPostBack Then ViewS...
[ -0.07020242512226105, 0.13958272337913513, 0.5984383225440979, -0.4661587178707123, -0.21346788108348846, 0.28918197751045227, 0.3543882369995117, -0.2855605483055115, -0.4709850549697876, -0.8143370151519775, -0.27204838395118713, 0.4450787603855133, -0.2907356917858124, 0.078056737780570...
Dim Cmd As New OleDb.OleDbDataAdapter("Select * from Emp", conn) Cmd.Fill(ds, "Employee") Grid1.DataSource = ds.Tables("Employee") Grid1.DataBind() Session("intOldCount") = ds.Tables("Employee").Rows.Count Session("tempTable") = ds.Tables("Employee") ``` on add button click, ...
[ -0.053800083696842194, -0.5064166188240051, 0.6620051860809326, -0.32858139276504517, -0.30554014444351196, 0.07630322128534317, 0.3558770716190338, -0.3878697156906128, -0.2846032679080963, -0.41179075837135315, -0.2624461054801941, 0.6628674268722534, -0.32706084847450256, 0.476765483617...
As String intOldCount = CType(Session("intOldCount"), Integer) If Session("blnFlag") = True Then ``` getFooter() dt = CType(Session("tempTable"), DataTable) intNewCount = dt.Rows.Count If intOldCount = intNewCount Then Dim tx1 As TextBox Dim tx2 As TextBox ...
[ 0.326323926448822, -0.43866968154907227, 0.7186703085899353, -0.2713419198989868, -0.02321919985115528, 0.08281733840703964, 0.3339228928089142, -0.38212093710899353, -0.16156800091266632, -0.34906813502311707, -0.41929739713668823, 0.6487844586372375, -0.44978857040405273, 0.1544948667287...
tx1 = CType(Grid1.FooterRow.FindControl("txt1"), TextBox) tx2 = CType(Grid1.FooterRow.FindControl("txt2"), TextBox) drp = CType(Grid1.FooterRow.FindControl("Drop1"), DropDownList) strQuery = "INSERT INTO Emp (ID,Description,Comments) values ('" + tx1.Text + "','" + tx2.Text + "','" ...
[ 0.10693579912185669, -0.017805716022849083, 0.807865560054779, -0.05338728800415993, 0.15457706153392792, 0.26611730456352234, 0.04582713916897774, -0.44587287306785583, -0.23942452669143677, -0.4778428375720978, -0.47168776392936707, 0.5339488387107849, -0.3324374258518219, -0.21880914270...
conn.Open() Cmd.ExecuteNonQuery() conn.Close() Else For i = intOldCount To intNewCount - 1 Dim strId As String Dim strDesc As String
[ -0.16949044167995453, -0.11787854880094528, 0.5362879037857056, -0.3900010883808136, -0.1652432233095169, -0.06065927818417549, 0.44774478673934937, -0.5638700127601624, 0.049695227295160294, -0.25613248348236084, -0.16572365164756775, 0.3770744204521179, -0.13547444343566895, 0.3828577101...
Dim strComm As String strId = dt.Rows(i)(0).ToString() strDesc = dt.Rows(i)(1).ToString() strComm = dt.Rows(i)(2).ToString() strQuery = "INSERT INTO Emp (ID,Description,Comments) values ('" + strId + "','" + strDesc + "','" + strComm + "')"
[ 0.12188360840082169, -0.3408866822719574, 0.7984881401062012, -0.31723007559776306, -0.23994481563568115, 0.2358092963695526, 0.17100301384925842, -0.5386978387832642, -0.004086565691977739, -0.07469416409730911, -0.26812392473220825, 0.632556140422821, -0.2564467489719391, 0.2097717672586...
Dim Cmd As New OleDb.OleDbCommand(strQuery, conn) conn.Open() Cmd.ExecuteNonQuery() conn.Close() Next End If For i = 0
[ -0.022584781050682068, -0.2655509114265442, 0.9602925181388855, -0.2353619635105133, -0.1003088653087616, 0.010769872926175594, 0.38653844594955444, -0.3313468396663666, 0.005830447189509869, -0.3062886595726013, -0.18633019924163818, 0.5999023914337158, -0.4588398337364197, 0.311172455549...
To intOldCount - 1 Dim strId As String Dim strDesc As String strId = dt.Rows(i)(0).ToString() strDesc = dt.Rows(i)(1).ToString() strQuery = "update Emp set Description = '" + strDesc + "' where ID = '" + strId + "'"
[ -0.1472775638103485, -0.42980366945266724, 0.656141996383667, -0.4988531172275543, -0.27312153577804565, 0.045491836965084076, 0.4163822829723358, -0.5910629034042358, 0.22808139026165009, -0.20404331386089325, -0.17426586151123047, 0.5476356148719788, -0.2990758419036865, 0.04206287488341...
Dim Cmd1 As New OleDb.OleDbCommand(strQuery, conn) conn.Open() Cmd1.ExecuteNonQuery() conn.Close() Next ds = New DataSet() Dim CmdData As New OleDb.OleDbDataAdapter("Select * from Emp", conn) CmdData.Fill(ds, "Employee") Grid1.DataSource = ds....
[ -0.1737350970506668, -0.7116909027099609, 0.6360576748847961, -0.14399908483028412, -0.19671060144901276, 0.09879907220602036, 0.2974686622619629, -0.35555967688560486, -0.22713331878185272, -0.5173954367637634, -0.31811970472335815, 0.547153115272522, -0.39178603887557983, 0.0791107937693...
Grid1.DataBind() Session("blnFlag") = False Else dt = CType(Session("tempTable"), DataTable) i = 0 For Each rows As GridViewRow In Grid1.Rows Dim txt As TextBox txt = CType(rows.FindControl("txt"), TextBox) dt.Rows(i)(1) =
[ 0.07203519344329834, -0.3831915557384491, 0.41311681270599365, -0.15264731645584106, -0.22710372507572174, 0.32742008566856384, 0.15892373025417328, -0.38341137766838074, -0.11896397918462753, -0.711902916431427, -0.06869152933359146, 0.6275737881660461, -0.3921280801296234, 0.200170978903...
txt.Text i = i + 1 Next Session("tempTable") = dt For i = 0 To intOldCount - 1 Dim strId As String Dim strDesc As String strId = dt.Rows(i)(0).ToString()
[ 0.05386761203408241, -0.423941433429718, 0.6549670696258545, -0.3456650972366333, -0.1270282119512558, 0.12741662561893463, 0.5695505142211914, -0.33595773577690125, 0.07583217322826385, -0.33183664083480835, -0.16058194637298584, 0.9003141522407532, -0.3247268497943878, 0.0278164204210042...
strDesc = dt.Rows(i)(1).ToString() strQuery = "update Emp set Description = '" + strDesc + "' where ID = '" + strId + "'" Dim Cmd1 As New OleDb.OleDbCommand(strQuery, conn) conn.Open() Cmd1.ExecuteNonQuery() conn.Close() Next
[ -0.28557223081588745, -0.29482194781303406, 0.9536877274513245, -0.21211475133895874, -0.1277196705341339, 0.15874168276786804, 0.519104540348053, -0.2990415096282959, -0.12561823427677155, -0.5760387182235718, -0.25191017985343933, 0.5595718622207642, -0.3146229684352875, 0.16115027666091...
Grid1.DataSource = dt.DefaultView Grid1.DataBind() End If ``` im using one function like, Public Function getFooter() Dim tx1 As TextBox Dim tx2 As TextBox Dim drp As DropDownList tx1 = CType(Grid1.FooterRow.FindControl("txt1"), TextBox) tx2 = CType(Grid1.FooterRow.FindControl("txt2"), TextBox) dr...
[ 0.12293916195631027, -0.4428698420524597, 0.7881362438201904, -0.009763350710272789, -0.318367063999176, 0.12543106079101562, 0.02688886970281601, -0.4852272570133209, -0.1323780119419098, -0.5488499999046326, -0.36700892448425293, 0.5536528825759888, -0.3676086664199829, 0.112586513161659...
dt.Rows.Add(dr) i = 0 For Each rows As GridViewRow In Grid1.Rows Dim txt As TextBox txt = CType(rows.FindControl("txt"), TextBox) dt.Rows(i)(1) = txt.Text i = i + 1 Next Grid1.DataSource = dt.DefaultView Grid1.DataBind() Session("tempTable") = dt End Function ...
[ -0.02302371710538864, -0.3131761848926544, 0.531889021396637, -0.21780377626419067, -0.03435483202338219, 0.1043839305639267, 0.3463681936264038, -0.23584647476673126, -0.14208370447158813, -0.7869178056716919, -0.22409671545028687, 0.8017404675483704, -0.28729936480522156, 0.3320064246654...
I have set up a cruisecontrol.net build server. When running it in console mode it works fine, but when trying to run it as a windows service it doesn't work. The log file shows the following message: ``` ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: No VSS database (srcsafe...
[ -0.017954358831048012, -0.2138630598783493, 0.7218080163002014, -0.03776136040687561, 0.37127965688705444, -0.22511820495128632, 0.3226923942565918, 0.020302660763263702, -0.27563852071762085, -0.7643721103668213, 0.06543946266174316, 0.8185322880744934, -0.03209950402379036, 0.21367526054...
the Service does not have access rights to the srcsafe.ini file and your account does(assuming that's what your using to run the console). Apologies if I'm way off the mark, just trying to help!
[ 0.19022637605667114, 0.10295206308364868, 0.24507123231887817, 0.12407935410737991, 0.11673760414123535, -0.17560255527496338, 0.5475116968154907, 0.44815704226493835, -0.07708197832107544, -0.3154284954071045, 0.049114663153886795, 0.35134392976760864, 0.2526192367076874, 0.20306320488452...
I am developing an .net application which heavely depends on plugins. The application itself contains an connection to a remote server. Recently I digged into Application domains and see them as the ideal solution for isolating the plugin code from the rest of the application. However there is one big disadvantage w...
[ 0.4294866919517517, 0.23130370676517487, 0.25705885887145996, 0.07638297975063324, -0.00007026531966403127, -0.17577210068702698, 0.1480897217988968, 0.12930594384670258, -0.16627763211727142, -0.7129523754119873, 0.20342932641506195, 0.2887929379940033, -0.28031009435653687, 0.62312692403...
I can pass an reference to that object. Note: Creating a proxy is out of the question, the connection layer already acts as a proxy since the classes are auto generated. Note2: System.AddIn can not be used as it is not available on the compact framework. Have you tried deriving from [MarshalByRefObject](http://msdn.m...
[ 0.2872980237007141, 0.13911859691143036, 0.23283450305461884, 0.0630905032157898, 0.0027436581440269947, -0.5447190999984741, 0.37767475843429565, -0.32101812958717346, -0.11255916953086853, -0.7207552790641785, -0.09882352501153946, 0.1527889370918274, -0.30053916573524475, 0.404812902212...
are implicitly > marshal by value. When a remote > application references a marshal by > value object, a copy of the object is > passed across application domain > boundaries. > > > MarshalByRefObject objects are > accessed directly within the > boundaries of the local application > domain. The first time an ...
[ 0.24324235320091248, 0.30125024914741516, 0.4328576326370239, 0.312307745218277, 0.10007219016551971, -0.1817464530467987, 0.44731405377388, -0.7633689045906067, -0.045344654470682144, -0.5160179138183594, -0.13923335075378418, 0.09777936339378357, -0.493949830532074, 0.32659024000167847, ...
MarshalByRefObject when the type is > used across application domain > boundaries, and the state of the > object must not be copied because the > members of the object are not usable > outside the application domain where > they were created. In my experience, it can be pretty limiting - you really need to do as...
[ 0.07912313938140869, 0.2106107622385025, 0.1514790952205658, 0.20255494117736816, 0.33632442355155945, -0.4919638931751251, 0.6233174800872803, -0.41261258721351624, -0.133108451962471, -0.34956231713294983, -0.10093488544225693, 0.5484694242477417, -0.3463100492954254, -0.1433153152465820...
a bit of a minefield.
[ 0.02455396205186844, 0.16945256292819977, -0.09171632677316666, -0.10555572807788849, 0.12791699171066284, -0.32294806838035583, 0.3364834785461426, 0.22303131222724915, 0.03235626965761185, -0.19117017090320587, 0.055528152734041214, -0.06749124825000763, -0.09555243700742722, 0.120429418...
This is a broad question, so let me narrow it a bit. I am a graphic designer entering the world of web design. I'm not totally green in this field, but I know enough to know that I have a lot to learn. From friends and from posts on this site I realize there is often a harmful disconnect between design and development....
[ 0.911077082157135, 0.3029080331325531, 0.41811323165893555, 0.04087463393807411, 0.15333235263824463, -0.04762287065386772, 0.059077441692352295, 0.2567899525165558, -0.3549724519252777, -1.0335947275161743, 0.27238529920578003, 0.49976402521133423, 0.15480059385299683, 0.01824413798749447...
look and feel of this one, nothing more. What potential pitfalls should I know about, on my end, to avoid making the development end hairy? And of course any other nuggets of wisdom are appreciated too. Thanks! Perhaps the worst mistake that many designers make when working with developers is to assume that developer...
[ 0.7677223086357117, 0.2893558740615845, -0.3347136378288269, 0.27879834175109863, 0.021721605211496353, -0.06361880153417587, 0.3703465163707733, 0.12381269782781601, -0.16124458611011505, -0.5080971121788025, 0.0985933169722557, 0.606918215751648, 0.21059748530387878, 0.16532199084758759,...
doesn't represent the design exactly, yet many designers get very touchy when we raise suggestions about how their design could be improved even in minor ways. Sometimes the suggestions may not be suitable, but occasionally you might be able to improve your design. In addition, I have frequently found that designers u...
[ 0.6419896483421326, 0.019187791272997856, 0.004131688270717859, 0.2865554094314575, -0.04997124522924423, 0.021482618525624275, 0.21639572083950043, 0.043135758489370346, -0.00839929562062025, -0.5183765888214111, 0.10905972868204117, 0.626277506351471, 0.009906849823892117, -0.11920457333...
all of it, or even something better as you discuss what actually can be achieved (sometimes what seems hard to achieve to a designer seems easy to the dev, and vice versa, because they are different disciplines). Of course the converse is true and you might be aiming too high, so you need to find that out as well. In ...
[ 0.8156616687774658, 0.0790373906493187, -0.043518226593732834, 0.4561815857887268, -0.06743354350328445, -0.2548145353794098, 0.07139760255813599, 0.005342626478523016, 0.1062350869178772, -0.4944952130317688, -0.15633876621723175, 0.9313749074935913, 0.026250319555401802, -0.0878123939037...
I'm quickly falling in love with ASP.NET MVC beta, and one of the things I've decided I won't sacrifice in deploying to my IIS 6 hosting environment is the extensionless URL. Therefore, I'm weighing the consideration of adding a wildcard mapping, but everything I read suggests a potential performance hit when using thi...
[ 0.38843658566474915, 0.030255690217018127, 0.09142432361841202, 0.03867238759994507, -0.09729921072721481, -0.2568340003490448, 0.250445157289505, 0.1887577474117279, -0.2604418098926544, -0.4603349566459656, 0.01608668453991413, 0.20154210925102234, -0.23099933564662933, 0.258002609014511...
jMeter on our dev server over a 100Mbs connection. **Background Info** Our hosting provider has a 4Gbs burstable internet pipe with a 1Gbs backbone for our VLAN, so anything I can produce over the office lan should translate well to the hosting environment. The test scenario was to load several images / css files,...
[ 0.41818201541900635, -0.31920984387397766, 0.4287864863872528, 0.2571493983268738, 0.02347131073474884, 0.12415719032287598, 0.5202254056930542, -0.3869089186191559, -0.04562598094344139, -0.8405579328536987, 0.0957111120223999, 0.4487491548061371, -0.0300996582955122, -0.2691109776496887,...
posted below. **Test Results** Without wildcard mapping: ``` Samples: 50,000 Average response time: 428ms Number of errors: 0 Requests per second: 110.1 Kilobytes per second: 11,543 ``` With wildcard mapping: ``` Samples: 50,000 Average response time: 429ms Number of errors: 0 Requests per second: 109.9 Kilobyt...
[ 0.06337925046682358, -0.04153386130928993, 0.1702619194984436, 0.4545949697494507, -0.14438258111476898, 0.20002076029777527, 0.6659541130065918, -0.1289745420217514, -0.37411007285118103, -0.6485059857368469, -0.13993246853351593, 0.6431326270103455, 0.24938642978668213, -0.27602022886276...
and not a single comment? I was hoping for more.. lol Chris, very handy post. Many who suggest a performance disadvantage infer that the code processed in a web application is some how different/inferior to code processed in the standard workflow. The base code type maybe different, and sure you'll be needing the MSIL...
[ 0.3351132571697235, 0.03246584162116051, -0.2613564729690552, 0.32443898916244507, -0.16962334513664246, -0.14786025881767273, 0.2654815912246704, 0.20121155679225922, -0.19825908541679382, -0.6482973098754883, -0.03794053569436073, 0.550743043422699, -0.19613675773143768, 0.12028843909502...
Some of those are designed for performance increase (caching, compression) and - indeed - will be lost unless you reimplement them in your code, but many of them are for other purposes and may not ever be used. If you build for your needs (only) you can ignore those other pieces and should be realising some kind of per...
[ 0.6396305561065674, 0.193129763007164, 0.25155091285705566, 0.27540522813796997, -0.13069754838943481, 0.01609170436859131, 0.2039632350206375, -0.019362499937415123, -0.41615816950798035, -0.7603684067726135, -0.11670702695846558, 0.4737042486667633, -0.2663705050945282, 0.143053740262985...
swallow. I'm not surprised the difference is almost negligible in your tests, but I'm happy to see it backed up. NOTE: You can disable wildcard mapping from static directories (I keep all static files in /static/(pics|styles|...)) in IIS. Switch the folder to an application, remove the wildcard mapping, and switch it...
[ 0.5981733798980713, -0.11459304392337799, 0.29755812883377075, 0.07902361452579498, 0.3495991826057434, -0.20444338023662567, 0.1120493933558464, 0.06708581000566483, -0.2864198088645935, -0.683856189250946, 0.10468985885381699, 0.49182870984077454, -0.14720062911510468, 0.1432920843362808...
This might be a silly question: * Does HTTP ever use the User Datagram Protocol? **For example:** > If one is streaming MP3 or video using HTTP, does it internally use UDP for transport? Typically, no. Streaming is seldom used over HTTP itself, and HTTP is seldom run over UDP. See, however, [RTP](http://en.wikiped...
[ 0.25305280089378357, -0.1000053808093071, 0.2788238823413849, 0.25234147906303406, -0.15839947760105133, -0.06394072622060776, -0.2065829187631607, 0.361115038394928, -0.9437419176101685, -0.7049305438995361, -0.19241002202033997, 0.2606765031814575, -0.20568567514419556, 0.356645584106445...
the resource will be saved to local disk before being played back, so the network transfer is not what's usually meant by "streaming". As commenters have pointed out, though, it's certainly possible to really stream over HTTP, and that's done by some.
[ 0.2752888798713684, -0.26737797260284424, 0.15828345715999603, 0.30421164631843567, 0.02092386782169342, -0.29283076524734497, 0.113531194627285, 0.4568271040916443, -0.2998187839984894, -0.5913903117179871, -0.16377389430999756, 0.5294914245605469, 0.06491148471832275, 0.2840399444103241,...
How does the C/C++ compiler manipulate the escape character ["\"] in source code? How is compiler grammar written for processing that character? What does the compiler do after encountering that character? Most compilers are divided into parts: the compiler front-end is called a [lexical analyzer](http://en.wikipedia.o...
[ -0.11516761034727097, 0.23196859657764435, -0.15986673533916473, 0.32139524817466736, -0.013577950187027454, 0.3021903932094574, 0.23440445959568024, -0.2752700746059418, 0.21087676286697388, -0.3387989401817322, -0.5816649794578552, 0.30132585763931274, -0.3078819811344147, -0.27792024612...
other token (such as a tab or a newline) to the next part of the compiler ([the parser](http://en.wikipedia.org/wiki/Parser)). The state machine can group several characters into a token.
[ -0.050476692616939545, -0.02645804174244404, -0.1513550579547882, 0.2624533474445343, -0.15328766405582428, 0.44723811745643616, -0.15255357325077057, -0.39139482378959656, -0.06398675590753555, -0.5298786759376526, -0.2988014817237854, -0.07868263870477676, -0.08213798701763153, 0.0032937...
If a user requests a large file from an Apache web server, but cancels the download before it completes, is this logged by Apache? Can I tell from the log file which responses were not sent fully, and how many bytes were sent? Yes, it logs those requests, but you need to use [mod\_logio](http://httpd.apache.org/docs/2...
[ 0.2321358174085617, 0.016641046851873398, 0.26902472972869873, 0.09121616929769516, -0.15351572632789612, -0.2514324486255646, 0.4738464951515198, -0.3206218481063843, -0.4507121741771698, -0.494487464427948, -0.39755240082740784, 0.42191362380981445, -0.24013663828372955, 0.04350379481911...
(why would you if you have the first option :-) )
[ 0.30824604630470276, -0.03260991722345352, -0.11714337021112442, 0.1524210423231125, 0.12456851452589035, 0.2468695491552353, 0.10301545262336731, -0.14899735152721405, -0.2588493525981903, -0.04727540165185928, -0.3119465708732605, 0.26714789867401123, -0.34508708119392395, 0.084196008741...
I'm learning ASP.NET MVC and bugged by one issue. In the HomeController, the Index action has OutputCache attribute, but it seems doesn't work. ``` [HandleError] public class HomeController : Controller { [OutputCache(Duration=5, VaryByParam="none")] public ActionResult Index() { ViewData["Title"]...
[ -0.32613199949264526, -0.4904259443283081, 0.8880874514579773, -0.1884649395942688, 0.26337045431137085, -0.15191000699996948, 0.32955679297447205, 0.007175615523010492, -0.4865957796573639, -0.858879804611206, -0.39140933752059937, 0.5020993947982788, -0.12437103688716888, 0.3676005005836...
action. If I access it through "<http://localhost:3573/>", the outputcache doesn't work. However, if I access it with "<http://localhost:3575/Home/Index>", the outputcache works. Anybody know any workaround to make the default controller-action outputcacheable? Thanks. I think this is a bug in ASP.NET MVC. We have lo...
[ -0.12001051753759384, -0.38638630509376526, 0.40660974383354187, 0.10258127003908157, -0.1145671010017395, -0.11622128635644913, 0.22290828824043274, 0.07465972751379013, -0.6102694869041443, -0.6244307160377502, -0.18828441202640533, 0.8400844931602478, -0.4257216453552246, -0.07174864411...
``` A.Event1 := nil; A.Event2 := nil; try ... finally A.Event1 := MyEvent1; A.Event2 := MyEvent2; end; ``` Can something go wrong with it? **EDIT:** I've accepted Barry's answer because it answered exactly what I asked, but Vegar's answer is also correct depending on the scenario, sadly I can't accept both. I...
[ 0.19589266180992126, -0.08204096555709839, 0.09352312982082367, -0.12743821740150452, 0.017995072528719902, -0.04935527965426445, 0.44080597162246704, -0.23523090779781342, -0.33133459091186523, -0.14558522403240204, -0.23058903217315674, 0.47761857509613037, -0.37251606583595276, 0.141405...
the code is between the try and finally. However, that does assume that Event1 and Event2 properties (all Delphi events are properties of a method pointer type) do not do unusual things in their setters. A pathologically malicious event setter could squirrel away a method pointer, and still be able to invoke it, even ...
[ -0.05684315413236618, -0.2689637541770935, 0.1568550020456314, 0.02743990160524845, 0.009605695493519306, -0.27444833517074585, 0.24916131794452667, -0.10647650063037872, 0.08834382891654968, -0.41658738255500793, -0.0999462753534317, 0.1318482607603073, -0.13072262704372406, 0.17985211312...
Here's a relatively common task for me, and, I think, for many a .NET programmer: I want to use the .NET ThreadPool for scheduling worker threads that need to process a given type of tasks. As a refresher, the signatures for the queueing method of the ThreadPool and its associated delegate are: ``` public static b...
[ 0.22592385113239288, -0.13858754932880402, 0.3363179862499237, -0.23046119511127472, 0.11734049767255783, -0.030068345367908478, -0.004638753365725279, 0.03433544188737869, -0.6113138794898987, -0.5402337908744812, 0.03501404821872711, 0.3920915722846985, -0.4274621903896332, 0.38991373777...
i_task) } private void execute(Object o){ T task = (T)o; //What happened to the type safety? executeTask(task); } private void executeTask(T i_task){ //process i_task } } ``` Notice the type of the `state` parameter? It's *`Object`* ! What's the compelling reason why th...
[ 0.10732559859752655, -0.12211660295724869, 0.280933141708374, -0.2617759704589844, 0.17312853038311005, 0.010164833627641201, 0.45278412103652954, -0.017733925953507423, -0.42731550335884094, -0.40021079778671265, 0.03547515720129013, 0.4443759620189667, -0.52036452293396, 0.58258390426635...
how I'd like to see it: ``` //in the ThreadPool class: public static bool QueueUserWorkItem<T> ( WaitCallback<T> callBack, T state ) public delegate void WaitCallback<T> (T state) ``` This would make the worker class type-safe (and a lot clearer, IMHO): ``` public class Worker<T> { public void schedule(...
[ 0.5022565722465515, -0.039116647094488144, 0.2956954836845398, -0.21611171960830688, 0.2729150354862213, 0.007446321193128824, 0.03368290141224861, 0.17230606079101562, -0.5447383522987366, -0.8760910630226135, 0.273266077041626, 0.36832737922668457, -0.5073724985122681, 0.4612994790077209...
clippy...) For the record, thread-pool threads should typically be used for short pieces of work. You should ideally create your own threads for a long-lived queue. Note that .NET 4.0 may be adopting the CCR/TPL libraries, so we'll get some inbuilt work queues for free - but it isn't hard to write a threaded work-queu...
[ 0.5078485012054443, -0.34758666157722473, 0.44378024339675903, 0.07981543987989426, -0.006060105748474598, -0.21775533258914948, -0.05218924582004547, -0.029300549998879433, -0.27737295627593994, -0.603797972202301, 0.0029349278192967176, 0.5198661684989929, -0.5747369527816772, 0.07799115...
t.Name = "Worker n"; t.Start(); ``` This gives you much more granular control over the thread, without saturating the `ThreadPool`.
[ -0.040781084448099136, -0.30043843388557434, 0.0774325281381607, -0.18864579498767853, 0.024016328155994415, 0.01715443842113018, 0.1473078727722168, -0.21919970214366913, -0.4209963083267212, -0.5274540781974792, -0.0649062991142273, 0.36144524812698364, -0.2804144620895386, 0.50596237182...
I know how to disable [WSDL-cache](https://stackoverflow.com/questions/303488/in-php-how-can-you-clear-a-wsdl-cache) in PHP, but what about force a re-caching of the WSDL? This is what i tried: I run my code with caching set to disabled, and the new methods showed up as espected. Then I activated caching, but of some...
[ 0.3084186911582947, 0.14717842638492584, 0.30234000086784363, 0.08360393345355988, -0.12612973153591156, -0.21732696890830994, 0.664266049861908, -0.3170711100101471, -0.10228124260902405, -0.4924279451370239, 0.0278609711676836, 0.5695149898529053, -0.3733920454978943, -0.0425033643841743...
caching enabled) ``` ini_set('soap.wsdl_cache_ttl', 1); ``` I put in a time-to-live of one second in because I think if you put zero in it will disable the cache entirely but not remove the entry. You probably will only want to put that line in when you want to kill the cached copy.
[ -0.02777101658284664, -0.0016464802902191877, 0.39664867520332336, -0.2294660210609436, 0.04296717047691345, -0.026569660753011703, 0.4921102523803711, -0.10705797374248505, 0.19980774819850922, -0.6150816679000854, -0.05400048941373825, 0.45853492617607117, -0.33601996302604675, 0.0673048...
Has anyone encountered the following problem: I have IIS7 running on my computer. On that same computer, I open IE7 and the website works (<http://localhost/web.site/Default.aspx>). Put that same url in Firefox 3 and I get the welcome screen of IIS7, a big image with IIS7 in the middle and 'Welcome' in several differen...
[ -0.022034790366888046, 0.040473151952028275, 0.5614035129547119, -0.19867970049381256, 0.008971434086561203, -0.19502510130405426, 0.42289361357688904, 0.12123998254537582, -0.33313077688217163, -1.311397671699524, -0.2833453118801117, 0.6308361887931824, -0.17391742765903473, 0.2085780650...
I have an entity that maps to an external oracle table which is one of the primary data sources of my application. This entity is modelled using hibernate. The oracle table now has a complex function defined the calculates some special values. I need to call this function somehow - almost as another accessor on the en...
[ 0.2427143007516861, 0.0045975204557180405, 0.3399220108985901, 0.21910956501960754, -0.06282790005207062, -0.0964641347527504, 0.09813063591718674, -0.10163503885269165, 0.1290709674358368, -0.5707708597183228, 0.24399003386497498, 0.5296934843063354, -0.29260489344596863, 0.09458412975072...
I need to test a url that it **does not** end with `.asp` So `test`, `test.html` and `test.aspx` should match, but `test.asp` should not match. Normally you'd test if the url **does** end with .asp and negate the fact that it matched using the NOT operator in code: ``` if(!regex.IsMatch(url)) { // Do something } ``...
[ 0.17657311260700226, 0.09322934597730637, 0.4768584668636322, 0.2544573247432709, -0.015143239870667458, -0.3439054787158966, 0.22906708717346191, -0.1961822658777237, 0.1374349147081375, -0.6266887784004211, -0.09209449589252472, 0.34012794494628906, -0.2230084389448166, -0.04900575429201...
it should fall through when the controller in the url ends with .asp The trick is to use [negative lookbehind](http://www.regular-expressions.info/lookaround.html). If you need just a yes/no answer: ``` (?<!\.asp)$ ``` If you need to match the whole URL: ``` ^.*(?<!\.asp)$ ``` These regexes will work with any UR...
[ -0.0005948480684310198, -0.3569273352622986, 0.5593279600143433, 0.03623863309621811, -0.19809822738170624, -0.09817728400230408, 0.24997349083423615, -0.10755272209644318, -0.1712915003299713, -0.4384199380874634, -0.2520006597042084, 0.5908638834953308, -0.3130648732185364, 0.00797207746...
For example, let's take the format of a forum, where we have multiple users and multiple threads. Say this forum wants to track which users have read which threads and, say, use that information to mark which threads are unread when viewing the thread list. The only solution I can imagine is something that drops a rec...
[ 0.7038782238960266, -0.060960035771131516, 0.01854180358350277, 0.4018721282482147, -0.023243151605129242, -0.4276375472545624, -0.15641333162784576, 0.20928743481636047, -0.5496730208396912, -0.49627140164375305, 0.33164340257644653, 0.33301278948783875, -0.1858433037996292, 0.39102151989...
a feeling that I'm missing something here... maybe Thanksgiving morning isn't the time to think over one's programming problems. Is there a better solution out there for this? Any ideas? 1. Drop a record in the database for each user-thread combination 2. Or store this information in a file - one file per user. It may...
[ 0.5985895991325378, 0.2742619216442108, 0.020712601020932198, 0.17299851775169373, 0.14745672047138214, -0.0451945960521698, 0.47162938117980957, 0.006412440910935402, -0.479476660490036, -0.32814857363700867, 0.12292296439409256, 0.14270436763763428, -0.20113429427146912, 0.27853429317474...
In MFC, a CListBox has a "disable no scroll" property. When you set it to true, the vertical scrollbar is always there, no matter how many items you have. How can I do the same thing with CListCtrl? To start the discussion. I like the **[database / transaction deadlock](http://www.codeproject.com/KB/database/Deadlocks...
[ 0.010075300000607967, -0.05585625022649765, 1.0018202066421509, -0.10523118078708649, 0.15178270637989044, -0.2607208788394928, 0.20152506232261658, -0.118753582239151, -0.3492926359176636, -0.4922768175601959, -0.4106280505657196, 0.6369638442993164, -0.5602391362190247, -0.10961403697729...
I've been working a little with DevExpress CodeRush and Refactor! Pro this week, and I picked up a commentor plug-in that will automatically generate comments as you type code. I don't want to go into how good a job it does of picking out basic meaning (pretty good, actually) but it's default implementation does raise...
[ 0.4456311762332916, 0.2175586074590683, 0.33546799421310425, -0.27260148525238037, -0.20530568063259125, 0.035073380917310715, 0.19321228563785553, -0.07853546738624573, -0.06278908252716064, -0.664825975894928, 0.015665940940380096, 0.5536031723022461, -0.29981717467308044, 0.239273443818...
see that there are instances where this behaviour may be of great use, I feel that the resultant code looks very untidy with all the additional commenting. I was wondering what other people;'s take on this kind of comment was. Not just from an academic standpoint, but if I get a good number of negative comments about ...
[ 0.705743670463562, 0.5130670666694641, -0.2589645981788635, -0.04989795759320259, -0.4267788529396057, -0.10632462799549103, 0.6946622133255005, 0.18531286716461182, -0.19924426078796387, -0.2860862612724304, -0.261883407831192, 0.10815338790416718, -0.1205492839217186, 0.35267311334609985...
a block ends because usually those blocks are indented. Edit: If a procedure is so big that is not readily apparent what block of code is being closed by a brace, then there should already be more descriptive comments describing the procedure anyways and these comments would just be clutter.
[ 0.20570063591003418, 0.11998867243528366, 0.13685151934623718, 0.15469828248023987, -0.1606062352657318, -0.14582617580890656, 0.4673486649990082, -0.07787878811359406, -0.3335314691066742, -0.5987430810928345, -0.5537801384925842, -0.21708300709724426, -0.34299710392951965, 0.265271753072...
I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Yes No answer, a choice of 4 options from very...
[ 0.6805713772773743, 0.04866065829992294, 0.27043870091438293, 0.14057376980781555, -0.006840416230261326, 0.16836997866630554, 0.1688869744539261, 0.13695339858531952, -0.12624581158161163, -0.3367190659046173, 0.14549915492534637, 0.5120829343795776, 0.08158011734485626, -0.10838764905929...
probably really basic, but I don't want to get it wrong. I think comments like that are useless, unless of course the code is awful. With proper formatting of code it's not difficult to see where a block starts and where a block ends because usually those blocks are indented. Edit: If a procedure is so big that is not...
[ 0.4520362913608551, 0.20754972100257874, -0.30027836561203003, 0.15282271802425385, -0.11902271211147308, 0.0324750617146492, 0.5885684490203857, 0.05608419328927994, -0.255747526884079, -0.5656090378761292, -0.12257508188486099, 0.20749011635780334, -0.17791025340557098, -0.01867632009088...
I'm having trouble trying to optimize the following query for sql server 2005. Does anyone know how could I improve it. Each one of the tables used there have about 40 million rows each. I've tried my best trying to optimize it but I manage to do the exact opposite. Thanks ``` SELECT cos , SIN FROM ...
[ -0.07984139025211334, 0.41607969999313354, 0.2853855490684509, -0.23695123195648193, -0.12758153676986694, -0.054283257573843, -0.20769992470741272, 0.193516343832016, -0.2863786518573761, -0.6337291598320007, 0.30582770705223083, 0.4772811532020569, -0.3157786428928375, 0.2761135399341583...
SIN FROM ConSisHis2006 union all SELECT cos , SIN FROM ConSisHis2007 UNION ALL SELECT cos , SIN FROM ConSisHis2008 ``` Maybe I should have said something else about the schema, all the tables used here are
[ -0.16200830042362213, 0.22496938705444336, 0.2659609913825989, -0.11972507834434509, 0.09871212393045425, 0.12479159981012344, -0.2792479693889618, -0.031225111335515976, -0.21992234885692596, -0.7666622400283813, 0.07519710063934326, 0.33791959285736084, -0.3836532235145569, 0.18250548839...
historical tables, they are not referenced to any other table. And theres already an index for cos and SIN. I was just wondering if there was any other way to optimize the query... as you can imagine 160millon records are hard to get :s It seems that the query is just combining the separated history tables into a singl...
[ 0.06605208665132523, 0.20353345572948456, 0.4075816869735718, 0.325027197599411, 0.030938562005758286, 0.1786341518163681, -0.32434865832328796, -0.1733160763978958, -0.5089161992073059, -0.5149078369140625, 0.05867128074169159, 0.28732022643089294, 0.009620986878871918, 0.6235131621360779...
I have a program that can have a lot of parameters (we have over +30 differents options). Example: `myProgram.exe -t alpha 1 -prod 1 2 -sleep 200` This is 3 Commands (from command pattern object at the end) that each contain some parameters. Inside the code we parse all command (start with -) and get a list of string...
[ 0.5230467915534973, -0.023237230256199837, 0.2420479953289032, -0.01429039891809225, 0.04339475557208061, 0.11045849323272705, 0.2190750539302826, -0.3951970338821411, -0.19284914433956146, -0.7568681836128235, -0.04297728091478348, 0.5507537126541138, -0.18018284440040588, 0.1151049658656...
is we require to do a lot of IF everytime to get the good command. Do you have some pattern that can be used to extract all parameters from an EXE without using a lot of IF? The code is in C# but I think the logic can be any other language too... Create a hash table which stores function pointers (in C# that'd be del...
[ 0.280087947845459, -0.06251191347837448, -0.01820099540054798, 0.20803168416023254, 0.17394670844078064, -0.23369401693344116, -0.17966505885124207, -0.27049335837364197, 0.13116540014743805, -0.3954711854457855, -0.019590800628066063, 0.7371167540550232, -0.20929323136806488, -0.137298464...
I have the following problem: I open the dialog, open the SIP keyboard to fill the form and then minimize the SIP. Then when I close the current dialog and return to the main dialog the SIP keyboard appears again. Does anyone know how could I show/hide SIP keyboard programatically or better what could be done to solve...
[ 0.16731567680835724, 0.11661912500858307, 0.7659657001495361, -0.03092062845826149, 0.005578066688030958, -0.1361425369977951, 0.3658581078052521, 0.0548410527408123, -0.19573190808296204, -0.7456777691841125, 0.16650240123271942, 0.6617891788482666, -0.18894261121749878, 0.252956360578537...
the SIP for the window so you can set it once and you know the SIP state will be restored to your set state every time the window is shown. I've never heard of SipShowIM but I did see on the MSDN page linked: > The standard method of showing and > hiding the SIP (SIPShowIM) exhibits > some problems in MFC dialogs.
[ 0.18307282030582428, -0.22693224251270294, 0.607330322265625, 0.11523351073265076, 0.05899050086736679, -0.17039865255355835, 0.3332020044326782, -0.03951166197657585, -0.13072745501995087, -0.6712555885314941, -0.198002889752388, 0.708004891872406, -0.2566746473312378, -0.0383827649056911...
There are two pictureboxes with two different images. If I click on one picture box, the image in it should be cleared. To make the matters worse, both of the picture boxes have only one common event handler. How can I know which picturebox generated the event? I would appreciate source code in C++-CLI I need to kno...
[ 0.2899131178855896, -0.26285821199417114, 0.20102305710315704, 0.13884225487709045, -0.20966602861881256, 0.11359743773937225, -0.06347797811031342, -0.12056569010019302, -0.30301541090011597, -0.550470232963562, 0.2757073640823364, 0.45490938425064087, -0.45197755098342896, 0.033159364014...
this I would use: ``` PictureBox ^pb = safe_cast<PictureBox^>(sender); if(pb != null) { // logic goes here } ``` (Note that I've corrected the above code after Josh pointed out my reference flaw. Thanks!) the dynamic cast will give you the right object type if it can cast, or null if it cant (it's the equiv. of...
[ 0.3689957857131958, -0.1765211671590805, 0.1284628063440323, -0.023609332740306854, -0.11510993540287018, -0.03446369990706444, 0.5572752952575684, -0.18274007737636566, -0.12011539936065674, -0.3127197027206421, -0.2278532087802887, 0.5718610882759094, -0.4219173789024353, -0.005137492902...
I'm working on a webservice + AJAX interface, and I'm worried about authentication. This moment I'm passing username and password to the webservice as arguments, but I fear that this approach is highly insecure. I was told that ssl could solve my problem, but I want more alternatives. My webservice is written in php a...
[ 0.09092608094215393, 0.28583821654319763, 0.5210169553756714, 0.017433229833841324, -0.5244240164756775, -0.1602119654417038, 0.15536850690841675, 0.11622656136751175, 0.05970551818609238, -0.811959445476532, -0.07829651236534119, 0.5961043238639832, -0.06047471612691879, 0.025887850672006...
log-in. When they log-in store a cookie at the browser. This cookie can then be sent back with every AJAX request. Your PHP script can "authenticate" the AJAX request using the cookie exactly as it would with normal requests.
[ 0.04537001997232437, -0.07121184468269348, 0.18759572505950928, 0.18521298468112946, -0.05378473922610283, -0.3071577847003937, 0.4044448733329773, 0.306026428937912, -0.10321782529354095, -1.0383692979812622, -0.13674210011959076, 0.26677176356315613, -0.004718391224741936, 0.053054254502...
Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.? It is generally a bad pattern to kill a thread abruptly, in Python, and in any language. Think of the following cases: * the thread is holding a critical resource that must be closed properly * the thread has created sever...
[ 0.2745820879936218, -0.09317709505558014, -0.017692245543003082, -0.042225077748298645, 0.2210683375597, -0.4559817910194397, 0.41244107484817505, 0.2556878328323364, -0.4985159635543823, -0.317857950925827, -0.24634844064712524, 0.3072880208492279, -0.3793293237686157, 0.23824428021907806...
threading class StoppableThread(threading.Thread): """Thread class with a stop() method. The thread itself has to check regularly for the stopped() condition.""" def __init__(self, *args, **kwargs): super(StoppableThread, self).__init__(*args, **kwargs) self._stop_event = threading.Event(...
[ -0.03715323284268379, -0.2547927498817444, 0.4329873323440552, -0.2416968196630478, 0.21332432329654694, -0.10877572745084763, 0.2983384430408478, 0.24431945383548737, -0.5324209332466125, -0.21711741387844086, -0.4450942575931549, 0.4715815782546997, -0.44674375653266907, 0.22062715888023...
to exit properly using `join()`. The thread should check the stop flag at regular intervals. There are cases, however, when you really need to kill a thread. An example is when you are wrapping an external library that is busy for long calls, and you want to interrupt it. The following code allows (with some restrict...
[ 0.30091947317123413, -0.19049189984798431, 0.2530432641506195, -0.30348944664001465, 0.14293906092643738, -0.3081658184528351, 0.4315274953842163, -0.11786192655563354, -0.41504472494125366, -0.4370463192462921, -0.12974147498607635, 0.2766002416610718, -0.5497387051582336, 0.2484437823295...
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exctype)) if res == 0: raise ValueError("invalid thread id") elif res != 1: # "if it returns a number greater than one, you're in trouble,
[ 0.24900402128696442, -0.25489774346351624, 0.3835386335849762, -0.07305777817964554, 0.19549842178821564, 0.02507072500884533, 0.6352899074554443, -0.6114558577537537, -0.4187546968460083, -0.2797849774360657, -0.0553131029009819, 0.563162624835968, -0.31369414925575256, 0.267620325088501,...
# and you should call it again with exc=NULL to revert the effect" ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), None) raise SystemError("PyThreadState_SetAsyncExc failed") class ThreadWithExc(threading.Thread): '''A thread class that supports raising an exception in the thread fro...
[ 0.05192628875374794, -0.12981201708316803, 0.3812226355075836, -0.2419644594192505, 0.054773636162281036, -0.03607102110981941, 0.45894160866737366, -0.26837262511253357, -0.5692105293273926, -0.21681518852710724, -0.1578068882226944, 0.5618563890457153, -0.34290507435798645, 0.12328469753...
the caller thread, to get the identity of the thread represented by this instance. """ if not self.isAlive(): raise threading.ThreadError("the thread is not active") # do we have it cached? if hasattr(self, "_thread_id"): return self._thread_id
[ 0.09990404546260834, 0.02020381949841976, 0.5414085984230042, -0.0594506710767746, 0.23346389830112457, -0.017061203718185425, 0.3770940899848938, -0.09150811284780502, -0.1938123106956482, -0.44040700793266296, 0.0688757374882698, 0.6823441982269287, -0.2219875156879425, 0.168626010417938...
# no, look for it in the _active dict for tid, tobj in threading._active.items(): if tobj is self: self._thread_id = tid return tid # TODO: in python 2.6, there's a simpler way to do: self.ident
[ 0.08320232480764389, -0.05232378840446472, 0.2985115945339203, -0.3111240565776825, -0.03795477747917175, -0.02306409366428852, 0.20475813746452332, -0.03958199545741081, -0.33450061082839966, -0.5079275369644165, 0.022457409650087357, 0.38780590891838074, -0.24639324843883514, -0.11557542...
raise AssertionError("could not determine the thread's id") def raiseExc(self, exctype): """Raises the given exception type in the context of this thread. If the thread is busy in a system call (time.sleep(), socket.accept(), ...), the exception is simply ignored. If you are sure ...
[ 0.49046117067337036, 0.2885681092739105, 0.46984168887138367, -0.08666134625673294, -0.07607711106538773, -0.2661740779876709, 0.2632499039173126, -0.3196089267730713, -0.24679654836654663, -0.2087993621826172, -0.03650375455617905, 0.6068564057350159, -0.2042434960603714, 0.14272619783878...
t = ThreadWithExc( ... ) ... t.raiseExc( SomeException ) while t.isAlive(): time.sleep( 0.1 ) t.raiseExc( SomeException ) If the exception is
[ 0.5056808590888977, -0.5681033730506897, 0.4942535161972046, -0.4525470733642578, 0.15660057961940765, -0.10362353920936584, 0.30135443806648254, -0.1516038328409195, -0.3354576826095581, -0.2117423564195633, 0.0773489773273468, 0.3143710792064667, -0.10709475725889206, 0.25894495844841003...
to be caught by the thread, you need a way to check that your thread has caught it. CAREFUL: this function is executed in the context of the caller thread, to raise an exception in the context of the thread represented by this instance. """ _async_raise( self._get_my_tid...
[ 0.5560537576675415, -0.13435311615467072, 0.04903598874807358, -0.002856756094843149, 0.084816575050354, -0.122017502784729, 0.23177242279052734, -0.05457727983593941, -0.5323747396469116, -0.19469892978668213, 0.03436674550175667, 0.13324764370918274, -0.6835677027702332, 0.04897353798151...
the return value of `PyThreadState_SetAsyncExc` appears to be from an [old version of Python](https://svn.python.org/projects/stackless/Python-2.4.3/dev/Python/pystate.c).) As noted in the documentation, this is not a magic bullet because if the thread is busy outside the Python interpreter, it will not catch the inte...
[ 0.1788311004638672, -0.16336748003959656, 0.25018343329429626, -0.033122140914201736, 0.14386701583862305, -0.1468847692012787, 0.23995372653007507, 0.017429625615477562, -0.4235242009162903, -0.35314154624938965, -0.23553059995174408, 0.3182719349861145, -0.3858540952205658, 0.06875706464...