« first day (894 days earlier)      last day (4069 days later) » 

9:00 PM
brb bathroom
 
lool
 
are targetted for .net 2.0
so does VS upgrade makes any sense?
.net 2.0 & 3.5
 
It doesn't make sense to develop for 2.0, IMO.
 
why is that kendall?
is .net 2.0 slow? buggier ?
or what?
 
Because it's so old. New versions have so many more nice features.
Like LINQ.
 
9:02 PM
linq is avail with few work around
 
Uh, what?
LINQ is not available in 2.0.
Why would you use 2.0, anyway?
 
client requirement
they are mostly win XP user
and dont want to install .net 4
 
Tell them they have to.
They will have to sometime anyway.
 
yah
at somepoint they will have to
well, linqbridge works fine for me
 
i still work on .net 2.0 at work, and 3.5
hell, i still work with classic asp lmao
 
9:08 PM
ill soon get started with asp
enough with the windows application !
 
Just last week a guy had to learn Python, because there was a problem with a script, and no one left there knew Python.
 
lol ^
that sucks
 
lolz wth!
 
my networking class uses python
so dumb
 
well, it sucks, but is fun equally!
well, less fun but challenging!
 
9:09 PM
i didn't mean python was dumb, i meant that they make us use python is dumb
 
i have scheduled to learn python in next year
 
The same guy is now writing an integration with some inventorying system. To test, he emails XML back and forth from a developer in Romania.
Poor guy.
 
:(
one of the projects i'm on now, the project leader works out of europe, its so hard to understand them sometimes
 
there are too much technology out thr
 
especially when my dba is out of asia
 
9:11 PM
sometimes i wonder, how much time it takes to learn the major ones
 
depends how much you work with it, if you use it for 8 hours a day, is going to go a lot quicker than working with it for 3 or 4 hours a week
 
i just do it for 2/3 hrs a day
well, being self taught is little hard
 
i was self taught at first too, with php
 
vb6 was my first self taught language
it took me 6 month to learn basic
 
best advice ever: fuck online tutorials. Buy books. Download books. Pirate books. Online tutorials are too shallow to understand the larger picture
that was my problem when I was younger, I would follow online tutorials until I "hacked" things together, or if i did read a book, it was skimming
 
9:13 PM
right said steve! except the f word lolz!
 
Books are great for teaching you how to program. Online resources are great for teaching you how to use a language.
 
^
hit the nail on the head
 
Codecademy is pretty cool too.
 
btw, when i read book , i always look for the book that has more coding then theory
is it a bad way to read book?
 
you want both
 
9:15 PM
any suggestion for book on ado.net
i mean in terms of best practices
 
books to teach you object oriented programming, design patterns, but also books that teach you about a language(or framework), and neat tricks you can do with it
 
why is design pattern so important?
 
in the early 90s a group of people called the gang of four realized that certain problems in software development repeated
 
repeated as in ?
 
You will never fully understand the importance of design patterns until you maintain a project that has none.
 
9:17 PM
and they came up with the best solutions to these problems and wrote a book about them, and ever since they have been pretty popular, its easy to overuse design patterns though
like the observer pattern, you need one object to be notified when another one changes state
that is applied everywhere from mvc to buttons on your gui
 
Kendall can u explain that in simple words?
 
"experience"
 
^
 
lolz!
how much experience?
 
The more, the better.
 
9:19 PM
i mean read a book about design patterns, it will explain more in the first few chapters than having us explain bits and chunks of it in chat
 
i am almost doing this programmin thing for 3 years now
still i feel like idiot at times
 
As a job, or as a hobby?
 
well both
started a hobby
 
every programmer feels like an idiot at times lol
 
Good. :)
 
9:20 PM
well, i cover my education fees with programmin
so u can say both
 
What's the largest project that you are the primary programmer for?
 
but it started as a hobby
all of my work is a standalone project
biggest project has approx 19,000 lines
 
What kind of program is it?
 
thats a decent size
 
well let me be honest
its a bot
which does alot of warez related automation
:P
 
9:22 PM
warez-bb ftw!
 
Do you ever feel like your code is disorganized?
If so, you'll know what I mean.
 
lolz. always
 
pick up an OO book, it'll make you feel much much better :)
 
but somehow, its manageable
 
gotta go home now though bye
 
9:23 PM
c ya steve!
 
UI applications require more design patterns, because they have so many types of components.
 
have a nice day!
any book you want me to read kendall?
i surely wana learn a lot of programmin thing
that too a better way
 
I haven't read a good programming book since I was a noob.
 
is programming all about practice & experience?
and, how long u have been in programming world?
 
I would say 90% of it is.
How long? Depends where the line is.
I wrote my first line of code about 6 years ago.
 
9:27 PM
i mean, for how many years you have been into coding?
 
I got officially hired about 2 years ago.
And I've been working with a 'real' team for over half a year.
 
hmm
its almost 3 AM now
will watch a episode of fringe & then will sleep
@KendallFrey - thanks a lot, you cleared a lot of confusion's!
 
