Creating Local Git Repositories

I accidently delete all my project stuffs by rm -rf.

Yeah I should be more careful. But it happens, this is life. Well the bad thing is that that folder also serves as my git repository. So I lost all my hard work. To avoid that I deceide to set up another local folder to serve as a remote git repository. The next time I will have a working copy there. Hope....

Let us start

1. make a directory:

mkdir ~/gitrepositories/pathogenbase.git

2. enter the new create diretory and initialize the repository

cd ~/gitrepositories/pathogenbase.git

git init --bare

3. now we have a working "remote" repository. We are ready to make a local clone:

cd ~

git clone ~/gitrepositories/pathogenbase.git pathogenbase

4. now we have an empty clone, at my home directory

5. creat a file touch file1

6. git add .

7. git commit -m "create file1"

9. git push origin master

Creating Local Git Repositories

I accidently delete all my project stuffs by rm -rf.

Yeah I should be more careful. But it happens, this is life. Well the bad thing is that that folder also serves as my git repository. So I lost all my hard work. To avoid that I deceide to set up another local folder to serve as a remote git repository. The next time I will have a working copy there. Hope....

Let us start

1. make a directory:

mkdir ~/gitrepositories/pathogenbase.git

2. enter the new create diretory and initialize the repository

cd ~/gitrepositories/pathogenbase.git

git init --bare

3. now we have a working "remote" repository. We are ready to make a local clone:

cd ~

git clone ~/gitrepositories/pathogenbase.git pathogenbase

4. now we have an empty clone, at my home directory

5. creat a file touch file1

6. git add .

7. git commit -m "create file1"

9. git push origin master

Create Django Dynamic Hyper Links and get parameters from them

I was trying to use a template to create dynmic hyperlinks and get parameters from them. Searched online and found two ways to do that according to what types of the url you are creating

type 1: http://localhost:8000/pathogen/detaildemo/28

type 2: http://localhost:8000/pathogen/detaildemo/?id=28

For type 2: if you want to get the value of id, 28 in this case, you  will have to use request.GET.get('id')

in template file you have such code to create dynamic hyperlnks


                {% with table.rows as rows %}
                    {% paginate rows %}
                    {% for row in rows %}
                       
                        {% for value in row %}
                        {{ value }}
                        {% endfor %}
                       
                       
                    {% endfor %}
                    {% show_pages %}
                {% endwith %}

 

in url file you have

urlpatterns = patterns('',
   
 .......
    url(r'^detaildemo/$', views.someDemographics, name = 'show_some_demographics'),
.......

)

in view file you have

def someDemographics(request):
    isolateId = request.GET.get('id')
    initial_queryset = Demographic.objects.filter(isolate=isolateId)
    demographicTable = DemographicTable (
        initial_queryset,
        order_by=request.GET.get('sort', 'isolate')
    )
    context = {
        'table':demographicTable,
        'a_title':'Demographic',
        'b_title' : '../demographicsearch/',
       
    }
    return render_to_response(
        'pathogen/detaildemographic.html',
        context,
        context_instance=RequestContext(request),
    )

 

I am working on type 1 now.

Create Django Dynamic Hyper Links and get parameters from them

I was trying to use a template to create dynmic hyperlinks and get parameters from them. Searched online and found two ways to do that according to what types of the url you are creating

type 1: http://localhost:8000/pathogen/detaildemo/28

type 2: http://localhost:8000/pathogen/detaildemo/?id=28

For type 2: if you want to get the value of id, 28 in this case, you  will have to use request.GET.get('id')

in template file you have such code to create dynamic hyperlnks

<tbody>
                {% with table.rows as rows %}
                    {% paginate rows %}
                    {% for row in rows %}
                        <tr>
                        {% for value in row %}
                        <td > <a href={% url pathogenbase.apps.pathogen.views.someDemographics %}?id={{row.isolate }}>{{ value }}</a> </td>
                        {% endfor %}
                       
                        </tr>
                    {% endfor %}
                    {% show_pages %}
                {% endwith %}

</tbody>

 

in url file you have

urlpatterns = patterns('',
   
 .......
    url(r'^detaildemo/$', views.someDemographics, name = 'show_some_demographics'),
.......

)

in view file you have

def someDemographics(request):
    isolateId = request.GET.get('id')
    initial_queryset = Demographic.objects.filter(isolate=isolateId)
    demographicTable = DemographicTable (
        initial_queryset,
        order_by=request.GET.get('sort', 'isolate')
    )
    context = {
        'table':demographicTable,
        'a_title':'Demographic',
        'b_title' : '../demographicsearch/',
       
    }
    return render_to_response(
        'pathogen/detaildemographic.html',
        context,
        context_instance=RequestContext(request),
    )

 

I am working on type 1 now.

CSS Strikethrough

I was wondering what's the name of the cross-line in CSS file. After consulted with my coworker and knew it is strikethrough. However when I put the trikethrough in the css file it does not work.

The true name is: line-through.

To make strikethrough text using CSS, use text-decoration: line-through in your style sheet.


CSS Strikethrough

I was wondering what's the name of the cross-line in CSS file. After consulted with my coworker and knew it is strikethrough. However when I put the trikethrough in the css file it does not work.

The true name is: line-through.

To make strikethrough text using CSS, use text-decoration: line-through in your style sheet.


Switched back to Blogger

Couple months ago, I switched to WordPress because Blogger has less function I need comparing to WordPress. Today I moved back to Blogger because I want to use my own domain name with my blog and found out that WordPress charge $12/per/blog for using your own domain. That's sucks.....
I moved all of my old contents to Blogger, by doing the following steps
1. Login to your wordpress account and navigate to the Dashboard
2. From manage tab >> export >> xml file
3. Save the xml file into your local machine. At this moment if you tried to import this xml file into Blogger you will fail, because the structures of the xml files these two websites using are different
4. go to this website to format the xml file: http://wordpress2blogger.appspot.com/ and re-import to Blogger


Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...