Wednesday, November 02, 2011

ASP.Net MVC4 BlackBerry Application


I tried MVC4 mobile templates for a blackberry application for my company, as a preview of the power of mobile apps, all our company employee have blackberry devices so, making use of some web Blackberry application essential.
First impression with the default template was it was very cool for if viewed on iPhone or android with large screen and high resolution colors with all the curves and style working, but for the blackberry it was not.

Plus the performance was horrible and very slow, different employees so different output (that was because the style sheet was still downloading).
With a very simple start up page containing only a small menu of 3 elements it took about 4-6 sec to load and that was not accepted. I was using the blackberry curve 9300.
So after some analysis, the Jquery and the style sheet are so big for these devices it was about 400K, so I started removing and cleaning, after stripping JQuery out and starting with a new style sheet from scratch, I got a good result with about 2Kb only, now my colleges accepted the performance that was less than a second for loading the pages, or at the max 2 sec for the pages that contain more data.
even if you say the first style is better on the device it was without the curves so a lot similar to the current one. you can check it here
Another problem raised to the surface and that was security, the application I was trying to expose this mobile new interface was on IIS with windows authentication that didn’t work with blackberry at all. So detecting the user and login him in the application was a new task, I didn’t like the idea of user name/pwd specific for the application or even to connect it with Active Directory. I needed something simpler and easy to use. The only Ideas I have are as follow:
·        Use simple user PIN code for each user
·        Use certificate on devices
·        Detect the IP, if its static identify user with it. (im working here ), and filtering by Browser Agent
or if there any other method !!
So until I manage the security part I think this project will be on the shelf for now. 
and i need to give this back to a graphic designer that will return the style to look good and to work good to. as below expected pages:-\





Tuesday, October 25, 2011

CityVille Popular Science Timed Goal Tips

I finished the mission in 2 minutes, but prepared for it one day before starting.

I was the worst in the timed missions, so this time I had some extra time to fix it. I have 4 time missions not yet started and decided to learn about them first and know how to get the bet result out of them,
For the City Ville Popular Science Timed Goal, and with some Google search, the requirements are:-

And all this for what ?
  • Gold Trophy: Solar Panel (gives you a 100 percent payout bonus to any buildings you place the Solar Panel next to).
  • Silver Trophy :50,000 coins .
  • Bronze Trophy:20,000 coins.
Its simple impossible to make if you start before you prepare, but if you prepare you can finish it after 2min of starting it, you get the highest reward, this is an advance mission so im expecting you to be an advance player too (have large and good CityVille), no need for extra space, no need to build one house.

In short summary:
• Collect from an Observatory Twice
--Have two of them ready to collect before starting 
• Increase your Population by 5,000
--Store several high population houses in your storage that will cover 5000 population and when you start    the mission return them to their original location 
 • Have 10,000 Goods
--Have the needed goods storage for that, and fill it with goods before starting the mission.

First Requirement: Collect from an Observatory Twice 
Before you start your mission check that you have a Observatory and its ready to collect, it will be ready again after 24 hours, I have two of these so I will wait until both are ready to collect and when Im ready to start this will be simple task. If you have one, ok no problem you will finish in one day (collect first time and wait 24 hours and collect again), or you can build the another ,completed and wait until its ready to collect.

Second Requirement: Increase your Population by 5,000 
I started first by some calculation, I will need about 625K$ to build 25 units of housing that have a population of 200 to make the 5000 goal , the energy too so or even the extra space need !!!!!!, but I found a very good tip and that is , you can use your storage for these time goals, you simple store what you have of the largest population building in the storage, your population will go down (lookout you will lose ready collected from the house, very small I don’t care.) after going down for more than 5000 you are ready to start the mission considering the population requirement. So when you start the mission, you only need to empty your storage by returning your housed to their original location. I used about 20 Big kahuna bungalow housed that had a population of 200-280

Third and last requirement: Have 10,000 Goods 
This is easy, I have a storage of about 16K, so I filled it before starting the mission. If you don’t have that storage yet, prepare for it, build some goods storage units and seed your farm for that goal, don’t start if you don’t have 10,000 or more in storage.

So enjoy bouns payout of your businesses and homes by 100 percent? after getting the Gold Trophy Solar Panel

Thursday, August 18, 2011

Empires & Allies Advance Game Tip

 This is for the people who are at level 55 and don’t have anything to do before leaving the game this may be the last fun part the game can provide. You will need a lot of money & a lot off industry factories level 3

The idea is simply :-
Provide A Full Time Market Service
To start do the following:
1.     Use the maximum production option available,
This will take 3 days but don’t worry about time now.

2.     Go to all your friends and start buying all the goods.
A long and boring step but you will need to do it.

3.     Later put all the goods in your markets for sail.


Optimize your selling strategy by doing the following:
1.     Have (or build) at least 7 markets
5 for the ore productions (Iron, Gold, Aluminum, Uranium and Cupper) and one for Wood and another for Oil, if you like add more to sell military this will help too.
2.     Group your market in one place so all the goods are checked
3.     Put all your Markets in the Center, the first location the visitors can see.
4.     Make some market surrounding so it can be easily and instantly checked by your visitors. use empty space or some decorations to make the all the markets more visible
5.     Always try to have huge amount of goods in your market
If you have huge amounts of goods your friends will come back to you whenever they need anything

6.     Put all your money in the market, put don’t dry yourself leave about 50K-100K, for building and playing
7.     Use all the available space for industry production
8.     Put your Ground and Air units in the inventory don’t waste land for that.
9.     Remove all unnecessary decorations, including the roads and mission required decorations after your complete them.
10.   Increase Oil, Wood & whatever Ore production you have, done waist a lot of land for farms; they are not so good on the long run.
Simply everybody now will can come to your island and buy anything they need, so they will visit your market and in the process the visitors will try to gain one-energy by doing 5 simple clicks on anything worthy.

And if they do that you got there 5 clicks for life whenever they play. And your production time will drop.
Even if they don’t buy anything on their first visit they will remember that your island had a huge market off goods and they will come back.

Be aware that Wood is very high in demand so leave a bunch of Wood to refill your market, each time I come back to my market the wood is gone, I will need to increase my Wood industry even though I have a lot of them.

That’s it, you’re at the correct track after the money comes in with huge numbers build your huge fleet and invade everybody and be the largest emperor in Empire and Allies.

Tuesday, August 16, 2011

ASPNET MVC & JScript Editor Extensions


If you started MVC, a lot of java will be there and this extension will help,

In summary it do the following:

Brace Matching

Adds support for automatically highlighting the matching opening or closing brace to the one currently at the cursor. Supports matching parenthesis: (), square brackets: [], and curly braces: {}. Braces in strings, comments and regular expression literals are ignored.

Outlining / Cold-folding

Adds support for automatically creating outlining regions for JScript blocks. Blocks are detected via opening and closing curly braces. Braces in strings, comments and regular expression literals are ignored.

Current Word Highlighting

Adds support for highlighting all instances of the word currently at the cursor.

IntelliSense Doc-Comments Support

Adds support for the element in JScript IntelliSense doc-comments to allow display of new lines in IntelliSense tooltips

And to use and download , or more visit the original site, cool job

VPS options for my ASP.NET MVC3 new project

I was looking for a good VPS for ASP.NET MVC3 hosting, my role was at least 1GB RAM or 2GB Ram , these were my findings, im thinking the best for 2GB RAM is 1&1, and its a very will know company so may be when the time comes it will be my choice, here is the summary of my quick research:

Windows VPS with min 1GB RAM

All have full root access, Raid 5 or 10,expected Bandwidth 100 Mbit

Company Offer OS:Windows 32/64 Bit RAM GB Traffic GB/month HDD GB Extra Price $/month One Year $
vpswebserver Plan 1024 2008 R2 Hyper-V 64 1 1000 50
  • 2 core cpu
  • 1Gbit/sec

25 299.4
webkeepers Value 2003 64 1 500 50 18 216
accuwebhosting WebMaster VPS - Opal 2008 Hyper-V 32/64 Bit 1 250 40
  • SmarterBundle Pro
23 276
softsyshosting Bronze VPS Win Hyper-V 64 1 300 30 25 300
1&1 Virtual Server L Web Server 2008 R2 64 1 1000 20
  • SSL certificate
  • Android monitoring
29 348
AvailHosting AvailVP3 2008 1 1700 100 53 460
ultimahosts ultimahosts 1 800 20 35 +15 setup 435
webhostingbuzz oVZ Bronze 1 Unlimited 50 30 360
GoDaddy Economy 2008 64 1 500 15
  • $100 Google® Adwords® Credit+
  • $100 Bing™ / Yahoo!® Search Credit1
  • $50 Facebook® Advertising Credit2
  • SSL Certificate
  • 10 Fotolia® Credits^
  • 3 dedicated IPs
30 324
myhosting Developer VPS 2008 R2 1 600 40
  • $70 Google Adwords Voucher
47 564
ucvhost Starter VPS Win 2003 1 750 10 22 264
pandela W-30 64 1 1500 30 30-Day Guarantee 54 648
kickassvps Basic Win Server 2008 64 1 200 10
  • 30-Day Guarantee
  • 4 CPU Cores
  • SmarterMail-250 like Exchange Mail
  • SmarterTrack-customer service
  • SmarterStats-50 Sites analytics and SEO
35 420
bbvps HV-1024 Windows Server 2008 Ent. 64 1 Unmetered 60 50 600

Windows VPS with min 2GB RAM

All have full root access, Raid 5 or 10,expected Bandwidth 100 Mbit & price <450


Company Offer OS:Windows 32/64 Bit RAM GB Traffic GB/month HDD GB Extra Price $/month One Year $
1&1 Virtual Server XL Web Server 2008 R2 64 2 2000 40
  • SSL certificate
  • Android monitoring
49 (-3 mm) 441
GoDaddy Value 2008 64 2 1000 30
  • same as above
36 431
ucvhost SOHO VPS Win 2003 2 500 20 34 408
webkeepers Value+ 2003 64 2 1000 100 25 300


Wednesday, July 06, 2011

TRANSFORMERS 3

Transformers - Dark Side of the Moon

This movie was very cool. the story was a straight.

check the trailer too

Tuesday, July 05, 2011

Searching for Any Word & All Words in Linq to SQL ( C# & VB)

Yep this is old and not new, but is useful for non large DB's
So let’s say you have a text box with a search button, and some options (Search exact phrase, Search for any work & Search for all words). The first option will be direct and easy to implement but the other two, mmm, a lot of solutions can be found, what I liked is as follow:



   1:  public static class QueryExtensions
   2:  {
   3:      public static IQueryable<TEntity> LikeAny<TEntity>(
   4:          this IQueryable<TEntity> query,
   5:          Expression<Func<TEntity, string>> selector,
   6:          IEnumerable<string> values)
   7:      {
   8:          if (selector == null)
   9:          {
  10:              throw new ArgumentNullException("selector");
  11:          }
  12:          if (values == null)
  13:          {
  14:              throw new ArgumentNullException("values");
  15:          }
  16:          if (!values.Any())
  17:          {
  18:              return query;
  19:          }
  20:          var p = selector.Parameters.Single();
  21:          var conditions = values.Select(v =>
  22:              (Expression)Expression.Call(typeof(SqlMethods), "Like", null,
  23:                  selector.Body, Expression.Constant("%" + v + "%")));
  24:          var body = conditions.Aggregate((acc, c) => Expression.Or(acc, c));
  25:          return query.Where(Expression.Lambda<Func<TEntity, bool>>(body, p));
  26:      }
  27:      public static IQueryable<TEntity> LikeAll<TEntity>(
  28:          this IQueryable<TEntity> query,
  29:          Expression<Func<TEntity, string>> selector,
  30:          IEnumerable<string> values)
  31:      {
  32:          if (selector == null)
  33:          {
  34:              throw new ArgumentNullException("selector");
  35:          }
  36:          if (values == null)
  37:          {
  38:              throw new ArgumentNullException("values");
  39:          }
  40:          if (!values.Any())
  41:          {
  42:              return query;
  43:          }
  44:          var p = selector.Parameters.Single();
  45:          var conditions = values.Select(v =>
  46:              (Expression)Expression.Call(typeof(SqlMethods), "Like", null,
  47:                  selector.Body, Expression.Constant("%" + v + "%")));
  48:          var body = conditions.Aggregate((acc, c) => Expression.Or(acc, c));
  49:          return query.Where(Expression.Lambda<Func<TEntity, bool>>(body, p));
  50:      }
  51:  }
With ref. to:
http://stackoverflow.com/questions/2010639/linq-to-sql-any-keyword-search-query

And because the project I was working on was in VB, I thought this will help too:


   1:  Imports System.Linq.Expressions
   2:  Imports System.Data.Linq.SqlClient
   3:   
   4:  Public NotInheritable Class QueryExtensions
   5:      Private Sub New()
   6:      End Sub
   7:      '<System.Runtime.CompilerServices.Extension()> _
   8:      Public Shared Function LikeAny(Of TEntity)(ByVal query As IQueryable(Of TEntity), ByVal selector As Expression(Of Func(Of TEntity, String)), ByVal values As IEnumerable(Of String)) As IQueryable(Of TEntity)
   9:          If selector Is Nothing Then
  10:              Throw New ArgumentNullException("selector")
  11:          End If
  12:          If values Is Nothing Then
  13:              Throw New ArgumentNullException("values")
  14:          End If
  15:          If Not values.Any() Then
  16:              Return query
  17:          End If
  18:          Dim p = selector.Parameters.[Single]()
  19:          Dim conditions = values.[Select](Function(v) DirectCast(Expression.[Call](GetType(SqlMethods), "Like", Nothing, selector.Body, Expression.Constant("%" & Convert.ToString(v) & "%")), Expression))
  20:          Dim body = conditions.Aggregate(Function(acc, c) Expression.[Or](acc, c))
  21:          Return query.Where(Expression.Lambda(Of Func(Of TEntity, Boolean))(body, p))
  22:      End Function
  23:      Public Shared Function LikeAll(Of TEntity)(ByVal query As IQueryable(Of TEntity), ByVal selector As Expression(Of Func(Of TEntity, String)), ByVal values As IEnumerable(Of String)) As IQueryable(Of TEntity)
  24:          If selector Is Nothing Then
  25:              Throw New ArgumentNullException("selector")
  26:          End If
  27:          If values Is Nothing Then
  28:              Throw New ArgumentNullException("values")
  29:          End If
  30:          If Not values.Any() Then
  31:              Return query
  32:          End If
  33:          Dim p = selector.Parameters.[Single]()
  34:          Dim conditions = values.[Select](Function(v) DirectCast(Expression.[Call](GetType(SqlMethods), "Like", Nothing, selector.Body, Expression.Constant("%" & Convert.ToString(v) & "%")), Expression))
  35:          Dim body = conditions.Aggregate(Function(acc, c) Expression.And(acc, c))
  36:          Return query.Where(Expression.Lambda(Of Func(Of TEntity, Boolean))(body, p))
  37:      End Function
  38:  End Class
Note: Dont forget to include the references
and the using it will be somthing like this

   1:  string[] Words= new string[] { "one", "two", "three" };
   2:  var AnyWordResults = Query.LikeAny(s => s.Subject, Words);
   3:  var AllWordResults = Query.LikeAll(s => s.Subject, Words);



Tuesday, April 12, 2011

Watch the MIX Keynotes Live, Apr 12 & 13

Yes you can watch it live even if you are not there,  live from Las Vegas, 
April 12 & 13 at 9am PDT (8pm UAE time), via live.visitmix.com.


And what if you are interested in more than the keynotes, you need to wait not more than 24 hours and you can online view or download them


    


If you like to know more about mix check this link MIX2011

Monday, April 11, 2011

dbForge SQL Complete

I found a very good free tool for SQL Management studio; it will make your life typing t-sql much easer.
Download link: http://ping.fm/dswd7
Select the express edition it’s free.

Note: if you installed Visual Studio SP1 on your computer and you had MS SQL Management studio 2008 R2, Intelsense will stop working, there is a very large fix from Microsoft to fix it, but this solution is much better in my eyes

Saturday, April 02, 2011

Simulating sending email

This is not new but very helpful if you build applications and in the business process need to send emails.

The old way that I was using is to go inside the code and remark some lines and put my email instead of the receiver and make some tests and see the email in my inbox, sometimes we forget to update that part and when we go to production emails come to my inbox or other problems that can appear because we marked some code.

So better than that change the email configuration in the web config to something like the following:


<configuration>
    <system.net>
    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <network host="ignored" />
        <specifiedPickupDirectory pickupDirectoryLocation="c:\email" />
      </smtp>
    </mailSettings>
  </system.net>
After running and sending email you will get these emails in a directory and you can check them with there there format. This will even be helpful if you don’t have the email server setting at the time your developing.

In the end when you go to production only use the correct web.config file setting. In my work I don’t deploy my testing web.config because of all the db connection setting and other stuff. So when you test your application locally you will receive the emails in the C:\email directory and when you go to production it will be there for you working without the need to change code, recompile and test.

Sunday, March 13, 2011

Invitation: Qt Training – Dubai, March 14-15, 2011


Forum Nokia is hosting a free 2-day intensive training workshop on Qt in Dubai, U.A.E. on 14-15 March 2011. Based on the popular Qt Creator IDE, the Nokia Qt SDK brings the power of Qt to Symbian, Maemo, and MeeGo application development. Learn how Qt cuts Symbian lines of code by up to 70% and at the same time delivers native app performance, platform integration, and look and feel. Also find out how to reach 100 million Symbian smartphones and 150 million to come in 190 countries with Qt and Ovi Store. If you are new to Qt and would like to know more about it, check out the Forum Nokia Qt page.
 

This will be a hands-on, classroom-style, setting where developers will be taught how to create mobile applications using Qt for Symbian smartphones, focusing primarily on smartphones like the Nokia N8, Nokia C7 and upcoming Nokia E7.


If you are curious to learn more about Qt then this workshop will allow you to ask experts about its technical capabilities, exchange ideas with your peers, and see for yourself how Qt will provide increased flexibility while reducing long term support costs.

http://wl4.peer360.com/b/eHo6g641dO21c0ZDCRUs/mle.asp?hl=-1&CID=127074%20

Thursday, March 10, 2011

Microsoft Tech.ed Middle East 2011

Great days at the event a lot of new subjects and new people to communicate and share ideas and thoughts






Subjects that I loved:
Cloud Computing & Online Services
  • Using the Cloud to Engage Across a Diversity of Devices – Lessons Learned from Using Windows Azure to Connect Via Native Web, Facebook, Android, iPhone, iPad and WP7 Clients
  • The Windows Azure AppFabric Caching Service
  • A Lap Around SQL Azure




Web Platforms
  • What’s New in ASP.NET & Visual Studio for Web Developers
  • Building Rich Web Applications with Microsoft ASP.NET
  • ASP.NET MVC 3 & A Deep Dive into Razor  
  • Visual Studio 2010 Tips and Tricks  
  • The Future of Parallel Programming in the .NET Framework

Windows Phone 7 Applications 
  • Understanding Marketplace and Making Money 
  • Understanding the Windows Phone 7 Development Tools  
  • Showcasing we.Muslim for Developing Silverlight
The event was full with great things.