7.8.12

I didn't post for a very long time!I had alot of sketches though but didn't had the time to finish and publish them..But i hope to come back now with more posts!Also i'm gonna stick to a new format in my posts thati think is better to read. maybe i'll also update old posts to this format.I just started learning Ruby on Rails few weeks ago and ran into a very weird problem.

Environment:

I'm using Windows 7 64bit with RubyMine 4.5.1, Ruby 1.9.3, Rails 3.2.I was able to install all this working environment on my Desktop but not on my Laptop..

Problem:

I encounterd the following errors on cmd & RubyMine:

C:\Users\Danpe>gem install rails

WARNING: Error fetching data: Errno::ECONNREFUSED: No connection could be made

ERROR: http://rubygems.org/ does not appear to be a repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed
because connected host has failed to respond. - connect(2) (http://rubygems.org/yaml)

I got all these kind of weird errors!

Research:

so i started looking around the web and around my PC network settings.

I double checked my Internet Options to see that there is no proxy enabled, and there was none!

I opened cmd and typed SET to see my Environment Variables:

C:\Users\Danpe>SET

ALLUSERSPROFILE=C:\ProgramData

APPDATA=C:\Users\Danpe\AppData\Roaming

COMPUTERNAME=DANPE-ZENBOOK

ComSpec=C:\Windows\system32\cmd.exe

HOMEDRIVE=C:

HOMEPATH=\Users\Danpe

HTTP_PROXY=192.168.0.1:8080

As you can see there is an Environment Variable for HTTP_PROXY...

Solution:

Go to Start (WinKey) type Edit the system environment variables and you'll get this window:

Click on Environment Variables and then remove HTTP_PROXY from System Variables!

2.9.11

Environment:

Problem:

So i face a really annoying problem today,
I had an array with 400 lines written in C#.
The problem is that, the list was reversed from the order i wanted.

Example:

The array i have:

The array i need:

Like i said it's a 400 lines array...

Research:

I really needed this reversed, i tried Notepad++ with several plugins like TextFX without any success, i actually found out that it's possible to do it by recording a Macro in the Notepad++, but it's like not my thing.

So i used my best friend! C# :)

I'll make a quick explanation of what i'm doing and then just paste the code.

Solution:

So i made a Console App that gets a file path from the application arguments.

It reads all the lines and pushs them into a Stack then writes it to a new file using Pop :)