Monday, May 5, 2014

We need more women in IT: realization from AUW We Tech Fest

Last month I had a visit to a tech fest arranged by IT Club of Asian University for Women where I had to take a session on Ruby on Rails platform.  The thing I realized that woman all over the world are trying to keep their pace with the male dominated technology world. I wish I can romanticize the whole thing as a very easy to do thing for them. Irony is, it isn't.

In a developing country like Bangladesh, a girl always faces constant challenge in every aspect of her life. The way she should wear dress, the way she should think, even her career choice, her personal life - everything is being manipulated by the socio-economic factors. Our society loves to portray girl as a future mother,  not as a future leader in professional fields. Specially they face uneven hindrances with many double standards. Parents love to educate their daughters, not for being self dependent, respected human entity. in most of the cases, for getting a better husband. In this stereotypical set up, it is awe inspiring to imagine the girls of ours are going to lead the future technology world. I'm glad I could see the dream in their eyes.

I work in software industry, from my experience I've seen lower participation of women everywhere I worked, from startup to huge corporation, from Asia to USA, I've seen the tendency of thinking women as less of a technology people. For the lower participation, women are facing harassment in their workplaces. The github incident is just a fraction of the whole picture of global IT industry. Women are being harassed everywhere in the world.

The most important thing in tech world is how to introduce, innovate and improvise ideas. The way we can engage people from different backgrounds, it would be better to create a solution that could really make a dent to the world for the better future of us. We need more people - who can think out of the box, who have the courage of breaking the stereotypes, get out of their comfort zone and take the challenge to do what matters most. It's still tough for them to survive in school, the workplace and in case of entrepreneurship women have to deal with a lot more problems than a the male counterpart.

I'm not saying that there aren't any success stories, there are loads of female tech personalities  proving themselves everyday. I love being hopeful, but still I think we couldn't make this tech world a gender discrimination free place. After a few days of starting career, most of them can understand that meritocracy is a lie.


Courtesy: XKCD
Well, that's how we think. We love to imagine the male factor made us a better race, it's in our DNA that we try to overcome our frustration of our failure by creating a mindset which favors our way of thinking. We love being opinionated, being judgmental, bombast with our misconceptions, we are making the hostile world for the half of the human society. Treating a woman as a human being is still an issue in the developed world. I love to imagine a tech world without gender discrimination where we can be proud of our works, not of our gender. The spark I've noticed in the eyes of participants makes me believe that the day is coming.

I would love to share some snapshots from that event.
The panelists

AUW IT Club president is giving her speech
Convener and program coordinator Fahria Kabir



And the video footage is taken from youtube.





Monday, February 10, 2014

Redmine plugin asset pipelining

<%= stylesheet_link_tag :stylesheetname, :plugin => 'pluginname' %>

same convention is applicable for *.js files

example:

<%= stylesheet_link_tag :dashboard, :plugin => 'imeetdashboard' %>

Sunday, January 12, 2014

Redmine:: passing ruby variable to javascript

I needed to get user's first name from database and pass the value to a javascript variable in JSON format.

I wanted to exclude the root, so I used this line.


ActiveRecord::Base.include_root_in_json = false


then I declared a ruby variable named token which takes id and firstname attribute from user table,

  @token = User.all.to_json(only: [:id, :firstname])


In the erb file, I used the following line,

var tokenList = <%= @token.html_safe %>







Wednesday, January 1, 2014

Redmine: Change attachment size for file upload

log in to admin account, go to settings , then general.. then Maximum attachment size ... save it ....

Sunday, December 15, 2013

Redmine: Database table returcture in plugin

ruby script/rails d redmine_plugin_model Dods dod name:string description:string user:string created_at:timestamp created_by:string dod_to:string duration:integer
rake db:rollback
delete last migration
and table from db
ruby script/rails g redmine_plugin_model Dods dod name:string description:string created_at:timestamp created_by:string dod_to:string duration:integer
rake redmine:plugins:migrate

Saturday, December 14, 2013

Redmine:: import empty scaffold in Redmine

export RAILS_ENV=production


