Controller not a function, got undefined, while defining controllers globally

Controller not a function, got undefined, while defining controllers globally

I am writing a sample application using angularjs. i got an error mentioned below on chrome browser. Error is Error: [ng:areq] http://errors.angularjs.org/1.3.0-beta.17/ng/areq?p0=ContactController&p1=not%20a%20function%2C%20got%20undefine

Replace method doesn't work

Replace method doesn't work

I want to replace the smart quotes like ‘, ’, “ and ” to regular quotes. Also, I wanted to replace the ©, ® and ™. I used the following code. But it doesn't help.Kindly help me to resolve this issue.str.replace(/[“”]/g, '"');str.replace(/[‘

C# webbrowser Ajax call

C# webbrowser Ajax call

I am using a webbrowser control embeded in C# WPF .NET4 app. Whenever I press manually the button in a form, the browser hangs on "Your request is being processed" message and nothing happens. If I do the same in full IE browser the page is

Simple way to transpose columns and rows in Sql?

Simple way to transpose columns and rows in Sql?

How do I simply switch columns with rows in SQL?Is there any simple command to transpose?ie turn this result: Paul | John | Tim | EricRed 1 5 1 3Green 8 4 3 5Blue 2 2 9

Simplest way to serve static data from outside the application server in a Java web application

Simplest way to serve static data from outside the application server in a Java web application

I have a Java web application running on Tomcat. I want to load static images that will be shown both on the Web UI and in PDF files generated by the application. Also new images will be added and saved by uploading via the Web UI.It's not

How to get the insert ID in JDBC?

How to get the insert ID in JDBC?

I want to INSERT a record in a database (which is Microsoft SQL Server in my case) using JDBC in Java. At the same time, I want to obtain the insert ID. How can I achieve this using JDBC API? 1:If it is an auto generated key, then you ca

Reading a resource file from within jar

Reading a resource file from within jar

I would like to read a resource from within my jar like so:File file;file = new File(getClass().getResource("/file.txt").toURI());BufferredReader reader = new BufferedReader(new FileReader(file));//Read the fileand it works fine when runnin

From an array of objects, extract value of a property as array

From an array of objects, extract value of a property as array

I have JavaScript object array with the following structure:objArray = [ { foo: 1, bar: 2}, { foo: 3, bar: 4}, { foo: 5, bar: 6} ];I want to extract an array containing the values of key foo, resulting in a value of [ 1, 3, 5 ].I have accom

What is a StackOverflowError?

What is a StackOverflowError?

What is a StackOverflowError, what causes it, and how should I deal with them? 1:Parameters and local variables are allocated on the stack (with reference types the object lives on the heap and a variable references that object). The sta

How to avoid having class data shared among instances?

How to avoid having class data shared among instances?

What I want is this behavior:class a: list = []x = a()y = a()x.list.append(1)y.list.append(2)x.list.append(3)y.list.append(4)print(x.list) # prints [1, 3]print(y.list) # prints [2, 4]Of course, what really happens when I print is:print(x

How to deal with floating point number precision in JavaScript?

How to deal with floating point number precision in JavaScript?

I have the following dummy test script:function test(){ var x = 0.1 * 0.2; document.write(x);}test();This will print the result 0.020000000000000004 while it should just print 0.02 (if you use your calculator). As far as I understood

Why does a RegExp with global flag give wrong results?

Why does a RegExp with global flag give wrong results?

What is the problem with this regular expression when I use the global flag and the case insensitive flag? Query is a user generated input. The result should be [true, true].var query = 'Foo B';var re = new RegExp(query, 'gi');var result =

What is array decaying?

What is array decaying?

What is decaying of an array? Is there any relation to array pointers? 1:It's said that arrays "decay" into pointers. A C++ array declared as int numbers [5] cannot be re-pointed, i.e. you can't say numbers = 0x5a5aff23. More importantl

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

I have some code and when it executes, it throws a IndexOutOfRangeException, saying, Index was outside the bounds of the array.What does this mean, and what can I do about it?Depending on classes used it can also be ArgumentOutOfRangeExce

My regex is matching too much. How do I make it stop?

My regex is matching too much. How do I make it stop?

J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000100: Machine name: DEV J0000100: Project file: E:\mbiek\foo.pf J0000100: Template file: E:

Inno Setup: How to pass variable from [Code] to [Run]

Inno Setup: How to pass variable from [Code] to [Run]

How can I pass a variable from [Code] section to parameters in [Run] section in Inno Setup?Basically, I want to do the following.Get and save user input to a variable in a procedure InitializeWizard.Pass the user input to an executable in [

Remove double quotes from string

Remove double quotes from string

I'm trying to grab data from a MySQL database and use Ruby to reformat it into a flat text file. Some of my MySQL data contains double quotes like so: Matthew "Matt" Perryand I need to remove those quotes and replace them with something el

In PHP, how can I add an object element to an array?

In PHP, how can I add an object element to an array?

I'm using PHP. I have an array of objects, and would like to add an object to the end of it.$myArray[] = null; //adds an element$myArray[count($myArray) - 1]->name = "my name"; //modifies the element I just addedThe above is functional, but

yylval and union

yylval and union

What is the purpose of union in the yacc file? Is it directly related to yylval in the flex file? If you don't use yylval, then you don't need to use union? 1:The purpose of the union is to allow storing different kind of objects into

RestSharp Deserialization with JSON Array

RestSharp Deserialization with JSON Array

I have a JSON response that I'm trying to deserialize with RestSharp, and it looks like this:{"devices":[{"device":{"id":7,"deviceid":"abc123","name":"Name"}}, {"device":{"id":1,"deviceid":"def456","name":"Name"}}],

Inconsistency in WPF command routing behavior depending on the UI focus state

Inconsistency in WPF command routing behavior depending on the UI focus state

I have a RoutedUICommand command which can be fired in two different ways:directly via ICommand.Execute upon a button click event;using declarative syntax: .The command is handled only by the top window: The first approach only works if

Is there a standard date/time format that can be passed on a URL?

Is there a standard date/time format that can be passed on a URL?

Looking at the DateTimeFormatInfo documentation, it appears that all the standard formats have colons in them, which makes passing them on a url unpleasant/impossible.Is there a standardized format for passing a datetime on a url, preferabl

Custom html helpers in MVC 4

Custom html helpers in MVC 4

I created the helper classnamespace SEM.API.Helpers{ public static class Navigation { public static string BuildSomething(this HtmlHelper helper) { return "empty"; } }}And added the namespace to webc

Java: Adding fields and methods to existing Class?

Java: Adding fields and methods to existing Class?

Is there, in Java, a way to add some fields and methods to an existing class?What I want is that I have a class imported to my code, and I need to add some fields, derived from the existing fields, and their returning methods.Is there any w

How can I access OAuth's state parameter using Passport.js?

How can I access OAuth's state parameter using Passport.js?

I'm using Passport.js to do authentication, and per Google's OAuth2 documentation, I'm passing in a state variable:app.get('/authenticate/googleOAuth', function(request, response) { passport.authenticate('google', { scope: [ 'ht