I wrote an in-house Overtime system for our workers. One particular shift is a 24-hour on-call, which is typically 8am to 8am the next day. A worker happened to do an on-call shift 3/10 8am to 3/11 8am, and the system said it was invalid--because he only did 23 hours due to the clocks being moved forward! Once he changed the end time to 9am, it worked. Strictly speaking, the system is correct--but it sure looks weird.
James VT
Posts
-
Daylight saving bug? Or working as designed? -
Mass Voice/Text Messaging ServiceDo you want an API, or a web interface that a non-programmer can use? I looked into this a bit for my son's school, and there was a big difference between A) a turnkey solution where the school's reception could just log in & send a voicemail or text to all the parents, and B) an API that you could control with code. As you can imagine the API is much cheaper. I just played around with one of the sandbox API's (I forget which one) and it was very easy. It made me realize you could develop a web interface pretty easily, and I was planning to do this for them to save them some money over the turnkey solution. To send a text message, you just provide the text string and phone number to the API as you'd expect. For a voice message, as I recall you provide a MP3 or WAV file along with the phone number to the API. For APIs, there's Twilio and Plivo; Amazon Web Services (AWS) also has these services available. To give you an idea of AWS pricing: Pricing[^] The first 100 text messages per month are free, and then it's $0.00645 per message after that. It's hard to gauge a price like that in the abstract (is that cheap? or a lot?), so I did some ballpark estimating. The school has about 1,000 parents, so that's $6.45 each time the school sends a text message. It's not necessarily a lot, but it's not something you want to be sending 5 times a day either, or even every day, because it can start to add up. If you're just sending one a week, that's $25.80 per month. This is still radically cheaper than the turnkey solutions. I think the secretary told me they were quoted $3,000/yr for a ready-made web solution? I'm sure that had restrictions or additional fees if you went over a texting limit.
-
Mass Voice/Text Messaging ServiceDo you want an API, or a web interface that a non-programmer can use? I looked into this a bit for my son's school, and there was a big difference between A) a turnkey solution where the school's reception could just log in & send a voicemail or text to all the parents, and B) an API that you could control with code. As you can imagine the API is much cheaper. I just played around with one of the sandbox API's (I forget which one) and it was very easy. It made me realize you could develop a web interface pretty easily, and I was planning to do this for them to save them some money over the turnkey solution. To send a text message, you just provide the text string and phone number to the API as you'd expect. For a voice message, as I recall you provide a MP3 or WAV file along with the phone number to the API. For APIs, there's Twilio and Plivo; Amazon Web Services (AWS) also has these services available. To give you an idea of AWS pricing: Pricing[^] The first 100 text messages per month are free, and then it's $0.00645 per message after that. It's hard to gauge a price like that in the abstract (is that cheap? or a lot?), so I did some ballpark estimating. The school has about 1,000 parents, so that's $6.45 each time the school sends a text message. It's not necessarily a lot, but it's not something you want to be sending 5 times a day either, or even every day, because it can start to add up. If you're just sending one a week, that's $25.80 per month. This is still radically cheaper than the turnkey solutions. I think the secretary told me they were quoted $3,000/yr for a ready-made web solution? I'm sure that had restrictions or additional fees if you went over a texting limit.
-
Gonna build a surveillance cam.For the easiest way to set up a Raspberry Pi as a motion camera, I would highly recommend MotionEye OS: Home · ccrisan/motioneyeos Wiki · GitHub[^] He has customized the OS so the RPi acts as an appliance; all you have to do is flash the SD card and it's ready to go. To make configuation changes, you type in the internal IP address using another computer and you get the web-based login screen, and after logging in you can tell it how long to save recordings, whether to take still shots long with video, etc. You pretty much do all your interaction with it using the web interface, not the command line. It's based on Linux and not Windows IoT, but you won't notice the difference anyway because it just sits there and does its thing and the only time you interact with it is to look at recordings or change its configuration. For mine, I use this camera: http://www.waveshare.com/rpi-camera-f.htm[^] Unfortunately I put my camera inside a waterproof housing and the night vision infrared would reflect off the housing glass, so I had to remove the infrared bulbs, but during my initial tests the night vision worked great. If you wanted this as a project to learn and tinker on, then Windows IoT might be fun to try, but if you just want to set it up quick with minimal headache, MotionEyeOS is the way to go. I'm saying this as someone who started out doing it as a fun project, and I had grand plans of writing my own custom scripts to move the saved recordings around, but after a couple of fruitless days working on it, I got to a point where I just wanted it working, and MotionEyeOS was the winner.
-
Home Security CamerasI used a Raspberry Pi with an old Microsoft USB webcam I had in my drawer. I mounted the webcam in one of these weatherproof enclosures so it would be fine outside: Enclosure This software works really well to drive the camera and even has motion detection: MotionEyeOS The software lets you set how long you want it to keep recordings, depending on how much memory is on your micro SD card. To view it remotely, you have to set up port forwarding on your home router to the Raspberry Pi. Once this is set up, you can even see it using your phone's browser, which is so much easier than commercial products that require you to install a buggy app. The only crummy thing is that the webcam doesn't have infrared, so you don't see much at night, but honestly I couldn't see much of anything when we had a commercial camera that did have infrared.
-
DapperI used it for a project. I didn't use any of the object-relational mapping, but I liked that I could swap this:
SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (rdr.HasRows)
{
while (rdr.Read())
{
//do something with record
}
rdr.Close();
}with this:
SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
IEnumerable flatResult = conn.Query(sql);I thought that was pretty handy, especially for quick prototyping where the table and field names were changing a lot and I didn't want to hassle with altering all the field names and just wanted a quick resultset back.
-
Duck-typed script languages, or statically typed "compiled" languages?I have a slightly different perspective on this. I think the language matters less and the environment matters more. In other words, to an absolute beginner, the important thing is understanding what the cryptic words and squiggly characters are going to do within that little world the language resides in and how the language's actions are useful to them. The problem with most contrived tutorials like "make an array of addresses" or "make the kitty move across the screen until it hits the side wall" is that it's not something they want or need to do and their interest wanes quickly. That 2nd reference isn't a dig at Scratch at all, because I think Scratch is awesome, and the best way I've seen to help young kids understand loops and if/then logic gates. However, if Scratch doesn't ignite more curiosity like, "how can I make the kitty navigate through a maze?", then they're not going to experiment more. If it's a kid and they're into Minecraft, then learning how to write a Minecraft mod is a perfect task that will keep their experimental fires burning because they want to see that mod work. Another possibility is writing a basic iPhone app, because it's exciting being able to show your friends, "look at that app in the App Store, I wrote that!", even if the app is just a button you push and it shows a smiley face. Here's something that sparked my son's curiosity: He was trying to figure out why a Javascript game on a website wasn't working right, so I said, "let's check out the code and see if we can figure out what's going on," and he was blown away that you could click View Source and start poking around with the HTML and Javascript. It really piqued his curiosity about how you can make web pages do things. If it's an adult and they want to automate some tasks in Word or Excel, then showing them how to write some VBA code is a good intro to programming. Regarding a specific language, I think Ruby is a pretty nice language, and for a beginner it's nice that it doesn't require semicolons. I don't know Python well but it's nice that it also doesn't require semicolons. Python does require indents/whitespace--not sure if that is confusing or helpful to a beginner? I learned Perl and VB6 at the same time and I remember the case-sensitivity of Perl confused me and it was nice that VB didn't have that, but I also remember that VB's linebreak requirements (like you have to say "If a=b Then" and not "If a=b --linebreak-- Then") confused me and I liked that Perl was fine with splitting things onto a new line. One neat
-
How flexible is your schedule?I think this sounds super-cool and fun. "Crazy" to me is taking your life savings and betting it on the Super Bowl, or quitting your stable job to pursue an acting career right after your baby is born. Taking a spontaneous road trip just sounds like a blast. I agree that most people find this kind of approach too risky, and that's a shame. This approach to life always reminds me of the line in the poem "The Love Song of J. Alfred Prufrock" by TS Eliot where he says, "I have measured out my life with coffee spoons". I say keep doing what you're doing and ignore the naysayers.
-
Should I even bother?I have 2 kids in that exact age range and am witnessing this push to learn coding, and I can say with confidence that most of these kids are not going to get into programming, nor will it create a glut of them. The biggest hurdle is that most of them just don't have any burning ideas that they want to create, and my experience since I was 12 and first started learning this stuff is that you need a shining goal. The contrived tutorials where you make a music-search website, or make a robot walk the perimeter of a room, don't make you want to stay up late researching and trying to solve a vexing problem. It's only when you have this cool idea but no clue how to create it that you get the passion to push through the confusing and boring parts and not want to give up. Even the gamer kids don't really want to create games, they want to play them, because once they start learning all the logic required to make event loops and all the things you need to do to make something happen onscreen, they lose interest. I also think you're smart to learn mobile because it's a pretty clear bet that's going to keep getting huger. Even if the exact language changes (ie, you're learning Swift or Java right now and some new language comes along), you'll be in good shape to learn it b/c you already know the attendant concepts, like how to deal with a sudden network loss, and how to design GUIs for a small screen. This stuff is *way* too complicated to reduce to a drag-and-drop, "anyone can do it" design studio. In my opinion the bigger worry in programming is the ever-present preference for youth. I still think there's demand for older programmers (though I don't live in Silicon Valley so I'm sure it's worse there), but the problem I see from my close-to-50 vantage point is that I just don't live and breathe the mobile technology because it's not important to me at this phase of my life. It's more about family now, whereas 25 years ago it was more about "where's the next party? Let's organize a group trip to Vegas! etc", so if mobile technology was around then I would've been more immersed in it--all my friends would be up on the newest stuff, I'd be reading about it, playing with it 24-7, experimenting. At this age I'm content with a phone that makes calls, has a map, and lets me search the web in a pinch if I need to refresh my memory about the War of 1812 or look up the hours of my favorite restaurant. That lack of obsession with technology that just comes naturally with age makes it harder to come up with cool new ideas for programs
-
What to do? What to do?I would say if it's a quick-and-dirty project that you just want done and off your plate, use WebForms, but if you enjoy the intricacies of CSS/HTML or feel like you want more practice with them, go with MVC. I faced a similar dilemma for an overtime submission system, and almost went with WebForms for the drag-and-drop quickness, but going with MVC gave me some good practice with CSS and layout, plus as I went along I found myself incorporating more and more Javascript, to the point where the project is almost all client-based, with lots of Ajax calls to web services. MVC has made it easy to gradually incorporate pieces as I go along, like Knockout, Bootstrap, Q (for asynchronous, promise-based calls). I've learned a huge amount about Javascript-based development, and I don't think it would've been as easy had I gone the WebForms route. When I first began developing it with MVC, it was all server-based, with page submissions to the server for every save, and it worked fine, and probably would've been the same had I gone with WebForms, but then I started getting hit with a lot of "hey, it would be really cool if..." mid-stream requests, and that model started showing its limitations, especially when they wanted lots more logic in the client controls, which is where the declarative bindings of Knockout and Ajax calls really proved useful. I'm sure you can incorporate many of these same things with WebForms, but I don't think it was designed for you to delve into the HTML this much. It's like putting snow tires and a scoop on your Honda Accord to make it a snowplow--you can do it, but it's a completely different task than it was designed for. With MVC you're already waist-deep in the HTML so it encourages you to tinker with it.
-
Are you on the cutting edge of technology?I feel exactly as you do. Since having kids, the few precious hours in the evening are devoted to them--homework, outdoor play, etc. I wouldn't trade it for anything, but there's no time left for trying new technologies. When my wife got me an iPad for Father's Day 3 years ago, it stoked my desire to learn Objective-C and I spent the next 3 months developing an app. From a programming standpoint it was the most fun I've had in a long time; reading the Apple docs in every free moment, writing code until midnight after the kids were asleep, actually relishing a sick day at home with a cold so I could bang out code for the app. However, my family life really suffered. The kids started noticing how I would jump on the computer while playing Hot Wheels with them and would lose the gist of the game, my wife said it made her feel lonely falling asleep with nobody beside her. It made me consider jumping ship from my secure-but-routine job to a web startup, but those tend to require long work hours. I'm trying to incorporate cutting-edge stuff on small projects here at work but it's hard to carve out the time in between required tasks. Not sure what the answer is. Sometime I think maybe I just had my time on the edge and it's someone else's turn (I had my fun at a dot-com in the whirlwind 90's so I can't complain). Sorry for the long-winded response but this struck a nerve for me because I feel the same way.