Epic Blog of Awesome

code.tech.sci.math.art.write

Ice Manual – Ice 3.4 – ZeroC

The Internet Communications Engine (Ice) is a modern object-oriented toolkit that enables you to build distributed applications with minimal effort. Ice allows you to focus your efforts on your application logic, and it takes care of all interactions with low-level network programming interfaces. With Ice, there is no need to worry about details such as opening network connections, serializing and deserializing data for network transmission, or retrying failed connection attempts.

The main design goals of Ice are:

Provide an object-oriented middleware platform suitable for use in heterogeneous environments.
Provide a full set of features that support development of realistic distributed applications for a wide variety of domains.
Avoid unnecessary complexity, making the platform easy to learn and to use.
Provide an implementation that is efficient in network bandwidth, memory use, and CPU overhead.
Provide an implementation that has built-in security, making it suitable for use over insecure public networks.
In simpler terms, the Ice design goals could be stated as "Let’s build a powerful middleware platform that makes the developer’s life easier."

via Ice Manual – Ice 3.4 – ZeroC.

Server Side Paging using SQL Server 2005 – SQLTeam.com

A common activity in applications is to page results or record sets from a database. This is usually done on the client using the clients paging functionality or on the server through a variety of methods. In SQL Server 2000 those server side methods typically used dynamic SQL or nested TOP clauses and werent very efficient. Using Common Table Expressions in SQL Server 2005 we have a better way to page record sets on the server.The Members Page on SQLTeam.com lists the first 20 members sorted by number of posts. In order to generate this it selects the entire set of members, returns it to the client and then displays the first 20 rows using ADOs paging functionality. The SELECT statement it runs looks something like this

via Server Side Paging using SQL Server 2005 – SQLTeam.com.

Reducing SQL Server Locks – SQL Server Performance

if your users are complaining that they have to wait for their transactions to complete, you may want to find out if object locking on the server is contributing to this problem. To do this, use the SQL Server Locks Object: Average Wait Time (ms). You can use this counter to measure the average wait time of a variety of locks, including database, extent, Key, Page, RID, and table.

If you identify one or more types of locks causing transaction delays, then you will want to investigate further to see if you can identify what specific transactions are causing the locking. The Profiler is as a good tool for this detailed analysis.

via Reducing SQL Server Locks – SQL Server Performance.

>Creating RIA Services Solutions

>

Default Solution Structure

In the default solution structure, RIA Services creates a single client project and a single server project. When you create a new project with the Silverlight Application template and select the Enable WCF RIA Services check box, you create a solution with the default structure. A RIA Services link exists between the two application projects. When you build the solution, client code is generated for domain services and shared code. The following illustration shows the default solution structure.

Default Project Structure

The default solution structure is convenient because all domain service types and shared code added to the server project are automatically available to the Silverlight client project after you build the solution. Also, the shared code you add to the server project is visible in the client project. This structure works well when you do not have many domain services in the server project and you do not need to reuse business logic across many different Silverlight applications.

In a solution with the default structure, you can add more Silverlight applications with a RIA Services link to the server project. However, there are limitations of the default structure. The generated code for each Silverlight client can access all of middle-tier code from the server project. For example, if you have three Silverlight applications linked to a single server project and you want to add a domain service that will be used by only one of the Silverlight applications, all three client applications will have a generated domain context for the domain service and will be able to access that domain service.

For more information, see Walkthrough: Creating a RIA Services Solution. For more information about the code generated for a client project, see Client Code Generation.

Silverlight Business Application template

RIA Services also provides a Silverlight Business Application template. This template provides a convenient starting point for building a business application that utilizes Silverlight for the client. The template builds on the Silverlight Navigation Application and uses RIA Services to support authentication and user registration. When you create a project by using the Silverlight Business Application template, RIA Services creates the solution with the default structure. The Silverlight Business Application automatically adds the following features:

  • Login window

  • Registration window

  • Silverlight Navigation

The default authentication mode for the Business Application is Forms Authentication. To use Windows Authentication, you simply change the value of the authentication element in the Web.config file, such as <authentication mode=”Windows”/>, and change the value of the Authentication property on the generated WebContext class. The Business Application template automatically contains code to support either FormsAuthentication or Windows Authentication. For more information, see Walkthrough: Using the Silverlight Business Application Template.

The Services folder of the server project contains the domain services that expose user registration and user authentication. The user registration service utilizes the ASP.NET membership provider to create new users. In the server project, a folder named Models contains classes for defining properties for user and registration data. You can add properties to these classes to customize the user data for your application.

In the client project, the Business Application contains code to simplify developing the presentation layer. The Libs folder and the Controls folder contain assemblies and controls that are used within the template. The Login folder (located within the Views folder) contains the authentication and user registration controls. These controls are automatically enabled in the project. The Resources folder (located in the Assets folder) contains resource strings for text within the project. As you add text to your application, you can add them to the file for application strings.

For more information, see Walkthrough: Using the Silverlight Business Application Template.

Posted via email from Mocha Brain Freeze

>Silverlight MVVM: An (Overly) Simplified Explanation

>

The Model

image

The Model is where the data for the application goes, The Model can contain:

  • Web Services – A Silverlight application typically needs to communicate with the web server to get the data, you can put your web service methods here.
  • Rest Services – The same as web services.
  • Generic Collections – Basically any data.

 

The View Model

image

The View Model consists of:

  • Properties – One of something. This could be a String or an Object. Implements INotifyPropertyChanged, so that any element bound to it, is automatically notified whenever it changes.
  • Collections – A collection of something. This is of type ObservableCollection, so that any element bound to it, is automatically notified whenever it changes.
  • Commands – An event that can be raised. Also, one parameter of type Object can be passed. This implements ICommand.

 

The View

image

This is the part that you can make with no code using Expression Blend.

An Outline

  • Model
    • Get your data any way you can. Usually calls to web services.
  • View Model
    • Consists of:
      • Properties – One of something. This could be a String or an Object. Implements INotifyPropertyChanged, so that any element bound to it, is automatically notified whenever it changes.
      • Collections – A collection of something. This is of type ObservableCollection, so that any element bound to it, is automatically notified whenever it changes.
      • Commands – An event that can be raised. Also, one parameter of type Object can be passed. This implements ICommand. 
        • Implemented using Behaviors. Mostly the InvokeCommandAction Behavior  
  • View
    • Properties
      • Bind to a text box, radio button, toggle button, MediaElement, trigger an animation or ViewState change
    • Collections
      • Bind to List box, TreeMenu
    • Commands
      • Implemented using InvokeCommandAction behavior
        • Bind to a ICommand in the ViewModel
        • Indicate the ICommand that you want to raise
        • Pass a parameter

Posted via email from Mocha Brain Freeze

>An attempt was made to load a program with an incorrect format

>

This message being spewed-forth by an asp.net application means that the DLL concerned has been compiled as a specific “bitness”, but one that doesn’t match that which IIS is running at. The most usual reason for this is an assembly marked as “x86″ deployed to an “x64″ server. If the assembly doesn’t P/Invoke out to any 32-bit DLLs, change the platform target to “AnyCpu”.

As far as the .net framework is concerned, the x86/x64 categorisation is only used as an indicator of requirements, thus if no P/Invoke is going on it’s not needed, as the JIT compiler takes the assembly and JIT compiles it to the relevant instruction set at runtime anyway.

Posted via email from Mocha Brain Freeze

>Absolutely Hilarious Computer Quotes

>

“If at first you don’t succeed; call it version 1.0″

“The Internet: where men are men, women are men, and children are FBI agents.”

“Some things Man was never meant to know. For everything else, there’s Google.”

“unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep”  – my daily unix command list

“… one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.” – Robert Firth

“If Python is executable pseudocode, then perl is executable line noise.”

“The more I C, the less I see.”

“To err is human… to really foul up requires the root password.”

“After Perl everything else is just assembly language.”

“If brute force doesn’t solve your problems, then you aren’t using enough.”

“Life would be so much easier if we only had the source code.”

“Unix is user-friendly. It’s just very selective about who its friends are.”
 
“COBOL programmers understand why women hate periods.”

“Programming is like sex, one mistake and you have to support it for the rest of your life.” — Michael Sinz

“There are 10 types of people in the world: those who understand binary, and those who don’t.”

“640K ought to be enough for anybody.” – This is not humorous by itself; but in the context it’s a classic by Bill Gates in 1981

Microsoft: “You’ve got questions. We’ve got dancing paperclips.”

“Microsoft is not the answer. Microsoft is the question. NO is the answer.”   - Erik Naggum

“Men are from Mars. Women are from Venus. Computers are from hell.”

“SUPERCOMPUTER: what it sounded like before you bought it.”

“Windows95: It’s like upgrading from Reagan to Bush.

“People say Microsoft paid 14M$ for using the Rolling Stones song ‘Start me up’ in their commercials. This is wrong. Microsoft payed 14M$ only for a part of the song. For instance, they didn’t use the line ‘You’ll make a grown man cry’.”

“I’m not anti-social; I’m just not user friendly”

“A printer consists of three main parts: the case, the jammed paper tray and the blinking red light”

“The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2.”

“A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila”

“1f u c4n r34d th1s u r34lly n33d t0 g37 l41d”

“To go forward, you must backup.”

“I would love to change the world, but they won’t give me the source code”

“A Windows user spends 1/3 of his life sleeping, 1/3 working, 1/3 waiting.”

“My software never has bugs. It just develops random features.”

“Better to be a geek than an idiot.”

“Windows isn’t a virus, viruses do something.”

