Skip to main content

WOLFRAM / Editing Existing Code

GOOGLE EVERYTHING, THEN WOLFRAM EVERYTHING?

By today, we all sure already got used to idea of SEARCHING all kind of knowledge and information using GOOGLE SEARCH (or other search engine, such as DuckDuckGo) and expecting results from websites that we later we can filter and sort ourselves.

Searching and browsing IMAGES, VIDEOS, and all kind of useful INFORMATION, such as a more organized WIKIPEDIA or the messy webs becomes our second nature. We are pretty fast at it too. We are in the era of too much informations.

I do not mind this "dumb lazy but fast way to search for information", but I suddenly recall myself when I was a kid and browsing pages of thick Encyclopedia books. Then later come Encycplopedia CDs, with audio and sound .... and then the INTERNET.

The Internet and Google have surely changed a lot in our way to access information and knowledge. People can learn a lot from the Internet (well, minus some junks information and hoaxes, etc.).

However, I think, myself and most of Internet users often forgot about the idea of ENCYCLOPEDIA or even REFERENCE BOOKS. Some people are of course still use books and libraries. But not that we become lazy, our way of searching information digitally is very convenient.

So... with WOLFRAM, I have an impression that we finally have access to HUGE DATA and KNOWLEDGE, digitally and we can filter program the knowledge to our liking.

This is really a cool concept. Although sometimes I still have doubt regarding Wolfram "DATA" itself, but I think for now, we just accept the data and play with the data using Wolfram Language. I really like this idea of being able to access information like this.

Before we start, I like to coin this "Unit System" in Wolfram Language.

UNIT SYSTEM SETUP

https://reference.wolfram.com/language/guide/Units.html

By default, I keep getting pounds,lbs and all sort of unit that I am not familiar with. So, before sending query or working with Wolfram, it is a good idea to change this setting.

You simply need to type $UnitSystem to see what your current default unit is. Then in my case, I just change the value from 'Imperial' to 'Metric'.



That should set your unit system to the correct one. Of course there is command to convert unit, and that is something to check as well.

WOLFRAM LAB: "Dinosaur Weights"

Sometimes, learning programming involves borrowing other people program and edit and customize the code to our usage. 

This is common practice, although not always recommended because it does not make you a better programmer, unless you study and understand the actual code and write it yourself. It

Now, I will jump ahead to "hack" one example from Wolfram Lab: "Sort The Dinosaur By Weight".


That dinosaur example is very fun to do! I recommend you to go through it, read the documentation, try to understand what happened, and then modify it to your liking. 

Below, I changed "Dinosaurs" to CatBreed" and it works as expected. One thing to keep in mind is that if you gave Wolfram certain keywords that Wolfram do not understand, it will fail. It is always a good idea to find that correct ENTITY or KEYWORDS using CTRL + EQUAL method.





USER CUSTOMIZED SOFTWARE / PROGRAM

A PROGRAM is not solid rock. A good program is flexible and changeable and needs updating time to time. In fact it is probably something that everyone should get used to.

Well, the thing is, normally the idea of PROGRAM is something that is ready to use by USER with certain limited usages. For example PHOTOSHOP program. We don't have access or way to modify it. We are given set of Filters and Tools and we cannot really add to it.

Some other softwares do allow users to modify the interface to certain extent, creating plugins or addons. 

With Wolfram, the idea seems to "sandbox" and quickly "prototype" program that is deployable via cloud / Internet instantly. 

In fact, you can deploy the Dinosaur example into the cloud and it will run on iPhone, iPad, any computers, and even the Apple Watch.

However, since we are using the FREE Cloud version of Wolfram, there is a limit with the program. Anyway, for now it should be good.

MORE: Digging Information

From the very beginning, I have this curiosity on how much Wolfram actually knows. My biggest frustration is when finding out that this "Wolfram Brain" does not have any idea of what I am looking for or what I am querying.

I've asked Wolfram Foundation and their response was to send them feedback on what topic or knowledge should be added.

Ideally, or eventually I think the big knowledge of Wolfram can be added like Wiki kind of way, just my own idea.

