text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
.Where(x => x.HasPicture == true) .ToArray(); watch.Stop(); ``` Time elapsed to execute query for HasPicture == true 975 Total number of products found: 412352 ``` watch = Stopwatch.StartNew(); result = s.Advanced.LuceneQuery<Product>("Products_Index") .Statistics(out stats) .Whe...
[ 0.03346148878335953, 0.031460829079151154, 0.6505984663963318, -0.058869559317827225, 0.16094806790351868, 0.5810852646827698, 0.06724391877651215, -0.08201278746128082, -0.3231457769870758, -0.39261409640312195, -0.15910187363624573, 0.5405891537666321, 0.03613687679171562, 0.160886973142...
products found: 412352 At first, you cannot upload files asynchronously, unless you are using HTML5. If you still need this feature, you might want to try [jQuery Form plugin](http://malsup.com/jquery/form/). At second, in your current js you are not sending any data with your request (field `data` in `ajax` method op...
[ 0.21635377407073975, 0.028222762048244476, 0.28769761323928833, 0.16425493359565735, -0.12617835402488708, -0.2579508423805237, -0.002029981231316924, -0.17888243496418, -0.2972329556941986, -0.6558275818824768, -0.33056941628456116, 0.4886121451854706, -0.13400326669216156, 0.163889899849...
method="post"> <div> <input type="file" name="file" id="file" /> <input type="submit" value="Upload" id="UploadList" /> </div> </form> ``` No js here, server code is the same.
[ 0.03192930668592453, -0.10027840733528137, 0.2407061755657196, -0.049986906349658966, -0.42324599623680115, -0.1151595264673233, 0.19227005541324615, -0.30098575353622437, -0.003019485855475068, -0.6163720488548279, -0.15433578193187714, 0.178910031914711, -0.3196863830089569, 0.2475553005...
I'm using c# and creating an auto downloader/updater, that checks to see if the application is there, or if the application needs an update. If the new version of the app needs to be downloaded it downloads it and puts it in the LocalAppData/MyApplication Directory. When I try executing the application I get the error...
[ 0.4145543575286865, 0.36465612053871155, 0.6164270043373108, -0.1131422370672226, 0.24190576374530792, -0.12233402580022812, 0.28422072529792786, 0.24585723876953125, -0.39013028144836426, -0.7216975688934326, -0.28048115968704224, 0.9296929240226746, -0.3897554576396942, 0.139995947480201...
soon as the updater runs..I get that error. I'm using C# and using the WebClient to download the files, and then using WshShellClass to create shortcuts for the application. Any insight would be great. If it would help for me to post the code that I'm using to download the items I can do that too. At first, you canno...
[ 0.4428020715713501, -0.06951147317886353, 0.5243533253669739, 0.1953209787607193, -0.13033409416675568, -0.43812525272369385, 0.1276199072599411, 0.1686924546957016, -0.21092677116394043, -0.9399049282073975, -0.1826661080121994, 0.7095236778259277, -0.20087580382823944, 0.2445162683725357...
that is why you are not receiving anything at server side. Moreover it is impossible to insert a file in this request as I have mentioned before. The most simple solution for you here is to give up with AJAX and let the file be uploaded in usual way: View: ``` <form action="/Admin/Mail/Upload" enctype="multipart/form...
[ 0.08784433454275131, -0.06641893833875656, 0.3173544108867645, 0.22131286561489105, -0.29255759716033936, -0.2687967121601105, 0.18118196725845337, 0.018873387947678566, -0.08360783010721207, -1.0343061685562134, -0.14295217394828796, 0.550407886505127, -0.26321181654930115, 0.094318978488...
js here, server code is the same.
[ 0.24251797795295715, 0.17477205395698547, 0.0034355681855231524, -0.07633376866579056, -0.25127166509628296, -0.1532907783985138, 0.06741578131914139, 0.5907765626907349, -0.24273449182510376, -0.5054622888565063, -0.17750036716461182, 0.26118963956832886, -0.17559489607810974, 0.101463079...
As I read in a lot of articles, when I use JPA/Hibernate query it is good to set parameters in my queries so SQL injection is avoided. Like: ``` select user from User user where user.name = :name and user.surname = :surname ``` My problem is that in some cases I need to use native query when I create my query. I ...
[ -0.19620360434055328, 0.12377700954675674, 0.18641652166843414, 0.13096654415130615, -0.4013136625289917, 0.034880317747592926, 0.09397943317890167, -0.16215506196022034, -0.030764145776629448, -0.6943195462226868, 0.012013504281640053, 0.44434893131256104, -0.2858460545539856, 0.253328174...
this case "sql injection proof" like when in the parameterized query? if you do not use string operations for building your query like ``` "SELECT foo FROM bar Where id="+myParameter+" more sql ..." ``` , then you will not have any vulnerabilities.
[ -0.06812363117933273, 0.035778291523456573, 0.015617378056049347, 0.10016517341136932, 0.05102631822228432, -0.28531768918037415, 0.5975584387779236, -0.15769730508327484, -0.11377227306365967, -0.41028326749801636, -0.1801200956106186, 0.7102310657501221, -0.34160757064819336, 0.267970770...
Suppose I have a view in which some of the column names are aliases, like "surName" in this example: ``` CREATE VIEW myView AS SELECT firstName, middleName, you.lastName surName FROM myTable me LEFT OUTER JOIN yourTable you
[ -0.07588480412960052, -0.07187919318675995, 0.4625386595726013, -0.08567948639392853, 0.09822066873311996, 0.060336750000715256, -0.2325938642024994, 0.10704515874385834, 0.11454298347234726, -0.769768238067627, 0.06459222733974457, 0.3173711597919464, 0.029979269951581955, 0.5432878732681...
ON me.code = you.code GO ``` I'm able to retrieve some information about the view using the INFORMATION\_SCHEMA views. For example, the query ``` SELECT column_name AS ALIAS, data_type AS TYPE FROM information_schema.columns WHERE table_name = 'myView' ``` yields: ``` ---------------- |ALIAS |TYPE | --...
[ -0.2632061243057251, 0.35782960057258606, 0.7916775941848755, 0.08926689624786377, -0.11204871535301208, 0.09260550886392593, 0.0495980940759182, 0.15095269680023193, -0.08057650923728943, -0.8134617209434509, -0.0583750382065773, 0.6566037535667419, -0.08699101209640503, 0.369394779205322...
be some way to use the sys tables and/or INFORMATION\_SCHEMA views to retrieve this information. --- **EDIT:** I can get close with this abomination, which is similar to Arion's answer: ``` SELECT c.name AS ALIAS, ISNULL(type_name(c.system_type_id), t.name) AS DATA_TYPE, tablecols.name AS REALNAME FROM ...
[ -0.011495769023895264, 0.04271502047777176, 0.6233435869216919, 0.1318640112876892, 0.04413206875324249, 0.07945090532302856, -0.10911992192268372, -0.19138745963573456, -0.2504452168941498, -0.48832014203071594, 0.07652689516544342, 0.5566925406455994, -0.324383020401001, 0.27325767278671...
tablecols ON d.referenced_major_id = tablecols.object_id AND tablecols.column_id = d.referenced_minor_id AND tablecols.column_id = c.column_id WHERE v.name ='myView' ``` This yields: ``` --------------------------- |ALIAS |TYPE |REALNAME | --------------------------- |firstName |nchar|first...
[ -0.4717399775981903, 0.09524816274642944, 0.9811078310012817, 0.08111534267663956, 0.10541852563619614, -0.042477235198020935, -0.1467619240283966, -0.2165476679801941, -0.20783422887325287, -0.5885317325592041, -0.37701964378356934, 0.5041831135749817, -0.2091132253408432, 0.2419946789741...
Books.title AS Name FROM Books ``` What I can see you can get the columns used and the tables used by doing this: ``` SELECT * FROM INFORMATION_SCHEMA.VIEW_COLUMN_USAGE AS UsedColumns WHERE UsedColumns.VIEW_NAME='viewTest' SELECT * FROM INFORMATION_SCHEMA.VIEW_TABLE_USAGE AS UsedTables WHERE UsedTables.VIEW...
[ -0.01815924234688282, 0.35920825600624084, 0.78252112865448, 0.06812063604593277, -0.09987296909093857, -0.07703011482954025, -0.10539788752794266, -0.3579421043395996, -0.3011625111103058, -0.49759408831596375, -0.23695054650306702, 0.4152750074863434, -0.37285465002059937, 0.144800558686...
ON c.object_id = d.referenced_major_id JOIN sys.types AS columnTypes ON c.user_type_id=columnTypes.user_type_id AND c.column_id = d.referenced_minor_id JOIN sys.columns AS aliases on c.column_id=aliases.column_id AND aliases.object_id = object_id('viewTest') WHERE v.name = 'viewTest'; ``` It ret...
[ -0.23773081600666046, 0.2377481609582901, 0.6833028197288513, -0.13959984481334686, -0.11255937069654465, 0.03803657740354538, 0.11235401034355164, -0.3695569336414337, -0.04893043264746666, -0.4468897581100464, -0.11774928867816925, 0.6236915588378906, -0.2270929217338562, 0.3101779818534...
I need upstart event names for the following two events. 1. The networking is up and running 2. When the system is about to shut down What you are describing is known as the "arcsine" function. It's available in Java as [Math.asin()](http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#asin%28double%29). You...
[ 0.19873128831386566, -0.008261218667030334, 0.34862208366394043, 0.21879172325134277, -0.10878872871398926, -0.010905539616942406, -0.0019700638949871063, 0.013995968736708164, 0.009493669494986534, -0.48375582695007324, 0.10997370630502701, 0.6583355069160461, -0.29465770721435547, -0.171...
What is wrong with this code? ``` NSString *strTest = @"Sun Apr 12 23:29:24 +0000 2009"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MM/dd/yy"]; NSDate *createdAtFormatted = [dateFormatter dateFromString:strTest]; self.createdAt.text = [dateFormat...
[ 0.09551607072353363, 0.22416767477989197, 0.8511366844177246, -0.0857706144452095, -0.05763613432645798, -0.16562378406524658, 0.523919403553009, -0.14509092271327972, -0.12753000855445862, -0.7609125971794128, -0.16380269825458527, 0.3028106391429901, -0.1000431627035141, 0.36701545119285...
recognizes english names for months and days [dateFormatter setLocale:loc]; [loc release]; // remove if using ARC [dateFormatter setDateFormat:@"EEE MMM d HH:mm:ss ZZZZ yyyy"]; NSDate *createdAtFormatted = [dateFormatter dateFromString:strTest]; NSLog(@"got %@", createdAtFormatted); ``` The formatter specifiers can b...
[ 0.12326087057590485, 0.20847320556640625, 0.4953426718711853, 0.03435123339295387, -0.09982802718877792, 0.027372099459171295, 0.06306274980306625, -0.11856537312269211, -0.2062593698501587, -0.36851826310157776, -0.5137596726417542, -0.2797032296657562, 0.2769964337348938, 0.4262605011463...
I've run into another problem in Qt, I can't seem to figure out how to write on a specific line on a text file with `QFile`. Instead, everything is erased written at the beginning. So with the given information, how would I write to a specific line in `QFile`? Here are two functions. 1. The first function searches a...
[ 0.21500471234321594, -0.19280190765857697, 0.18869446218013763, 0.1351345330476761, 0.10316760092973709, 0.04615923762321472, 0.07788940519094467, -0.0844055786728859, 0.09485593438148499, -0.6638616323471069, 0.19231784343719482, 0.4692074656486511, -0.27925905585289, 0.257413774728775, ...
no avail. Function 1 --- ``` QString fileName = "C:\\Users\\Gabe\\SeniorProj\\Students.txt"; QFile mFile(fileName); QTextStream stream(&mFile); QString line; int x = 1; //this counts how many lines there are inside the text file QString currentID; if(!mFile.open(QFile::ReadOnly | QFile:...
[ 0.08809752017259598, -0.22694697976112366, 0.7182157635688782, -0.1488918960094452, 0.42513832449913025, 0.22370873391628265, 0.5487757921218872, 0.030149759724736214, 0.17691457271575928, -0.5763810873031616, -0.38361120223999023, 0.6380444169044495, -0.2647324204444885, 0.396767616271972...
QStringList parts = line.split(";", QString::KeepEmptyParts); if (parts.length() == 3) { QString id = parts[0]; QString firstName = parts[1]; QString lastName = parts[2]; x++; //this counts how many lines there are inside the text file
[ -0.27885305881500244, -0.5102240443229675, 0.8005220890045166, -0.3243820369243622, 0.002385187428444624, 0.2810301184654236, 0.25555285811424255, -0.3246336579322815, -0.11526256799697876, -0.4538719356060028, -0.36862075328826904, 0.20977924764156342, -0.14743246138095856, 0.117312416434...
currentID = parts[0];//current ID number } }while (!line.isNull()); mFile.flush(); mFile.close(); Write(x, currentID); //calls function to operate on file } ``` The function above reads the file, which looks like this. ``` 1001;James;Bark 1002;Jeremy;Parker 1003;Seinfeld;Parker 1004;Sigfri...
[ -0.501914918422699, -0.11447864025831223, 0.516814649105072, -0.23938380181789398, 0.25956428050994873, 0.33089450001716614, 0.2527249753475189, -0.38164225220680237, -0.16328829526901245, -0.4752630293369293, -0.2752244472503662, 0.22144795954227448, -0.6683149933815002, 0.311453342437744...
of the search. ``` So I passed in those variables to the next function, at the end of function 1. `Write(x, currentID);` Function 2 --- ``` void StudentAddClass::Write(int currentLine, QString idNum){ QString fileName = "C:\\Users\\Gabe\\SeniorProj\\Students.txt"; QFile mFile(fileName); QTextStream st...
[ -0.46072444319725037, -0.006604011170566082, 0.8650369644165039, -0.2588810622692108, 0.4649726450443268, -0.10691950470209122, 0.42887312173843384, 0.05253922566771507, 0.015737490728497505, -0.39817777276039124, -0.47423839569091797, 0.5276910662651062, -0.3773749768733978, 0.35817116498...
all this function does is replace all the contents of the text file with "HelloWorld". Does anyone know how to write on a specific line, or at least go to the end of the file and then write? If the line you want to insert into the file is always the last line (as the function 1 suggest) you can try to open the file i...
[ -0.05930407717823982, -0.23026421666145325, 0.4925292730331421, -0.05219688639044762, 0.041054774075746536, -0.15395846962928772, 0.4438188672065735, 0.5491190552711487, 0.12047815322875977, -0.6190735101699829, -0.04096298664808273, 0.4108896255493164, -0.39250850677490234, 0.182740852236...
possible, to load the lines into a QList, insert the line and write the list back to the file)
[ 0.3434920310974121, -0.45454496145248413, 0.17509588599205017, 0.12401169538497925, 0.21031323075294495, 0.3755810260772705, 0.3658647835254669, -0.12163721770048141, -0.03228610381484032, -0.6439287662506104, -0.18529953062534332, 0.44307735562324524, -0.46594706177711487, -0.170306503772...
I have a page where users can select different documents files in a datalist control. The documents are categorized based on categories using the on pre-render event handler. Documents are selected based on Checkbox controls (not Checkboxlist). So far so good. What I want to happen next is to put a 'Select All' checkbo...
[ 0.10187797248363495, -0.027841035276651382, 0.867602527141571, 0.016856824979186058, -0.0853116512298584, -0.0662519633769989, -0.06377439945936203, -0.3883902430534363, -0.1361415982246399, -0.8062586188316345, -0.11015133559703827, 0.2909257113933563, -0.05547788739204407, 0.273086875677...
<td> <asp:Label ID="lblHeader" runat="server" Font-Bold="True" Font-Underline="True"></asp:Label> <asp:Label runat="server" id="lbl_cb_all" visible="false">Select All <input runat="server" id="cb_selectall" type="checkbox" value='<%# Eval("catid") %>' /> </asp:Label> </td> ...
[ -0.17288129031658173, 0.019173556938767433, 0.48398035764694214, -0.24619315564632416, -0.16184446215629578, 0.3138682544231415, 0.061710160225629807, -0.7355706095695496, -0.30807143449783325, -0.36399927735328674, -0.3512657880783081, 0.26338323950767517, -0.431761771440506, -0.002868785...
<asp:Label ID="lbl_categoryname" runat="server" Text='<%# Eval("categoryname") %>' Visible="false" /> <!-- Hide this; only used in Code Behind --> <input runat="server" id="cb_docid" type="checkbox" value='<%# Eval("docid") %>' /> <asp:Hyperlink ID="hpl_docfileencr" Text='<%# Eval("do...
[ -0.5845330357551575, 0.15583737194538116, 0.6499238610267639, -0.10134776681661606, -0.2824781537055969, 0.31714776158332825, 0.25931522250175476, -0.5021682977676392, -0.43301311135292053, -0.6170915365219116, -0.25363245606422424, 0.28531038761138916, -0.2878003716468811, 0.0564239956438...
</td> </tr> </table> </ItemTemplate> ``` and here is the OnPreRender code: ``` protected void DataList1_PreRender(object sender, EventArgs e) { string strTempLabelCategory = ""; foreach (DataListItem item in DataList1.Items) { Label lbl_categoryname = item.FindControl("lbl_categoryna...
[ -0.2297859936952591, -0.10670097172260284, 0.5914820432662964, -0.23791758716106415, -0.19234587252140045, 0.25643205642700195, 0.3036164343357086, -0.5062023997306824, -0.23982888460159302, -0.26194122433662415, -0.6815158128738403, 0.7432615756988525, -0.29135337471961975, 0.419970333576...
Label lblHeader = item.FindControl("lblHeader") as Label; lblHeader.Text = strTempLabelCategory.ToUpper(); Label lbltempdiv = item.FindControl("lbl_cb_all") as Label; lbltempdiv.Visible = true; } } } ``` I have looked for something which can work within my code but no ...
[ 0.0708552822470665, 0.01947644166648388, 0.248464897274971, -0.2858130931854248, 0.07511085271835327, -0.03012232482433319, 0.29837656021118164, -0.2732428014278412, -0.08672010153532028, -0.6628698110580444, -0.19383352994918823, 0.5626877546310425, -0.5421761870384216, 0.0955666899681091...
would help anyway). Any ideas? I thought I could use: <http://www.dotnetcurry.com/ShowArticle.aspx?ID=77> code but not sure how I can make that work? If I can somehow make the select all checkbox tie to a tag and then look for all tag then may be the link's code would help. Thanks! 1. Use HiddenFields to store `CatID` ...
[ 0.21423737704753876, -0.5295906066894531, 0.48660945892333984, 0.020565364509820938, -0.14259503781795502, -0.10945168137550354, 0.4796001613140106, -0.3472774028778076, -0.22462651133537292, -0.7191280126571655, -0.04064283147454262, 0.5476500988006592, -0.48887893557548523, -0.1255751699...
DataList1.Items.Cast<DataListItem>() .Where(li => ((HiddenField)li.FindControl("HiddenCatID")).Value == HiddenCatID.Value) .Select(li => li.FindControl("cb_docid")); foreach (CheckBox docCheckBox in catCheckBoxes) { docCheckBox.Checked = checkAll.Checked; } } ``` on aspx: ``` <asp...
[ -0.16310931742191315, -0.22039780020713806, 0.594864010810852, -0.1962028592824936, 0.17967525124549866, -0.005647857207804918, 0.24095934629440308, -0.6829889416694641, -0.2936606705188751, -0.4366762340068817, -0.21923509240150452, 0.44005072116851807, -0.3613760471343994, -0.20970793068...
aspx(note f.e. `<tr runat="server" id="tr_category">)`: ``` <ItemTemplate> <table cellpadding="0" cellspacing="0" id="tbl_data"> <tr runat="server" id="tr_category"> <td> <asp:Label ID="lblHeader" runat="server" Font-Bold="True" Text='<%# Eval("categoryname") %>' Font-Underline...
[ -0.42999887466430664, -0.0590788759291172, 0.7760459184646606, -0.24462036788463593, -0.13752450048923492, 0.30879083275794983, -0.04369235038757324, -0.4124923646450043, -0.5300182700157166, -0.4515778422355652, -0.31574851274490356, 0.2689996659755707, -0.3031245768070221, -0.24089191854...
</asp:Label> </td> </tr> <tr runat="server" id="tr_data"> <td> <asp:HiddenField ID="HiddenCatID" runat="server" Value='<%# Eval("CatID") %>' /> <asp:CheckBox runat="server" id="cb_docid" />
[ -0.304889053106308, -0.2146083116531372, 0.24857638776302338, -0.21959714591503143, 0.11159969866275787, 0.38634276390075684, -0.018937692046165466, -0.44191354513168335, -0.35888248682022095, -0.27188509702682495, -0.26961201429367065, 0.2897375524044037, -0.35998186469078064, 0.074985496...
<asp:HyperLink ID="hpl_docfileencr" Text='<%# Eval("docfileencr") %>' NavigateUrl='<%# "~/PDFEncr/" + DataBinder.Eval(Container.DataItem, "docfileencr") %>' Target="_blank" runat="server" /> <br /> </td> </tr> </table> </ItemTemplate> ``` 1. Ensure that the ...
[ -0.40748393535614014, -0.11533312499523163, 0.7483721971511841, -0.029224203899502754, -0.1907823383808136, 0.15281957387924194, 0.03682412952184677, -0.4976450502872467, -0.4658360183238983, -0.7882175445556641, -0.49094218015670776, 0.3960323929786682, -0.32024672627449036, -0.2002621442...
will not be maintained: ``` protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) BindDataList(); } ``` 2. I'm using `ItemDataBound` instead of `PreRender` which is important for the ViewState to be reloaded correctly. I've also simplified all: ``` protected void DataList1_ItemDataBound(Object ...
[ -0.16560856997966766, -0.3066102862358093, 0.9440149664878845, -0.2454233020544052, 0.05848170071840286, 0.08889411389827728, 0.494802325963974, -0.36427828669548035, -0.24222305417060852, -0.5138980150222778, -0.4509155750274658, 0.5988461971282959, -0.43781542778015137, 0.215157687664031...
var tr_category = (System.Web.UI.HtmlControls.HtmlTableRow)e.Item.FindControl("tr_category"); var sameCategory = lastRow != null && (int)row["catid"] == (int)lastRow["catid"]; tr_category.Visible = !sameCategory; } } ``` 3. The `CheckAllChanged` remains unchanged. This works as expected even if yo...
[ -0.4873119294643402, -0.2872375249862671, 0.8505474925041199, -0.10206834971904755, -0.1484988033771515, 0.010334772989153862, 0.241353377699852, -0.35716739296913147, -0.4211370050907135, -0.4193321466445923, -0.4079006016254425, 0.5835209488868713, -0.32412388920783997, 0.016403244808316...
Ryan Davis’s [Ruby QuickRef](http://www.zenspider.com/ruby/quickref.html#general-tips) says (without explanation): > Don’t rescue Exception. EVER. or I will stab you. Why not? What’s the right thing to do? **TL;DR**: Use `StandardError` instead for general exception catching. When the original exception is re-raised ...
[ -0.027606600895524025, 0.007932623848319054, -0.26677706837654114, -0.051665883511304855, 0.023519527167081833, 0.06250445544719696, 0.6609202027320862, -0.25057095289230347, -0.09427455067634583, -0.13065092265605927, -0.4078335165977478, 0.37148600816726685, -0.5656057000160217, -0.02556...
-9`. Rescuing `SyntaxError` means that `eval`s that fail will do so silently. All of these can be shown by running this program, and trying to `CTRL``C` or `kill` it: ``` loop do begin sleep 1 eval "djsakru3924r9eiuorwju3498 += 5u84fior8u8t4ruyf8ihiure" rescue Exception puts "I refuse to fail or be s...
[ 0.18815433979034424, -0.04261740669608116, 0.5093405842781067, -0.12784700095653534, 0.3212246894836426, -0.31497132778167725, 0.7590641975402832, -0.33344554901123047, -0.3173198103904724, -0.09506943076848984, -0.6951234340667725, 0.5478736758232117, -0.3507428467273712, -0.2054126113653...
it, and can have catastrophic results and make bug-hunting extremely difficult. --- If you have a situation where you do want to rescue from `StandardError` and you need a variable with the exception, you can use this form: ``` begin # iceberg! rescue => e # lifeboats end ``` which is equivalent to: ``` begin...
[ -0.05922715365886688, -0.01727135479450226, 0.2885165810585022, 0.25392842292785645, 0.14071105420589447, -0.3272399604320526, 0.7775930166244507, -0.1423233151435852, -0.38544562458992004, -0.24550415575504303, -0.4232451021671295, 0.3229431211948395, -0.5344478487968445, 0.01234734989702...
I have a page in my web flow where I want to upload a file without refreshing the page. I tried using an Ajax call for that, but failed. I couldn't figure out how to send the data in the uploaded file to the server side/back end for further processing. I'm using the Spring MVC framework and I don't want to use PHP. Ca...
[ 0.5310330390930176, 0.15764589607715607, 0.15051284432411194, -0.01532948948442936, -0.19445107877254486, -0.11555802822113037, 0.39112389087677, 0.08828479796648026, -0.2658363878726959, -0.7604305148124695, 0.23882241547107697, 0.5047521591186523, -0.05148555710911751, -0.024287968873977...
server side to process uploaded file and return to same page with a string from server side.all this happen without refreshing the current page Any suggestion would be highly appreciated. Assuming you've already gotten your form built and server-side controller set up to handle the upload, this little snippet should g...
[ 0.2766091227531433, -0.04230036213994026, 0.929609477519989, 0.06956586241722107, -0.3755009174346924, -0.2696573734283447, 0.3511475622653961, -0.3119153678417206, -0.1819881647825241, -0.8167828321456909, -0.33947351574897766, 0.4551982283592224, -0.17321355640888214, 0.08758272230625153...
My `EAX` register contains the `xxxxxx9D` value and I have the following assembly code: ``` C0C8 14 --> ROR AL,14 ``` To me, it means that the last 8 bits of the `EAX`'s 32 bits value are rotated bitwise by 14 mod 8 = 6 positions ``` 0x9D = b1001 1101 ``` will be transformed into ``` b0111 0110 = 0x76 ``` Howe...
[ 0.3551967442035675, 0.6739094257354736, 0.3542787432670593, -0.35622936487197876, -0.17327773571014404, 0.3234453499317169, 0.2052374631166458, -0.2922458052635193, -0.291483998298645, -0.24035336077213287, 0.06853450834751129, 0.46853968501091003, -0.20437227189540863, 0.1025283932685852,...
by 1. Etcetera. The processor will thus rotate by 20 mod 8 = 4 positions.
[ 0.176680788397789, 0.14978431165218353, 0.8747846484184265, -0.30795782804489136, -0.009101982228457928, 0.27552250027656555, 0.12833693623542786, -0.35944873094558716, -0.437252402305603, -0.2423587590456009, 0.011123626492917538, 0.30220767855644226, -0.018063679337501526, 0.347227126359...
I've been working through in [Structure and Interpretation of Computer Programs](http://mitpress.mit.edu/sicp/) and completing the exercises in Haskell. The first two chapters were fine (code at [github](https://github.com/chris-taylor/SICP-in-Haskell)) but Chapter 3 is making me think harder. It starts by talking abo...
[ 0.21177272498607635, 0.09135270118713379, 0.32441481947898865, -0.39970120787620544, -0.005902454722672701, 0.41309624910354614, 0.07924342155456543, -0.5650007128715515, -0.0561833418905735, -0.484170138835907, 0.15142042934894562, 0.487332820892334, -0.04764274135231972, -0.0666864812374...
balance) "Insufficient funds"))) ``` so that you can execute the following code: ``` (define w1 (make-withdraw 100)) (define w2 (make-withdraw 100)) (w1 50) 50 (w2 70) 30 (w2 40) "Insufficient funds" (w1 40) 10 ``` I'm not sure how I can emulate this in Haskell. I first thought to a some simple fun...
[ 0.058744512498378754, -0.15944841504096985, 0.5897439122200012, -0.2311987578868866, 0.3121071755886078, 0.15947838127613068, 0.1070868968963623, -0.45196810364723206, -0.2344571053981781, -0.18537303805351257, -0.01953285187482834, 0.6002628207206726, -0.3147891163825989, 0.03280872106552...
- amount) else (Left "Insufficient funds", balance) ``` which allows me to run the code ``` ghci> runState (do { withdraw 50; withdraw 40 }) 100 (Left "Insufficient funds",30.0) ``` but that does something different to the scheme code. Ideally I'd be able to run something like ``` do w1 <- makeWithdraw ...
[ 0.31022515892982483, -0.18177713453769684, 0.5090897679328918, -0.2958798408508301, 0.3435201644897461, 0.12354573607444763, 0.15981480479240417, -0.6311814188957214, 0.09342994540929794, -0.33846744894981384, 0.12502744793891907, 0.6186633110046387, 0.012872772291302681, -0.04971115291118...
using two bits of state: one is the (implicit) association between variables `w1` and `w2` and a ref-cell; the other is the (explicit) state stored in a ref-cell. There's a couple different ways to model this in Haskell. For example, we might pull a similar ref-cell trick with `ST`: ``` makeWithdraw :: Float -> ST s (...
[ 0.31455710530281067, -0.1717369556427002, 0.07144521176815033, -0.08774783462285995, -0.13408128917217255, 0.3322000801563263, 0.19122590124607086, -0.6284326314926147, 0.00013064943777862936, -0.5113487243652344, 0.16025270521640778, 0.29271215200424194, -0.3404284119606018, 0.26123920083...
balance - amount if balance' < 0 then return (Left "insufficient funds") else writeSTRef refBalance balance' >> return (Right balance') ``` Which lets us do this: ``` *Main> :{ *Main| runST $ do *Main| w1 <- makeWithdraw 100 *Main| w2 <- makeWithdraw 100 *Main| x1 <- w1 50 *Main...
[ -0.008198344148695469, -0.11195562034845352, 0.5983114838600159, -0.05952015891671181, 0.09922290593385696, 0.38272780179977417, -0.23954036831855774, -0.5278646945953369, -0.308412104845047, -0.2325710505247116, 0.11759237200021744, 0.4936205744743347, -0.2636943459510803, 0.1482402682304...
"insufficient funds",Right 10.0] ``` Another option is to make both pieces of the state explicit, for example by associating each account with a unique `Int` id. ``` type AccountNumber = Int type Balance = Float data BankState = BankState { nextAccountNumber :: AccountNumber , accountBalance :: Map AccountNu...
[ 0.1591605395078659, 0.05553590506315231, 0.44818127155303955, -0.12544284760951996, 0.3393365442752838, 0.05504012480378151, 0.009697536006569862, -0.5482560396194458, -0.34863612055778503, -0.6117114424705505, 0.03598831221461296, 0.5348703861236572, -0.19867829978466034, 0.03199308365583...
, accountBalance = insert next balance (accountBalance bs) } return next withdraw :: Account -> Balance -> State BankState (Either String Balance) withdraw account amount = do balance <- gets (fromMaybe 0 . lookup account . accountBalance) let balance' = balance - amount if balance' < 0 ...
[ 0.0774381011724472, -0.12165706604719162, 0.5383191704750061, -0.15552471578121185, 0.16345494985580444, 0.22018733620643616, -0.017909619957208633, -0.26951834559440613, -0.31869131326675415, -0.1944185197353363, 0.07470068335533142, 0.4246279001235962, -0.22793689370155334, 0.23936797678...
balance' (accountBalance bs) }) >> return (Right balance') ``` Which would then let us write `makeWithdraw`: ``` makeWithDraw :: Balance -> State BankState (Balance -> State BankState (Either String Balance)) makeWithdraw balance = withdraw <$> newAccount balance ```
[ 0.2390902042388916, -0.12886641919612885, 0.5087582468986511, -0.27463939785957336, 0.36667752265930176, 0.10050018876791, -0.041705578565597534, -0.35531145334243774, -0.25255146622657776, -0.14589765667915344, 0.04607921466231346, 0.29993942379951477, -0.2584039866924286, 0.2523712813854...
I'm using jQueryUI Tabs and have a requirement to add UI elements to each tab that allow a user to Edit information about the tab, or remove the tab. The markup I use on the `<li>` for a given tab looks like this: ``` <li> <div style="background-color:Red;"> <-- Red to see what's happening --> <a href="#t...
[ 0.005642580334097147, -0.06950616836547852, 0.6874318718910217, -0.36074990034103394, -0.25827524065971375, 0.06317650526762009, -0.16104485094547272, -0.18542711436748505, -0.026781288906931877, -0.8420926332473755, -0.014311334118247032, 0.3609669506549835, -0.2784469425678253, -0.051344...
</div> </div> </li> ``` This renders just as I would hope in IE ``` ______________________________ | Edit| | Tab One | |___________________________X__| ``` but it does not render properly in Chrome or FireFox (the tab is only wide enough for the
[ -0.17285382747650146, 0.21552686393260956, 0.6810836791992188, -0.2574135661125183, -0.37364476919174194, -0.0520373098552227, 0.18912698328495026, -0.12198403477668762, 0.10061414539813995, -1.0332448482513428, -0.17988991737365723, 0.7155062556266785, -0.380673885345459, 0.00316635752096...
"Tab One" text, and "Edit" / "X" are mostly "under" the tab (lower Z-Index apparently). What is a compatible way to achieve my goal? Try this way. ``` Intent a = new Intent(context, MyActivity.class); a.putExtra("String1", "Hello World"); context.startActivity(a); ``` and ``` Bundle extras = getI...
[ 0.3388573229312897, -0.5629987120628357, 0.7532851099967957, 0.009133790619671345, 0.1745111644268036, -0.03389986976981163, 0.34038421511650085, -0.35116586089134216, 0.10142433643341064, -0.6602295637130737, -0.26288002729415894, 0.7389773726463318, -0.4256221354007721, -0.34970545768737...
I have these 2 queries that I would like to combine into one big query: ``` SELECT COUNT(*) AS ac, SUM(Views) AS vc FROM tableA ``` and ``` SELECT COUNT(*) AS mc FROM tableB ``` could'nt find anything on that topic, is it even possible? You can do in way using three subquery : ``` SELECT (SELECT COUNT(*) FROM ...
[ -0.012362154200673103, 0.1551375687122345, 0.4972621202468872, 0.4052368700504303, -0.08411114662885666, 0.1661534309387207, -0.21779543161392212, -0.35253581404685974, -0.36463817954063416, -0.5570660829544067, 0.04206056520342827, 0.5215399265289307, -0.22957700490951538, 0.4849421977996...
I'm writing a BloomFilter and wanted to use Scala's default MurmurHash3 implementation: scala.util.MurmurHash3. My compile is failing however with the following compile error: ``` [error] /mnt/hgfs/dr/sandbox/dr-commons/src/main/scala/dr/commons/collection/BloomFilter.scala:214: MurmurHash3 is not a member of scala.ut...
[ -0.3182567358016968, 0.39655911922454834, 0.7075725197792053, -0.5009716749191284, -0.06103908643126488, -0.14105375111103058, 0.4456658661365509, -0.4074189364910126, 0.01622704789042473, -0.5869781970977783, -0.01652674376964569, 0.1513805091381073, -0.5748611092567444, -0.07086841762065...
is the author of scala.util.MurmurHash. I would advise you not to accept this answer (assuming it's the correct one); since [Rex Kerr](https://stackoverflow.com/users/247533/rex-kerr) is on StackOverflow he may chime in and give you a much better one...
[ 0.24864241480827332, 0.002675214083865285, 0.1320132613182068, -0.08194305002689362, 0.5044957399368286, 0.13453420996665955, 0.37924620509147644, 0.3836904764175415, -0.47485044598579407, -0.019852176308631897, -0.1083817109465599, -0.005427282303571701, -0.3105754256248474, 0.13821835815...
Not sure if this has been covered somewhere, but I couldn't find it in the documentation, and was wondering if it'd be possible to not include the search input box with the jQuery chosen plugin (used to style select inputs). Specifically I'd like to use the standard select one without it. <http://harvesthq.github.com/...
[ 0.6077025532722473, 0.011614981107413769, 0.1296430379152298, -0.09924580901861191, -0.0820997878909111, 0.07084266096353531, -0.17092517018318176, 0.2779631018638611, -0.19808723032474518, -0.8242883086204529, 0.11611288040876389, 0.31547001004219055, 0.18177025020122528, 0.16709610819816...
I've **hosted a MySQL DB** in a **webserver**. I've **granted all privledges** and allowed **my IP to connect to this database remotely** from my local computer. It gets connected and I'm able to retrieve data from the database to my Java Swing application. But, sometimes **I get this error message** and my **connectio...
[ 0.05928735062479973, 0.3672213554382324, 0.5872130990028381, -0.16834813356399536, -0.39057672023773193, -0.08194407820701599, 0.5865774154663086, -0.5935912728309631, -0.20366938412189484, -0.5774389505386353, 0.16097602248191833, 0.23419561982154846, -0.1728573888540268, 0.40440750122070...
unexpectedly lost. STACKTRACE: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2411) at com.mysql.jdbc.M...
[ -0.352481871843338, 0.045789193361997604, 0.7787771821022034, 0.133491650223732, 0.1994122862815857, 0.3989478647708893, 0.4803239703178406, -0.5812987685203552, -0.4912339746952057, -0.6694209575653076, -0.29222825169563293, 0.3633151948451996, -0.24466875195503235, 0.1452062875032425, ...
java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.ja...
[ -0.25417616963386536, 0.01633029617369175, 0.665026068687439, -0.20180577039718628, -0.07078995555639267, 0.685525119304657, 0.26822739839553833, -0.6388460993766785, -0.20045027136802673, -0.9062351584434509, -0.24998876452445984, 0.829521656036377, -0.24413971602916718, -0.04999612271785...
packet sent to the server was 2 ms ago. at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2622) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc...
[ -0.3139004409313202, -0.2222026139497757, 0.6207947731018066, 0.03018978424370289, -0.3296414911746979, 0.6128180623054504, 0.3619752824306488, -0.48895561695098877, -0.41122087836265564, -0.8168478012084961, -0.20218314230442047, 0.21878457069396973, -0.3312027156352997, 0.228636160492897...
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:693) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:958) at java.awt.DefaultKeyboardFocusMa...
[ -0.18048784136772156, 0.10507115721702576, 0.4875289797782898, -0.03695429489016533, -0.09291313588619232, 0.5665549635887146, 0.6365476250648499, -0.3192364573478699, -0.2512941360473633, -0.9123178124427795, -0.30167147517204285, 0.6733772158622742, -0.3237195611000061, -0.08363562077283...
:) This is my class to Connect the DB: ``` package scm; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class DBControl { private static DBControl con; private static String severIp = null; private static String severPort = null; ...
[ 0.07129950821399689, -0.2121814340353012, 0.5468863844871521, -0.05881129577755928, -0.21538780629634857, 0.11197756975889206, 0.4430444836616516, -0.2746647000312805, -0.09845154732465744, -0.48905378580093384, -0.48955237865448, 0.4903419017791748, -0.6415280699729919, 0.3707405030727386...
if (con == null) { con = new DBControl(); } return con; } public void setSeverIp(String Ip) { severIp = Ip; } public void setSeverPort(String Port) { severPort = Port; } public void SetUserName(String Name) {
[ -0.23152296245098114, -0.37519699335098267, 0.5484196543693542, -0.3169655501842499, -0.09813935309648514, 0.3099404573440552, 0.35659077763557434, -0.36109644174575806, 0.02953323721885681, -0.8192185163497925, -0.3686274588108063, 0.3108651340007782, -0.3076815605163574, 0.23752197623252...
userName = Name; } public void setPassword(String passWord) { password = passWord; } public static ResultSet getResult(String url) throws Exception { Statement s = cc.createStatement(); rs = s.executeQuery(url); return rs; } public static Connection getConnecti...
[ -0.05478741601109505, -0.3194088637828827, 0.5660176277160645, 0.05882127955555916, -0.05371040105819702, -0.009348270483314991, 0.44953155517578125, -0.035250283777713776, -0.48605865240097046, -0.5401070713996887, -0.6079648733139038, 0.2276645302772522, -0.39004725217819214, 0.496085345...
Class.forName("com.mysql.jdbc.Driver"); cc = (Connection) DriverManager.getConnection("jdbc:mysql://" + getSeverIp() + ":" + getSeverPort() + "/anuradha_rr", getUserName(), getPassword()); return cc; } public void setResult(String url) throws Exception { Class.forName("com.mysql.jdbc.Dr...
[ 0.04559015482664108, -0.10219471901655197, 0.28356799483299255, 0.03356655314564705, 0.006560996174812317, 0.1246519610285759, 0.20203827321529388, -0.36654382944107056, -0.3555624485015869, -0.41532090306282043, -0.38113662600517273, 0.4789578914642334, -0.4309331178665161, 0.498794227838...
} public static String getSeverIp() { return severIp; } public static String getSeverPort() { return severPort; } public static String getUserName() { return userName; } public static String getPassword() { return password; } } ``` Make sure you are n...
[ 0.0758509486913681, -0.14020323753356934, 0.46694061160087585, 0.037546295672655106, 0.09816838800907135, -0.13870498538017273, 0.4908098578453064, -0.022309523075819016, -0.1373756378889084, -0.8356267213821411, -0.5462265610694885, 0.6064514517784119, -0.37463614344596863, 0.225916787981...
creating your jdbc connection they may be going idle. If you are using the same connection over and over, test the connection before you try to issue a query and get a new one if it has been closed by mysql. UPDATE: You create a new connection everywhere except getResult() which is where the stack trace identifies th...
[ 0.1823674440383911, -0.1838376522064209, 0.13467362523078918, 0.1182502880692482, -0.11345365643501282, -0.327860563993454, 0.5594052076339722, 0.013758832588791847, -0.3154180645942688, -0.981130838394165, -0.1648029386997223, 0.5132244825363159, -0.49273741245269775, 0.24728859961032867,...
Otherwise create a new connection and return that.
[ 0.16692951321601868, -0.005964863114058971, 0.0012079189764335752, 0.21779786050319672, -0.0005966252065263689, -0.29052507877349854, 0.33070018887519836, 0.06685645878314972, 0.2872054874897003, -0.6776275634765625, -0.28235211968421936, 0.3088601231575012, -0.14463776350021362, 0.5414901...
I am trying to serve up a dynamically generated csv file. For some reason when I get the file, there are 18 empty rows preceding the data. I don't have any space between the headers I define and the csv data I'm sending. If I write the data to a file on the server, it does not get these empty rows. However, if I write ...
[ 0.5690425634384155, 0.34697866439819336, 0.3289009928703308, -0.15458925068378448, -0.11737179011106491, 0.2057940810918808, 0.20076604187488556, 0.21989977359771729, -0.44228294491767883, -0.6237859129905701, 0.08508395403623581, 0.0657101646065712, -0.4542064964771271, 0.4810184240341186...
thinking of: ``` function generate_csv($source_type, $include_unpublished = FALSE) { // retrieve data from DB .... // start up headers $csv_name = "$source_type-$data_set-csv_" . date('Y-m-d') . '.csv'; header('Content-Type: text/x-comma-separated-values'); header('Cache-Control: must-revalidate, p...
[ -0.16836050152778625, 0.11346723139286041, 0.38726064562797546, -0.17566166818141937, -0.0026760674081742764, 0.0787835568189621, 0.394532173871994, -0.36351072788238525, -0.1732788383960724, -0.4674164056777954, -0.3530675768852234, 0.189083069562912, -0.3536898195743561, 0.24087576568126...
files that you are including. Every whitespace more than one newline after php closing tag `?>` is sent to the browser. Best solution is to get rid of this closing tags in every php file. Other option will be to remove only unnecessary new lines from them or to bufer output and disregard it before serving file.
[ 0.3911125957965851, 0.16593317687511444, 0.2674797475337982, 0.05378245189785957, -0.11686424911022186, -0.2047291100025177, 0.5253196954727173, 0.09750614315271378, -0.36976563930511475, -0.613318145275116, -0.1811550259590149, 0.3242969512939453, -0.5127004981040955, 0.06308744102716446,...
This should really be easy for an experienced android programmer. Unfortunately I don't know anything about the android sdk. I am using PhoneGap to package a web app and I need to override the WebSettings in the cordovaExample.java (right now I am using the cordovaExample as a template for my app). My code looks like t...
[ 0.06721674650907516, -0.11908045411109924, 0.5482640862464905, -0.019023939967155457, 0.04577920585870743, 0.14191490411758423, 0.3702111542224884, -0.5384456515312195, 0.2006203681230545, -0.8029433488845825, -0.21900944411754608, 0.8496813178062439, -0.4534671902656555, -0.00279819266870...
super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/www/index.html"); } } ``` I can run `ant debug install` without a problem but when I start the app in the emulator, the following errors occur: ``` E/AndroidRuntime( 549): java.lang.RuntimeException: Unable to start activity Compo...
[ -0.1043422520160675, 0.15487582981586456, 0.6575497984886169, -0.19673849642276764, 0.20816780626773834, 0.32200032472610474, 0.668459415435791, -0.4345288574695587, -0.3060496747493744, -0.45168864727020264, -0.47293010354042053, 0.8898959159851074, -0.6960023641586304, -0.084410443902015...
at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 549): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 549): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) E/AndroidRuntime( 549): at com.android.internal.os.ZygoteInit.main(Zy...
[ -0.054718174040317535, 0.08067643642425537, 0.4909210801124573, -0.29312610626220703, 0.1219966933131218, 0.031964849680662155, 1.0233718156814575, -0.5114960670471191, -0.44122007489204407, -0.3470783829689026, -0.31036433577537537, 0.8193210959434509, -0.28980880975723267, -0.33478063344...
help will be very much appreciated. ``` SELECT DISTINCT SectionID FROM @tmpTable AS t WHERE NOT EXISTS ( SELECT * FROM @tmpTable AS tt WHERE tt.SectionID = t.SectionID AND tt.DetailID NOT IN (-1, 0) ) ``` I think this should work too, since `DetailID` is an integer and the values...
[ -0.1874096691608429, -0.16885313391685486, 0.2806423604488373, 0.1695745289325714, 0.011278252117335796, 0.06436089426279068, 0.2120925337076187, -0.2575901746749878, 0.06662704050540924, -0.6962180733680725, -0.1869121491909027, 0.5874682068824768, -0.24201051890850067, -0.214568316936492...
@tmpTable AS t GROUP BY SectionID HAVING MAX(DetailID) <= 0 AND MIN(DetailID) >= -1 ```
[ 0.3276025056838989, -0.45115500688552856, 0.1277325302362442, -0.11026355624198914, -0.034780096262693405, 0.13860881328582764, 0.40313097834587097, -0.03672090917825699, 0.11865001916885376, -0.5495564937591553, -0.1366693079471588, 0.6914499998092651, -0.0255095474421978, 0.0223911590874...
In a class I have a handling method which performs actions based on what post/get variables are available. Here is a simplified example: ``` public function handleAll(array $vars) { if (isset($vars['var1'])) { $this->doThisAction($vars['var1']); } else if (isset($vars['var2'])) { $this->doAnoth...
[ -0.15512989461421967, -0.14853985607624054, 0.08192750811576843, -0.09515196084976196, -0.23734574019908905, 0.2693455219268799, 0.17687343060970306, -0.3282666504383087, 0.04938926920294762, -0.40160515904426575, -0.3012331426143646, 0.32873186469078064, -0.45471712946891785, 0.1836261451...
html form elements or get variables in urls (or indeed the keys of any array passed in). Allowing an array of any variables to be injected makes the method flexible which is necessary as it is also polymorphic. Classes inherit this method and use it to call it's own actions. A result of this is that it is not obvious...
[ 0.31135889887809753, -0.08050499856472015, 0.4206850528717041, 0.04121459275484085, -0.43372857570648193, -0.355185866355896, 0.47681787610054016, -0.19778181612491608, -0.0993759036064148, -0.5201976895332336, -0.08021427690982819, 0.3241727352142334, -0.5253637433052063, -0.3463572561740...
how to get around this. Having enormous if/case statements all exposed on index pages (from multiple classes like these) makes for extremely messy code so it is preferable to have all this encapsulated within a method. Also, it makes sense to have it as a method of the class responsible for calling the actions that man...
[ 0.23405303061008453, -0.1180780753493309, -0.16607287526130676, 0.3545171320438385, -0.14315947890281677, -0.25313034653663635, 0.3573603928089142, -0.3040107786655426, -0.26060807704925537, -0.4385116994380951, 0.19075118005275726, 0.371420294046402, -0.30022871494293213, 0.16512593626976...
as all parameters would need to be explicitly injected for each call, removing the polymorphic aspect. To sum up I need to keep the method polymorphic but I need some way of decoupling the handling code from user input from html forms or urls. In doing this perhaps there is a way of separating the interface from the i...
[ 0.3234860301017761, 0.212189182639122, 0.09739624708890915, 0.20248445868492126, -0.21227502822875977, 0.10825726389884949, 0.32608795166015625, -0.25057879090309143, -0.16843977570533752, -0.4659278690814972, 0.38357222080230713, 0.4522877335548401, -0.6016806960105896, 0.2278561145067215...
in the form of an array containing certain values or whatever else - that function will always depend on the arguments being populated correctly. If I have `function foo($a, $b, $c)`, I will always have to fill the parameters. If they come from POST, then I would need to take them from POST. The same goes even if the ...
[ 0.17702683806419373, 0.15441223978996277, 0.40277808904647827, -0.15736088156700134, 0.001954416511580348, 0.1938353031873703, 0.06040685996413231, -0.33170393109321594, -0.05633462965488434, -0.4910314083099365, -0.14429789781570435, 0.5588442087173462, -0.251616507768631, 0.0424889065325...
your handler functions. I do not really see any reason for this though, since why add the extra complexity if you don't have to? If you wish to better define what kind of array your handler requires, you could consider having it require an object instead. This approach is sometimes called a [parameter object](http://s...
[ 0.41746169328689575, -0.2757236957550049, -0.10796254128217697, 0.20522540807724, -0.2748261094093323, -0.19119542837142944, 0.09752676635980606, -0.25422191619873047, -0.24028927087783813, -0.6294938921928406, 0.17438502609729767, 0.6615927219390869, -0.5488426685333252, -0.16971406340599...
are actually related to each other, I would consider creating an actual business logic type object. Create it using the data from POST, and move the code which processes the values into a method in the object.
[ 0.5284329652786255, 0.17355374991893768, 0.1512680947780609, 0.5130577683448792, 0.11583607643842697, -0.010669734328985214, -0.15711955726146698, -0.11622490733861923, 0.09223779290914536, -0.3060144782066345, 0.14132454991340637, 0.46252137422561646, -0.3122222125530243, 0.23453524708747...
Is there a way to add a property to an ExpandoObject with the same name as a string value? For example, if I have: ``` string propName = "ProductNumber"; dynamic obj = new System.Dynamic.ExpandoObject(); ``` I can create the property ProductNumber like: ``` obj.ProductNumber = 123; ``` But, can I create the prop...
[ -0.030912721529603004, -0.13075755536556244, 0.5019456148147583, -0.33278387784957886, 0.4125977158546448, -0.23864112794399261, 0.10385533422231674, -0.40892529487609863, 0.04302448779344559, -0.5980353355407715, -0.299669474363327, 0.8490737676620483, -0.3007269501686096, 0.2122400104999...
my head whether you can use the indexer syntax with a `dynamic` reference (i.e., without the cast), but you can certainly try it and find out.
[ 0.36129653453826904, 0.12519216537475586, 0.18565186858177185, 0.14696986973285675, 0.07792751491069794, -0.08609599620103836, -0.04927392303943634, -0.014015487395226955, -0.043440137058496475, -0.25465184450149536, 0.04367684945464134, 0.23887783288955688, 0.016535449773073196, 0.1449326...
I'm building functionality onto a webpage which the user can perform multiple times. Through the user's action, an object/model is created and applied to HTML using ko.applyBindings(). The data-bound HTML is created through jQuery templates. So far so good. When I repeat this step by creating a second object/model a...
[ 0.30796241760253906, 0.20026351511478424, 0.4642857611179352, -0.3487064838409424, -0.19584958255290985, 0.03375430032610893, 0.49148648977279663, -0.2849683165550232, -0.17885291576385498, -1.0373766422271729, -0.13831286132335663, 0.47455891966819763, -0.23978418111801147, 0.188125863671...
templated HTML which contains all the data-bind attributes, so that it's no longer in the DOM. When the user starts the process for the second pass the data-bound HTML is re-added to the DOM. But like I said, when the HTML is re-added to the DOM and re-bound to the new object/model, it still includes data from the the...
[ 0.38466396927833557, -0.33858829736709595, 0.1205199584364891, 0.006413542665541172, -0.2334641069173813, -0.34550362825393677, 0.06982210278511047, -0.23717635869979858, -0.28707876801490784, -0.6675117015838623, 0.034661754965782166, 0.5508421063423157, -0.4937700927257538, -0.0354935564...
is a means of removing these bound properties from Knockout; telling knockout that there is no longer an observable model. Is there a way to do this? **EDIT** The basic process is that the user uploads a file; the server then responds with a JSON object, the data-bound HTML is added to the DOM, then the JSON object m...
[ -0.11138992756605148, -0.11245200783014297, 0.6244451999664307, -0.06791231781244278, -0.08842909336090088, 0.11297228187322617, 0.07563307136297226, -0.3370223641395569, -0.2846117317676544, -0.6235034465789795, -0.3549377918243408, 0.7562361359596252, -0.3255990743637085, 0.0262207761406...
null; ``` When the user wishes to do this once more, all these steps are repeated. I'm afraid the code is too 'involved' to do a jsFiddle demo. Have you tried calling knockout's clean node method on your DOM element to dispose of the in memory bound objects? ``` var element = $('#elementId')[0]; ko.cleanNode(eleme...
[ -0.06829161196947098, -0.2496282309293747, -0.0808948501944542, -0.34683066606521606, 0.1646907478570938, -0.1646728515625, 0.4098069667816162, -0.010663049295544624, -0.2178344875574112, -0.6483029723167419, -0.0655253455042839, 0.6823344826698303, -0.6840905547142029, 0.24416407942771912...
I have a winform application which contains a window resizable but one requirement is all UI items in the window should be resized according to size of the window. How can I achieve that? Set the anchor properties on your controls. For example, if you set a control to anchor left *and* right, it's width will change as ...
[ 0.21724994480609894, -0.1975536346435547, 0.40797314047813416, 0.01129778753966093, 0.0725441500544548, -0.04437596723437309, 0.15061688423156738, -0.2930118441581726, 0.07011108845472336, -0.7089641094207764, -0.002366372151300311, 0.612061619758606, 0.07445061206817627, 0.062368534505367...
I would like to display an editable list of items, each item of which is editable (kind of like an editable grid, in a way). I am using KnockoutJS. I cannot use just a simple Observable Array because, as the documentation states "An observableArray tracks which objects are in the array, not the state of those objects" ...
[ 0.2343648076057434, -0.03080633655190468, 0.3425613045692444, -0.18181146681308746, -0.2861620783805847, -0.03143982216715813, 0.09670422971248627, -0.10120180249214172, -0.2432042360305786, -0.8705450892448425, 0.05886995419859886, 0.6596596240997314, -0.48176416754722595, 0.0710106119513...
See <http://jsfiddle.net/AndyThomas/E7xPM/> What am I doing wrong? ``` <script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.0.0/knockout-min.js" type="text/javascript"></script> <table> <tbody data-bind="template: { name:'productListJavascriptTemplate', foreach: products}"> </tbody> </table> <script ...
[ 0.33849871158599854, 0.13631722331047058, 0.6035358309745789, -0.2058621644973755, -0.01476037222892046, 0.04798518121242523, -0.13361738622188568, -0.5250332951545715, -0.1851341277360916, -0.3693391978740692, -0.1264684945344925, 0.5971021056175232, -0.12523286044597626, 0.14765496551990...
Name: "Melon", CategoryId: "2"} ]; var viewModel = { products: ko.observableArray( ko.utils.arrayMap(initialData, function(product) { return ko.observable(product); })), categories: ko.observableArray(categoryList) }; $(function() { ko.applyBindi...
[ -0.5438386797904968, -0.05872776731848717, 0.5664084553718567, -0.208423912525177, -0.234467551112175, 0.33909767866134644, 0.1338924914598465, -0.19429390132427216, -0.46776431798934937, -0.43869709968566895, -0.5861116051673889, 0.46431148052215576, -0.4553559422492981, 0.296797007322311...
updated dynamically. If you define your CategoryId as an observable, you'll see it update as expected: ``` var initialData = [ { Name: "Television", CategoryId: ko.observable("1") }, { Name: "Melon", CategoryId: ko.observable("2") } ]; ``` See this updated jsfiddle: <...
[ -0.2122901827096939, -0.3429822325706482, 1.0731538534164429, -0.1659332513809204, -0.24615135788917542, -0.22722890973091125, 0.13772675395011902, 0.09132620692253113, -0.5391206741333008, -0.595589280128479, -0.6569708585739136, 0.5763385891914368, -0.2460784763097763, 0.2048496454954147...
**S**o I have a method that takes in a String and then is suppose to set the dynamic textbox on a button to said String. ``` public function setText(caption:String) { this.btext.text = caption; } ``` I really don't understand why this method is producing a 1119 error. `Access of a possibly undefined property bt...
[ 0.14216399192810059, 0.06485369056463242, 0.4961649179458618, -0.252287358045578, -0.11477228999137878, 0.14564745128154755, 0.45975568890571594, -0.15218058228492737, -0.09537550806999207, -0.6102476119995117, -0.1416395902633667, 0.3886575698852539, -0.6143699288368225, 0.217780560255050...
plenty of runtime errors. Basically what am I doing wrong? Thank you for any help. EDIT ==== Here is the code I am using, and I create an instance of button add it to the stage and store it in an array with this code. ### Code to create button ``` this.buttonArray.push(this.addChild(weaponButton)); ``` ### Bu...
[ 0.48663806915283203, -0.11493612825870514, 0.6558994054794312, -0.3336990177631378, 0.12104760110378265, 0.09760583937168121, 0.3024757206439972, -0.7462494969367981, -0.02879836969077587, -0.6520974040031433, -0.11675601452589035, 0.899769127368927, -0.35952651500701904, -0.13874438405036...
this.x = xpos; this.y = ypos; } public function setScale(xScale:Number, yScale:Number) { this.scaleX = xScale; this.scaleY = yScale; } public function addDropShadow():Array {
[ 0.07180783152580261, -0.3823966979980469, 0.5737650990486145, -0.056483034044504166, 0.11332183331251144, 0.19165641069412231, 0.23431098461151123, -0.49880096316337585, -0.3990285098552704, -0.4648342430591583, -0.35190480947494507, 0.5209234356880188, -0.4099993407726288, -0.206736445426...