It's a bit urgent... ;)
Someone i know have a Casio calculator (FX-9750 / Grahp35+).
There is in the menu a functionnality TVM with "Days Calculation" that permits to know the number of days between 2 dates.
I have to program for this calculator something very quick but i don't know how to do... i don't know so much about casio programming...
Is it possible to call that TVM -> Days Calculation function inside a program?
I can't find any information about that on google...
Downloaded some casio manuals but i don't see anything about days calculation...
Please help meee :)
As far as I know you can't call an existing program from CASIO BASIC. I tried finding a way to do that myself, but that was a long time ago with an older calculator, so things could be different now. Still, I couldn't find anything on the internet. In other words, it seems like you would have to implement it yourself.
Here is a tutorial that might be of help for the general programming.
Here is a thread about doing what you wanted in Java that might be helpful (to show the approach to take).
Here is one in C.
Note that you might be able to download a CASIO SDK and write the program in C, if you find that the BASIC dialect is not up to the task. I do not know if your situation permits that, though, nor if such an SDK is available for your particular model.
If you run into trouble I suggest you post a new question.
EDIT: This programming manual from CASIO seems to confirm that it is not possible to do what you wanted, and might serve as a good reference should you choose to implement it yourself. It was made for the FX-9750GII.
I am not very sure how to do it, but for starters:
1. Calculator Games and Programs (some have source code too)
2. How to program casio calc
Yes, the TWM functions are available from Casio BASIC. Days_Prd() gives the difference between two dates.
Days_Prd(MM1, DD1, YYYY1, MM2, DD2, YYYY2)
(A full function reference is available in the manual downloadable from casio and maybe a CD you got with the calculator).
Related
I have an excel sheet I've received from someone with information about their personal library recently, and they've asked me to add the library of congress number to every book on the sheet. There's thousands of books on this thing, and it would take forever to search the library of congress website and copy-paste everything on here. Is there a built-in function or a way to have a column search the website for each book and copy the appropriate number?
Err... No.
This specific functionality (searching the library of congress) is so specific, that it makes no sense for Microsoft to add it to Excel. There would be probably 3 people in total that would EVER use it.
A more generic functionality (take an arbitrary webpage and look for some arbitrary information in it) would on the other hand be too vague. Either it would be useless or it would need to have a bazillion parameters to get it to do what you need to. And you'd need to spend months trying to configure it just right.
Actually, Excel does kinda offer this generic functionality - it's called the VBA. You can write custom programs there that can do pretty much anything under the sun. The downside - it's programming. If you know what you're doing, you can probably get it done in a couple of days, maybe a week. If you don't know... good luck. You'll need it!
Alright, so I don't really know much about COM. What I do know is that if you write code in one of the Microsoft-sponsored programming languages, then you can write something like 3 lines of code to launch Excel, open a blank workbook, stuff some data into the cells and tell Excel to graph it. But I have no idea how this black magic actually works; all I know is that it's related to COM somehow.
Is it possible to do this kind of thing with Haskell? Is it "easy", or is it going to be hellishly difficult? Because if it's easy, I might try and get this to work, but if it's really hard, there are simpler ways to make Excel graph things...
I'm aware that you don't actually need to learn COM just to graph stuff. (E.g., I could use GraphVis or GNUplot, or Google Chart, or write a small Cairo function, or...) I'm interested in how easy or hard it is to do COM with Haskell, and this is just a motivating example.
HDirect used to be the standard, as it was last uploaded 3 years ago I imagine it's bitrotted a fair bit.
Looks like there's a new package aimed at doing the same sorts of things.
Sorry, I'm may be a little bit late.
There is already someone who plays with excel:
Excel Automation with haskell gives a seg fault
I've written some scripts who communicate with Clearcase and Clearquest.
It was quite easy until I get problems with variant StringArray (look
at my question on SO).
I've used HDirect in order to generate the Haskell glue code. The procedure is:
launch the OLE/COM Object Viewer and select View Typelib in the File menu
select the DLL (e.g. ccauto.dll for Clearcase)
save the IDL file
run HDirect on this IDL file in order to get the haskell glue code
import it in your project
How do I start contributing to GNOME? I can program in C++ and Python, but have never touched C. I am not familiar with GTK even.
To be honest, I have no idea how GNOME works. All I have is a deep desire to somehow contribute to it.
Where do you recommend do I start? Any tutorial, mailing list or anything. I am ready to do the hard work, I just need a direction.
PS: I could have googled for the problem, but nothing beats the experience I have seen since Google returns SO for most of the questions.
Visit Join GNOME.
Figure out what you want to do for them
If it's development, then:
learn C and GTK
checkout the source code
browse through the bug-tracker to find a reasonably sized task and ask for help of more senior committers to tell you what is at your level
fix it and submit a patch
wait for roses and glory
But maybe you can help with other things, as mentioned on Join GNOME
Translations
Design / Artworks
Technical Documentation (review, proofreading)
Best of luck and thank you for trying to contribute.
Be sure to check out GNOME Love as well. It's a site aimed at getting people started with GNOME.
You may find it handy and useful by creating new extensions for Gnome shell.
There are a lot of extensions on https://extensions.gnome.org/. It requires JavaScript programming. It will also give you insights of how things work in Gnome.
start simple program with below manual.
The GTK+ tutorial
GTK+ 2 Reference Manual
GTK+ 3 Reference Manual
show your program here: http://www.gtkforums.com/ (Project Showcase)
also to note:
you don't have to learn C (even though it's a good idea). You can use PyGtk for GTK development in python (but i won't recommend that because of the speed of python).
GTK bindings for c++ also exit it's called gtkmm. It have binding for many other librays (Cluttermm, Cairomm, Pangomm).
there are bindings for A LOT of languages but native C is the best solution.
I would recommend learning vala because of it's ease of use but also because of it's speed (but that's just personal preference).
also check the gnome-devel-demo out. can be useful
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
At home I'm working on a large personal project written in Java. I recently found employment as a C# developer.
After an 8 hour workday reading C# code, I find it very hard to switch back to Java at home. Actually, my home project stalled almost completely since I've been employed.
At first I thought I'd have to wait for vacation to actually switch back to Java, but even after a week of not having C# on the brain, I did not manage to come into Java-mood again. I do not want to admit that my home project died, but I can't really see a way to overcome this issue.
If it's that bad, can you start the project again in C#? It may be quicker than waiting for your java-mood to return. It should be quicker than starting from scratch, as you've coded the logic and domain already, so you may be able to translate-and-type your way through that bit.
Use a good (and comparable) IDE in both. I switch between C# and Java, and find the combination of Visual Studio with JetBrains ReSharper for C# and IntelliJ Idea for Java makes this straightforward.
Celebrate the differences - I find a spell in C# helps my Java and vice versa. Differences in, for example, the collection frameworks just help you understand the implementations in each language more deeply.
Use the similarities to your advantage. Syntactically, the differences are not great. You should be writing code, not writing C# or writing Java. As Steve McConnell would put it, "code into the language and not in the language" (or something like that - think it's from Code Complete).
In fact, read Code Complete if you haven't already - great training for flipping between languages.
I suppose you could call this the habitual time to recovery,.
It can help to generalize to: programming logic knowledge + syntax and API = Language Knowledge ... because ...
Human beings are creatures of habit and build efficient work methods, memories and psychology based on environments and tasks we perform most often. This is a good thing.
I recently spent alot of time programming in Python, after being almost 100% C for a long time. I picked up Python quite easily and now am switching back to C. To my surprise, the problems I thought I would encounter (missing semi-colons, the random impulse to indent) were not there.
I concluded this is because:
While I was programming Python, I was frequently (daily) looking at the C source of other projects to remember the ones I didn't document too well. Because my C projects fit in with the Python stuff.
I was always looking at the C implementation of some of the Python stuff
I guess the trick is to relate new skills to old skills so that when you conduct tasks in the new skillset, your brain is still thinking about the old skills and how they related. Many theorise that learning is based on this relational foundation in your mind, and knowing about it can help you reduce the learning curve and time to recovery.
Think of it like a relational database. When you do something new, create a forign key and normalize things out. Don't create a whole new table or database.
Learn a generalization of programming logic and build on that with just the changes between languages. You will learn/switch faster.
Sorry for the bad RDBMS analogy
Your brain is full.
Full Brain http://img146.imageshack.us/img146/2469/brainfull.gif
Firstly, if you've put in an 8 hour day programming in any language, it may not be switching languages so much as just needing a break from programming. I can only speak for myself, and I know some SO'ers may feel otherwise, but I often need a break from programming after a full work day of doing it.
Currently I prefer to program in Python, but my job wants me to do shell scripting, Java, JavaScript, PHP, and IDL (that's Interactive Data Language, not Interface Description Language). So, I try to do some Python at home to keep those skills from atrophying. What I find (in addition to often needing a break as mentioned above) is that I get my languages confused a lot when I first switch from one to another. It's easy at that point to give up, but I find that as I get mentally deeper into programming with a given language I make fewer mistakes from the language confusion. So, maybe if you can just push past that first reluctance to use Java, you'll have success. YMMV, of course, and good luck!
This is because of something in psychology called the interference effect, or Stroop Effect. The two tasks are closely related (programming) so the knowledge brought into your mind by one language interferes with the knowledge brought into your mind by the other language.
Here's a cute example of a simple task that is hard to do because of this effect:
http://www.apa.org/science/stroop.html
Switching between two different frameworks is very hard to do. It's even harder if you haven't been doing them for very long.
The question, I think, has to come back to you in that you should ask yourself what you prefer now. If you still like Java and want to keep your skills up in Java, you will probably need to spend more time with it on a semi-daily basis. Working with it on nights and weekends and making sure there are no long breaks in between.
If you prefer C# now and really have no interest in persuing Java, I would convert the project at home to C# as that can only make you a better C# programmer and make you better at your day job.
I wonder if it's related to the similarities between those particular languages. Granted I've not actually used C#, but it seems pretty similar to Java. The similarities might make it difficult to context switch from work to hobby. Maybe you could learn and switch to Python, Haskell, Lisp, etc. for your personal project.
You could try spending some time programming in a completely different language in your spare time. For example, write something in Haskell, Prolog, Mercury, Oz, or Factor.
When (if?) you come back to Java, its similarities to C# will be much more striking than its differences.
That is normal. It may be a problem of Cognitive Flexibility and Inflexibility. It happens with human speech too.
Check yourself. If you are getting too tired to work at home after your regular 8 hour workday reading C# code, and also you want so much to finish your project, and now you find difficult to code in java, you may be suffering from anxiety. If you take some energy drink, coffee, cola, then you are favoring anxiety.
There are exercises for keeping yourself Cognitive Flexible. One of them is to switch for a while (couple of minutes) to Java instead of spending so much time in C#. It is like when you are programming in Java and have to switch to SQL, then to HTML. You are being flexible and switching.
Good luck.
As I answer this i feel I need to make some assumptions here based on personal experience. I write code in C++ or c# on side projects while at work am forced to dangle between php and python
There was a time i was without a steady day job and kept pretty busy on side projects.
When i landed my day job the enthusiasm i had for my side projects dwindled based on two major factors... Like you i was at my job 8 to 9 hrs a day.
2ndly i had an increased steady source of additional revenue so the motivation to code just to earn a living drastically reduced and i found myself more and more opting not to take up any new projects after work coz i jus wasnt in the mood anymore.
I also discovered that with this new attitude i started making rookie mistakes when coding in c++ unlike before. After changing my attitude things picked up again.
My best guess is that you are going through the same thing that i was going through. I suggest you find new ways to get motivated once you leave work and you will find it easier to continue programming in java.
I have a similar thing at work. I write code in JavaScript and c# but at home I write code in Python and JavaScript.
I have sometimes caught myself writing python style code in c# and then getting my tests failing. I agree with Nat that working in a language that is totally different from your work language will help you see the similarities and that they only differences will be where the libraries exist!
You know when you are overworked: it's when you try to find F1 key in the elevator cabin to launch it up!
I think java is for the diligent, and .net is for the lazy.
Perhaps someone would be angry for that,but I wanna say I am a .Neter.The .net syntax is less strict than the java's.In fact in the source code of .net,there is some simplify.
for example,we can use Convert.toDateTime(string) to Convert a String to DateTime directly.
But in java,we should make the difinition of the string's format such as "yyyy-dd-mm" then we can convert.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have always been astonished by Wine. Sometimes I want to hack on it, fix little things and generally understand how it works. So, I download the Wine source code and right after that I feel overwhelmed. The codebase is huge and - unlike the Linux Kernel - there are almost no guides about the code.
What are the best-practices for understanding such a huge codebase?
With a complex code base the biggest mistake you can make is trying to be a computer. Get the computer to run the code, and use a debugger to help find out what is going on.
Figure out how to compile, install and run your own version of Wine from the existing source code.
Learn how debug (e.g. use gdb) on a running instance of your version of Wine.
Run Wine under the debugger and make cause it to demonstrate the undesired behaviour.
The fun part: find where the code execution path goes and start learning how it all goes together.
Yes, reading lots and lots of code will help, but the compiler/debugger/computer can run code a lot faster than you.
A professor once told us to compare such a situation with climbing a mountain. You might be listening to someone who did this and tells you what it's like to look out into the country. And you believe without hesitation that that's a spectacular sight.
However, you have to start climbing yourself for real understanding what the view from the top is like.
And it's not that important to climb all the way to the top. It might be perfectly suficient just to reach a fair height above ground level.
But don't ever be afraid of start climbing. The view is always worth any efforts.
This has always been a nice analogy for me. I know this question was more about specific tips on how to efficiently deal with code bases once you started climbing. But nevertheless it instantly reminded me of our physics classes way back then.
(This is an answer I posted to a question a while back. I modified it a bit to fit this question.)
Experience has shown me that there are 3 major goals you have when learning a legacy system:
Learn what the code is supposed to do.
Learn how it does them.
(crucially) Learn why it does them the way it does.
All three of those parts are very important, and there's a few tricks to help you get started.
First, resist the temptation to just ctrl-click (or whatever your IDE uses) your way around the code to understand everything. You probably won't be able to keep everything in perspective in your mind this way, especially when each line forces you to look at multiple other classes in order to understand what it is, so you need to be able to hold several levels of the stack in your head.
Read documentation where possible; it usually helps you quickly gain a mental framework upon which to build everything that follows.
Run test cases where possible.
Don't be afraid to ask someone who knows if you have a question. Granted, you shouldn't waste others' time with inane queries, but if there's something that you simply don't understand (this is especially true with more conceptual questions like, "Wouldn't it make much more sense to implement this as a ___" or something), it's probably worth finding out the answer before you mess something up and don't know why.
When you do finally get down to reading the code, start at a logical "main" place and go from there. Don't just read the code top to bottom, or in alphabetical order, or anything (this is probably obvious).
The best way to get acquainted with a large codebase is to dive in. Many projects have a list of easy tasks that need to be done, and they're usually reserved to help ease people in. You should find and work on some of these; you'll learn a lot about the general code outline and structure, contribute to the project, and get an easy payoff that will help encourage you to take on larger tasks.
Like most projects, WINE has good resources available to its developers; IRC, wiki, mailing list, and guides/overviews. With most daunting codebases, it's not so scary after the first few fixes. WINE is truly large, and much like the kernel, I doubt there's any expert in all systems; don't feel like you need to be either. Start working on something that matters to you and take it from there.
I've started a few patches to WINE myself, and it's a good community and good structure. There's lots of very helpful debug messages, and it's a really cool project to work on, so that helps you hit it longer too.
We all appreciate your valor and willingness to help with WINE (it needs it). Thanks, and good luck.
Dig in. Think of a question you'd like to have answered, and try to find the answer. When you get tired of reading code, go read the dev mailing list, the developer's guide, or the wiki.
Unfortunately, there's no royal road to understanding a large code base. If you enjoy that sort of thing (I do) you're in for some fun. If not, guide books won't really help, so you aren't really that much worse off.
Look for one peculiar feature you are interested to improve. Search for its implementation. Once you found it, pull on that straw and all the rest will follow.
The best way is through comments.
I'm being ironic, as you understand tiny bits of the beast add comments so you can follow your trail.
The other developers will also enjoy it if you add the missing guides in the code.
Try to implement some tiny little change in the code, something that will be visible to you. That might be figuring out a workable way to output debugging statements (and figuring out where the output appears), it might be changing the default size of windows or desktop color, or something. Once you can make something happen in the codebase, you've scratched the surface of understanding and can begin to move on toward more complicated things. At that point, select a goal of something slightly more useful that you'd like the code to do, and implement that. Or check out the project's bug tracker and look for something small to start with.
Document as you go, and write unit tests as you go, and refactor as you go. When you figure out what a routine does, comment it!!
As others have suggested, dig in! Read all the available documentation you can absorb. Then see if you can find other people who are interested or knowledgeable and learn with/from them. It helps to have people to bounce ideas off of and ask questions.
For C source code, once you get a feel for what areas of the code you'd like to work on, generate ctags and cscope databases for that code. These tools make it a lot easier to jump around and understand the code. Many text editors (one example is gvim) have support for ctags and cscope so you can jump around easily.
(warning: shameless marketing ahead)
For Java developers using Eclipse, there's nWire. It is an Eclipse plugin for navigating and visualizing large codebases.
A good way to understand a large system is to break it down into it's constituent parts and focus on a specific paths through the application.
Your debugger is your friend here, set a breakpoint in the thread you want to investigate then step through it line by line looking at which each part does... hope that helps...