Silverlight Streaming unfortunately closed. So, StudentGuru.gr doesn’t now show any videos. For this reason, I transferred my videos to vimeo.com. Right now, there are two videos:
StudentGuru.gr - Introduction to Windows Mobile 6 (greek)
StudentGuru.gr - Introduction to SQL Server 2008 (greek)
You can also find my videos at my Vimeo profile.
What is it?
As I hope you’ve seen in my previous post, I participated in the MIX 10K Challenge (see here for the entry). HitEmUp features a classic idea, hitting enemies with your mouse as fast as you can! Hit 'Em hard and quickly to gain more points and more ranks!
HitEmUp Instructions: Click on the purple targets before their timer expires and get +1 Score or you lose a life. Don't click an empty nest, or you lose a life. Lose all lives and it's game over! Click on the yellow targets before their timer expires to get +1 Life. The more points you get, the more ranks you achieve and the more harder it gets!
At the end it shows you a Game Over image taken randomly from the Bing services. It also features short sounds dynamically downloaded from the internet. The game gets really interesting and harder when you reach 175 score, about to get the Lieutenant rank.
I developed HitEmUp in Silverlight 3.0. It was a bit challenging trying to get the source code smaller and smaller in order to pack it into 10 kilobytes. That’s the main reason this contest is interesting. Not only for the pieces of software, but for techniques on making the code smaller. Even if it really doesn’t matter much, because C# gets compiled in IL :)
Play it!
You must have Silverlight 3.0 installed on your machine. Download this file, and extract it to your desktop. Open view.html with your favorite browser to play the game. Note: Internet resources may not play if run locally.
Source code
The source code is made up of two solutions. Download this file. The big one is the main project, right before getting minified and is about ~20K (only the .cs and .xaml files are counted against the size limit). The smaller one is the minified one and is about ~8K. [Note: The minified one is more updated than the big one, because I made some changes after minifying my entry.]
To understand what’s being done, start by examining the big project before going to the minified one. The first thing to check out is the Nest usercontrol which represents each of the 16 nests of the game. It has methods on how to activate a nest, either with a purple or yellow target, how much time it will be activated and an event when the timer expires etc. Next thing to check out is the main page. First examine the XAML code for the layout and the objects. Then, check out how the timer works.
The main variables that control the gameplay are: The maximum score which is set to 800 (the scores and the ranks are defined in the main page’s constructor). The spidersSpawnInterval which is the milliseconds between the random activation of nests. The badProbability which determines if the nest will be populated (randomly) with a purple or yellow target. The spidersTimeToSmash which sets the duration of a nest’s activation (yellow targets get half time).
Also, when the score increases, depending on the score value, the game progressively changes the above variables to create a harder gameplay. When Lives deplete, the game ends and shows a random “congratulations” image from the Bing web search services.
Next read on, on how the code got minified into more than the half of its size.
Minifying the C# code
Let’s tell many of the tricks used (or could be used) to minify the code:
- Main idea: Short names and code everywhere! Start with a one-letter named solution and project. Next thing to do is minify the code, before minifying the names.
- Remove unnecessary code from App.xaml and App.cs.
- var is your friend for declaring variables. It detects type automatically.
- Use lambdas where possible. The implicitly typed arguments are great for shaving off type names (just like var). Also, short-hand notation for usual procedures (searching, looping, replacing etc.) is possible. See this handy post for more on LINQ tricks.
- LINQ extensions to IEnumerable and IList are great. ForEach and Cast will save you a lot of code especially when combined with lambdas.
- Use the short-hand if-statement notation () ? : when you want to assign a value.
- Use the short-hand C# 3.0 notation for constructing objects and setting properties immediately. Example: var f = new DoubleAnimation(){To=1,Duration=A.t(500)}; where A.t is a shared function that returns TimeSpan.FromMilliseconds(500).
- Remember that you can use multiple assignments in a single statement. They are evaluated from right to left.
- Use fields instead of properties. Do not use access modifiers if not required.
- Code should be preferred to XAML. Many expressions require much less code than xaml code.
- Consider subclassing commonly-used non-sealed framework classes, to avoid long names.
- Use many “usings” in one big code file, if possible.
- Create small functions for typical procedures, like adding a shadow to an object, hiding or showing it, placing it (with Canvas.SetLeft for example), animating it etc. Store them inside a static class to be used everywhere in the project.
- Where XAML is required, consider:
- Think if Webdings font has a shape that you may need. If yes, use that instead of drawing paths with Blend. Remember you can specify a unicode character in a string like “\u0085”. Webdings are included by-default in Silverlight and will not add up to the size.
- Do not use unecessary color gradients or effects.
- C# is a very managed object-oriented language. It features a very strongly-typed system and allows Visual Studio to do dynamic refactoring on-the-fly. So next step, select each variable and function, select refactor, select rename. Choose a one-letter name to rename the variable. If small letters deplete, use capital ones. After those, start with two-letters names.
- Cleanup all of the whitespace. In C#, only semicolons and some spaces are important. Remember special spacing rules like int[]a and int?a are valid.
Sources
I made a little Silverlight 3.0 game for the MIX 10K Challenge. HitEmUp features a classic idea, hitting enemies with your mouse as fast as you can! Hit 'Em hard and quickly to gain more points and more ranks! Read the instructions at the start screen for more on the game logic. The game is complete in the sense that it has a beginning, a progressive speed and ends if you reach the top score. At the end it shows you a Game Over image taken randomly from the Bing services. It also features short sounds dynamically downloaded from the internet. The game gets really interesting and harder when you reach 175 score, about to get the Lieutenant rank. Try it!
As the entry can win the Community prize by gathering a lot of good ratings, I would like to ask you all to please support my entry by rating the game with 5 stars! Here’s where you can play and rate the game: http://mix10k.visitmix.com/entry/details/192. Leave a comment if you like it!
At the end of January, after the contest’s finished, I will also post on my blog the source files of the game. I will upload the full version and the minified one. It was really interesting trying to minify 20K into 8K! But it can really happen for C# source files.
Nowadays the cloud services are blooming really fast. One very useful service that many hosts are offering is online storage. A notable example is Microsoft’s SkyDrive service which offers 25GB of free online file storage. There’s also a rumor about Google offering a similar service named GDrive, following the example of GMail.
One thing most people dislike about online storage is having to go to the host’s website in order to upload, download, edit files. Fortunately, there are internet protocols to help us. And fortunately, Windows supports natively the WebDAV protocol for accessing remote file servers through Windows Explorer, plus supporting the HTTPS for solid security. All you need is have a SkyDrive account. Note: See my previous article on how to create your WebDAV folder to access them remotely.
Before starting, I recommend creating a new private folder in your SkyDrive, e.g. named “Files” and do the following in that folder. If you do not want to create a new folder, remember that sometimes a folder in SkyDrive has a different name shown and a different real name that is shown in the address bar. We need the folder’s name that appears in the address bar. Also, I must note that I haven’t been able to map the SkyDrive’s root folder, but only the folders shown in SkyDrive’s homepage separately. We will continue with one folder, the “Files” folder we created. You can follow the same process to map all of your other SkyDrive folders.
Now we have to “discover” the WebDAV address which we will use for our SkyDrive: I don’t know if this method will work for all SkyDrive users, but it will work surely for users who have signed up for the beta of Office Web Apps. If you create/upload a new Office document (e.g. Powerpoint) to SkyDrive, you can then “Edit” it with PowerPoint Web App. You will then see a button called “Open in Powerpoint” which will open Powerpoint 2007 and edit the online document. In your local powerpoint, click Save As and you will see the internet WebDAV address Powerpoint uses to upload the file. This is the address we need to connect Windows Explorer to SkyDrive’s WebDAV features!
My address has the following pattern: \\wsmdyp.docs.live.net@SSL\DavWWWRoot\{SkyDriveID}\Files
where {SkyDriveID} is an alphanumerical string that identifies your account and is shown in the address bar of your browser when you’re browsing your SkyDrive. Then we need to map this address to our Windows Explorer. Open the Command Prompt and execute the following command:
net use * \\wsmdyp.docs.live.net@SSL\DavWWWRoot\{SkyDriveID}\Files /SAVECRED /PERSISTENT:YES
It will create a new network drive in Windows Explorer and then you’ll be able to access your SkyDrive files! You can also rename the folder with a more friendly name like “Sky Files”.
The only issue left is the one involving the Live ID credentials. If you restart your PC, the network connection won't work (except if you previously login to SkyDrive). We have to make Windows remember your Live ID. This is what you must do (tested in Windows 7): Go to Window's Control Panel and click Credential Manager. In the left panel of the Control Panel, you'll see a link named "Link Online IDs" (also can be found in Control Panel's User Accounts). There you'll be able to link your Windows account with your Live ID. Additionally, in the Credential Manager, you can add a "Generic Credential" with your live ID (this is usually your hotmail) and your password, though I do not know if it's necessary to do that. After doing these things, you'll be able to access the skydrive network connection without having to previously login with the browser.
Finally, there is also a freeware application that does away with all the WebDAV hassle and does the same job: http://skydriveexplorer.com/.
As this is my post of the very first day of 2010, I wish you all a happy new year full of healthiness and creativity!
Sources:
Σήμερα έκανα 2 ώρες training για Windows Mobile στο Innovation Center της Microsoft. Είδαμε αρκετούς συμμετέχοντες του Imagine Cup, εύχομαι σε όλους καλή επιτυχία!
Στην παρουσίαση, είδαμε 2 προγράμματα:
- e-Home Mobile
Πρόκειται για ένα πρόγραμμα για την απομακρυσμένη διαχείριση της θερμοκρασίας και της φωτεινότητας των δωματίων ενός σπιτιού. Βέβαια παρουσιάζουμε μόνο το UI. Επικεντρωνόμαστε στα Windows Forms του .NET Compact Framework 3.5 και στον SQL Server Compact 3.5 SP1. Επίσης υπάρχει webcast με οδηγίες για να το φτιάξετε!
- CheeseGame3
Ένα απίθανο παιχνιδάκι, βασισμένο σε ένα παλιό white paper του Rob Miles. Πρωταγωνιστής ένα ψωμί και ένα τυρί. Στυλ arkanoid που χτυπάς ντομάτες. Οι τρεις εκδόσεις που έχω στο συννημένο έχουν τα εξής χαρακτηριστικά:
- CheeseGame: Το παλιό παιχνίδι, με πολλά features όπως διάφανα .gifs, levels, scores κ.α.
- CheeseGame2: Μειωμένο functionality για τον σκοπό της παρουσίασης. Κατανόηση του μηχανισμού του παιχνιδιού. Περιλαμβάνει steps για το πως να δημιουργηθεί.
- CheeseGame3: Αυτό που παρουσιάσαμε σήμερα. Όπως το CheeseGame2 αλλά με alpha-blending γραφικά (δηλαδή με σκιές). Χρησιμοποιεί το UI Framework for .NET Compact Framework 3.5. Δείτε μέσα στο συννημένο το CheeseGame3 Step-by-step.doc για το πως να το φτιάξετε step by step.
Επίσης, θα βρείτε στο συννημένο τα slides. Εκεί υπάρχουν διάφορα χρήσιμα links σε ιστοσελίδες, resources και SDKs.
Συννημένο: http://cid-3f162c821a6ea969.skydrive.live.com/self.aspx/Public/Microsoft%20Student%20Partners/Windows.Mobile.Training.23-11-09.zip
These days I’m trying to configure my new Windows Server 2008 R2. Of course, I would like to be able to access my files remotely and without any effort (such as downloading a third-party application). There were 3 options to use for accessing remotely files on Windows: VPN and SMB, FTP or FTPS and WebDAV. VPN is a bit complex and I ruled it out. FTPS is a great way to go but unfortunately Windows clients cannot directly map network drives to FTPS (it only supports plain FTP which is insecure). Fortunately, Windows clients can map network drives to WebDAV drives. So that’s the way to go! It’s also a standard and many systems can connect to WebDAV. It’s also pretty “comfortable” as it relies on HTTP. And it becomes quite secure when you use HTTPS.
Fortunately, Microsoft has developed a great IIS 7 extension that adds WebDAV capabilities to websites. It’s included automatically in R2, but for Windows Vista you have to download it from here. There will be a WebDAV icon in the IIS which allows you to configure everything. So, when you need to configure a website’s physical folder for WebDAV access, you just have to do the following:
- If you want to enable HTTPS, you need to create a self-signed certificate for your server. This can be done easily if you go to your IIS server and click Server Certificates. Unfortunately, IIS issues a certificate with a common name that is your server’s name. If you’re using a dns address like “www.example.com”, you’ll find this unacceptable for most PCs, because they will be surmising that it’s false. To create a custom self-signed certificate, use this guide.
- Enable WebDAV on the parent site. You do not need to add access rules in the parent site, if you don’t want WebDAV for all the website. If you want to have only HTTPS, go to the settings and turn “Require SSL Access” to true. Be sure that the website has an https binding, with the right certificate.
- Go to the folder you want to enable WebDAV on. If you want only HTTPS, go to iis SSL Settings and check Require.
- Now, you’ll come to configure the permissions. First of all, there must be a way of authentication. Enable “Basic Authentication” (only works for SSL WebDAV) or something else if you want. Then you have to configure permissions in 3 places: 1) the IIS Authorization Rules, 2) WebDAV Authoring rules, 3) NTFS/File/Folder permissions.
After all these you’ll be able to connect to your WebDAV! But there’s another problem with most PC clients. If you’re using a self-signed certficate like me, they’ll automatically reject the connection. What to do? Open the website with Internet Explorer (be sure to open it with "Run as Administrator", else the "Install certificate" button won't show up later). Go to the webdav location e.g. https://www.example.com/webdav/. It will complain about the untrusted certificate. Do the following to install the certificate on the client PC:
- It will complain about the certificate, click Continue.
- In the address tab, click the certificate error icon.
- Click View Certificates. Click Install Certificate... Click Next. Select "Place all certificates in the following store".
- Click Browse and select Trusted Root Certification Authorities.
- Click Next and then Finish.
- On the Security Warning dialog box, click Yes.
After all the above steps, the computer can trust the location and you’ll be able to map the network drive with the following command line:
net use * https://www.example.com/webdav
It will ask for username and password. You can also use Windows Explorer’s map network drive wizard. One small problem you could stumble upon, is when trying to move/copy large files. Windows may tell you that you cannot do that because of the file size. The "webdav redirector" on windows (client side, not server side) has a limit. It exists in the registry, in the key HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\FileSizeLimitInBytes. The default is 50 MB. Change it to the maximum allowed and restart.
One last problem you may stumble upon: Unfortunately, WebDAV for IIS has one major bug (at least for me): You cannot add virtual directories that map to a whole hard disk. For some reason, they are not shown when you’re exploring the webdav remotely. To resolve that, you must create a folder in each hard disk e.g. “webdav” and put all your hard disk in there. Then add a virtual directory in IIS that points to that folder. It worked for me!
Conclusion: Webdav’s a really nice way to connect to files remotely! I just wish Microsoft resolved the aforementioned problems and make the administrator’s life easier.
Σήμερα έκανα μια ώρα training για SQL Server 2008 και Management Studio στο Innovation Center της Microsoft. Είδαμε αρκετούς συμμετέχοντες του Imagine Cup, εύχομαι σε όλους καλή επιτυχία!
Στην παρουσίαση, είδαμε πως διαχειριζόμαστε τον Management Studio του SQL Server, ενώ γράψαμε και T-SQL queries για την ανάκτηση και επεξεργασία δεδομένων. Τελικά η πραγματικότητα απέδειξε για άλλη μια φορά ότι μία ώρα δεν ήταν αρκετή για να γίνουν όλα! Για αυτό σας προτρέπω να δείτε το εξής webcast, το οποίο περιέχει μέρος της σημερινής παρουσίασης αλλά και πλειάδα χαρακτηριστικών που δεν προλάβαμε να δούμε (σχέσεις, stored procedures κ.α.).
Επίσης, στο παρόν post, επισυνάπτω αρχεία που έχουν σχέση με την παρουσίαση: scripts, το powerpoint και το word που περιλαμβάνει όλα τα steps για να κάνετε όλα όσα γίνονται στο webcast.
Συνεχίζω με το τελευταίο post της εμπειρίας μας στην TechEd. Τις προηγούμενες ημέρες, μπορείτε να τις διαβάσετε σε προηγούμενα posts. Τα sessions που παρακολούθησα τις τελευταίες αυτές μέρες ήταν:
Τετάρτη 11/11, DEV306 F# for Parallel and Asynchronous Programming, Donald Syme
Κατ’ αρχήν η F# είναι μια funcional γλώσσα προγραμματισμού η οποία έχει παρόμοιο πυρήνα με την OCaml, αλλά έχει παρόμοιο αντικειμενοστρεφής μοντέλο όπως η C# και το .ΝΕΤ. Ο Donald είναι από τους πατέρες της F# και είναι στο research τμήμα της Microsoft. Απέδειξε τις ικανότητες του, παρουσιάζοντας μάλλον το πιο ενδιαφέρον session της TechEd! Μας έκανε ένα γρήγορο introduction στην F# μαζί με το Visual Studio και ύστερα επικεντρώθηκε στο γεγονός ότι η ανάπτυξη παράλληλου κώδικα με την F# είναι παιχνιδάκι! Λύνει 4 σημαντικά προβλήματα:
- Shared State: threads, locks, semaphores. Τα λύνει εύκολα χρησιμοποιώντας πολλούς immutable τύπους οι οποίοι δεν είναι επικίνδυνοι για race conditions όταν μεταφέρονται από ένα thread σε άλλο ή όταν προσπελάζονται ταυτόχρονα, αφού δεν τροποποιούνται.
- Inversion of Control: delegates & callbacks, async workflow. Λύνεται με την F# Async.
- I/O Parallelism: not lots of threads, web requests and streams. Λύνεται επίσης με την F# Async.
- Messaging and Scaling. Χρησιμοποιώντας τα F# Agents + Web/Azure/MSQ κ.α.
Προχώρησε σε γρήγορα αλλά πολύ δυνατά παραδείγματα για web crawling και DirectX Managed Libraries. Επίσης παρουσίασε παραδείγματα παραλληλισμού για να δείξει ότι η F# μαζί με τα Concurrent Collections, PLINQ qeuries και Parallel Loops του .ΝΕΤ 4.0 δίνουν την πιο καλή λύση για εύκολο αλλά ισχυρό παραλληλισμό.
Τετάρτη 11/11, DEV204 Unit Testing Best Practices, Roy Osherove
Επίσης ένα από τα πιο ενδιαφέροντα sessions! Επειδή δεν είχα ασχοληθεί με unit testing, μου φάνηκε πολύ χρήσιμο. Παράλληλα ο Roy έδινε πολλά tips για καλό unit testing, ώστε τελικά τα tests να βοηθούν τον προγραμματιστή παρά να τον μπερδεύουν και να καταναλώνουν άδικα χρόνο. Σημείωση: Είναι επίσης ο συγγραφέας ενός πολύ καλού βιβλίου, του Art of Unit Testing.
Άρχισε επαναλαμβάνοντας και επαναλαμβάνοντας συνεχώς τη διάκριση μεταξύ unit testing και integration tests. Τα unit tests είναι στατικά, χωρίς I/O και χωρίς threads, δηλαδή είναι τα πιο απλά και τα πιο σταθερά που πρέπει να σκεφτόμαστε για να επαληθεύσουμε κάτι. Τα integration tests είναι πιο σύνθετα και επικοινωνού με resources, ή χρησιμοποιούν για παράδειγμα Random αριθμούς, και πρέπει να οργανώνονται σε διαφορετικό project από τα unit tests. Έλεγε ότι για αυτό το λόο πολλές φορές τα tests έχουν απρόβλεπτες εξελίξεις, όπως να κάνουν fail σε τυχαίες στιγμές κ.α. γιατί ακριβώς είναι integrations tests. Τα unit tests πρέπει να είναι ενιαία και να έχουν μόνιμη συμπεριφορά και να μην εξαρτώνται από άλλα tests.
Άλλα tis που μάθαμε: Κάνουμε testing μόνο public μεθόδους. Στα unit tests να μην υπάρχει λογική, να μεταφέρουμε τη λογική παραέξω. Test isolation και να μην υπάρχει dependedncy μεταξύ δυο tests. Να αποφεύγουμε τα πολλαπλά assertions σε ένα test case, και να το σπάμε σε περισσότερα, ώστε να μην υποσκιάζονται το ένα από το άλλο. Να μην υπάρχουν “μαγικές τιμές”, δηλαδή τυχαίοι αριθμοί που ένας οποιοσδήποτε αναγνώστης να μην μπορεί να καταλάβει τι είναι.
Κατέληξε στο ότι ένα unit test πρέπει να είναι readable, maintenable, trustworthy. Πρέπει οι μέθοδοι να ονομάζονται με καλό τρόπο όπως για παράδειγμα MethodNameTested_StateUnderTest_ExprectedBehaviour. Ενώ ο κώδικας συνήθως περιέχει τα εξής τρία μέρη: //Arrange … //Action … //Assert.
Τετάρτη 11/11, DEV309 The Windows API Code Pack: How Managed Code Developers Can Easily Access Exciting New Windows Vista and Windows 7 Features, Kate Gregory
Αν και όχι πολύ ενδιαφέρον θέμα, ήταν χρήσιμο για να μάθουμε κάποια καινούργια χαρακτηριστικά των Windows 7. Άρχισε κατ’ αρχήν μιλώντας για τα jumplists, δηλαδή τα μενού που εμφανίζονται όταν κάνετε δεξί-κλικ π.χ. στον Internet Explorer στο taskbar. Είναι κάτι σαν ένα mini-start για την εφαρμογή. Επικεντρώθηκε στην διαχείριση του jumplist μέσω του Windows API Code Pack. Παρουσίασε ένα sample για την διαχείριση των 4 μερών του jumplist: pinned, recent & frequent, custom categories, και το τέταρτο είναι ίδιο για όλους.
Μετά πέρασε στα taskbar icons, στο hot-tracking, και στα overlays πάνω στα icons ώστε να ενημερώνει ένα πρόγραμμα τον χρήστη. Επίσης πως μπορούμε να εμφανίζουμε ένα progressbar στο taskbar. Προχώρησε εξηγώντας τα thumbnails όπως π.χ. όταν κάνουμε mouse-over πάνω από το εικονίδιο του Windows Media Player, πως να ορίσουμε το δικό μας thumbnail και τα δικά μας κουμπιά.
Περαιτέρω, εξήγησε το restart (δηλαδή αυτό που κάνει restart τον υπολογιστή μετά το Windows Update) & recovery (τα Windows καλούν το πρόγραμμα σας όταν κάνει crash, όπως π.χ. όταν το Visual Studio επανεκκινεί) σύστημα των Windows. Δίνεται σε αυτές τις φάσεις η δυνατότητα στο πρόγραμμα να σώσει τη δουλειά του ώστε μετά την επανεκκίνηση, ο χρήστης να ξαναβρεί το πρόγραμμα ανοιχτό όπως το άφησε.
Τέλος εξήγησε πως να τροποποιήσουμε το πρόγραμμα μας ώστε να διαχειρίζεται σωστά το power management που επιλέγει ο χρήστης.
Πέμπτη 12/11, WIA401 Enhancing the Design-Time Experience for Microsoft Silverlight 3, Oliver Scheer
Αρκετά τεχνικό session το οποίο επικεντρώθηκε στο πως ο developer μπορεί να βοηθήσει τον designer, επεκτείνωντας τον κώδικα του με design-time metadata και κομμάτια. Μίλησε για data templates, design-time visibility (μπορεί το control να κάνει render στο design-time?), τη χρησιμοποίηση Attributes (π.χ. για να ορίσεις Category, Description κ.α. για τις ιδιότητες ενός control), τον καλό χειρισμό του structure των projects. Διάφορα χρήσιμα attributes: PropertyOrderAttribute, NumberRangesAttribute, EditorBrowsableAttribute, TypeConverterAttribute.
Μίλησε επίσης για τα behaviours του Expression Blend και γιατί οι designers μπορούν να τα χρησιμοποιήσουμε πολύ εύκολα και χωρίς καθόλου κώδικα. Για παράδειγμα, φτιάχνοντας ένα behaviour “drag” μπορεί ο designer να ορίσει ότι ένας κύβος στο Silverlight μπορεί να μετακινηθεί από τον χρήστη.
Πέμπτη 12/11, WIA303 Microsoft ASP.NET AJAX: Taking AJAX to the Next Level, Stephen Walther
Ένα καλό session για να μάθουμε τα καινούργια features της AJAX library της Microsoft και το interoperability με asp.net. Κατ’ αρχήν παρουσίασε το εργαλείο Microsoft Ajax Minifier και το hypercrunching mode του, και το πως μπορούμε να το κάνουμε integrate στο MSBuild του Visual Studio. Πέρασε μετά στην Microsoft Ajax Library και επικεντρώθηκε στα εξής χαρακτηριστικά:
- Powerful client data access library, η οποία γίνεται exposed στο jQuery μέσω jQuery plugins. Μίλησε πως με ajax μπορούμε να έχουμε πρόσβαση σε δεδομένα μέσω ASMX, WCF, ADO.NET, JSON end-points. Μίλησε πως να παρουσιάσουμε τα δεδομένα μέσω client templates όπως repeater και με 2-way binding.
- Client script loader: Δυναμική και on-demand φόρτωση ενός script. Μπορούν να φορτωθούν και παράλληλα.
- Seamless jQuery integration. Είπε πως η Microsoft ξέρει τη χρησιμότητα του jQuery για πολλούς developers. Έδειξε πως το ajax library της microsoft, μπορεί να προσπελαστεί πολύ εύκολα μέσω του jQuery, ενώ υποστηρίζει και το chaining του jQuery.
- Intellisense for Javascript.
Συνολική Εντύπωση
Απίστευτη εμπειρία η TechEd! Πρέπει να ευχαριστήσω την Microsoft που έδωσε στους Microsoft Student Partners την ευκαρία να παρακολουθήσουν την TechEd. Είχε πάμπολλα sessions για να παρακολουθήσουμε, το Messe του Βερολίνου ήταν τεράστιο και άνετο για να γίνει το event, η περιποίηση ήταν πολύ οργανωμένη, τα δωράκια και τα freebies έπαιρναν και έδιναν, η έκθεση ήταν τεράστια με πάρα πολλές εταιρίες όπως Intel, Dell, HP, ComponentOne κ.α., η διασκέδαση υπήρχει στο έπακρον αφού κάναμε connecting με διάφορους ανθρώπους και real persons της Microsoft, παίξαμε πολλές ώρες Guitar Hero :P, πήραμε άπειρες φωτογραφίες, ενώ το Βερολίνο ήταν μια πολύ όμορφη πόλη για να επισκεφτείς! Voila και μερικές φωτογραφίες!
Cheers!
Την Τρίτη παρακολούθησα ένα κυρίως interactive session το οποίο είχε σχέση με Windows Mobile 6.5 Graphics. Επικεντρώθηκε κυρίως στο CodePlex project που ονομάζεται UI Framework for .NET Compact Framework 3.5. Με ένα απλό τρικ μπορεί να γίνει και για .ΝΕΤ 2.0. Έχει alpha blending με διάφορους τρόπους. Ενώ υποστηρίζει την δημιουργία μιας φόρμας που υποστηρίζει controls με alpha γραφικά που βρίσκονται μέσα στο συγκεκριμένο library. Όμως παραμένει κανονικό form που μπορεί να έχει windows forms controls. Ουσιαστικά απλά διαχειρίζεται το OnPaint event της φόρμας.
Το απόγευμα είχαμε interactive session με όλους τους υπόλοιπους Microsoft Student Partners της Ευρώπης που ήταν καλεσμένοι στην TechEd. Ένα από τα πιο ωραία events που παρακολούθησα! Είχαμε την ευκαρία να δούμε MSPs και ADEs από άλλες χώρες, όπως επίσης είδαμε μια καταπληκτική και χιουμοριστική παρουσίαση του Rob Miles για XNA για Zune HD. Τέλος είχαμε την απίστευτη ευκαρία για Q&A με τους major leaders των: Windows Embedded (Olivier Bloch), David Chappel, F# (Donald Syme), Web Client (Giorgio Sardo), predictive programming (Rafal Lukawiecki). Επιπλέον συζητήσαμε περί του IE8 και των πλεονεκτημάτων και μειονεκτημάτων του, όπως και για πιθανές ευκαιρίες σταδιοδρομίας στην Microsoft.
Γειά χαρά σε όλους! Γράφω από το υπέροχο (και παγωμένο) Βερολίνο. Είμαστε ήδη 3 μέρες εδώ και είναι υπέρτατα. Εκτός του ότι έχουμε να εξερευνήσουμε το Βερολίνο (που κατά σύμπτωση τώρα γιορτάζουν το γκρέμισμα του berlin wall) έχουμε την μοναδική ευκαιρία να παρακολουθήσουμε την TechEd, μια από τα πιο μεγάλα conference της Microsoft, όπου μαζεύονται χιλιάδες developers & IT people, μαζί με τις σημαντικότερες εταιρίες του χώρου, όπως HP, Dell κ.α. Προφανώς υπάρχουν άπειρα sessions που μπορούμε να παρακολουθήσουμε, ενώ ερχόμαστε σε επαφή με υπάλληλους και developers της Microsoft, όπως επίσης και με άλλους Microsoft Student Partners από όλη την Ευρώπη =D
Τα από πάνω συνοπτικά για την εμπειρία, δεν θέλω να σας κουράσω πολύ με λόγια, αλλά ούτως ή άλλως δεν έχουμε πολύ χρόνο εδώ για γράψιμο! Οπότε συνεχίζω με εικόνες, και τι sessions παρακολούθησα στην πρώτη μέρα. Οι υπόλοιπες αργότερα!
Days 1-2
DEV305 ADO.NET Entity Framework in Microsoft Visual Studio 2010 and Microsoft .NET Framework 4
Αν και δεν κατέχω γρι από entity, ήταν ωραίο event γιατί είδαμε στην πράξη διάφορα όπως T4 templates για entities, LINQPad for CLR 4.0, lazy loading, POCO object to EDML, CodeOnly για Entity. Αυτό που έπρεπε να συγκρατήσουμε είναι ότι τα σφάλματα του παρελθόντος έχουν διορθωθεί και είναι η καλύτερη στιγμή για να ξεκινήσεις Entity framework.
MOB303 Adding Life and Intelligence to Windows Mobile 6.5 Applications
Ωραίο περιεχόμενο για νέα feautures σε Windows Mobile devices. Δυστυχώς καθόλου multitouch, αλλά είδαμε ένα ενιαίο mini framework του CodePlex (sensorapi.codeplex.com) για διαχείριση accelerometer, light sensor, stylus sensor, navigiation wheel. Επίσης είδαμε 6.5 gestures, και ενιαίο vibration (opennetcf extension).
SIA07-IS Security Assessment Planning and Implementation
Interactive session με ενδιαφέρον ομιλητή! Το μόνο ΙΤ που προσπάθησα να παρακολουθήσω, αλλά ήταν ok. Καλύτερο phrase για σκέψη: “If I hack your computer today, would you know it tomorrow?”. Το λειτουργικό είναι αρκετά ασφαλές πλεόν, τα third-party apps όμως όχι. Αρκετές λεπτομέρειες για security assessment, πως γίνεται, ποια είναι τα assets, η αξία τους. Auditing. The Human Asset: vulnerable, disgruntled people. Total Quality Management.
Όπως έχει ήδη περιγραφεί σε post του StudentGuru, έχει ήδη ξεκινήσει ο παγκόσμιος φοιτητικός διαγωνισμός Imagine Cup 2010 που διοργανώνει η Microsoft.
Πάλι φέτος, στα πλαίσια του διαγωνισμού, η Microsoft Hellas διοργανώνει δωρεάν training για διάφορες τεχνολογίες. Για να συμμετάσχετε πρέπει να εγγραφείτε στο διαγωνισμό και να στείλετε ένα σύντομο βιογραφικό σας μέσα στο deadline. Μάθετε περισσότερα στο αντίστοιχο thread του studentguru.
Και εγώ θα έχω την ευκαιρία να σας παρουσιάσω κάποιες τεχνολογίες! Περισσότερα όταν ανακοινωθεί το πρόγραμμα!
I had a little problem with my phone’s contacts. I have changed several mobile phones, Windows Mobile and not (e.g. Symbian). Each operating system had a different philosophy for storing the country code (+30) of each contact. One time, I synced my contacts from a Windows Mobile Smartphone 2003 to a Motorola phone and all +30 were converted to 30. Then I changed to a Windows Mobile 6 Professional device and I could not anymore call these contacts unless I added the plus (+) sign again at the beginning of the country code. Moreover, the desktop version of Outlook, adds a space between the country code and the number. Alas, .NET Compact Framework 3.5 is ideal for such petty work! I made the following program in a snap. You can download it from the attached files, it contains the source code (Visual Studio 2008) and the executable which you can just copy (along with the required .dlls) to your device and execute it. It just changes all your contacts’ numbers with the following rules, so as to make them homogeneous. For the given country code (e.g. +30 for Greece), it will do the following: - Change 30xxxxxxxxxx to +30xxxxxxxxxx. - Change +30 xxxxxxxxxx to +30xxxxxxxxxx. - Change 0030xxxxxxxxxx to +30xxxxxxxxxx. - Change 0030 xxxxxxxxxx to +30xxxxxxxxxx. - Any other number which does not start with a plus sign (+), xxxxxxxxxx to +30xxxxxxxxxx. | |
Of course I have not added any validation or any peculiar cases, so proceed at your own risk! If you’re interested in how to use Pocket Outlook to manage contacts, tasks, calendar etc., see an older post of mine where I note the most intriguing features of the namespace Microsoft.WindowsMobile.PocketOutlook.
For an introduction in programming Windows Mobile 6, you can watch my webcast at http://www.studentguru.gr/learn/view.aspx?id=5 (“Developing eHome for Windows Mobile 6”).
I have Windows Server 2008 installed on my main desktop machine, and I usually work on a Windows Vista installed as a Hyper-V virtual machine on Windows Server. I have to note that I don't have a Windows Server Domain infrastructure, and thus I do not have any Active Directory users or settings. My Windows Server locks up after a few minutes of inactivity (15 I believe), effectively showing the blue login screen where I have to press ctrl + alt + del to log in to my session again. This is very annoying while watching a video clip. Of course these settings were meant for real servers, but because I use Windows Server mainly for development, I would like to change them to be more workstation-like. The following may also apply to a workstation (Vista, 7 etc.) if their
settings were tampered with, but usually the default settings do not
result in locking out.
After searching for a while on the internet, and trying out stuff, I found the following combination to solve my problem: In the Start Run box type "gpedit.msc" to open up "Local Group Policy Editor". In the"Local Computer Policy", find the following nodes:
- Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options > Interactive logon: Do not require CTRL+ALT+DEL. Enable this and you will not be required to press these keys before logging in.
- Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options > Microsoft network server: Amount of idle time required before suspending a session. The pre-filled value is 45 minutes for servers and 15 minutes for workstations (Vista, 7 etc.). The default value is Not Configured, which means 15 minutes for servers and indefinite for workstations. So, this one is a value to change for Windows Server not to lock up. I changed it to 60 minutes.
- User Configuration > Administrative Templates > Control Panel > Display > Screen Saver timeout. Even if you have not defined a screen saver, even if the rest of the nodes in the Display category are Not Configured, I found that enabling this and setting it to 0 seconds (effectively disabling any screen saver) helps.
After these, go to the Start Run box again and execute the command "gpupdate /force". Restart your PC. Again at the Start Run box you can type "rsop.msc" to open up "Resultant Set of Policy". Here you may assure that the above settings are applied.
Of course, if the above didn't help you consider searching:
- Control Panel, such as Screen Saver settings.
- Security policies. Both Local Policies for the current machine and Group Policies for Windows Domains infrastructures (apply them to client PCs and restart them).
- Local Users (Control Panel > Administrative Tools > Computer Management > System Tools > Local Users and Groups). In Windows Server, you'll find Session settings etc.
- Active Directory User's settings, if you have a Windows Domain infrastructure.
- Power Settings, if your problem is that your screen turns off.
- The notorious Registry!
Hope the above helps.
Σήμερα παρουσιάσαμε το Windows Communication Foundation και το axis2 στο μάθημα "Δικτυακός Προγραμματισμός" (το οποίο και παρακολουθώ :) του 8ου εξαμήνου των ηλεκτρολόγων του ΕΜΠ, όπου μας είχε καλέσει ο υπέυθυνος του μαθήματος Ανδρέας.
Συνοπτικά, η παρουσίαση έγινε ως εξής: Ο Ανδρέας Μπότσικας έκανε μια 40-λεπτή εισαγωγική παρουσίαση, εξηγόντας τα διάφορα μέρη που απαρτίζουν τα web services. Παρουσίασε επίσης το .ΝΕΤ 3.0 και το WCF.
O Νίκος Πρίντεζης έκανε μετέπειτα ένα εισαγωγικό demo για την C#, περί το ένα τέταρτο, δείχνοντας ένα απλό console application.
Ο Μιχάλης Ζερβός έπειτα έδειξε πως μπορούμε να δημιουργήσουμε ένα web service με WCF, και πως μπορούμε να δημιουργήσουμε ένα client μιας απομακρυσμένης διαδικτυακής υπηρεσίας μέσω WCF. Περίπου 50 λεπτά.
Έπειτα έδειξα (Ηρακλής Ψαρουδάκης), μια 30-λεπτη εισαγωγή στο axis2, ένα αντίστοιχο framework για web services στη java. Αναπτύξαμε το ίδιο web service του Μιχάλη (το MathService), και δείξαμε ότι ένας WCF client το καταναλώνει άψογα. Επίσης δείξαμε έναν java client να καταναλώνει το MathService που φτιάχτηκε με WCF.
Τέλος, ο Νίκος Πρίντεζης έκανε ένα 10-λεπτο demo για την ανάπτυξη ενός silverlight που καταναλώνει μια web υπηρεσία.
Το μάθημα ήταν αρκετά ωραίο, με συμμετοχή αρκετών μαθητών που έδειξαν ενδιαφέρον. Στα επισυναπτόμενα του παρόντος post σας επισυνάπτω τον κώδικα και το .pptx της δικής μου παρουσίασης περί το axis2. Θα βρείτε μέσα και το 3ο demo που δεν πρόλαβα να δείξω, όπου χρησιμοποιούμε το AXIOM του axis2 για πλήρη έλεγχο της XML που ανταλλάζετε μέσω των SOAP μηνυμάτων.
Σημείωση: Στις σημειώσεις του .pptx, θα βρείτε οδηγίες για την εγκατάσταση του axis2 και για το πως να φτιάξετε το project στο eclipse.
Το ξέρω ότι το 6ο StudentGuru event το κάναμε πριν αρκετό καιρό :) Όμως τώρα βρήκα το χρόνο να φτιάξω το webcast που είχα υποσχεθεί και το οποίο θα περιλαμβάνει όλα τα εισαγωγικά που είχαμε πει στο 6ο StudentGuru event, συν άλλα που δεν είχαμε προλάβει να πούμε. Το video είναι σε 2 μέρη. Έχω βάλει λεζάντες σύμφωνα με το "κεφάλαιο" που βλέπετε κάθε στιγμή. Τα περιεχόμενα των κεφαλαίων είναι τα εξής:
- Εισαγωγή στον SQL Server 2008
- Περιγραφή συστατικών και της εγκατάστασης - Εισαγωγή στον SQL Server Management Studio
- Δημιουργία πινάκων - Εισαγωγή στην T-SQL
- Επεξήγηση των βασικών εντολών CRUD
- Παρουσίαση του Query Designer
- Επεξήγηση κλειδιών (primary, unique, index)
- Δημιουργία check constraints
- Επεξήγηση των Templates
- Επεξήγηση προκαθορισμένων τιμών στηλών - Σχέσεις
- Ξένα κλειδιά
- Delete & Update rules των ξένων κλειδιών
- Backup & Restore
- Detach & Attach
- Ένας-προς-πολλά και πολλά-προς-πολλά
- Database diagram της ολοκληρωμένης βάσης - Περισσότερη T-SQL
- Select με προσαρμοσμένες στήλες
- Aggregate functions: Count, Group by
- Εμφωλευμένα Select
- Inner join, left outer join - Όψεις
- Συναλλαγές ή transactions
- Εισαγωγή δεδομένων από αρχείο κειμένου - Κανονικοποίηση
- Stored procedures
- Παράμετροι, μεταβλητές, προσωρινοί πίνακες - Triggers
- Παραγωγή T-SQL
- Database Mail & SQL Server Agent
- ορισμός απαραίτητων δικαιωμάτων - Ρύθμιση για απομακρυσμένη σύνδεση
Επίσης, τα SQL scripts που χρησιμοποιούνται μπορείτε να τα κατεβάσετε από εδώ, απλά δείτε τα attachments του παρόντος post.
Μπορείτε να δείτε τα videos μέσω των τους εξής link:
http://www.studentguru.gr/learn/view.aspx?id=89
Αναμένω τα σχόλια σας!
More Posts
Next page »