|
Dear internets, I’m a sysadmin/architect, which means I spend a good amount of time coding in puppet and other languages. Puppet is a great tool, however the puppet community is a bit anal strict about their style policies. I can respect this because I understand how important uniformity is when many developers are sharing code. ( On a side note, I absolutely can’t stand using spaces for indentation, but that’s another story. Plea..
|
|
So far, we have defined language grammar and have written a lexer. In this part we will write a parser for our language. Before we start, we need some helper functions: int peek(char *s) { return (strcmp(tok, s) == 0); } int accept(char *s) { if (peek(s)) { readtok(); return 1; } return 0; } int expect(char *s) { if (accept(s) == 0) { error("Error: expected '%s'\n", s); } } peek() returns non-zero value if the next token is equal to the giv..
|
|
So far, we have defined language grammar and have written a lexer. In this part we will write a parser for our language. Before we start, we need some helper functions: int peek(char *s) { return (strcmp(tok, s) == 0); } int accept(char *s) { if (peek(s)) { readtok(); return 1; } return 0; } int expect(char *s) { if (accept(s) == 0) { error("Error: expected '%s'\n", s); } } peek() returns non-zero value if the next token is equal to the giv..
|
|
HostDatastoreSystem.QueryVmfsDatastoreCreateOptions
-
blog.raymond.burkholder.net
-
13 years ago
-
eng
|
|
HostDatastoreSystem.QueryVmfsDatastoreCreateOptions
-
blog.raymond.burkholder.net
-
13 years ago
-
kor
|
|
I have written a little bookmarklet that will allow you to filter your OKCupid matches by a smaller geographic region. By default, their search filters allow no smaller than a 25-mile radius. Drag the bookmarklet link below onto your bookmarks toolbar, then click it when you are on the OKC search page, and voilà, you will have the options for 5 and 10-mile searches. 10-mile radius will be selected, so just click "search" and you will have....
|
|
Let talk about the compilers. Have you ever thought of writing your own one? I will try to show you how simple it is. The first part will be pretty much theoretical, so keep patience. what we’re going to achieve? CUCU is a toy compiler for a toy language. I want it to be as close to ANSI C as possible, so that every valid CUCU program could be compiled with a C compiler without any errors.
|
|
Let talk about the compilers. Have you ever thought of writing your own one? I will try to show you how simple it is. The first part will be pretty much theoretical, so keep patience. what we’re going to achieve? CUCU is a toy compiler for a toy language. I want it to be as close to ANSI C as possible, so that every valid CUCU program could be compiled with a C compiler without any errors.
|
In my professional work, we have a system that utilizes __call and __callStatic for caching of certain method calls. We have been running into a problem where calling an undefined method via :: within the class itself will trigger __call rather than the expected __callStatic. The Problem The following code example illustrates the issue.
|
In my professional work, we have a system that utilizes __call and __callStatic for caching of certain method calls. We have been running into a problem where calling an undefined method via :: within the class itself will trigger __call rather than the expected __callStatic. The Problem The following code example illustrates the issue.
|
|
I experienced a strange memory issue with Lemma this week. Memory usage skyrocketed each time I loaded a level; it never dropped back down. Now granted, I am definitely the garbage collector's worst nightmare. (I'll just say this: closures. Closures everywhere .) But at this point I am setting fields to null all over the place and manually calling GC.Collect() after unloading a level, all to no avail. Enter the .NET Large Object Heap ..
|
|
Stamina and Sprint I finally realized that speed is perhaps the most important resource in a Parkour game. Up until now, Lemma hasn't really understood the concept of "faster" and "slower"; you were always going the same speed. Acceleration from a dead stop was almost instantaneous and the Parkour moves didn't change your speed (with the exception of wall-running). With this in mind, I decreased the acceleration a lot and made all the mo..
|
|
I mentioned that a small group of us had been working on a project in week one. The project is a startup idea generator with an 8-bit theme.
|
|
Small Programming Decisions that Expose More Information than Intended
-
kevinohashi.com
-
13 years ago
-
eng
Sequential Account Numbers + Affiliate Program = Financial Transparency Background Accounts generally come in two flavors: name based and numerical. Name based systems use a text representation for an account (username). Numerical systems use an id number to identify accounts. (Note: these aren't mutually exclusive) The affiliate program is nearly a staple of any online business these days. Companies give people a cut for referring t....
|
|
I always find myself reading about fusion . This time, I’ve come across an excellent Q&A on slashdot by some MIT Fusion Researchers . It’s well worth the read, and so is the http://www.fusionfuture.org/ website for some clear explanations about nuclear fusion. Enjoy, James You can hire James and his team at m9rx corporation . You can follow James on Mastodon for more frequent updates and other random thoughts. Yo..
|
|
I always find myself reading about fusion . This time, I’ve come across an excellent Q&A on slashdot by some MIT Fusion Researchers . It’s well worth the read, and so is the http://www.fusionfuture.org/ website for some clear explanations about nuclear fusion. Enjoy, James You can hire James and his team at m9rx corporation . You can follow James on Mastodon for more frequent updates and other random thoughts. Yo..
|
|
Splitting text into lines according to maximum width + vertical text scroll in JavaScript and HTML5
-
liza.io
-
13 years ago
-
eng
Yesterday I made another iOS build (I do them about once a week, but will be ramping up the frequency now) and spent a few hours fixing iOS specific bugs, then trying to consolidate the iOS code with the browser version code to take out as many differences as possible.
|
|
Yesterday there was a post which hit Hacker News that talked about using SQL to access Mongo . While this is powerful I think much of the true value was entirely missed within the post. SQL is an expressive language, though people are often okay with accessing Mongo data through its own ORM. The real value is that you could actually query the data from within Postgres then join across your data stores, without having to do some ETL pro....
|
|
Yesterday there was a post which hit Hacker News that talked about using SQL to access Mongo . While this is powerful I think much of the true value was entirely missed within the post. SQL is an expressive language, though people are often okay with accessing Mongo data through its own ORM. The real value is that you could actually query the data from within Postgres then join across your data stores, without having to do some ETL pro....
|
|
Selecting from multiple ship/character options before each level (more UI stuff)
-
liza.io
-
13 years ago
-
eng
After a slight (well, slightly more than slight) design change in my current project I had to build a way for players to be able to select a vessel to use before each level. This required a little bit of recoding. The gist is this (as usual, everything is a barebones placeholder at this time):
|
|
With Lukas Smith we gave the Monday keynote in this year’s International PHP Conference , titled The Internet is your application blueprint . The video is now online: The main argument of the keynote is that even though the big promises of the Service-Oriented Architecture hype of 2000s haven’t happened, by now companies are using lots of services when building their web applications. Consider these: Web analytics Streaming med....
|
|
up and ^ down : navigate methods ⇧ ⌘ up and ⇧ ⌘ down : switch from .h to .m ⇧ ⌘ ⌫ : go to last edit ⇧ esc : hide console/bottom view ⌥ ⌘ L : reindent code (^ i in xcode) ^ r : Run (⌘ + r in xcode) ^ tab : navigate files ⌘ o : open class ⌘ ⇧ o : open files
|
|
Da qualche giorno ho rilasciato Cerberus, uno strumento per la convalida dei dizionari Python. Gli passate un dizionario, lui lo confronta con uno schema di convalida e, se c’è qualcosa che non va (per esempio una chiave sconosciuta, oppure un valore di tipo sbagliato), ve lo segnala. Sono due le caratteristiche che rendono Cerberus interessante: è facilmente estensibile (la documentazione include un esempio di estensione del sistema di..
|
|
Recently I have rolled out a few small performance and functional tweaks and changes. Nothing major to report here however I am working on the next version of searchcode which has an improved look and feel and blended search results. The idea being if you search for “mysql_query” you are probably interested in the documentation first and code examples second, or if you search for “mysql_query is a blocking function?” you are probably intere..
|
|
Nice Clouds I got sick of my old pixelated skybox powered by Google Images and decided to make a real one. I used Spacescape to generate a sufficiently trippy outer space skybox, chopped up some cloud photos in Gimp, fought with my code for a couple hours, and wha-la: Scary Monsters What's that glowy green thing you say? It's the new monster I just added, creatively named "the vine". See that string of dark blocks coming out of it..
|
|
Sometimes, small questions lead to big answers. Sometimes these answers are controversial. One such question is “What does this warning about serialVersionUID mean”? All the advice out there basically is for developers who don’t know what’s going on to write code that will ignore errors when something unexpected happens. In my view - this is exactly the wrong approach. The safe way to act is to make sure that your program crashes if you don..
|
|
How Cobalt Calibur uses Canvas to display Sprite-Based Graphics
-
davidwalsh.name
-
13 years ago
-
eng
|
|
Review Signal Launch: Stats, Failures, Successes and Lessons Learned
-
kevinohashi.com
-
13 years ago
-
eng
It's been two weeks since Review Signal launched. The initial excitement of reaching it's first major milestone is over and I finally have a moment to think about how it went. The Stats: 3,041 Visits 10,163 Pageviews 3.34 Pages per Visit Average Visit Duration: 2m 16s Bounce Rate: 5.52% Visitors from TechCrunch: 727 Failures and Short Comings: Social Sites - Reddit, HackerNews It got very little traction in these commun....
|
|
Review Signal Launch: Stats, Failures, Successes and Lessons Learned
-
kevinohashi.com
-
13 years ago
-
eng
It's been two weeks since Review Signal launched. The initial excitement of reaching it's first major milestone is over and I finally have a moment to think about how it went. The Stats: 3,041 Visits 10,163 Pageviews 3.34 Pages per Visit Average Visit Duration: 2m 16s Bounce Rate: 5.52% Visitors from TechCrunch: 727 Failures and Short Comings: Social Sites - Reddit, HackerNews It got very little traction in these commun....
|
|
Review Signal Launch: Stats, Failures, Successes and Lessons Learned
-
kevinohashi.com
-
13 years ago
-
eng
It's been two weeks since Review Signal launched. The initial excitement of reaching it's first major milestone is over and I finally have a moment to think about how it went. The Stats: 3,041 Visits 10,163 Pageviews 3.34 Pages per Visit Average Visit Duration: 2m 16s Bounce Rate: 5.52% Visitors from TechCrunch: 727 Failures and Short Comings: Social Sites - Reddit, HackerNews It got very little traction in these commun....
|
|
Review Signal Launch: Stats, Failures, Successes and Lessons Learned
-
kevinohashi.com
-
13 years ago
-
eng
It's been two weeks since Review Signal launched. The initial excitement of reaching it's first major milestone is over and I finally have a moment to think about how it went. The Stats: 3,041 Visits 10,163 Pageviews 3.34 Pages per Visit Average Visit Duration: 2m 16s Bounce Rate: 5.52% Visitors from TechCrunch: 727 Failures and Short Comings: Social Sites - Reddit, HackerNews It got very little traction in these commun....
|
|
I had a brief chat on Twtter with @mrlasertron yesterday about GUI in ImpactJS and decided to make a post about how I’m handling all GUI elements in my project (nicknamed Vostok until I decide on a title) yesterday. This project is more UI heavy than any other I’ve done in Impact, so putting this together has involved much experimentation, makeshift diagrams of relationships between elements, and trial and error. First, some screenshots..
|
|
Il prossimo 24 ottobre sarò a Milano per A Morning with MongoDB, evento ufficiale 10gen nel corso del quale racconterò la mia esperienza nell’integrazione di MongoDB in una Web REST API. Partecipazione e registrazione sono gratuite: cosa aspettate?
|
|
Surprisingly, "\-\-" is not allowed inside XML comments
-
www.databasesandlife.com
-
13 years ago
-
eng
I was slightly surprised today to check XML containing the following for validity, and to see the following error from the validity check: Low-level XML well-formedness and/or validity processing output Error: -- in comment I mean basically this error does what it says on the tin, I mean, the string “--” is indeed not allowed in comments. To quote Wikipedia :
|
|
ImpactJS has a really cool screen shaker plugin written by Killbot, which I used during the first iterations of this game. The project has now changed quite a bit and the screen shaker was no longer working exactly as I needed it to because the camera follows the player entity as it moves instead of being constantly positioned at 0,0.
|
|
Last time we investigated the k-nearest-neighbors algorithm and the underlying idea that one can learn a classification rule by copying the known classification of nearby data points. This required that we view our data as sitting inside a metric space; that is, we imposed a kind of geometric structure on our data. One glaring problem is that there may be no reasonable way to do this. While we mentioned scaling issues and provided a number ..
|
|
Last time we investigated the k-nearest-neighbors algorithm and the underlying idea that one can learn a classification rule by copying the known classification of nearby data points. This required that we view our data as sitting inside a metric space; that is, we imposed a kind of geometric structure on our data. One glaring problem is that there may be no reasonable way to do this. While we mentioned scaling issues and provided a number ..
|
|
Last time we investigated the k-nearest-neighbors algorithm and the underlying idea that one can learn a classification rule by copying the known classification of nearby data points. This required that we view our data as sitting inside a metric space; that is, we imposed a kind of geometric structure on our data. One glaring problem is that there may be no reasonable way to do this. While we mentioned scaling issues and provided a number ..
|