Hi,
For Sqilte3 C API, I would use sqlite3_last_insert_rowid. How to get this id when using ActiveRecord after insert a new record? I use following way to insert a new record :
Section.new |s|
s.a = 1
s.b = 2
#I expected the return value of save to be the last_insert_id, but it is NOT
s.save
end
I have processed a SSAS cube. After it was done processing, I hit the close button - and then realized that I should have saved the output.
I think SSAS stores the processing log as a text or XML file, but I do not know what folder to look into.
Can someone direct me to retrieving processing logs?
I have 3 text boxes for a phone number. As the user types, it automatically moves from one textbox to the next. When the user presses backspace, I can move focus to the previous text box. The problem is that in IE, focus is set to the beginning of the text box. Here's my code, which works fine in chrome.
$('#AreaCode').live('keyup', function (event) {
if ($(this).val().length == $(this).attr("maxlength"))
$('#Prefix').focus();
});
$('#Prefix').live('keyup', function (event) {
if (event.keyCode == 8 && $(this).val().length == 0)
$('#AreaCode').focus();
if ($(this).val().length == $(this).attr("maxlength"))
$('#Number').focus();
});
$('#Number').live('keyup', function (event) {
if (event.keyCode == 8 && $(this).val().length == 0)
$('#Prefix').focus();
});
How do I make the focus set at the end of the contents when going backwards?
I need to create a php search function for names and need to change LastName, FirstName into LastName..FirstName to search the database. I don't know if this helps, but the string will originally be in the form a variable ($Client).
I need the syntax for the three statements that find the string, matches, and makes the changes.
The webViewDidFinishLoad message seems to be sent each time any object in the page has been loaded. Is there a way to determine that all loading of content is done?
I need some advice
I have two tables, one holds unique serial numbers of items (items) and the other holds status changes and other information for these items (details)
The Tables are set up as follows
Item
itemID
itemName
itemDate
details
detID
itemID
modlvl
status
detDate
All items have at least one record in the details table, but over time the status has changed or the modification level has changed (Both of these are identified by numbers which are held in other appropriate tables) and a new record is created each time the status/modlvl changes
I want to display a table on my webpage using php that identifies the different mod levels of the items and shows a count of each of the current status of the items
EDIT
Hi Ronnis,
This is an example of the data in the tables and what I want to achieve
The current Mod Levels range from 1 to 3
Status representations are
1 In Use
2 In Store
3 Being repaired
4 In Transit
5 For Disposal
6 Disposed
7 Lost
Item
itemID OrigMod created
1000 1 2009-10-01 22:12:12
1001 1 2009-10-01 22:12:12
1002 1 2009-10-01 22:12:12
1003 1 2009-10-01 22:12:12
1004 1 2009-10-01 22:12:12
1005 1 2009-10-01 22:12:12
1006 1 2009-10-01 22:12:12
1007 1 2009-10-01 22:12:12
1008 1 2009-10-01 22:12:12
1009 1 2009-10-01 22:12:12
1010 1 2009-10-01 22:12:12
Details
detID itemID modlvl detDate status
1 1000 1 2009-10-01 1
2 1001 1 2009-10-01 1
3 1002 1 2009-10-01 1
4 1003 1 2009-10-01 1
5 1004 1 2009-10-01 1
6 1005 1 2009-10-01 1
7 1006 1 2009-10-01 1
8 1007 1 2009-10-01 1
9 1008 1 2009-10-01 1
10 1009 1 2009-10-01 1
11 1010 1 2009-10-01 1
12 1001 1 2010-02-01 2
13 1001 1 2010-02-03 4
14 1001 1 2010-03-01 3
15 1000 1 2010-03-14 2
16 1001 2 2010-04-01 4
17 1006 1 2010-04-01 2
18 1001 2 2010-04-03 2
19 1006 1 2010-04-14 4
20 1006 1 2010-05-01 5
21 1002 1 2010-05-02 2
22 1003 1 2010-05-10 2
23 1010 1 2010-06-01 2
24 1006 1 2010-06-18 6
25 1010 1 2010-07-01 7
26 1007 1 2010-07-02 2
27 1007 1 2010-07-04 4
28 1003 1 2010-07-10 2
29 1007 1 2010-07-11 3
30 1007 2 2010-07-12 4
31 1007 2 2010-07-15 2
32 1001 2 2010-08-31 1
33 1001 2 2010-09-10 2
34 1001 2 2010-10-01 4
35 1008 1 2010-10-01 2
36 1001 2 2010-10-05 3
37 1008 1 2010-10-05 4
38 1008 1 2010-10-10 3
39 1001 3 2010-10-20 4
40 1001 3 2010-10-25 2
Using the tables above I want to get this result
MoLvl Use Store Repd Transit Displ Dispd Lost Total
1 3 3 1 0 0 1 1 9
2 0 1 0 0 0 0 0 1
3 0 1 0 0 0 0 0 1
Total 3 5 1 0 0 1 1 11
Please answear me how can i access the ListView in controlTemplate, or what event handler to use for extracting sender parameter that will be called every time my Collection is updated. Please give a solution! I make brainstorming for a week already!!
I have a whole bunch of percentages stored as XX% (e.g. 12%, 50%, etc..) I need to remove the percentage sign and then multiply the percent against another variable thats just a number (e.g. 1000, 12000) and then output the result. Is there a simple way to strip the percentage sign and then calculate the output with PHP? Or should I consider some sort of JS solution?
Hello,
This is the final output
My HTML
<li id='$id'>TEXT
<ul class='indent'>
<li id='$id'>TEXT</li>
<li id='$id'>TEXT</li>
<li class='formContainer'> FORM </li>
</ul>
</li>
I want to append a li between form after all other li So in this example new li will be appended between Test141 APPEND Input Box
The $id are db ids of li which are unique
Say you have an array, data, of unknown length. Is there a shorter method to get elements form a starting index to the end than
subdata = data(2:length(data))
I would like to use the EmailField in a form. However, instead of only storing
[email protected]
I want to store
"ACME Support" <[email protected]>
The reason is, that when I send email, I would like a "friendly name" to appear.
Can this be done?
My ideal workflow would consist of the following steps
edit the code
compile
git commit -a -m "commit message"
start running the new binaries, tests, etc. (may take 10+ minutes)
start new changes, while the binaries are still running
when step # 4 is finished, edit the commit message from step # 3, without committing the changes introduced in step # 5, by adding, say, "test FOO failed"
I cannot use git commit -a --amend -m "new commit message", because this commits the new changes as well. I'm not sure that I want to bother with staging or branching. I wish I could just edit the commit message without committing any new changes. Is it possible?
Hi,
This is the output of my 'git log'. But when I do a 'git pull' , the top commit causes conflict. So I did a 'git rebase -abort'
commit 7826b25db424b95bae9105027edb7dcbf94d6e65
commit 5d1970105e8fd2c7b30c232661b93f1bcd00bc96
But my question is Can I 'save' my commit to a patch and then do a git pull?
Just like I want to emulate
* I did not do a git commit, but I did a 'git stash' instead
* Do a git pull so that I should not get any merge error
So I need to somehow 'turn back the clock'. Is that possible in git?
I am initialising a StringBuilder as follows:
StringBuilder builder = new StringBuilder("Symptoms are ");
After this I loop through a list and add each string item to the end using
foreach(var item in list)
{
builder.Append(item);
}
An example item would be something like "headache" but once i've appended it to "Symptoms are " and called builder.ToString() it shows:
"Symptoms areHeadache...etc"
as opposed to
"Symptoms are Headache...etc"
Why is it ignoring the space?
I'm trying to download a lot of files after downloading a sql statement must insert a record.
I'm using System.Net.Client to download each file synchronously, still it could be done asynchronous. There's no relation or dependency between each download.
At first I just tried to use WebClient.DownloadFileAsync but that shutted the program down and killed all the download processes/threads. Second I tried to create a wait routine something like this;
while (processedFiles < totalFiles)
Thread.Sleep(1000)
This freezed everything. So could someone tell me which aproach to take to implement this Async?
Please consider the below simple code:
thrust::device_vector<int> positions(6);
thrust::sequence(positions.begin(), positions.end());
thrust::pair<thrust::device_vector<int>::iterator, thrust::device_vector<int>::iterator > end;
//copyListOfNgramCounteachdoc contains: 0,1,1,1,1,3
end.first = copyListOfNgramCounteachdoc.begin();
end.second = positions.begin();
for(int i =0 ; i < numDocs; i++){
end= thrust::unique_by_key(end.first, end.first + 3,end.second);
}
int length = end.first - copyListOfNgramCounteachdoc.begin() ;
cout<<"the value of end -s is: "<<length;
for(int i =0 ; i< length ; i++){
cout<<copyListOfNgramCounteachdoc[i];
}
I expected the output to be 0,1,1,3 of this code; however, the output is 0,1,1. Can anyone let me know what I am missing? Note: the contents of copyListOfNgramCounteachdoc is 0,1,1,1,1,3 . Also the type of copyListOfNgramCounteachdoc is thrust::device_vector<int>.
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id() but this only work after I have made an entry
Can anyone help please
thanks
Hi, i've got stuck with substring.
On input i've got a string that looks like Sometext (123456). Those digits at the end are random. I need to get only text from that string.
Hi folks,
I wanna have a drop down that lets me select "Week Commencing Monday the 20th" going back 10 Mondays but I'm not sure how to go about doing this.
I've used date.now(), etc. before but not sure how to do this one.
Thanks,
Billy
Let's assume I have a database with two tables: categories and articles. Every article belongs to a category.
Now, let's assume I want to fetch the latest article of each category that fits a specific criteria (read: the article does). If it weren't for that extra criteria, I could just add a column called last_article_id or something similar to the categories table - even though that wouldn't be properly normalized.
How can I do this though? I assume there's something using GROUP BY and HAVING?
I have an excel spreadsheet with about 700 entries. The names are listed as "DOE JOHN" (no comma separating the names). I need to format them so they read JOHN DOE.
1.) I would like to learn how to do this in excel.
2.) I would like to learn how to do this in linux.
Thanks!