I was coding (poorly) probably when I was 10.
I remember when my mother sat me on her knee and showed me how a FOR loop worked in Commodore 64 BASIC.
I thought "this will save me all sorts of time!" (my program at the time was one that I required to print my name out many times in different colors)
 
10:31 PM
books are no longer necessary to learn
to learn programming anyway, more tutorial videos on asp.net and youtube then you can shake a stick at
 
aaah stop trolling
 
who is trolling?
 
7 hours ago, by Mike F
visual basic is for dim people
 
oh wait wrong quote
 
10:37 PM
why did you stop at 2457 btw?
 
6 mins ago, by Vortex
books are no longer necessary to learn
i am lazy.
 
I can relate
 
I'm so glad I was in college after the internet started to explode
 
lol ccinc what's wrong with what i said
what I said was a completely valid statement
@CCInc tell me what is wrong with my statement
 
its correct
you just wont get good at it :D
 
10:43 PM
and i think that is incorrect
pracitice makes perfect
all you have to do is learn basics, and practice by making a bunch of difficult apps
 
you are rigjt
 
...and by getting advice from people more experienced
 
i'm 100% self taught and one of the best programmers I know because of my hard work and dedication to my craft over these past 10 years
lol @MikeF that doesn't hurt;)
 
My favorite CS teacher in college was one who walked us through coding examples and interactively asked the class what line of code would go next.
And then explained why it would be bad.
 
Books can still be useful though
 
10:45 PM
@JohanLarsson really only in edge cases these days
the vast majority of problems can be googled these days
 
Hard to Google the same level of depth as you get from reading a book
But view are great
 
again only in extremly complex and edge cases
vast majorities of documentation are online so if you find an answer to a problem and wish to explore it further through documentation you can do that 99% of the time through the web
 
Vids are great on tablet here
 
If you're trying to learn a detailed tutorial of how to use some framework or language, books could be nice. But there's always similar tutorials online, with comments from people who point out flaws.
 
i learned programming through books back when web was on ver 1.0, but these days i learn all new things i need to learn, be it software, or programming, or photosohp through tutorial videos
 
10:48 PM
books take up space.
 
personally i really really really dislike learning through books and even through lecture
i learn the best when i'm given just a summary and told to explore it more on my own
which is exactly what a tutorial video is
a quick walkthrough so you can go try out the stuff yourself in more depth
 
I do about 50/50 books/vids
Also chatting on surface is not working gotta quit:-)
 
lol
almost time for me to go home and play bioshock
 
My last employer had some plans to use IBM Initiate framework for someshit and sent me on some training on it. That stuff was undocumented and unpopular enough that hands-on training was the only real way to learn about it.
 
lol @MikeF at that point i'd leave the company
if any company made me learn some propiatry framework with bad documenation I would quit lol
just toooo many good programming jobs out there these days
 
10:52 PM
Ended up not even using it after our customer had some budget shifts.
 
to not be doing something you truly love all day
lol yep
that's what sually ends up happening
 
anybody feel like helping me with a major brain fart? @RyanTernier I HAVE REQUIREMENTS
 
@Pheonixblade9 - sure
 
cool
so
I have this event that I need to kick off at 6AM or 6PM, whichever is next
I need to calculate a TimeSpan between the current time and 6AM or 6PM
 
ok
 
10:56 PM
I have 2 things coming from a config file, an ISO8601 TimeSpan "PT12H" in this case for 12 hours, and "6AM" for the start time
if it's before 6AM, I need it to return the TimeSpan between now and 6AM
if it's after 6AM, I need it to return the TimeSpan between now and 6PM
if it's after 6PM, I need it to return the TimeSpan between now and 6AM the next day
 
ok
 
this is what I have so far:
public static TimeSpan GetTimeToStart(DateTime eventStartTime, DateTime currentTime, TimeSpan timeBetweenEvents)
{
	TimeSpan timeToStart;
	// e.g. if it is before 6:00AM today
	if(currentTime < eventStartTime)
		timeToStart = eventStartTime - currentTime;
	// otherwise process at timeToStart + ISO8601 specified merchantEventProviderSchedule
	else
		timeToStart = eventStartTime - currentTime + timeBetweenEvents;
	return timeToStart;
}
 
What's currentTime?
 
everyone have a great evening, i'm out
 
My thoughts: calculate currentdateAt6AM, currentdateAt6PM, tomorrowAt6AM
 
11:00 PM
currentTime is the current time. DateTime.GetDate, but I parameterized it so I can unit test it without mocking
 
and find where Now fits in those buckets inbetween
 
Where does currentTime fit into the requirements?
 
I believe you should calculate out the 3 times as well
 
Wait, I might understand.
 
@KendallFrey it's how you calculate the difference between the time in the future and the current time.
 
11:01 PM
to linqpad! bacon all teh things!
 
You want to find the 6:00 following the eventStartTime, and figure out the timespan between now and then?
 
see heres the thing
it's not necessarily 6AM and 6PM
hmm
 
Will it be 12 hours apart?
 
it just needs to calculate the time to the next event within that time span
@KendallFrey not necessarily.
it could be 4 hours
 
