Updates from May, 2017 Toggle Comment Threads | Keyboard Shortcuts

  • CG 8:15 pm on May 28, 2017 Permalink | Reply
    Tags: image recognition, ,   

    Image Recognition with TensorFlow – python 

    Bildschirmfoto 2017-05-28 um 7.53.32 PM Bildschirmfoto 2017-05-28 um 7.53.56 PM

    1. Start with this link https://www.tensorflow.org/tutorials/image_recognition#usage_with_python_api
    2. Download TensorFlow models repo from Github here https://github.com/tensorflow/models/blob/master/inception/inception/image_processing.py
    3. If you got errors with python, go here https://stackoverflow.com/questions/40357548/inception-v3-guide-on-tensorflow-broken-for-c-and-python
    4. Remove the argv command
    • Brooks 11:35 am on June 30, 2017 Permalink | Reply

      magnificent issues altogether, you just gained a emblem new reader. What may you recommend about your publish that you made some days ago? Any certain?

    • restaurant frankfurt oder 1:39 pm on June 30, 2017 Permalink | Reply

      Grüße! Sehr hilfreiche Beratung in diesem Beitrag! Es sind die kleinen Veränderungen, die die größten Veränderungen bewirken werden. Danke für das Teilen!

    • anexo monografia 2:52 am on August 31, 2017 Permalink | Reply

      Heya i’m for the primary tikme here. I came across this board and I in finding It really helpful & it helped me out
      a lot. I hope to offer one thing again and aid others like you helped me.

  • CG 9:54 pm on May 26, 2017 Permalink | Reply
    Tags: macos, pip, , Sierra, , virtualenv   

    Installing TensorFlow on MacOS Sierra 

    I can’t remember every steps but I need to leave some notes that I can refer to later 🙂 I just put everything I can remember here 🙂

    The directory:

    cd /usr/local/lib/python2.7/site-packages/tensorflow/bin
    source activate tensorflow

    code example to test

    >> import tensorflow as tf
    >>> hello = tf.constant(‘Hello, TensorFlow!’)
    >>> sess = tf.Session()
    >>> print sess.run(hello)
    Hello, TensorFlow!
    >>> a = tf.constant(10)
    >>> b = tf.constant(32)
    >>> print sess.run(a+b)
    >>> quit()
    (tensorflow) CG-MacBook-Pro-2:bin Marisa$ deactivate

    Activating virtualenv

    $ cd /path/to/tensorflow/bin
    $ source activate tensorflow
    $ python
    >>> import tensorflow as tf
    >>> print(tf.__version__)

    Important links:

    1. https://www.tensorflow.org/install/install_mac#the_url_of_the_tensorflow_python_package
    2. https://thkim.org/tensorflow/tensorflowinstallation/tensorflowinstallationvirtualenv/
    3. https://github.com/tensorflow/tensorflow/issues/647
    4. https://codedump.io/share/6Oq22H5Uhoab/1/virtualenv-tensorflow-instalation-validation-with-importerror-no-module-named-tensorflow
    5. https://stackoverflow.com/questions/43647090/virtualenv-tensorflow-installation-validation-with-importerror-no-module-named
    6. http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/
    7. https://hackercodex.com/guide/python-development-environment-on-mac-osx/
    8. http://sourabhbajaj.com/mac-setup/Python/virtualenv.html

    The journey:

    Downloading TensorFlow

    Bildschirmfoto 2017-05-25 um 7.09.57 PM

    Install and update

    Bildschirmfoto 2017-05-25 um 7.18.58 PM

    Removing Anaconda

    Bildschirmfoto 2017-05-25 um 7.25.06 PM

    tensorflow library couldn’t be recognized. Installing gpu version

    Bildschirmfoto 2017-05-25 um 8.01.42 PM

    installing for python 2.7

    Bildschirmfoto 2017-05-25 um 9.57.24 PM

    reinstalling python and fixing the PATH

    Bildschirmfoto 2017-05-25 um 10.25.47 PM

    installing virtualenv

    Bildschirmfoto 2017-05-25 um 11.33.43 PM

    installing tensorflow on virtualenv

    Bildschirmfoto 2017-05-26 um 1.14.44 PM

    tensorflow had been successfully installed on virtualenv

    Bildschirmfoto 2017-05-26 um 1.24.11 PM

    tensorflow library still not recognized

    Bildschirmfoto 2017-05-26 um 1.32.30 PM

    finally figure out how to activate the virtualenv

    Bildschirmfoto 2017-05-26 um 1.50.15 PM

    library recognized but there were errors!

    Bildschirmfoto 2017-05-26 um 1.50.42 PM

    reinstall tensorflow to the activated virtualenv, and it worked!

    Bildschirmfoto 2017-05-26 um 1.54.14 PM

    YES!!! 🙂 Now I’m ready to explore! 😉

    Bildschirmfoto 2017-05-26 um 2.16.10 PM

  • CG 1:39 pm on February 26, 2015 Permalink | Reply
    Tags: , queue, rabbitmq   

    Installing RabbitMQ on MacOS 

    1. Download RabbitMQ for Mac here
    2. Download Java AMQP client library here
    3. Start RabbitMQ server by running ./rabbitmq-serverBildschirmfoto 2015-02-26 um 11.10.15 vorm.
    4. Check that the server is running properly with ./rabbitmqctl statusBildschirmfoto 2015-02-26 um 11.10.51 vorm.
    5. Compile and run a HelloWorld testing program from the tutorial here. Compile the Send.java and Recv.java files with javac -cp rabbitmq-client.jar Send.java Recv.java. Run Send.java with java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar Send. This will send the message (in this case the message is “Hello World!”) to the queue. And then run Recv.java with java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar Recv to pop out the message on the queue.Bildschirmfoto 2015-02-26 um 11.08.05 vorm.
    6. The server and the queues can also be checked via browser http://localhost:15672/Bildschirmfoto 2015-02-26 um 11.09.31 vorm. Bildschirmfoto 2015-02-26 um 11.08.41 vorm.

    Now the queue is ready.

    • Budi Rahardjo 8:20 am on February 28, 2015 Permalink | Reply

      On Linux (I know, it’s not Mac OS X 🙂 ) there’s “amqp-tools”. Install it with “apt-get install amqp-tools”. You’ll get five (5) command line tools. For example if you want to publish something:

      amqp-publish -e exchange_name -b “your message”

      To get a message from a queue:

      amqp-get -q queue_name
      amqp-consume -q queue_name

      I believe these tools are built with rabbitmq-c library. Having said that, I looked at the newer version of rabbitmq-c library in here:

      It has a number of different tools. Perhaps they changed (upgraded?) the library? I have not looked deeper into it. Basically, it is a C library that you can use to create command line tools. I looked at one of the code, and hardcoded the userid dan password in it so I can use something like this.

      amqp_sendstring localhost 5672 amq.direct test “hello world”

      I have tested amqp-tools and this rabbitmq-c library agains locally installed rabbitmq server. They work!

    • Budi Rahardjo 8:37 am on February 28, 2015 Permalink | Reply

      And now for some clients. I have tested Perl Net::RabbitMQ. Getting it running is easy.

      Publishing message(s) works perfectly, but I am still having problems getting one (1) message from the queue. For some reasons, I got *all* the messages from the queue. ie. get and consume behave the same. I need to tinker some more with the get.

      I haven’t had time to play with Python and Java clients.

  • CG 7:55 pm on January 3, 2015 Permalink | Reply
    Tags: ant, canarymod, , minecraft, mods, scriptcraft, yosemite   

    How to run Minecraft on Mac OS X Yosemite 10.10.1 

    I got this message when running Minecraft on Yosemite, and when I googled I found that this is common problems.

    Bildschirmfoto 2015-01-03 um 7.27.35 nachm.

    Some references say that the latest JDK should be installed while the earlier ones should be uninstalled. I have uninstalled the earlier and installed the latest JDK but the problem persisted.

    So I followed this reference to make it work.

    These are the steps:Install ant

    1. Download Java Application Bundler
    2. Download Minecraft.jar from here *after clicking “Show all platforms” and choose that one under “Linux and Other
    3. Create a file named build.xml and type this code in
      Bildschirmfoto 2015-01-03 um 7.22.29 nachm.
    4. Organize my file like this
      Bildschirmfoto 2015-01-03 um 7.21.13 nachm.
      *Notes: at this point, the dist folder is empty, it will contain Minecraft.app after I run ant command*
    5. Open terminal and run ant like this
      Bildschirmfoto 2015-01-03 um 7.21.56 nachm.
    6. Now the dist folder will contain Minecraft.app in it. Move it to Applications folder

    And it works!

    Bildschirmfoto 2015-01-03 um 7.17.19 nachm.

    Bildschirmfoto 2015-01-03 um 7.23.56 nachm.

    Bildschirmfoto 2015-01-03 um 7.24.02 nachm.

    My next step is to make canarymod and scriptcraft work to make mods on Minecraft. Wish me luck.

  • CG 8:51 pm on October 3, 2013 Permalink | Reply
    Tags: xcode phonegap nodejs cordova   

    PhoneGap – Getting Started using Xcode 

    1. Download and install NodeJS and PhoneGap
    2. Type this in Terminal: (make sure you have a stable internet connection because this will affect the generation of the code like missing libraries, invalid structures of directories etc.)
      Screen Shot 2013-10-03 at 7.35.52 PM
      You have to do this project creating and building on command prompt because in later versions of XCode, they do not give you to choose Cordova application or PhoneGap application when you start a new project like shown in this picture:
      Screen Shot 2013-10-03 at 8.55.02 PM
    3. Find the .xcodeproj and run it (it will be opened automatically in XCode)
      Screen Shot 2013-10-03 at 7.39.28 PM
    4. And then Run the project (by pressing the button on the top left) and you will get this
      Screen Shot 2013-10-03 at 7.49.22 PM
      You can modify the index.html or .js scripts and see how they look in simulator.An error usually occurs (the error message would be “index.html not found” when there is no index.html in www directory or the structure of the directory is not like shown below.Screen Shot 2013-10-03 at 7.59.58 PM


    1. The version I’m using is Xcode 5.0, iOS Simulator 6.1, PhoneGap 2.9.0 and node.js v0.10.20. Running on Mountain Lion 10.8.5
    2. If you are using different versions in either of one of them, the result might be slightly different
    • Ripiu Info 9:29 am on December 5, 2013 Permalink | Reply

      Which one do you recomend, phonegap or native ios for newbie like me ?

    • www.hubmesh.com 11:27 pm on June 25, 2014 Permalink | Reply

      Many thanks for every other useful website. The place altogether different may possibly I receive that kind of information coded in a very perfect means? I’ve got a mission i’m right now operating upon, so i are actually with the be aware of similarly info.

    • Collum 9:22 pm on July 1, 2014 Permalink | Reply

      whoah this web site is usually amazing i like reading your content. Maintain the great work! You know, many men and women want circular with this info, you are able to encourage them to enormously.

  • CG 7:07 pm on April 30, 2013 Permalink | Reply
    Tags: Erlang   

    Hello World – Erlang 

    The easiest way to install Erlang on MacOS is by downloading the .dmg of Erlang here. And then you will get Erlang installed.

    Screen shot 2013-04-30 at 3.23.01 PM

    And here’s the example of Hello World using Erlang.

    Screen shot 2013-04-30 at 6.56.01 PM

    Useful Links:

    1. http://digitalsanctum.com/2009/10/01/installing-erlang-on-mac-os-x/
    2. http://www.erlang.org/download.html
    3. http://www.waratuman.com/2010/01/12/installing-erlang-on-mac-os-x/
    4. http://www.claystuart.com/
    5. http://www.erlang.org/documentation/doc-5.1/doc/getting_started/getting_started.html
    6. http://www.trapexit.org/Running_Erlang_Code_From_The_Command_Line
  • CG 9:17 pm on March 30, 2013 Permalink | Reply
    Tags: arithmetic, , , reduction,   

    Polynomial Basis Squaring 

    Finally have successfully found some spare time to do coding to solve this polynomial squaring:


    And this is the result, x^5 + x + 1 :

    Screen shot 2013-03-30 at 8.58.52 PM

    • rudi 9:37 pm on May 30, 2013 Permalink | Reply

      bu, akan lebih cantik kalo nulis polinomnya pake latex,
      x^5 + x+1

      • CG 11:00 am on May 31, 2013 Permalink | Reply

        iya belum sempet dirapihin 😀 biasanya saya pake latex for wordpress

    • Akshay 11:18 pm on July 26, 2013 Permalink | Reply

      Hey please mail me this complete C code. sorry I’m not execute this ….please help me…please ..

  • CG 2:07 pm on March 15, 2013 Permalink | Reply  

    Why Python? 

    Our research group is developing a library for finite field operations on very long bits, so we start gathering information about the performance of Python on scientific programming, big numbers especially for cryptography.
    Here are some important links related to Python for scientific and cryptography implementation:

    1. http://www.tutorialspoint.com/python/python_numbers.htm – about Python number representations
    2. https://pypi.python.org/pypi/PyECC – a module for implementing Elliptic Curve Cryptography
    3. http://theunixgeek.blogspot.com/2008/09/c-vs-python-speed.html – Python compared to C
    4. http://www.linuxjournal.com/magazine/use-python-scientific-computing – the use of Python for scientific computing
    5. http://scipy-lectures.github.com/ – Python Scientific Lecture Notes
    6. http://www.scientificpython.net/ – Scientific Computing with Python
    7. http://wiki.python.org/moin/NumericAndScientific – list of modules and tools for various implementation in Python
    8. http://ubuntuforums.org/showthread.php?t=1581805 – Python power for large numbers
    9. http://programmers.stackexchange.com/questions/128589/how-to-handle-large-numbers – handling big numbers with Python
    10. http://www.daniweb.com/software-development/python/threads/364584/very-large-numbers – library for big numbers in Python
    11. http://www.daniweb.com/software-development/python/threads/364584/very-large-numbers – Python can handle very big numbers
    12. http://code.google.com/p/ecc4pys60/wiki/Roadmap – Elliptic Curve Cryptography implementation on S60 using Python
    13. https://gist.github.com/bellbind/1414867 – Elliptic Curve Cryptography implementation in Python
    • Tafta 5:08 pm on March 16, 2013 Permalink | Reply

      The title doesn’t match the content, please dech (pake helm biar ga ditampar)

      • CG 7:27 pm on March 16, 2013 Permalink | Reply

        *tempiling sampe kepalanya lepas*

  • CG 12:40 pm on March 8, 2013 Permalink | Reply  

    Python: Converting String to Binary 

    A simple code on how to convert string to binary, accessing array string and performing shift operation on binary


    a_str = ‘10110011’
    b_str = “00101010”
    a_bin = int(a_str, 2)
    b_bin = int(b_str, 2)

    print “a “, int(a_bin), a_str
    print “b “, int(b_bin), b_str
    print “a[0] “, a_str[0]
    print “b[0:3]”, b_str[0:3]

    #print “c “, c, bin(c)[2:]

    print “a << 2 “, a_bin << 2, bin(a_bin << 2)[2:]
    print “b >> 2 “, b_bin >> 2, bin(b_bin >> 2)[2:]

    The result:

    Screen shot 2013-03-08 at 12.37.48 PM

    • tinykuya 3:02 pm on March 15, 2013 Permalink | Reply

      ternyata dari string diconvert dulu ke int, terus diconvert lagi ke binary.. ya ya ya.. saya sempat berpikir operasi binernya dalam bentuk array 😀 kalau seperti ini, masuk akal.

      terima kasih bu.

      • CG 3:55 pm on March 15, 2013 Permalink | Reply

        sip mudah2an berguna 😉

  • CG 3:32 pm on March 7, 2013 Permalink | Reply
    Tags: bit operations,   

    Python: Bit Operations 

    Basic bit operations in Python:

    a = 60            # 60 = 0011 1100 
    b = 13            # 13 = 0000 1101 
    c = 0
    print "a = ", (bin(a)[2:]);
    print "b = ", (bin(b)[2:]);
    c = a & b;        # 12 = 0000 1100
    print "a & b = ", (bin(c)[2:]);
    c = a | b;        # 61 = 0011 1101 
    print "a | b = ", (bin(c)[2:]);
    c = a ^ b;        # 49 = 0011 0001
    print "a ^ b = ", (bin(c)[2:]);
    c = ~a;           # -61 = 1100 0011
    print "~a = ", (bin(c)[2:]);
    c = a << 2;       # 240 = 1111 0000
    print "a <> 2;       # 15 = 0000 1111
    print "a >> 2 = ", (bin(c)[2:]);

    Screen shot 2013-03-07 at 3.28.10 PM

    An interesting link about bit operation algorithm implementation in Python is here.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc