Friday, September 28, 2018

Traffic: Should I move or not? (OpenCV + Android) Pseudocode and Algorithms

Story Behind the Project
I complained to my good friends, who can tolerate my late night bombardment, about how I needed a project to keep my mind running productively and busy, aside from exercise and actually working on my real tasks that are much more rewarding later on (e.g. practice technical interviews, clean up my portfolio). I wanted work, where I could look forward to every return home.

My friend said that he'd be ready to test my app, so I guess I'll have to create the app, and do my best to stick to that.

I surely want to test out my app. Although I am not a fan of driving, I've been in the back seat long enough to know that not all traffic lights are perfect and can be a dreadful patience and discipline tester in the same spot for 5+ minutes. This includes sitting in traffic for quite, where we might as well nap there, too.

That's enough to catch at least 25% of a power nap.

Every stopping moment, the app starts finding traffic lights and detects another car movement to check whether you should press the gas pedal or not. The app should also allow you to exit and still run in the background so you can do simple tasks such as check e-mails and playing music. And, shouldn't use so much battery life.

Car Movement Detection
As much as I want to train my own haar cascade, I am impatient and want a running prototype (also this is not even paid and out of learning interest) so I'm going to copy this project: https://www.geeksforgeeks.org/opencv-python-program-vehicle-detection-video-frame/

Or, I can do HSV segmentation: https://www.researchgate.net/publication/251423714_Vehicle_Detection_at_Night_Based_on_TailLight_Detection

American Traffic Lights
There are light patterns for American traffic lights. The light sequence is red, then green to go, and green, flashing yellow, and then red to stop. And, it's vertical rows of 3 circles.

Also, this is a good read: https://autottblog.wordpress.com/programming-the-car/opencv/

Traffic Light and Color Detection
Find 3 circles that are red, yellow, and green in a vertical row, and calculate the distance between those circles to determine if it is a traffic light. By converting the image to HSV to find the 3 circles and its distance.

Pseudocode and Algorithm for Traffic Light Detection
Thanks, researchers, for making it easy for me: https://www.researchgate.net/publication/300581967_Traffic_Light_Recognition_System_for_People_with_Color_Blindness/download

Basically, segment frames into HSV then LOTS AND LOTS of tweaking the threshold. They made a nice flowchart in there. Thank goodness.




Thursday, July 19, 2018

[dev/Mission Personal Project] TrackMe Website

Inspiration
The whole idea of the project is to keep track of the items at home. I learned from <dev/Mission> is that CRUD (Create, Read, Update, Delete) is something we're working on. The general idea of creating this project is for students to understand how to do CRUD operations with websites using Javascript, HTML, CSS, JQuery, Visual Studios, GitHub Desktop, GitHub, BootStrap and Atomic (optional).

TrackMe keeps an elegant and vibrantly visual flow of where all items are located in the house, and when it was last seen in the conditions that they are in and what notes.

I'm going to create this website based all on location to keep organized. As before, I'm going to use that template to create this website.

We have to present this to DropBox!

Tuesday, July 10, 2018

[Resume Website] A Possible Software Security Issue

This is my first time working on websites.

I am supposed to work on HTML, CSS, and Javascript. I am still astonished till this day on how great this non-profit organization has established itself. I have 1 edit, that needs to be finished so I can see this as a security vulnerability in any websites.

Noticed how "<dev/Mission> looks like a HTML code. On my website, I had the title as "dev/Mission" 

the orange highlight of "dev/Mission"

I tried to type "<dev/Mission>" in the HTML; yet, it still considered as a typo. 

How is this a vulnerability?

"HTML injection is an attack that is similar to Cross-site Scripting (XSS). While in the XSS vulnerability the attacker can inject and execute Javascript code, the HTML injection attack only allows the injection of certain HTML tags. When an application does not properly handle user-supplied data, an attacker can supply valid HTML code, typically via a parameter value, and inject their own content into the page. This attack is typically used in conjunction with some form of social engineering, as the attack is exploiting a code-based vulnerability and a user's trust.

Attack scenario (OWASP)

A possible attack scenario is demonstrated below:
  • Attacker discovers injection vulnerability and decides to use an HTML injection attack
  • Attacker crafts malicious link, including his injected HTML content, and sends it to a user via email
  • The user visits the page due to the page being located within a trusted domain
  • The attacker's injected HTML is rendered and presented to the user asking for a username and password
  • The user enters a username and password, which are both sent to the attackers' server"
- https://www.acunetix.com/vulnerabilities/web/html-injection

A cool volunteer named Francis Li mentioned in Slack that a way to edit it to look like "<dev/Mission>" instead of "dev/Mission" is using HTML escape entities (https://dev.w3.org/html5/html-author/charref)

I haven't looked too much into it, but I would consider this possibly a software security issue if I was running a major company that may save lives. Because there are creative people in this world who can make anything into reality.

Even if I was wrong, it's pretty cool that I learned a snippet about HTML injection.

Monday, June 18, 2018

dev/Mission Week 3

Program has been going great so far!

To find a community so close to home, and a nice support system to keep my motivation and inspiration in moving forward with my computer science journey is pretty much something that I have been searching.

I knew that I would find something considering that I live in a tech labyrinth where anything is almost accessible and majority of the city is striving towards the tech movement.

Hopefully, I keep my attendance going. I already have 1 excused and 1 unexcused.

[Resume Website] ...I'm done.

blinks
I'm not sure on how to get rid of the side scrolling bar when the bottom is just white.

Sunday, June 17, 2018

[Resume Website] Progress Report

Progress Report
design inspiration
Of course, not every plans go according to schedule. I decided to change my plans and do something like this. It's almost purely on CSS designs.

almost there...
I have 7 more items on the list to do.

progress screenshot
I think that I can finish this before this week is over. I am hoping that I finish by today, but I need to do other stuff! 



[Resume Website] Finally...settled with a design.

rough sketch
After much exploring and ideas, I finally settled with a design for my portfolio. My portfolio has been long overdue. Anyway, this is inspired by my room that I spend majority of my time in since I am an indoor person. I honestly do not like going outside.

Notes

  • My resume will be scrolling in an opaque white with black text. And, an "X" in red. 
  • A phone placed supported by books. Phone flashes from the example here.
  • Photo of myself that shines so user can hover it with email (mailto), GitHub, LinkedIn, and Blogspot.
  • The drawer handle shines too, and when user hover over the drawer and clicks on the button, the cat pops up.
  • The computer screen has two windows popped up. On the left is just a window scrolling. On the right is the resume.
  • There are 2 sticky notes on the computer. Sticky note, left and "1", should say "TODO Projects" and sticky note, right and "2", should say "REMINDER Resume". When hovered the sticky notes bend.
  • There is a board behind the resume when it's closed. The board is just a bunch of images of my interests.
  • The phone is clickable where it shows the projects.


How To Do This

  • https://codepen.io/donovanh/pen/EjYeLa
    • Photo frame
    • Computer: scrolling and resume
    • Books
    • Everything on the desk except phone
  • https://codepen.io/Alireza29675/pen/YVMBOg
    • Phone
  • https://codepen.io/choogoor/pen/vKdBrm
    • sticky notes 
    • links for photo frame for hover of 
  • https://codepen.io/Bucur/pen/dPJvbL
    • the shine in animated items
  • https://codepen.io/anandgraves/pen/iycmh?editors=1100
    • bulletin in the back
  • https://codepen.io/peiche/pen/PPPRgz
    • the resume window
    • the project window
    • well, more links about that resume window:
      • https://codepen.io/joshcummingsdesign/pen/qOKaWd
      • https://codepen.io/balapa/pen/embYYB

Thursday, June 14, 2018

[Android Studio Errors] Face Alarm App

Problem
Camera2Renderer had an error. I forget what it was since I already fixed it. But basically it had so many missing a variables that stemmed from there.
Solution
Change the project structure for the compile sdk version because they added hardware in a different version.
https://stackoverflow.com/questions/36204781/error-package-android-hardware-camera2-does-not-exist-opencv

Problem
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAXM must be updated (version 1.1.1 < 6.0.1).

Solution
??

Conclusion
I hate to leave errors unsolved, and I'm not sure if I'll continue this project. I hate to leave this project unfinished because of my anger issues with android development. I can say that I am leaving this project at a pause.


Thursday, February 15, 2018

Dear Future Self whenever you start an android dev project

I noticed every time I do Android development. I mean every time!
Just every time! It always happens! I can't connect my phone to develop, so here! Don't ever forget this!

This was copy and pasted from a post I did in an VR group. This was meant for Unity, but maybe it would work with Android Studio, too.

[SOLVED] Problem: I'm having trouble with Unity to recognize the S7 when I do a build and run. When I run 'adb devices' in cmd, it gives me an empty list. I'm on Windows 10.
Solution: I switched USB cables. Updated my drivers from device manager.
Anyone know how I can get Unity to build my app to the S7?
#olpquestion
Things I already tried:
1. Since downloading just the command line android zip didn't work, I downloaded the whole Android Studio for the adb, and it still listed empty.
2. Phone is in developer mode with USB debugging in MTP.
3. Downloaded an app, "USB Driver for Android", for developers who have the same problem and "magically" have adb recognize their phone. But didn't work.
4. adb kill-server and restart. plug and unplug usb. restart computer. check the system info on my pc hardware and the pc recognized it as a mass storage
5. downloaded usb driver on official samsung website but it still didn't recognize Android Phone has been plugged in when I look at the device manager even with the view showing all hidden devices. It recognizes as a USB root hub. so this might be a problem?
Any suggestions are appreciated. This is taking me like 5 hours to figure out. And I read a few comments from people who said it took them 2 days. o_o;;