Leave a comment

Why we hurt others

Because…

Things to know before reading this article:

  1. People put their own interests first
  2. Whatever your thoughts are, your actions are what identifies you
  3. Everything happens for a reason, whether you like it or not

 

In psychological behavior classification there’s what we call “Personality type” which refers to the psychological classification of different types of individuals. Everyone of us has a different personality type that defines or explains his behaviors, but could this personality type change during his life?
Actually NO, it doesn’t change but depending of the events we face, we practice some additional behaviors, which unexpectedly could change he personality but not the type.

It all starts with a simple reason, good or bad reason it doesn’t matter, a reason that could change the way of living of any of us, and our first reaction is what defines the ending.

Sometimes you think that you’re doing the right things, while you’re totally horribly wrong. In most cases it’s all an illusion made by our minds or by the people around us, people we really trust, we get inspired from, and that’s the point, because people who are likely to cause us harm of any sort are likely going to be people we trust.

Once the bad happens, an in-mind investigation step begins, where we start to bind every event to another, and the final result is what we usually call “the truth” which produces a special feeling, a feeling that we could never expect, not joy and not sadness, you can’t truly understand it until it really happens.

All this will get us into a final deep feeling of sadness, but after some time (usually months), we start to feel better and better and this will make us changing our lifestyle to a more risky lifestyle, I’ve struggled to understand how we so easily accept a lifestyle that includes risks of death and/or incarceration. From my perspective, the choices we make are self-destructive,

In other terms, living this “self-destructive” lifestyle actually serves to increase the good feeling when hurting others which makes us more comfortable.
This makes us a whole new personality, a destructive and heartless personality, you’ll notice this in your behaviors and you’ll lose the ability to forgive people for even any mistake.
you could even do things that you’ve never thought you could do before.

At this point, the best feeling is to revenge to people who gave you the first reason, but is it the right decision? I’ll let you answer this question 😉

Leave a comment

Who manipulates your feelings every day?


There is a possibility that many of you are aware about that well, and that you agree with what I’m going to say, I’ll write it anyway:

“If you think that advertising is aimed at promoting (product-goods-services…) offered for purchase, you are wrong, terribly wrong about it!”

There’s no need to be surprised when your conscious mind reads the previous statement, but I believe that i have to tell you a little secret. In short, all the things that are advertised in magazines, newspapers or on television, with different types, the approach is one, and what is being manipulated is one, and the target is one: YOU.

People don’t want to own one thing or two or more, so that they feel good about themselves, and pride when talking about what they have with others. It’s that feeling that tells you “Don’t worry, you’re not less valued than the one who’s talking to you now, you’re just like him, you have a new phone,a beautiful car and beautiful house just like he has, … etc.”. It’s called DESIRE my friend!

Marketing agencies use this desire to serve their advantage when designing campaigns, you will notice that most of the commercials care about something that will return to you when you buy this product, and that your life will be changed completely, and a rainbow will appear around you, and will not leave you and your business even in the bathroom!

Am I exaggerating? OK, lets say i have a bit exaggerated. But what i mean here is that the truth is contrary to what we see in commercials, you won’t feel that ecstasy of dancing and singing when you open a bottle of soda, I don’t think that anybody is taking that smile when he takes a shower just because of some kind of soap or a shower gel.

Simply, many marketing campaigns – ads- don’t fail; because they are rather than focusing on the most important characteristics of this product in a manner attractive and mind respective, they show you an image that doesn’t have any relationship with the product, and your life will not be better when you use that product.

Finally,  I don’t deny that advertising is very important to promote business and increase sales, but we have to distinguish between what respects minds, and what it’s main concern is crooning in order to implant the idea in your minds.

One more thing; marketing campaigns may not aim to sell a product, but to change the way you think…BE CAREFUL!

Enjoying Google Search Tricks

You can use Google Search as a timer:

Tip Calculator:

Find out what date holidays fall on:

Find Movies release date:

Find schedules for television shows:

2 Comments

Working with Windows 8 user pictures (.accountpicture-ms)

BACKGROUND

First of all, I love Windows 8. I have it on all of my computers and I find that is the best OS for productivity and awesomeness.

Microsoft has changed a lot of things on Windows 8 comparing to Windows 7, and one of these things is the way the Windows stores the user pictures.

