I am grabbing the last rowid and i am doing this select @@IDENTITY
pk = (long)cmd.ExecuteScalar();
I get an invalid typecast bc this is int instead of long. Why doesnt this return a long? can i make it return long?
Solution for now is to use
pk = Convert.ToInt64(cmd.ExecuteScalar());
How would I print the multiples of a list of given numbers in a merged, sorted list?
I.e.
take 10 (multiples [4,5])
gives
4,5,8,10,12,15,16,20,24,25
I've got it working for lists of size 2 or 1 but I need a more general solution :)
I have deleted a directory which contains a project solution I have added previously to TFS.
It shows a red x icon in front of it but does make it disappear.
How to completely do so (I'm on VS2005) ?
UITableView crashes in endUpdate, called by the Managed Object Context "save" method, when:
1- The Core-Data Store is empty
2- The Fetched Result Controller is configured to show sections
3- Two managed objects (or more) have been added to the store
When I've searched this situation in google. I've found exactly matched error in this post.
It looks like a bug.Is there a any solution to avoid this bug ?
i am here to ask for help again, i created one database for all activities,
the problem i have is that the insertion in every activity comes in with new row, but that's
not what i want, what i am looking for is in the same row in each activity insert the columns
that contains. i already looked for solution here, they are speaking about static reference
but i don't know how to do it! so, is there any ideas ?
static DBAdapter db = new DBAdapter();
Just wondered if anything like that exists? Certainly in Eclipse it does.
A small window like the solution window listing all the methods in the active class would be great
Any ideas?
Thank you
One of my utility jar files is used by different nix scripts, located in different categories. Problem: unable to initialize log4j framework (unable to find log4j.xml). Solution, that allows to configure logger correctly while launching jar classes by different scripts - usage of env vars and force configuring using DOMConfigurtor.configure(pathToConfXml) method. is it possible to avoid path hardcoding and configure logger inside of a script?
Appreciate all your help.
Thanks.
I just wonder how array_diff() works.And obviously it couldn't work as follows
function array_diff($arraya, $arrayb)
{
$diffs = array();
foreach ($arraya as $keya => $valuea)
{
foreach ($arrayb as $valueb)
{
if ($valuea == $valueb)
{
break;
}
$diffs[$keya]=$valuea;
}
}
return $diffs;
} //couldn't be worse than this
Hope someone can show me some better solution.
Thanks.
I need for text like "joe ($3,004.50)" to be filtered down to 3004.50 but am terrible at regex and can't find a suitable solution. So only numbers and periods should stay - everything else filtered. I use C# and VS.net 2008 framework 3.5
I've bounced around between different wrappers, my own, and using straight php mysql functions over the years but I'm sure there's a really good solution out there. What is it? :)
EDIT: Only needs to connect to MYSQL and it would be nice if it was lightweight.
I see so many solution , but none of them was matching my problem .
As i am new to iOS development .
I have a String
abc/_api/web/GetFolderByServerRelativeUrl('Documents/Root Folder/Level 1/Level 2/Level 1-1/Level 1/')/folders.
I want to remove Remove Substring after last "/"
for example my new string should look like this.
abc/_api/web/GetFolderByServerRelativeUrl('Documents/Root Folder/Level 1/Level 2/Level 1-1/Level 1/)
Can someone suggest me the best way to achieve this , thanks ,
ASP.NET MVC - Can i have multiple names for the same action?
In the same controller... Can i have multiple names for the same action?
I am looking for a complete multiple language solution. Essentially the i want all the logic to be sa same but change the "keywords" (actions, controllers in the url) depending on language.
hello
Is there library/header already written to manage C++ objects from C using opaque pointers/handles?
I can write one myself, but I would rather use already made solution, especially if it has fortran bindings.
Thanks
So, I have this source:
http://paste2.org/p/808870
Now, it works getting the source, however, it keeps repeating afterwards. For example:
http://img263.imageshack.us/img263/7259/outputq.png
Notice how it says , then continues? I was wondering how I can avoid that. I know I can limit the buffer, however is there a better solution? Thanks
Building on this question, is there a simple solution for having a multi-key dictionary where either key individually can be used to identify the value?
ie.
MultikeyDictionary<TKey1, TKey2, TValue> foo;
foo.Add(key1, key2, value);
myValue = foo[key1];
// value == myValue
foo.Remove(key2);
myValue = foo[key1]; // invalid, Exception or null returned
I want to retrieve all ids within a certain timespan. The timestamps however,
are stored in a different table:
Table A has column my_id
Table B has columns my_id, timestamp
I would want something like
SELECT
id,
time
FROM
(SELECT my_id AS id FROM A) q1,
(SELECT timestamp AS time FROM B WHERE my_id = id) q2
;
But how can I get the value of id within a different subquery? Is there
an elegant solution for this problem?
I am using Inscript Keyboard to directly type into TinyMCE. However when I click on save, all the characters appear as question marks on website and even in article list on admin side.
How I should solve the problem?
I am specifically talking about Marathi but the problem-solution might be same for all Devnagrari fonts.
Thanks in advance.
The Goal:
On mouseover (or :hover), enlarge the preview image by about 400% and display it in the center of the page
Remove the preview when the mouse leaves
The Problem:
Solutions like FancyBox are too bloated
in FancyBox's case it ignores width and height for image elements, which makes it useless
Most of these "lightboxes" steal focus when they're called
Really, I'm just looking for a simple, efficient solution.
Oops - StackOverflow won't let me post images yet, mockup - http://img685.imageshack.us/img685/7649/idae.png
Is there a way to add files to a zip file from another server with php's zip extension? ie. addFile(array('localfile.txt,'http://www.domain.com/remotefile.txt')) (that obviously does not work)
I suppose I can download the files to a temporal folder and then add them to the zip file, but I was looking for a more automated solution or a function already made
I know that it is very simple question, but I can't find a solution.
I have a main swing dialog and other swing dialog. Main dialog has a button.
How can I make that after clicking a button the other dialog opens?
I have searched much but I didn't find any solution but I god somewhere this example:
ContentValues values = new ContentValues();
values.put(BluetoothShare.URI, "content://" + uritoSend);
values.put(BluetoothShare.DESTINATION, deviceAddress);
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP, ts);
but this example give error unsupported content. please provide me the correct answer.
Thanks in advance
I am creating an inherited form and when i click add, it is showing the message as
"Do you want to open or save the file". The file is tmp_auto.tmp file.
Give me a solution..Thanks..
I am creating an inherited form and when i click add, it is showing the message as "Do you want to open or save the file". The file is tmp_auto.tmp file.
Give me a solution..Thanks..
Also, it shows "Navigation to the webpage was canceled"
I am creating an inherited form and when i click add, it is showing the message as "Do you want to open or save the file". The file is tmp_auto.tmp file.
Give me a solution..Thanks..
Also, it shows "Navigation to the webpage was canceled"