block

blocking url using firefox extension

how can i control access to webpages in firefox. i'm going to develope a new addon for this but colud you tell me what should i do? can firefox extension programming allows this. or should i develop a desktop application to control access. thx in advance. edit: it's not going to be used daily. will be just an example for a research. ...

Mysql SELECT FOR UPDATE - strange issue

Hi, I have a strange issue (at least for me :)) with the MySQL's locking facility. I have a table: Create Table: CREATE TABLE test ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 With this data: +----+ | id | +----+ | 3 | | 4 | | 5 | | 6...

Return hash with modified values in Ruby

I'm trying this: {:id => 5, :foos => [1,2,3]}.each {|k,v| v.to_s} But that's returning this: {:id=>5, :foos=>[1, 2, 3]} I'd like to see this: {:id=>"5", :foos=>"[1, 2, 3]"} I've also tried variations of Hash#collect and Hash#map. Any ideas? ...

Call a block method on an iterator: each.magic.collect { ... }

I have a class with a custom each-method: class CurseArray < Array def each_safe each do |element| unless element =~ /bad/ yield element end end end end And want to call different block methods, like "collect" or "inject" on those iterated elements. For example: curse_a...

Set Static block in Right side in Magento site

Hi I am new for Magento and don't much knowledge of programing what i want to do is i heve three categories on my site and created three static blocks for it and set it up on middle of each category page with their related block all working fine but now i want to move it in Right Sidebar in My site so pls. suggest how and where do i chan...

Removing the block "Popular Tags" from the index view in Magento

Hi, I started working with Magento this week and I'm trying to create a new theme. Following the "Designing for Magento" article of the wiki, I tried to remove the Popular Tags block from the index view, adding this line to local.xml on magento\app\design\frontend\default\mytheme\layout: <remove name="tags_popular"/> I don't why, but ...

Text and Picture Block Recognition in Picture

Hi, I'm new in Image Proccessing. I have an image and I want to parsing Text blocks and picture blocks. How can I do? I don't use OCR components. I need algorithm or sample or suggestion. ...

drupal - using variable_set, hook block and hook menu to save config values then print out in custom template

I am trying to 1) implement the hook menu and variable_set in the block hook and to solicit and store configuration values from user, 2) then use retrieve configuration values and 3) pass them out into a template using theme hook when page is shown. However I need a bit of a push on step two and three! // ===================== file:...

Download file is blocked using WatiN even after modifying registry settings

I'm doing an IE automation using WatiN. When a file to be downloaded is clicked, I get the following in the Internet Explorer Information bar: To help protect your security, Internet Explorer has blocked this site from downloading files to you computer. I added a registry key to, HKEY_CURRENT_USER\Software\Microsoft\Win...

Drupal: assign block to a specific content type

I made a customized template called node-mynode.tpl.php Whenever a node of type mynode is requested, then node-mynode.tpl.php is automatically used. However, now user wants to see a specific menu block in this case. Question: How can I assign a block to a specific content type? Hint: I have started to look at URL aliases with Pathaut...

Python: "inline" block / condition to return a char?

Sorry for the vague question. I would like to create a string that uses a plural if count > 1. For that, I would like have an "inline" condition that returns 's' to concatenate to my noun. print "The plural of plural is plural{0}. {1}".format( {'s' if count > 1}, "Isnt't it!?") ...

In languages which create a new scope each time in a loop block, a new local copy of the local loop variable is created each time in that new scope?

It seems that in language like C, Java, and Ruby (as opposed to Javascript), a new scope is created for each iteration of a loop block, and the local variable defined for the loop is actually made into a local variable every single time and recorded in this new scope? For example, in Ruby: p RUBY_VERSION $foo = [] (1..5).each do |i| ...

magento move navigation block to above the cart/basket

I placed the menu to the right on on 2columns-right.phtml. But I can not figure out how to move it to above the shopping cart. In catalog.xml I added this to get the menu inserted: <block type="catalog/navigation" name="catalog.vertnav" template="catalog/navigation/vert_nav.phtml" /> Now I just need to move it to the top. ...

Fast block placement algorithm, advice needed?

I need to emulate the window placement strategy of the Fluxbox window manager. As a rough guide, visualize randomly sized windows filling up the screen one at a time, where the rough size of each results in an average of 80 windows on screen without any window overlapping another. If you have Fluxbox and Xterm installed on your system,...

Apply PHP regex replace on a multi-line repeated pattern

Let's say I have this input: I can haz a listz0rs! # 42 # 126 I can haz another list plox? # Hello, world! # Welcome! I want to split it so that each set of hash-started lines becomes a list: I can haz a listz0rs! <ul> <li>42</li> <li>126</li> </ul> I can haz another list plox? <ul> <li>Hello, world!</li> <li>Welcome!...

IE Blocking Scripts

IE 8 block my custom scripts every time i run my web site,and i need to click "allow scripts" to run it correctly.Its boring. Any ideas? The script: // JavaScript Document var char=0; var caption = ""; var standby; var msg = "Lorem ipsum dolor sit amet, consenctuinv isdrulix core"; var selectedItem = 1; var lastItem; var fotos ...

Is there a functional version of begin...rescue...end (exception block) in ruby?

I'd like to do something like this in ruby: safe_variable = begin potentially_nil_variable.foo rescue some_other_safe_value end ... and treat the exception block (begin/rescue/end) as a function/block. This doesn't work as written, but is there a way to get a similar result? NB what I'm actually doing is this, which works but is ...

python subprocess block

Hello. I'm having a problem with the module subprocess. I'm running a script from python through: subprocess.Popen('./run_pythia.sh',shell=True).communicate() and sometimes it just blocks and it doesn't finish to execute the script. Before I was using .wait() instead of .communicate() but then because of this: http://dcreager.net/2...

Internet Explorer URL blocking with Python?

I need to be able to block the urls that are stored in a text file on the hard disk using Python. If the url the user tries to visit is in the file, it redirects them to another page instead. How is this done? ...

How do you code up a pattern matching code block in scala?

How do you code a function that takes in a block of code as a parameter that contains case statements? For instance, in my block of code, I don't want to do a match or a default case explicitly. I am looking something like this myApi { case Whatever() => // code for case 1 case SomethingElse() => // code for case 2 } And insid...