What code did you write today?

Page may contain affiliate links. Please see terms for details.

martint235

Dog on a bike
Location
Welling
WH Smiths was one of the shops that sold home computers back in the 80s. @Markymark 's program was just the sort of thing some spotty oik would type into one of the display machines.
Halted CZ
Not if you filled the program with NoBreak commands or whatever it was 30 years ago...... :wacko:
And I object to being called a spotty oik!!! I used to go to Dixons to make fun of the computer staff, much the same way as I go to PC World now and always end up in trouble.....
 

pplpilot

Guru
Location
Knowle
@Markymark 's program was just the sort of thing some spotty oik would type into one of the display machines.

We used to edit the autoexec.bat file with the line 'format c: /u' added at the end....
 
OP
OP
Shut Up Legs

Shut Up Legs

Down Under Member
I just did more work on one of my home projects: the image-displaying screen saver I mentioned in this thread's 1st post. It now randomly loads an image from a list, displays it for x seconds, blanks the screen for y seconds, and repeats. These options x and y (and others) are controlled by a configuration file which is just assumed to be in the same directory as the screen saver executable (i.e. the file with .scr extension, typically located in C:\Windows\System32).

The image layout is as follows:
1. I use a general-purpose fitRect() function to fit the image within the screen saver window rect, maintaining the image's aspect ratio. This will result in the image's top and bottom fitting the top and bottom of the screen, or its left and right fitting the left and right of the screen (or perhaps both).
2. Apply a scaling factor (set in config file) from 0.0 to 1.0 to scale the image down from its "fit" size. This then allows me to:
3. Randomly position the image in the x and y dimension, by applying 2 randomly-generated scaling factors between 0.0 and 1.0. For x (horizontal), 0.0 is fully left and 1.0 is fully right, while for y (vertical), 0.0 is fully top and 1.0 is fully bottom. Of course, if the above size scaling factor is 1.0, then no repositioning may occur in the x and/or y dimension.

The config file will allow the user to specify image positioning as:
1. keep aspect ratio (or not).
2. stretch image to fit screen (can be used with aspect ratio=on, but the image will only stretch as far as its aspect ratio allows).
3. centre the image on the screen.

I've also put a lot of the general rectangle-handling and OpenGL code into reusable libraries, so now my main application and SCREENSAVERPROC function look nice and tidy.

So far, it's looking good.

As I mentioned previously, I'll be adding image size-filtering to the screen saver, so it doesn't display ridiculously small images (e.g. thumbnails) as they don't look that good when displayed on a large, black screen. I'm just trying to find a way to check the size of an image file (some of them a few MB in size) without having to read the whole file, as this is inefficient for large image lists.

Displaying the full path to the image file somewhere on the screen saver window (an option for the existing Windows image display screen saver) would also be nice, so I'll add that at some point. Also, transition effects when switching between the image display and the blank screen periods. So many ideas to implement!

Regards,

--- Victor.
 

Tin Pot

Guru
Standard SQL for me today to pull some data out of our contract monitoring tables and link to reference tables to make it readable data

All parameterised queries/procedures, validating input and with least privileged acces to the tables...of course?
 

marknotgeorge

Hol den Vorschlaghammer!
Location
Derby.
Yesterday I was partly drawing pretty maps of local bus stops, but mostly debugging a unit test. No amount of rewriting a mocked-up web server will make the test pass if you don't actually inject it into the code. :blush:
 
A bit of VBA tweakery in an Excel spreadsheet to compensate for missing records in the third party manufacturing app.
Also changing the query in a report in Crystal Reports.

I've had to swap out one of the printers upstairs. Nice to see it's all sorted by changing the reservation in DHCP.
This afternoon it's jiggery-pokery with a firewall to get a client online to our ordering system.

If I've a minute after that lot I've got to find why an email goes to a certain client successfully but never appears there. Then look into a decent VPN box for the network to get rid of all this firewall chicanery. Then I'm looking for a refurbished server for the rack in the other factory as part of my devious plan to take over the world one virtualised server at a time.

Yesterday at this time I was sat catching rays on a balcony in Lanzarote ^_^
 
Screenshot 2016-02-22 at 5.34.50 PM.png
 

marknotgeorge

Hol den Vorschlaghammer!
Location
Derby.
Tonight I've been writing a bit more of the Windows 10 Mobile ride tracking app I've been writing for the last two or three years. Okay, so I haven't been writing it for W10M for 2 or three years - I started in Windows Phone 8. I'm doing this in my spare time and I'm prone to laziness and lack of confidence, so sometimes I shy away from coding and beat myself up about it. I know I shouldn't, but heigh ho.

