Beginning programming: Simple/Quick work log application - windows

I want to create a simple work log program/script with very basic function. Basically when I run it I want it to prompt me with an input windows. When I write the input it prints it into a .txt file with the current date and time.
Input : <text here>
and the output would look something like this in a .txt file.
<HH:MM:SS YYYY:MM:DD> | <text here>
What programming language is "easiest" for this kind of a program ?
With regards,
H

Ok, well I think your question is going to be a bit difficult to answer head on. How about asking yourself what language you do know. If you don't know any, then take the problem you are trying to solve each step at a time with documentation that your comfortable with. Do you want a program that strictly uses the command line? Or do you want a program with a GUI? That being said, I preferably would recommend Java because I think the syntax is more clear to me, but someone might recommend, say language X because they might know a few easier tricks. So my advice is, do some more research into a programming language and come back with more of a precise question that relates to the results your looking for.

Related

How to make this simple GUI in Python?

I'm totally new with programming, but have made some scripts for extraction data from .txt files etc. Now I am making a simple script for work, but need a simple GUI so people can run use it efficiently. The script is really simple, and consists of 4 dictionaries and a list with the keys for the values that I want to print from one of the dictionaries. What I need is a GUI that looks like the one posted. There will be 4 buttons, one for each dictionary, and the user can only pick one. On the left will be the keys, and the keys transferred to the right will be put in a list, which will be used to write the values to a .txt file. This is probably really simple, but I have no idea where to start with GUI, so I hope that someone can give me some ideas. In advance, thank you :)
Exaple: https://ci.apache.org/projects/wicket/guide/6.x/img/multi-select-transfer-component.png
It's cool that you are getting into GUI programming. Try tkinter:
https://www.tutorialspoint.com/python/python_gui_programming.htm

How to split a large csv file into multiple files in GO lang?

I am a novice Go lang programmer,trying to learn Go lang features.I wanted to split a large csv file into multiple files in GO lang, each file containing the header.How do i do this? I have searched everywhere but couldnt get the right solution.Any help in this regard will be greatly appreciated.
Also please suggest me a good book for reference.
Thanking You
Depending on your shell fu this problem might be better suited for common shell utilities but you specifically mentioned go.
Let's think through the problem.
How big is this csv file? Are we talking 100 lines or is it 5G ?
If it's smallish I typically use this:
http://golang.org/pkg/io/ioutil/#ReadFile
However, this package also exists:
http://golang.org/pkg/encoding/csv/
Regardless - let's return to the abstraction of the problem. You have a header (which is the first line) and then the rest of the document.
So what we probably want to do (if ignoring csv for the moment) is to read in our file.
Then we want to split the file body by all the newlines in it.
You can use this to do so:
http://golang.org/pkg/strings/#Split
You didn't mention but do you know how many files you want to split by or would you rather split by the line count or byte count? What's the actual limitation here?
Generally it's not going to be file count but if we pretend it is we simply want to divide our line count by our expected file count to give lines/file.
Now we can take slices of the appropriate size and write the file back out via:
http://golang.org/pkg/io/ioutil/#WriteFile
A trick I use sometime to help think me threw these things is to write down our mission statement.
"I want to split a large csv file into multiple files in go"
Then I start breaking that up into pieces but take the divide/conquer approach - don't try to solve the entire problem in one go - just break it up to where you can think about it.
Also - make gratiutious use of pseudo-code until you can comfortably write the real code itself. Sometimes it helps to just write a short comment inline with how you think the code should flow and then get it down to the smallest portion that you can code and work from there.
By the way - many of the golang.org packages have example links where you can literally run in your browser the example code and cut/paste that to your own local environment.
Also, I know I'll catch some haters with this - but as for books - imo - you are going to learn a lot faster just by trying to get things working rather than reading. Action trumps passivity always. Don't be afraid to fail.
Here is a package that might help. You can set a necessary chunk size in bytes and a file will be split on an appropriate amount of chunks.

how do i make a batch program that types

hi i am interested in making a batch program that allows me to be able to place my cursor anywhere and have the batch program type for me as if i'm typing. i have looked at a lot of different sites for help but it might be it's impossible with batch programming or i just need someone on here to tell me how your input is much appreciated. i have tried to use echo >>etc .text commands but that only inserts input into that specific text document. I would like to know this because it would improve my batch programming and would be a valuable tool to have.
Ok, after a bit of thinking, the only way to do this is to update the clipboard with whatever you want to "type" into the program, and then press "Ctrl + V" to paste it. The way you would go about inmplementing this is up to you, but to place something in the clipboard via batch is:
Clip < file.txt
And you would have to make a batch file which would continuosly update the clipboard with whatever you wanted to paste. The way you do this is up to you.
Other then that, I dont see any other way you could do something like this in batch. Like I mentioned your better off doing this in C#.
Mona

A step by step small app creation guide in Ruby

I'm looking for a step to step tutorial to make an app, not so complex in Ruby, so students can do it. By now, i have only medium-big examples that i have developed for companies some years ago,but they require extra knowledge as i used diff frameworks and libraries and i want something that can be done only with the ruby interpreter itself.
A well commented app will be good as well as i can make some step-to-step guide based on that, and yea maybe I can do one but the thing is that im running out of time, and i haven't used ruby in like 1.5-2years, so as i said im looking for something not so complex and not so big, 200 , 300, 400, or 500 lines of code is ok
Could be anything, like administration or managing purpose like idk, a script that generates word documents for certain department. A script that reads a .txt or .doc and do something with that, idk.
Thanks in advance!
It's not an app really, but it's smallish, it's Ruby, it's sort of a game, and it's fun. http://github.com/ryanb/ruby-warrior

How can I detect a user's input language using Ruby without using an online service?

I'm looking for a library or technique to detect the input language of blocks of text provided by users. Online lookups (like Google translate) won't work for this task as I'm writing an app which must run offline.
Thanks.
Here are two more n-gram-based gems you might want to try. They work offline.
https://github.com/echen/unsupervised-language-identification, optimized for separating english and other languages (has a live demo)
https://github.com/feedbackmine/language_detector, less specialized, will detect more languages. Some languages may need some extra training — I found it to be not precise enough for German text.
For anyone interested, I've found http://rubygems.org/gems/kenwaln-whatlanguage, which is performing excellently.
I'm using CLD which I really like, succinct and easy to use. Give it a try.
A quick demo of WhatLanguage in Ruby:
http://www.youtube.com/watch?v=lNqZ2cqOReo&list=UUJ_3fstMOH-g4yBxtvgAWkw&index=0&feature=plcp

Resources