real time Texas Holdem - real-time

I'm designing a multiplayer poker site and require a way to display changes that occur during game play on all users screens that are active at the table including Ai decisions?
I'm coding using the MVC Structure, and currently making use of C#, javascript and html5
I've attempted using meta tags
and javascript intervals, but unfortunately all it does is continuously refreshes the entire screen, even when partial views are used
I'm looking for something to maintain real time gameplay

I suggest You look into JavaScript JSON or Ajax controls.
Meta tags won't help as they as designed to refresh the entire page and you often see the lag of loading the page between IE9 and Google Chrome. That would definitely adversely affect your multi-player environment.
Stick with the partial view, because that is the way to go, but in your view have a Ajax function, datatype:json , type:post, and use the success of the function to do whatever process is required.

Related

Why use ionic element tags/components vs standard html?

Whats the benefit of using ionic elements like ion-button, ion-item, ion-row, ion-text ion-img instead of regular html?
The first benefit is that each component has been implemented to work properly on mobile devices and with mobile events like clicks, taps, and so on (do you remember the 300 ms delay issue?).
It's also important to notice that Ionic components were designed/implemented according to each platform's design guidelines and recommended patterns. Users expect all apps to respect some UI/UX patterns they are already used to, and Ionic does that extremely well.
Last but not least, some components also encapsulates a lot of logic that would be kind of hard to be implemented with just html elements (for example, the ion-item-sliding component).
But please notice that there're some scenarios where using standard html may be a good option. For example, if you need to show a very long list of items, using ion-items would mean that a new instance of the ion-item component is created for each item of the list, and your Ionic app will need to keep them in memory. Ionic components were implemented to be very performant so this won't be an issue for most of the mobile devices nowadays, but if you need to support old/slow devices this may improve the performance a lot.

How to merge images and text on web form?

I need advice - what technology I could use to create website form to merge 2 images [take from list] and one text from text field?
I want to see results on same page.
I see two possible solutions.
First, using pure javascript and canvas:
I saw simillar problems here and here.
Authors use pure javascript and DOM to manipulate with html5 Canvas.
So problem is to draw images on context, and also insert text.
To insert text, there is method fillText, i am not sure it would look great for first time, but studying canvas should solve problem.
So HTML5 Canvas is first answer.
pros:
easy to implement and only javascript
cons:
may not fit your needs as application grows up.
Second, according to fact, that there may be some limitations, eg.
your picture must be on same domain as your application
you want to do something more difficult with images and text
then you may use server side application, and work with server side graphic library.
It may be for example PHP GD, for php.
Here is possible solution in php.
The application may look like:
obtaining data with a form ( uploading images from disc, filling textfield )
after clicking submit, do an AJAX POST call with multipart-form-data to php page
receive an resulting image in ajax response.
pros:
can solve more difficult tasks, for which your application may
evolve.
cons:
there are two languages to learn - php and javascript.
it may be difficult to send two images to php script at one time and
text, but it's possible
The first solution is less complicated and you can test code adhoc, but second solution is more demanding, but you can reach better result and have more robust technology.

Implementing an app with multiple views in GWT

I understand from threads in this forum and the Google GWT forum that in the GWT world you typically load just a single page and then what appears to a user to be a different page is just the same page with it's content being updated by user actions. A lot of posts imply that you develop your app as you would a desktop application. That sounds easy if you have done desktop development but I am coming from a pure Web services/ Servlets/ Struts background and want to see a very basic example that shows the proper way to implement a GWT app where you show a user a txt box and button and when they click the button, the view is replaced with 2 different components.
There are plenty of basic apps I have done and plenty of complex multipage type ones but I just one that takes me past the click a button to see a message type app to the next level.
Any links to such an example would be welcome
I recommend to study Activities & Places design pattern. It is the best approach, in my view, for large applications with multiple views. It provides a lot of important functionality "out of the box", like browser history management, support for tokens, efficient memory management, etc.
You may want to look into the Model-View-Presenter pattern (MVP). Using this pattern correctly will greatly decouple your application, allowing you to create views that are not only highly modular and disposable, but are very easy to swap out and change.
In fact, Google fully recommends the MVP pattern when developing GWT applications. They provide a full example and walkthrough of a MVP GWT application here, which I imagine is based off of a Google I/O presentation given on best GWT application architecture practices back in 2009.
I've been following this pattern with my latest GWT project and it's working out extremely well. It's very easy to add, remove and swap views.

