Questions

Doctrine quoting apostrophes

I am using Doctrine ORM for php and Zend MVC. I have a mysql database. When I insert into the database it is escaping quotes. In other-words when I enter <input name="customer_name" value="Test'ed user"> ... into my form, and assign to a doctrine object and save. When I look a ...

Change parent of MovieClip

I want to detach a movieclip and attach it elsewhere, but it doesn't seem possible in AS2. I'm looking for an AS2 equivalent of Cocoa's addSubview/removeFromSuperview. Is there alternatives routes to go, such as duplicating a movie with a new parent.. is that possible? ...

Malloc a pointer to a pointer to a structure array by reference

The code below compiles, but immediately crashes for reasons obvious to others, but not to me. I can't seem to get it right, can anyone tell me how to fix this. *array_ref[2] = array[0]; *array_ref[3] = array[1]; It crashes on that part everytime. typedef struct test { char *name ...

Is it better/faster to have class variables or local function variables?

Ok I know the title doesn't fully explain this question. So I'm writing a program that performs a large number of calculations and I'm trying to optimize it so that it won't run quite so slow. I have a function that is a member of a class that gets called around 5 million times. This is ...

How can I display my UIImage on an EAGLView (iPhone)?

I have a UIImage. I have an EAGLView in my app, which is a derivative of the GLPaint ("Shake Me!") sample program. The UIImage is full-screen (320x480.) Actually, it's a screen-capture of the EAGLView's image from earlier in the program (like in this question.) I'd like to set the la ...

counting session units from array PHP

I want to count my $_SESSION['cart'] (units) products from my basket. #check added stock $units = (int) $_POST['units']; $sizes_id = (int) $_POST['size_id']; $in_stock = $db->GetScalar("SELECT p.units FROM products_sizes s ...

Linq to SQL with Stored Procedures

I want to add custom (compound and read-only) attributes to my stored procedure results class. When I did that, I got the error LINQ - Cannot assign value to member XXX. It does not define a setter. I then found this blog post - the author suggests that decorating the partial class wi ...

ASP.NET MVC 2 Preview/Beta Visual Studio Questions

ASP.NET MVC 2 Beta was just released and I'm a bit confused as to what is required to run it. Does it require .NET 4? If I have an App that was created using Visual Studio 2010 Beta 2, can I port it to ASP.NET MVC 2 Beta by referencing the proper DLLs? If so what DLLs do I need? Can I ...

partition a sequence of 2n real numbers so that

I'm currently reading The Algorithm Design Manual and I'm stuck on this exercise. Could you help me out please? Take a sequence of 2n real numbers as input. Design an O(n log n) algorithm that partitions the numbers into n pairs, with the property that the partition minimizes the ma ...

Looking for Pricegrabber.com API

I saw many e-commerce sites using Pricegrabber for price comparison. For example: http://www.cheapstingybargains.com/184212/lg-gp08lu10-8x-dvd%C2%B1rw-dl-usb-20-slim-external-drive-w-lightscribe/ Is there a pricegrabber API for developers? ...

Is this a IE Bug or am I stupid?

I have several pages and one stylesheet. The page bodies get two classes: Their name, and the language. For example: <body class="contact english"> Now, in the stylesheet, I have an special rule for the german version of the "expertise" page: body.expertise.deutsch .container ...

What is a good service that offers registration code and activation services for Cocoa/OSX applications? [closed]

I have a completed Cocoa application and would like to sell it. I have found many services that will sell your application, but not many that will also handle activation. Are there any services that will integrate activation into the installation file or are there any services that are e ...

dismissModalViewControllerAnimated: will not dismiss the page?

I have read all the other user's accounts of problems, but they don't seem to conclude with a result that works for me or they end with 'I fixed it guys - thanks for the help', but then they neglected to share their solution. Here is my code to present and dismiss (all key objects are p ...

from absolute numbers to proportion in two level data (R! SAC? plyr?)

I have data nested in to levels: L1 L2 x1 x2 x3 x4 A This 20 14 12 15 A That 11 NA 8 16 A Bat Na 22 13 9 B This 10 9 11 6 B That 3 3 1 NA B Bat 4 10 2 8 Now I want something simply - and I feel I have been able to do this just last month. But something has gone mis ...

In Pinax, how to invite when ACCOUNT_OPEN_SIGNUP = False?

In Pinax, when ACCOUNT_OPEN_SIGNUP = False how does the admin invite more users to the system? How does one generate invitation codes? How do they work? ...

how to extrude a path in 3d?

I'm trying to extrude a path in 3d. Nothing fancy yet, just following some points and using a regular polygon for 'tubing'. I'm using Processing for now to quickly prototype, but will later turn the code into OpenGL. My problem is rotating the 'joints' at the right angles. I think I hav ...

unset session in Javascript

Does anyone know is it possible for me to reset/remove the session for php in javascript? ...

forking a process seems to eat up certain lines of code - Objective-C

Here's a simplified version of my code: - (IBAction)convert:(id)sender { /* these two lines are ignored */ [textbox setStringValue:@"converting"]; [convertButton setEnabled:NO]; pid_t pid; if((pid=fork())==-1) { [log setStringValue:@"couldn't fork a new ...

jquery create a unique id

$(document).ready(function() { $('a.menuitem').click(function() { var arr = 0; var link = $( this ), url = link.attr( "href" ); var newDiv = $( document.createElement( 'div' ) ) $( "#content_pane" ).append( newDiv ); newDiv.load( url ); return false; ...

How to detect a filename within a case statement - in unix shell?

I coded the below code and if no -l or -L option is passes to the script I need to assume (detect) whether a filename was passed as a param. The below third condition only matches if filename is one lowercase character. How can I make it flexible to match upper and lower case letters or ...

Flash adding \r to input textbox, is this normal?

I am setting a string variable to the value of a input box in my movie but Flash also seems to be adding a \r (Carrage Return) to the end of it's value. This is not something i am typing. Is this normal or am i doing something wrong, i can't seem to find where it is coming from. If thi ...

What's the difference between a hash and hash reference in Perl?

I would like to properly understand hashes in Perl. I've had to use Perl intermittently for quite some time and mostly whenever I need to do it, it's mostly related to text processing. And everytime, I have to deal with hashes, it gets messed up. I find the syntax very cryptic for hashe ...

How do I take a reference to an array slice in Perl?

How would you take a reference to an array slice such that when you modify elements of the slice reference, the original array is modified? The following code works due to @_ aliasing magic, but seems like a bit of a hack to me: my @a = 1 .. 10; my $b = sub{\@_}->(@a[2..7]); @$b[0, ...

PostgreSQL issue with named arguments in a function

PostgreSQL 8.4 on Linux. I have a function: CREATE OR REPLACE FUNCTION production.add_customer ( name varchar(100), email_address varchar(300), street_address text, city varchar(50), state varchar(2), zip varchar(10), secret1 bytea, secret2 bytea, secret3 bytea, sec ...

Simple FlowLayOut Help

I have a few questions for this program, one the first thing I am trying to do is make it so it could compare and see if the textfield is equal to the colorValues[x] position. The second issue is the if statement says if inText == to colorValues.length - 1 to open a box that says congrad ...

.NET Regex Expression For Finding & Replacing Any ProductName Value In A .vdproj File In C#

I'm trying to write a NAnt extension task that can update different settings within a Visual Studio 2003 generated Setup .vdproj file, and would appreciate help with the following. Specifically, I would like to use a RegEx expression to find, and if found, replace any value string value ...

Convert List<DerivedClass> to List<BaseClass>

While we can inherit from base class/interface, why can't we declare a List<> using same class/interface? interface A { } class B : A { } class C : B { } class Test { static void Main(string[] args) { A a = new C(); // OK List< ...

How can I determine programmatically whether on multi-core, hyperthreading or multi-processor?

I know how to get the processor type, perhaps that's the only way, but I'm actually looking for a way to determine from an application whether it's running on a multi-core processor or on a hyper-threading single-core processor. (background: the hosting providers of some of my clients a ...

Object reference problem

Following problem: I would like to build a little clipboard with jQuery. I have tried several times to store an object in the data of a javascript object with $(object).data('id',objectToStore). Objects can be stored there that works fine. The problem is if I try to insert the stored da ...

Using ediff as git mergetool

I would like to be able to use ediff with "git mergetool". I found some patches that alter the source code, which I don't want to do. Instead, I'd like to add ediff support with my .gitconfig. I know git has builtin support for emerge, but I prefer ediff. I attempted to add these line ...

Hot Tags