[Solved] Can we put a UIButton in a UIScrollView and vice versa in iPhone

UIScrollView *scrollview = [[[UIScrollView alloc] initWithFrame:CGRectMake(0.0F, 0.0F, 320.0F, 480.0F)] autorelease]; [self.view addSubview:scrollView]; UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect]; [button setTitle:@”Title” forState:UIControlStateNormal]; [button setFrame:CGrectMake(0.0F, 0.0F, 50.0F, 50.0F)]; [scrollView addSubview:button]; If you have to add a subview to a UIButton then you would just to it in the opposite order: UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect]; [button … Read more

[Solved] Enable / disable Elements When div element gets focus

Assuming the following HTML as an example: <div class=”div”> <input type=”text” /> <input type=”text” /> <input type=”text” /> </div> <input type=”text” class=”b”/> One can use the following script, using the focus and blur events: $(‘.div input[type=”text”]’).on(‘focus’, function(){ $(‘.b’).prop(‘disabled’, true); }).on(‘blur’, function(){ $(‘.b’).prop(‘disabled’, false); }); Check Fiddle 1 solved Enable / disable Elements When div element … Read more

[Solved] String parsing, replace new line character

Strings are immutable in Java – operations like replace don’t actually update the original string. You have to use the return value of the substring call, e.g. String updated = str.substring(j,str.indexOf(‘>’,j+1)).replaceAll(“\n”, “#10”); If you want to replace this in the overall string, you can simply concatenate this back into the string: int indexOf = str.indexOf(‘>’,j+1); … Read more

[Solved] Variable inside a REGEX

text = input.replace(/(KEYWORD)\(([^)]+)\)/, “$1 $2”) You realize your example has a space after the keyword yeah? Maybe this instead: text = input.replace(/(KEYWORD)\s*\(([^)]+)\)/, “$1 $2”) 2 solved Variable inside a REGEX

[Solved] exception error: bad argument in function [closed]

Presumably this happens because Token and Payload are binaries, not integers. When constructing a binary like this, everything is assumed to be a 1-byte integer unless specified otherwise. To insert Token and Payload into the binary being constructed, use the /binary suffix: Packet =[<<0:8, TokenLength, Token/binary, PayloadLength, Payload/binary>>], solved exception error: bad argument in function … Read more

[Solved] Delete specific subfolder under unknown folders from anywhere

I created a short powershell solution using this- $targetName=”ss s”; foreach ($file in Get-Childitem “G:\Project\Projects\” ) { $fname=$file.name; if (Test-Path “G:\Project\Projects\$fname\$targetName\”) { $shell = new-object -comobject “Shell.Application” $item = $shell.Namespace(0).ParseName(“G:\Project\Projects\$fname\$targetName”) $item.InvokeVerb(“delete”) } } This powershell script sends that folder to recycle bin after confirmation popup. (this won’t send any file named ‘ss s’) this seems … Read more

[Solved] Is Primitive types Exist in C#? [closed]

Please ask only one question per question. Is Int32 a = new Int32() equal to int a ? No. It is the equivalent of int a = 0; If not: How its possible to write a.ToString() ? Ints have a method called ToString. You called it. Do we have primitive types in C#? The C# … Read more