Hello,
I how do I find the last but one character in a string in VB.net.
for e.g. I have a string Dim strTicket as string="56789-091F0"
I want the value "F"
Thanks for your help in advance.
Hi. I have to select the last two records for every topic.
ex:
table: msg
id | topic_id
------------
1 | 1
2 | 1
3 | 1
4 | 1
5 | 2
6 | 2
7 | 2
8 | 3
9 | 3
10 | 3
I want to obtain these rows:
3 1
4 1
6 2
7 2
9 3
10 3
How can I do this?
thanks
I have timestamp in DB like: 1268085720, its 2010-03-08 23:00, so its today.
How can i add one year, and to be the last day in the same month, and need to convert it like: YYYY-MM-DD HH:MM?
For given example i need 2011-03-31 23:59.
Thanks
If I have a string that looks like either
./A/B/c.d
OR
.\A\B\c.d
How do I get just the "./A/B/" part? The direction of the slashes can be the same as they are passed.
This problem kinda boils down to: How do I get the last of a specific character in a string?
Basically, I want the path of a file without the file part of it.
Hey there,
I have the following markup: http://www.webdevout.net/test?011
As you can see, the "li" element is overlapping the rounded borders defined for the box.
Is there a way to prevent this apart from applying the corner directly to the last "li"?
Thanks
I'm trying to mash all my changes since I last pushed to the svn server into one big patch that I can email to my coworker for review. Can I do this with git format-patch ?
How can i return Last Insert Id on my store procedure using MySQL and use them with Nhibernate?
When i am inserting recording using Nhibernate + mysql store procedure then i am getting error that result not found
IQuery qry = session.CreateSQLQuery(string.Format("{0})", qryString)).AddScalar("ProductID", NHibernateUtil.Int32);
qry.List();
tx.Commit();
Is there a GetLastInputInfo() equivalent that can be used in Linux?
The intention is to detect the last input time (keyboard or mouse) of the user.
Am using python to script the program.
I am looking for function in postgre that returns last inserted id into table.
In MS SQL there is SCOPE_IDENTITY(). Is something same in PostgreSQL?
Please, do not advise use something like this:
select max(id) from table
what is the best way to extract last 2 characters of a string using regular expression.
For example, I want to extract state code from the following
"A_IL"
I want to extract IL as string..
please provide me C# code on how to get it..
string fullexpression = "A_IL";
string StateCode = some regular expression code....
thanks
I'm frequently using the following to get the second to last value in an array:
$z=array_pop(array_slice($array,-2,1));
Am I missing a php function to do that in one go or is that the best I have?
My table structure looks like this:
create table rankings (
id IDENTITY NOT NULL,
user_id INT NOT NULL,
game_poule_id INT NOT NULL,
rank INT NOT NULL,
insertDate DATETIME NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (game_poule_id) REFERENCES game_poules(id) ON DELETE CASCADE
);
All old rankings of users per game are saved in this table. Now I want to have the last but one rank in the table for all users in a gamepoule.
Has someone an idea how to achive this? Thanks
What's the best way of getting the last item from an iterator in Python 2.6? For example, say
my_iter = iter(range(5))
What is the shortest-code / cleanest way of getting 4 from my_iter?
I could do this, but it doesn't seem very efficient:
[x for x in my_iter][-1]
I have a 512G disk and I want to clear the last 512k bytes at the end of the disk.
I usually clear it by dd if=/dev/zero of=/dev/da0 the whole disk.
Which way is the fastest to do this operation?
In the 5/15 minute scrum meeting the 3 questions are asked.
For the last question
"what impediments are getting in your way"
If a dev has problems - the xyz is going to have problems, this is likely going to draw the meeting out past 15 mins and could go into a hour long discussion.
Is it the scrum masters job to help this user, is there something to stop this from going on more than 15 mins.
Thoughts?
I am trying to delete all worksheet in excel exept last one and save it then move its location. I can not get it took work as it deletes all other worksheets but errors out with and out of range error.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts = False
Set objWorkbook = objExcel.Workbooks.Open("C:\M-tek 10-31-12_Tony.xlsx")
i = objWorkbook.Worksheets.Count
Do while i = i
i = i - 1
objWorkbook.Worksheets(i).Delete
Loop
I have articles table, article_comments.
I want to get the value: last_modified_all of article. I need this value to be the great date of this two:
the last_modified field of articles table.
the last comment of article_comments last_modified column.
Can someone help me? the structure is very simple, and you can guess is without problem.
I'm trying to read a comment that is stored in a mysql table. For some reason I always get a parse error on the last line of the file even if the last line is blank. I'm not sure if it's relevant but the connect.php works for putting the comment into the database. I'm using wampserver to host it and coding it by hand.
I think that's it's something to do with the while loop, when I comment out the while(){ and the } near the end I just get a few missing variable errors as you would expect. I'm quite new to php coding so I'm pretty sure the problem will be something simple that I've either missed or not understood properly.
Anyway, here's my code:
<?php
include "connect.php";
?>
<?php
$sql = "SELECT * FROM main";
$result = mysql_query($sql) or die("Could not get posts from table");
while($rows=mysql_fetch_array($result)){
?>
<table bgcolor="green" align="center">
<tr>
<td></td>
</tr>
<tr>
<td><strong> <? echo $rows['name']; ?> </strong></td>
</tr>
<tr>
<td> <? echo $rows['email']; ?> </td>
</tr>
<tr>
<td> <? echo $rows['comment']; ?> </td>
</tr>
</table>
<?
}
?>
Thanks for the help. :)
I have some problem whith such mysql_query
INSERT INTO table VALUES ('', CURDATE()-1)
why if yesteday is last day of the month
the CURDATE()-1) result is like 2010-04-00
why not 2010-03-31
Hi,
I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the current month selected to be the last calendar i.e. March, April, May instead of the current implementation which is May, June, July.
Greatly appreciate any help!
Hi,
I have a table that looks like this:
----------------------
| DateTime | Value |
----------------------
| 2010-01-01 | 26 |
| 2010-02-01 | 24 |
| 2010-03-01 | 23 |
| 2010-04-01 | 28 |
| 2010-05-01 | 30 |
I need to find if the last three consecutive months have increased in value.
How can I get SQL to check whether the value for each has increased?
If anyone can give me any pointers for solving this problem it would be greatly appreciated!
Thanks
I want to store the last 3 items in an MySQL database in an efficient way. So when the 4th item is stored the first should be deleted.
The way I do this not is first run a query getting the items. Than check what I should do then insert/delete.
There has to be a better way to do this. Any suggestions?