11:03 PM
Forget this. I'm out.
 
pseudocode
`currentdateAt6AM = DateTime.UtcNow.Date //plus however you add 6AM`
currentdateAt6PM = DateTime.UtcNow.Date //plus however you add 6PM
tomorrowAt6AM = DateTime.UtcNow.Date.AddDays(1) //plus however you add 6AM

if(now < currentdateAt6AM) target = currentdateAt6AM
else if(now < currentdateAt6PM) target = currentdateAt6PM
else if(now < tomorrowAt6AM ) target = tomorrowAt6AM
else throw new Exception()

return target-now;//timespan`
 
@MikeF it's not necessarily 6AM and 6PM.
I have a startTime, which is the DateTime that I need to start the service at
 
then dynamically put in the times of day you do care about
 
if its after startTime, it needs to calculate the next possible time based on timeBetweenEvents
 
oh, so you could have N possible target times per day?
e.g. if timeBetweenEvents is 1 hour, there would be 24 possible buckets
 
11:08 PM
I can has win
var date = DateTime.Now;
	var morning = new DateTime(date.Year, date.Month, date.Day, 6, 0, 0, 0);
	var night = new DateTime(date.Year, date.Month, date.Day, 18, 0, 0, 0);
	var tomorrow = new DateTime(date.Year, date.Month, date.Day+1, 6, 0, 0, 0);
	if( date < morning ){
		TimeSpan next = morning - date;
		Console.Write(next);
	}else{
		if( date < night ){
			TimeSpan next = night - date;
			Console.Write(next);
		}else{
			if( date < tomorrow ){
				TimeSpan next = morning - date;
				Console.Write(tomorrow);
@Pheonixblade9 - ^
 
so I'd create a list of { now.Date + timeBetweenEvents, now.Date + timeBetweenEvents*2, now.Date + timeBetweenEvents*3 ...}
 
that compiles and runs, accurately gave 1 hour and 50 minutes for me since it is 4pm here
 
then find where now fits
or maybe I'm overthinking this. You could just use a loop to keep adding timeBetweenEvents until you find the first one in the future.
 
Let me adapt it to your signature
 
@TravisJ sorry, I just smoked your ass... but I do appreciate the help
public static TimeSpan GetTimeToStart(DateTime eventStartTime, DateTime currentTime, TimeSpan timeBetweenEvents)
{
	while(eventStartTime < currentTime)
		eventStartTime = eventStartTime.Add(timeBetweenEvents);

	return eventStartTime - currentTime;
}
 
11:16 PM
in the adaptation or you went a different route?
 
I knew there was a simple way to do it
but it did help to talk about it, ty
 
I would suggest making sure your loop only runs 1000 times so it doesn't lock
 
I'll call it with eventStartTime = DateTime.MinValue
and TimeSpan of 1 millisecond
 
11:18 PM
Also, won't the event start time always be more than current time? since it is in the future
 
"eventStartTime" really means more of a "time of day offset"
 
@TravisJ no
eventStartTime basically means "this is the time at which I want to start checking for possible start times"
 
What should happen if the timespan is 1 hour, the start time is 6am, and the current time is 1am?
 
so if my eventStartTime was 4AM, and my timeBetweenEvents was 2, the values I'd want to check would be 4AM, 6AM, 8AM, 10AM, 12PM, etc.
 
it is a datetime, so there are dates involved too, not just hours, right?
 
11:20 PM
what if the eventStartTime is already in the future for today?
 
I mean, this is for future planning it seems.
 
@TravisJ yes, but the default DateTime constructor takes "6:00AM" and returns "3/28/2013 6:00AM"
@MikeF then it will go to the next possible one based on a multiple of timeBetweenEvents
 
your code would currently just return eventStartTime
not the next interval-ed one
 
no, it would return the diff between currentTime and timeToStart
 
right that's what I meant, the timespan between them
 
11:23 PM
yes, thats desired
 
@Pheonixblade9 - So you are assuming that the day is going to be the same?
 
@TravisJ it will either be today or in the future.
 
so in your 4am example, 2AM should never be allowed?
 
@MikeF correct.
 
allrighty then
 
11:25 PM
so if eventStartTime="4AM", currentTime="2AM", timeBetweenEvents="4H", it should return 2 hours
 
hellow
 
hellow
 
helloworld
 
hellow my baby hellow my honey hellow my ragtime gal
 
11:44 PM
heh
 
user142019
Hello.
 
user142019
What's up.
 
not much, just breaking everyone's brains with DateTime nonsense
 
I thought you solved it?
 
0
A: How do I calculate the next run time for my event provider?

Pheonixblade9Using a simple while loop solves this by incrementing the eventStartTime until it is AFTER the current time. This is vulnerable to some data issues, but works for what I need it to do. public static TimeSpan GetTimeToStart(DateTime eventStartTime, DateTime currentTime, TimeSpan timeBetweenEvent...

I did!
I didn't find exactly the same question/answer, so I posted it and answered it myself.
hopefully it helps somebody
 

« first day (894 days earlier)      last day (4069 days later) »