iPhone Data Form Submission best practice?

I am starting a new project where we need to make entering web data forms an easy experience on mobile.
Currently our web site data forms cannot be styled and made mobile friendly they also reside behind a company firewall, however we can do POSTS via XML to submit a data form.
I'm currently undecided to which approach would be best.
Rebuild the forms natively on the iPhone using iOS components
Somehow create a local HTML5 Data form on the mobile, and then have the iPhone parse this and submit via XML.
Has anyone done similar on mobile in the past, it would be great to hear of your experiences, one key piece to this project is that we also need to have the data forms offline, and have them posted when the device is back online.
Based on the background information you've given, I believe that the only way to go is with the native UI components. Here's why:
You've stated the need for offline form "submission". You will have a much easier time if you have a native form that stores the information somewhere and then submits it when connected.
You've stated the desire to provide an easy experience on mobile. For that, I would naturally recommend native UI controls. Your custom "native" web controls are more likely to be confusing and difficult to use. Contrast that with UIKit which presumably has a lot of research behind it (and millions of satisfied users to back it.)
In the long run, it will be easier to integrate with the rest of the device if you use native controls.
For making XML requests, I recommend the ASIHTTPRequest library.
In my opinion, the better option would be to recreate the forms using the iOS components. It would be much more user friendly, and faster, if done right.

GWT with multiple host pages in a legacy application

I am considering making use of GWT as the front-end to an existing web application.
I can't justify a complete rewrite to 100% GWT in one go. It is likely that I would migrate parts of the system to GWT gradually. However for consistency I would like to make use of the GWT TabPanel, MenuBar, etc as global interface elements from day one.
As an experiment to see how 'legacy' parts of the system could be incorporated, I have done the following.
The application's main page template now loads a small 'wrapper' GWT module on every page. This GWT module looks for a selection of DIVs in the dynamically generated host page. If the DIV is found, a suitable widget is slotted into place, i.e. menuBar, tabPanel.
A lot of the configuration for the included widgets can also be slotted into the host page as JSON structures. For instance, I have implemented an adapter that dynamically sets up a TabPanel in this way. I've also added some very simple widgets that load remote HTML, etc.
As a prototype, this all appears to work perfectly and loads quickly.
However, it seems that GWT apps are really designed to be run from a single host page, not hundreds of dynamically generated ones.
Can anyone highlight any issues that the above approach may run into, particularly as the GWT module increases in size? I would aim to keep the legacy wrapper module intentionally lean. Other functionality would be implemented in separate modules.
How have other people integrated GWT into their front end in a gradual fashion?
One of the ways GWT was designed to be used is exactly as you've used it. We have done that in many of our apps - where there is one GWT module with multiple 'parts' that are loaded based on whether a given id exists on a page or not. So I don't see that you'll have any issues at all going this way. We often use this approach even for new web applications, where we just want a few 'widgets' on the page, rather than coding the whole application in GWT.
It won't make a huge difference, but one thing I would suggest is not putting the GWT javascript code into your main template, but rather only put it on the pages that need it. It's true that if you're not running HTTPs it is cached basically forever, but it seems wrong to get people to load in the module if it's not actually needed on that page. This of course depends on how people use your site, if they are likely to download it anyway then it won't make any difference.
You're doing it right. Avoid avoid avoid the temptation to try to 'minimize' the GWT footprint by breaking it up into multiple separate apps.
The key to GWT performance is to have as few downloads as possible and to make sure they're cached. Loading a 250k bundle once is much better than two 200k bundles and because compression get's better with larger files you really start to reap benefits as things grow.
y-slow & firebug can be really helpful when it comes to convincing yourself of this.
One performance trick you might check out is available in the sample chapter here: http://www.infoq.com/articles/progwt
It shows a mini-architecture around loading GWT widgets into any number of slots and pre-populating data in JavaScript variables. This allows your GWT widgets to load and not require a second HTTP GET to get the data they use. In practice I found that this was a nice performance boost.