Friday, April 20, 2012

Silverlight Windows Phone and Sockets part 1 of an on going learning experience.

So im going to be learning how to write a silverlight app on a windows phone to send gyro data to a pc. Sounds simple, but from the get go I found that the http version of socket is really damn slow, so I'm supposed to use websocket so i've been told. Right now I have an HTTP version of this working which is really slow.

so here it goes. I'm going to read
http://www.rajneeshnoonia.com/blog/2010/12/silverlight-websockets-duplex-communication/
and
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/07/27/silverlight-and-websockets.aspx

so hopefully I'll be able to wrap my head around sockets in general by the end of the day.
So websockets allow TCP over a single socket. and Wiki says that any client can use websockets not just browsers. Which is good since im writing a silverlight client. Wiki also mentions "realtime games" which is good since I need to send gyro data as fast as possible from the phone to the pc to use the phone as a controller.

So the wiki technical overview mentions that some browsers dont support this for security reasons, im hoping that the latest version of silverlight im running does support websockets, or im SOL.

Wiki mentions something about a handshake, which is what my fellow programmer mentioned, so it seems like im on the right track. Okay so enough with the wiki, onto the URLs i mentioned.

first with http://mtaulty.com/ he mentions TCP being full duplex and open and closes a connection only at the beginning and end of a session. I want to do this, so again seems like im on the right track. This is better than the http version of the app im working with right now with "using System.Net.Sockets;" in my C# app so far.

he also mentions that i should read http://www.whatwg.org/specs/web-socket-protocol/ but really? it's a gigantic unformatted txt file... WTF? it does mention a lot of UTF8 looking bytes that are line breaks and stuff. so i'll just stick to that being something about the sorts of characters to send to make websockets do specific things.

but what? Now he's talking about http polling and other "tricks" and how great http is making use of sockets. No, i dont want http, it's slow!

okay, hes going back into websockets now. so it's looking like things are back on track....

reading about checking if your browser supports websockets, i'll skip this shit... and he just says use WebSockets open send close methods to use websockets... fucker, that didnt help worth shit.

after further research on msdn I find .NET Framework 4.5 has system.net.websockets, which is what I need, and it's a beta... so lets see if i can get it to work in visual studio 2010 found it here http://www.microsoft.com/download/en/confirmation.aspx?id=28978

i read somewhere that it's not side-by-side compatible with 4.0 so lets hope that the beta mostly works for what I need. since the WebSocket part of the framework is new I'm hoping that they spent a lot of time on this part to make it work right. crossing my fingers...

update ~4pm:
ah! so i found that mtaulty guys video posts which seem a lot more informative http://channel9.msdn.com/blogs/mtaulty/silverlight-4-beta-networking-part-9-udp-multicasting

I installed .NET 4.5 and there's no system.net.winsockets reference to add. I'm not sure what else might have been added but I can't really tell if there's a way to check if 4.5 installed correctly since it just over wrote 4.0 stuff. So I'm going ahead and Installing Visual Studio 2011 beta, so I hope that perhaps that might have the websocket thing I need to add to the project so I can write this client for the phone if the phone can even make use of the new .net libs through silverlight.

update ~7pm:
After installing the Visual Studio 2011 beta I'm met with a rather start grey everything. Kinda neat, but also pretty flat and it feels awkward with the windows 7 glassy frames. And, starting up a project I find I have to go to the on-line templates to find a Windows Phone template that might have what I need. And once I got that up I check for System.Net.Websockets and NOTHING I can't find the reference to add to my phone project. So I'm pretty much dead in the water.

looks like I'll have to write a small javascript web app to websocket data from silverlight to the PC.
We'll take a look at how that might work on monday. For now I'm going to go home and enjoy some Unrealscript and shoot things.

Wednesday, February 8, 2012

Starting to get into Game Maker

Just figuring out how to build scripts in Game Maker.

So far it's pretty simple. Almost over simplified. However, it's got a lot of clever things.
The timeline editor seems like a pretty simple way to control flow of action.
Add in a step0 and call some script.
Then add in Step at position 1, and then make it sleep "Zzz" for 1000 ms, or a second.
then add in a step at 2, resume timeline.

Set the timeline to loop and you have a script that executes once a second on the object the script is applied to.
I have an object which on create sets it's timeline and then starts it.

then my script looks like this:

globalvar someVar;
{
 cfTime = 1.0;
 cfTime += someVar;
 show_debug_message(cfTime);
 someVar += 1.0;
}

with this script applied to the timeline to execute, the messages increment +1 every second. pretty simple.
in the messages window when running in debug i get a nice counter. I'll be using this for a lot of things, Just getting all of my globalvar's to be easily remembered is going to be a big part of the organization of this project.

Monday, December 19, 2011

colons are full of...

comparing unreal script and javascript
function declaration in unity3d vs Unreal

javascript:

function SomeCondition():boolean

{

return false;

}

what's the ():"somereturn value?"

unrealscript:

function bool SomeCondition()

{

return false;

}

for some reason, I prefer using :'s a lot less. the formatting of putting the return value after the arguments makes less sense to me for some reason.
even in C# you have

public bool SomeCondition()

{

return false;

}

Not sure I'll be into this js stuff in unity, or at least it's abundance of colons.

Thursday, December 15, 2011

SOPA keeps going on!!

Now there is a debate on how an amendment doesn't need a court order to take down a site. Mel Watt, says "I'm not convinced there doesn't need to be a court order to take down a site" and in fact, there is no recourse if an ISP takes down a web site for the web site's owner. The owner will not be notified and poof, their web site is gone, simply because there's no need by the amendment to inform or allow for any notice to the web site owner. And there's no court order required if the ISP is asked to take it down. Issa is asking to add a requirement for a court order before any legal action is taken.

And now the vote, and the result is the same as it's been all day, NO. So far all of the amendments that break the terror that is the SOPA are not being broken down. The bill is going to remain venomous and onerous as it started off. If anything it's getting worse. The voting has been consistently 10 for freedom of speech and 24 for squelching the right to fair use rights.

Jared Polis is making everyone aware that anyone could issue a website take down. And he's asking that a court order is required before issuing any take down notice, and there has to be some merit before the order is issued.

Smith insists that the "media publishers" cannot take down web sites if there is a court order required. He's got all of his reasons written for him. Berman is also on the side of the chairman. Stating that "good faith" is the only thing that's required for a take down. DMCA offers a counter notice. SOPA tosses out the notice. Lofgren is still pushing toward adding some court order to limit the ease of any company "Like Comcast" who could take down any site just because it might compete with their services.

Polis chimes back in to remind people that only a letter is required without any checks or balances to take down someone's business. Chaffetz, Jason is reminding people that any web site that's taken down can be someone's work, their business, and their lively hood. Reminding the committee that all it takes is a paper to reduce the competitive nature of the internet as a business. And we need to protect peoples rights, not take them away.

OMG Mel Watt says a compromise with a notice is worth amending.

However, it seems like the hearing tonight will end with no free speech or internet business positive amendments being made. All of the votes are failing 2 to 1 with the minority being the only people speaking and making any moves to change the bill.

so frustrating.

more SOPA

Issa points out a flaw in the amendment in that there is a part of the bill that allows for enforcing copyright from any other nation in our nation. This is only US law, not international law, it's way too far reaching. So we need to limit the copyright law to just this country. 6 - 24 Copyright loses... so angry about that. Why do we need to enforce copyrights from china here? China don't enforce our copyrights over there.

So dumb.

So far every amendment to an amendment has been voted NO, so basically this bill will pass through the justice without any changes to it's venomous idiotic ways. Looks like free speech is going to have to go to dark net forums, like it's the french underground hiding from the SS. Yep, I said it. the DOJ is now the copyright nazi party.

SOPA coverage continued.

The chairman is being asked by Ms Waters to tell them to shut up because he's already convinced that the bill should pass, so all of the arguments by the reps will be ignored.

Mr Poe is also suggesting we delay. Lungren is asking for a closed conference with the NSA and other security govt groups to talk about the DNS filtering threat. A classified Briefing.

Sanchez asks for 7 days of legislative review. He also points out the original draft had ISP defined incorrectly, so they need to make sure that everything is at the very least written correctly. http://jacksonlee.house.gov/ Said mr king of iowa was being offensive by not attending and simply surfing the net instead of being at the hearing.

... someone asked to remove that "offensive" line from the record... she called him incapable of multi-tasking :D
wow this is taking a long time to strike a word from the record... oh my gawd, she's asking for a parlamentarian to assist with the rules of the house's records... fawk...

alright, looks like this isnt going anywhere any time soon. I'll read the transcript later tonight when all this shit is done...

posting about the hearing in the house of reps covering SOPA

Darrell Issa says the bill sucks and ammends that search engines and dns filtering wont work, this is supported by Lofgren, Sanchez, and Chafetz at the beginning of the hearing. Chafetz calls the people on the internet "the nerds of the world," LOL.

Issa continues to educate the house that "hyperlinks are words, and you cant stop the printed word" he's saying that the bill should be handled more like patent reform. and wants to at least have more hearings not just default to one hearing.

Mel Watt is a slow speaker. and admits he doesn't know anything about technology. And thinks that the bill will not stop criminal action, but still wants to pass the bill just to reduce the criminal actions. He thinks the DMCA wasnt effective, so thats why there needs to be a more dramatic bill. He likes to remind people that he's "not a nerd" Still uses a typewriter I'm sure. He's completely ignorant on the internet and is allowed to pass legislation on technology he knows absolutely nothing about.

Mr. Berman another slow speaker thinks that the people who work on the internet haven't been coming forth to tell the house that they are being dumb. http://sensenbrenner.house.gov/ tells berman that he's only got a copy of the bill a few days ago, and hasn't been able to analyze it. Berman is talking about the length of time that this bill has been put forward, but also admits that there should have been ample time to think about the issues.

Sanchez is putting forward a suggestion to delay the hearing to bring in more experts. Berman is saying he's been trying for years to bring them in, but they haven't shown up. Sanchez is saying that they will now. Berman doesn't care.

Mr. Goodlatte has http://www.innovationpolicy.org/ as a site that supports SOPA, who the heck are these guys? says DNS filtering is fine and it's an innovation. This guy sucks.

Mr. Perlusi notes that we should respect "nerds" suggests that to continue the markup and to delay the passing of the bill. Sanchez asks for a technical hearing to cover the bill. Lofgren says the Goodlatte's arguements are supported by people funded by the MPAA (zing!) and is saying they're paid liars. (poking at Mel Watt)

California Lungren rep says that there is controversy and offers to delay the hearing as well, expecting that there would be technical people present at this hearing. He also puts forward that the facts are incomplete. He's telling the chairman that saying "because you don't have a better answer, you can't stop the bill" which is "a red herring" so we should change his opinion and wait for a better way to rule on the bill. He also opts to not pass the bill if you dont understand it.

Mr. Issa is asking for experts to show up. Computer IT folks should pay more attention to this shit... http://www.netcoalition.com/ was mentioned by Issa to show up Mel Watt is talking again, about who's been bought off. and talking about a lot of money floating around, and is being defensive about his position. So, he's being defensive because he's obviously been in his own words: "been bought off" He also passed laws on derivatives (responsible for the crash of 2008) so Mel Watt has a history of bad decisions.


rxokita's shared items