create a scaffold with correct database settings.
copy the model, view,controller into redmine plugin's app folder.
then open the route.rb file of redmine project

add this line
resources :dods  #here dods is my plugin name 

Wednesday, December 11, 2013

Redmine plugin creation in Ubuntu 13.10

export RAILS_ENV="production" 
ruby script/rails generate redmine_plugin testPlugin

Monday, December 9, 2013

Redmine: Retrieving all issues according to reverse chronological order

@issues  = Issue.order("created_on DESC").all

Redmine: Hiding the top menu before authentication

Change the following file from

file :: redmine/app/views/layouts/base.html.erb



<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>


to
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
 <%= render_menu :top_menu if User.current.logged? %>

Saturday, December 7, 2013

Redmine: Calendar object creation



 <% @year ||= Date.today.year %> 
     <% @month ||= Date.today.month %>
   
     
      
    <% end %>
   
   <%@calendarLocal = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :week) %>

  <%=render :partial => 'common/calendar', :locals => {:calendar => @calendarLocal} %>

Redmine: Redirecting a link to project's calendar page





<%=  link_to project.name,project_path(project) << "/issues/calendar" %> 

Sunday, April 22, 2012

Solution : gem install minitest /usr/lib/ruby/gems/1.9.1/gems/turn-0.9.4/lib/turn/minitest.rb:23:in `': MiniTest v1.6.0 is out of date. (RuntimeError) `gem install minitest` and add `gem 'minitest' to you test helper.

My system info was like:
OS: Ubuntu 11.10
Ruby: version 1.9.2p290
Rails: version 3.1.1
Minitest gem: 2.12.1
I've had the following error when I tried to run the test command for my rails application.

rake test
The error message was like this: (Click on the image to read the text)



change the gemfile of the project and add the following lines:


group :test do
  gem "minitest"
end

Had a quite good test experience. 
Happy coding.

Friday, July 15, 2011

Setting up sensors in linux

Just install lm-sensors with this command:

sudo apt-get install lm-sensors


after installation use this command to get the status of the cpu:

sensors

Friday, July 8, 2011

Changing brightness from ubuntu terminal

Try this command:

setpci -s 00:02.0 F4.B=10

value of F4.B can be changed (my limit is 99)

Thursday, June 30, 2011

Easiest way to determine "Follow Set"

Consider the following grammar:

E = TE'
E' = +TE' | e
T = FT'
T' = *FT' | e
F = (E) | id

