text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Following the [NerdDinners](http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx) example, I am interested in creating a strongly typed Master Page. In order to achieve this, I use a base controller which retrieves the data for the master page. All other controllers inherit this class....
[ -0.24908417463302612, -0.06303867697715759, 0.5302367806434631, 0.10489632189273834, -0.07271415740251541, 0.24460092186927795, -0.08152773231267929, -0.22696414589881897, -0.2527373731136322, -0.6573180556297302, -0.19660688936710358, 0.3401540517807007, -0.16023440659046173, 0.1547157913...
are determined in an XML file, hence the `Buttons` class that I am populating. **MasterPage ViewModel Code Snippet** ``` using System.Collections.Generic; namespace Site1.Models { public class MasterViewModel { public List<Button> Buttons{set; get;} } } ``` **View `ViewModel`** ``` namespace ...
[ 0.08460351824760437, -0.35841044783592224, 0.829102635383606, 0.06718213111162186, -0.08430556207895279, 0.26664701104164124, -0.20217569172382355, -0.13869734108448029, -0.4483192563056946, -0.8733803629875183, -0.07561130076646805, 0.34146177768707275, -0.13254421949386597, 0.14647938311...
protected MasterViewModel model = new MasterViewModel(); public BaseController() { model.Buttons = new List<Button>(); //populate the button classes (doesn't matter how) PopulateButtons(model.Buttons); } } } ``` **View's controller:** ``` using System...
[ -0.03261851891875267, -0.48670682311058044, 0.8329140543937683, -0.026095690205693245, 0.16992869973182678, 0.056713368743658066, 0.1287446767091751, -0.337733656167984, -0.4236925542354584, -0.5949432849884033, -0.3093797564506531, 0.7695993781089783, -0.4940393269062042, 0.33668819069862...
public ActionResult Index() { Models.View1ViewModel viewModel = new Models.View1ViewModel(); SomeDataClass viewData = new SomeDataClass() //populate data class (doesn't matter how) PopulateDataClass(viewData); viewModel.SomeData = viewData;
[ -0.2765648066997528, -0.697079598903656, 0.5902406573295593, 0.049428824335336685, 0.04968298599123955, 0.27505970001220703, 0.28605979681015015, -0.29415497183799744, -0.38886332511901855, -0.5227506756782532, -0.28904736042022705, 0.5457277894020081, -0.4947044551372528, -0.1472594290971...
//I WANT TO ELIMINATE THE FOLLOWING LINE! viewModel.Buttons = model.Buttons; return View("Index", viewModel); } } } ``` The master page inherits `System.Web.Mvc.ViewMasterPage<Site1.Models.MasterViewModel>`. The view inherits `System.Web.Mvc.ViewMasterPage<Site1.Models.View1ViewMo...
[ 0.004262232221662998, -0.5090448260307312, 0.37894079089164734, -0.21718671917915344, 0.01753348298370838, 0.06831809878349304, 0.23836317658424377, -0.4949495196342468, -0.28726333379745483, -0.7317478060722351, -0.06047416478395462, 0.49783065915107727, -0.5932786464691162, 0.32454994320...
automatically. The action filter attribute gets the controller's `ViewModel`, and passes it to the controller's `SetModel` function: ``` using System.Web.Mvc; using Site1.Controllers; namespace Site1.Models { public class MasterAttribute : ActionFilterAttribute { public override void OnActionExecuted...
[ -0.2958452105522156, -0.80764240026474, 0.6553369760513306, -0.20649059116840363, -0.04494824633002281, 0.19284376502037048, 0.22104208171367645, -0.5976330637931824, -0.36450716853141785, -0.5589482188224792, -0.5004127621650696, 0.473205029964447, -0.5632995963096619, -0.0110321817919611...
controller.SetModel(viewModel); } } } ``` **This function is added to the `BaseController`:** ``` public void SetModel(MasterViewModel childViewModel) { childViewModel.Buttons = model.Buttons; } ```
[ -0.1632189005613327, -0.619218647480011, 0.6414781808853149, 0.27796420454978943, 0.3186075687408447, 0.12494810670614243, -0.16953931748867035, 0.04850465804338455, -0.3732454478740692, -0.7803152799606323, -0.0821642205119133, 0.4988451302051544, -0.43093517422676086, 0.31866005063056946...
let me explain my current situation i have a SharePoint site lets say it is MAIN, and a subsite lets call it SUBMAIN in MAIN i have a list called "a" and in subMAIN i have a list called "b" both lists have the exact same columns, i need to show the content of both lists (ordered by modified date for example) in o...
[ 0.18465586006641388, 0.018105169758200645, 0.4574698209762573, 0.08735160529613495, 0.01877651922404766, -0.07777077704668045, 0.5334006547927856, -0.040197644382715225, -0.4065982401371002, -0.4848538637161255, 0.26256266236305237, 0.20676204562187195, -0.3139554560184479, 0.4702889919281...
and added to it horizontal merquee) so it will be nice if somehow i can add contents of list"b" also to the same content query webpart (but if it is not possible in content query webpart its ok, at least let me know what other options do i have) your help is appreciated If you are using SharePoint Designer to do this,...
[ 0.43203282356262207, -0.3414793014526367, 0.4611968994140625, 0.31984272599220276, -0.3082010746002197, 0.0778895914554596, 0.019239412620663643, -0.13912300765514374, -0.4486195147037506, -0.5399165749549866, 0.415216863155365, 0.5731765627861023, -0.003710519289597869, -0.073604889214038...
you can look [here](http://msdn.microsoft.com/en-us/library/ms456030.aspx) for the MSDN overview.
[ -0.03160608559846878, -0.16974501311779022, -0.20541532337665558, 0.28806042671203613, 0.17153242230415344, -0.48496219515800476, 0.22108902037143707, 0.6142549514770508, -0.5911372303962708, -0.8132081627845764, -0.37657231092453003, 0.27294421195983887, 0.09913051873445511, 0.07091586291...
can anyone help me in trying to check whether JavaScript is enabled in client browser using Java code. Assuming you're writing a Java web application, one technique that I've used successfully is to have the first page that's accessed—typically a login form—write a session cookie when the page loads. Then have the Java...
[ 0.4206508696079254, 0.08609908074140549, 0.4354146718978882, 0.017546767368912697, 0.2274811714887619, -0.3068076968193054, 0.33321303129196167, 0.09690623730421066, -0.1720678061246872, -0.8827909827232361, -0.16823981702327728, 0.3685097098350525, -0.018182244151830673, 0.190229877829551...
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } var cookie = name + "=" + value + expires + "; path=" + "/"; document.cookie = cookie; } createCookie("JavaScriptEnabledCheck", 1, 0); </script> ``` On the server: ``` /** * Returns <cod...
[ 0.13028676807880402, -0.3255362808704376, 0.6434966921806335, -0.19700321555137634, 0.15170907974243164, -0.21191847324371338, 0.3907618522644043, -0.41024839878082275, -0.3413824141025543, -0.8300812244415283, -0.5792977809906006, 0.3012408912181854, -0.4191007912158966, 0.147602796554565...
boolean isJavaScriptDisabled = true; Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; i < cookies.length; i++) { if ("JavaScriptEnabledCheck".equalsIgnoreCase(cookies[i].getName())) { isJavaScriptDisabled = false; break; } } } retu...
[ -0.15682241320610046, -0.09721176326274872, 0.3130047023296356, -0.4174307882785797, 0.13493970036506653, -0.1443651020526886, 0.9676692485809326, -0.4985058307647705, -0.04740097373723984, -0.490527868270874, -0.32490256428718567, 0.5520421266555786, -0.3835284411907196, 0.115417882800102...
I am trying to delete files in my `$(TargetDir)` within visual studio before building a project. How do you have to format command line to get around this problem I am getting below? ![alt text](https://farm4.static.flickr.com/3575/3459516474_65f59767d4_o.png) Try ``` cd $(TargetDir) del *.tif ``` As jvenema pointe...
[ 0.493893027305603, 0.04947046563029289, 0.19992974400520325, -0.30150923132896423, -0.1087314635515213, -0.20633763074874878, 0.2331877499818802, -0.05281009152531624, -0.2425772100687027, -0.8777710199356079, 0.0972878485918045, 0.7182711362838745, -0.20233573019504547, 0.2131651043891906...
We are currently transferring our websites from Windows 2003 (32-bit) to Windows 2008 (64-bit) and have hit a problem. One of our website use the payment gateway HSBC CPI which requires a DLL to be registered(regsvr32.exe), this DLL is then used inside a classic asp website. The problem is the DLL is a 32-bit DLL and ...
[ 0.2776218354701996, 0.0932578444480896, 0.6410501003265381, 0.31555575132369995, -0.35607191920280457, -0.29179543256759644, 0.12739449739456177, 0.15022587776184082, -0.2981704771518707, -0.5168250799179077, 0.2794937789440155, 0.28900817036628723, -0.003166497452184558, 0.295915156602859...
can register the DLL with regsvr32.exe from the C:\Windows\SysWOW64 folder. However since you can't mix 64/32bit code you'd have to create a C# service running in x86 (see the project properties, platform target) that you can then use from your x64 web app via WCF. An easier option would be to ask HSBC for a x64 dll.
[ 0.339616060256958, -0.2266591340303421, 0.32226434350013733, 0.268573135137558, -0.07655880600214005, -0.36220863461494446, -0.01639668457210064, 0.058426566421985626, -0.3782069683074951, -0.7384365200996399, -0.2673112750053406, 0.45643579959869385, -0.26726603507995605, 0.24752454459667...
I am running an executable in a batch file with two parameters; `cmd /k ""executable" "param1" "param2""` This returns a string that I want to launch. I can't figure out how to set this return in a variable and subsequently launch it in IE. Any ideas? You can use the following syntax to capture the output of your ex...
[ 0.3486349582672119, 0.16955262422561646, 0.5228974223136902, -0.1484431028366089, -0.05608941614627838, 0.0042842961847782135, 0.29520276188850403, -0.12411332130432129, -0.015559861436486244, -0.5998924374580383, -0.3940899074077606, 0.32367298007011414, -0.28072208166122437, 0.0104041285...
in a batch file directly, or the source to the executable has been lost. If not I personally would prefer to have the logic visible in the batch file itself.
[ 0.44736945629119873, 0.20545175671577454, -0.019059771671891212, 0.12467248737812042, 0.1695251613855362, 0.010433493182063103, -0.1567859649658203, 0.3485645651817322, -0.0972735658288002, -0.3571225106716156, -0.3001002371311188, 0.5444366335868835, 0.11071570217609406, 0.197898358106613...
I’m aware of the tutorial at boost.org addressing this: [Boost.org Signals Tutorial](http://www.boost.org/doc/libs/1_38_0/doc/html/signals/tutorial.html), but the examples are not complete and somewhat over simplified. The examples there don’t show the include files and some sections of the code are a little vague. *...
[ 0.5149741172790527, -0.05153380334377289, 0.09826213866472244, 0.07033804804086685, -0.3390543758869171, -0.1635880470275879, 0.15736328065395355, -0.31161248683929443, -0.35555294156074524, -0.30993857979774475, 0.15119823813438416, 0.3813503086566925, -0.471125066280365, -0.1434415727853...
order, who calls who, etc). The code below is a minimal working example of what you requested. `ClassA` emits two signals; `SigA` sends (and accepts) no parameters, `SigB` sends an `int`. `ClassB` has two functions which will output to `cout` when each function is called. In the example there is one instance of `ClassA...
[ -0.10366959869861603, -0.1847383826971054, 0.2266656905412674, -0.22891508042812347, -0.1742069572210312, 0.2894252836704254, 0.04550575837492943, -0.43792253732681274, -0.12447478622198105, -0.4213871955871582, -0.13752762973308563, 0.4584476351737976, -0.47168853878974915, -0.03245213627...
SigA; signal<void (int)> SigB; }; struct ClassB { void PrintFoo() { cout << "Foo" << endl; } void PrintInt(int i) { cout << "Bar: " << i << endl; } }; int main() { ClassA a; ClassB b, b2; a.SigA.connect(bind(&ClassB::PrintFoo, &b)); a.SigB.connect(bind(&ClassB::PrintInt, &b, _1)); ...
[ 0.010446312837302685, -0.031062839552760124, 0.5136104226112366, -0.5425695776939392, -0.0480545237660408, 0.6090229153633118, 0.1625332534313202, -0.3960895836353302, -0.2096760869026184, -0.45552128553390503, -0.03826453909277916, 0.3655073046684265, -0.6257179379463196, 0.26992392539978...
access control is lax and you'd normally 'hide' your signal registration behind a function like in KeithB's example). It seems that most of the difficulty in `boost::signal` is in getting used to using `boost::bind`. It *is* a bit mind-bending at first! For a trickier example you could also use `bind` to hook up `Cla...
[ -0.36420610547065735, -0.2763849198818207, 0.453901082277298, 0.09495945274829865, 0.0970851331949234, -0.36631378531455994, 0.40537118911743164, -0.19456341862678528, -0.06094798445701599, -0.4472697079181671, -0.19226369261741638, 0.46930429339408875, -0.23772287368774414, -0.00796289369...
The last sentence in the [article](http://linuxhelp.blogspot.com/2006/04/steps-to-compile-c-c-programs-using.html) caught my eye > [F]or C/C++ developers and > students interested in learning to > program in C/C++ rather than users of > Linux. This is because the compiling > of source code is made simple in > GNU...
[ 0.6778983473777771, 0.1087837964296341, 0.03801532834768295, -0.38001468777656555, -0.039269182831048965, -0.3025791645050049, 0.13076063990592957, -0.11626305431127548, -0.12229227274656296, -0.5786864161491394, -0.14824660122394562, 0.4816126823425293, -0.18419793248176575, 0.39649036526...
and gcc?** Well ... gcc is a compiler, make is a tool to help build programs. The difference is huge. You can never build a program purely using make; it's not a compiler. What make does it introduce a separate file of "rules", that describes how to go from source code to finished program. It then interprets this file,...
[ 0.7560000419616699, 0.2094309777021408, -0.0882510244846344, 0.1949918419122696, -0.2789292335510254, -0.5041200518608093, -0.29658183455467224, -0.19128508865833282, -0.26302382349967957, -0.14890986680984497, -0.027399923652410507, 0.3798427879810333, -0.2773612439632416, 0.3233101665973...
I am passing an object from one asp.net page to another. I'm encoding the object as a Base64 string and passing it as a POST parameter. However, when the receiving page reads the POST value, if there is a + sign in the Base64 string, it is being replaced with a line break. For example: ``` ...AABDEDS+DFEAED... ``` ...
[ 0.26476386189460754, 0.045434653759002686, 0.5448976755142212, -0.30263930559158325, -0.4389660358428955, 0.17184346914291382, 0.3937939703464508, -0.3005402684211731, 0.06692425906658173, -0.8330393433570862, -0.10189315676689148, 0.0162267554551363, -0.2456885725259781, 0.254317700862884...
that had no effect, so it seems to be an issue on the receiving end. Any ideas? Use [UrlEncode](http://msdn.microsoft.com/en-us/library/zttxte6w.aspx). The + is a reserved character and needs to be encoded.
[ 0.26935359835624695, -0.18869717419147491, 0.4462605118751526, 0.017318325117230415, -0.09105625748634338, 0.03509492427110672, 0.16137394309043884, 0.14302675426006317, 0.12113703042268753, -0.31660762429237366, -0.44495874643325806, -0.04276389628648758, -0.24795997142791748, 0.240473613...
Given Java's "write once, run anywhere" paradigm and the fact that the Java tutorials give explicit bit sizes for all the primitive data types without the slightest hint that this is dependent on anything, I would say that, yes, an `int` is always 32 bit. But are there any caveats? The [language spec](http://java.sun....
[ 0.2612118721008301, 0.09553038328886032, -0.009490210562944412, -0.20773601531982422, -0.0876830518245697, -0.13039733469486237, 0.48654705286026, -0.04550851136445999, -0.19738052785396576, -0.4633568823337555, 0.024165812879800797, 0.5396338701248169, -0.20285622775554657, -0.26864165067...
good in-depth resources for this type of question? Java code always works as though ints are 32-bit, regardless of the native architecture. In the specification, there's also [a part](http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#85587) that is definitive about representation: > The integral ...
[ -0.03145887702703476, -0.02152545563876629, 0.36773747205734253, -0.012637777253985405, -0.08255717903375626, 0.242534339427948, -0.15790602564811707, -0.4404714107513428, -0.283621609210968, -0.15129174292087555, -0.1565190553665161, 0.5061153769493103, -0.19783304631710052, -0.2028269618...
I have a javascript function that calls a generic function to make an ajax call to the server. I need to retrieve a result (true/false) from the callback function of the ajax call, but the result I get is always 'undefined'. A super-simplified version of the generic function without all my logic would be: ``` functi...
[ 0.05579578876495361, -0.02251487597823143, 0.3337293267250061, 0.07789492607116699, -0.14430789649486542, -0.06283090263605118, 0.2752223014831543, -0.11504976451396942, 0.07570651173591614, -0.4369444251060486, 0.08811655640602112, 0.5575529336929321, -0.23529228568077087, 0.3134030401706...
success: function(result) { if (someLogic) return true; else return false;
[ 0.09943972527980804, -0.26009291410446167, 0.6523950695991516, -0.0009268094436265528, 0.053315065801143646, 0.03636040538549423, 0.7530543208122253, -0.2159254252910614, 0.16783234477043152, -0.09034809470176697, -0.3827333450317383, 0.6679513454437256, -0.08209480345249176, -0.0914536789...
}, error: function(errorThrown) { return false; } }); } ``` And the function calling it would be something like: ``` function Next() { var result = CallServer("/Signum/TrySave"); if (result == true) {
[ -0.14917409420013428, -0.2641087770462036, 0.4269636869430542, -0.36158764362335205, 0.2649246156215668, -0.012228534556925297, 0.37114155292510986, -0.450446754693985, 0.1677986979484558, -0.35016223788261414, -0.31416329741477966, 0.5563856363296509, -0.2928317189216614, 0.12489006668329...
document.forms[0].submit(); } } ``` The "result" variable is always 'undefined', and debugging it I can see that the "return true" line of the callback function is being executed. Any ideas of why this is happening? How could I *bubble* the return value from the callback function to the CallServer funct...
[ 0.16616782546043396, 0.09330961108207703, 0.6841437816619873, -0.22513195872306824, -0.0001600960677023977, -0.20504683256149292, 0.4351853132247925, -0.2808908522129059, 0.08605119585990906, -0.5021539330482483, -0.20249854028224945, 0.8527504205703735, -0.11002744734287262, 0.27197721600...
$.ajax({ type: "POST", url: urlController, async: false, data: $("form").serialize(), success: function(result) { if (someLogic){ returnValue = true;
[ 0.22624088823795319, -0.40477776527404785, 0.49083027243614197, 0.092977374792099, 0.12723664939403534, -0.3051881790161133, 0.5910527110099792, -0.03346165642142296, 0.160890132188797, -0.3599887490272522, -0.08804759383201599, 0.7870913743972778, -0.08846602588891983, -0.0735442936420440...
return; } }, error: function(errorThrown) { alert("Error occured: " + errorThrown); }
[ -0.3845774233341217, -0.23107439279556274, 0.12111076712608337, -0.31557223200798035, 0.25782325863838196, 0.2605665326118469, 0.42722225189208984, -0.0348794050514698, 0.04083385318517685, -0.23047605156898499, -0.3030852973461151, 0.8897457122802734, -0.33491384983062744, 0.0150651829317...
}); return returnValue; } ```
[ -0.4160114824771881, -0.058535076677799225, 0.3326094448566437, -0.42680075764656067, 0.29152238368988037, -0.11090255528688431, 0.5686802268028259, -0.15901318192481995, 0.21922855079174042, -0.5267183780670166, -0.575602114200592, 0.9978449940681458, -0.3691018521785736, 0.30996936559677...
How can I set an environment variable in WSH jscript file that calls another program? Here's the reduced test case: ``` envtest.js ---------- var oShell = WScript.CreateObject("WScript.Shell"); var oSysEnv = oShell.Environment("SYSTEM"); oSysEnv("TEST_ENV_VAR") = "TEST_VALUE"; oExec = oShell.Run("envtest.bat", 1, true...
[ 0.28661808371543884, 0.18314185738563538, 0.07314389944076538, 0.1132013127207756, 0.30289408564567566, 0.09960717707872391, 0.4409746825695038, -0.35643428564071655, -0.034748274832963943, -0.7695506811141968, -0.12983296811580658, 0.5775553584098816, -0.2172023057937622, 0.02801188267767...
the same set of variables. Your code-sample works good. It adds the variable to the SYSTEM environment. So, you need to set the variable not only for your system but also for your process. Here's the code. ``` var oShell = WScript.CreateObject("WScript.Shell"); var oSysEnv = oShell.Environment("SYSTEM"); oSysEnv("T...
[ 0.4585611820220947, 0.35031551122665405, 0.19771984219551086, -0.05120684951543808, 0.18747003376483917, 0.1193075031042099, 0.44951167702674866, -0.08448009192943573, 0.11378340423107147, -0.8594861030578613, -0.023384742438793182, 0.6144737601280212, -0.42504215240478516, 0.1085198670625...
Can anyone explain at a beginner-intermediate level the terminology of "bus", "transport" and "endpoint" in the context of an [enterprise service bus](http://en.wikipedia.org/wiki/Enterprise_service_bus)? I'm a C# developer with a few years experience now, but only just starting working with an ESB. It seems that the ...
[ 0.4235306978225708, 0.027562838047742844, 0.14703664183616638, -0.036291807889938354, -0.06557675451040268, -0.01738610491156578, 0.12305941432714462, 0.2616705596446991, -0.37463483214378357, -0.8912237882614136, 0.07594861835241318, 0.2570677399635315, -0.021545609459280968, 0.0733560547...
ESB architecture should not be considered as simple queue for message dispatching. To allow integration of different services, ESB provides much more. Important additional functionalities of ESB: * Routing. Messages can be routed to different services, depending on message content or endpoint specification. * Message...
[ -0.1986534595489502, -0.11446850001811981, 0.5478487014770508, 0.04319699853658676, -0.0704970583319664, -0.1991991549730301, 0.26440924406051636, -0.057691026479005814, -0.4677354395389557, -1.2261152267456055, -0.3925161063671112, 0.13745205104351044, -0.19914522767066956, 0.039950773119...
**endpoints** - uniform, unique "addresses". Messages dispatched between endpoints are using unified **transport** (method/protocol that encapsulates message's payload). Application that natively use different transport, need to connect to ESB via suitable adapter - service that will provide necessary transport convers...
[ 0.045182425528764725, -0.04163273051381111, 0.48939046263694763, 0.17847874760627747, -0.11417564749717712, -0.005273974034935236, 0.15727221965789795, 0.14555184543132782, -0.48969849944114685, -1.0806511640548706, -0.4380412697792053, -0.14442726969718933, -0.28942734003067017, 0.3155937...
If you are interested in standardized ESB, you can take a look at JBI (Java Bussiness Integration). There are several open-source implementations of JBI avalable, among them [Apache ServiceMix](http://servicemix.apache.org/), [Mule](http://www.mulesource.org/display/MULE/Home), [OpenESB](https://open-esb.dev.java.net/)...
[ 0.5491616129875183, -0.21228663623332977, 0.06371191889047623, -0.13064084947109222, -0.260495126247406, -0.05604410544037819, 0.2711033523082733, -0.29146164655685425, -0.1990751475095749, -0.6759966015815735, -0.15272367000579834, 0.35393157601356506, -0.39833948016166687, -0.09675516188...
I have been programming in .NET for four years (mostly C#) and I use IDiposable extensively, but I am yet to find a need for a finaliser. What are finalisers for? A finalizer is a last ditch attempt to ensure that something is cleaned up correctly, and is usually reserved for objects that wrap **unmanaged** resources, ...
[ -0.208639994263649, -0.07435094565153122, 0.011244871653616428, -0.12869574129581451, -0.3205760717391968, -0.10626187175512314, 0.42633914947509766, 0.01251540519297123, 0.04248207062482834, -0.6546685695648193, -0.05638420954346657, 0.34034642577171326, -0.06679928302764893, 0.0992784872...
not need a finalizer - but quite likely both `ClassA` and `ClassB` would implement `IDisposable`. For managed code, `IDisposable` is usually sufficient. Even if you don't clean up correctly, eventually the managed objects will get collected (assuming they are released).
[ 0.006065782159566879, -0.11748841404914856, -0.23417428135871887, 0.21924148499965668, 0.11440704017877579, -0.3225744664669037, 0.38058382272720337, 0.0025814413093030453, -0.18353019654750824, -0.5314326882362366, -0.7282850742340088, 0.41655516624450684, -0.27753275632858276, 0.11484771...
I have a web application which depends on the browser client retaining the [FQDN](http://en.wikipedia.org/wiki/FQDN) in order for it to work, but what is happening is that in multiple browsers I am seeing the url get converted into an ip address url (containing the correct IP address) which is getting changed by a redi...
[ 0.25667598843574524, 0.14070378243923187, 0.24259044229984283, 0.052318934351205826, 0.09933392703533173, 0.08851073682308197, 0.07945318520069122, -0.05120990052819252, -0.2701296806335449, -0.6836299300193787, -0.1437772959470749, 0.2942127585411072, -0.061812229454517365, 0.514492928981...
this issue to an incomplete implementation of the [HttpWorkerRequest](http://msdn.microsoft.com/en-us/library/system.web.httpworkerrequest(VS.71).aspx) abstract class of the .NET Framework as part of the Cassini implementation. The Cassini implementation failed to override the GetServerName and the base implementation ...
[ -0.2542765736579895, -0.24040699005126953, 0.19906562566757202, 0.2520124912261963, -0.0776330903172493, -0.13836738467216492, 0.4713309109210968, -0.18557091057300568, -0.09979801625013351, -0.5337796807289124, -0.442876398563385, 0.04750874266028404, -0.43797266483306885, 0.6426082849502...
I am currently using a javascript code to make an entire row in my table clickable. Once the row is clicked a function is ran, I am wondering what I can use to redirect to a PHP page and preferably send a post variable along with it. My guess is AJAX but I am not sure how or if it would work. > **Javascript** ``` fu...
[ 0.10737936943769455, 0.11300431191921234, 0.7593570947647095, -0.15298600494861603, -0.18349428474903107, -0.005616174545139074, 0.18726219236850739, 0.14242106676101685, -0.23919814825057983, -0.7829639911651611, 0.05806780233979225, 0.4747699797153473, -0.12955188751220703, 0.20561750233...
string... <tr onclick="DoNav('myphpscript.php**?key=value**');"> Or if you need a natural HTTP post, you can programmatically submit the form with Javascript... ``` onclick="document.forms[0].submit();" ```
[ 0.22924917936325073, -0.15006032586097717, 0.4573361277580261, 0.0692601278424263, -0.14743204414844513, -0.13818351924419403, 0.21917040646076202, -0.13218523561954498, 0.07672548294067383, -0.6858452558517456, -0.4528752863407135, 0.23220424354076385, -0.31834566593170166, -0.00203768792...
I have an application where I'll have repeating events. So an event can repeat by day, "every n days", by week, "every n weeks on Mon/Tue/Wed/etc", and by month, "every n months on the 1st,2nd,3rd,etc". What is the best way to handle this from a table design perspective? I can think of two ways but I'm not sure which ...
[ 0.19554315507411957, 0.10386087000370026, 0.4208380877971649, -0.0660184845328331, -0.2369004487991333, 0.5342356562614441, 0.5729033350944519, 0.07669619470834732, -0.7064244151115417, -0.42418673634529114, 0.19886404275894165, -0.010713382624089718, -0.40145161747932434, 0.47846683859825...
Have a second table, say events\_dateinfo or something, against which I'd JOIN for the query. Seems like option 2 is probably more 'normalized' and what not, but does it strike you as overkill for such a simple thing? Also, if I were to go option 2, is there a way to translate rows into columns - that is, select the 2...
[ -0.040707822889089584, -0.36169669032096863, 0.4021124839782715, 0.11822369694709778, -0.08198637515306473, 0.1173783391714096, -0.008627333678305149, 0.022271472960710526, -0.5337910652160645, -0.578787624835968, 0.12818148732185364, 0.37113848328590393, -0.30101361870765686, -0.075501114...
tables in this case; third one must be junction table. You can easily add new schedules if you need in the future with this scheme. So, something like this: ``` table events (event_id, event_name, description) table schedules (sch_id, schedule) table event_schedule (event_id, sch_id) ``` There isn't PIVOT possibili...
[ -0.29278281331062317, -0.007197869010269642, 0.366962730884552, 0.04051528126001358, -0.06668945401906967, 0.13963861763477325, -0.3909619450569153, -0.052277375012636185, -0.5198643803596497, -0.7476951479911804, 0.00853046216070652, 0.1278865784406662, -0.561935544013977, -0.039449445903...
es ON e.event_id = es.event_id JOIN schedules s ON s.sch_id = es. sch_id GROUP BY e.event_name; ```
[ 0.14720234274864197, -0.1906721591949463, 0.2906433343887329, 0.06355754286050797, 0.10034976154565811, 0.07144100964069366, -0.03190526366233826, -0.08613118529319763, -0.41412556171417236, -0.7151602506637573, -0.3933227062225342, 0.24574454128742218, -0.32351920008659363, 0.163831219077...
This is similar to (but different from) [this question](https://stackoverflow.com/questions/117293/use-of-const-for-function-parameters "tangent from this question"). Here is some simple test code to illustrate some weirdness I have discovered with Sun CC: ``` //---------------main.cpp #include "wtc.hpp" int main(in...
[ 0.32516494393348694, 0.008072933182120323, 0.5747623443603516, 0.28103360533714294, -0.06483723223209381, -0.3648401200771332, 0.5678941607475281, -0.3801056742668152, -0.20644275844097137, -0.41191160678863525, -0.12393371015787125, 0.29070156812667847, -0.14508768916130066, 0.08615958690...
would expect when run. You can also add a ++a; in testy::lame() and the compiler will complain about changing a read-only variable (as it should). However when I compile using CC, I get the following linker error: ``` CC -g -c -o main.o main.cpp CC -g -c -o wtc.o wtc.cpp CC -g -o all main.o wtc.o Undefined ...
[ 0.13188254833221436, 0.22134900093078613, 0.36370089650154114, -0.10622652620077133, -0.022048601880669594, -0.09875985980033875, 0.26390162110328674, -0.04879916086792946, -0.28725820779800415, -0.184557244181633, -0.10635211318731308, 0.37207239866256714, -0.3678016662597656, 0.214157864...
in file void testy::lame(int) main.o ld: fatal: Symbol referencing errors. No output written to all make: *** [all] Error 1 ``` checking the object code with nm and C++filt, I find that the g++ version creates a testy::lame(int) symbol, whereas CC creates testy::lame(const int) , hence the linker error...
[ 0.4693000316619873, 0.2160513997077942, -0.12262965738773346, 0.08492646366357803, -0.1869407296180725, -0.19499191641807556, 0.43722546100616455, -0.19794419407844543, -0.2871878743171692, -0.5583097338676453, -0.1404000222682953, 0.4802810847759247, -0.6156124472618103, 0.031858742237091...
like a compiler problem in `CC`. The C++ standard says (in 13.1 Overloadable declarations): > Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent. That is, the const and volatile type-specifiers for each parameter type are ignored when determining which function i...
[ 0.03738420829176903, 0.1831417828798294, -0.01885143853724003, 0.0025329820346087217, -0.11942987889051437, -0.2295459508895874, -0.10753078758716583, -0.16069307923316956, -0.10434716939926147, -0.3953422009944916, -0.1883125603199005, 0.5681030750274658, -0.4313766360282898, 0.1778017282...
and can be used to distinguish overloaded function declarations.
[ 0.04026727378368378, -0.0007590622408315539, -0.206501767039299, 0.047361232340335846, -0.12641581892967224, -0.2019466757774353, -0.09507844597101212, -0.12342040985822678, -0.05762731283903122, -0.10571059584617615, -0.6614736318588257, 0.5522623062133789, -0.10299324244260788, -0.076557...
I have a UserControl which I have added to my web.config ``` <add tagPrefix="BCF" src="~/controls/MyMessageBox.ascx" tagName="error"/> ``` and added to my master page ``` <BCF:error ID="BCError" runat="server" Visible="false" /> ``` Now I need to be able to reference this control AND its public properties from al...
[ 0.03933653607964516, 0.31183913350105286, 0.688219428062439, 0.20934127271175385, 0.08678226172924042, -0.15275980532169342, 0.18270468711853027, -0.28376343846321106, -0.12574166059494019, -0.6353553533554077, 0.012885620817542076, 0.2753015160560608, 0.08767494559288025, 0.22051972150802...
definition for 'ShowInfo' and no extension method 'ShowInfo'** Can you please point me in the right direction! This is the code for the user control... I can use the properties in the masterpage code behind (And in a page if I put the control directly into it) but cannot use them in the child page code behind?? It do...
[ 0.0686657503247261, -0.09619636833667755, 0.7708047032356262, 0.081803098320961, 0.19304199516773224, -0.3123970329761505, -0.014880772680044174, -0.14902347326278687, -0.2225724458694458, -0.7777388095855713, -0.3568345606327057, 0.10328099131584167, -0.3697828948497772, 0.356135994195938...
{ get; set; } #endregion #region Load protected void Page_Load(object sender, EventArgs e) { if (ShowCloseButton) CloseButton.Attributes.Add("onclick", "document.getElementById('" + MessageBox.ClientID + "').style.display = 'none'"); } #endregion #region Wrapper method...
[ 0.19900335371494293, -0.281320184469223, 0.8920968770980835, -0.3162413537502289, -0.06686773896217346, -0.186857208609581, 0.4068281948566437, -0.174764946103096, -0.04806017875671387, -0.6245085597038269, -0.45086026191711426, 0.1547725796699524, -0.3086583912372589, 0.262902170419693, ...
{ Show(MessageType.Info, message); } public void ShowSuccess(string message) { Show(MessageType.Success, message); } public void ShowWarning(string message) { Show(MessageType.Warning, message); } #endregion #region Show control public void Show(Messag...
[ 0.26878634095191956, -0.34861519932746887, 0.586642324924469, -0.5214874148368835, -0.24578845500946045, -0.1624687761068344, 0.48586323857307434, -0.20575451850891113, 0.10940995067358017, -0.6123228073120117, -0.4032324254512787, 0.013933273032307625, -0.5606568455696106, 0.2015112638473...
litMessage.Text = message; MessageBox.CssClass = messageType.ToString().ToLower(); this.Visible = true; } #endregion #region Enum public enum MessageType { Error = 1, Info = 2, Success = 3, Warning = 4 }
[ -0.2728535532951355, -0.5620918869972229, 0.8793379068374634, -0.16504739224910736, 0.2804676592350006, -0.2188877910375595, 0.632335364818573, -0.049776241183280945, -0.1367487609386444, -0.8251389861106873, -0.4570937156677246, 0.18642322719097137, -0.3080713748931885, 0.2318288683891296...
#endregion } ``` You have a couple of things you need to/may want to keep track of here: • Current scroll position • Position of the tapped element (I assume a textbox) when they tapped it Note that the EnabledChanged event for the InputPanel is pretty easy to deal with (I assume you've already done it): chec...
[ -0.08615319430828094, -0.015944333747029305, 0.6986782550811768, -0.0869850441813469, 0.03598504140973091, -0.25902509689331055, 0.20591261982917786, 0.24710172414779663, -0.03402450680732727, -0.8800330758094788, -0.056731224060058594, 0.6310400366783142, -0.12463537603616714, -0.31417268...
will be moved off-screen when the tabcontrol resizes. I believe (not 100% certain) that resizing a tabcontrol will keep the top of the tabcontrol contents visible and you'll have to scroll down to see anything that is now "covered" by the InputPanel. What you'll want to do in the EnabledChanged event is find out ...
[ -0.061219632625579834, -0.26809170842170715, 0.937893271446228, 0.20339342951774597, 0.3960025906562805, -0.14829911291599274, 0.2364741563796997, -0.04637395590543747, -0.11644553393125534, -0.7168849110603333, -0.15337374806404114, 0.642094075679779, -0.12674085795879364, -0.317429840564...
see where I'm going with it: int yOffset = top y-coordinate of the tapped control; if ( yOffset > ClientSize.Height-inputPanel.Bounds.Height ) {    int yShift = amount to shift everything up;    Point scrollPosition = AutoScrollPosition;    scrollPosition.Y = scrollPosition.Y - yShift;    AutoScrol...
[ 0.11138727515935898, -0.18786758184432983, 0.8127249479293823, -0.20214533805847168, -0.0405881293118, 0.052074726670980453, -0.023813540115952492, -0.43393486738204956, -0.286635160446167, -0.47535234689712524, 0.08546218276023865, 0.5243406891822815, -0.02570919319987297, -0.293401926755...
.NET CF seems very forgiving about setting invalid scroll rules. If you can only scroll up 10 pixels and you tell it to scroll up 100, it will stop at 10. • Screen coordinate (0,0) is the top left of the visible screen - NOT the form being displayed. You can get tripped up if you assume that (0,0) is the top of your...
[ 0.19012251496315002, -0.20788787305355072, 0.8460044264793396, 0.2350616604089737, -0.07118717581033707, -0.6590716242790222, 0.3931806683540344, -0.08679834753274918, -0.05145558714866638, -0.8321167230606079, 0.00058283272664994, 0.006437832023948431, -0.10407298803329468, -0.11173250526...
I have a UIViewController with a UIWebView (webview1) in it. The webview is only a few lines of text but does have a link in it. Rather than open the link, which goes to an external website, in this tiny space, I'd like to send it on to webview2, which will be a full screen. The goal is to keep the web requests within ...
[ 0.3574490249156952, 0.07624037563800812, 0.7495396137237549, 0.055853601545095444, -0.23949414491653442, -0.13657361268997192, 0.06770073622465134, -0.2901402413845062, 0.015557795763015747, -1.02849280834198, 0.1006091758608818, 0.41631510853767395, -0.16842135787010193, 0.253654778003692...
which works fine: ``` - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ myapp *delegate = [[UIApplication sharedApplication] delegate]; Webview1Controller *webview1Controller = [[Webview1Controller alloc] initWithNibName:@"w...
[ 0.22357074916362762, 0.06872077286243439, 0.8179922699928284, -0.15031640231609344, -0.1591494083404541, 0.02779465913772583, 0.414467453956604, -0.6430144906044006, -0.2530372738838196, -0.8621232509613037, 0.017174720764160156, 0.718553364276886, -0.1792953908443451, 0.014937452971935272...
But is there a better way? Return `NO` from the delegate method. Regarding your comment, I think what you want to do is make your delegate method check which webview is calling your controller: ``` - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigat...
[ 0.07778269052505493, -0.34469103813171387, 0.8517312407493591, 0.34171581268310547, 0.07133253663778305, -0.0836387425661087, 0.278515100479126, -0.40583714842796326, -0.13476534187793732, -0.7014366388320923, 0.00008099451952148229, 0.5955389738082886, -0.27191075682640076, 0.188806638121...
else { return YES; } } ``` (Note, also, that UIViewController has a `navigationController` property so you can use that rather than getting it through your app delegate).
[ -0.1621101051568985, -0.10227491706609726, 0.4228176176548004, 0.20938658714294434, 0.2193308174610138, -0.21408674120903015, 0.41626349091529846, 0.2116813361644745, 0.057217542082071304, -0.9764145612716675, -0.3718474507331848, 0.7017126083374023, -0.1392444521188736, 0.1396489739418029...
Reading the online MSDN docs is a great way to learn more about .NET and other MS technologies. However sometimes I need to read it in an offline mode, like when using an eReader. Is there a tool, software or some code which can be used to download a section of the MSDN library and convert it to a pdf, by starting fr...
[ 0.5514756441116333, -0.043624427169561386, 0.1514439433813095, 0.49979034066200256, -0.1785469502210617, -0.4603351354598999, -0.12041324377059937, 0.5083330869674683, -0.08424752205610275, -0.714259922504425, -0.018747564405202866, 0.73307204246521, -0.08452291786670685, 0.050380349159240...
not be followed. They usually point to other subsections in the main section and they will get downloaded during the process. **Update:** App and code is available at <http://soofflinereader.codeplex.com/> I paid someone to create one for me.
[ 0.8628458976745605, 0.018726900219917297, 0.27429699897766113, 0.013311107642948627, 0.06186186522245407, -0.05490168556571007, 0.3188647925853729, 0.035798583179712296, -0.12106414884328842, -0.5179373025894165, -0.050523657351732254, 0.4282839298248291, -0.2182413935661316, -0.2054114639...
i have a xml like this I want to parse the xml, build a dynamic class with spscified properties. i found some pointers to do it with system.reflection.emit namespace, but i do i always have to create an assembly and module in order to define the type? can i just create a type and define the properties? ``` <Root> <t...
[ 0.15656231343746185, 0.13931749761104584, 0.20267072319984436, 0.024700962007045746, -0.2635813355445862, -0.07055498659610748, -0.07683020830154419, -0.4827675521373749, -0.060844697058200836, -0.7505871653556824, 0.07371774315834045, 0.28527408838272095, -0.13998177647590637, 0.330206722...
world</value> <datatype>string</datatype> </property> </properties> </type> </Root> ``` I paid someone to create one for me.
[ 0.4125403165817261, 0.1441980004310608, -0.06597922742366791, 0.09798174351453781, -0.18139001727104187, 0.33661413192749023, 0.28318455815315247, 0.2025468498468399, -0.26452407240867615, -0.5120147466659546, 0.2227334827184677, 0.28223541378974915, -0.46946457028388977, 0.533504724502563...
I have a bit of JavaScript in one of my pages that avoids the problem of users double-clicking buttons on a form and causing double submissions during asynchronous postbacks: `var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest);` ``` ...
[ 0.04149790480732918, 0.06459256261587143, 0.6252318024635315, -0.3102676570415497, -0.022268712520599365, 0.26146042346954346, 0.5298980474472046, -0.6708835363388062, -0.12644807994365692, -0.6783315539360046, -0.41420742869377136, 0.33343252539634705, -0.41857513785362244, 0.179001286625...
put a Button control inside, that works fine. Looking at the HTML that gets rendered for the DataGrid, I can see that ASP.NET isn't outputting an onclick for the ButtonColumn, where it does do so for a Button inside a TemplateColumn: **ButtonColumn:** ``` <input type="submit" name="ctl00$placeholderContent$dgComm...
[ 0.036316875368356705, -0.01754811592400074, 0.5682349801063538, 0.12243159115314484, 0.2321329414844513, -0.15960730612277985, 0.1444600522518158, -0.4764101207256317, -0.2668839395046234, -0.7180764675140381, -0.2648738920688629, 0.3688012957572937, -0.23769310116767883, 0.118323199450969...
Buttons in TemplateColumns. I'm curious if anyone knows *why* ASP.NET renders ButtonColumns this way though, and if there's some way to get it to render them the same as Buttons. MS has a standard implementation of bound fields, which does not set ID or attributes for ButtonColumn created buttons. To be a bit more sp...
[ -0.06717407703399658, -0.23373936116695404, 0.49774283170700073, -0.21284638345241547, 0.03445751965045929, 0.1967964768409729, -0.04649214819073677, -0.4666667878627777, -0.3614135980606079, -0.6765846610069275, -0.05912904813885689, 0.0801413431763649, -0.5847634673118591, 0.017055416479...
child = null; if (this.ButtonType == ButtonColumnType.LinkButton) ... else { child = new Button { Text = this.Text, CommandName = this.CommandName,
[ -0.34840261936187744, -0.2771327495574951, 0.4464917480945587, -0.21691477298736572, 0.5941535830497742, 0.8146013021469116, 0.022002194076776505, -0.21162989735603333, -0.1004064679145813, -0.725128710269928, -0.20190593600273132, 0.5282369256019592, -0.10845870524644852, 0.45899125933647...
CausesValidation = this.CausesValidation, ValidationGroup = this.ValidationGroup }; } ... cell.Controls.Add(child); } } ``` As you can see, that's all there is to a button. If you want it to have IDs and "onclick" attributes, you could use something like this: ...
[ -0.1735743284225464, -0.24909278750419617, 0.3999086022377014, -0.0965411439538002, 0.3842723071575165, 0.2460162490606308, -0.04384572058916092, -0.24188555777072906, -0.3928595781326294, -0.7971307635307312, 0.11644471436738968, 0.24766021966934204, -0.4239790439605713, 0.033734977245330...
if (e.Row.RowType == DataControlRowType.DataRow) { //assuming that a first cell is a ButtonField //note that in edit mode a button may be at some other index that 0 Button btn = e.Row.Cells[0].Controls[0] as Button; if (btn != null) { btn.OnClientClick = "return c...
[ 0.12621110677719116, -0.2786402404308319, 0.3857978880405426, -0.025872934609651566, 0.6976653933525085, -0.23840469121932983, 0.27359917759895325, -0.5454056859016418, 0.1260453760623932, -0.1898145228624344, -0.35529354214668274, 0.39611414074897766, -0.11094272881746292, 0.0356183387339...
btn.ID = "myButtonX"; } } } ```
[ 0.3331488370895386, 0.02391042560338974, 0.02267284505069256, -0.4089493155479431, 0.22266989946365356, 0.1203431710600853, 0.32021626830101013, 0.3729187846183777, -0.18103164434432983, -0.5602583289146423, -0.362747460603714, 0.6178326606750488, -0.4069327712059021, 0.3813023865222931, ...
It would seem that regular expression questions are common as each question seems to apply to a specific case. With that said, here is my specific case... I need to validate that an employee id is in one of two specific formats. The first format (and one that I have working reliably) is (w/o the quotes): "A000000" , w...
[ 0.35849347710609436, 0.14840258657932281, 0.39373722672462463, 0.01434587873518467, -0.10295384377241135, 0.3806358873844147, -0.11001945286989212, -0.057480327785015106, -0.00791831687092781, -0.3348027765750885, -0.03445076942443848, 0.23235392570495605, -0.004985908046364784, -0.0989292...
it would validate (this employee id gets used in a SQL statement's LIKE - ...SID LIKE "A0%". Again, this I have by using... `[A-Z]{1}\d{1,6}` The second format is the one giving me trouble. The same requirement holds above where only the first two positions of the input string are required, anything else is optional,...
[ 0.15382853150367737, 0.3618776798248291, 0.4573323130607605, -0.09033112227916718, -0.03611534461379051, 0.022354329004883766, 0.04520566761493683, -0.10081997513771057, 0.022096455097198486, -0.32962363958358765, 0.0857168436050415, 0.33939212560653687, 0.03886104002594948, 0.149015411734...
last value is entered, then it must be a character. So valid inputs could be... "00" or "000" or "0000" or "00000" or "000000" or "000000A", but NOT "0" or "0A" or "00A", or "000A" etc., or "0000000". Here is what I have so far for this format... `\d{2}(\d{1,4})?[A-Z]{0,1}` The problem is that this allows alpha-char...
[ -0.07015852630138397, 0.12544192373752594, 0.23246845602989197, -0.2644493877887726, 0.040175653994083405, 0.2265751212835312, 0.11246179789304733, -0.2968257665634155, 0.07564476132392883, -0.37200963497161865, -0.3306456506252289, 0.34152039885520935, -0.24452321231365204, 0.058249294757...
causing me grief. I hope this is enough info (or perhaps not too much). Any help would be greatly appreciated. Thank you!!! Try this expression: ``` (\d{2,5}|\d{6}[A-Z]?) ``` This matches either 2 to 5 digits (`\d{2,5}`) or six digits and an optional letter (`\d{6}[A-Z]?`). And if you want an exact match, use the `...
[ 0.14299963414669037, 0.5487571358680725, 0.38099706172943115, -0.17381611466407776, 0.07498457282781601, 0.2717339098453522, 0.16510584950447083, -0.07448267936706543, -0.06560806185007095, -0.5020515322685242, 0.13388662040233612, 0.4513276517391205, -0.11956080794334412, 0.22793385386466...
I am implementing a Repeater in my web application to display data. I want to add functional action links in a column similar to the built-in functionality in a GridView. Can anybody give me the steps required? I assume I will add a LinkButton control to each row, somehow set the OnClick event handler to point to the s...
[ 0.44835755228996277, -0.15670442581176758, 0.6253429651260376, 0.16574347019195557, 0.0034491869155317545, -0.012109288014471531, 0.15613962709903717, -0.22390271723270416, -0.4839491844177246, -0.6390649676322937, 0.3319573700428009, 0.36713874340057373, -0.19034335017204285, 0.3405481278...
<asp:LinkButton ID="lbtn" runat="server" OnCommand="lbtn_Command" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "KeyIDColumn") %>' ></asp:LinkButton> </ItemTemplate> </asp:Repeater> ``` Then in your code behind ``` protected void lbtn_Command(object sender, CommandEventArgs e) { ...
[ -0.19604720175266266, -0.2508797347545624, 0.6399627327919006, -0.2530181407928467, 0.1161307841539383, 0.18224526941776276, 0.4680546820163727, -0.4132044017314911, -0.2933082580566406, -0.6236827373504639, -0.3038775324821472, 0.549548327922821, -0.2518126368522644, 0.3343810737133026, ...
It's an implementation of [Sieve of Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes). ``` class PrimeGenerator def self.get_primes_between( x, y) sieve_array = Array.new(y) {|index| (index == 0 ? 0 : index+1) } position_when_we_can_stop_checking = Math.sqrt(y).to_i (2..positio...
[ -0.1122080385684967, -0.07610411196947098, 0.23730283975601196, -0.16336527466773987, -0.001634920947253704, 0.46289971470832825, 0.09687221795320511, -0.5808876752853394, -0.09973052889108658, -0.6490142345428467, 0.08519188314676285, 0.22579854726791382, -0.3898344933986664, 0.4586957395...
end def self.isMultipleOf(x, y) return (x % y) == 0 end end ``` Now I did this for a 'submit solutions to problems since you have time to kill' site. I chose ruby as my impl language.. however i was declared timed out. I did some benchmarking ``` require 'benchmark' Benchmark.bmbm do |x| x.report ("get pri...
[ -0.2894701659679413, 0.10481201112270355, 0.44311240315437317, -0.08360156416893005, -0.17595204710960388, -0.026754099875688553, 0.9168397784233093, -0.31129100918769836, 0.013510980643332005, -0.33793264627456665, -0.16771726310253143, 0.7149929404258728, -0.38213619589805603, -0.0523376...
system total real get primes 33.735000 0.000000 33.735000 ( 33.843750) ``` ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] ``` Rehearsal ---------------------------------------------- get primes 65.922000 0.000000 65.922000 ( 66.110000) ------------------------------------ total: 65.922000sec...
[ -0.67592853307724, -0.3568083643913269, 0.4558190405368805, 0.1747305989265442, -0.03128241002559662, 0.4350726902484894, 0.576427698135376, 0.01260785385966301, -0.21175938844680786, -0.5120087265968323, -0.156044140458107, 0.9200571775436401, -0.015421963296830654, -0.2592954933643341, ...
milliseconds** So now this prods me into thinking is it a problem with my implementation or is the perf diff between languages this wide? (I was amazed with the 1.9 Ruby VM... until I had to go compare it with C# :) **UPDATE:** Turned out to be my "put-eratosthenes-to-shame-adaptation" after all :) **Eliminating unne...
[ 0.38048508763313293, -0.13299009203910828, 0.15667961537837982, -0.029610639438033104, -0.10881764441728592, 0.012610464356839657, 0.7444025874137878, 0.06591451168060303, -0.23570466041564941, -0.6812297105789185, 0.1454494446516037, 0.47271716594696045, -0.1682322472333908, 0.06147637218...
s = (0..n).to_a s[0]=s[1]=nil s.each do |p| next unless p break if p * p > n (p*p).step(n, p) { |m| s[m] = nil } end s.compact end ``` There are a few further little speedups possible, but I think it's pretty good. They're not exactly equivalent, so your 10\_000 to 1\_000\_000 would equate to `...
[ -0.13683579862117767, -0.209966242313385, 0.5096675753593445, -0.20319660007953644, -0.24995937943458557, 0.11932430416345596, 0.4479060471057892, -0.5512652397155762, -0.21808981895446777, -0.5793970823287964, -0.42369991540908813, 0.5391495823860168, 0.036932650953531265, -0.087885908782...
= PrimeGenerator.get_primes_between( 1_000, 10_000) } end ``` which gives ``` user system total real Mike 0.016000 0.000000 0.016000 ( 0.016000) Gishu
[ -0.21631309390068054, -0.04942978918552399, 0.20230570435523987, -0.10988080501556396, -0.10540846735239029, 0.3291359543800354, 0.15281476080417633, -0.20530030131340027, 0.01756136305630207, -0.49042582511901855, -0.0407089926302433, 0.746351420879364, -0.010922317393124104, 0.1151789948...
1.641000 0.000000 1.641000 ( 1.672000) ``` (I stopped running the one million case because I got bored waiting). So I'd say it was your algorithm. ;-) The C# solution is pretty much guaranteed to be orders of magnitude faster though.
[ -0.06048412248492241, 0.2149297297000885, 0.5294872522354126, 0.14405570924282074, 0.17427542805671692, -0.0076395184732973576, 0.3361077606678009, 0.20451712608337402, -0.22138574719429016, -0.658734917640686, 0.2237870842218399, 0.5492660999298096, -0.27188435196876526, 0.050086483359336...
I created a simple extension method for the ASP.NET MVC UrlHelper. It takes no arguments as its job is to look up the name of a stylesheet file from the configuration and return a url to the stylesheet. The extension method looks roughly like this: ``` public static string SiteStylesheet(this UrlHelper urlHelper) { ...
[ 0.35315948724746704, -0.1521877646446228, 0.7224253416061401, -0.14173085987567902, -0.016215847805142403, -0.04567470774054527, -0.06675189733505249, -0.12296192348003387, -0.1748124212026596, -0.5371575355529785, -0.02620597369968891, 0.44018426537513733, -0.15259571373462677, 0.31679257...
scriptFilename)); } ``` And I use it like this: ``` <link href="<%= Url.SiteStylesheet() %>" rel="Stylesheet" type="text/css" /> ``` The method does not get executed, however, and the following is rendered: ``` href="../Views/Shared/%3C%25=%20Url.SiteStylesheet()%20%25%3E" ``` As you can see the extension metho...
[ 0.12689745426177979, -0.06041007488965988, 0.8851886987686157, -0.3080020546913147, 0.053932562470436096, -0.08551228791475296, 0.15557003021240234, -0.22399987280368805, -0.1608479917049408, -0.50703364610672, -0.1995423436164856, 0.5849762558937073, -0.2629122734069824, 0.104800567030906...
my question then is this by design or is this a bug in the ASP.NET MVC Web Form view engine? This issue has come up a number of times. The root of the issue is that the <head> tag has runat="server", which causes the parser to treat tags as server tags. The simplest workaround is to just remove runat="server" from the...
[ 0.26310455799102783, 0.06499458104372025, 0.5431848764419556, 0.12476351112127304, -0.09799335896968842, -0.3908683657646179, 0.33502042293548584, 0.07191325724124908, -0.14339950680732727, -0.48257145285606384, -0.006085777189582586, 0.3539571166038513, -0.5468227863311768, 0.409558653831...
Requirements: * Calculate the number of months between two dates: receiveDate and dueDate. * Both optimistic and pessimistic calculations are needed Assumptions: * dueDate will always be the last day of the month. I've already figured out the pessimistic calculation (meaning a single day overdue counts as a whole m...
[ 0.48609447479248047, -0.019957635551691055, 0.7710244655609131, -0.13266195356845856, -0.06600107252597809, 0.03777648136019707, 0.16863296926021576, 0.040770698338747025, -0.15734046697616577, -0.34718579053878784, 0.21670092642307281, 0.33669954538345337, 0.3865407705307007, 0.1958093494...
am I missing something? You're right; if you're looking for the number of *complete* months between the two dates, subtracting 1 (assuming the `receiveDate` doesn't fall on the last day of the month, in which case you will have a remainder of 0 days either way) will get you your answer.
[ 0.3057008385658264, 0.21469277143478394, 0.3300073444843292, -0.04122654348611832, -0.05865929648280144, 0.015594630502164364, 0.4970199763774872, 0.3578955829143524, -0.41066426038742065, 0.13269075751304626, 0.08690675348043442, -0.17868858575820923, 0.18464764952659607, 0.56023389101028...
I've been using Castle Windsor in my previous project and I liked it a lot. For my current project I'm looking to use a different IoC container. Castle Windsor hasn't had any new releases since 2007 and is still not at version 1.0 so it is hard to justify using it in a commercial environment. One of the things I like ...
[ 0.19555853307247162, 0.1007213220000267, 0.024005092680454254, -0.02967008948326111, 0.04324841499328613, -0.3738703727722168, 0.225175678730011, -0.11565980315208435, -0.1719767451286316, -0.4192986488342285, 0.09127088636159897, 0.03583231195807457, -0.13641510903835297, 0.50572860240936...
do property injection instead of constructor injection and that cleans up code and tests quite a bit. I've been looking at StructureMap, AutoFac, Unity and Spring.Net as alternatives but of these only Spring.Net supports something similar, it automatically calls an `Init()` method. Unfortunately Spring.Net does not re...
[ 0.44862106442451477, -0.15068311989307404, -0.21831057965755463, 0.07610365748405457, -0.24741943180561066, -0.2363317906856537, 0.3296894431114197, -0.33875083923339844, -0.15394286811351776, -0.41550904512405396, 0.2245120108127594, 0.5212243795394897, -0.4876892566680908, -0.01881904155...