block

Block call in Ruby on Rails

Hi, I'm trying to clean up my code and get rid of a lot of ugly hashes. In my views I define several actions like this: @actions = { :interest => {'Show interest', link_to(..), :disabled => true}, :follow => {'Follow this case', link_to(..)} ... } As these hashes grow, the maintainability decreases. I want to convert the abov...

Creating content in a block in Drupal 6

By default for creating content a new page is opened. I want to do this inside a block. A block where there will be some fields like title body taxonomy terms and a create content button. How can I do this? ...

Intercepting process execution in a NT driver

I have developed a driver for Windows XP which is able to monitor the execution of processes. A callback function receives the notifications using standard WDK API (PsSetCreateProcessNotifyRoutine). The driver then decides if the process should be authorized or not; if not, it must block its execution/kill it. What's the cleanest way t...

GCD / block scoping in Objective-C++

I'm using GCD to speed up some calculations in a few C++ templates I'm working on. I've already done it successfully for several functions, but now I'm trying to get it to work for a member function and I've encountered this weird scoping problem. The code looks something like this: inline void op::factorOutGaussian(const double *x, c...

How do I do multiple lines of Ruby in html.erb file

Hey, I'm using Ruby on Rails and need to run a block of Ruby code in one of my html.erb files. Do I do it like this: <% def name %> <% name = username %> <%= name %> or like this: <% def name name = username %> <%= name %> Thanks for reading. ...

Django Template block tag

Hi How many different block tags like these exist? {% block %} In other words if I have a parent template and child templates with multiple block tags. How does Django know where to insert if not by different block tag names? Or can I customize like: {% block_mytag_1 %} Thanks L ...

jQuery Detect CSS Property Change

Hi Guys, I am trying to use jQuery to establish whether a CSS property has changed inside a class. I dont want to use .HasClass() - I want to find a property within the CSS - namely display:block; I thought maybe this might work ? if (jQuery('css-class').css('display') == 'block') But not sure if it does. Does anyone have any sugg...

How to block UI in IPhone

Hello A simple question: how can I block UI thread without using sleep? Just to be clear: I understand that UI will freeze for user, but that's the idea... Can I run empty RunLoops? Any other ways. thank you ...

how to block websites?

Hello. How to block websites, not write to file hosts? (C#) ...

Block websites programmaticaly

The program has a black list, it contains a list of sites. When the user opens the site in IE (Firefox, Opera, Chrome) he should get an error. (For example 404). How can I do? It is advisable not writing to the file HOSTS. Language C#. Thanks. ...

simplifying threading in python

I am looking for a way to ease my threaded code. There are a lot of places in my code where I do something like: for arg in array: t=Thread(lambda:myFunction(arg)) t.start() i.e running the same function, each time for different parameters, in threads. This is of course a simplified version of the real code, and usually the co...

drupal block display

is there any way to place a block in different regions without duplicating it . for ex consider a block1 and its display regions requirement page1 lefttop page2 right how to configure block1 in 2 different regions ? ...

CPALead Type Content Block (JS or CSS)

Hey, I'm just wondering how I could create a cpalead type thing to block content and display a message. Really, all I need is the screen to go black and have a very high opacity so you can only see the content a bit, and I need 1 div to be left viewable. If anyone could help me out that would be great! ...

scala foreach und map initializers

Just seen an interesting possibility to initialize code blocks in Scala for high order functions such as foreach or map: (1 to 3) map { val t = 5 i => i * 5 } (1 to 3) foreach { val line = Console.readLine i => println(line) } Is this some documented feature or should i better avoid such constructs? I could imagine, ...

If admin block a user then session of that current user should be expired in ASP.NET

Is there anyway to implement this.If admin block a user then session of that current user should be expired in ASP.NET ...

JSP deny direct access to URL by non-logged in user

I have a login and a user info page which is displayed after login. How can I block user info page from direct access by user? How can I implement that with session? ...

Perl's BEGIN{} block in Python

I have Python code that uses the "with" keyword (new in 2.6) and I want to check if the interpreter version is at least 2.6, so I use this code: import sys if sys.version < '2.6': raise Exception( "python 2.6 required" ) However, the 2.4 interpreter chokes on the with keyword (later in the script) because it doesn't recognize the ...

Apache block an ip address from accessing the website

someone trying to access pages like //mysqladmin//scripts/setup.php Is it some hack attempt or .. ? If yes then how i can block its ip from accessing mine website ? Via htaccess or something else ? ...

Shorten My Objective-C Code Using Blocks

This is from a category that I'm using to modify UIView. The code works, but in the first method (setFrameHeight) I'm using a block and in the second method (setFrameWidth) I'm not. Is there any way to use blocks more efficiently in this example? typedef CGRect (^modifyFrameBlock)(CGRect); - (void) modifyFrame:(modifyFrameBlock) block ...

Getting Past Facebooks Iframe Block

Hi well on Facebook they seem to have a block witch prevents you from loading an iframe of their website. When you do, they lock complete functionality of their website ex : http://belginfish.com/fb/test.php I'm just wondering if anyone knows how you could bypass this? Thanks ...