“Geek’s favorite pickup line: Hey, does this rag smell like chloroform? “

“Be nice to geeks when you’re in school, you might end-up working for one when you grow-up.”

“Difference between a virus and windows ? Viruses rarely fail.”

“Evolution is God’s way of issuing upgrades.”

“The only problem with troubleshooting is that sometimes trouble shoots back.”

“It’s a little-known fact that the Y1K problem caused the Dark Ages.”

“The box said ‘Required Windows 95 or better’. So, I installed LINUX.”

“Computer are like air conditioners: they stop working when you open windows.”

“once upon a midnight dreary, while i pron surfed, weak and weary,
over many a strange and spurious site of ‘hot xxx galore’.
While i clicked my fav’rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour,
” ‘Tis not possible!”, i muttered, “give me back my free hardcore!”
quoth the server, 404.”

Mac users swear by their Mac,
PC users swear at their PC.”

“Like car accidents, most hardware problems are due to driver error.”

“Dating a girl is just like writing software. Everything’s going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You’ll be forced to patch the code (admit you’re wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.”

“Real men don’t use backups, they post their stuff on a public ftp server and let the rest of the world make copies.”  – Linus Torvalds

“There are 10 kinds of people in the world, those that understand trinary, those that don’t, and those that confuse it with binary.”

“If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.”

“It is easier to change the specification to fit the program than vice versa.”

“I had a fortune cookie the other day and it said: ‘Outlook not so good’. I said: ‘Sure, but Microsoft ships it anyway’.”

“The nice thing about standards is that there are so many to choose from.”

“The term reboot comes from the middle age (before computers). Horses who stopped in mid-stride required a boot to the rear to start again. Thus the term to rear-boot, later abbreviated into reboot.”

“Programmers are tools for converting caffeine into code.”

 
“The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.”

“Hacking is like sex. You get in, you get out, and hope that you didn’t leave something that can be traced back to you.”

Posted via email from Mocha Brain Freeze

>The Alcoholic – 7

>She signaled the server and ordered him another double and a glass of Cabernet for herself.

“He started hitting me the second year of our marriage. It’s hard to explain to someone who hasn’t been there, but I always felt it was my fault. If only I’d done this better, or said that differently, he wouldn’t have gotten angry. Of course, he understood this and exploited it every day. I felt less than worthless and came to feel that I deserved the abuse.”

“That’s crazy,” he blurted. “Why didn’t you just get the hell out of there?”

The drinks arrived and he grabbed his and took a gulp.

“Why don’t you just stop drinking?” She replied.

“That’s different.”

She didn’t respond, but instead continued her account. “It was my pastor who figured out what was happening and approached me. I denied it at first, but later after my husband broke my arm, I took the chance. He was very understanding and had experience with other women in similar situations. He introduced me to a support group and they eventually helped me get away from my husband.”

“Why didn’t you report him to the police? Get a restraining order?”

She was quiet for a moment and sipped her wine. “I don’t expect you to understand. I just couldn’t. I didn’t have it in me.”

“I don’t understand.”

“I know.”

“So what about now? He just tried to kill you. Why did we run away instead of binding him and calling the cops?”

“And how long will they hold him? Will they believe me over him, with a drunk as my only witness?”

Her words stabbed him and he withered inside. He had almost forgotten his own situation for a moment, as he lost himself in her problems. He felt himself shutting down, pulling away from her.

She spoke softly. “I’m… I’m so sorry. I didn’t mean to hurt you. I just–”

“It’s fine. That’s what I am.” He stood up. “Thanks for the drinks. Good luck to you.” He shuffled out of the bar before she could protest.

He was halfway down the block, purposefully heading nowhere in particular. “Hey,” she said as she grabbed his shoulder. “Please stop. You saved my life. Maybe I can return the favor.”

He stopped and looked at her.

“I don’t want to be saved. I want to be dead. And I doubt you have that kind of power. You have no idea who I am or what I’ve done.”

“No, I don’t know you and I don’t personally have the power to help you. But I do understand alcoholism because I watched my father suffer from it and I watched him recover from it. If you want freedom and a chance at getting your life back, it’s possible. You’re not alone or unique. At least try to find help before giving up on yourself.”

He wanted to believe there was a glimmer of hope. Of course he had heard of people “recovering” but that wouldn’t work for him. How could it? He’d tried to quit with everything he had but he’d failed. What more could he do?

He wanted a drink and felt ashamed. People streamed past him on the busy sidewalk, but he only saw her. Her passion spoke softly to him in a way he hadn’t felt in a long time. In fact, he hadn’t felt anything in a long time. Something stirred in him that he didn’t understand, but couldn’t ignore.

“I’ll make you a deal,” he finally said. “You let me help you with your husband problem. I’ll let you help me with my living problem.”

She grinned. “I think we can work with that.”