Why to-do apps for JavaScript frameworks

Leave a comment

Somehow whenever I see some new Javascript framework, most of them always have the same To-Do application as their showcase sample. If someone/ some company is going to build a new framework and going to tell me, we built an awesome framework you can do so much with that and then they go ahead and give me a sample of a To-Do application, anyone would be like meh!!

How difficult can a to-do application be that the said framework is going to make your life much easier.

Just wrote a small to-do app myself, it only needs 1 single line of javascript, yup you read that right.

All the things you need are –

  1. Text area for the To-do
  2. Button to add it.
  3. Checkbox to mark the todo complete.

The addtodo() function inside the <script> tag is what does all of this.

I feel designers, developers need to come up with something more innovative than a todo list app. Just saying!

Script Processor in EDQ is cool

Leave a comment

So I started with a bit of work on EDQ and I must say its a pretty neat tool. Basically Oracle EDQ stands for Enterprise Data Quality where you get to fix all the invalid, inconsistent and simply put bad, very bad, very very bad data.

I was just playing with it a bit and found the script processor very handy since I could do anything I want with use of a scripting language like javascript or groovy.

I just wrote a sample script to have convert the currency values of products from one currency to another. Maybe this could help someone writing a script for the first time in EDQ.

Here is what my data looks like –

I created a quick web service on mockable.io. It is a pretty neat tool where you can create a web service to output any data that you want to, here is the sample data I created –

And finally here is the code of the script processor which will convert the values to specific currency, the data used is pretty self explanatory.

There are few things which I am sure, you would know if you have used EDQ before.

  1. All inputs and outputs have to be used in the form of array. input1[0], input1[1], input1[2] and so on will be automatically mapped with your columns which you would have selected.
  2. There can be only one output of the script and you need to store it in output1 variable only.
  3. You can simply ignore the logic of Currency conversion in the code, since this is for a very specific task.

All this was just to show you how you can manipulate data with the use of Web Services in EDQ. Hope this helps πŸ™‚

A blog a day challenge

Leave a comment

I am going to start with the blog a day challenge. Simply put for the next 100 days I am going to write a blog every single day without fail on any topic.

I need to invest a considerable amount of time in learning new things for career growth and my own as well. Having a regular blog should help in prioritising the activities in that direction.

How do we start?

Leave a comment

Hi Guys

Long time no see πŸ™‚ sometimes I feel like I should tell that to myself as well.

So how do we start, we start by noting down what we need to do, and while we are at it, we note down what we didn’t write in the first place and also few more things which you should have thought of before. To do things is to improvise, learn and also to keep on adding more things to do, obviously a to-do list never ends, because to do something or to learn something, you need to do a lot of things πŸ™‚

To understand that lets write a blog post πŸ™‚ This is going to be quick. All you need is rails setup in your system.

Lets start with creating a blank app

rails new todoapp # this will create a blank slate for you to work on

rails g scaffold todo task:string complete:boolean parent_task_id:integer # this will create your model/views/controller/migration etc etc files which you will do the work for you

rake db:migrate # if this throws an error, you gotta do “rake db:setup first” this will create your database migration and the schema for todo tasks.

Now we need to build something like the below to sorta have a parent child relationship between the tasks. Why ? just read the 2nd para again from top.

Parent Task 1
—- Child Task 1
—- Child Task 2
Parent Task 2
Parent Task 3
—- Child Task 1
——– Child Task 2

In your new and shiny app/models/todo.rb add these two lines to create the parent child hierarchy.

has_many :child_tasks, :class_name => 'Todo', :foreign_key => "parent_task_id"
belongs_to :parent_task, :class_name => 'Todo', :foreign_key => "parent_task_id"

Now a bit of magic is needed to the views to allow us to easily select the Parent tasks for any child task.

Head over to your app/views/todos/_form.html.haml or *.erb file depending on the templating engine and change the f.parent_task_id to a collection_select

.field
= f.label :parent_task_id
= collection_select :todo, :parent_task_id, Todo.all + [Todo.new], :id, :task

This will allow us to choose a parent task, whenever we are creating a new task with – not a very bad hack? πŸ˜›

Finally in the show and index page, we need to display the parent task.

replace your todo.parent_task_id with
Todo.find_by_id(@todo.parent_task_id).task rescue "No Parent Task"

And the end result is tada!!!

Todoapp

Where do we belong!

Leave a comment

Hey guys!

Writing something down after a long time. I always get these urges to write something, but never do that due to lack of time or investing time in other worldly problems.

Of late, I have been thinking about the direction in which my career is heading. Even though I like my current job, understanding how large manufacturing companies work and implement oracle for them. However it is not entirely what I imagined myself to be doing when I was a kid.

Ofcourse when are are younger, we imagine us to be a lot of things, lots of dreams and then when you grow up, we stop chasing the dreams and start running to just get the things done in front of us. Somehow the tasks at our hand are too pressing and we forget what we always wanted.

All of us want to find our place in the world. Some find it, some make one and some just are happy with what they get. What if you are one of those, who have to make a place for yourself in the world and it is always there in the back of your mind. Even if you choose to ignore it, your sub conscious mind keeps on telling you, you don’t belong here. There are places you must go to and see for yourself, where you fit and if you don’t make a place for yourself. I have always loved Anime series. You get to learn a lot from them.

One of the Characters in the show Nanatsu no Taizai says, if I live long enough, maybe something will happen to me, I am waiting for that something to happen. We long for that something to happen, but it never might. We have very limited time in our hands and cannot wait an eternity for that moment. We have to work towards reaching that moment. We can only wish.

With that wish in my ghost, I will try to find the place where I belong.

Stackoverflow ?

Leave a comment

Hey guys!! wassup!

I have been a member of StackOverflow since 4-5 years now, but just recently, I thought, why do I search for answers and not help others with their questions. So I have started answering questions on SO as well. I try to help people with SQL, Web Development related queries and related techs.

Now that I think about it, I am not entirely sure, why I never tried it in the first place, but then again, better late than never. Planning to be active and try to help as many people I can πŸ™‚ come on now, an answer from you, makes their day at office easy πŸ™‚

So yeah! guys go out there and try and be active at communities on stackexchange.

You can find me on SO @ http://stackoverflow.com/users/1013142/sudipta-mondal

Things that matter to me!!

Leave a comment

I have always been thinking, about what matters to me the most. I like coding, I like sweet things, I like to be around people, cute things. I like soft and fluffy things πŸ˜› I like my laptop a lot, like really a lot. I can marry it. If I don’t get to touch my laptop for a few days, I get withdrawal symptoms and after a few days, I just want to hug my laptop πŸ˜₯

Too many things interest me and I feel, I can’t just keep my head into a single thing, I wanna try out so many things out there. I wanna try A, I wanna try B, till I get hang of B, I wanna try out C or whatever. I am random. ADHD perhaps.. not sure.

I used to live in one of the major cities in India and never ever lived or cared too much about people outside of that big city. Neither did I know much. Thank fully I got to work in a company, where I got to meet people from all over India. I have absolutely loved it.. There are so many people from so many places, with so much varied experiences, talent.

I have learned, I am not smart, I am definitely not intelligent. people are out there, some who think like you, some who are different, some who hate you, some whom you like. But people, so many to experience. I used to think, my way was always the right way, that I was correct in thinking always. I was so god damn wrong, for like 23-24 years of my life πŸ™‚ I have learnt, about mistakes that I had made, thinking they were right. I could do only after meeting so many people. These things were never taught in college or school. These things you can only learn, if you go out there and experience, learn, see, listen.

Go, Get out there, talk to people, share your view, hang out, go to movies, but most importantly listen, to what everyone has to say. Listen and understand. I am sure, you will figure out the real you.

Older Entries