So I looked up how to use the PubSub pattern in JS and came across a few articles. I wanted to have two way data binding, so when a one of an Object's Properties value was set, it would update x ammount of subscribers.
Sounds confusing but heres the relevant sections of my code:
// data-cluckle...
@Malachi I personally think this repository is more interesting, but that might be a bit too much for you right now (and is in Java, and not JavaScript)
Calculating probabilities in Minesweeper might sound like an easy task, but I've seen so many probability calculators that's either incorrect, horribly slow, or with ugly code (or all of them) so I have to share my code for this.
This code is used within my Minesweeper Flags online game by the A...
yeah yeah.... I have work, and then there have been some time-consuming things to do, like meta posts, and flags, and chaos..... and books to read, and kids to feed, etc. ;-0
@SimonAndréForsberg I've never look at everything! And there is still some things that I don't quite understand (no that good with probabilities and algorythm).
So basically my code waits for database table a to have an xml string inserted into it. The sql query parses the xml string and stores it into separate columns (this has to occur this way because the insert is actually happening from elsewhere, I just rewrote if for testing). The service broker l...
@skiwi Good question. There's some ethical things to consider.... I can't do it myself, but I work with these folk.... if there was a 'sponsorship' angle I could approach them with....
@skiwi in essence, you build a cloud application. The application is essentially myapp.ng.bluemix.net and is globally accessible. The backend of that can be one of a number of languages (Java, Node.js, etc.).
being globally addressable, and having no restriction on bandwidth, and being able to create socket/network connections anywhere..... allows you to, essentially do anything you can on your own server somewhere, except you no longer have to manage your own infrastructure....
in addition, you can link to backend services (databases, etc.) that are managed by other people too.
you just plug in to what you want, and then expose your app to the world.
What about moving your services as company to such cloud? Does it bring out risks? Assume it's a server handling some kind of messages, if you make sure data comes in encrypted and goes out encrypted, do you have a risk?
I'm not pushing it, all I know is that IBM is trying to create an environment where people move their applications to the cloud, and then IBM sells the service... ;p
The requirement is that there needs to be a free-to-play level of service for everything, and then you make the money on the people who use it for business/mission-critical.
IBM can do it relatively cheap because: they have invested in multi-tenancy systems (lots of people securely using the same resources), and they also own SoftLayer.
cheap enough that they can carry the expense of the free-tier, as a loss-lead.
After developing several Haskell applications I've found myself rigorously segregating impure code and failable (partial) functions from their pure & total counterparts. These efforts have noticeably reduced maintenance cost associated with the applications. I have found myself over time relying ...
The following class handles all my HTTP cookie authentication processes.
Can it be improved?
Readability, usability, clean code.
Any other suggestions are always welcome.
namespace Model\Application;
use Http\HttpCookie;
use Model\Domain\User\User;
use Library\CryptoRandCharGen;
use Model\...
Back in the 70's I used to watch TV in black and white. Then everything was in colour, it was pretty awesome. You know what else would be awesome? Looking at Code Review Stack Exchange in full colour too!
I suspect that there is an ISO standard that bomb makers follow. As evidence of this is the fact that in about 50% of the movies, there is a statement like "remember to clip the red wire and NOT the blue" or some similar statement. SO I suspect that embedded in the ISO document is a standard tha...
I am in a bit of a pickle. I have an xml which I want to read and make a table using AJAX/HTML/JQuery. The data from the xml is categorized. Any help would be great. Thanks!!
I'm trying to figure out a good way to do semi-inheritance in c.
This is what I've come up with
//statemachine.h
...
#define CHANGE_STATE(newState) \
do { \
printf("[%s]->", stateStrings[state]); \
state = newState;...
I'm looking for some tips on how to properly organize my code so I don't run into as many errors as I have been lately. One of my problems right now is that my elements are positioning weirdly. My fonts move on top of each other when I resize the window, my widgets don't stay centered like I thou...
I'm looking for some tips on how to properly organize my code so I don't run into as many errors as I have been lately. One of my problems right now is that my elements are positioning weirdly. My fonts move on top of each other when I resize the window, my widgets don't stay centered like I thou...
I have a php page for a weather station that I'm trying to build.
I run multiple queries to pull out data from a mysql data base for min/max/average values for temp, pressure, humidity etc.
All of these are done by multiple mysql select statements - here are 2 of them:
$sql_dht22_temp_max = "...
I'm originally from Saint-Georges-de-Beauce, lived in Montréal for 3 years while attending college. Apartment was across the street from the big TVA building on boul. de Maisonneuve
@Malachi I looked that over. Does appear that it leans to the 'no brackets' direction... but for vertical space? Is that up-to-date? I mean on old console screens I can see it, but I can easily get 100 lines on my screen and we all use the same monitors here.
This is an assignment which C++ class asked me to make. I have one main menu with four other menus branching out from it. If you guys can please review this program I would be grateful. I am perusing a bachelors in programming and I would like to make my code as clutter free as I can. So plea...
@Volearix I think that it is up to date, I am looking over it myself, I don't think I have ever read a standards paper on any language except for lolcode or brainfuck
If the link you sent me is the most up-to-date version, I will have to change it up. I can't find anything stating otherwise. Always made sense to me due to the lack of confusion when checking out if blocks, but better go with what the standards say.
I'm creating a voxel based game and have been working on it for quite a while.
I've come to a point where I have to load and unload chunks on the fly. I've created a chunk manager class and its working, but its quite slow and I would like to improve its speed.
(This is my first post here so I'm...
Hi I have created a java program which generates a key (for activating a piece of software for example) my code works correctly however there are parts of it that I know can be improved. In particular inside the createKey method were I have repeated an if statement in multiple places.
I would ap...
The preferred way to do this is to only put an opening brace { after the last using statement, like this:
using (StreamReader outFile = new StreamReader(outputFile.OpenRead()))
using (StreamReader expFile = new StreamReader(expectedFile.OpenRead()))
{
///...
}
@rofl using (SqlConnection con = new SqlConnection(db)) using (SqlCommand cmd = CreateCommandWithDependency(SYSTEM_AVAILABILITY_QUERY, con, SystemAvailability_OnChange)) { con.Open(); cmd.ExecuteNonQuery(); }
I have my below method which will be called every one minute from the background thread.
In my below code, if my unauthorizedCount and badRequestCount is not equal to zero, then I send out an email.
private void callMetrics() {
// .. some other code
// send an email for unauthorized ...
One of the moderators on Stack Overflow in Portuguese was complaining about the number of "closed without comment" flags they had to deal with, considering the community has plenty of users who could provide guidance to newcomers and not leave all the work to the mod team.
That flag only exists ...