When i started developing MetroSidebar, i developed a User Account tile which displays the user picture, user name and PC name.

I thought it would be easy because i did it many times on Windows 7 but i found that it’s completely different, and here what i found:

In Windows 8, the user pictures are not saved as image files like JPEGs or BMPs or or or, they are saved as .accountpicture-ms (weired isn’t it?!).

The profile pictures are stored in this directory Environment.SpecialFolder.ApplicationData, “\Microsoft\Windows\AccountPictures” with the extension .accountpicture-ms.

To get the file name you need to move the mouse over the image file

Then you can see it in the tooltip (in my case it’s “673c064405e4b2fd”).

The problem is that these are not images, they are Account Picture files with extension “.accountpicture-ms”, in fact, I don’t think there is any program that can open this type of file (except Windows Explorer).

COMPOSITION:

The “.accountpicture-ms” files contain a file type definition and two *.jpg images.

The type definition is used to define the file type, so even if you change the extension to *.jpg, you won’t be able to read the file.

The images are stored in two different extensions one in 96×96 pixels and the other in 448×448 pixels.

READING THE IMAGES:

We’ll start by reading the 96×96 pixels image:

The first thing we need to do is to load the file using a FileStream:


FileStream fs = new FileStream(path, FileMode.Open);
long position = Seek(fs, "JFIF",0);

Then converting the FileStream to BitmapImage:


public BitmapImage GetImage96(string path)
{
FileStream fs = new FileStream(path, FileMode.Open);
long position=Seek(fs, "JFIF", 0);
byte[] b = new byte[Convert.ToInt32(fs.Length)];
fs.Seek(position-6, SeekOrigin.Begin);
fs.Read(b, 0, b.Length);
fs.Close();
fs.Dispose();
return GetBitmapImage(b);
}

Now to read the 448×448 pixels image:

public BitmapImage GetImage448(string path)
{
FileStream fs = new FileStream(path, FileMode.Open);
long position = Seek(fs, "JFIF", 100);
byte[] b = new byte[Convert.ToInt32(fs.Length)];
fs.Seek(position-6, SeekOrigin.Begin);
fs.Read(b,0,b.Length);
fs.Close();
fs.Dispose();
return GetBitmapImage(b);
}

To Convert byte array to BitmapImage:

public static BitmapImage GetBitmapImage(byte[] imageBytes)
{
var bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.StreamSource = new MemoryStream(imageBytes);
bitmapImage.EndInit();
return bitmapImage;

}

As you notice i used the Seek method, this method allows me to start reading the bytes from a chosen byte.

The seek method:

public static long Seek(System.IO.FileStream fs, string searchString, int startIndex)
{
char[] search = searchString.ToCharArray();
long result = -1 ,position = 0 ,stored = startIndex,
begin = fs.Position;
int c;
while((c = fs.ReadByte()) != -1)
{
if((char)c == search[position])
{
if(stored == -1 && position > 0 && (char)c == search[0])
{
stored = fs.Position;
}
if(position+1 == search.Length)
{
result = fs.Position - search.Length;
fs.Position = result;
break;
}
position++;
}
else if(stored > -1)
{
fs.Position = stored+1;
position = 1;
stored = -1;
}
else
{
position = 0;
}
}

if(result == -1)
{
fs.Position = begin;
}
return result;

}
2 Comments

Quick Screen Capture 2.0

 

After the success of the first release, i have received many feedbacks from many users, some users want more languages, more languages and others want better performance. I really appreciate their feedback, they helped me a lot, and especially some ideas from friends who I’m lucky just by talking to them, however, i came up with more ideas and more positive energy, so i decided to start improving the software by improving the performance first, then the features.

When we talk about a good quality software we talk about a software that runs on every version of Windows without problems, there are many variables that have to be in count, because the method changes from operating system to other (not completely but a sensitive part of it), so i found myself spending more time not only to find the method but to make it compatible with all versions of Windows.

QuickSCapture 2.0 comes with more languages, more stability and more awesome features.

 

Features:

Screen to capture:  if you are using two monitors, with this feature you can choose which screen is going to be captures and you can even capture both screens at once.

Crop:  with this feature you can select which part of your screen you want to capture.

Clipboard:  this is a very very useful feature, it allows you to copy the screenshot to your clipboard so you can paste it in Photoshop or Paint or any other image editor.