Here,
First( E ) = { ( , id }
First( E' ) = { + , e }
First( T ) = { ( , id }
First( T' ) = { * , e }
First( F ) = { ( , id }

So, to get the value of Follow (E) we have to pick any one of Es from the right side of the equation. E is in the right side only here F = (E)|id , here right side of E is ')' which is a terminal. So Follow set of E would be ')'. And E is first one to get so $ sign would be in the follow set.
So Follow(E) = { ) , $ }

Now we have to get the value of Follow (E'). At first we have to take any one of the equations from the list where E' is in the right side. Lets take E = TE'
Here right side of E' is empty. So the Follow set of E' would be the Follow set of E (left side of the equation)
So, Follow(E') = { ), $ }

Now it's time to get the value of Follow(T). We can take E = TE', where T is in the right ride of the equation. Here the right consecutive value of T is E' which is a non terminal. So, we have to add it's first set's element to its follow set, adn if the first set has the value 'e' (empty set), follow set of the non terminal residing in the left side of the equation has to be added, Here the first set of E' is {+,e}, so the follow set of T would be {+, Follow set of E} that means {+,),$}

To get the Follow set of T' We can take the equation T=FT' and T' has not any right consecutive value, so the follow set of T' would be the follow set of the left sided non terminal T. That is {+,),$}

Follow set of F can be determined from the relation T = FT'
Here right consecutive value of F is T' which is a nonterminal. So the follow set would be {first set of T', if First(T') contains e add follow set of T}
Therefore, Follow(F) = {*,+,),$}

Friday, November 26, 2010

Ruby on Mint ;)

Ruby develoment:

To create new application , install ruby and gem and webrick from apt with this command

sudo gem install rails

install sqlite3 and its dev file from apt.

then create a sample application,

rails create blog

cd blog

rails server

Here rails generate controller home index

To edit configuration go to

app/views/home/index.html.erb

give this command:

rm public/index.html

Now, you have to tell Rails where your actual home page is located. Open the file config/routes.rb in your editor. This is your application’s routing file which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. This file contains many sample routes on commented lines, and one of them actually shows you how to connect the root of your site to a specific controller and action. Find the line beginning with :root to, uncomment it and change it like the following:

Blog::Application.routes.draw do #... # You can have the root of your site routed with "root" # just remember to delete public/index.html. root :to => "home#index"

The root :to => "home#index" tells Rails to map the root action to the home controller’s index action.

Now if you navigate to http://localhost:3000 in your browser, you’ll see Hello, Rails!.

For routing add get part

Blog::Application.routes.draw do

get "say/hello"

get "say/goodbye"

get "home/index" receive

Friday, May 28, 2010

EyeOS !!!! cloud in your local machine

My home cloud

EyeOS is an Open Source web desktop operating system written in PHP and AJAX. The main problem of setting up EyeOS is running the sql queries, cause there are several files containing sql commands. To set up EyeOS, you've to edit the settings.php file in mail directory and edit this portion according to your configuration.

// STORAGE
define('SQL_CONNECTIONSTRING', 'mysql:dbname=eyeos;host=127.0.0.1');
define('SQL_USERNAME', 'user');
define('SQL_PASSWORD', '123456');

you have to write your user name instead of "user" and your desired password will replace "123456".

Open mysql console and create a database named eyeos
Then go to /server directory/eyeos/eyeos/extras and open Calendar.sql from Calendar directory.
Run the queries in mysql console. If error is poped, then its okay, we've to come back to this queries after finishing other queries. Then openEyeosEventsNotification.sql file from Eyeos
EventsNotification directory.Remember, if any query shows error, don't be nervous, we will run them after executing other queries. Silmilarly run the queries of EyeosPeopleSQL.sql, EyeosTags.sql, EyeosUMSQL.sql, languageAdmin.sql, MailApplicationSQL.sql from EyeosPeopleSQL, EyeosTags, EyeosUMSQL, LanguageAdmin, MailApplicationSQL directories. Now it's time to get back to unexecuted queries of previous files.Run those queries and ready to use the cloud in your PC.


Run the eyeos from server and click on the New User link, register yourself and ready to take the taste of web desktop.


Screen shot of EyeOS

Friday, May 14, 2010

JDBC MySQL snippet

I'm working on my database project. Here is a tips to connect java with MySQL in Ubuntu. I downloaded MySQL Java connector with Synaptic. The downloaded file is mysql-connector-java-5.1.10.jar and located at /usr/share/java path. I copied that file to my java home's /jre/lib/ext directory, which is /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext

I created a database with this command in mysql :

create database test;
create table Name (FirstName char(10),LastName char(10));
insert into Name values ("Md. Rezaur","Rahman");

Now I used this code to test my connection:


import java.sql.*;

public class JdbcExample1 {

public static void main(String args[]) {
Connection con = null;

try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql:///test", "sajol", "123456");
if(!con.isClosed()){
System.out.println("Successfully connected to MySQL server...");
Statement s = con.createStatement ();
s.executeQuery("select FirstName,LastName from Name");
ResultSet rSet = s.getResultSet();
int count = 0;
while (rSet.next ())
{
String FirstName = rSet.getString ("FirstName");
String LastName = rSet.getString ("LastName");
System.out.println (" First Name = " + FirstName+ ", Last Name = " + LastName);
++count;
}
rSet.close ();
s.close ();
System.out.println (count + " rows were retrieved");
}
}

catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
}
finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {}
}
}
}

Monday, May 10, 2010

Lexical Issues

I was given some sample source files and instructions to build a lexical analyzer. Though it is not a complete project but this flex file works pretty good job to identify the lexicon. Here is the lex file and the generated files: