In a url like the one below, I'd like to get the value of ProdId. The URL format will always be consistent, as will the parameter name, but the length of the value may change. It will always be numeric.
http://www.site.com/page.php?ProdId=2683322&xpage=2
Using PHP what's the fastest way to get it (I'll be processing 10,000's so speed is an issue) ?
I have tried:
git archive HEAD --format=zip > archive.zip
:and then I email archive.zip and at the other end they unzip archive.zip into a folder. But when they try any git commands they find out that this does not produce a valid git repository
Intro
When saving png images through GIMP, I've always used level 9 (maximum) compression, as I knew that it's lossless. Now I've to specify compression level when saving png format image through GD extension of PHP.
Question
Is there any case when I shouldn't compress PNG to maximum level? Like any compatibility issues? If there's no problem then why to ask user; why not automatically compress to max?
I have a model 'listing' with a field 'created' which is in a datetime format.
I need to list in a view all listings that were created over 2 weeks ago.
An extra thing if possible is to somehow mark them as expired.
This is in cakePhp 1.27
i have to integrate spatial indexing in mysql .i got an example i almost done it.in that example
INSERT INTO address VALUES('Foobar street 12', GeomFromText('POINT(2671 2500)'));
inplace of 2671 and 2500 i have to insert latitude and longitude in below format
35.177 ,-77.11. How is it possibe .Please help me
I'm trying to make a program so that I can run it through the command line with the following format:
./myProgram
I made it executable and put #!/usr/bin/env python in the header, but it's giving me the following error.
env: python\r: No such file or directory
However, when I run "python myProgram", it runs fine. Can someone tell me what I'm doing wrong?
Hi,
In my table I have a date column which the date is displayed in the format "2009-11-18 10:55:28.370"
How can just get the date value of this field in a select statement. e.g.
select id from risks, where creation_date = getdate()
i always using the following format to use transactionscope.
using(TransactionScope scope = new TransactionScope()){
....
}
sometimes i want to wrap the transactionscope to a new class, for example DbContext class, i want to using the statement like
dbContext.Begin();
...
dbContext.Submit();
it seems the transactioncope class need use "using"statement to do dispose, i want to know if there is anyway not use "using".
So, I made a simple socket server using python. And now I'm trying to structure a proper http response. However, I can't seem to find any sort of tutorial or spec that discusses how to format http responses.
Could someone point me to the right place?
I have the following code snippet:
string tmp = String.Format("javascript:window.open('{0}');", url);
ClientScript.RegisterClientScriptBlock(this.GetType(), "NewWindow", tmp);
the url generated by this code include the port number and I think that is happening becasue port 80 is used by the website and in this code I am trying to load a page from a virtual directory of the website. Any ideas on how to supress the port number in the url string generated by this code?
I need to access a file as text file and want to process it later. But before I fetch it how I can identify a file that I am taking is a text file only. If file is in another format my whole code interpret wrongly. I want to access and process only text file.
Currently i am using:
StreamReader objReader = new StreamReader(filePath);
How can I do so in C# .NET?
I've got an array listing days of the week:
days = ['Monday', 'Tuesday', 'Wednesday']
Whats the easiest / best way to output it in a human readable format:
Monday, Tuesday and Wednesday
The best I have is a rather ugly:
', '.join(days[:-2]+['']) + ' and '.join(days[-2:])
Is there a way in Groovy to get the duration between two Date objects? The duration format I'm looking for would be something like: 2 days, 10 hours, 30 minutes...
Thanks
What is better for PHP developer - Unicode or UTF-8?
I am going to create international CMS. So I am going to have clients all over the werld. They will speak all posible languages.
What encoding format is better for browser recognition and for DB data storing?
I have a paper submission in about 12 hours. I have written references in a separate .bib file in bibtex format. Now please tell how to merge the references with my paper written in MS word in the simplest/ easiest possible manner. I am looking for some automatic tool that does this.
I have never used bibtex before. In fact I came to know about bibtex few hours ago only.
I would like to take all the commit messages in my subversion log and just concatenate them into one text file.
Each commit message has this format:
- r1 message
- r1 message
- r1 message
What I would like is something like:
- r1 message
- r1 message
- r2 message
- r2 message
- r3 message
[...]
- r1000 message
Update
I thought the above was clear, but what I don't want in the log is this type of info:
r2130 | user| 2010-03-19 10:36:13 -0400 (Fri, 19 Mar 2010) | 1 line
No meta data, I simply want the commit messages.
Hi there!
When Flex application make an asynchronus HTTP request, does it add a special header to the request, like some JavaScript framework does? Something that indicates whether this request is an AJAX call/not.
I just want my server side code to return different response format, depending on whether the request is made from browser/flex.
Regards, Andree.
I've been trying to figure out how to parse textures in directx for two reasons: to write my own texture format and to manipulate data in existing IDirect3DTexture9 type textures.
I've been looking at the IDirect3DTexture9::LockRect() function but I'm unsure how it works, are the void* pBits I get out of it in D3DLOCKED_RECT the data in the texture? Does that mean I can read it in by converting it to D3DXCOLOR or something?
Really not sure where to go, any help would be appreciated!
I have been able to read an excel cell value with xlrd using column and row numbers as inputs. Now I need to access the same cell values in some spreadsheets that were saved in .ods format.
So for example, how would I read the value stored in cell E10 from a .ods file from python?
What are your most useful, most practical methods that extends built-in JavaScript objects like String, Array, Date, Boolean, Math, etc.?
String
format
trim
padding
replaceAll & replaceAll
Array
indexOf
Date
toMidnight
Note : Please post one extended method per answer.
Hi i have a column (type date).I want to insert custom date and time without using Preparedstatement .i have used
String date = sf.format(Calendar.getInstance().getTime());
String query = "Insert into entryTbl(name, joinedDate, ..etc) values ("abc", to_date(date, 'yyyy/mm/dd HH:mm:ss'))";
statement.executeUpdate(query);
but am getting literal doesnot match error. so even tried with "SYSDATE".Its inserting only date not time.So how to insert the datetime using java into oracle?please any one help..
I have an sql table with data like this:
| theDate (datetime) | theValue (int) |
----------------------------------------
| 2010-05-17 02:21:10 | 5 |
| 2009-03-12 04:11:35 | 23 |
| 2010-02-19 18:16:53 | 52 |
| 2008-07-07 22:54:11 | 30 |
The dates are stored in UTC format in a datetime column, how can I convert them to local time (Norway)? Remember that the UTC-offset is not the same all year because of winter/summer-time.
I am trying to create a .vcf file programmatically in C#, and writing a bunch of strings in the correct format in that file. But when i try to open it manually, the following message appears. Could not start Microsoft Outlook.The file maynot exist, you may not have permission to open it, or it may be open in another program.
Any help!!!