Script parameters in Bash

The arguments that you provide to a bashscript will appear in the variables $1 and $2 and $3 where the number refers to the argument. $0 is the command itself. The arguments are seperated by spaces, so if you would provide the -from and -to in the command, they will end up in these variables … Read more

How to pass parameters to a Script tag?

I apologise for replying to a super old question but after spending an hour wrestling with the above solutions I opted for simpler stuff. <script src=”https://stackoverflow.com/questions/5292372/..” one=”1″ two=”2″></script> Inside above script: document.currentScript.getAttribute(‘one’); //1 document.currentScript.getAttribute(‘two’); //2 Much easier than jquery OR url parsing. You might need the polyfil for doucment.currentScript from @Yared Rodriguez’s answer for IE: … Read more

ASP.NET MVC 3 client-side validation with parameters

You could use the ValidationParameters property to add custom parameters to the rule: public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context) { var rule = new ModelClientValidationRule { ErrorMessage = this.ErrorMessage, ValidationType = “futuredate”, }; rule.ValidationParameters.Add(“param1”, “value1”); rule.ValidationParameters.Add(“param2”, “value2”); yield return rule; } which could be used in the adapter: jQuery.validator.unobtrusive.adapters.add( ‘futuredate’, [ ‘param1’, ‘param2’ ], function … Read more

‘UserControl’ constructor with parameters in C#

Design decisions made regarding the way Windows Forms works more or less preclude parameterized .ctors for windows forms components. You can use them, but when you do you’re stepping outside the generally approved mechanisms. Rather, Windows Forms prefers initialization of values via properties. This is a valid design technique, if not widely used. This has … Read more

HTTP request parameters are not available by request.getAttribute()

Here, String url = (String) request.getAttribute(“url”); you’re trying to get a request parameter as a request attribute instead of as a request parameter. This will obviously not do what you want. You need to get a request parameter as a request parameter, not as a request attribute. String url = request.getParameter(“url”); Unrelated to the concrete … Read more

C# “Parameter is not valid.” creating new bitmap

Keep in mind, that is a LOT of memory you are trying to allocate with that Bitmap. Refer to http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/37684999-62c7-4c41-8167-745a2b486583/ .NET is likely refusing to create an image that uses up that much contiguous memory all at once. Slightly harder to read, but this reference helps as well: http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.drawing/2005-06/msg00176.html Each image in the system has … Read more