text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
not storing the Count in an int, so every time we add to the list, we are comparing i+1 with Count+1, hence the endless loop.
[ 0.39629969000816345, 0.08489412069320679, 0.08204054087400436, -0.2473897635936737, -0.11454755812883377, 0.06738559901714325, 0.323302686214447, -0.42613691091537476, -0.4315168559551239, -0.3305209279060364, 0.26520171761512756, -0.054086171090602875, -0.42334842681884766, 0.506964266300...
If you have an object like this: ``` public class Foo { private int _id; public int id { get { return _id; } set { _id = value; } } private string _name; public string name { get { return _name; } set { _name = value; } } } ``` And you
[ -0.06116470322012901, 0.1218574047088623, 0.27818718552589417, -0.1804257482290268, 0.05026793107390404, -0.1442994773387909, 0.07341253757476807, -0.2270374298095703, 0.025040816515684128, -0.44219130277633667, -0.44534510374069214, 0.5854682922363281, -0.34050431847572327, 0.192934930324...
want to initialize id to -1 and name to String.Empty what is the best practice? (and why) Doing: ``` private int _id = -1 ``` Or Setting \_id = -1 and name = String.Empty in the constructor? This is more of a style question than anything else. There are only a few cases where it is a functional issue 1. When you...
[ 0.2072010040283203, 0.08287391811609268, -0.1960361897945404, 0.029145341366529465, -0.09119150042533875, -0.27208971977233887, 0.09175322949886322, -0.19767339527606964, -0.20587830245494843, -0.59382164478302, -0.06021982431411743, 0.7070109844207764, -0.31645509600639343, -0.04010839387...
same class hierarchy. In the abscence of partial classes the outcome is predictable but still can throw people for a loop..
[ -0.0870867669582367, -0.24627837538719177, -0.24265405535697937, 0.5498962998390198, -0.17868578433990479, -0.06594783812761307, 0.5084089040756226, 0.1750880628824234, -0.17333567142486572, -0.6639219522476196, -0.10434921830892563, 0.33938223123550415, -0.20371071994304657, 0.25291538238...
Can someone help me to find out why I'm getting the error message "Access to undefined property: removeChild(goBack)" on the following snipped? BTW, this is for flash CS4 ``` function nameOfFunction() { var goBack:backButton_mc = new backButton_mc(); goBack.x = 10; goBack.y = 700; goBack.back_text.text = myXML.*[...
[ -0.07025691121816635, 0.07790727913379669, 0.504115104675293, -0.15364721417427063, 0.23397979140281677, -0.04250190407037735, 0.31381696462631226, -0.3921610116958618, -0.2928794026374817, -0.4003409743309021, -0.07637935876846313, 0.704793393611908, -0.19904327392578125, 0.31224906444549...
ID of this transaction COMMIT TRANSACTION InsertRecord ``` and call the sproc using VB: ``` Dim strNn '<- var to be passed' Set cn = Server.CreateObject("ADODB.Connection") connectString = "DSN" cn.Open connectString, "user", "PW0rd" Set rs = Server.CreateObject("ADODB.Recordset") set rs = cn.Execute("EXEC [...
[ -0.049397312104701996, -0.03464556857943535, 0.7758331894874573, -0.13193519413471222, -0.00781579315662384, -0.11583103984594345, 0.02478993870317936, -0.3857670724391937, -0.3500285744667053, -0.6232839226722717, -0.14328370988368988, 0.3641602098941803, -0.18054403364658356, 0.323894053...
We've been doing some testing with ColdFusion and MySQL and are a bit puzzled. We know that there are different 'sql-mode' flags you can set in the /etc/my.cnf file which will cause MySQL to behave certain ways, depending on the modes defined. We know you can also set these flags whenever starting MySQL using '--sql-mo...
[ 0.18783213198184967, 0.06895025074481964, 0.5231260657310486, 0.04649970680475235, -0.10122451186180115, -0.15288189053535461, 0.2573087215423584, 0.23959501087665558, -0.17918378114700317, -0.4835526645183563, 0.03919850289821625, 0.6038059592247009, -0.29811620712280273, 0.23760052025318...
| +-------------------+ 1 row in set (0.00 sec) mysql> SELECT @@SESSION.sql_mode; +--------------------+ | @@SESSION.sql_mode | +--------------------+ | | +--------------------+ 1 row in set (0.00 sec) ``` This tells me that there is no mode, which is what we're going for. However, doing the sam...
[ -0.24368180334568024, -0.22292935848236084, 0.8489560484886169, 0.11077478528022766, 0.08496251702308655, -0.12400568276643753, 0.3506239652633667, -0.20364703238010406, -0.1324814260005951, -0.4909261167049408, -0.03864753246307373, 0.6266612410545349, -0.5061027407646179, 0.1598572731018...
don't want. Now, I can set the Session sql-mode to be empty in ColdFusion before we do anything else, which gives me the desired effect, but I don't really want to go to every query and add that. I (tried) looking in the /etc/init.d/mysqld script to see if I could find where it would set the mode, but didn't see anyt...
[ 0.762083113193512, 0.3029956519603729, 0.16770419478416443, 0.19647864997386932, 0.09988086670637131, -0.21542923152446747, 0.3195855915546417, 0.3474694490432739, -0.22322942316532135, -0.5480164885520935, 0.20832274854183197, 0.4497806131839752, -0.2887195646762848, 0.18347050249576569, ...
it looks like it's a compatibility issue with either Java or JDBC: > The driver needs the STRICT\_TRANS\_TABLES mode enabled to enforce JDBC compliance on > truncation checks. > > > If you can't use STRICT\_TRANS\_TABLES as part of your sql\_mode, then you'll have to disable > truncation checks by adding "jdbcComp...
[ 0.03849061578512192, 0.19263127446174622, 0.17344187200069427, 0.03313262760639191, 0.1327648013830185, -0.1835147887468338, 0.5763521790504456, 0.06830158829689026, -0.27277159690856934, -0.463335245847702, 0.008953294716775417, 0.709560215473175, -0.5937396883964539, 0.4043080806732178, ...
The problem comes up when you run couple of python scripts. in top at command, it shows only 'python' with these scripts. How to rename a process or otherwise tag it so that I could tell them apart in top? Simply use the `--full-commands` option to show the full command line for each process : ``` top -c ```
[ 0.12177934497594833, 0.24541643261909485, 0.10437212139368057, -0.06007082760334015, 0.07904639840126038, -0.22661961615085602, 0.12977232038974762, 0.2703782618045807, -0.314850777387619, -0.3746206760406494, -0.17258426547050476, 0.6428046822547913, -0.16978706419467926, 0.13519808650016...
I am trying to use stored proc to insert record using detailsview and sqldatasource. I get the following error: Procedure or function 'CustRec\_iu' expects parameter '@firstname', which was not supplied. My detailsview definition is as follows: ``` <asp:DetailsView ID="dvCustDetails1" runat="server" AutoGenerateRows...
[ 0.11808758974075317, -0.034686192870140076, 0.5622400641441345, -0.09150802344083786, 0.20745277404785156, -0.11357180774211884, -0.13284064829349518, -0.15876510739326477, 0.05140186473727226, -0.822471022605896, 0.1264573484659195, 0.4551992118358612, 0.03035985678434372, 0.2886958718299...
<asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" /> <asp:CommandField ButtonType="Button" ShowInsertButton="True" /> </Fields> </asp:DetailsView> ``` In the code behind , PageLoad looks as follows: ``` SqlDataSource1.Connection...
[ -0.35730719566345215, -0.15386657416820526, 0.49123287200927734, -0.24164767563343048, 0.35245105624198914, 0.10715598613023758, -0.10671185702085495, -0.13991163671016693, -0.27476510405540466, -0.6330716013908386, -0.3326515257358551, 0.48553475737571716, -0.08888699114322662, 0.06861052...
from customer"; //SqlDataSource1.SelectCommand = "CustRec"; SqlDataSource1.InsertCommand = "CustRec_iu"; SqlDataSource1.InsertParameters.Clear(); SqlDataSource1.InsertParameters.Add(new Parameter("firstname", DbType.String)); SqlDataSource1.InsertParameters.Add(new Parameter("LastName", DbType.St...
[ -0.062337398529052734, -0.16554297506809235, 0.7271637320518494, -0.4239045977592468, 0.26040661334991455, 0.3318173885345459, 0.298801064491272, -0.20878039300441742, 0.0989648625254631, -0.5036420226097107, -0.18082112073898315, 0.7758713960647583, -0.23770885169506073, 0.266164183616638...
insert into customer (firstname,lastname,Active) values (@firstname,@lastname,@Active) end else begin update customer set firstname=@firstname, lastname= @lastname,
[ -0.05710073560476303, 0.041119929403066635, 0.4611019194126129, -0.21234026551246643, 0.279940128326416, 0.24664656817913055, -0.22230282425880432, -0.022257711738348007, 0.25892359018325806, -0.5401517152786255, -0.15927369892597198, 0.732759952545166, -0.10644995421171188, 0.120674967765...
active = @Active where custid = @custid end /* SET NOCOUNT ON */ RETURN ``` What I dont understand how the input parameter interacts between sqldatasource, detailsview etc. How does it work with insline statement and not work with stored proc? How does sql datasource and detailsview w...
[ 0.0395754873752594, -0.2938925623893738, 0.6876086592674255, 0.08575739711523056, -0.1811763197183609, -0.2379900962114334, 0.1947806477546692, -0.22455595433712006, -0.099598728120327, -0.5740262269973755, -0.15317176282405853, 0.6808419227600098, -0.313859224319458, -0.12066327780485153,...
not much help . Thank you in advance to read my question. I think you may be missing ``SqlDataSource1.InsertCommandType = CommandType.StoredProcedure``
[ 0.07138409465551376, 0.15957842767238617, -0.07997137308120728, 0.11414126306772232, 0.28277787566185, -0.20498326420783997, 0.18613310158252716, 0.44376909732818604, -0.0735548660159111, -0.5045965909957886, 0.04000391438603401, 0.5117304921150208, -0.2482113540172577, 0.21976391971111298...
I've got a form with several search (text) fields. When text is entered into one of the fields, I'd like to disable the others. Conversely, if all text is removed from the active text field, the other fields should be re-enabled. The basic idea would be something like this (I think): ``` $(document).ready(function() ...
[ 0.3350198268890381, 0.07586273550987244, 0.6299457550048828, -0.19441427290439606, 0.3607560694217682, -0.3127101957798004, 0.17423802614212036, -0.2516155540943146, 0.117494136095047, -0.6701146960258484, -0.22047744691371918, 0.7012551426887512, -0.3868364691734314, 0.07483496516942978, ...
} else { //enable all textboxes } }); }); ``` I'm not clear on what the easiest way to find/work with "all text boxes that aren't this one" is. I think the best way to do "all textboxes that aren't this one" is using the `not` filter like: ``` $(document).ready(function() { ...
[ 0.189615860581398, -0.2074820101261139, 0.46179816126823425, -0.05651198327541351, 0.5836275219917297, -0.25656449794769287, 0.21357737481594086, -0.2987734377384186, -0.03516152501106262, -0.728756308555603, -0.5069584846496582, 0.9105173945426941, -0.4889451563358307, -0.2485701888799667...
$(":text").not(this).attr('disabled','disabled'); } else { $(":text").removeAttr('disabled'); } }); }); ``` ### Couple notes: * I recommend giving a class to all the input elements you want to include with this behavior and doing a selector of input.myfields as it is faster/cleaner. *...
[ 0.046430330723524094, -0.10640043020248413, 0.1256222277879715, -0.24268528819084167, -0.18718169629573822, 0.06774476915597916, 0.4629013240337372, 0.010810872539877892, -0.05665696784853935, -0.5165876746177673, -0.35226771235466003, 0.7475695013999939, -0.480237752199173, -0.01237664930...
them that way. * I also think you want the `keyup` event instead of `keypress`.
[ 0.28909534215927124, -0.0036144652403891087, -0.023367855697870255, -0.00737083749845624, -0.1448700726032257, -0.13329118490219116, 0.10536281019449234, 0.30925631523132324, -0.4027577340602875, -0.515463650226593, -0.165012925863266, 0.5933387875556946, 0.004437193740159273, 0.0828060358...
I have two `IEnumerable<T>`s. One gets filled with the fallback ellements. This one will always contain the most elements. The other one will get filled depending on some parameters and will possibly contain less elements. If an element doesn't exist in the second one, I need to fill it with the equivalent one of the ...
[ -0.1814521849155426, 0.06394302099943161, 0.38145387172698975, -0.06093945726752281, -0.0028947487007826567, 0.16118352115154266, 0.2750155031681061, -0.33427849411964417, 0.26018208265304565, -0.7131001949310303, -0.31872957944869995, 0.39168649911880493, -0.3954678177833557, 0.0324485152...
translated.add(person); } ``` Any suggestions? Try this. ``` public static IEnumerable<Person> SmartCombine(IEnumerable<Person> fallback, IEnumerable<Person> translated) { return translated.Concat(fallback.Where(p => !translated.Any(x => x.id.equals(p.id))); } ```
[ -0.17847734689712524, -0.18617574870586395, 0.3411810100078583, 0.20719879865646362, 0.04767405241727829, -0.1988331377506256, 0.16808272898197174, 0.13272973895072937, 0.0890042707324028, -0.7251603007316589, -0.5605392456054688, 0.6439141035079956, -0.3879569470882416, -0.098527096211910...
all I am trying to implement a floating point arithmetic library and I have trouble understanding the algorithm of subtracting floats. I have implemented addition succesfully and I thought that subtraction was just a special case of it but it seems I am making a mistake somewhere. I am adding the code here just for r...
[ 0.33489537239074707, 0.3241714835166931, 0.3274344205856323, 0.21329763531684875, -0.35233378410339355, 0.14537593722343445, 0.13550524413585663, -0.3714888393878937, -0.05173590034246445, -0.4901037812232971, 0.26810896396636963, 0.4948154389858246, 0.04201602190732956, 0.1734414845705032...
negative one(the one we subtract) into two's complement and then add them? That's what I am doing but the result is not correct. Albeit it is very close ... but not the same. Anyone has any ideas? Thanks in advance! I am quite sure that the way I do things works since I implemented an almost identical algorithm for ...
[ -0.02334292232990265, 0.051052846014499664, 0.24881340563297272, -0.21820737421512604, -0.5810315012931824, 0.4138428270816803, 0.323525607585907, -0.45942625403404236, -0.23907259106636047, -0.37403610348701477, 0.31034189462661743, 0.7210036516189575, -0.2701420485973358, 0.0153019381687...
to the right //adding the hidden bit f2.float_parts.mantissa = ((f2.float_parts.mantissa)>>1) | (0x01<<22); f2.float_parts.mantissa >>= (int)(diff);//was (diff-1) //also increase its exponent by the difference shifted f2.float_parts.exponent = f2.float_parts.exponent + diff; } else if(f1.float_part...
[ -0.3780019283294678, -0.3028196692466736, 0.4981815218925476, -0.11252495646476746, 0.05394422262907028, 0.6059444546699524, -0.10644737631082535, -0.48614701628685, -0.23575392365455627, -0.1806551218032837, -0.3158471882343292, 0.5451156497001648, -0.050478849560022354, -0.04862217232584...
//adding the hidden bit f2.float_parts.mantissa = ((f2.float_parts.mantissa)>>1) | (0x01<<22); f2.float_parts.mantissa >>= (int)(diff); //also increase its exponent by the difference shifted f2.float_parts.exponent = f2.float_parts.exponent + diff; } else//if the exponents were equal f2.float_parts.m...
[ -0.09094925969839096, -0.42863190174102783, 0.1070581004023552, -0.12099099159240723, -0.015757929533720016, 0.6170253157615662, 0.2507816553115845, -0.4239969849586487, -0.03540506958961487, -0.2457822561264038, -0.28302380442619324, 0.7479491829872131, -0.19949494302272797, -0.0836217105...
//gotta shift right by overflow bits //normalization if(manBitSet(result,1)) result.float_parts.mantissa <<= 1; //hide the hidden bit else result.float_parts.exponent +=1; return result; } ``` If the databases are in different servers you need to make sure that they are set up as linked servers. Also be ...
[ 0.18115943670272827, -0.1866081804037094, 0.19708167016506195, 0.22721782326698303, 0.3258466124534607, -0.06108896806836128, 0.44230571389198303, -0.23965872824192047, -0.30960389971733093, -0.38054805994033813, -0.0449804812669754, 0.6558918952941895, -0.25021129846572876, 0.193097561597...
"intersect". So performance isn't what it could be.
[ 0.2334098070859909, -0.257281094789505, -0.05523962527513504, 0.436582088470459, -0.08219126611948013, -0.12111561000347137, 0.10221517086029053, 0.1846601665019989, 0.12896332144737244, -0.4908340871334076, -0.06089618429541588, 0.665482759475708, -0.27454066276550293, -0.0209698993712663...
When debugging C/C++ (unmanaged?) code in VS, after stepping out of a function, you can see the returned value in the 'autos' window: [alt text http://img156.imageshack.us/img156/6082/cpp.jpg](http://img156.imageshack.us/img156/6082/cpp.jpg) However, this does not work for C# code: [alt text http://img120.imageshack...
[ 0.07009690254926682, 0.001617110799998045, 0.4492761492729187, -0.164279967546463, -0.14359036087989807, -0.003391163656488061, 0.3460090756416321, -0.619110107421875, -0.30316391587257385, -0.30895453691482544, -0.20874176919460297, 0.6403440833091736, -0.5124579071998596, -0.054666329175...
return a value and different jitters will make different choices. Particularly so when the return value type isn't simple, like a struct. If it is large then the jitter will reserve stack space on the calling method and pass a pointer to that space so the called method can copy the return value there. Nevertheless, VS2...
[ 0.03843045234680176, -0.2985103130340576, 0.8576031923294067, -0.18393473327159882, -0.3037508726119995, 0.23428869247436523, 0.40522006154060364, -0.10970249772071838, -0.23100706934928894, -0.299244225025177, -0.05524199828505516, 0.5570911765098572, -0.1705145686864853, -0.0702812150120...
I have the following array, which I would like to reindex so the keys are reversed (ideally starting at 1): Current array (**edit:** the array actually looks like this): ``` Array ( [2] => Object ( [title] => Section [linked] => 1 ) [1] => Object ( [title] => Sub-Section ...
[ -0.07695427536964417, 0.13123288750648499, 0.7029394507408142, -0.38739731907844543, 0.01163027249276638, -0.10792502760887146, 0.1444035917520523, -0.3409879505634308, -0.12339872121810913, -0.5250330567359924, -0.06551512330770493, 0.539093017578125, -0.21171292662620544, 0.3180740475654...
[title] => Sub-Sub-Section [linked] => ) ) ``` How it should be: ``` Array ( [1] => Object ( [title] => Section [linked] => 1 ) [2] => Object ( [title] => Sub-Section [linked] => 1 ) [3] => Object ( [title] => Sub-Sub-Section
[ 0.1027432456612587, 0.16841629147529602, 0.39308032393455505, -0.29546236991882324, -0.00036501625436358154, -0.351310670375824, 0.3869386613368988, -0.7101320624351501, -0.17083393037319183, -0.5413491725921631, -0.529167890548706, 0.3320731520652771, -0.37449318170547485, 0.0925770998001...
[linked] => ) ) ``` If you want to re-index starting to zero, simply do the following: ``` $iZero = array_values($arr); ``` If you need it to start at one, then use the following: ``` $iOne = array_combine(range(1, count($arr)), array_values($arr)); ``` Here are the manual pages for the functions used: * ...
[ 0.16485174000263214, -0.10008524358272552, 0.4906702935695648, -0.45273807644844055, 0.00041865641833283007, 0.1404094249010086, 0.07852257043123245, -0.658980667591095, -0.2529926300048828, -0.1926449090242386, -0.034736428409814835, 0.6559501886367798, -0.503931999206543, -0.081309780478...
I've written an app that I use as an agent to query data from a database and automatically load it into my distributed web cache. I do this by specifying an sql query and a type in a configuration. The code that actually does the querying looks like this: ``` List<Object> result = null; try { result = dc.ExecuteQuery...
[ 0.29126521944999695, 0.2901156544685364, 0.525542676448822, -0.1326417624950409, 0.3463956117630005, 0.13050693273544312, 0.09239599108695984, -0.3456711769104004, -0.11040779203176498, -0.37004807591438293, -0.01614454574882984, 0.5948148369789124, -0.49722573161125183, 0.0921270996332168...
= "foo_id")] public Int32 FooId { get; set; } [Column(Name = "count")] public Int32 Count { get; set; } } ``` The SQL query looks like this: ``` select foo_id as foo_id, sum(count) as [count] from foo_aggregates group by foo_id order by foo_id ``` For some reason, when the query is executed, the "Coun...
[ 0.008135445415973663, 0.2160506248474121, 0.4686061143875122, -0.23890900611877441, -0.21055451035499573, 0.024880969896912575, 0.09506476670503616, -0.6904861330986023, -0.08356056362390518, -0.2921488583087921, -0.09564124047756195, 0.35014471411705017, -0.5801135897636414, 0.24702323973...
with `TableAttribute`: ``` [Table(Name = "foo_aggregates")] public class FooCount { [Column(Name = "foo_id")] public Int32 FooId { get; set; } [Column(Name = "count")] public Int32 Count { get; set; } } ``` I had assumed (wrongly, apparently) that since I wasn't using the `GetTable<T>()` method, I d...
[ -0.09963858872652054, 0.18492010235786438, 0.428971529006958, -0.20287860929965973, -0.1234162226319313, -0.15548677742481232, 0.09886181354522705, -0.36324194073677063, -0.3684443533420563, -0.511300265789032, -0.173544779419899, 0.23020552098751068, -0.5021650791168213, 0.137640506029129...
would match the column in the SQL statement, whereas FooId/foo\_id of course do not match.
[ 0.2888314127922058, 0.3911499083042145, 0.22794440388679504, -0.23855195939540863, 0.05388524755835533, 0.020717894658446312, 0.017683900892734528, -0.1464768350124359, 0.4153499901294708, -0.16082917153835297, -0.14068208634853363, 0.5546731352806091, -0.4355250597000122, -0.0682131797075...
The API for the Java [Set](http://java.sun.com/javase/6/docs/api/java/util/Set.html) interface states: > For example, some implementations prohibit `null` elements and some have restrictions on the types of their elements I am looking for a basic Set implementation that does not require ordering (as [ArrayList](http:...
[ 0.09420162439346313, 0.15604624152183533, 0.12043651938438416, -0.04562424123287201, -0.317905068397522, -0.13641846179962158, 0.31995102763175964, -0.5415606498718262, -0.24048630893230438, -0.6563135981559753, -0.28470519185066223, 0.14650624990463257, -0.6159664988517761, 0.008769688196...
code my class will iterate over all elements in the collection and call a specific method. (I'm actually using `HashSet<MyRandomObject`>). I would rather fail fast than fail later or accidentally incur some bizarre behavior due to a `null` being in the set. Better than extending a particular implementation, you can eas...
[ 0.2856786847114563, -0.03643520548939705, -0.0970284715294838, 0.20652680099010468, -0.1893753856420517, -0.21931016445159912, 0.5819390416145325, -0.11886945366859436, 0.0760776698589325, -0.6754050254821777, -0.09084242582321167, 0.3372134566307068, -0.43001165986061096, 0.26991680264472...
versions.
[ -0.03468243032693863, -0.19306527078151703, 0.36140671372413635, 0.131602481007576, 0.17083120346069336, 0.19747382402420044, -0.03428180515766144, 0.05015498027205467, -0.10246183723211288, -0.6961013078689575, -0.5561131834983826, 0.006347841117531061, -0.21633101999759674, 0.14726762473...
``` Interface IView { List<string> Names {get; set;} } public class Presenter { public List<string> GetNames(IView view) { return view.Names; } } var mockView = MockRepository.GenerateMock<IView>(); var presenter = new Presenter(); var names = new List<string> {"Test", "Test1"}; mockView.Expect(v ...
[ 0.12329065054655075, 0.0399249903857708, 0.7729498744010925, -0.3269391655921936, -0.5103899836540222, 0.32822927832603455, 0.5765352845191956, -0.4179930090904236, -0.3540678024291992, -0.7980491518974304, 0.08948972821235657, 0.718974232673645, -0.28434836864471436, 0.33908364176750183, ...
list object from the mocked property it returns null. However when i change the property data type to string/int i.e.premitive type then value is returned correctly Thanks for your help, after investigating I found that I was creating a new list object inside the presenter with the same content of view list object, and...
[ 0.3699890375137329, -0.05232095345854759, 0.6148378252983093, 0.12265700846910477, -0.6613920331001282, 0.18373627960681915, 0.5318976640701294, -0.14820416271686554, -0.2374996542930603, -0.3526679575443268, 0.23247705399990082, 0.6361052989959717, -0.27022784948349, 0.18146421015262604, ...
We have a large, deployed, 3-tier .NET application which for good business reasons can't be upgraded at present. The client makes use of a number of classic c++ ActiveX controls through the usual interop mechanism. We have fixed some critical bugs in one of the ActiveX controls and need to deploy the fixes to a number...
[ 0.2676490843296051, 0.045950789004564285, 0.2939704656600952, 0.2306077778339386, 0.27944090962409973, -0.10495894402265549, 0.13051468133926392, -0.0037419807631522417, -0.18091924488544464, -0.5969427227973938, -0.20362497866153717, 0.655482292175293, -0.3517441749572754, 0.0346225276589...
variety of somewhat strange errors, but it's possible that the ActiveX dll (which is still in development) is defective -- that's being followed up in parallel. Should simply substituting the dlls work? If not, can you suggest another approach short of rebuilding then reinstalling the client which ought to work? Echoi...
[ 0.5969687104225159, -0.07616312801837921, -0.14200459420681, 0.293918639421463, -0.35075026750564575, -0.12481891363859177, 0.705046534538269, 0.16728761792182922, -0.4038265347480774, -0.288838654756546, -0.10398446768522263, 0.5841289162635803, -0.5090505480766296, -0.649240255355835, ...
you can simulate it. Here's an example that simulates it by creating a global binding, but restores the previous value on exit: [http://codepad.org/6vAY8Leh](http://codepad.org/6vAY8Leh "dynamic scope in python") ``` def adds_dynamic_z_decorator(f): def replacement(*arg,**karg): # create a new 'z' binding in gl...
[ 0.034856632351875305, -0.21215392649173737, 0.31890150904655457, -0.05869421362876892, 0.13621516525745392, 0.12767669558525085, 0.38479700684547424, -0.30341213941574097, -0.33204081654548645, -0.5686215162277222, -0.09292419999837875, 0.6899251341819763, -0.483862966299057, 0.16500250995...
finally: #restore any old bindings if oldZ: globals()['z'] = oldZ[0] else: del(globals()['z']) return res return replacement @adds_dynamic_z_decorator def func(x,y): print z def other_recurse(x): global z print 'x=%s, z=%s' %(x,z) recurse(x+1) print 'x=%s, z=%s' %(x,z...
[ 0.21465182304382324, -0.1477736234664917, 0.9665339589118958, -0.2564030885696411, 0.012679175473749638, 0.04737493023276329, 0.22280307114124298, -0.4429783225059509, -0.4747506082057953, -0.414448082447052, -0.5522916316986084, 0.8722476959228516, -0.3839419186115265, 0.33543479442596436...
sanity of the above code. Actually, I warrant that it *is* insane, and you should avoid using it unless you want a flogging from your Python peers. This code is similar to both eduffy's and John Montgomery's code, but ensures that 'z' is created and properly restored "like" a local variable would be -- for instance, n...
[ 0.19669751822948456, -0.08617155253887177, 0.03170493245124817, 0.1760932356119156, -0.022014060989022255, -0.3307957351207733, 0.4704529941082001, -0.0738893672823906, -0.06494233757257462, -0.006487986072897911, 0.11377746611833572, 0.8311951160430908, -0.5134016275405884, 0.292028069496...
I've got some problems unregistering some eventreceivers form a contenttype. The contenttype and the receivers were deployed and registered by myself so I don't try to remove any MOSS built-in or internal eventreceivers. I trying to archive this with the following code snippet: ``` using (SPSite site = new SPSite("h...
[ 0.09590950608253479, -0.1774846613407135, 0.49308884143829346, -0.03641469404101372, 0.03698011115193367, -0.3733674883842468, 0.3190358877182007, -0.06958711892366409, -0.2989637851715088, -0.5850266814231873, 0.0001772427058313042, 0.4124894142150879, -0.011015902273356915, 0.11403556168...
web.AllowUnsafeUpdates = true; SPContentType type = web.AvailableContentTypes[<ContentTypeName>]; while (type.EventReceivers.Count > 0) { type.EventReceivers[0].Delete();
[ 0.07040585577487946, -0.4725176692008972, 0.8503397703170776, 0.060610976070165634, 0.038433730602264404, -0.2144843190908432, 0.5958652496337891, -0.28641679883003235, -0.23568443953990936, -0.5608869194984436, -0.34760403633117676, 0.31507235765457153, -0.527656614780426, 0.1552659124135...
} type.Update(); // web.AllowUnsafeUpdates = false; } } ``` Unfortunately the command "type.Update()" throws an exception telling me that the collection cannot be modified. As you can see in the code I've already tried different things to solve
[ 0.28343862295150757, 0.17548292875289917, 0.4246137738227844, -0.36362990736961365, 0.30420422554016113, -0.37734541296958923, 0.4854322075843811, -0.20736783742904663, -0.19372282922267914, -0.541694164276123, -0.12331406027078629, 0.7451282739639282, -0.5616173148155212, 0.38969197869300...
this problem, as allowing unsafe updates or running this code with elevated privileges. But I always get the same exception. So what am I doing wrong? Your problem is that the "AvailableContentTypes" property returns you a **READ-ONLY** collection. You should also use the 'ContentTypes' property, ans everything shou...
[ 0.341236412525177, -0.06981700658798218, 0.21290399134159088, 0.23208536207675934, -0.3411963880062103, -0.4466581344604492, 0.41270512342453003, 0.2605365812778473, -0.1955597847700119, -0.594115138053894, 0.06958767026662827, 0.6829739809036255, -0.17512495815753937, 0.5098637938499451, ...
Do you know a tool that automatically refactors a method with a single loop into a recursive method, preferably in Java? This is for teaching purposes. I don't think such a tool exists, since usually refactoring aims at increasing performance, not decreasing it (which is the case when using recursive methods instead o...
[ 0.1655615270137787, -0.16233769059181213, -0.452242910861969, 0.34055590629577637, 0.042929209768772125, -0.08719547092914581, 0.15755651891231537, -0.08206623047590256, -0.2951793074607849, -0.4336889386177063, 0.19325900077819824, 0.5538918972015381, -0.4463810324668884, -0.1861910372972...
a generic for loop, in pseudo-code, for the sake of demonstration: ``` loopFunc() // method (could return a value or not) { for (initialization ; // Sets the context test ; // Test continuation wrt the context counting_exp // Update the context after each iteration ) { ...
[ 0.2913837432861328, -0.3969351351261139, 0.09855333715677261, -0.007983241230249405, -0.13966576755046844, -0.03849122300744057, 0.5397397875785828, -0.5164932608604431, -0.17635980248451233, 0.15792085230350494, 0.19068658351898193, 0.17703108489513397, -0.6221851110458374, 0.186793148517...
} } ``` The loop is composed of four parts: `initialization`, which initialize the context (usually variables); `test`, which is a boolean expression that checks wheter or not the loop is finished; `counting_exp`, which is a statement that is performed after each iteration; and finally, `loop_body`, that represents t...
[ 0.26391759514808655, -0.11006861180067062, -0.016640031710267067, -0.03980949521064758, 0.14534173905849457, 0.0745948776602745, 0.34750795364379883, -0.5396654605865479, 0.027608191594481468, 0.09506282955408096, -0.15132082998752594, 0.47028684616088867, -0.40985050797462463, -0.12459151...
the context to the inner function } innerRecFunc(context) { if not test then return // could return a value else { loop_body // Can update context counting_exp // Can update context innerRecFunc(context) // Recursive call (note tail-recursion) } } ``` I di...
[ 0.0067464429885149, -0.04445512592792511, 0.07501036673784256, -0.19751371443271637, -0.01511461939662695, 0.06492294371128082, 0.6798087954521179, -0.47335049510002136, 0.14422382414340973, -0.2665420472621918, 0.24827244877815247, 0.7862488031387329, -0.4299546778202057, -0.3836762309074...
this would work in all cases, but for simple loops this should be correct. Of course, this transformation can easily be adapted to other types of loops (while, do while).
[ 0.02569088712334633, -0.4211461842060089, -0.07281620055437088, 0.021485915407538414, -0.028480615466833115, -0.22374951839447021, 0.19791258871555328, -0.17639265954494476, -0.16233068704605103, -0.4044632017612457, -0.12923742830753326, 0.3120001554489136, -0.3415912091732025, 0.05686733...
I want to compute a checksum of all of the values of a column in aggregate. In other words, I want to do some equivalent of ``` md5(group_concat(some_column)) ``` The problem with this approach is: 1. It's inefficient. It has to concat all of the values of the column as a string in some temporary storage before p...
[ -0.12174572050571442, 0.11538194119930267, 0.3311796188354492, -0.22865645587444305, -0.05896662548184395, -0.0656953975558281, 0.22612258791923523, -0.22536282241344452, -0.23066644370555878, -0.455113023519516, 0.063710518181324, 0.5046893358230591, -0.5928696990013123, 0.199664384126663...
clause within it, e.g. `group_concat(some_column order by some_column)`) MySQL offers the nonstandard bitwise aggregate functions BIT\_AND(), BIT\_OR() and BIT\_XOR() which I presume would be useful for this problem. The column is numeric in this case but I would be interested to know if there was a way to do it with ...
[ -0.12230192869901657, 0.27574747800827026, 0.2837240397930145, -0.20268979668617249, -0.41628551483154297, -0.010303792543709278, 0.14499729871749878, -0.1869175285100937, 0.038959719240665436, -0.31387197971343994, 0.06633919477462769, 0.34385615587234497, -0.41998490691185, 0.03306445106...
a temporary table (especially if you added an `order by`).
[ 0.040279991924762726, 0.08470262587070465, 0.33145803213119507, 0.11038883030414581, -0.08781184256076813, -0.10857276618480682, -0.08735749870538712, 0.3370644152164459, -0.5668527483940125, -0.5130861401557922, -0.29495352506637573, -0.20172254741191864, -0.0801323875784874, 0.0412407107...
I tried strftime( ) to get a formatted time-stamp. ``` char ft[ 256 ]; struct tm *tmp; strftime( ft, 256, "%D - %T", tmp ); ``` My problem is that I get "13/02/60 - 03:07:-17958194" as a result. Is there a way to display the seconds properly? (I'm using Mac OS X and gcc) You're using an uninitialized value in the c...
[ 0.15864528715610504, -0.2186795324087143, 0.43911463022232056, -0.12343288213014603, 0.06363533437252045, 0.032230060547590256, 0.5768423080444336, -0.06764817237854004, -0.4233947992324829, -0.6863647699356079, -0.1544528305530548, 0.5548869371414185, -0.4798673093318939, -0.0560899525880...
256, "%D - %T %s", tmp); printf("%s\n", ft); return(0); } ``` Then, compile and run the example: ``` cc -o time_ex time_ex.c ./time_ex 02/26/09 - 11:26:34 1235665594 ``` **ETA:** Drop the %s if you just want the local time without UNIX time after it, of course.
[ 0.03091491386294365, 0.22602899372577667, 0.46065306663513184, -0.38061586022377014, 0.4026888608932495, 0.1282728910446167, 0.21033896505832672, -0.015159716829657555, -0.30438053607940674, -0.6335397958755493, -0.2945984899997711, 0.5244386792182922, -0.3494042158126831, 0.08375031501054...
We have a very strange error occurring at a developer site which we are unable to replicate ourselves. A developer in Poland has recently upgraded his Windows XP Service Pack 3 machine to 4Gb of Ram When he did so he started experiencing graphical errors in java programs using IBM JDK 1.5 This errors only occur in IBM...
[ 0.25858086347579956, 0.1931520402431488, 0.19727005064487457, -0.02721884287893772, 0.11001814901828766, 0.2975353002548218, 0.5054749846458435, -0.052602097392082214, -0.22794567048549652, -0.9739965200424194, 0.09509124606847763, 0.4888405203819275, -0.4175181984901428, -0.01307037845253...
args[]) { JFrame frame = new JFrame("GraphicTest"); frame.getContentPane().setLayout(new FlowLayout()); frame.setSize(200, 200); JButton button = new JButton("Test button"); button.setVisible(true); frame.getContentPane().add(button); frame.setVisible(true); ...
[ 0.12559251487255096, -0.012762267142534256, 1.1402523517608643, -0.3380036950111389, 0.17511716485023499, 0.15870016813278198, 0.5792181491851807, -0.6175580024719238, -0.13124139606952667, -0.8092320561408997, -0.3815353810787201, 0.7669305801391602, -0.4276558756828308, 0.038379985839128...
version to 4Gb of Ram. Has anyone else ever seen an issue like this? Just to clarify this a bit, this issue only happens with IBM JDK 1.5 and only happens when we have 4Gb of Ram. It doesn't happen on any other version of the JDKs and if we reduce the amount of memory to 3 Gb the problem disappears. Try reducing the ...
[ -0.07822342962026596, 0.012781049124896526, 0.6175611615180969, -0.08054633438587189, -0.18675772845745087, 0.22141417860984802, 0.26943156123161316, -0.0748148262500763, -0.6372523307800293, -0.5595270395278931, -0.21567511558532715, 0.9272953867912292, -0.2596290111541748, -0.18293765187...
driver (or the RAM may even be faulty).
[ -0.05995728075504303, 0.3770211637020111, 0.272011399269104, 0.1342654526233673, -0.14490258693695068, 0.11022472381591797, 0.318611741065979, -0.184772789478302, -0.033394526690244675, -0.12509121000766754, -0.23806454241275787, 0.8691651821136475, 0.16825836896896362, -0.1600361168384552...
I have read quite a bit about the ReadOnly databases. Therefore I was wondering if there would be any benefit in having a readonly database, used heavily to read and query data, and a separate write database used for all the CRUD work when the write database doesn't utilize locking. There would probably be some benefi...
[ 0.6516154408454895, 0.25821658968925476, 0.34110763669013977, 0.06862558424472809, 0.05338286608457565, -0.35748210549354553, -0.05010955408215523, -0.37483739852905273, -0.04302505403757095, -0.5420600175857544, 0.1585896909236908, 0.7306291460990906, -0.04032653570175171, 0.4256255030632...
two databases works out really well, especially if the databases are on separate physical machines. **Edit:** As a real world example, years ago at a client of mine they were having a hard time getting usable adhoc reports out of their production database (SQL Server), running on very powerful machine that costs upwar...
[ 0.430612713098526, 0.12316899001598358, 0.041647572070360184, 0.3300510346889496, 0.23250354826450348, -0.12257187813520432, -0.04708061367273331, 0.21648402512073517, -0.1773642748594284, -0.5719925165176392, 0.40929704904556274, 0.6626933217048645, -0.2823576033115387, 0.0785043984651565...
of massive compaq quad processing server with gobs of ram and gobs of disk trying to serve the OLTP, batch processing and reporting needs of the unit. Needless to say the users were very happy, and despite initial resistance from the IT folks, in the end in freed up valuable cycles on the "production" machine and the...
[ -0.012865371070802212, 0.017932981252670288, 0.047206368297338486, 0.3830890655517578, -0.15352222323417664, 0.37528350949287415, 0.04837092384696007, -0.10376956313848495, -0.27935758233070374, -0.26570552587509155, -0.04124944284558296, 0.5120882391929626, -0.27604061365127563, 0.3853866...
I have DIV, and UL inside it, with position: absolute. By default left is 0px. I need to move UL to the left on the 100% of UL width. UL right corner would be where DIV left corner begins. You have mismatched parentheses on the line beginning with `backgroundr`. I think maybe you want this: ``` backgroundr = int(rando...
[ -0.2711936831474304, -0.06250571459531784, 0.7958887219429016, -0.502282977104187, -0.20655468106269836, 0.38892534375190735, -0.14223143458366394, 0.1570182591676712, -0.010058917105197906, -0.5951092839241028, 0.07048606127500534, 0.4035007357597351, -0.11894580721855164, 0.1067853420972...
I have this ``` <p> <cite>One</cite><cite>Two</cite> </p> ``` is there a way in css to say that the first cite is going to be bold and the second italics, **without editing the above code**? With CSS3, you should be able to accomplish this with the following style: ``` cite:nth-child(1) { font-weight: bold; } ...
[ 0.047187622636556625, 0.5127297639846802, 0.22622205317020416, -0.1476704329252243, -0.23294006288051605, 0.1992103010416031, -0.10547705739736557, -0.13623203337192535, -0.10993567109107971, -0.9618527293205261, -0.012447834946215153, 0.4233793020248413, -0.27532216906547546, 0.0146272229...
I'm trying to decide whether to use a custom ASP.Net Ajax Extender or jQuery to perform a simple web service call. The web service method accepts a customer ID and returns the customer name. I'm leaning towards jQuery because of it's simplicity. The only problem is that due to my company's IE7 Group Policy settings, th...
[ 0.11642588675022125, 0.053070489317178726, 0.15955127775669098, -0.2324376404285431, -0.21445110440254211, -0.299973726272583, 0.19403618574142456, 0.1539931297302246, -0.02604062482714653, -0.5491511821746826, -0.13300223648548126, 0.5583680868148804, -0.08626757562160492, 0.0157025288790...
does not cause this message to be displayed. I'm assuming the ASP.Net Ajax library has some javascript voodoo that suppresses it. So my questions is, **How do I suppress this message using javascript?** Here's my aspx markup: ``` <h1> Finder Test</h1> <div> <h2> Extender</h2> Customer ID: <asp...
[ 0.06419966369867325, 0.09444393217563629, 0.5297210812568665, -0.3223074972629547, -0.4368003010749817, -0.10101893544197083, 0.4459373652935028, -0.338739812374115, -0.31849405169487, -0.6870664358139038, -0.13023734092712402, 0.5409910082817078, -0.323508620262146, -0.019878918305039406,...
jQuery</h2> Customer ID: <input id="txtCustomerId2" type="text" maxlength="9" style="width: 4em;" value="0000" /> <span id="txtCustomerName2"></span> <script type="text/javascript"> $(document).ready(function() { $("#txtCustomerId2").change( function() ...
[ 0.10713021457195282, -0.28755760192871094, 0.8469462394714355, -0.20465773344039917, 0.07454828917980194, 0.11123833060264587, 0.014044839888811111, -0.25781652331352234, -0.09087206423282623, -0.5689534544944763, -0.37805330753326416, 0.6525481939315796, -0.21746276319026947, -0.025308066...
}).change(); }); function updateCustomerDescription(id, descriptionControlId) { // if we don't have a value, then don't bother calling the web service if (id == null || id.length == 0) {
[ 0.22586750984191895, -0.12898625433444977, 0.6135769486427307, -0.10174859315156937, 0.6155185103416443, -0.25154033303260803, 0.4683893322944641, -0.20189447700977325, 0.09573094546794891, -0.5387401580810547, -0.1771431863307953, 0.6761420965194702, -0.3652016222476959, 0.337716907262802...
$("#" + descriptionControlId).text(""); return; } jsonAjax("customer.asmx/Name", "{'id':'" + id + "'}", true, function(result) {
[ 0.21921001374721527, -0.12824469804763794, 0.46795302629470825, -0.25761085748672485, 0.4441211223602295, 0.1878298819065094, 0.3967026472091675, -0.16788817942142487, 0.23087263107299805, -0.06848429888486862, -0.41039595007896423, 0.8872988820075989, -0.2880219519138336, 0.33873900771141...
var name = result.d == null ? "" : result.d; $("#" + descriptionControlId).text(name); }, null); } function jsonAjax(url, data, async, onSuccess, onFailed) { $.ajax({
[ -0.0391131229698658, -0.2573723793029785, 0.20874032378196716, -0.11022136360406876, 0.1617896854877472, 0.019871758297085762, 0.376449853181839, 0.06051284819841385, 0.03493814915418625, -0.37250831723213196, -0.2631903290748596, 0.7540045976638794, -0.3758501410484314, 0.3043827712535858...
async: async, type: "POST", url: url, data: data, contentType: "application/json; charset=utf-8", dataType:
[ -0.24189932644367218, 0.009890557266771793, 0.4956331253051758, -0.15683601796627045, -0.1571744829416275, 0.26910731196403503, 0.1602800041437149, 0.385459840297699, -0.1806711107492447, -0.4345841407775879, -0.7585498690605164, 0.2583901286125183, -0.4413367807865143, 0.33357009291648865...
"json", success: onSuccess, error: onFailed }); } </script> </div> ``` [Update] I'm assuming that the ActiveX control referenced in the message is XMLHttpRequest. I'm also assuming that the internals of jQuery and ASP.Net Ajax both use it for IE7. [Update] Th...
[ -0.18054242432117462, -0.18446819484233856, 0.339687317609787, -0.14118817448616028, -0.22567710280418396, -0.2690503001213074, 0.1883329451084137, 0.20998863875865936, -0.13413427770137787, -0.6300917267799377, -0.4631223678588867, 0.4999205470085144, -0.29897570610046387, -0.283808916807...
XMLHttpRequest. ASP.Net Ajax (thanks @Jesse Dearing): ``` window.XMLHttpRequest = function window$XMLHttpRequest() { var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ]; for (var i = 0, l = progIDs.length; i < l; i++) { try { return new ActiveXObject(progIDs[i]); } catch (ex) { } } return nul...
[ -0.33180537819862366, -0.0852585956454277, 0.5991021394729614, 0.07589079439640045, -0.3189762234687805, 0.03797817602753639, 0.37242552638053894, -0.3734953999519348, -0.03237111121416092, -0.7794062495231628, -0.36002567410469055, 0.547368586063385, -0.37439846992492676, -0.1587897241115...
by overriding jQuery's xhr function as so: ``` function overrideJqueryXhr() { $.ajaxSetup({ xhr: function() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else
[ -0.007115490734577179, -0.19063547253608704, 0.34189921617507935, 0.04927179217338562, -0.12830382585525513, -0.30944305658340454, 0.28719186782836914, -0.19448691606521606, -0.0047402516938745975, -0.5269076824188232, -0.3277738392353058, 0.6172887086868286, -0.31618979573249817, 0.004881...
{ var progIDs = ['Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP']; for (var i = 0; i < progIDs.length; i++) { try
[ 0.03577857092022896, -0.46388310194015503, 0.6697670817375183, -0.1131584569811821, 0.3022874891757965, 0.4420478641986847, 0.41334643959999084, -0.585091769695282, -0.012675892561674118, -0.6135430335998535, -0.44228169322013855, 0.35080811381340027, -0.43509212136268616, -0.0866116881370...
{ var xmlHttp = new ActiveXObject(progIDs[i]); return xmlHttp; }
[ -0.19090761244297028, -0.4427281618118286, 0.43516114354133606, -0.2826642394065857, -0.07592584192752838, 0.18086394667625427, 0.21623672544956207, -0.18451400101184845, -0.1365128457546234, -0.6921087503433228, -0.5727498531341553, 0.3419491648674011, -0.8524689674377441, -0.079557828605...
catch (ex) { } } return null; } } }); } ``` This
[ 0.007828864268958569, -0.2248125672340393, 0.255007266998291, -0.25592949986457825, 0.2545619606971741, -0.3960646092891693, 0.34817612171173096, -0.13801847398281097, 0.011855640448629856, -0.21759319305419922, -0.41300612688064575, 0.46626994013786316, -0.5618126392364502, 0.246797218918...
function tells jQuery to create an instance of the XMLHttpRequest class for non-IE browsers, and then creates an ActiveX object the MS Ajax way for IE. It tries the latest version first, Msxml2.XMLHTTP.3.0, then Msxml2.XMLHTTP and finally Microsoft.XMLHTTP.
[ -0.2820783257484436, -0.31615006923675537, 0.7246371507644653, 0.020934348925948143, -0.29791122674942017, -0.07758639752864838, 0.20248627662658691, 0.05201458930969238, -0.05311894044280052, -0.7524383068084717, -0.11172761768102646, 0.36086317896842957, -0.47673678398132324, -0.16335625...
Say I have a string in php, that prints out to a text file like this: nÖ§9q1Fª£ How do I get the byte codes of this to my text file rather than the funky ascii characters? Use the ord function <http://ca.php.net/ord> eg. ``` <?php $var = "nÖ§9q1Fª£ˆæÓ§Œ_»—Ló]j"; for($i = 0; $i < strlen($var); $i++) { echo ord(...
[ 0.3746154308319092, 0.337834894657135, 0.4792502820491791, -0.35321420431137085, 0.09495197981595993, 0.04122483730316162, 0.24598458409309387, -0.19708874821662903, -0.17688488960266113, -0.18180301785469055, -0.08105576783418655, 0.48295193910598755, -0.4119376242160797, -0.2220087051391...
I've been reading up a bit on anti-aliasing and it seems to make sense, but there is one thing I'm not too sure of. How exactly do you find the maximum frequency of a signal (in the context of graphics). I realize there's more than one case so I assume there is more than one answer. But first let me state a simple alg...
[ 0.23907721042633057, -0.23016639053821564, 0.36545464396476746, 0.34251561760902405, -0.26375266909599304, 0.05180998891592026, -0.2564069330692291, -0.0021100605372339487, -0.32313665747642517, -0.7255575656890869, 0.27665331959724426, 0.4420165717601776, -0.26842987537384033, 0.022485509...
simply scan the entire pixel line (in the spatial domain) looking for a for the minimum oscillation and the inverse of that smallest oscillation would be the maximum frequency? Ex values {23,26,28,22,48,49,51,49} Frequency:Pertaining to Set {} (1/2) = .5 : {28,22} (1/4) = .25 : {22,48,49,51} So would .5 be the max...
[ 0.29403117299079895, -0.4561511278152466, 0.37287575006484985, 0.06116901710629463, -0.05584094673395157, 0.19704055786132812, 0.1425340324640274, -0.4364314079284668, -0.11098231375217438, -0.3554045259952545, 0.11364999413490295, 0.41307246685028076, -0.2285221666097641, 0.27893003821372...
point sampling while(2*maxFrequency > pointSamplingInterval) { pointSamplingInterval*=2 Redetermine maxFrequency from point sampling (with new interval) } ``` I know these algorithms are fraught with inefficiencies, so what are some of the preferred ways? (Not looking for something crazy-optimized, just fundamentall...
[ 0.10047736763954163, -0.34704747796058655, 0.1866060346364975, 0.26949772238731384, -0.0018321224488317966, -0.018146347254514694, -0.1645202338695526, -0.47895658016204834, -0.06953457742929459, -0.8417079448699951, 0.04617100581526756, 0.38594678044319153, -0.28199470043182373, -0.042742...
representation of the image in the "frequency domain". Instead of each individual number specifying each pixel, each number represents the amplitude of a particular frequency in the image as a whole. The tool which converts from the "spatial domain" to the "frequency domain" is the Fourier Transform. The output of the...
[ -0.013752137310802937, -0.4332325756549835, 0.895783007144928, 0.07143692672252655, -0.1554122418165207, 0.293304443359375, -0.2432909458875656, -0.3459147810935974, -0.20718424022197723, -0.7679609060287476, -0.050924405455589294, 0.7930692434310913, -0.1417466700077057, -0.14290487766265...
down until you hit your "minimum significant amplitude" threshold. You can code your own FFT, but it is much easier in practice to use a pre-packaged library such as [FFTW](http://en.wikipedia.org/wiki/FFTW)
[ 0.37514492869377136, -0.2533411979675293, 0.4919168949127197, -0.1042281836271286, 0.11354201287031174, -0.1233639344573021, 0.3014509081840515, -0.448621928691864, -0.35194045305252075, -0.644218921661377, -0.1504913717508316, 0.5498890280723572, 0.026586173102259636, -0.06729226559400558...
I spend a lot of my time in emacs, and for the most part it's wonderful. But one thing really drives me nuts when I'm deep in it, and that's control over which window various new buffers are opened in. When I do `find-file`, it always opens in the current window, and this is what I like. But tons of other modes like to...
[ 0.2081749439239502, 0.13183166086673737, 0.44813358783721924, 0.2954879701137543, 0.23216354846954346, -0.21766255795955658, 0.14128240942955017, 0.3515617251396179, -0.3153170049190521, -0.5671620965003967, -0.1252705603837967, 0.4190658926963806, 0.10973826050758362, 0.223169207572937, ...
`org-mode` commands do the same thing, closing windows I want to keep open, etc. I don't like having to redo my layout everytime I want to look at my `org` agenda or open a manpage. In short, is there anyway to globally control which windows are used for modes that want to open in a window other than the current one? ...
[ -0.11089958995580673, -0.4241723120212555, 0.6479400396347046, 0.09816650301218033, -0.31930920481681824, -0.10381463170051575, 0.17132984101772308, 0.08354219049215317, -0.3355155885219574, -0.5755532383918762, -0.23955777287483215, 0.5222541689872742, -0.24040140211582184, -0.13044208288...
I have a system tray icon that receives incoming phone calls. When a call comes in, I want to send the phone number into a web app that does stuff on that phone number. We can launch the web app with the phone number in a query string, but if I launch a new window for every call, it will junk up the user's computer wit...
[ 0.29446208477020264, 0.275102823972702, 0.2143324613571167, 0.22800138592720032, 0.11676525324583054, -0.14073699712753296, 0.15362200140953064, 0.004504394717514515, -0.2417801171541214, -0.5616196990013123, 0.06650791317224503, 0.6204355955123901, -0.23281125724315643, 0.2685571610927582...
the same IE browser window and just send the web app the new phone number every time a new call comes in. I'm envisioning somehow sending a Windows message, or somehow instructing the IE browser to run a certain javascript event with some data? I can see why doing the reverse (javascript out to Win32) would be a securi...
[ 0.4333003759384155, 0.08038279414176941, 0.3686164319515228, -0.049912985414266586, -0.19805116951465607, -0.3275889456272125, 0.31180712580680847, -0.17799194157123566, -0.2180211842060089, -0.8571991920471191, -0.13652652502059937, 0.6929754018783569, -0.42055150866508484, -0.02367737516...
launch a Win32 app from Javascript and pass data to the win32 app. Roughly, I need to do the opposite. I need to send data from a Win32 app into a running javascript program. Note also that I'm not asking how to launch one IE window with arguments to Javascript one time; I can easily do that with query strings. What I...
[ -0.041242994368076324, -0.15976591408252716, 0.2716531455516815, 0.06493588536977768, -0.2482169270515442, -0.003220926271751523, 0.04426410049200058, -0.07746674865484238, -0.1700611412525177, -0.7359648942947388, -0.29450541734695435, 0.37688273191452026, -0.3036433160305023, -0.19857265...
configuration.
[ 0.01796139031648636, -0.2174413949251175, 0.13285693526268005, 0.06777287274599075, 0.12860460579395294, 0.2579827308654785, -0.08474607765674591, -0.2764465808868408, -0.3099897503852844, -1.0126680135726929, -0.32227838039398193, 0.39024099707603455, -0.16699646413326263, -0.047357741743...
I have a folder in my Desktop. I want to copy it to my server in Terminal. I tried this unsuccessfully ``` [~/bin]# cp -r /Users/Sam/Desktop/tig-0.14.1 ~/bin/ cp: cannot stat `/Users/Sam/Desktop/tig-0.14.1': No such file or directory ``` **[edit]** I run the command in my server. The problem seems to be in the fac...
[ 0.04242217168211937, 0.27681100368499756, 0.5683255195617676, -0.12910299003124237, 0.1645878553390503, 0.01698373630642891, 0.20770734548568726, 0.21618588268756866, -0.4073689877986908, -1.0564440488815308, -0.07857964187860489, 0.5070974826812744, -0.22169196605682373, 0.246098801493644...
shortname on your local mac. A.B.C.D is the IP address of your local mac as seen by the server. You will be prompted for your password. Or if you wanted to push from your local client: ``` scp -r ~/Desktop/tig-0.14.1/ serveruser@W.X.Y.Z:~/bin/ ``` serveruser is the user on the server whose ~/bin you want to copy in...
[ 0.07583251595497131, -0.10726010054349899, 0.5471419095993042, -0.21247869729995728, -0.14748941361904144, -0.05134817957878113, 0.10597983002662659, 0.2739177942276001, -0.37278786301612854, -0.7625802755355835, -0.2759339511394501, 0.04462463781237602, -0.2532508671283722, 0.543379664421...
For *ad hoc* Rails tasks we have a few implementation alternatives, chief among which would seem to be: ``` script/runner some_useful_thing ``` and: ``` rake some:other_useful_thing ``` Which option should I prefer? If there's a clear favourite then when, if ever, should I consider using the other? If never, then...
[ 0.18791665136814117, -0.18894878029823303, -0.042597971856594086, 0.09028364717960358, -0.16904643177986145, 0.0722421184182167, 0.20543797314167023, -0.17050020396709442, -0.02055973745882511, -0.7290018796920776, 0.13620786368846893, 0.6689932942390442, -0.11509954929351807, -0.274041801...