• 1

Jealousy and Envy

It is a copy-paste of "Jealousy and Envy" article. Few years ago I've got this question: what is the difference between this two words? In some time I have googled and even almost understood it. And made a bookmark "Translate it to Russian". It seems now the time to made a translation post has came. Russian translation can be found here. I'll keep English original here just to be safe. It's a web, after all. You never know what can happen :)

Jealousy and Envy
Ooh, what an exciting pair to be discussing — the two emotions that jointly account for about 65% of all Gossip Girl storylines! But wait! Are they two emotions? Or are they two words for the same emotion? Some people think there’s a crucial difference between the two, such as Paul Brians (author of Common Errors in English Usage) and this commenter who put it nicely:

“I get frustrated by the common use of the word jealousy instead of envy. “I was jealous of her house/car/clothes etc” should be “I was envious of her house/car/coat” as they belong to someone else. We are envious of something we don’t have and jealous of something we want to hold onto – yet most people seem to use the word jealous for both!”

The definitions given in the above comment are completely reasonable, but like “most people” and unlike these people, I don’t believe in the exclusivity of the definitions. Let’s start out by checking the definitions that commenter gives against actual usage:

(1a) “If you are in a relationship where your husband’s jealousy or possessiveness is beginning to get to you [...]“
(1b) “My husband is envious and I’m sure we will be ordering a case for his i-pod in the near future.”

In (1a), the jealous husband wants to not lose his wife. In (1b), the envioushusband wants to gain his wife’s iPod case. In the first sentence, the jealousy is over something that is (metaphorically) his; in the second, the envy is over something that isn’t. So those definitions bear out, and they’re listed in any dictionary as well.

Furthermore, there is some exclusivity between the two words; envious can’t take on the meaning of jealous in (1a):

(2) The woman could no longer stand her envious husband.

(2) is, of course, a grammatical sentence, but it means that the husband’s inability to handle the fact that other people have nicer things than he does is contributing to the dissolution of their marriage. For me, it can’t mean that the husband is possessive of his wife, like jealousy did in (1a). (My intuition is backed up by the OED, in which all of the definitions of envy involve other people and their things.) So that fills in 3 of the 4 possibilities:

wanting own stuff others’ stuff
jealous YES (1a) ?
envious NO (2) YES (1b)

And if the complainant whose quote started this post is correct, then the question mark in that top-right square should be replaced by a bright red NO. In some sense, that would be nice, right? The table would be symmetric, and the exclusivity would be mutual. But language cares not for symmetry, nor for mutual exclusivity. Jealous can be used in reference to other people’s possessions, and it has been this way since before the letter j even existed. The OED’s first attestation with this meaning is from Chaucer, around 1385. Here’s a nice, clear example from William Caxton, the first English printer, circa 1477:

(3) Alle were ialous of him. But Iason neuer thought on none of them.

The OED has attestations of this meaning through to the present, and we know that this meaning still exists, or there wouldn’t be any reason to complain about it. So let’s finish off the chart:

wanting own stuff others’ stuff
jealous YES (1a) YES (3)
envious NO (2) YES (1b)

Yes, there’s a difference between jealousy and envy. But it’s not that you can’t be jealous of your friend’s stuff. It’s just that you can’t be enviously guarding your friendship.

By the way, there’s another proposed distinction that I found while researching this one, a philosophical distinction that is certainly worthy of mention. But that distinction merits a post of its own, one that involves philosophers, emotions, and Gossip Girl spoilers. This post simply wouldn’t have been able to keep it all in. I’ll try to get that post up soon.

Summary: Envy is pretty well restricted to the feeling you get from wanting someone else’s stuff. Jealousy is a bit more inclusive, allowing you to either want to have someone else’s stuff or want to keep your own stuff.

http POST bruteforce

This post is a bit funny. It wouldn't have happened if I would not forget a password for this site. This actually never happened to me before: for 1-time sites I have easy 1-time passwords, and for something I am going to be using, I have strong passwords that I do remember. (UPD: not anymore; Troy Hunt made me understand that any password must be unique and very strong)
But for this site I have turned my imagination on, judging by posts dates, first two days I have remembered it, and now, few weeks later, I don't. I've spent like hour typing in passwords, failed.

"I'm a programmer, after all" — I thought, and wrote a program that would bruteforce the password for me. I had a set of "tokens" that I must have used when created a password, it made task much easier. I also didn't bothered with googling, implementing something fancy, fast, multithreading. Just a copy-paste from my other project, that have a site parsing part. Here it is:

CookieAwareWebClient

Code above allows you to be "logged in" with your WebClient via cookies. Code below is using CookieAwareWebClient to POST login-password, and then trying to download page, that is only available to users, that are logged in. There probably is some much better and faster way to understand, was login attempt successful or not (if you know better solution — please leave a comment), but this one was fast enough for me.

Using CookieAwareWebClient

Now, once I have a list of possible password tokens:

Password tokens example

I just have to iterate over them and their combinations. Voilà!

(I figured out, if something is going to be slow and inefficient — that would be networking, retrieving /admin page in single thread. Not string concatenation and regexp; hence, no optimization here at all)

 

Links:

Download sources

Tags :

msbuild and msdeploy for Orchard

This site (UPD: not anymore!) and my russian site about buying items with Shipito are running on Orchard CMS. Orchard is open source project, it uses ASP.NET MVC 3, Razor syntax, it uses dynamic extensively. It is much easier to add own Modules or just edit existing ones if you have full sources of Orchard. But converting sources into deployable package is not an easy task. Since Orchard already had Orchard.proj msbuild project, compiling will be done with msbuild. Web server is "WebMatrix friendly" IIS, I will be using msdeploy to deploy package on server.

Original msbuild project is doing following: clean, compile, test, package. Everything is fine, except I don't want source files on server.

Copy sources disabled

 

I also want Warmup, ImportExport and DesignerTools modules to be in package.

Preserve useful modules

 

Doing a few steps forward, I also want deploy to not delete folder with site information that is on server. Following hack will make folder appear in deploy package. This way folder with site info will not be deleted during deploy.

msdeploy hack

 

I also want my CSS and JS to be minified. I will be using YUI Compressor for .Net. I do not want to merge any of JS or CSS files, but I want each of them minified. It's pretty easy (don't forget to include Yahoo.Yui.Compressor.dll).

CSS and JS compression target

Note, that without ThreadCulture specified, this compressor was throwing JS with errors. It also can sometimes throw resulting files larger, than source files, if original file was already minified. But overall it works great, I get 30% to 50% js/css file size reduction. That's it. Read through original Orchard.proj file yourself to understand how it works, it's pretty straightforward.

Now I have good Orchard package. I need to

  1. customize it for every site I have / will have.
  2. deploy it to server.

Easiest way I found to use same Orchard core and different media for different sites was to inject media into the temp core package archive, deploy it to server, delete it. (I know it sounds too complicated, or even crazy, but it is the best and most universal way to deploy I have found, considering I have restricted access rights for my shared hosting; if you have an idea of how to make it better, please, leave a comment)

Here is my deploy .bat script:

Deploy .bat file

Line 11: create temp package.
Line 12: add files that are in content\%site%\ folder to temp package.
Line 13: put app_Offline.htm file to server, this will effectively shut it down.
Line 14: deploy package to server. Do not delete *Settings.txt files, do not delete \Media folder.
Line 15: remove app_Offline.htm file from server.

That's really brief story of how my Orchard building and deploying is done.

In the end, I just need to type build to build Orchard core, and then stefantsovcom_deploy to deploy this site. I am also able to use Visual Studio 2010, it's useful for debug and quick response to changes I make.

 

Links:

Download sources

 

Tags :

netmf Character LCD

It's about programming .NET Micro Framework device, Netduino. I will make it work with HD44780-compatible Character LCD.

 

What is this display?

PC2402LRS-ANH-H Character LCD

This one is PC2402LRS-ANH-H, more images at google.

It have 14-pin interface: 4 or 8 data pins, 3 control pins, power, ground, brightness adjust pin. In can display up to 255 different characters, graphics for few of them can be set up by programmer, rest are hard-written in ROM.

 

What can my Character LCD class do?

Class can handle complicated LCD controller protocol / initialization / timing / interface.

Timings from manual

 

It also offer straightforward Hashtable to map symbols you use to ones your LCD have in it's ROM: some displays have Japanese character set, some have Cyrillic etc.

Character table

 

Sample code

Example usage of Lcd class

Once lcd is created, display is initialized and ready to work. This code does creeping line.
Here are class public members:

Visual Studio 2010 + ReSharper File Structure

 

Once you know how your LCD microcontroller works, it's pretty straightforward. But to understand it, you might need to read some manuals. You can also find online LCD simulator very useful.

Here is BitBucket open source netmf LCD page.

If you have any questions, if you want something added or you have a change suggestion, do not hesitate to leave a comment.

My work desk with Netduino and Lcd connected

Close view on Netduino and Lcd connector

Character LCD in action

UPD: my Character LCD class was mentioned at Microsoft blog. Woot! :)

  • 1