Today I've mostly been working on the page that shows details of rides already ridden that are stored in the app's database. Entity Framework using SQLite? Lovely stuff! More specifically, I've been writing the bit of code that calculates the interval splits - how long it's taken to ride each kilometre (or mile). These have to be calculated on the fly, as the app can switch between metric and imperial units, so the splits will change depending on the unit. Lots of iteration, plenty of maths and a certain amount of geodesy - I have to work out the distance between two points on the Earth's surface.

If you're wondering 'why doesn't he buy a Garmin?', you're missing the point.
 
OP
OP
Shut Up Legs

Shut Up Legs

Down Under Member
Tonight I've been writing a bit more of the Windows 10 Mobile ride tracking app I've been writing for the last two or three years. Okay, so I haven't been writing it for W10M for 2 or three years - I started in Windows Phone 8. I'm doing this in my spare time and I'm prone to laziness and lack of confidence, so sometimes I shy away from coding and beat myself up about it. I know I shouldn't, but heigh ho.

Today I've mostly been working on the page that shows details of rides already ridden that are stored in the app's database. Entity Framework using SQLite? Lovely stuff! More specifically, I've been writing the bit of code that calculates the interval splits - how long it's taken to ride each kilometre (or mile). These have to be calculated on the fly, as the app can switch between metric and imperial units, so the splits will change depending on the unit. Lots of iteration, plenty of maths and a certain amount of geodesy - I have to work out the distance between two points on the Earth's surface.

If you're wondering 'why doesn't he buy a Garmin?', you're missing the point.
I hear you, @marknotgeorge , and understand perfectly.

On my home PC, I use both SportTracks and TripTrack for tracking my cycling trips. The only unusual thing about the latter is that "TripTrack" is a name I invented myself, because it's a Java application I wrote at about 2012, and have been embellishing ever since. It loads .TCX and .FIT files, and displays all my trips in tables. The main table lists the trips with summary details such as distance, average speed, route taken, number of laps, etc. Then a "Laps" table lists similar details, but for each lap in the currently-selected trip in the "Trips" table. Finally, a "Tracks" table lists all tracks in the currently-selected entry in the "Laps" table. If I select multiple trips, a summary pane at the right gives totals for the selection, e.g. total distance, total climbing, etc.

It has more features than that, and I'm currently (but slowly, due to work and of course other home commitments) adding graphs to the application.

As for metric and imperial units: that just gave me another idea to add to the long list of TODOs for my Java application. At this rate, I'll never get through the list!
 
OP
OP
Shut Up Legs

Shut Up Legs

Down Under Member
Today, I've been working on my C++ / OpenGL image-displaying Windows 7 screen saver. No functionality change today: instead, I've been refactoring and adding some classes, building up a hierarchy of abstract classes with some virtual class functions, to support future changes.

So think of the application as a caterpillar: all the refactoring, creation of virtual classes and subclasses, and renaming of variables is the caterpillar busy building its chrysalis. Pretty soon, I'll be ready to launch the new, updated screen saver, and so: voila! A butterfly is born! :biggrin: (Yes, I know, I think too much, sometimes...)
 
OP
OP
Shut Up Legs

Shut Up Legs

Down Under Member
I did some more work on my Windows 7 C++ / OpenGL image-displaying screen saver today. When I went to do some grocery shopping earlier this morning, I couldn't resist buying a new 28" PC monitor. This was partly because one of the two 27" monitors I had was becoming unreliable, with an annoying habit of blanking randomly, even while I was using it.
So now I have a 28" monitor, with a 27" monitor to its right, as shown below:

20160305-Philips-monitor-284E5QUAD_75-layout.JPG


No more annoying random blanking! :smile: Well, at least not yet, anyway. :ph34r:
The new monitor was $325 AU, which I think is currently about £170.
 

marknotgeorge

Hol den Vorschlaghammer!
Location
Derby.
I did some more work on my Windows 7 C++ / OpenGL image-displaying screen saver today. When I went to do some grocery shopping earlier this morning, I couldn't resist buying a new 28" PC monitor. This was partly because one of the two 27" monitors I had was becoming unreliable, with an annoying habit of blanking randomly, even while I was using it.
So now I have a 28" monitor, with a 27" monitor to its right, as shown below:

20160305-Philips-monitor-284E5QUAD_75-layout.JPG


No more annoying random blanking! :smile: Well, at least not yet, anyway. :ph34r:
The new monitor was $325 AU, which I think is currently about £170.
I want one of the big Planar touchscreen monitors they use on Microsoft Virtual Academy.

Me? I've been playing with Xamarin with a view to creating a cross-platform sample for my TransportAPI client library. Seems a bit fiddly, but worth a go.
 
Top Bottom