block

Using blocks in iOS4 and backwards compatibility

Hello All - If I write code in iOS SDK 4.1 and I use block notation, will it still run on an iOS 3.0 iPhone? I am suspecting not, but wanted confirmation on this. On another tip - I am a little confused about why people use blocks at all. To my (ignorant) mind, it seems like a new syntax that doesn't really allow one to do anythin...

Basic Drupal Question

I have been trying to figure this out for days. Hope someone can help. I am implementing a new theme for a site. I added the html to a page.tpl.php file, populated it with the appropriate variables, and it works OK so far. It consists of a header, footer, and a left and right div. The left div successfully displays the output of the...

submit button and display block in IE

hi, why does the code below put the submit button on its own line in FF but on the same line in IE? <style type="text/css"> #div1 form input.submit {display:block;} </style> <div id="div1"> <form> hi <input type="submit" class="submit" value="hello there"> </form> </div> ...

Magento list of related(recommended) products in checkout cart

Hi, i'm tring to put a list of recommended items in checkout cart page, i was trying to use the related products block that is in layaout/catalog.xml, but it works for a single product in product view page, and in the checkout cart page can be more than one product, so, how can i make something like this, if it can be done?? ...

Ruby Get Array From Objects Returned in a Block

In Ruby, on certain occasions (ruby/gosu/texplay) I'v seen code like the following used: image.paint { circle 20, 20 pixel 10, 10 } Would it be possible for me to write a similar function that can be used like so?: my_function { "one" "two" "three" } that would return and array: ["one", "two", "three"] p.s...

Using Block Completion Handler in iOS 4 for animation

I would like to animate my subviews movement when rotating the device, changing the alpha to 0, move the view to the new position and reset the alpha to 1. Using this code in didRotateFromInterfaceOrientation causes the view to flash and fade very quickly and then reappear. I would like to avoid this behaviour. [UIView animateWithDurat...

Block MsgBox From External Application Using VB.Net

Is there a way to intercept a MsgBox() from an external application and block it using VB.Net? For this discussion, let's say the MsgBox Title is "SQL Application" and the Message is "SQL Error - Try Again". I have found some examples of looking for the MsgBox to pop-up (by watching for the Window title) and then sending key(s) to pre...

How can the block size of a file store be portably obtained in Java 7?

I believe the title says it all. I've looked at java.nio.file.attribute.Attributes and java.nio.file.FileStore, but couldn't find a way to discover the block-size of a disk-file. ...

xlib/ xcb deadlock or block

Hi, I’ve a program developed using xlib and cairo. Just for the reference I do mix calls between cairo and xlib, although I’m not sure If that might be the cause of the error. I get a deadlock or a block in some situations. I’ve three threads that work with xlib. One is the main UI thread which makes calls to both xlib and cairo, anothe...

How Block spam links In ASP

In php we use the following code to block the url link passing via text boxes or textarea on form submit(For avoid bad link passing from contact us form ).Is there any methode like this in classic asp using vb. if($_POST['Register']) { $username=$_POST['username']; if (preg_match('~(?:[a-z0-9+.-]+://)?(?:\w+\.)+\w{2,6}\S*~i', ...

Blocking/redirecting referrer-spoofed referrals CHALLENGE!

Example: An internal page of mine is linked to this way (actual URLs edited out): ...referrerspoof.com/?http://mywebsite.com/internalpage.html I checked out the headers for this link and got two locations: LOCATION 1 GET /?http://mywebsite.com/myinternalpage.html HTTP/1.1 Host: referrerspoof.com User-Agent: my computer Referer: ...r...

Objective-C Block type as return value

How do I write the following: typedef void (^T)(void); T f() { return ^{}; } without the typedef? ...

Objective-C blocks -- EXC_BAD_ACCESS if I call block directly?

Continuing to try to understand blocks in Objective-C. I have the following function: typedef void(^TAnimation)(void); TAnimation makeAnim(UIView *aView, CGFloat angle, CGFloat x, CGFloat y, CGFloat width, CGFloat height, UIInterfaceOrientation uiio) { return Block_copy(^{ aView.transform = CGAffineTrans...

In vi/vim is there any way to make Visual Block Mode unconstrained by line endings?

In vi/vim is there any way to make Visual Block Mode unconstrained by line endings? ...

[Java] Block java hotkeys, like alt+esc, control-alt-delete

Hey guys, I'm building a Java App, and i need to block the hotkeys, like Alt+Tab, Control-Alt-Delete... Basically theses. My application requires this, because it is a control application. If the solution is not possible on java, any one knows another way to do this. Thanks you! Edit1: I'm build a "computer manager" that requires a pa...

Block USB, based on Volume/Capacity

Hello, I want to block a USB based on volume using C#. Like I want to block USB stick if capacity is greater than 8GB. Look there is a method to block USB on PC using registry. but this will make USB undetectable so I can not get volume information. I want to do that If my client program is running on some machine and I put restriction...

how to pass a Ruby iterator as a parameter?

I'd like to write a method that yields values in one place and pass it as a parameter to another method that will invoke it with a block. I'm convinced it can be done but somehow I'm not able to find the right syntax. Here's some sample (non-working) code to illustrate what I'm trying to achieve: def yielder yield 1 yield 2 yiel...

socket never accept bytes to write

Hi, I'm trying to write a client. I am able to open a socket to the server and the server acknowledges the connection, but for some reason, the write stream is never ready to accept data, i.e. it seems to always be blocked. What am I doing wrong? I'm new to socket programming, so it might be something in the wrong place, but here's w...

MySQL InnoDB lock question

Hi All: I have a question about MySQL InnoDB. For example: I have the following table created: mysql>CREATE TABLE IF NOT EXISTS `SeqNum` ( `id` varchar(10) NOT NULL, `seq_num` BIGINT(30) default 0, PRIMARY KEY(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Query OK, 0 rows affected (0.00 sec) mysql>INSERT IG...

if/else format within while loop

while(true) { cout << "Name: "; getline(cin, Name); if(Name == "Stop") break; cout << "Additional Name - Y/N: "; getline(cin, additional); if (additional == "Y") cout << "Additional Name: "; getline(cin, Name2); else cout << "Location: "; getline(cin, Location); if(Location == "Stop") break; } chi...