After doing some explorations of my own, probably the best way is to get to the right ENTITY using CTRL+ENTER method.

Sometimes when searching, we get ENTITY that is just a WORD. Which means Wolfram only knows it as a Word. And that Word you might find the Description of that Word, or find similar Rhymes Words, but nothing like Images. So this is something to keep in mind.

However, if you find ENTITY that is more than just WORD, you can continue digging.


Another example, if you get to your particular Plant Entity, we can further explore its SUB ENTITIES.



What really interesting I found is that for beginner Wolfram Explorer, I think the best way is to REUSE the same "Pattern" of code, to get "that information" you really want. Until you get more comfortable with modifying LIST QUERY, then digging more into the ENTITY PROPERTIES and VALUE.


"SLASH SLASH method"

There is this double slash ("//") method can be useful whenever you are digging a certain ENTITY and you want to see the PROPERTIES.

Supposed you start with:
1) CTRL + ENTER, and then find a certain ENTITY of your interest.
2) Then you are interested to find out about what PROPERTIES that Wolfram knows about that entity and want to dig further.

For example below:



There is this good video example that uses // inside Wolfram Mathematica. This video is using Raspberry Pi computer. It goes further to explain cool way how Wolfram can be used as CLASSIFIER. Machine Learning.
https://www.youtube.com/watch?v=ZqjjBr_IPgs

It's called Prefix and Postfix function if you are interested to find out more.

f @ expr  prefix function application
expr //  postfix function application ("slash slash")


Comments

Popular posts from this blog

PYTHON PROCESSING / It only really begins ...

Back into Processing again, with Python! While Daniel Shiffman is continuously inspiring us with his CODING TRAIN series on YouTube, using Processing with Java and Javascript language, I decided to free my mind and trying to really do something using Processing and Python language. Installing Python language version on Processing 3 is easy enough, just first download the latest Processing and install the Python language mode via Add Mode button. Other link that might help: https://github.com/jdf/processing.py http://py.processing.org/tutorials/ BLANK MODE As soon as Processing Python Mode, opens up and running I am presented with a  blank environment. Suddenly I recalled my journey in learning programming from zero until now... With Python, outside Processing, commonly people will be introduced to Python IDE or IDLE environment. Something that looks like Console Window or Command Prompt, where we type single liners command. Python Command Line and IDE normally have t

PYTHON / OpenCV, Recreate Uncanny Manga - Anime Style

Can you tell what it is? Computer Vision. Yesterday, I spend almost whole day exploring this opencv module using Python. What I discovered was revealing. Even at the very basic level, I could produce some interesting Image and Video manipulation using all the code collected from documentation and many, many blog tutorials. If you are a total noob like me, I am still getting used to knowing that the CV in OpenCV means Computer Vision! Actuallly, I recalled that I did try to get into OpenCV few years back ago, when I knew no Python and when Python opencv module was probably still early. It was all C++ code and it was a little bit too hard for me. I read a couple of books about opencv at the library, I did not understand a single thing. That was back then. Today, for strange reason, with a bit of knowledge of Python, I can go a little further. EDGE DETECT IN OPENCV Me holding you know what. What leads me this far is my curiosity on how we can replicate Wolfram Langu

WOLFRAM / Making Text With Rainbow Color

Continuing with my Wolfram Mathematica Trial Experience... I watched and went through some more Mathematica introduction videos, read lots of Mathematica documentation and also going through the Wolfram Lab Online again a few times. There are some major learning curves and Mathematica is a lot different from normal programming language. Sometimes there is a lot of interesting "shortcuts", say like: FindFaces[] , WordCloud[] . Sometimes I got a little confused on how one can do iterations. Normally FOR LOOP concept is introduced early, but in Wolfram, because everything is EXPRESSIONS and ENTITY (like OBJECTS), sometimes it gets quite quirky. Mind you I am still in the first impression and having to look at many tutorials. Lots of NEAT EXAMPLES from documentation, but sometimes I got lost. I found Wolfram to be really awesome with LIST and generating list. It's almost too easy when it works visually. I cannot explain them with my own words yet, but there are