Mouse capturing:  most screen capturing software are not able to capture the mouse while capturing the screen, but not anymore with QuickSCapture!

Crop:  with this feature you can select which part of your screen you want to capture.

Image extension:  this allows you to choose which extension you want to save your image (PNG, BMP, JPEG, GIF, TIFF).

 

Now, to access settings we go to Control panel -> Quick Screen Capture or Start Menu -> All programs -> Quick Screen Capture

 

Languages:

Arabic
Dutch
English
French
German
Greek
Hungarian
Polish
Romanian
Russian

 

Requirements:

Microsoft Windows XP, Windows Vista, Windows 7, Windows 8.
Microsoft .NET Framework 4 or later.

 

Related Links:

Leave a comment

Why Windows Applications become slow after long period of inactivity?


Lets say you have an application launched and minimized for a long time (30 min). When you restore the application you will notice that it’s slow and sometimes “not responding” for a few seconds. It’s annoying, really!

I face this problem when I run applications that use too much memory (such as Adobe Photoshop, Visual Studio or….).

Basically, modern operating systems attempt to make the applications that are running as fast as possible – but they also allow many applications to run at once, more than all of their memory could fit into the RAM at once. So when the OS sees that a running  application needs to allocate a new page of memory, but RAM is full of pages already, it kicks one of the pages (preferring ones that have not been used in a while) to the hard disk, into a file called the page file.

When the application for which that page of memory belonged to attempts to access it, this is called a ‘page fault’ – the OS detects the page is not in RAM but on disk, and has to read it into RAM before execution continues. This is relatively slow since reading from the hard disk is slower than reading from RAM. If an application hasn’t been running for some time, it’s conceivable that ALL of its pages have been paged out to RAM – and so it will be slow until it stops hitting page faults.

SOLUTIONS:

1) Write an application to behave asynchronously – if a thread while doing things that trigger page faults, the program is also sensitive to other threads.

2) Deliberately touching each page of your memory to keep everything paged (Only recommended if your application is so important that it deserves to occupy RAM all the time, even when not used!)

3) Do not minimize your application, send it out of the screen (ex: set position -1000), and make a timer to activate the window each 10 minutes.

4) Buy more RAM.

Leave a comment

Orange Aperture – A better way to learn Photography


If you are interested in photography and want to learn about it, you probably have been googling to find the best and easiest way to do that, but once you’ve done that, I bet you realized it is impossible to find everything you want in one site, what leads you to browse more websites and read more articles.

All that happened to me, I gave a little thought, I am a web developer and I love photography, so why don’t I make my own website that contains the most important things about photography that you might find in different websites, it should be fairly simple, easy to navigate and anti-boring.
So I came to orangeaperture.aminedries.com, it took me three days to finish it.
The first day was for graphic design using Adobe Photoshop, the second day was to search for courses and information, and the third day was to merge design and information.

Design:
I opened Adobe Photoshop CS6 and created a new blank page, so I thought … what could be more interactive user interface of an educational website, as you can see, almost all websites use CMS, so when you read, you have to scroll down several times and it’s annoying and keeps your mind out-of-focus, so I had the idea, “Why do not I make an anti-Scroll ” website which really helps to keep your focus on the content and not the mouse wheel , so I started by drawing the main circle that contains the main details, then I added the other circles.

Coding:
After getting everything ready, I wrote a simple HTML page based entirely on the CSS file, because it would be preferable when the page loads and keeps the code clear.

After completing everything, I felt so proud to perform such work, but after testing, I realized that it is “dead” somehow, that means there is no interaction, then I thought about adding  some animations, and the best way to do this is using JavaScript.

Openly I thought it would be easy, but when I got to the middle of the road, I’ve faced some problems:
1 – JavaScript animations cause serious problems when changing CSS values and to solve this problem, I had to change most of my CSS code.
2 – Images do not load all at once, so I had to make my own JavaScript preloader.
The preloader simply loads JS files first, then CSS images and then displays the contents of the page.

Leave a comment

Things no Photographer wants to hear


Here’s an article about somethings no photographer (including myself) want to hear.
I decided to write this article because everytime i go out for some shots i face some of these things that i don’t (and any photographer) want to hear.

 

“Hey, take my photo!”

