Saturday, April 24, 2010
Hm
I think the worst decision I've been able to independently make was to go to Waterloo. I think the second is to work for my current company.
Monday, April 05, 2010
WebService API
Silverlight and Ruby on Rails
Technical Discovery is taking a lot longer than it's supposed to have.
I've had a fellow Ruby/Rails friend direct me in the right direction. I'm a bit disappointed that I just couldn't Google "Ruby Rails Web Service" and get an easy tutorial. I don't normally expect that with all languages and frameworks but the reason I expected it from R&R is because it's new (relatively) and web-based.
I followed one tutorial that used the actionwebservice libraries. It didn't work. Completely.
A friend of mine said that I can easily control and create a web service out of the box. Simply by working with the views. I don't know enough yet. I do realize that the fast and furious way of R&R won't work. I'll need to go through the fundamentals in order to get it to work.
There is one issue though. This is going to be really interesting to me. From what I can tell, there is no support for generating WSDLs. Apparently, they don't believe in the bloat. This is a bit confusing to me because the WSDL is intended to just expose the information that your web service provides. Maybe it gets hairier than that, I don't know. All I know is that it does most of what I want. Easy database retrievals and JSON.
So why the WSDL?
.NET proxies that call web services are generated from WSDLs.
Now, I have to decide on whether I want to generate a WSDL (or write it manually). OR
I can just write my own transport layer for making these method calls. All of these calls would have to be asynchronous though. I would also need to serialize each of the responses into accompanying objects. That means I'll have to always update the client anytime I update the server. It's not that bad. I've done this type of thing before. I'll just need to do it on a background thread using the HTTPRequest and HTTPResponse objects.
There's nothing particular interesting about writing a WSDL generator. Besides learning about the WSDL spec and the Ruby syntax. Writing a transport layer maybe a decent exercise. I could always write it and compare my implementation with what gets generated by the proxy class.
Writing a WSDL manually would be the best and fastest option though. I could technically write the classes and method signatures in .NET generate the WSDL and then use it for Ruby. As sad as that sounds.
I'm going to go with the transport layer, I think. I think that it'd be an interesting exercise.
I've sat down with Q and gotten the rules of Sichuan Mahjong down. Fairly interesting. Oh yes, I have the codename of my project. I named my Bomberman project: code name Oklahoma. I'll let that sink in. This one I'm going to name it Project Hot Pot.
Here's the service API so far:
Lobby:
- Game[] DisplayGames
- gKey CreateGame
- pKey JoinGame (gKey)
- void LeaveGame (gKey)
- GameDetail DisplayGame (gKey)
- void StartGame (gKey)
Note: Designing a chatroom sucks using polling
Chat:
- string Say (gKey, pKey, message)
- string Get (gKey, message, timestamp)
Game
- GameDetail (gKey) -- overlaps DisplayGame (gKey)
Action
- Tiles GetTiles (gKey, pKey)
- GameState GetState (gKey, pKey)
- Tile GetTile (gKey, pKey)
- GameState Mahjong (gKey, pKey)
- GameState Pong (gKey, pKey)
- GameState Kong (gKey, pKey)
- GameState Sheung (gKey, pKey)
I haven't decided what goes in my objects yet. This is going to be the basic foundation of what I need. I'm going a little bit with and against the grain for this. In that I won't be using RESTful APIs properly. I'll maintaining only a little bit of state on the client-side. The rest will be done on the server-side (stupid I know ... but what can I do). This game can actually be played by entering the URLs inside a web browser. I don't think anything requires POSTs yet only GETs. Since I'm just going to be using polling for this ... I'll need to set timeouts for a game. Game state will also be stored on a database. What sucks is that the tiles need to be shuffled and stored into the database. It'll be base 84 ... maybe a CHAR(84) for the storage of the shuffled set? I don't know. I'll think about the server layer later.
I'll need another day to think about this. I'll need to draw what each client sees and the controls. Play a game in my mind of what they require and then do it again.
After that, I'll design the web-service. Since I'm doing this across two separate web applications … this should be interesting. I have no source control. I think I'll go with SVN onto an external drive. I could go with GitHub since it's just me. But I'll stick to what I can get. It's 4:17am now. I'm out.
Mac Hatred:
Apparently no Mac users enjoy reaching the beginning or end of a line using shortcuts properly. Also, iTunes copies any song I double click into its own directly. That bugs me. Then again, windows bugs me when it places hidden images into every directory when it downloads the album art.
Technical Discovery is taking a lot longer than it's supposed to have.
I've had a fellow Ruby/Rails friend direct me in the right direction. I'm a bit disappointed that I just couldn't Google "Ruby Rails Web Service" and get an easy tutorial. I don't normally expect that with all languages and frameworks but the reason I expected it from R&R is because it's new (relatively) and web-based.
I followed one tutorial that used the actionwebservice libraries. It didn't work. Completely.
A friend of mine said that I can easily control and create a web service out of the box. Simply by working with the views. I don't know enough yet. I do realize that the fast and furious way of R&R won't work. I'll need to go through the fundamentals in order to get it to work.
There is one issue though. This is going to be really interesting to me. From what I can tell, there is no support for generating WSDLs. Apparently, they don't believe in the bloat. This is a bit confusing to me because the WSDL is intended to just expose the information that your web service provides. Maybe it gets hairier than that, I don't know. All I know is that it does most of what I want. Easy database retrievals and JSON.
So why the WSDL?
.NET proxies that call web services are generated from WSDLs.
Now, I have to decide on whether I want to generate a WSDL (or write it manually). OR
I can just write my own transport layer for making these method calls. All of these calls would have to be asynchronous though. I would also need to serialize each of the responses into accompanying objects. That means I'll have to always update the client anytime I update the server. It's not that bad. I've done this type of thing before. I'll just need to do it on a background thread using the HTTPRequest and HTTPResponse objects.
There's nothing particular interesting about writing a WSDL generator. Besides learning about the WSDL spec and the Ruby syntax. Writing a transport layer maybe a decent exercise. I could always write it and compare my implementation with what gets generated by the proxy class.
Writing a WSDL manually would be the best and fastest option though. I could technically write the classes and method signatures in .NET generate the WSDL and then use it for Ruby. As sad as that sounds.
I'm going to go with the transport layer, I think. I think that it'd be an interesting exercise.
I've sat down with Q and gotten the rules of Sichuan Mahjong down. Fairly interesting. Oh yes, I have the codename of my project. I named my Bomberman project: code name Oklahoma. I'll let that sink in. This one I'm going to name it Project Hot Pot.
Here's the service API so far:
Lobby:
- Game[] DisplayGames
- gKey CreateGame
- pKey JoinGame (gKey)
- void LeaveGame (gKey)
- GameDetail DisplayGame (gKey)
- void StartGame (gKey)
Note: Designing a chatroom sucks using polling
Chat:
- string Say (gKey, pKey, message)
- string Get (gKey, message, timestamp)
Game
- GameDetail (gKey) -- overlaps DisplayGame (gKey)
Action
- Tiles GetTiles (gKey, pKey)
- GameState GetState (gKey, pKey)
- Tile GetTile (gKey, pKey)
- GameState Mahjong (gKey, pKey)
- GameState Pong (gKey, pKey)
- GameState Kong (gKey, pKey)
- GameState Sheung (gKey, pKey)
I haven't decided what goes in my objects yet. This is going to be the basic foundation of what I need. I'm going a little bit with and against the grain for this. In that I won't be using RESTful APIs properly. I'll maintaining only a little bit of state on the client-side. The rest will be done on the server-side (stupid I know ... but what can I do). This game can actually be played by entering the URLs inside a web browser. I don't think anything requires POSTs yet only GETs. Since I'm just going to be using polling for this ... I'll need to set timeouts for a game. Game state will also be stored on a database. What sucks is that the tiles need to be shuffled and stored into the database. It'll be base 84 ... maybe a CHAR(84) for the storage of the shuffled set? I don't know. I'll think about the server layer later.
I'll need another day to think about this. I'll need to draw what each client sees and the controls. Play a game in my mind of what they require and then do it again.
After that, I'll design the web-service. Since I'm doing this across two separate web applications … this should be interesting. I have no source control. I think I'll go with SVN onto an external drive. I could go with GitHub since it's just me. But I'll stick to what I can get. It's 4:17am now. I'm out.
Mac Hatred:
Apparently no Mac users enjoy reaching the beginning or end of a line using shortcuts properly. Also, iTunes copies any song I double click into its own directly. That bugs me. Then again, windows bugs me when it places hidden images into every directory when it downloads the album art.
Sunday, April 04, 2010
Yawn
I couldn't get Ruby to work on Windows. I tried the base case and got a DLL error. I tried installing all these extra dependencies and packages. I had a quick website built in no time but the actionpack ... or action ... whatever it is just can't run properly under windows. People tell me to VM another OS. I'll tell you what. That's the only chance I'll ever give Ruby and it's gone now. It shouldn't be this hard to create a web service. This is so silly.
What a waste of time. On the plus side, my Windows 7 froze again. I left the house for a solid 6 hours and thanks to the Macbook Pro crashing so much ... it spent 8 hours scanning the disk for errors.
Urgh, it's so frustrating just to get something simple done. I may be forced to use PHP but I'd rather not go that route. I'll have to host this thing myself. Which isn't something I want. I have no choice.
This is absurd ...
What a waste of time. On the plus side, my Windows 7 froze again. I left the house for a solid 6 hours and thanks to the Macbook Pro crashing so much ... it spent 8 hours scanning the disk for errors.
Urgh, it's so frustrating just to get something simple done. I may be forced to use PHP but I'd rather not go that route. I'll have to host this thing myself. Which isn't something I want. I have no choice.
This is absurd ...
Back to Black
After seeing a demo of Google's HTML 5 of Quake 2 I'm wondering if I should just do a game using those WebSockets ... and Javascript and stuff.
Seriously.
Most applications need a client-side component, be it: ActiveX, Silverlight, or Flash. Simply because the browser is only intended to display HTML and execute Javascript. Yes, that's not all and I'm being a bit reductive. That's why I'm interested to see what HTML5 can do and further browser support for it.
Anyways, back to the project.
Why am I not using WCF? Don't get me wrong. It'd be very good if I were to use WCF and learn about it. But I'm sure I'll run back into WCF again. I want to write my own polling mechanism in Silverlight. I just think it'd be more interesting. A lot of what we're building should be modular. Anyways, it's not that big of a deal. If I'm building a web service and I get a WSDL generated (I'm NOT writing it myself, I've done that before ...); then .NET will generate a proxy anyways.
I'm still under technical investigation. I have to research how to build a web service using Ruby on Rails. My main concern is that Ruby on Rails is very high. You use ORMs mainly to manage your database. I need my web service/access to be multi-threaded and all that jazz. I'm sure I can get the control I want. Just want to know how.
Also, I have to think about how to run both Ruby and .NET on the same machine. Since there's no way in hell I'm using mono. That means I'll be booting into my windows environment. Since I don't have a good desktop and I have a shitty MBP ... I can't use VMs.
This is going to be interesting. Anyways, time to research Ruby.
Friday, April 02, 2010
WCF + SL
Interesting.
I'm having issues doing some duplex WCF with Silverlight right now.
So what I wanted was to be able to call back the server to the client. Now there are obvious issues with this. You don't want to go ahead and use a configuration that is going to slow it down. The server may need to have memory of the clients that are connected to perform that callback. It could be a timeout before the server will reping to see if the client is still alive. Not to mention security and transport issues to support a duplex binding. The HTTP the protocol that it is is not the best binding to use in this situation. There are other types that many people would use in a situation like this. wsdualhttpbinding or something like that; for duplex it's best for one to use nettcpbinding. Silverlight 1-3 doesn't support it. So fuck it, I take a look at what's out there. There's pollingduplexhttpbinding. The name tells me that's it's not a true duplex. Since there's a timeout and some interval deal. I may as well write my JSON service and have my silverlight app pull on a regular basis. It's fucking easy enough and I could write that.
So I download Silverlight 4, I realize I now need to change all my assemblies to point to a new Framework. Then I realized my copy of the Visual Studio 2010 Beta can't work with SL4.
Everyone is pissing me off to use my company's copy of Visual Studio. Don't get me wrong. I can. My company will never know and that I am. I just hear a lot of bullshit about Microsoft and editors and shit like that. I want to be able to prove I can build a decent MS application using free tools. Not just a decent MS app. A state of the art one using the latest technologies.
So here I am. I guess using a beta copy was "cheating". For some reason after I installed the beat, it was difficult to find the Express copies. They're like, not in my start menus.
>>>
In the middle of an install ... my computer froze on the shitty mac. I hate the mac, keeps fucking freezing. I assume it's because of the NVidia drivers. I fucking don't know why people say it works. It fucking doesn't. Fucking monopolistic assholes. You know why it's so locked down? Here's the scoop, because they're not good enough to support anymore than their own shit. They're not smart enough.
>>>
In the middle of an install ... my computer froze on the shitty mac. I hate the mac, keeps fucking freezing. I assume it's because of the NVidia drivers. I fucking don't know why people say it works. It fucking doesn't. Fucking monopolistic assholes. You know why it's so locked down? Here's the scoop, because they're not good enough to support anymore than their own shit. They're not smart enough.
Subscribe to:
Posts (Atom)