Querying JSONField in Django

If you are a Django developer and have to deal with kinds of data where you don’t know the datatype or the number of values to store, your best bet is to go with JSONField.

You get JSONField if you are using Postgres.

When you don’t know the schema of the data that you need to store, the first thing that comes to mind is NOSQL. However, that means sacrificing the comforts of SQL and ForeignKey for many (I personally am happy with both).

Using JSONField makes it a little difficult to do filtering on the data in JSONField.

Continue reading “Querying JSONField in Django”

Creating a content toggler like Gmail in Android

If you are an Android user and you use Gmail app; then you know this: If there are more than one mail in your thread, then you can touch on the heading of any mail and make it collapse and appear.

If you want to implement a similar content toggler then you can also do so. Continue reading “Creating a content toggler like Gmail in Android”

Thoughts on Suicide, Fear, and Life

This is what I stumbled upon today. The thing that I liked about it is that it expresses the fear of suicide more clearly than I have ever seen. I generally cave in by saying that I am afraid of suicide because of what will happen to others in my life after me? It is definitely a factor, a big factor I can say. The way I think of it, won’t it be easier for them, if my suicide didn’t looked like suicide but looked like an accident. It will be easier for them to accept the truth then. It will be less painful. The pain of knowing that your son, your brother, your husband killed himself is more than knowing that he died because of an accident(traffic, electrocution any accident). But is that all? Is that the only factor of the fear of suicide. No it’s not. The post expresses, my thoughts more clearly than I have the courage to do so myself. And YES I say the courage to express my feelings toward suicide. Because it’s a little weird, even though I think of dying, even though I think of committing suicide, I fear in expressing my true feelings. And I think it’s because of what anyone would think of me. It’s weird at one hand I think of dying and on the other hand I am ashamed in admitting my true feelings about it and thus cave in and lie.

Kefka Ponders

I was basically asked two questions: Are you afraid of dying? Is that fear why you’re still here?

As to the fear question, the short answer is yes, but it’s more complicated than that. However, that fear is not why I’m still alive. But that question certainly got me thinking… Why am I still here?

I think what I hate most of all is having to deal with all of this in the first place. I don’t want to have to deal with suicide. I don’t want to have to deal with death. But I must because I have something else I have to deal with, something I never wanted to deal with, something I wish I never had: life.

But, oh, how I so do not want to deal with any of this! I want to be spared from life, but in order to do that I must face…

View original post 800 more words

Creating Wallpaper Package (deb)

Disclaimer :

I am writing this post because what I found on the internet is pretty outdated or simply doesn’t work. It may be only me who couldn’t find new updated articles for this, but anyway I am going to write this post. Maybe because I haven’t written anything in months.

How to create an install-able wallpaper package for Ubuntu

Motivation

If you are a Ubuntu user, you may have noticed that changing the desktop background also changes the background of the login screen. I like this. However you may have also noticed that the login screen reflects your choice only when you choose one of the default wallpapers, if you choose some other wallpaper then you won’t see the wallpaper in the login screen, even when it is set as your desktop background. I wanted the wallpaper of my choice to be used as the desktop background as well as my login screen.

Continue reading “Creating Wallpaper Package (deb)”

jQuery to Jump Start PHP – SitePoint’s give-away

jQuery
jQuery

I have recently started developing a website. I wanted it to be filled with things I don’t know yet. So going to tutorials and articles on the internet was an obvious choice.

Searching for a method to make the div elements sticky after a certain amount of scrolling ( in other words , window-scroll + scroll-position + display:fixed ), came up with results containing the usage of JQuery. Now to be fair I have never used JQuery. Like never ever. Although I have worked on JavaScript and HTML5 Canvas. Continue reading “jQuery to Jump Start PHP – SitePoint’s give-away”

Samsung Galaxy Star

I haven’t put a anything over here since a long time. And there is a reason for that. I was busy playing with my new android phone. By playing I mean hanging around looking for apps trying then out. Enjoying features of Android (yeah okay gaming was involved too), but that’s what I do. I play with other people’s implementation look at how good the work they have been doing. And then I keep on learning to make myself able to do the things which are already being done by others and if possible better 🙂

image

Anyways I bought a Samsung Galaxy Star (GT-S5282).
It’s got a single core 1.3 ghz processor. 2 GB internal memory. 512 MB Ram. 802.11 b/g wifi.
2 megapixel camera. No front facing camera. A 320X240 resolution 3 inch screen,  with a specification of 133 dpi.
I bought it during summer holiday for 5K. It comes with a USB cable which helps in developing for android.

image

An interesting thing, I couldn’t set my bsnl broadband modem to open the port for play store used in Android. However here in Jalandhar with the Internet connection I use I didn’t had any problems with play store, but the irony is I couldn’t get ports to open for my torrent clients.
I have been using the phone to test the apps I have been developing. The simulator for android is too slow. So having a phone to do testing is a life saver.
I have been spending my time learning android and java. I will put about my first simple app. However I am also thinking about making a game for Android. However I don’t even have a plot /type in mind.
P. S.
Flatland book seems interesting. Let’s see if I can find my way to a game in it.

node.js

node.js
node.js

As it’s website says node.js is :

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Continue reading “node.js”