1 2 3 4 5 6 7 8 |
import sys, os try: raise NotImplementedError("No error") except Exception as e: exc_type, exc_obj, exc_tb = sys.exc_info() exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] print(exc_type, fname, exc_tb.tb_lineno) |
Yes, it's thread-safe. sys.exc_info() was introduced to deal with thread-safety problems in the previous API. Its output is specific t
0 Comments
I recently bught arduino yun shield from Geetech, and discovered there is not straight way even for a linux user , as on Yun we are dealing with OpenWRT lite version of Linux so the packages has to be light as well, as Yun shield has just 5MB of space.
this post is just some links that will be useful, rest I will post in the next upcoming blog post:
Well, Javascript is beautiful jQuery and json is the food for stomach. I cannot come up with anything better but here is how you can get your website visitor geolocation based on his IP.
I was first thinking to recursively call the ajax function to pull IP and then geo data based on IP. But I later realize since both Json is of different structure. Doing that would be too great of a thing. So there you go nice and neat (y)
swell, the title of the post may sound miss leading but actually thats what it is and in this post I am going to share how to plot data from sensors google Line Chart in realtime with no sql involved . I pretty much figured it out months back when I first had a look at setInterval function of javascript and google graph API, all this time I was spending time with google gauge, so this weekend I played with Google Line Chart.
I was displaying the temperature and humidity from outdoor and indoor on google gauge(see here). However the only disadvantage of it is every time you will get to see the latest values and you have no straight away way to see the old values, so I was thinking lets spend this weekend with Google Line Chart while some of my fellow office colleagues are away walking for a noble cause.
on right you are looking at the mobile view of the graph I implemented with lots of digging, researching and reading google Chart Docs . The docs helped me a lot while I was trying hit and try to see what happens with attributes and customisation settings shown on the page.
for little bit of optimisation I use javascript function to detect if the platform the page displaying graph is mobile platform or a desktop. And based on which I adjust the settings of graphs.
Have a look at the graph displaying data in realtime from the sensors connected to Arduino Mega running web server using Ethernet shield. And since its realtime and data is updated every minute based on setInterval function there is no use of sql or any dbms. I believe we only need to punch data into database if we have to do some research or analysis further based on the data. Or if you want to learn about databases .
Getting the IP address over internet is no difficult.
The above code gives us the client IP, however if you want to get local IP address , you can use WebRTC JS API and the ICE protocol (STUN for public IP).
More info here.
thanks for your time, I hope this post helped you.
|
Custom Search
Other Blogs & PagesGit Commands Animation & VFX SitesA MUST READ for Ani/VFX Artistsawakened by thoughts,
|