Via jquery / Javascript
Given a number 1234567891234
How can I concat, or truncast By removing the 2 from the left to make that number a valid integer I can insert into MySQL:'
4567891234
Thanks
Trying the following code. But getting 'The argument 1 of the xml data type method "modify" must be a string literal' error. searched alot but cant find any solution for this problem
SET @Path = '/@ParentNodeName/@NodeName/child::*'
SET @x.modify('insert attribute status {sql:variable("@status")}
as first into (' + @Path + ')[1]')
I'm sorry for asking yet another "best [insert-technology] book".
I know a bit of MVC, I want to start a project in MVC 2 and a good book would be really helpful.
Usually, after a while, people come to a consensus what are the top 2-3 books for learning a given technology.
Have you read any ASP.NET MVC 2 book?
I have a lot of legacy Delphi 5 & 6 Code. We want to test this code using the new Microsoft Test Manager (part of VS2010)
To effectively track your testing using this tool you need to use build numbers. To get Delphi 5 or 6 building in TFS Build 2010 is a huge task. One that I am not sure I want to take on.
Is there a way I can just insert my build numbers in to tfs?
I'm using SqlBulkCopy to insert into a table with IGNORE_DUP_KEY on. This means that exceptions aren't thrown when duplicate is encounteredm instead it passes over it and continues.
Is it possible to get feedback on which rows were inserted or not?
How do you execute a Unix shell command (awk script, a pipe etc) on a cluster in parallel (step 1) and collect the results back to a central node (step 2)
Hadoop seems to be a huge overkill with its 600k LOC and its performance is terrible
(takes minutes just to initialize the job)
i don't need shared memory, or - something like MPI/openMP as i dont need to synchronize or share anything, don't need a distributed VM or anything as complex
Google's SawZall seems to work only with Google proprietary MapReduce API
some distributed shell packages i found failed to compile, but there must be a simple way to run a data-centric batch job on a cluster, something as close as possible to native OS, may be using unix RPC calls
i liked rsync simplicity but it seem to update remote notes sequentially, and you cant use it for executing scripts as afar as i know
switching to Plan 9 or some other network oriented OS looks like another overkill
i'm looking for a simple, distributed way to run awk scripts or similar - as close as possible to data with a minimal initialization overhead, in a nothing-shared, nothing-synchronized fashion
Thanks
Alex
Hi,
I have dowload a KissXml project.
I must add all the files to my project (excluding DDXMLTesting).
Sorry for the stupid question but i must insert all class in the classes folder (http://ixhan.com/2010/03/tutorial-of-kissxml-iphone/) or i can do another operation.
Sorry but i'm a beginner programmer for iPhone.
I have set up a SQL link server between an SQLserver 2005 on a W2003 R2 and a SYBASE 12.5.0.2 server on a IBM AIX H70 system.
I use the Sybase ODBC driver 04.20.00.67
The problem is than most of the times (there is no pattern ) when I select rows from a Sybase table I get ONLY ONE ROW without any error. Please note that there is no problem when I insert rows from SQL server to the SYBASE server
I appreciate any possible solutions...
I'm trying to export 2 values from every single item from the combo box field.
I have found two methods to insert items into a combo box:
1) insertItemAt
http://www.verypdf.com/document/acrobat-forms-javascript/pg_0048.htm
2) setItems
http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat9_HTMLHelp&file=JS_API_AcroJS.88.748.html
but neither method allows two parameters (im always get "missing ) after argument list" error from the Acrobat JavaScript Debugger)
Does anyone know of a better solution for this problem? Thanks!
i am having a very irritating problem, when i open a url ( http://celebs.widewallpapers.net/md/a/adriana-lima/1440/Adriana-Lima-1440x900-002.jpg ) in browser, it works fine.. but when i try to access it by telnet on bash, i get 404 not found!!
my exact terminal:
$ telnet celebs.widewallpapers.net 80
HEAD /md/a/adriana-lima/1440/Adriana-Lima-1440x900-002.jpg HTTP/1.0
[enter]
[enter]
HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 23 May 2010 21:36:05 GMT
Content-Type: text/html; charset=windows-1251
Content-Length: 166
Connection: close
please help me with this as i m trying to make a C batch-downloader, which is almost working as same as the telnet.
I've found lots of documentation on how to install com+ components with WiX or an exported msi from dcomcnfg but the problem with these approaches is I can't see where to specify the com+ server.
Currently we register the components with clireg and the -s switch which allows us to specify the com+ server like so:
clireg32.exe BLEH.VBR -s COMSERVER -t BLEH.TLB -d
This is messy to say the least and I've been trying to get this into some automated form of installation that doesn't involve calling a batch file full of clireg32 calls.
Currently WiX is the backbone of our packaging automation so a solution with WiX would be awesome.
Thanks.
Say my application has a "Posts" model, and one of the function is add_post(), it might be something like:
function add_post($data) {
$this-db-insert('posts',$data);
}
Where $data is an array:
$data = array ('datetime'='2010-10-10 01:11:11', 'title'='test','body'='testing');
Is this best practice? It means if you use that function you need to know the names of the database fields where as my understanding of OOP is that you shouldnt need to know how the method works etc etc
Im moving data from one table to another using insert into. in the select bit need to transfer from column with characters and numerical in to another with only the numerical. The original column is in varchar format.
original column -
ABC100
XYZ:200
DD2000
Wanted column
100
200
2000
Cant write a function because cant have a function in side select statement when inserting
I have written a program that creates nodes that in this class are parts of polynomials and then the two polynomials get added together to become one polynomial (list of nodes). All my code compiles so the only problem I am having is that the nodes are not inserting into the polynomial via the insert method I have in polynomial.java and when running the program it does create nodes and displays them in the 2x^2 format but when it comes to add the polynomials together it displays o as the polynomials, so if anyone can figure out whats wrong and what I can do to fix it it would be much appreciated.
Here is the code:
import java.util.Scanner;
class Polynomial{
public termNode head;
public Polynomial()
{
head = null;
}
public boolean isEmpty()
{
return (head == null);
}
public void display()
{
if (head == null)
System.out.print("0");
else
for(termNode cur = head; cur != null; cur = cur.getNext())
{
System.out.println(cur);
}
}
public void insert(termNode newNode)
{
termNode prev = null;
termNode cur = head;
while (cur!=null && (newNode.compareTo(cur)<0))
{
prev = null;
cur = cur.getNext();
}
if (prev == null)
{
newNode.setNext(head);
head = newNode;
}
else
{
newNode.setNext(cur);
prev.setNext(newNode);
}
}
public void readPolynomial(Scanner kb)
{
boolean done = false;
double coefficient;
int exponent;
termNode term;
head = null; //UNLINK ANY PREVIOUS POLYNOMIAL
System.out.println("Enter 0 and 0 to end.");
System.out.print("coefficient: ");
coefficient = kb.nextDouble();
System.out.println(coefficient);
System.out.print("exponent: ");
exponent = kb.nextInt();
System.out.println(exponent);
done = (coefficient == 0 && exponent == 0);
while(!done)
{
Polynomial poly = new Polynomial();
term = new termNode(coefficient,exponent);
System.out.println(term);
poly.insert(term);
System.out.println("Enter 0 and 0 to end.");
System.out.print("coefficient: ");
coefficient = kb.nextDouble();
System.out.println(coefficient);
System.out.print("exponent: ");
exponent = kb.nextInt();
System.out.println(exponent);
done = (coefficient==0 && exponent==0);
}
}
public static Polynomial add(Polynomial p, Polynomial q)
{
Polynomial r = new Polynomial();
double coefficient;
int exponent;
termNode first = p.head;
termNode second = q.head;
termNode sum = r.head;
termNode term;
while (first != null && second != null)
{
if (first.getExp() == second.getExp())
{
if (first.getCoeff() != 0 && second.getCoeff() != 0);
{
double addCoeff = first.getCoeff() + second.getCoeff();
term = new termNode(addCoeff,first.getExp());
sum.setNext(term);
first.getNext();
second.getNext();
}
}
else if (first.getExp() < second.getExp())
{
sum.setNext(second);
term = new termNode(second.getCoeff(),second.getExp());
sum.setNext(term);
second.getNext();
}
else
{
sum.setNext(first);
term = new termNode(first.getNext());
sum.setNext(term);
first.getNext();
}
}
while (first != null)
{
sum.setNext(first);
}
while (second != null)
{
sum.setNext(second);
}
return r;
}
}
Here is my Node class:
class termNode implements Comparable
{
private int exp;
private double coeff;
private termNode next;
public termNode(double coefficient, int exponent)
{
coeff = coefficient;
exp = exponent;
next = null;
}
public termNode(termNode inTermNode)
{
coeff = inTermNode.coeff;
exp = inTermNode.exp;
}
public void setData(double coefficient, int exponent)
{
coefficient = coeff;
exponent = exp;
}
public double getCoeff()
{
return coeff;
}
public int getExp()
{
return exp;
}
public void setNext(termNode link)
{
next = link;
}
public termNode getNext()
{
return next;
}
public String toString()
{
if (exp == 0)
{
return(coeff + " ");
}
else if (exp == 1)
{
return(coeff + "x");
}
else
{
return(coeff + "x^" + exp);
}
}
public int compareTo(Object other)
{
if(exp ==((termNode) other).exp)
return 0;
else if(exp < ((termNode) other).exp)
return -1;
else
return 1;
}
}
And here is my Test class to run the program.
import java.util.Scanner;
class PolyTest{
public static void main(String [] args)
{
Scanner kb = new Scanner(System.in);
Polynomial r;
Polynomial p = new Polynomial();
System.out.println("Enter first polynomial.");
p.readPolynomial(kb);
Polynomial q = new Polynomial();
System.out.println();
System.out.println("Enter second polynomial.");
q.readPolynomial(kb);
r = Polynomial.add(p,q);
System.out.println();
System.out.print("The sum of ");
p.display();
System.out.print(" and ");
q.display();
System.out.print(" is ");
r.display();
}
}
It seems that we have managed to insert into our database 2 unicode characters for each of the unicode characters we want,
For example, for the unicde char 0x3CBC, we've inserted the unicode equivalents for each of it's components (0xC383 AND 0xC2BC)
Can anyone think of a simple solution for fixing this?
I've come up with something like
SELECT replace(name, CONCAT(0xC3,0x83,0xc2,0xbc), CONCAT(0xc3,0xbc)) FROM lang
For the above, but don't want to have to do this for every unicode character!
I've been asked to write a Windows service in C# to periodically monitor an email inbox and insert the details of any messages received into a database table.
My instinct is to do this via POP3 and sure enough, Googling for ".NET POP3 component" produces countless (ok, 146,000) results.
Has anybody done anything similar before and can you recommend a decent component that won't break the bank (a few hundred dollars maximum)?
Would there be any benefits to using IMAP rather than POP3?
How can I iterate ResultSet ? I've tried with the following code, but i get the error java.sql.SQLException: Illegal operation on empty result set.
while ( !rs.isLast()) {
rs.next();
int id = rs.getInt("person_id");
SQL.getInstance().getSt().execute("INSERT ref_person_pub(person_id) VALUES(" + id + ")");
}
I have the following XML:
<Field FieldRowId="1000">
<Items>
<Item Name="CODE"/>
<Item Name="DATE"/>
</Items>
</Field>
I need to get the FieldRowId using OPENXML. The SQL i have so far:
INSERT INTO @tmpField
([name], [fieldRowId])
SELECT [Name], --Need to get row id of the parent node
FROM OPENXML (@idoc, '/Field/Items/Item', 1)
I've written a PowerShell script to build several .net solutions one after the other. It simply makes several calls to csc.exe to build the .sln files.
Almost every time I run the script one of the solutions fails to build and CSC.exe reports:
error CS1606: Assembly signing failed;
output may not be signed -- The
process cannot access the file because
it is being used by another process.
This happens even though I've closed all instances of Visual Studio holding these solutions and I've none of their exes running on mu machine.
A similar batch file that I've written works just fine. It's only PowerShell that complains about the file being used by another process.
How can avoid having this happen? Are there any better examples out there of building .net solutions through PowerShell?
How can I make a list model from a JList in order to be able to insert an item into it.
I want to use this method: addElement(java.lang.Object item)
I found an explanation here, but the problem is that ListModel is an interface
and even if I write an implementation and override its method, I can't use the addElement() method
I have a form which contains a lot of elements, my DB guy has generated an SP and now i need to call that stored procedure. My form has twenty elements, when i click on submit the data must be saved in database. I know how to do this on insert query, but how to call an SP and perform this operation.
I’m looking for some feedback on mechanisms to batch data from MySQL Community Server 5.1.32 with an external host down to an internal SQL Server 05 Enterprise machine over VPN. The external box accumulates data throughout business hours (about 100Mb per day), which then needs to be transferred internationally across a WAN connection to an internal corporate environment before some BI work is performed. This should just be change-sets making their way down each night.
I’m interested in thoughts on the ETL mechanisms people have successfully used in similar scenarios before. SSIS seems like a potential candidate; can anyone comment on the suitability for this scenario? Alternatively, other thoughts on how to do this in a cost-conscious way would be most appreciated. Thanks!
Hi
I have written a pgsql function along the lines of what's shown below. How can I get rid of the $1, $2, etc. and replace them with the real argument names to make the function code more readable?
Regards
Peter
CREATE OR REPLACE FUNCTION InsertUser (
UserID UUID,
FirstName CHAR(10),
Surname VARCHAR(75),
Email VARCHAR(75)
)
RETURNS void
AS
$$
INSERT INTO "User" (userid,firstname,surname,email)
VALUES ($1,$2,$3,$4)
$$
LANGUAGE SQL;