How does Gmap.net cache works? - c#

I´m using the GMAP.net library in a project and I found it was a powerful tool. It´s cache facility made it a real profit to my project. Anyway, I need if someone can tell me a little bit of how that cache works. As far as I tested it, I can see that it pre-allocates space (in my case about 200 mb on SQLITE file), so I started doing some test seeing how it worked, and it turns out it works really well, but in some cases I have been viewing maps that haven´t been cached. I don´t know if I have to spent some time with the position on the map so It can be cached or something like that. Does the tile cache file size increases with the time?, or it just keeps the prealocated size?.
Thanks in advance for any possible answer.

I've been doing some research on this same topic. I learned that the application by default has a gmdb of 256mb. This doesnt mean that there is 256mb of cached map. It just creates room for the cache data. Look at this post by Radio man for more clarity. Hope this helps. If you find more info post if for others because there is a lot of missing info on this topic.
http://greatmaps.codeplex.com/discussions/274628

Related

Image analysis in C# with ML.Net

I have thousands of jpegs in a folder structure. These images are a snapshot of my driveway in 2560 x 1440 and are taken and stored every 60 seconds.
I'd like to create a program that can detect, from analyzing an image, whether I or my wife, was home at that particular time or not. I have a red car, she has a bright yellow car. So a simple color threshold should probably suffice. Another clear distinction is that we both have our own spot and never park in the others. Also, other people don't use the driveway (and if they do, I don't mind a false positive). One minor complication is that the camera's switch to black/white during the dark (but that may be when the parking spot rather than the color might come in handy).
So I was hoping I could use ML.Net and train a model with some hand-annotated images where I tag the image with data whether I see my or her car in the driveway. I was thinking of annotating maybe a 100 to a couple of hundred images for day and another set for night and feed all these images to ML.Net to train it and then have analyse a few 100 images where I can manually check the results and correct any mistakes and then create a sort of feedback-loop to train on a few hundred more images.
Once the training is complete I'd like to analyze all images currently stored and each new image as it comes in to generate some data on when I'm (or my wife is) home, away etc.
My problem is (and this is probably going to be the reason for the question being closed as "too broad" or something): I have no clue on how to do this. I have seen awesome tutorials that all make it seem like child's play but when I then try to do this in C# (my language of choice) and look for ML.Net Howto's I can't seem to find anything that helps me in the right direction.
For example: Train a machine learning model with data that's not in a text file. I'm a competent programmer so it's peanuts to create CSV file / database / whatever that has 1.jpg -> rob home, wife not home data. But the "How To" doesn't explain how to feed the image into ML.Net and I haven't been able to find anything that does. Most probable cause is that I'm new to ML(.Net) and probably that I'm too stubborn to give up trying to accomplish this in C# but the information available is, weird as it sounds, overwhelming but also scarce. The information available usually leads me going down some rabbit hole only to find out after way too long that it's not what I want or I can't find anything that hints of me going in the right direction.
So long story short; tl;dr:
How do I feed images into ML.Net, how do I tell ML.Net that my/her car is in the driveway for any given image (training) and how do I get ML.Net to tell me whether it thinks I'm / my wife is home or not for a given image? Or is this not possible (currently)? I'm NOT looking for complete code but for pointers, hints, links, tutorials, examples or whatever may help me in the right direction.
you might find something usefull here Image recognition/classification using Microsoft ML.net 0.2 (Machine learning)
However I would encourage you to consider python as weapon of choice for your task.
Here you would just store the data in different folders according to the label, you #home, your wife #home, both #home, no car in the drive way, other
and you are ready to go.
https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
It probably won't take you more than a weekend, and thats inlcuding to learn the bacics of python.
Edit:
I seems as it still does not support to train image classification tasks using ML.Net: "Again, note that this sample only uses/consumes a pre-trained TensorFlow model with ML.NET API. Therefore, it does not train any ML.NET model. Currently, TensorFlow is only supported in ML.NET for scoring/predicting with existing TensorFlow trained models."
There is a thread about it here https://github.com/dotnet/docs/issues/5379,
What you could try is uses: http://www.emgu.com/wiki/index.php/Main_Page in combination with OpenCV, this https://www.geeksforgeeks.org/opencv-python-program-vehicle-detection-video-frame/ is an example in python but it should translate well to c++ or c# using emgu. Once the car is detected check for the position and color. This approach would probably also avoid labeling any data.
Alternatively use a pre trained model h5 file and load into ML.Net then check for the position and mean color to check whos car it is.

Loading Heavy Graphics

I am trying to create a game but before that i am creating all the graphics that will be used in it but here is the problem.
Problem
The current games graphics size is 50MB and might increase as all the graphic work is not done yet and it is not possible to load 50 MB every time when the user runs the game. So, please tell me this if it is possible to downloaded all the graphics on the first run and use it again when the user runs the game again?
If yes then please help me by giving a piece of code snippet or any article related to it. Platform : ASP.NET
Take advantage of all the different caching mechanisms:
Http Caching. You may read more about it here. Especially the section "2. Expires"
HTML5 has the concept of local storage and you can possibly take advantage of that as well. You can read more here.
Try and compressing the graphics. You can read more here. Especially the section "Minimize payload size".
Good luck and hope that helps.
You can download all the graphics on the first run & cache it. This will improve the performance tremendously.
Best practice is to use a CDN/Cache Server.
Refer to the following article for catching: Link & Link

How to get motherboard sensor readings in C#

I'm trying to get any temp/fanspeed/accelerometer readings from my motherboard in C#
I have done a lot of research and I know its not easy, but it has to be possible to get something I can work with.
I have tried using motherboardmonitor.net but I can't figure out how to incorporate the dll into my program.
I have tried "using motherboardmonitor" with the motherboardmonitor.DLL i downloaded. But there is absolutely no documentation on how to use it. Im just fumbling around with it at the moment to no avail.
And I have tried using the sensor.dll but I dont think i have enough knowledge to go any further.
Here's a working example of what you are trying to achieve. Hope it's helpful.
http://forums.whirlpool.net.au/archive/1723879
It might not be a full solution, but it should get you started in the right direction.
The following is usefull too:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/34f0fa55-567b-4a98-a29d-b92a5c9b5f8f/
CPU temperature monitoring

SilverLight: How to record a video from a web camera

I have searched how to use SILVERLIGHT to record video for days but got no luck.
Most articles related to SL only talk about how to record audio or snap a picture rather than recording a video file and save it somewhere.
And I found there is no resources about it on Internet(I am surprised!!!)!
So could you provide me an example code with proper explanation?
I am waiting for it.
PS: I do not want to use Flesh as none iPhone nor iPAD supports it.
Thanks
Fortunately, Mike Taulty's source code can easily be updated to work with Silverlight 5. You can download the fixed source code and try it out (Disclaimer: all code courtesy to Mike Taulty, I merely fixed SL5 compatability and ran a cleanup). Use your favorite diff tool to see the changes I made.
I have tested it, and it generates video files that can be viewed in VLC media player (after selecting build index to fix the corrupted index). As the file format is not 100% correct, the files can not be opened in Windows Media Player etc... but I'm sure that can be fixed.
You should, however, be aware of the fact that Silverlight is not supported on iPhone, iPad, Android, and Windows Phone (Windows Phone apps are made on a special version of Silverlight, but can not run Silverlight applications in the browser).
Unfortunately, after undergoing hundreds of hours researching on the possible solution, I finally found the answer in a book called: Pro Silverlight 4 in C# (Matthew MacDonale, APress).
According what is said on the page 436, although you can do it with Silverlight 4 (you have to write your own file header helper, store the row data as byte arrays and later on you have to convert them into a raw video data and what is worse is the audio and video are separated.), it is just not practical and worthy to do it. Because it requires reams of complex, handwritten code to convert it, and the conversion process is computationally expensive, which makes it extremely difficult to do in real time.
So I guess this would be the conclusion of my question. Now what seems still make sense for me is to find out why Microsoft doesn't support it and what is the new technology which is going to be used/ has been used to replace the SL.
Is it HTML5? But as far as I know, there is only a video tag in HTML which can only be used as a video player, but no tag to support to get the access of a web camera and save the captured video+audio at the same time as one file onto somewhere which could be a local hard drive or a network storage.
I hope all dear you could come up with some thoughtful advice.
I am going to leave this question un-answered for a few days to see whether there could be someone who can come up with some fantastic solution.
Thanks again.

Architecture of a CMS

I am building a custom Content Management System for my client, using C#2008, ASP.Net technology. I am looking for advice regarding the architecture (application layout, database layout etc) of such a system.
Anyone here have any experience design / developing such a system? Any websites that I can get more information from?
Any open source CMS out there?
Thanks in advance.
Any open source CMS out there?
Check out Umbraco, its very good, not suitable for everything (depends on your sites content really) but you get so much for free that it would be silly to not give it a look over, its not a small bedroom hack up job.
Regarding creating your own CMS, I'd probably try to steer you away from it, its not for the faint of heart unless your content demands are very niche. Even then its better to build on top of something else if at all possible.
ASP.net MVC would be worth a look too if you are going down that code your own route, would save you some headaches.
DotNetNuke is a good open source CMS is specifically for ASP.NET development. Definitely worth a look.
I've written a blog post about content modeling and data stores for content management systems. I think it could be useful: Blog post: Get more out of your content: content modeling and data stores

Categories