An existing DB schema has unique, non-primary, keys, and some foreign keys that rely on them.
Is it possible to define unique keys, alongside primary keys, in Entity Framework v4? How?
When I run Book.scoped({:conditions => ['books.index LIKE ?','%query%']}) I get:
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "index": syntax error: SELECT * FROM "books" WHERE (books.index like '%query%')
What am I doing wrong?
I'm trying to use the replace function in JavaScript and have a question.
strNewDdlVolCannRegion = strNewDdlVolCannRegion.replace(/_existing_0/gi, "existing" + "newCounter");
That works.
But I need to have the "0" be a variable.
I've tried:
_ + myVariable +/gi and also tried
_ + 'myVariable' + /gi
Could someone lend a hand with the syntax for this, please. Thank you.
Related to my other question: What's the best way to layout a C# class?
Is there a way in ReSharper to define the order you want your members to be in, so that ReSharper will maintain it?
I need to port this following from Oracle syntax to Postgresql. Both FLO_END_DT and FLO_START_DATE are of type DATE in Oracle, and TIMESTAMP WITHOUT TIME ZONE in Postgresql:
SELECT
TRUNC( TO_CHAR(ROUND(( FL.FLO_END_DT- FL.FLO_START_DT)* 24), '9999D99'),2)
FROM
FLOWS FL
I am not familiar enough with Oracle to know what it is trying to accomplish.
Any ideas?
I am looking for a Java equivalent to .NET's Snippet Compiler. Is there any such utility out there? That or a really light weight Java IDE for Windows? Eclipse and NetBeans seem too heavy-weight to practice basic syntax.
I am looking up all Organizations with the url "http://", and updating their attributes to "".
My attempt:
Organization(:all).select { |o| o.url = "http://" ? o.update_attribute("url","")}
Which returns a compile error:
SyntaxError: compile error
(irb):2: syntax error, unexpected '}'
from (irb):2
Any ideas?
Why doesn't this work?
define("STR_TEST", "qwerty");
class Test
{
public $arrTest = array(
"test"=>"Bla bla bla ".STR_TEST
);
}
$objTest = new Test();
print($objTest->arrTest["test"]);
I'm trying to build a basic POP3 mail client in C/++, but I've run into a bit of an issue. Since you have to define the buffer size when building the program, but a message can be arbitrarily large, how do you, say, get the mail server to send it to you in parts? And if this isn't the correct means of solving the problem, what is?
And while I'm here, can anyone confirm for me that RFC 2822 is still the current document defining email layout?
Thanks
Hi,
I have queries that are built like this:
public static List<MyObjectModel> GetData (int MyParam)
{
using (DataModel MyModelDC = new DataModel())
{ var MyQuery = from....
select MyObjectModel { ...}
}
return new List<MyObjectModel> (MyQuery)
}
}
It seems that using compiled linq-to-sql queries are about as fast as stored procedures and so the goal is to convert these queries into compiled queries. What's the syntax for this?
Thanks.
The line cmd.ExecuteNonQuery();
cmd.CommandText
CREATE TRIGGER subscription_trig_0 ON subscription AFTER INSERT AS UPDATE user_data SET msg_count=msg_count+1 FROM user_data
JOIN INSERTED ON user_data.id = INSERTED.recipient;
The exception:
Incorrect syntax near the keyword 'TRIGGER'.
Then using VS 2010, connected to the very same file (a mdf file) I run the query above and I get a success message. WTF!
Hi all,
Quick question: How do I specify the number of characters in a split window? C-x-3 Splits my window into two windows evenly, but a subsequent split will split one of the windows in half. I'd like 3 equal sized windows. The documentation says that I should be able to specify the number of characters for the left buffer as a parameter, but I cant seem to get that to work. Any ideas for syntax?
Thanks.
I consider myself quite fluent in PHP and am rather familiar with nearly all of the important aspects and uses, as well as its pratfalls. This in mind, I think the major problem in taking on Perl is going to be with the syntax. Aside from this (a minor hindrance, really, as I'm rather sold on the fact that Perl's is far more readable), what are some key differences you think I should make myself aware of prior to taking on the language?
def merge(l1,l2):
i=0;
while((l1[i]!=none)||(l2[i]!=none)):
SyntaxError: invalid syntax
being a newbie i can't figure out whats wrong with the abouve code.
Backbone's documentation states:
The events property may also be defined as a function that returns an events hash, to make it easier to programmatically define your events, as well as inherit them from parent views.
How do you inherit a parent's view events and extend them?
Parent View
var ParentView = Backbone.View.extend({
events: {
'click': 'onclick'
}
});
Child View
var ChildView = ParentView.extend({
events: function(){
????
}
});
I’m looking at some C# code, and have come across the following statement:
#if DEBUG
// Do something here
#else
// Do something else
#endif
I assumed that DEBUG would be a defined somewhere as follows:
#define DEBUG
But I’m unable to find such a definition, although the code seems to behave as though it were set. Is DEBUG a special case, and if so, how is it set / unset?
I have three types of users: A, B, C .. Hence a user base class and then we have 3 derived classes. However it is possible for a user to be of 2 types at the same time. How would we go about dealing with this in a decent fashion, keeping in mind the type(s) of the user will define the kind of access they have in an application.
how to load the other HTML page when i click a button? i'm using GWT 2.0.3.
p.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
// is there a syntax to load other HTML?
}
});
thanks before, Rafael.
I'm making a very simple content-management system in Javascript. It uses plugins which are individual .js files which live in a "modules" folder. Currently I'm loading them with JQuery's getScript() function, but I have to manually define the list of available modules.
Is there any way to dynamically load the list of Javascript files so that the user can install additional modules by simply dropping them into the "modules" folder?
I was amazed to find out that apparently Eclipse doesn't come with a decent HTML editor by default (it opened my .html file in some kind of browser view and apparently tried to render it). And the basic text editor is not good enough (I need at least some syntax highlighting and automatic indenting).
Any suggestions?
I have an Excel worksheet where the user enters certain data, which I want to store in a text file and upload to a server using FTP. One site suggested adding a reference to "Microsoft Internet Transfer Control" and then define an "Inet" object to do the FTP. However, I am unable to find a reference with this name in "Tools - References" in the VB Editor. Does anyone know of a solution for this problem? Thanks in advance.
So, Im a beginning C# programmer. I know basic syntax and simple things like if statements and loops(methods and classes too). I've only used console apps right now havent bothered with windows forms yet.
So any simple app ideas that introduce new things important for C# programming.
Also, NO tutorials. I want to make all by myself.
How to use kyewordsearch query in c# to implement the Search object. What settings need through Central administration to enable kyewordsearch query ?
Also please send me Syntax for KeywordQuery.QueryText. means how to write query ?
I'm trying to learn how to use keys and to break the habit of necessarily having SERIAL type IDs for all rows in all my tables. At the same time, I'm also doing many-to-many relationships, and so requiring unique values on either column of the tables that coordinate the relationships would hamper that.
How can I define a primary key on a table such that any given value can be repeated in any column, so long as the combination of values across all columns is never repeated exactly?
Alright, I have tried a bunch of times the
python setup.py install
command from my command prompt, and this is what I'm getting:
SCREEN
And when trying this:
from SimPy.Simulation import *
on Idle, I get this:
Traceback (most recent call last):
File "C:/Python30/pruebas/prueba1", line 1, in <module>
from SimPy.Simulation import *
File "C:\Python30\SimPy\Simulation.py", line 320
print 'SimPy.Simulation %s' %__version__,
^
SyntaxError: invalid syntax
>>>