|
Πρόσφατες Δημοσιεύσεις
-
While trying to generate a single HTML page that will list all ClipFlair activities using XSL Transformations (XSLT), I had the need to group items in 2-column rows. This is my contribution to other solutions suggested at (if you like it you can vote it up there): http://stackoverflow.com/questions/9908488/xslt-for-each-wrapping-every-nth-item-in-a-div/ Faced by the same problem, that is […]...
|
-
In C/C++ and C# one has useful prefix (++index) and postfix (index++) increment operators and corresponding decrement ones. Although they have a single operant, they’re not working like functions as single + or – prefix would do, but instead they cause side-effects – they edit the variable passed to them. The prefix increment operator first […]...
|
-
I’ve been using various small XAML storyboard utilities and behaviors in my latest Window Phone and Windows Store apps. I’ve just packaged them all and released them into GitHub . Universal Helpers may not be that good of a name since the library is pretty small (yet) but I hope to enhance it in the future with more utilities and behaviors. So, let’s jump right in and see what’s under the hood! First of all, there are some Blend Behaviors. I love behaviors! Easy just as a Drag’n’Drop, yet so powerful! What’s even more great is that Windows 8.1 SDK has a Behaviors SDK , which, to no one's surprise, works with Windows Phone 8.1 Store apps. A limitation right now is that you can’t (at least easily ) write Behaviors in a portable class library, that’s why I’ve implemented them in the Shared project. Let’s see them, one by one. DragElementBehavior This behavior allows any element with a CompositeTransform to be dragged. It has options for inertia plus a container, in order to never be out of bounds (either by dragging...
|
-
Last time I posted something around Angry Birds was 3 years ago, when I blogged about a 5’ creation of Angry Birds with 0 lines of code using XAML, Behaviors and Expression Blend . Well, it wasn’t exactly a clone, but it simulated on how to implement some basic dragging/collision/particles functionality with the Farseer Physics Engine. This blog post serves as an attempt to create a single level (with reusable components, long live the prefab!) of Angry Birds using Unity3D platform. The game features a single level, 3 birds for the user to throw, 3 pigs that the user has to destroy, parallax backgrounds, a maximum strength for the bird (we cannot drag the bird more than a predefined distance), animations with the help of the excellent GoKit library, a projection of the trajectory of the bird (so we can more or less predict where it’ll land), the user’s ability to drag the screen to see the entire scene, pinch to zoom ability (for multitouch devices) and a small trail that is left by the bird when it’s thrown....
|
-
URL is a term familiar to a lot of people since the beginning of the internet age. Actually, not every internet user is familiar with that URL thing, but at least there are some knowing that copying some letters from the top of your browser and sending them to a friend might help him in opening the same page in his browser. People who are familiar with the internet may have heard the term URI and know that is something like the URL. Finally there is is another yet term connected with the previous ones; that's the URN. We are going to find what each one of these terms is about, what they are made for and how .NET may help us to handle them. Introduction A nice way to begin, is by saying what these things are. So here's what each term stands for: URI : Uniform Resource Identifier URL : Uniform Resource Locator URN : Uniform Resource Name We can now tell that they are all referring to some uniform resource. Uniform resources can actually be a lot of stuff. An image, as well as a website address...
|
-
In this post I will go through the process of debugging eXpandFramework for each of the distribution channel. The sources If you download the sources either from GitHub or our download page or our build server you need to run the buildall64.cmd file located in the root folder. The batch will generate the symbol files (pdb) and will register the assemblies in the GAC. Debugging is enabled by default since symbols and sources are in place. The Nuget packages eXpandFramework is distributed through Nuget and since version 14.1.4.8 and with the excellent GitHubLink project provides frictionless debug experience as long as Symbol Server support is enabled under your VS/Options/Debugging settings. The symbols are in the same package as the dll so expect the package size to be at least double in size. We will consider a better implementation if there are requests. GitHubLink patches the symbols so to request the assembly sources from the online GitHub repo so there is not need to have the sources in place. The Binaries...
|
-
Last month I had the opportunity to speak at a Microsoft event about best patterns Read more...
|
-
In the C# compiler error case shown above, CaptionsGrid class exists in namespace ClipFlair.CaptionsGrid so in the code we have “using ClipFlair.CaptionsGrid;” at the top of the file where we want to call the “SaveAudio” static method of CaptionsGrid class. But then we get the error “The type or namespace name ‘…’ does not exist […]...
|
-
Unless you’ve been living in a cave or visiting outer space for the past months, you have certainly played Flappy Bird , one of the most successful games for mobile devices. Hence, I decided to give it a shot and recreate it using Unity. Needless to mention that all graphics and sounds found in the tutorial are used only for educational purposes and do not intend to harm any intellectual property at all circumstances. The sprite sheet used was found here http://www.spriters-resource.com/mobile_phone/flappybird/sheet/59537/ whereas the sounds were extracted from this youtube video https://www.youtube.com/watch?v=xY0sZUJWwA8 So, let’s start with the small tutorial! This game’s development has many aspects, we’ll attempt to touch all of them one by one. First of all, we used Unity’s spritesheet editor to “slice” the spritesheet and get references to specific sprites Then, we created a small animation to simulate the flight course of the bird (this can be easily accomplished if you drag-drop the relevant sprites into...
|
-
I had blogged in the past about a simple puzzle game in XNA . Nothing better than to recreate it in Unity with a tutorial, of course! To begin with, here’s a screenshot of the game running on the editor The purpose of the game is to tap/click on the pieces next to the empty one so that they exchange positions. It goes on and one until you make the pieces appear as in the original photo. To begin with, we’ll need a photo. The best way to save yourself from copyright issues and not having to read licenses etc is to use a photo that you took! So, we need to slice it. For this purpose, we’ll use Unity’s native 2D tools and its sprite editor. Once we set the sprite mode to multiple, we can use the sprite editor to ‘slice’ our image. Since the image does not have an alpha channel, we’ll use Grid slicing. Moreover, we’ll name our exported sprites with a name that contains their location information (i.e. piece-0-0 => this implies that the sprite’s “correct” location is on the top left corner of our game). Plus, we’ll...
|
-
Some time ago I did a blog post about the famous Arkanoid game and its adaptation to Windows Phone using XNA. Couple of weeks ago, I attempted to recreate it from scratch using the Unity game engine and, to no surprise, it was pretty a piece of cake. Below you can see a screenshot from the start screen of the game. Let’s do a lap around the project. First of all, we have one and only one scene, the game one. We have a Camera, set to Orthographic projection (most suitable for 2D games) a directional light a GameManager gameobject which holds the GameManager script, in charge of running our game the Ball which goes around on the level the Paddle which is the means that the user will utilize in order to prevent the Ball from touching the floor the Floor, which if collided with the Ball will decrease player’s lives the SideBlocks which just make the Ball stay in our level and, of course, the Blocks which have to be hit by the Ball (via user’s assistance) and are organized in four BlockRow objects Purpose of the game...
|
-
About 4 years ago I had blogged about the creation of the classic Bubble Breaker game in XNA . Since I’ve recently started to get acquainted with the Unity3D game engine, one of the first things that crossed my mind was to try and recreate it using Unity. Why did I choose Unity? Well, one of the reasons is that it supports my favorite programming language C# plus games can be exported to my favorite platform, Windows Phone. Conversion from XNA was not that straightforward (well, I expected that, to be honest) in the matter that only the search and compare algorithms managed to survive. Game implementation is pretty basic, it contains 3 screens. First is the intro screen where you can select either to play the game or view the top 10 scores. Then, there is the game screen (we’re making a game after all!). All screens have an very strange script (I’m experimenting guys!) where the background dynamically changes color. Check out some screenshots from the game running inside Unity Editor. Well, basically each bubble...
|
-
Όσοι έχετε εγκατεστημένο σε παραγωγικό περιβάλλον SQL Server 2012 θα πρέπει να βάλετε το παρακάτω fix το οποίο διορθώνει ένα πρόβλημα που εμφανίζεται κάτω από συγκεκριμένες συνθήκες όταν κάνεις online clustered index rebuild και έχει να κάνει με απώλεια δεδομένων. http://www.sqlschool.gr/blog/fix-for-online-index-build-corruption-issues-in-sql-server-2012-sp1-sp2-989.aspx...
|
-
A simple project may be able to do just fine using its local resources, database and nothing but that. However an advanced application may be expected to use distributed resources, such as getting data out of web pages. In that case we need to make requests of our own in order to get that info. .Net contains the WebRequest class which can be quite helpful in such cases. We are going to use WebRequest's methods to get distant info, create a few useful examples and finally find out how we can create asynchronous requests using .Net 4.5. Using the WebRequest A request could be regarded as a basic part of the web architecture. A client sends a request to the server in order to get data. In return, the server will send the data back to the client. We can also create requests using a few lines of code using the WebRequest class. This is what this article is about. To begin with, we are going to create a simple GET requests to see how we can use it. ...
|
-
With smart frameworks like XAF it is inevitable that you will create applications one would except they developed by a whole team and not from just one person. A side effect of rich/large applications is that it is impossible to determine if all parts of the application function unless you have tests. Enter AutoTest from EasyTest XAF comes together with EasyTest a functional testing framework. EasyTest has an undocumented command the AutoTest. In short the AutoTest command will go through all your Navigation Items and for all related views will execute the New action if available and open/close the related detailview. So, lets talk by example. In eXpandFramework there are 38 Demos with a large number of views, each one demonstrating certain features. By using the AutoTest command we can automate the opening of all views therefore we can expect a code coverage larger than 80%. Following is the RunEasyTests target used in eXpandFramework build script ( Xpand.build ). < Target Name = "...
|
-
A lot of times, I get claims and concerns from colleagues and partners that EF is slow and it cannot compare to writing your own SQL queries for the database directly. In this post, we will try to clarify to what extent the above statement is true. Suppose that you have the following simple schema in your database: Let's examine some EF queries and approaches that affect performance: Querying the data in the Locations table Suppose you want to get some data from the Locations table. You may use the following: using (LocationsContext ctx = new LocationsContext()) { var Locations = ctx.Locations.ToList(); } Several runs of the above query yield approximately 3600ms to retrieve 80000 records. But wait a minute. Since we want only to display those data and not process them we do not need the proxies created for monitoring those objects by EF so we can effectively disable them as follows: using (LocationsContext ctx = new LocationsContext()) { ctx.Configuration.ProxyCreationEnabled = false; var Locations = ctx.Locations.ToList();...
|
-
Δεν είναι σπάνιο το να έχεις ένα identity field μέσα σε ένα πίνακα. Κάποια στιγμή πιθανότατα θέλεις να σβήσεις όλα τα δεδομένα του πίνακα και όταν αρχίσεις να γεμίζεις ξανά τον πίνακα θέλεις το identity field να ξεκινάει από την αρχή http://www.sqlschool.gr/blog/dbcc-checkident-manually-set-a-new-current-identity-value-for-the-identity-column-981.aspx...
|
-
I have been using JQuery for a couple of years now and it has helped me to solve many problems on the client side of web development. You can find all my posts about JQuery in this link . In this post I will be providing you with a hands-on example on the JQuery Roundabout Plugin . This is a plugin that supports circular rotating display for content. It supports autoplay. In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like. You can use Visual Studio 2013 Express edition. You can download it here . You can download this plugin from this link . I launch Expression Web 4.0 and then I type the following HTML markup (I am using HTML 5) <!DOCTYPE html> <html> <head> <title>JQuery Roundabout Plugin </title> <style> ul { margin: 1em auto; width:700px; height: 300px; list-style: none; } li { text-align: center; height: 300px; width: 700px; background-color:#eee; color:#565748; } </style> <script...
|
-
Garbage collection is an essential part of .Net architecture since it saves you from the trouble of managing the memory parts you have already used. We are going to see what garbage collection actually is and what may cause it. Next we'll check out how we can manage memory parts ourselves and talk about the disposed pattern. Introduction Garbage collection was one of the first things I heard of when started learning .Net. Even so, it's been some time since then that I got the first idea of what garbage collection is about, as most developers were not interested in how it works. Since garbage collection and memory allocation is not a part of a typical .Net developer and "it ain't broke" it doesn't sound like it "needs to be fixed". However a developer who likes to know how things work, may find this article quite interesting, as it forms a simple description of what happens under the hood while our programs keep running. The stack and the heap ...
|
-
Trovigo.com is an unwanted search engine hijacker that renders Internet Options of Windows / Internet Explorer inaccessible. To restore them on an older Windows XP installation, one way that I’ve found to work is to update Internet Explorer to a newer version, aka IE 8 (say via the embedded Windows Update facility or Microsoft Update […]...
|
-
I guess that most people know what postback is. Well, at least most developers that have been using ASP.NET Web Forms. If so, you know that postback is an essential part of your application. In this article we are going to search in depth what postback actually is, how it is created and how it can be used in combination with other parts of web applications. Brings back memories Probably the first time you heard of postback was when you tried to create a DropDownList the way it is in the following example. < asp : DropDownList runat ="server" ID ="DropDownListID" /> < asp : Button runat ="server" Text ="Click" OnClick ="ButtonClicked" /> < asp : Label runat ="server" ID ="LabelID" /> protected void Page_Load(...
|
-
DevExpress offers a great installer for their components and frameworks. But if you work in a continuous integration environment or have to deal with different versions of the components NuGet packages are the better way to deploy and version-control dependencies. This project contains .nuspec files for DevExpress WinForms, Web and XAF assemblies. It is not an official release and it is not supported by DevExpress. This is the description of the DX-Nuspec files, open sourced from Sergej Derjabkin a casual community contributor! The files are available in https://github.com/derjabkin/DX-Nuspec and of course they will be distributed as a submodule from eXpandFramework v13.2.9.1....
|
-
When you try to run a ClickOnce Windows application from Mozilla Firefox, on some machines you may see it try to save a .application (ClickOnce deployment manifest) instead of running the ClickOnce application installer/updater/launcher. To fix that issue you can open Firefox add-ons dialog and search among available to download/install add-ons for "net framework assistant". […]...
|
-
Delegates are a way to handle methods in a different way than we are used to. They comprise a basic part of the .Net architecture and are important in order to use technologies like lambda expressions. What is a delegate? A delegate is a reference type which can be used as a connection between that and the methods it is assigned. Think of it as a reference type for methods. In a few words, we can create the WriteSthDelegate delegate and the WriteSthMethod method. Then we connect the method to the delegate. Now, we can use the delegate the way we would use the method. Consider a delegate something like a pointer to a method. Let's see an example. We will use a simple literal object called DelegateOutputLitID to show the output. Here's our delegate and the method it will use. delegate void WriteSthDelegate ( string outputText); void WriteSthMethod( string outputText) { DelegateOutputLitID.Text += outputText; } ...
|
-
Lambda expressions are anonymous functions that can be really helpful at times. Alike many other .NET methods, lambda expressions are not the only way to create the algorithm you want, however they may help you in writing code that is much easier to read than the old fashioned way. We are going to see what lambda expressions are and go through some basic applications. Lambda calculus Even though the fact that you reading this article shows that you are interested in the .NET's lambda part, we'll first take a little tour over its mathematical background. When Microsoft developers released .Net 3.5 and introduced lambda expressions, that idea had been in store for a long time. The following description is nothing more but a naive description of the mathematical model and will be used as an introduction to the development model. In 1930s Church, a mathematician, in order to strengthen the foundations of mathematics, created a formal mathematical system based on function abstraction. He called that system...
|
|
|
|