tag:blogger.com,1999:blog-40905062673176255512024-02-19T07:53:58.871+00:00TehC0dezRandom Development MusingsUnknownnoreply@blogger.comBlogger25125tag:blogger.com,1999:blog-4090506267317625551.post-61942912879931557422017-09-14T22:53:00.001+01:002017-09-14T22:53:57.965+01:00SneakyBrian/p2pspider by SneakyBrianSneakyBrian/p2pspider
By SneakyBrian
DHT Spider + BitTorrent Client = P2P Spider
git clone http://ift.tt/2xBckQp
Created At: September 14, 2017 at 10:01PM
via GitHub http://ift.tt/2xBckQp
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-36624180064885189532016-06-26T17:01:00.001+01:002016-06-28T08:51:37.984+01:00SneakyBrian/nano-service by SneakyBrianSneakyBrian/nano-service
By SneakyBrian
nano-service is an example of building a platform that allows rapid deployment of web application code. The server-side script that runs is written in JavaScript, and executes in the context of the request, returning the evaluated result.
git clone https://github.com/SneakyBrian/nano-service
Created At: June 26, 2016 at 04:57PM
via GitHub https://Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-12789441338226892462016-06-08T21:38:00.001+01:002016-06-28T08:53:03.759+01:00SneakyBrian/escws by SneakyBrianSneakyBrian/escws
By SneakyBrian
Embedded Static Content Web Server, written in Go
June 8, 2016 at 09:38PM
via GitHub https://github.com/SneakyBrian/escwsUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-15120686763572301182013-07-22T00:45:00.001+01:002013-07-22T00:54:10.852+01:00Using a Raspberry Pi to Mine LiteCoins
In this tutorial I assume that you already know about LiteCoin, and have already signed up to a mining pool. If not, probably best go start reading here.
To begin, lets install the latest Raspbian image on to your SD card from here. I use Win32DiskImager for this:
Now we boot up the pi and run through the initial setup steps. We could skip this part, but you may want to run through the Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4090506267317625551.post-32436194796900318482013-07-17T23:36:00.001+01:002013-07-17T23:39:35.670+01:00Visual Studio Remote DebuggingI had some problems today getting Visual Studio to connect to the Remote Debugging tool (MSVSMON.exe) running on an ASP.NET application server. The error message I received when I clicked on “Debug” –> “Attach to Process…” was along the lines of: The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer.…even though I definitelyUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-58332719779827250822013-05-15T23:50:00.001+01:002013-05-15T23:50:47.517+01:0010 Things I Learnt Watching A Video About 10 Things Paul Irish Learnt From The jQuery SourceGreat, if slightly quirky, video from Paul Irish. Some good points about IIFE’s and jQuery selector performance. I’ve even added a Cornify button for you to click here: Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-24706736304130266792013-05-11T01:11:00.001+01:002013-05-11T01:11:41.127+01:00One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?Just had an issue trying to use a dynamic object in a .NET test project – at build time I had the compiler error: One or more types required to compile a dynamic expression cannot be found. Are you missing a reference? In the end all I had to do was reference “Microsoft.CSharp” from my test project. Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-9157858155242145992013-05-08T22:44:00.001+01:002013-05-11T01:27:54.557+01:00AntiScrape - IIS ASP.NET Http ModuleDownload Code AntiScrape is an IIS ASP.NET Http Module to help in the fight against website scrapers! How does it work? AntiScrape hooks into the IIS ASP.NET request/response pipeline. When your website users request a page, it automatically adds secret hidden links to the page that normal users in web browsers won't see. However, website scrapers that are scanning the HTML of the page Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-73922830144956296102013-05-08T13:33:00.000+01:002013-05-29T23:51:29.084+01:00X-POW - Proof Of Work for ASP.NET MVCX-POW is a proof-of-work implementation for ASP.NET MVC.
View the source code here.
How It Works
The server-side implementation is as an MVC ActionFilterAttribute called RequireXpowAttribute. This does not allow the request through unless the hash problem has been solved.
The client-side implementation is a javascript library that uses Web Workers to perform the hash calculations off the mainUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-63201746643930638252013-05-04T00:52:00.001+01:002013-05-04T16:53:24.031+01:00Google Chrome on Android,–webkit-overflow-scrolling and Modernizr.overflowscrolling
This morning I decided to install the latest version of Google Chrome for Android (26.0.1410.58), and test some work I had been doing on converting a website from using iScroll to overflow: scroll and –webkit-overflow-scrolling: touch. Imagine my surprise when I saw that none of my scrolling sections worked any more.
Investigating the issue it seemed that the Modernizr test for this support was Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4090506267317625551.post-87807110495816592372013-05-02T00:08:00.001+01:002013-05-02T22:16:39.150+01:00Using WebGL + SignalR To Create A Multiplayer HTML5 Space Simulation – Part 1  Although the name suggest that this is a game, at present it is merely a demo. When you visit the site (in a browser that fulfils the requirements below) then you will be presented with a first-person view from your own personal spaceship, flying through the galaxy. Other people also viewing the site at the same time as you will be visible to you as spaceships flying through space, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-7719380122440905932013-03-20T23:01:00.001+00:002013-07-13T01:01:36.756+01:00CAPTCHA.js, a javascript client-side CAPTCHA implementation using HTML5 CanvasHere is a simple Javascript library that implements a CAPTCHA using purely client-side code. It is meant as a demonstration of using a canvas element to perform text and spline based rendering, and is not meant as a secure CAPTCHA solution.
Using this library, when you create a CAPTCHA instance you can specify a function to call when the CAPTCHA is solved correctly, which could perform whatever Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-18627735136426699982013-01-24T22:38:00.000+00:002013-05-15T23:40:55.627+01:00The surprising truth about what motivates usHere is a video of a talk given by Dan Pink about motivation in the workplace that I found via Phil Haacks Blog. The main points I take away from the video are this: Pay people enough so that money isn’t an issue. After you’ve done this, it turns out that three factors lead to better performance and personal satisfaction: Autonomy – our desire to be self-directed Mastery – our urge toUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-24013242269802539492012-11-15T21:57:00.000+00:002013-05-11T01:37:59.175+01:00Poker Odds API - ASP.NET MVC 4 Web API Knockout.js Example Download Source Code Poker Odds API is an example API built using ASP.NET MVC Web API. Given a Texas Holdem Poker hand (and optionally the community cards) it will calculate the odds of winning. How It Works Poker Odds uses the excellent PokerHandEval code written by Keith Rule (based in turn on the poker-eval library). Users of the API submit information on their hand, and get back Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-49885038637118501142012-10-09T23:22:00.000+01:002012-10-10T22:27:42.037+01:00ZeroMQ + MsgPack + .NETI have created a simple testbed to demonstrate 2 .NET applications communicating with each other using ZeroMQ Publisher/Subscriber connections for the communications layer, and MsgPack as the serialization/deserialization layer.
ZeroMQ is a highly efficient and scalable network layer that acts as a reliable messaging layer on top of raw sockets. Performance is key here.
For ZeroMQ I use the x86Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4090506267317625551.post-21526944530291071662012-10-05T21:33:00.000+01:002012-10-05T22:23:51.925+01:00jQuery - Add an ajax request indicator to a page in a fixed position for debug purposesThis is a handy code snippet for adding a debug indicator to a page that uses jQuery for ajax requests. The indicator appears as a little 5px square in the top right hand corner of the page.
If the square is grey, then the request is in progress and has not received a response yet.
If the square is green then the response was received ok.
If the square is red then there was an error (either a Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-61794017286192658312012-10-05T21:20:00.001+01:002012-10-05T21:35:02.504+01:00XML2JSON – Command line tool for converting XML to JSONXML2JSON is a simple command line tool for converting XML files to JSON. It uses the JSON.NET library. Usage: XML2JSON.exe input.xml output.jsonExample Input:<?xml version="1.0"?><catalog> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre>Computer</genre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-66851051937881723632012-10-05T18:44:00.000+01:002012-10-05T18:44:52.344+01:00Create A Dynamic Object From An XML FileHere are a couple of simple methods that load an xml file into a dynamic object that can be used in code. At present this code does not handle xml attributes, only elements.
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4090506267317625551.post-15398603588823922872012-10-05T18:27:00.000+01:002012-10-05T18:27:16.865+01:00Javascript - Get Query String for current page as objectHere is a code snippet that gets the current query string parameters and puts them into a query object that can then be used to read the values in subsequent code.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-31013172631879014202010-07-01T10:16:00.001+01:002010-07-01T10:18:47.340+01:00Cannot Build Expression Blend 4 / Silverlight 4 Project in Visual Studio 2010Just had this problem: Trying to build an Expression Blend 4 Silverlight 4 project in Visual Studio 2010 on a machine that does not have Expression Blend 4 installed on it threw these errors: The property 'Triggers' does not exist on the type 'Grid' in the XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.    The tag 'EventTrigger' does not exist in XMLUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-50708872891824096342010-06-30T12:23:00.001+01:002010-06-30T12:23:37.204+01:00Unable To Open Silverlight 4 Project In Visual Studio 2010Just had this issue: Opening a project created on another machine threw an error in Visual Studio 2010. The output window contained this message: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4090506267317625551.post-12640877236218133342010-06-11T10:56:00.001+01:002010-06-11T18:29:02.368+01:00Unable to start debugging. The Silverlight managed debugging package isn’t installed.Just had this problem – Installed Visual Studio 2010 (which installs Silverlight 4), then used Visual Studio 2008 to open a Silverlight 3 project, tried to debug it, and POW! I fixed it by installing the Silverlight Windows Developer Runtime, as linked to from http://www.silverlight.net/getstarted/ Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-75449421242399507402010-04-06T11:30:00.001+01:002010-04-06T11:30:27.573+01:00Error inserting DBNull.Value into varbinary columnI have just experienced this problem: When attempting to insert DBNull.Value into a varbinary column, upon executing the insert statement the following exceptions is thrown: ”Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.” I found the solution here: http://forums.asp.net/t/1250380.aspx Essentially, in this case I Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4090506267317625551.post-23229040754607576672010-04-01T17:20:00.001+01:002013-05-07T00:22:06.258+01:00Nice Curves! - Catmull–Rom spline in C#Download sample code
Suppose you have a series of points that define a region.
When you “join-the-dots” you end up with something that looks quite “pointy”.
What if you want your region to look a little curvier than this?
Splines are a great way of calculating extra points between these key points to allow you to create much more organic and natural looking regions.
In this example I Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-4090506267317625551.post-17830927083348629282010-03-31T10:25:00.001+01:002010-03-31T13:21:56.310+01:00Reading Images From SQL Server using SqlDataReader.GetBytesSearching around on the internet I found it difficult to find some example C#/.NET code on using SqlDataReader.GetBytes to read image data from a varbinary field in a SQL Server 2008 database. Eventually I found a solution that worked for me, so I thought I would share it with the world. My solution returns an IEnumerable<T> and uses yield allowing the handling of very large datasets, as Unknownnoreply@blogger.com0