Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it,
follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given
their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'
Posts
Mostly joking, semi serious?
C#/.NET are doing really great things with asynchronous programming these days.
e: And of course, in .NET 4.5 we get the async and await keywords.
http://stackoverflow.com/questions/4246351/creating-random-colour-in-java
Usually you want a colour that fits in a certain place and you want to just change/pick the hue at random. You can't do that independently of everything else in RGB, but that it was the H in HSB is for. Just pick a set value for S and B (or decide an appropriate range and random those within it) and you avoid the random colours that clash or are unreadable etc.
For example, (0, 1, 1) HSB is "0 degrees hue, full saturation, full brightness" and is the colour red (255, 0, 0) RGB. If you random that first number between 0 and 1 you'll get a colour with the same overall value but totally random hue.
Play with that.
The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
Now I can finally do something like:
SqlLayer sql = new SQLSrv(); sql.Query("SELECT * FROM MyTable"); while(sql.Read()) { Console.WriteLine("ID : {0}", sql["id"]); Console.WriteLine("Name : {0}", sql["name"]); } sql = new MySQL(); sql.Query("SELECT * FROM MyTable"); while(sql.Read()) { Console.WriteLine("ID : {0}", sql["id"]); Console.WriteLine("Name : {0}", sql["name"]); }I don't even know what the hell this person was thinking before hand.
Edit: That being said, I have very little practical experience dealing with concurrency.
A couple of the guys in my office have switched to Go, and they love it. What do you think is it's strongest feature?
The Future<> frame work for multi-threading and scheduling worked fine for me. The only whore is knowing until you get the result and let the Future get Object collected, the memory the thread was using stays kept.
Turns out I was doing it correctly I just wasn't refreshing the scene. Bah!
And really, my only two real problems with it are "OMG BOILERPLATE WHY MUST I TYPE SO FUCKING MUCH?!?!!?!?" and that everything about it is aimed at super huge mega corp with a billion servers and developers, so it's way too much hassle to get experience in the parts of it potential employers are looking for by doing small projects on your own.
I have a HashMap<String, Control>. Is there an easy way to check the variable "controlType" in the Controls? (Basically there is a String in Control that is "controlType")
The only way I can think of is taking the ControlList ArrayList, popping the name into the HashMap and getting the Control and then checking the controlType. But that sounds incredibly inefficient.
myHashMap.get("MyControl").controlType = "poopybutt";But it should.
for (Control c : hashmap.values()) { if (c.controlType == "poopybutt") ... }The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
looks like I will need three to get the MCSE Data Platform path
"See relevant comment section"
I also think jsp is about the most terrible, archaic shit still in use. I've never found a jsp tutorial that suggested java had moved past "mix your markup and code because that's way easier for everyone!!!!". I used servlets with velocity templates for my previously mentioned project.
n = rows[A] // initialization for i = 1 to n do for j = 1 to n do if i = j then t[i][j](0) = 1 else t[i][j](0) = aij for k = 1 to n do in parallel for i = 1 to n do for j = 1 to n do for t[i][j]^(k) = t[i][j]^(k-1) or (t[i][k]^(k-1) and [j][k]^(k-1)) return T(n)This is actually a common example for Thread level concurrency, if you google it you’ll find plenty of examples. However, we were to implement concurrency at the process level via shared memory and semaphores. The matrix and number of processes was determined at runtime.
This is not how you’re suppose to use process level concurrency. In fact, if you do a search for this exact problem, you will find forums of people asking how to do this and being told to do it with threads because it’s stupid to do it via processes.
I did it. And I am convinced that there is absolutely no room for creativity in the solution: there is only one way to solve the problem. It is probably one of my greatest achievements from college and also one of the least practical.
You don't get your paper into a symposium by saying reading the damn documentation.
"For further information, see the help files."
Can't really without posting hundreds of lines of code. However I MAY have found the issue. Hopefully I can get it working by 5pm.
You really need to pitch the idea of some testing framework. Be it unit tests, functional tests or even regression testing you need a way to be sure individual components work as expected.
Specifically, I'm trying to run some Lua scripts through CGI, but I'm not sure whether I'm just screwing it up somehow or if indeed the server does not have mod_lua running. The server tries to run the script (because it's under /cgi-bin/), but never actually executes a single line in the script. It just immediately throws a 500 error and complains about "Premature end of script headers". For what it's worth, I can get the server to run PHP, Python, and Bash scripts just fine.
The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
We have JUnit tests set up. But I'm not sure they would help me figure out the problem, though.
Interesting learning experience today and not one I found any information online for -- do people live in ideal worlds?
Problem: I want to implement a policy for stored procedure naming that will require them to be up_%
Additional Problem: This is an existing database where developers did not abide by the new policy before -- this is in use so you have to be able to edit old ones without renaming [KEY!]
First iteration:
Make a condition for a Stored Procedure Facet and the Expression of @Name like 'up_%'
Flaw: altering existing stored procedures would fail
Second Iteration:
Add another expression to the condition which involves the @CreateDate being >= current date while the @name is like up_%
Also, put an "or" statement on the @Name not like up_% and the @CreateDate <= current date.
Flaw: existing procedures that abided by new naming would not save [son of a bitch]
Third Iteration:
Remove the second @Name restriction leaving you with
@Name like up_%
AND @CreateDate >= [today's date]
OR @CreateDate <= [today's date]
I am trying to get one created to disallow the creation of a table without a primary key but it appears that the DDL architecture for the policy won't let me auto roll them back through the on change: prevent functionality. I would have thought the create table trigger could have been used but I am not sure of the inner workings. I can get one created that will let me press 'evaluate' and give me a listing which sort of works but I wanted one to prevent ongoing stupidity.
The tests should be designed to help verify the code behaves in the way you expect. So you have tests to make sure the control is working in the main scene, and that it works inside a tabbed pane. You can than start looking at what test status to determine the likely cause of failure. For example you might find that unit tests of your tabbed panes pass when values are set programmaticaly, but fail when being run with a keyboard and mouse emulator. You than know that your logic is valid, but your UI code is to blame.