Sphere in an android App
My Code Xploits : These are my short trips into the programming world
Saturday, September 21, 2024
Sunday, September 15, 2024
Sierpinki Gasket in an Android App
This project is a modification of an existing app I created earlier.
~TLDR: clone the repo https://github.com/bmkamath2000/mukBoApps and open in android studio to run.
Upon creating an android project in android studio there was a MainActivity.java automatically created in the src folder.
I instinctively guessed that I needed to declare a MyGLSurfaceView which extends a GLSurfaceView.
My guess turned true as I got a surface in the app when I created a run configuration and
launched the app using it.
I had some experience with rudimentary android app development over several years in the past.
As you can see onCreate of the MainActivity the view is set as content view.
In MyGLSurfaceView
I created a MyGLRenderer instance which is derived from GLSurfaceView.Renderer.
The MyGLRenderer declares a Triangle and draws it onDrawFrame.
I have Created the Triangle class which is based on the android official site:
https://developer.android.com/develop/ui/views/graphics/opengl/draw
The triangle is subdivided and on single or delayed click the number of triangles
triples or divides by a factor of 3.
Here is how it looks:
Thanks
Saturday, September 14, 2024
protobuf.dev getting started with protocol buffer example
Head over to the site https://protobuf.dev
In that site you will find things to compile a C++ and many other language projects with address book. Now just take a deep breath and dive in.
Warning: This is easy in Linux and verry verry difficult in Windows
If you find the going tough in that site, come here for I will get you some personal touch.
write_to_file.cpp
read_from_file.cpp
Thursday, September 5, 2024
Compile and execute a Simple example of working with Protobuf in C++
You can learn a lot by doing.
Ditto with CMake project building and running in Ubuntu.
An example cpp-protobuf-example in the github site https://github.com/afiskon/cpp-protobuf-example
comes up often in the google search and I tried compiling it in windows and it gave error.
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Its difficult to install protobuf in windows but I did it in Ubuntu(which is just an app in windows now with technology of windows subsystem for linux-WSL).
First I did a git clone with this cmd:
git clone https://github.com/afiskon/cpp-protobuf-example.git
then I changed directory to
cd cpp-protobuf-example/
After that I created a build directory by
mkdir build
followed by
cd build
followed by
cmake ..
which gave the same error as in windows. In ubuntu its much easier to install required libraries.
sudo apt-get install protobuf-compiler libprotobuf-dev
this command installed everything for me and I was good to go build the app.
cmake ..
worked like charm with following output:
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found version "3.12.4")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kamathbol/GitHub/cpp-protobuf-example/build
then the command
cmake --build .
[ 20%] Running cpp protocol buffer compiler on src/proto/Game.proto
[ 40%] Building CXX object CMakeFiles/proto.dir/Game.pb.cc.o
[ 60%] Linking CXX static library libproto.a
[ 60%] Built target proto
[ 80%] Building CXX object CMakeFiles/main.dir/src/Main.cpp.o
[100%] Linking CXX executable main
[100%] Built target main
then upon running the main
./main
Saving heroes...
Loading heroes...
Name: eax
HP: 50
XP: 256
Class: warrior
Weapon: sword
Arrows: 15
Name: afiskon
HP: 25
XP: 1024
Class: mage
Spellbook: fireball, thunderbolt,
Mana: 100
BTW here is the Main.cpp source that gets you this Output:
Saturday, June 29, 2024
YouTube Data API: Register for a free API key and use Python code to extract metadata from a YouTube channel
Search google for Google Developer Console: https://console.developers.google.com/project
Shutting down a Created Project:
So enable billing if you like paying money to google without any benefit in return.
So you have to create a project now. Click in create project and Type in a name for your organization. This will be mentioned when they bill for the services.
Go to Resource Pending Deletion here:
Then you will get a screen
Finally disable billing screen in billing section:After billing is disabled you will to get this:
Here is where you add a billing account:
This is the project dashboard before I delete my project just for the heck of it.I casually went to project settings and clicked shutdown again to see what it entails:
This was incidentally the first screenshot:
This screen says it all:
Saturday, September 16, 2023
DNA Sequencer
This is John Doe's DNA:
John Doe,T,A,C,G,C,T,A,T,T
These are other animals:
Arctic Fox,T,A,C,C,T,A,C,T,T,A,C,G,A,T,G,T,G,T,A,G,C,A,C,A,T,C,T,G,G,A,T,G,C,T,C,C,T,T,C,T,A,C,G,C,G,G,T,A,A,T,A,T,C,C,T,G,T,G,G,A,T,G,G,A,C,G,G,A,G,C,T,A,C,C,G,C,T,T,T,C,T,T,G,C,G,G,A,G,G,T,G,A,T,C,A,C,C,T,G,A,C,T
Glow Worm,T,A,C,C,T,A,C,T,T,A,C,G,A,A,C,A,C,T
Eastern Diamondback Rattlesnake,T,A,C,G,C,C,T,A,G,G,C,G,G,T,A,A,T,C
Domestic Cat,T,A,C,G,G,G,T,A,G,C,T,A,G,C,C,A,T,T
Great Dane,T,A,C,T,T,G,T,C,A,T,G,G,C,T,C,T,C,G,T,A,G,C,T,T,T,C,T,A,A,T,G,A,A,C,C,G,T,T,C,T,A,T,T,G,A,A,C,A,G,T,T,A,G,A,T,G,G,A,G,C,T,C,C,C,T,C,A,A,T,C,C,C,T,T,A,C,C,A,A,G,T,C,C,T,C,T,C,A,A,G,C,G,C,C,A,C,\
A,C,C,A,C,T
Alaskan Malmute,T,A,C,C,T,G,T,C,G,A,G,G,A,C,C,C,T,C,A,G,A,C,C,T,G,A,G,T,T,A,G,C,A,C,G,G,T,A,G,G,T,G,T,C,T,G,G,C,G,T,G,C,C,G,G,A,T,G,C,G,C,A,T,A,T,G,T,T,C,T,T,T,G,C,T,C,T,C,A,A,G,A,C,C,G,A,A,G,T,C,C,C,G,G\
,C,T,A,G,G,A,T,C
Golden Retriever,T,A,C,A,C,C,T,G,T,A,A,C,G,T,T,A,G,T,A,G,T,C,G,A,G,T,A,C,C,A,C,T,T,T,A,A,T,G,C,A,C,A,T,C,T,T,C,C,A,A,C,G,A,C,G,A,C,G,T,A,G,T,C,G,A,T,T,A,G,A,A,G,A,G,C,C,T,A,C,G,G,A,A,C,C,C,G,C,G,G,G,G,T,\
T,C,G,A,A,T,A,T,T
The fund-a is simpler organisms need not necessarily have more complex DNA.
Now cell division happens in two types. Meiosis and Mitosis. Mitosis is normal division and Meiosis results in haploid cells with half the number of Strands.
The thing is DNA transcription happens with the involvement of messenger RNAs.
I have a partly written code for this which did not completely work.
Here is some sample:
Also the sequencing either happens completely or not at all. There is nothing like half the DNA is copied and other half of the sequence isn't as I thought might happen earlier.
The reference repo is not working properly but you can make it work.