Posts

Typeahead Implementation in PHP/MySQL

DEMO First, you need to include all the necessary files for this to work. Place these three files in the head section of your page.. jquery-1.10.2.min.js  bootstrap.min.js bootstrap3-typeahead.min.js Then, this script: $(document).ready(function () { var objects = []; var map = {}; $('#person').typeahead({ source: function (query, process) { $.ajax({ url: 'get_person.php', type: 'POST', dataType: 'JSON', async: true, success: function (data) { objects = []; //resets the objects map = {}; //to avoid duplication $.each(data, function (i, object) { map[object.full_name] = object; objects.push(object.full_name); }); process(objects); } }); }, //end source ...

ASDFJKL;

Image
Everytime you tell girls you like them, they always asked "Why?". And I always go with the reason, "I just like you". And then, end of conversation. Oh girl, I'm sorry. If you can only dissect my body and see what I felt about you. You'll be spending lots of hours reading all my reasons. Because sometimes with my limited source of words and vocabulary, I can't find the exact word. So, maybe you can? "That feeling between like and love." Hmmmn, getting there? Nah, I'm not fond of words. It's just sad that women love words. I know that you need to spit it out sometimes. Unfortunately, I'm not good in speaking. I haven't confess personally, like expressing my feeling like it's the end of the world. I haven't done that. And I don't have plan doing it except in my wedding vow. When I tell you I like you , it's always true. And it means I like every details about you. The soul within your body and all the...

...now she's gone!

Image
I just told her I like her, and now she's gone(not gone, gone). Am I that powerful? hahaha Well, I am not that proud of myself but I'm always fine with it. Like really, as much as I want her. I just don't beg. It's not my style and I don't even know how to please/court a girl. Which makes me wonder, how did I get a girlfriend before? :) Anyway, 2015 is coming! I have these list; a new year's resolution: I'll try to go to church as often as possible. Maybe be more mature in interacting with people esp. girls. HAHA Mind OVER Emotion thing. I overthink a lot. I'll work harder. I want to finish my Master's Degree as soon as possible to get married. HAHA I'll sleep early like 10:00 PM. Live healthy? Less caffeine and more water. I guess that's it! I am happy with my life right now. What more can I ask for? Ahh there's one thing, I want to learn Nihongo. I got plans , you know? haha

My Sweet...Moon!

Image
When this song hits me, I listen to it all over and over again. It's a bit sad but inspiring. I really love kids, like dreaming of having one right now. But I also have this in my mind that I'm not yet capable of giving her(I want a girl BTW) a very beautiful life. I love the man you're making me Yeah, every day I'm gonna prove there's nothing I won't do for you Such a great love for his child. OK, I should take up guitar lesson now 'cause I'm gonna write  a song for my future Naleigh Moon.

Export Data from QuerySet as Excel File in Django

Let's say you have this function in your views.py: def funtion_name(request): if request.method == "GET": get_id = request.user.id ... ... ... args = [] kwargs = { 'landproperty__sownerid__id': get_id, 'geom__distance_lte': (pnt, D(km=kmdistance)), 'narea__lte': getarea } mm = YourModelHere.objects.filter(*args, **kwargs).values_list('fielname1', 'fielname2', 'fielname3','fielname4') request.session[0] = mm return HttpResponse(json.dumps(list(m)), content_type='application/json') In order to get or pass the QuerySet from this function, you need to store it in a session as shown above. Here's how to create an excel file: def create_excel(request): book = xlwt.Workbook(encoding='utf8') sheet = book.add_sheet('untitled') default_style = xlwt.Style.defa...

I like her a lot...

Image
I like her a lot that I stop and just stare her smile like forever. What the F***! I always love cute people and those who smiles like an anti-inflammatory capsule. Women really are powerful  being! Like drugs, they can ease pain and worsen it. They're like a double-edge sword. :D Too bad, I'm so pessimistic! But I think, just this time I'll be hopeful. hahaha Like I always say, for a long time I don't like being close to a woman, like having a romantic closeness. Sounds gay! hahaha It's a choice! I do date sometimes but I just thought that I don't need a girlfriend that time. Too many reasons, right? I guess all those reasons won't matter if your feeling towards that girl is greater than those reasons. It's all about their weight. And the song for this babble,  

#MusicPlaylist 1: Getting a Good Night's Sleep

Image
I usually don't play music when I want to sleep 'cause sometimes I sing along with it. I have to tell you this Cause my heart goes wild -Russian Red