Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, December 2, 2013

Micro$oft no longer supports Windows Gadgets

So apparently Microsoft no longer supports windows gadgets AKA windows sidebar AKA desktop gadgets. But why? The reasons stated are that they present the possibility of posing a security threat. (http://windows.microsoft.com/en-ie/windows/gadgets) Upon further reading of the security threat posed (http://technet.microsoft.com/en-GB/security/advisory/2719662) they basically describe the same threat that installing ANY PIECE OF SOFTWARE WHATSOEVER poses. Microsoft have an extremely bad track record of fucking over software developers who learn and use their frameworks, for example in database access programming you used to have OLE, they completely changed and revamped this into ADO with a huge apology and a promise that they wouldn't change it again, pretty much straight away they changed this to ADO.NET with a re-apology and a re-promise that it wouldn't happen again. So that was annoying. Personally I wouldn't bother with any of that win8 shit til at least win10 when ya can be sure to get a bit of longevity out of your efforts. Rant off.

Friday, July 27, 2012

Free DynDns (Sort Of)

So I wanted to access my home network from outside. My ISP doesn't hand out static IPs and DynDns doesn't work on my router / also i don't want to pay for it anyhow.

Solution:

All I really want is my IP address. This can be displayed from sites like whatismyip.com very easily. We'll do it like they do and store the result somewhere on the web. There are plenty of free webhosts that support PHP. I set up a tiny website to set and get the IP address of my home gateway.

The website basically contains 2 webpages and 1 file. One webpage is called by my home server every hour, this page collects the IP address from the calling home server and writes it to a file on the webserver.

set.php :=


#get caller's ip address, we will have to pwd protect access to this file yes? $ip_address = $_SERVER['REMOTE_ADDR']; 
$file = fopen("ipfile", "w+"); 
if( $file==false) 

   echo("error opening file\n");
   exit(); 

fwrite($file, $ip_address); 
fclose($file); 
?>

The powershell script to call it was a bit of a pain to write as powershell is very fussy when it comes to authentication and signing scripts. Probably should have just used wget for windows, but I wanted to try something new.

PowershellScript.ps1 := 

$client = New-Object System.Net.WebClient; 

$client.Credentials = New-Object System.Net.NetworkCredential("usernamehere","passwordhere"); 

$client.DownloadData('http://mywebsite.domain.com/set.php'); 

I just used basic http authentication. Don't want anyone becoming curious as to what the IP address is for if they stumble accross it, and more importantly I don't want them running my set.php page and overwriting my IP with their own!

For getting the IP address I use the get.php page :=


$file = fopen("ipfile", "r"); 
if( $file==false) 

   echo("error opening file\n");
   exit(); 

$filetext = fgets($file, 100);
fclose($file);

then in the body display IP address:


(Very difficult to put all this php code into blogger blogpost, stuff keeps disappearing!)
I give up trying to write code here now.
Gonna set up my server for incoming connections now. Just wanna access my music and videos from my android.

Monday, December 26, 2011

Viewsonic VG2436wm-LED

My awesome new Viewsonic VG2436wm-LED monitor (pics pending). Another fantastic gift to myself ;-) Thanks Ros! No problem, anytime Ros.

24" 1080p, colours look vibrant, contrast ratio is high. Viewing angles are no great shakes, but no worse than other monitors. The most stand-out feature is pivot support (rotation) so that monitor can go into portrait mode. This is great for reading long articles, and should be fantastic for writing long functions when I get around to programming again. I have only tested this function on my laptop so far with Intel drivers, works great! Simply put mouse pointer on screen you desire to be rotated and then use the CTRL+ALT+arrow-direction keyboard shortcuts to rotate to desired screen orientation, very quick and easy to apply. The height can be adjusted to quite an exteme to allow for easier rotation, it makes the unit a little prone to shaking about slight vibration though, and may need a sturdy desk/worktop surface.

All in all, a nice little number, and the cheapest 24" monitor with pivot adjustment support built in and decent screen specs.

[UPDATE]
New monitor in action:


Thursday, October 27, 2011

Thursday, February 17, 2011

Alternative to "The C Programming Language by Kernighan and Ritchie"

Found a great book for learning C. Lesson 1 is the usual "hello world", but literally the next example dives into using it as a CGI script. It teaches all the usual C console output stuff, but concentrates on web programming with C and apache web server. This is great, as the terminal is a bit boring looking for the uninitiated, and most ppl are used to booting up and instantly firing up the web browser to click aimlessly on social networking sites.

It includes clean code examples, and moves rapidly on to interacting with mysql and creating images on the fly, while still learning about loop structures etc. At 84 pages of breakneck speed learning, I'd love to hear how a novice gets on with this book. I'm a relatively seasoned C/C++ programmer and I'm still getting mileage out of it.

"C Programming in Linux" by David Haskins.

Download pdf & examples (for free!) here: http://bookboon.com/external/computerweekly/it/c-programming-in-linux
(If your not a UK IT student just put "abroad" and "other" in drop downs).

Wednesday, February 9, 2011

Dijkstra & Mathematics Inc.

Pretty funny, this is swiped from the Wikipedia entry for Dijkstra. He's a pretty important figure in computer science.

"One of Dijkstra's sidelines was serving as Chairman of the Board of the fictional Mathematics Inc., a company that he imagined having commercialized the production of mathematical theorems in the same way that software companies had commercialized the production of computer programs. He invented a number of activities and challenges of Mathematics Inc. and documented them in several papers in the EWD series. The imaginary company had produced a proof of the Riemann Hypothesis but then had great difficulties collecting royalties from mathematicians who had proved results assuming the Riemann Hypothesis. The proof itself was a trade secret (EWD 475). Many of the company's proofs were rushed out the door and then much of the company's effort had to be spent on maintenance (EWD 539). A more successful effort was the Standard Proof for Pythagoras' Theorem, that replaced the more than 100 incompatible existing proofs (EWD427). Dijkstra described Mathematics Inc. as "the most exciting and most miserable business ever conceived" (EWD475). He claimed that by 1974 his fictional company was the world's leading mathematical industry with more than 75 percent of the world market (EWD443).[7]"

Tuesday, September 28, 2010

Programming humour

Pretty funny tutorial on C language pointers.
DISCLAIMER: Strictly for nerds only!
http://pastebin.com/vQbu9Lek

Thursday, July 1, 2010

Software Patents

Great video against software patentability funded by the fsf
It gives a nice bit of history and background.

Link is here: http://patentabsurdity.com/watch.html