Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
Scratching my head a bit with this one folks!
I'm using the Wordpress API to return posts & comments, which I then need to add to a local database (MySQL) using ColdFusion. I keep hitting a stumbling block with the dates returned though.
I'm using cfhttp with the API, then DeserializeJSON to work with the data returned.
An example date being returned is - 2013-06-25T17:20:24+01:00
When I run #CreateODBCDateTime(thedate)# I get the following error;
2013-06-25T17:20:24+01:00 is an invalid date or time string.
I'm pretty sure I've worked with dates in this format the same way before, without any errors - so I can't see why this one is failing.
Here is valid code to reproduce the issue.
<cfset theDate = '2013-06-25T17:20:24+01:00'>
<cfdump var="#CreateODBCDateTime(theDate)#">
Well I didn't spot this when I searched before posting, but I saw it appear in the 'related' area - ColdFusion - DateTime Format with GMT offset
The top solution, using the UDF has sorted the issue for me.
I would use the parseDateTime function
<cfset myDate = '2013-06-25T17:20:24+01:00'>
<cfset myDate = parseDateTime(myDate)>
<cfdump var="#myDate#">
This dumps out {ts '2013-06-25 11:20:24'}
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I'm writing a simple little program ... when I'm trying to email this info. from that form, I got that type of error
I'm writing a simple little program ... when I'm trying to email this info. from that form, I got that type of error
The function send_mail has the following signature:
send_mail(
subject, message, from_email, recipient_list, fail_silently=False,
auth_user=None, auth_password=None, connection=None, html_message=None
)
That means your call is equivalent to the following:
send_mail(
subject='Follow up required for - ' + name,
message=phone,
from_email=address,
recipient_list=message,
fail_silently=scheldule,
auth_user=time,
auth_password=email,
connection=['fidtestwebsite#gmail.com'],
fail_silently=False,
)
Maybe you can already see what is going wrong - the order you are passing in the parameters is important. Here, you are passing in the message as recipient_list, which I would guess is not your intention, and the error "send_mail got multiple values for argument fail_silently" comes from passing scheldule in place of fail_silently as a positional argument, and then again at the end as a keyword argument. There can only be one value for each argument.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I plan on having a massive JSON, ~20MB, and I am creating a React Native App using the JSON. I want to have the app:
Download only the changes to the JSON.
or at least
Download only if changes have been made (which will be less than once a month).
If there is something better than Firebase I would be fine switching over to that.
I had the same issue, a huge JSON object which change once a week. the way that I solved this issue is as following
lets say that we have an object O ~20MB
I created in my firebase db the object data = {raw: O, update: Date()}
on the client side I checked /data/update and compare it to the user localStorage. if it changed I replaced the user`s localstorage object, otherwise skipped.
In this way you dont need to download the whole O only to fetch the date object
it looks like
const {update, raw} = localStorage.fetch('/data')
const last_update = firebase.fetch('/data/update')
if(update === last_update){return raw}
const new_raw = firebase.fetch('/data/raw')
localStorage.save('/data', {update: last_update, raw: new_raw})
return new_raw
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am running the folliwing code:
trial = read.csv("trial.csv",
header = TRUE,
sep = ",",
na.string = "NA",
skip = 0,
strip.white = TRUE,
stringsAsFactors=FALSE
)
which I've successfully run for 3 previous datasets. No problem, I eventually merged them and did my stuff.
However, on this one I can't understand what's going on: the dataset doesn't open. I've tried to see which column was giving me the problem and it is the sixth
x<-trial[6]
which is the only numeric one. So i thought it was a conversion problem (the string one, even if I put the code in the import one.
But it is not this problem, since when I run
str(trial)
it gives me num, as it should.
It's been a week I've been trying to solve this apparently simple problem but I can't pull though.
EDIT2 The IMF dataset I0m using can be freely downloaded at this link. You need to register (free) to do the bulk download at the top right. I'm not sure if this is the right way to link a dataset, pls let me know.
When you download the dataset, just choose one country (e.g. Italy) and leave the option "all indicators".
EDIT. There is no shown error message.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
This is fairly interesting. Flash CS6 has suddenly lost the ability to iterate through objects and delete their values (which did work before)
Delete all values from object keys
for each(var key:String in ScoreKeep.scoreCard)
ScoreKeep.scoreCard[key] = 0;
The object (ScoreKeep.as)
static public var scoreCard:Object = {
"Fish":6, "Golfball":2, "Gloves":8, "Boot":4,
};
You can trace the object key. The value will still be there.
You are using it wrongly, it is not supposed to be for each but for. for each would take the value, not the key.
You also have a "," after the last prop in your object, I assume that's a typo (and should result in a compile-time error).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a database with products.
I need to add to name of products some string.
Example:
product name "abc1", "abc2", "abc3"
new products name: "Super abc1", "Super abc2", "Super abc3"
Use MySQL's concat().
If you want to update :
update tablename set column=concat('Super ', column);
You can even add a where clause .
update player
set productName= concat("super ",productName)
You need to use CONCAT function
SELECT CONCAT('Super ',columnWithABc) from tab