Friday, October 7, 2011

Matlab Gmail

Matlab can send an email (maybe can't make a call, though). Here is how to do it with Gmail. I've just played with this and checked this works. Still don't know when to use it, though. (this is supposed to be used by people who work on long simulation)

-----------------------------------------------------------------------------------

% Define these variables appropriately:
mail_address = 'linli@obasic.net';            % My E-Mail Address
user_name = 'linli';                          % My Username
password = 'likeiwilltellyoumypassword';      % My E-Mail Password
smtp_server = 'mail.obasic.net;               % My SMTP Server
 
% Then this code will set up the preferences properly:
setpref('Internet', 'E_mail', mail_address);
setpref('Internet', 'SMTP_Username', user_name);
setpref('Internet', 'SMTP_Password', password);
setpref('Internet', 'SMTP_Server', smtp_server);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth', 'true');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port', '465');

-----------------------------------------------------------------------------------
(copy from the link)

http://www.mathworks.fr/help/techdoc/import_export/f5-136211.html
http://obasic.net/how-to-send-e-mail-from-matlab

Wednesday, September 7, 2011

Nationality

Iranian has difficulties to install in western countries... There is a Iranian intern student in our group. He is looking for a job in the oil industry, hopefully in France, as he studies reservoir engineering, but large western oil company do not want to hire any Iranians. Even if Iranians are hired, they don't have all access to the information in these companies. They refuse even to receive his CV so he cannot have any contacts.

In our company there are Iranians but they are ok, i.e., once they are hired, there are more or less protected by the local labor law.

He said his plan is to go to Canada, if he can't get a job.

Sunday, July 3, 2011

Apartment (3)

What kind of apartments do you want to live in? Apartments in Paris varies enormously one to another. They are roughly categorized to 2: old style apartments and modern style apartments. Old style apartments are clearly different between 1900's 1930's, and modern styles 1960's, 1970's, 1980's, 1990's and 2000's. The good points of old apartment is the beauty of its building. The good points of modern building is the comfort of inside. It is not surprising to have trouble in the old apartment, such as the leak of water, lack of hot water, noise from neighbors etc.

- Old or modern
- Shower
- with elevator or not

1. Look for an apartment on web sites
or . Se loger is the site where you can see the apartment offered by agencies, on the other hand pap is the site for individual deal.

2. Call the agent and make an appoint of the visit
You should check every day and if you find a nice one you have to call soon. The apartments will be rent within 2-3 days after it is come up in the market.

3. Visit apartment with the agent and make a decision
Visit can be a private visit and a group visit. Generally the time limit to choose is at the end of the same day of the visit.

4. Give your profile documents to the agent
Generally, there are a lot people who want to live. This is the deal between . Owner ask agent to find a good renter because sometimes renters stop paying the rent so owner want a reliable renter. Agent looks for applicants for the apartment and give the owner the profiles of the applicants.


Sunday, June 26, 2011

Read csv file in C

Here is the C code to get csv file data.

-------------------------------------------------------------------------------------
#include "stdio.h"
#include "stdlib.h"
#include "math.h"

int main(void){

FILE *fin;
float a=0;
int nb_data = 60, i=0;

float* ReadArray;
ReadArray = (float *)malloc(sizeof(float)*nb_data);


/* open file */
if( (fin=fopen("TestData.csv","r")) == NULL ){
printf("file cant open\n");
exit(1);
}
/* get data one by one */
while( fscanf(fin,"%f,", &a) != EOF )
{
/* print */
ReadArray[i] = a;
printf( "read value=%f\n", ReadArray[i]);
i++;
}

fclose( fin );
}
-------------------------------------------------------------------------------------

French tax return

French citizen have to pay the taxes by oneself. There are two types of taxes - 1) taxes drawn from salary which companies pay so people don't have to deal with and 2) taxes I have to deal with by myself.

1)

2)
- 所得税 income tax
3回に分ける方式と、毎月払う方式(銀行口座からの引き落とし)から選べる。
今年の分は、前年の給料に基づいて支払っていき、年末に調整をする。

In this site (http://www.impot.gouv.fr/), we can quickly simulate the sum of tax we need to pay.
Generally, the amount corresponds to one month salary and proportional to the working period. If you started to work in June, you'll have to pay half of your one month salary.




- 住民税 resident tax
住んでいる地域と、アパートの大きさによって、額が決まる。
パリで30程度のstudioなら、500ユーロぐらいとのこと。


[ref. 1] Other taxes in France
- Consumption tax
5.5%。TVA(Tax à la Valeur Ajoutée) という。

[ref. 2] Tax in Japan
収入is brut、所得is net.
所得税が実際に課税されるのは、所得から社会保険料(国民年金、厚生年金、健康保険等)や扶養控除、基礎控除等の各種控除を差し引いた後の金額

Saturday, June 25, 2011

Antivirus soft

Recently bought McAfee antivirus software. As the package is written in French, I expected French version for the software itself. However once it is installed in my PC, all explications were in Japanese. This means that the software somehow recognized the mother language of my PC and adopted to the language. In fact, I wanted to see French interface just for my interest and for practicing my French... this is a shame.

Sunday, June 19, 2011

Velib

Velib is much easier to use than I have been expecting. This is my impression after taking a ride for the first time since I arrived in France. Very comfortable to ride in.

Here are the problems. First, in France it is not allowed to use the walkway for bicycle so people use the car road like motorcycle. So there are bicycles in the big intersection and rotary between cars. Second, there are many one-way street in Paris and bicycles, of course, need to follow it. People have to use other non direct streets. Then how can you find it is one-way or not because there are no signs in many cases?? The most common way is to check the direction of parked cars, or if there are two traffic light on the both sides of the street, the street is one way.

Today there are 1800(!) Velib stations in/close to Paris and they are placed about every 300m.