As a photographer, it’s nice to be able to decide exactly what I think should be captured, in the way that I like to capture it. That’s what I’m there for. Forced smiles and boring poses make for boring images that don’t capture anything, other than a person, or a few people, at a single event, which could be anywhere.

 

“Can you send me that?”

I’m happy to share photos with friends when they want them, but when someone you don’t know, or barely knows, asks you for a photo for free, that’s when it starts to cross the line. If you’re a professional, then you shouldn’t be afraid to ask for money, if the photo is good and someone wants it. How much you want to charge for a single photo is up to you, but if the photo is for someone that I know, then I usually offer a small discount. If they’re an adult about it, then chances are they will accept whatever you’re charging and won’t be offended, so don’t be afraid to ask. Selling a photo is a great way to start your day.

 

“I’ve got an idea for a photo…”

We as photographers have our own ideas and style, and choose how we take our photos very carefully. I will often give in and take the photo that someone else wants, but it can get to a point where the photo is going to come out horrible. Admittedly, it can be fun at times, but more often than not, it’s an idea that they’ve got from somewhere else, and that invariably means it’s not original, and possibly cliche. No one likes to be told how do their job.

 

“You must have a great camera.”

Having a good camera doesn’t mean shooting great photos, it’s all about you, many photographers have the same cameras but if you see the difference between their photos you get surprised.

 

“Do you mind bringing your camera?”

Usually, no I don’t mind, because i carry my camera with me everywhere i go, but the point here is not about if i mind or not it’s about i shot what i want and when i want!
If you’re a photographer then you know how could the light and many other variables effect your photos so it’s you who knows when it’s time for a good photo.

 

“You’re not allowed to take photos here…”

This is a real problem, I don’t tend to take photos where I’m not supposed to, so when I can legally take the photo, the last thing I want is for someone to tell me I can’t. You will hear complaints of ‘security issues’, ‘private property’ and even ‘threat of terrorism’, but these are largely unfounded. It varies depending on your country, because i’m living in Algeria so i know where i’m/not supposed to take photos, but in US, so long as you’re on public property, you can take photos of both public and private property. That means that so long as you’re standing on a public property, you can take a photo of most things, and there’s nothing that the owners of the private property can do.

Leave a comment

Free Visual Studio Express 2012 for Windows Desktop


 

When the Visual Studio 2012 free versions were originally announced, i was disappointed that there was no free way to make Console Apps, or Windows Forms apps, or anything for the Windows Desktop. (I’m sure i wasn’t the only one), as example S.Somasegar from The Visual Studio Blog said:

 

…we heard from our community that developers want to have for Windows desktop development the same great experience and access to the latest Visual Studio 2012 features at the Express level.

Today, I’m happy to announce that we will add Visual Studio Express 2012 for Windows Desktop to the Visual Studio 2012 family. This will bring to the Visual Studio Express family significant new capabilities that we’ve made available in Visual Studio 2012 for building great desktop applications.

 

So as we know Open Source projects need free tools like the Express SKUs. Even better that the Express Desktop SKU gets the new 2012 features as well.

Now Visual Studio has made Visual Studio Express 2012 for Windows Desktop available download it now free!. The great news is that this one SKU supports C++, C#, and Visual Basic together. With this one free version you can make WinForms, WPF, Console or Class Libraries with any or all of Visual Basic, C#, as well as Win32 projects, class libraries, and CLR apps using C++. You can also combine projects over multiple languages into a single solution. You can target both .NET 4.0 and 4.5.

 

Related Links:

Leave a comment

Quick Screen Capture V1.0


 

Sometimes we need to take a screenshot for something important on our screen, usually we press the key “PRTSCR” on the keyboard and then paste the screenshot in an Image editor and then save it as the extension that we want, well, i was doing it all the time, but after using it many times i noticed that it takes too much for just a screenshot, so i decided to make an add-in for Windows that enable me to save the screenshot directly by just one key press, so i made this great application called QuickSCapture®.
Now with QuickSCapture®, when you press the keyboard key (PRTSC) or (Print Screen) the application will automatically take a screenshot of your screen and save it automatically.

But where does it save my screenshots?, and what extension?

QuickSCapture® is customizable, that’s mean you can change the destination folder and the extension and even the language!

Languages:

Arabic
English
French

Requirements:

Microsoft Windows XP or later.
Microsoft .NET Framework 2 or later.

 

Related Links: