best design for parse

G

GS

oops. Please pardon my bad typo and proof reading
I see the code (you put a lot effort in) does work on a lot of cases. much
appreciated.

However would it not be better we get assistance from user who knows what
date format being used?

That is the rationale I let user somehow pick the date format mask.
Guessing date format is tough to master for all cases. Not only months,
days can be
indeterminate at times; worse when 2 digit year is used. I have seen some
sample data that is way out of ordinary date format commonly seen in US.

Relying the first 1 or 2 being numeric would miss out quite a few cases.
Nonetheless. the code can be a default process in absence of user spec. .
thank you
very much for that

Sorry for misleading you with incomplete data samples.
There are sample data set where the first column is not date. on the other
sometimes first 2 columns can also be dates as well as rarely another column
else where can to date. this sound incredulous but that's what users have
to contend with.
 
S

Stephany Young

Now I'm confused.

You have being the impression that you don't have any control on how the
data is 'gathered'.

Now you seem to be saying that you do have control.

If that is the case simply validate the data at the time the user inputs it.

If that is not the case then I think it's time you explained the big
picture.
 
K

kgerritsen

Cor said:
Stephany,

I am curious, what does this phrase mean, I don't know it.


(Living in Holland which is above one of the former biggest gasbells of
Europe)

Cor

It's somewhat, in some senses but not perfectly, an opposite of
"gezellig"

:)
 
C

Cor Ligthert [MVP]

GS,

You are assuming something that is standard. For today I can write in my
country

9-1-07
09-1-07
9-01-7
09-1-2007
9-jan-2007
9-januari-2007
etc. not any law tels me how to do it, it is not seldom done as
2007-01-09 as well in ISO.

And than every culture has its own style.


Cor
 
S

Stephany Young

If my understanding of the meaning 'gezellig' is correct, then 'cooking with
gas' is nothing like any sort of opposite of 'gezellig'.

My understanding of 'gezellig' is that, although not directly translatable,
means something like 'feeling good amongst family and/or friends' but has
much more subtle meanings than that.

'Cooking with gas' means to be working fast/proceeding rapidly. For example:

After working with thos old hand tools, power tools will
make you feel like you are really cooking with gas.

Metaphorically it is comparing a gas cooker where you get instant heat when
you light it, to other cookers (electric, wood coal, etc) where they take a
while to warm up.
 
G

GS

you're right every culture has it won style.

However the current project charter covers only data from
professional/commercial site with reputation of accuracy of date format
and content
other application that has consistent date format
of course if we can cover other unusual date format variations without
exceeding budget, it will be welcomed but I sure don't want to get involved
until everything is completed for the charter.

the date in the data gathered by user ( they don't key directly, thank
goodness)do fall in 2 digit day and month, standard English 3 letter month
or full months - no spelling errors. The users don't really enter the data.
user controls the site the application to visit. One way or another user
specify a date format mask for the data to be processed

NO the component and application is not expected to handle spelling error
but expected to deal with common date format in US, Canada(English ). There
may be more later on but that is not my worry for this project scope.

thanks to the aborted metrication (and so call freedom of speech) there are
a few more variants of date format from US.


As of yyyy-mm-dd format is a safe common format to use in N. America for
software published by Microsoft. I have yet to seen any Microsoft
application fails to convert the yyyy-mm-dd string to date properly among my
users base unless they arbitrary to set the windows date format to
yyyy-dd-mm

I suppose using yyyy-MMM-dd as the remediate string date will avoid that
issue al together

The real tricky part is to validate the users' date format mask against
actual data found. that is why regex replace was tempting to me


you are right regex replace will still not be able handle all mistakes
 
C

Cor Ligthert [MVP]

GS,

In my idea dit you not see my first advice just checking agains the DateTime
with TryParse will give you direct the idea if the dateTime can be valid.

Another addition. Canada(English) has AFAIK the same date time patern as all
former and current Gemenebest members in the parts where English is the
spoken languages.

Cor
 
C

Cor Ligthert [MVP]

Stephany,

Living in a country where Gas is the same as the most ordinair basic stuff,
does your sentence not add anything than not "gezellig".

Sitting at an open fire in a open wood and talk with each other is more
something for us as gezellig, for which we by the way have to go out of our
country if we don't do it illegal or are really rich enough.

If I am well informed, than you are not living in a country with not so much
people on a square kilometre as here, so the idea about that can be
completely opposite.
After working with thos old hand tools, power tools will
make you feel like you are really cooking with gas.

Some people can make a methaphoor to simple task fullfiling drag and drop
tools, I can assure you that I find that far from gezellig.

:)

Cor
..
 
S

Stephany Young

Let me put it this way:

You are working on a project and you are unable
to make any progress because you are waiting on
some vital information. At this point you are
'bogged down'.

The information that you are waiting on arrives,
and, as a result, you are now able to make rapid
progress toward completion of the project. Now
you are 'cooking with gas'.

'Cooking with gas' is to do with the 'rush' of activity.
 
C

Cor Ligthert [MVP]

Stephany,

I had understood this sentence already the moment you had placed it.

However this was really a statement I had never seen (it exist before you
start to correct me). I could not resist to write as I did.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top