I have a date/time string like this: 180510_112440 in this format ddmmyy_hhmmss
I need a snippet for having a string formatted like this way: 2010-05-18 11:24:40
Thanks for help.
may be this question had been asked, I've searched but still not confident about my problem..
my problem is checking valid date from string
$a='23-June-11'; //valid
$b='Normal String';//invalid
I want to convert $a and $b using strtotime()
before I do that, of course i want to validate whether $a or $b is a valid date format
From $a i can get 23, 11 using explode function, but how about 'June'?
using function above, 'June' is not numeric
No, I'm not talking about making a slideshow of pictures. How can I make the actual file that windows (at least windows 7) uses for screensavers?
It is a .scr format, and when I opened it in Notepad, I got a bunch of symbols, with a few words scattered throughout, but that was expected. It looks like it was made with directx, xml, and even assembly (for the shaders) based on the recognizable code there.
I just went on to a site-hosting place and made this:
Link to ribbons.scr code
First, what ScanResult.capabilities actually is? Because I don't have a device, I can't know the format of it.
Second, how to connnect to a specific AP? I look through the api doc but found no method to implement the function. Do I miss something?
Hi again, here is my coding which gives me the error 'warning: unknown conversion type character 0x20 in format'
int subtotal;
long long a,b,c,d,e,f,g,h,i,j,k,l,m;
subtotal = (1*(a+c+e+g+i+k))+(3*(b+d+f+h+j+l));
printf(" = %d % 10 = %d; (10 - %d) % 10 = %lld\n", subtotal,subtotal%10,subtotal%10,m);
any idea why this is wrong?
Hi All,
Please somebody help me.
I want to compress a folder (which contains images & text files as well as few sub folders) in zip,rar,tar format & then give it for download to user.
Is there any class/api/library/code to do so.
I am working on Joomla CMS.
Regards,
Shahu.
I am new in Prolog. I need to declare a function which looks at a list like
[[1, 0, 0], [1, 0, 0], [1, 0, 0]]
and if the value is 0 returns its address(by considering it as a double array).
I wrote a function basicly in the format:
function(..., X) :-
function(called by other values).
How can I write a function, that returns a value when each times it called(recursively). May I get them (in above question) as alternative X's???
I have developed an application using Eclipse IDE. After creating the application I exported the project in jar format. When I am trying to run this jar file, I get the error: Unable to load main class. Please Help.
I anticipate using some images in my Java application. These images will be drawn onto my JPanel using g.drawImage(). The JPanel is resizable and the images should scale as the JPanel increases/decreases in size
Two questions:
What image format is best for this type of desired scalable image? For instance, in this application, an image of size 100x100 may be scaled into an image of size 30x30 or 10x10 or 300x300.
How can I write code to do this scaling?
I'm trying to take a query:
SHOW TABLES;
which will display a bunch of tables with the chat_ prefix. I want to remove the chat_ prefix from the string, format the variable (with a link), and display it. How is this accomplished?
have file data of format
3.343445 1
3.54564 1
4.345535 1
2.453454 1
and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method?
Hi.
In my app, the user is supposed to insert a phone number, which is then displayed somewhere else.
In the contacts application, when displaying a phone number, it automatically appears in the format of the language selected by the user.
Is there a way to do this automatically, or a way to detect the region and then adapt the displayed string?
I have a web service hosted on a web server, I invoke the web service using jquery ajax.
The service returns results successfully when invoked locally from the server, but it fails when invoked from a remote client machine (not in the same domain).
I see the request fail in the firebug returning error (401 UnAuthorized) and the response has the following error (Request format is unrecognized for URL unexpectedly ending in '/List').
I'm still trying to get to grips with PHP, and I'm trying to make a form that uploads a picture to a database. I don't have permissions for move_uploaded_file so I'm using the copy() as an alternative. Everywhere I've seen experiencing similar problems have all been with move_uploaded_file so I'm rather stuck.
Trying to copy the image from the desktop doesn't seem to be working, it's not throwing up any more PHP errors but is displaying the error message for if something goes wrong. The form sends data to two tables in the database but I'm mainly concerned with the upload not working. There's over 200 lines so I'll post a snippet of the upload code, thank you in advance:
function getExtension($str)
{
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
//This variable is used as a flag. The value is initialized with 0 (meaning no error found) and it will be changed to 1 if an errro occures. If the error occures the file will not be uploaded.
$errors=0;
//checks if the form has been submitted
if(isset($_POST['submitted']))
{
//reads the name of the file the user submitted for uploading
$image=$_FILES['image']['name'];
//if it is not empty
if ($image)
{
//get the original name of the file from the clients machine
$filename = stripslashes($_FILES['image']['name']);
//get the extension of the file in a lower case format
$extension = getExtension($filename);
$extension = strtolower($extension);
//if it is unknown extension, class as an error and do not upload the file, otherwise continue
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
{
//print error message
echo '<h1>Unknown extension!</h1>';
$errors=1;
}
else
{
//get the size of the image in bytes
//$_FILES['image']['tmp_name'] is the temporary filename of the file in which the uploaded file was stored on the server
$size=filesize($_FILES['image']['tmp_name']);
//give an unique name, for example the time in unix time format
$image_name=time().'.'.$extension;
//the new name will be containing the full path where will be stored (images folder)
$newname="/home/k0929907/www/uploads/".$image_name;
//verify if the image has been uploaded, and print error instead
$copied = copy($_FILES['image']['tmp_name'], $newname);
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}
}
}
}
i have to convert a video to images i need some help to under stand this phenomenon and guid to code a program for it.
also
which format of video will be more useful for me ?
thanx in advance!
{"paging": {"pageNum":2,"action":"Next","type":"","availableCacheName":"getAllFunds","selectedCacheName":"","showFrom":101,"showTo":200,"totalRec":289,"pageSize":100},
"Data":[{"sourceCodeId":0,"radio_fund":"individua
l","availableFunds":[],"fundId":288,"searchName":[],"fundName":"Asian Equity Fund A Class Income","srcFundGrpId":"PGI","firstElement":0,"las
tElement":0,"totalElements":0,"pageList":[],"standardExtract":true}]
I have json file with above format with two fileds,one paging and one is Data array.
I able to retrieve values of paging,but i am not able to retrieve the values of data array with .each function of jquery.
Any suggestions or inputs really appreciated.
The goal: I want to convert a number from the format "10.234,56" to "10234.56"
Using this simple approach almost gets us there
/([\d\.]+),(\d\d)/ => '\1.\2'
The problem is that the first group of the match (of course) still contains the '.' character.
So questions are:
Is it possible to exclude a character from the group somehow?
How would you solve this with a single regexp
(I know this is a trivial problem when not using a single regexp)
What does this do exactly?
var counts = new Dictionary<string, int>();
for (int i = 0; i < 10; i++)
counts[string.Format("STA Thread Queue Worker Thread No. {0}", i + 1)] = 0;
Thanks
Hi,
I want to extract the status from the string untill I found a timespan. My input is something like "Something in start but not with this keyword of sure. STATUS: My Status Is Here Which can be anything but timespan 23:59:01 and so on. I want to extract the string after STATUS: untill 23:59:01 is found. How can i achieve this through regex. this 23:59:01 is a timespan and it is always in this format hh:mm:ss
Hi
I am planning to try to use XML Serialization in C# but I am wondering if I get a .xml file how do I check if the xml file confirms to the right type?
Like usually you would make a schema that you can validate against to make sure if it confirms to the right format.
Can you hook a schema up to to XML Serialization or does it do this checking automatically?
Thanks
I have a query regarding my report, the report format is as under
**Date** **Received** **Closed** **Pending**
12/01/10 1000 900 100
12/02/10 2000 1000 1000
12/03/10 1500 1300 200
The above report shows the Help Desk tickets Received, Closed, Pending Count as date wise.
How can I create a dynamic SQL query to show above result?
Received Tickets is calculated on SubmitedDate
Closed Tickets is calculated on ClosedDate with status "Closed"
same for Pending Tickets whose status is "Pending".
Please provide me the idea or some sample SQL queries.
I am storing logs in an xml file...
In a traditional straight text format approach, you would typically just have a openFile... then writeLine method...
How is it possible to add a new entry into the xml document structure, like you would just with the text file approach?
I'd like to have a DropDownList that has a CheckBox next to each item that would allow multiple to be selected. I did a little poking around but haven't found anything that will do this, does anyone know if this can be easily achieved?
I know it can be done with a listBox, but would prefer the dropdown format to save space.
i have date in dd/mm/yyyy format. how can i store it in databse, if i fant to do some operations on them after?
for example i must find out the rows, where date > something
what type i must set to date field?
thanks