So if you want to import a bazaar branch into git how do you do that?
Following this amazing tutorial which works in a very cool and smooth way
Check it out!
It was really handy π
An Eye to the World, an Eye to the Net
So if you want to import a bazaar branch into git how do you do that?
Following this amazing tutorial which works in a very cool and smooth way
Check it out!
It was really handy π
If you use LaTeX and sometimes want to override the TeX macro to get your figure right there you can do it.
You can use the exclamation point !
\begin{figure}[!ht]
\begin{center}
\includegraphics[scale=0.50]{image.png}
\end{center}
\end{figure}
However the results is not really nice as when Tex take care to do the layout. So the win-win solution would be to have Tex taking care of the layout, but force it to put all the figure that belong to a section within that section.
Well that’s pretty easy and the command
\clearpage{}
Just does the trick.
If instead you refer to a figure but instead of the number of the figure you can read the number of the section, this is because you have misplaced the caption with the label.
The label has to go after the caption, otherwise it will refer to the section not to the figure.
Right way:
\begin{figure}[htb]
\begin{center}
\includegraphics[scale=0.50]{image.png}
\caption{A wonderful image!}
\label{fig: image}
\end{center}
\end{figure}
Note the relax [htb]
. LaTeX will take care of the position for you.
I just discovered that in using pylab you can plot an array or list of number vs the list lenght by default.
Let’s say we have a list of point like [2,2,3,4,5,5,6,10, 23,45,58,42,12]
points = [2,2,3,4,5,5,6,10,23,45,58,42,12]
well to plot this you just have to
pylab.plot(points)
and this is the results:
The whole script in python
import pylab
points = [2,2,3,4,5,5,6,10,23,45,58,42,12]
pylab.plot(points)
pylab.show()
The last one is needed to show the window, which will happen automatically if you are running the script using ipython with the pylab option.
I just discovered by chance. I always thought that to plot you need x and y, but of course it’s possible to infer the x if you just one to plot only the points, cause each point in the list has a “Cartesian coordinates” embedded, i.e. [0,2];[1,2];[2,3];[3,4];… etc.
Today I released the first public release 0.1.0 of NeuronVisio.
NeuronVisio is a GTK2 user interface for NEURON simulator.
NeuronVisio connects with NEURON using the new python NEURON interface.
The code is on github (which I discover create automatically a tarball for you when you tag the package… sweet π )
If you found a warning like:
GtkWarning: Ignoring the separator setting
when you are playing around with glade and pygtk it is because glade create any dialogue with the “Has separator” set to No, instead Yes.
More info in this #587288
On a side note this solved the first bug/warning on neuronvisio π
HIH someone π
In python is possible to import _everything_ from a module in the root namespace with
from module import *
Just don’t do it.
If you curious why look here
The good way is
import module
Tracker is under a massive refactoring phase for the release of the 0.7.x series and there is a lot of work carried out. So to catch up and to give better info we started to work on the website to update the info over there.
Look at our new shiny development page where you can find the details and how to install tracker from the source with all the packages that you need in a debian based distro. BTW if you know what you have to install in Fedora and friends just let us know and we are going to add them in no time.
Anyway, I started this post to highlight another hint on how to use git (and where to find later when I will forget…)
The good news is Tshepang stated to contribute to the tracker website (source tracker website – if you feel like patches are always welcomed and yes you have to download all the gnomeweb-wml module).
Before today I always used git as a stand alone developer, but now I had to figure out how to track the changes in the master form the other projects, without losing all my work and the patches.
So here is the solution of this riddle.
From the master create your own branch
git checkout -b WIP
apply the patch and work on the branch
git am 0001-super_patch.patch
hack hack hack
git commit -am "A lot of good stuff"
Now you ready to go. You want to put back your changes in the master and then push on the server.
How to do that?
You must rebase your local Work In Progress branch with the local master that track the remote master. eh? yeah. Let’s go through the command:
git checkout master
#Back in master
git pull
# Grab all the new updates
git checkout WIP
# Back in WIP
git rebase master
#The Black magic. Commit all you change on top of the master ones
and now you good to go:
git checkout master
# Back in master
git merge WIP
# It’s gonna be a fast foward merge so no commit message will be created; that is exactly what you want, because the meaningful commits’ messages are in the WIP branch and a commit with the message “merged WIP” is not that interesting.
git push
# And we go online. π
On a side note:
gitg is your friend.
Yesterday one of my housemate asked me if I was able to make a partition of his hard-disk.
He has a 40 Gb drive and wanted to make two partitions, one only for windows and one only for the data.
To accomplished that I just had to fire up an ubuntu live cd (It was the 7.10 version, the one that I had handy at that time) and I used gparted to do the job.
It worked like a charm.
Open a terminal and then write
sudo gparted
to start it.
We were able to resize the old partion from 38 Gb to 12 Gb, create a new one of 28 Gb and format it with the ntfs filesystem.
Oh yeah, because this friend is still using windows.
Then we boot up in windows and the system recognized the two new partitions (C: and E:) and it was happy to use them.
All this thanks to an Ubuntu Live system. And in 5 mins. π
If you have to set up a public repository with git you can follow the instruction found on the git-core tutorial
(Hint: Search for “Publishing your work”)
Things to keep in mind:
project.git
and it’s a directory even if you can be mislead to think it’s a file for the extension (.git). Well, it’s not a file.The steps to do that:
mkdir project.git
GIT_DIR=my-git.git git init
git push <public-host>:/path/to/project.git master
On this page on the GNOME website I found how to use git properly if you are using it as a gateway to a svn:
git svn clone _svn_server_location
#Clone the repositorygit svn fetch
#Download the stuffgit svn rebase
#Merge the updates with the currentgit checkout -b myfeature
#Create a local branchgit commit -am "changed stuff"
# Commitgit commit -am "changed other stuff"
# Commitgit checkout master
# Change to master branchgit merge --squash myfeauture
#Merge myfeature to mastergit commit -am "merge the feature to the master"
git svn dcommit
# Commit everything on the svn serverMore info about git in the previous posts