block

Helper for Enterprise Library version 4.1

Hi all, any helper class for reduce code lines using ent Library: Database db = DatabaseFactory.CreateDatabase("ConnectionStrings.Oracle.D04PES01"); using (DbCommand cm = db.GetStoredProcCommand("TBL_POC_TEST_TIPOS.TBL_POC_TEST_TIPOS_FBY_PK")) { db.AddInParameter(cm, "P_ID_TEST_TIPOS", DbType.String...

How could I block all non-US IP addresses from access to my website?

I want to block all non-US users from accessing my website. I'm using nginx on the front end and have a django powered website. 1) How can I determine what are US IP addresses? 2) Should I be blocking them in my webserver or in my application layer? ...

Blocks to UIElement conversion

Hai is it possible to convert a 'System.Windows.Documents.Block' to 'System.Windows.UIElement' . I need this as i want to add the blocks i created to a fixed document.is there any other way? thanx alot ...

How to divide an image into blocks in MATLAB?

I have a 256x256 image and I want to divide it into 4 blocks of 128x128 each and address them as A1 to A4. Now I want to call them separately and do some operations on them. I know this can be done using the blkproc function -- but how exactly? Do I call blkproc like this? B=blkproc(I,[4 4],?) What do I put in place of the "?", and h...

How is a block diagram organized?

I would like to understand the exact hierarchy of a block diagram. If a block A is on top of block B does it mean that A is in some abstract manner build using B? A concrete question: I have a component C that calls components D,E to achieve its goal. Is C on top of D,E (since it uses them) or are these different unrelated blocks? Wh...

Block Control+Alt+Delete

Hi, I'm doing an Online Quiz project in C#. The test client is a Windows Desktop Application running on Windows XP. I need to block the control+alt+delete key combination to prevent students from minimizing/closing the application. I know this question has been asked a million times, but I'm simply unable to find a working solution. Usin...

Python Markdown: Markdown Inside HTML Blocks

Is there an extra for Python Markdown that supports Markdown inside HTML block elements, e.g. div, p i.e. is there a way to convert this: <div id="content"> [Google](http://www.google.com) </div> to <div id="content"> <a href="http://www.google.com&gt;Google&lt;/a&gt; </div> using Python Markdown or a Python Markdown exten...

Early return from a block given to instance_exec

In my application, I have the need to allow blocks to be defined and called within the scope of a class, using instance_exec (via Rails 2.3.2). However, some of these blocks need to return early in some situations, which is causing me a problem. My application was built using ruby 1.8.6, but I need to get it running on 1.8.7 as well. It...

Monitor USB traffic

I want to view all traffic going out the USB, with the potential to block data transactions to/from the USB based on content policy. How would this be done? Any way to achieve this in C#, or is it more of a C++ type of problem? ...

Is it possible to define a block with default arguments in Ruby?

This question deals with optional arguments passed to a Ruby block. I'm wondering if it's also possible to define arguments with default values, and what the syntax for that would be. At first glance, it appears that the answer is "no": def call_it &block block.call end call_it do |x = "foo"| p "Called the block with value #{x}" e...

JQuery Show/Hide - Values for Css Display Affecting Layout

JQuery uses the Css Display value under the hood of the simple show() and hide() functions. The following Html includes three buttons each wrapped in a span tag, and all three span tags placed in a parent div container. On page load the span tags are hidden using JQuery hide() and at some point later on they are displayed using the show(...

TextWriterProxy in WPF TextBlock

Hi, I am using a TextWriterProxy in the WPF application as follows: TextBlock output = new TextBlock(); TextWriterProxy proxy = new TextWriterProxy(); proxy.Add(Console.Out); StringBuilder sb = new StringBuilder(); StringWriter resultStringWriter = new StringWriter(sb); proxy.Add(resultStringWriter); output.Text = sb.To...

Problem sending emails to yahoo and hotmail users?

I am using php and mysql. Each time an user register on my website, I will use php mail() to send a single email for authentication. Recently I found out that, a lot of yahoo and hotmail users are not activated their accounts, lets say upon 1000 users, only 200 are activated. I am curious, and I try register using my hotmail account....

What exactly is is this in ruby: `&:capitalize`

I just read this answer http://stackoverflow.com/questions/1791639/regular-expression-in-ruby-to-convert-uppercase-title-into-lowercase/1792102#1792102. There is the following line of code "abc".split(/(\W)/).map(&:capitalize).join What exactly is &:capitalize? Before I had put this into irb myself, I would have told you, it's not va...

CUDA - Better Occupancy vs Less Global Memory Access?

Hey My CUDA code must work with (reduce to mean/std, calculate histogram) 4 arrays, each 2048 floats long and already stored in the device memory from previous kernels. It is generally advised to launch at least as many blocks as I have multiprocessors. In this case however, I can load each of these arrays into the shared memory of a ...

Html - div blocks and clear:both

Hello, I can't understand one thing. I have a big block, here is it's css: #content_part1 { margin: 0; padding: 0; width: 1024px; min-height: 544px; background-image: url(../images/top.gif); border: 1px solid green; } And another block in it: #content { width: 942px; margin-left: 41px; position: absolute;...

Simulate a faulty block device with read errors?

I'm looking for an easier way to test my application against faulty block devices that generate i/o read errors when certain blocks are read. Trying to use a physical hard drive with known bad blocks is a pain and I would like to find a software solution if one exists. I did find the Linux Disk Failure Simulation Driver which allows cr...

Jquery - How to get the style display attribute "none / block"

Is there a way to get the style: display attribute which would have either none or block? DIV : <div id="ctl00_MainContentAreaPlaceHolder_cellPhone_input_msg_container" class="Error cellphone" style="display: block;"> <p class="cellphone" style="display: block;">Text</p> </div> I know that there is a way to find out if the DIV...

Why doesn't Perl allow one liners to be 'unblocked'?

for example: if (something) function(); else nope(); ...

NSURLConnection - Is it possible to wait/block on a request?

Hi All, I need to wait for a response from a SOAP webservice, I am calling via a NSURLConnection as I need to manipulate the data being returned and then return it from my class to the calling class. I cant figure out how I can possibly do it. Here is my code at the moment: #import <Foundation/Foundation.h> @interface UsersBLL : NSO...