w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Windows: track memory usage and limit threads
Don't know if this will have any serious impact on the memory consumption, but it's worth of checking if you haven't already done it. When creating a thread, if you don't specify the stack size, the system will use the same amount as for the main thread. This could be 1MB. You probably don't need large stack, so try passing 32k, 64k, 128k...

Categories : Windows

Track C++ memory usage and system resources (No windows environment)
SIGAR has been recommended before It seems to give mostly total memory/cpu usage during runtime but may be useful as it has bindings for many languages and works on many platforms. As for more detailed per-process information, you can get resident, shared, virtual memory totals as well as i/o and page faults.

Categories : C++

How to track jQuery Plugin usage
You could just write a JSONp request into your plugin which pings your web server with the required information each time the init is called on your code: function init() { $.ajax({ type:"GET", url: "http://www.myplugin.com/tracking.php", data: { // All my lovely personal information }, dataType: "jsonp", timeout: 200000 }); } But please give a thought to all the reasons that you shouldn't do the above.

Categories : Javascript

how do I track how many users visit my website
know from myself people are obsessed with traffic, statistics, looking at other sites – tracking their stats and so on. And if there is enough demand, of course there are sites to satisfy You. I wanted to put those sites and tools in one list together, because at least for me this field was really unclear – I didn’t know what means Google Pagerank, Alexa, Compete, Technorati rankings and I could continue so on. I must say not always these stats are precise, but however they give at least overview, how popular the certain page is, how many visitors that sites gets – and if You compare those stats with Your site statistics, You can get pretty precise results then. http://www.stuffedweb.com/3-tools-to-track-your-website-visitors/ http://www.1stwebdesigner.com/design/10-ways-how-to-t

Categories : Python

How to write a service to keep track of gprs data usage on android device
You need to do the following : Create a local database that will store the data usage values . Start a service which runs continuously / periodically to calculate /recalculate the data usage . After data usage is calculated by the service ,add the data into your data usage table . To create local database you can refer to this tutorial on sqlite Here is how you can start a service Creating a Service in Android EDIT There is no way to get notified if any fresh data usage is made .You will have to periodically check it using your service that will run continuously or periodically . You can use the following code to calculate the usage : int UID=Process.myUid(); long recived = TrafficStats.getUidRxBytes(UID); long send = TrafficStats.getUidTxBytes(UID); Other functions that you ca

Categories : Android

Keeping track of users and photos they've viewed
Your best bet is to create a collection with { _id:Generated automagically, pictureID, viewerID } with find( pictureID, viewerID ).limit(1) and an index on pictureID AND viewerID will make checking super ultra fast level 99. very important to set the index. I use find().limit(1) because its faster than findOne, at least from the current benchmarks. why not have one entry per user with an array of viewed images? because searching through the array is slower than searching for a whole document in a collection. 10 million images? no problem. this is where mongodb shines. its designed to scale for big-ass databases like yours. As long as your documents are less than 16 mb, and with 3 properties, it is :) you have little to worry about. When you delete an image, just db.viewed.remove( { pict

Categories : PHP

How to track the users have became fans of my facebook page?
This can be done with FQL (Facebook Query Language) using the Facebook Graph API. What you're looking for is the likes attribute which can be obtained from the JSON returned by http://graph.facebook.com/yourusername. Ofcourse you will need to do further queries to obtain things like how many friends of a specific user liked your page. Probably something along the lines of SELECT ... FROM like WHERE object_id = yourpage and I would imagine you'd need to link that to the friend table with something like WHERE uid1 = friendid to get their friends.

Categories : Facebook

How I can track if users closes tab and show him research window?
You need something like this function formIsDirty(form) { for (var i = 0; i < form.elements.length; i++) { var element = form.elements[i]; var type = element.type; if (type == "checkbox" || type == "radio") { if (element.checked != element.defaultChecked) { return true; } } else if (type == "hidden" || type == "password" || type == "text" || type == "textarea") { if (element.value != element.defaultValue) { return true; } } else if (type == "select-one" || type == "select-multiple") { for (var j = 0; j < element.options.length; j++) { if (element.options[j].selected != element.

Categories : Javascript

Track paid/free users through Flurry Analytics
Yes, you can use events to track in-app purchases. Are you planning to log user ID in Flurry ? Once you implement events in in-app purchases, please reach out to support@flurry.com with the API key of App in question and we will try to find a work around for the same. Thanks

Categories : Android

Is it possible to track users and send their locations to a sever in the background on iPhone?
No, Its not possible. When you put your app in background your app will be in idel state. Hence you cannot track the location of the users who have kept the app in background. Maye be you can have some predefined location sets alrdy. So that when ever other users (A-Z) come across that location thet will notify the actual user.

Categories : Iphone

Track if the users have read documents Sharepoint 2010 Document Center
It gets stored in audit logs. Enable auditing for that particular document library and then get the details using the following code: SPSite oSPsite = new SPSite SPList doclib= oSPWeb.Lists["doclib"]; SPWeb oSPWeb = oSPsite.OpenWeb() SPListItemCollection doclibitems= doclib.Items; foreach (SPListItem odoclibItem in doclibitems) { odoclibItem .Audit.AuditFlags = SPAuditMaskType.View; // odoclibItem .Audit.AuditFlags = SPAuditMaskType SPAuditQuery oquery = new SPAuditQuery(oSPsite); oquery.RestrictToListItem(odoclibItem ); odoclibItem .Audit.Update(); SPAuditEntryCollection oAuditEntryCollection =SPsite.A

Categories : Sharepoint

R: Time stamps, Unix time and correct usage of 'strptime'
You need the lowercase %y for 2-digit years: R> pt <- strptime("1/11/07 15:15",format="%m/%d/%y %H:%M") R> pt [1] "2007-01-11 15:15:00 CST" R> where CST is my local timezone. And as.numeric() or as.double() converts to a double ... R> as.numeric(pt) [1] 1168550100 ... which has fractional seconds if those are in the input: R> options("digits.secs"=3) # show milliseconds R> as.numeric(Sys.time()) # convert current time [1] 1372201674.52 # now with sub0seconds.

Categories : R

Meteor server-side memory usage for thousands of concurrent users
Take a look at this post by Arunoda at his meteorhacks.com blog: http://meteorhacks.com/making-meteor-500-faster-with-smart-collections.html which talks about his Smart Collections page: http://meteorhacks.com/introducing-smart-collections.html He created an alternative Collection stack which has succeeded in it's goals for speed, efficiency (memory & cpu) and scalability (you can see a graphed comparison in the post). Admittedly in his tests RAM usage was negligent with both Collection types, although the way he's implemented things there should be a very obvious difference with the type of use case you mentioned. Also, you can see in this post on meteor-core: https://groups.google.com/d/msg/meteor-core/jG1KLObX1bM/39aP4kxqWZUJ that the Meteor developers are aware of his work and

Categories : Meteor

HTML5 App on Windows 8 which cannot be closed
This isn't possible on Windows 8; the soon to be released Windows 8.1 has a "Kiosk Mode", which seems to be what you are looking for. From Windows 8.1 kiosk mode locks systems to a single app: Generally speaking, kiosk mode is something that’s intended for use in corporate and shared computing settings — like public information terminals. It would, for example, make an excellent way to lock a point-of-sale terminal in to the “cash register” app and prevent would-be procrastinators from tabbing out and surfing the web.

Categories : HTML

How can I stop users from picking an end time that is before the start time
the idea is right, the problem is how you compare your dates. I have tried calling datepicker("getDate"), which returns a String, I assume this is the same on your datetimepicker plugin. The strings you are comparing look like Wed Jun 12 2013 00:00:00 GMT+0200 (CEST) and here the equality is just based on the lexicographical order of the Weekdate. But if you use the JavaScript method Date.parse(), you can easily compare those: var testStartDate = startDateTextBox.datetimepicker('getDate'); var testEndDate = endDateTextBox.datetimepicker('getDate'); if (Date.parse(testStartDate) > Date.parse(testEndDate)) endDateTextBox.datetimepicker('setDate', testStartDate); With this gist I have a toy website where you can try your validation, the first date already works: https://gist.github.

Categories : Javascript

When shutting down the application, not all windows are closed
Make sure that your thread(s) is/are stopped, before the application exits. You could do this by using Thread.Abort or wait for it using Thread.Join. But those are nasty ways to end or wait for a thread. The best way is to use a bool to stop it from running. Here is how to stop your thread the "Clean" way: http://stackoverflow.com/a/10664959/1661209

Categories : C#

Need to track the date/time a report is printed
I would store this data in a table within the database. table Layout: id | reportname | firstprint | lastprint instructions: On report.load() query the table to see if the report has a record for first print. If it does not have a record set that field with the current date. If it does have a first print record, update the last print with the current date. Then on report.current() you can use if statement to see if a query has a lastprint record for that report. If it does then set the text of an unbounded label to "Last Printed On: " & the date. If it does not have a date in the lastprint then you can change the unbounded label to "First Print: " & date. If you need help with the vba PM me and I'll assist.

Categories : Ms Access

How to track distance accurately between two locations in windows phone using GPS?
Are the "incorrect values" within a few dozen meters of the original location? If so, what you might be seeing is just the inaccuracy of GPS. GPS isn't 100% accurate. Even if your device isn't moving, the location where the device's GPS thinks it is can change. In fact, your calculated location might not be based on true GPS at all, but on Wi-Fi or on nearby cell towers (A-GPS), both of which are much less accurate. See this StackOverflow thread for more information. For debugging purposes, I suggest displaying the HorizontalAccuracy somewhere on your UI to see if the GPS drift is in line with expectations.

Categories : C#

How to track down "Connection timout during SSL handshake" and "Connection closed during ssl handshake" errors
This sounds like clients who are going away mid-handshake (TCP RST or timeout). This would be normal at some rate, but 5-10% sounds too high. It's possible it's a certificate issue; I'm not certain exactly how that presents to Things that occur to me: If negotiation is very slow, you'll have more clients drop off. You may have underlying TCP problems which you weren't aware of until your new SSL endpoint proxy started reporting them. Do you see individual hosts that sometimes succeed and sometimes fail? If so, this is unlikely to be a certificate issue. I'm not sure how connections get torn down when a user rejects an untrusted certificate. You can use Wireshark on the HAProxy machine to capture SSL handshakes and parse them (you won't need to decrypt the sessions for handshake anal

Categories : Ssl

multiple HTML5 audio behavior : one track at a time please
Add a parameter to your pauseAllAudio function which excludes a particular element: function pauseAllAudio(exclude) { allAudioEls.each(function() { var a = $(this).get(0); if(a !== exclude) { a.pause(); } } } And then pass song to pauseAllAudio: var song = $(this).next('audio').get(0); pauseAllAudio(song); If you didn't need to play the song in this code block, you could simply move the pauseAllAudio() call down beneath the check. However, doing so would make it unable to ever play for longer than the infinitesimally small amount of time it would take to go from song.play() to pauseAllAudio()

Categories : Jquery

Track time duration for which video was played - Web, iOS and Android
You won't need a speical player for this. The mediaelements audio and video already have a property called played.

Categories : Android

how to track the time duration video played in ipad app
You can record the start date and end date, then compare the date to see how long the video was played. Date includes time too. So: 1) When user presses play, you can go: NSDate *startPlayDate = [NSDate date]; 2) When user stops the video, you can go: NSDate *stopPlayDate = [NSDate date]; 3) Now compare the difference in the two dates, you should see how many seconds the user played the video for: NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar]; NSDateComponents* components = [gregorianCalendar components: NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:startPlayDate toDate:stopPlayDate

Categories : Iphone

Do dictionaries keep track of the point in time where a item was assigned?
No. The results you got were due to arbitrary choices internal to the dict implementation that you cannot depend on always happening. (There is a subclass of dict that does keep track of insertion order, though: collections.OrderedDict.) I believe that with the current implementation, if you switch the order of the PL1 and PL2 lines, PL1 will probably still be deleted.

Categories : Python

How to track execution time of each line / block of lines / methods in PHP?
This is what you are looking for: http://xdebug.org/docs/profiler. You can set up netbeans to attach to php process, than run scripts step by step, watch current variables content and analyze its running times. Just add dll to other php extension, configure by php ini: ; xdebug zend_extension = "C:phpv5.4extphp_xdebug-2.2.3-5.4-vc9-nts.dll" xdebug.remote_enable=on ;xdebug.remote_log="/var/log/xdebug.log" xdebug.remote_host=localhost xdebug.remote_handler=dbgp xdebug.remote_port=9000 xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:devprofilling" Netbeans setup: Then press Ctrl+F5 in netbeans (debugging). Than you can run script step by step and watch current variables values: To browse generated profilers log use http://sourceforge.net/projects/precompiledbin/ or http://sou

Categories : PHP

Track time spent compiling in Flex/Flash Builder
I know this probably doesn't work either (since it requires ant-contrib), but we use the "Stopwatch" task of ant-contrib. http://ant-contrib.sourceforge.net/tasks/tasks/ Also, ant-contrib has some other very useful features like: if for foreach PropertyRegex Variable Example of the end of our build scripts: BUILD SUCCESSFUL Total time: 37 minutes 46 seconds [timestamp]: Build started on: Sat Aug 31 06:05:50 PDT 2013 [timestamp]: Build completed on: Sat Aug 31 06:43:35 PDT 2013 [timestamp]: Total Build Time: 37 Min 45 seconds Finished: SUCCESS

Categories : Eclipse

how to make application with time limit before it automatically closed in C
If you are on a POSIX system then use alarm(3) (credit to @Duck for suggesting this first in his comment): #include <stdio.h> #include <signal.h> #include <unistd.h> static void sighandler(int sig) { if (sig == SIGALRM) exit(0); } int main(int argc, const char **argv) { signal(SIGALRM, sighandler); alarm(15); // do things here }

Categories : C

Windows Phone 8: Updating Live Tile data when app is closed
Does this mean I need to have separate instantiations of this class, one for the main application and the background agent? Yes. You must think of the background agent as a separate application. Though there is ways to share data between your application and your background agent, but the extra complexity isn't worth it in your case. Note that you can share the implementation of your class between the application and the background agent by putting it in a third project (and referencing this project from both the application and the agent).

Categories : Windows Phone 8

SQL Server Getting where an data object was based in a Period of Time given Track Info
OK, try this, using your updated sample data: Declare @Trackings table ( ProductID bigint , value float , StoreID int , DateID int , Aux_Row_Number int ) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,1,1,325.2,1) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,1,2,326.2,2) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,1,3,329.6,3) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,2,4,335.2,4) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,2,5,336.5,5) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row_Number) Values (100,2,6,338.3,6) Insert into @Trackings(ProductID,StoreID,DateID,value,Aux_Row

Categories : SQL

How to implement a page using modal windows and auto refresh divs when they are closed?
I'm oversimplifying this because you're asking how to do it, not specific details. So keep in mind this is kind of a guideline, but you tweak and adjust to fit your needs. So, this is what I would do: Have the view where you want to display the list. Lets call it view.ctp, in there you'll have a table (or something more fancy) with the people added Example code view.ctp <table> <? foreach ($people as $id => $person) { echo '<tr><td>'.$person['name'].' '.$person['lastname'].'</td></tr>'; } ?> </table> Add a modal window. Let's use jquery ui's (you need to search and see which do you prefer). Example also in view.ctp <div id="dialog-form" title="Add something"> <? echo $this->Form->create(). $thi

Categories : Cakephp

Getting current cpu usage in c++/windows for particular process
You need to use GetProcessTimes And unfortunately, it won't give you the "CPU usage", it will give you the amount of CPU-time since the process started. So to get CPU usage, you will need to take one sample, store that, and then take another sample a known amount of time later, and then calculate the time (and if you want to know the total usage, you'll need to add the usertime and kerneltime together, of course).

Categories : C++

Windows Phone 8 async await usage
Make sure your method in your "main app" code also has the "async" modifier: public async Task GetAddress() { WebApiWorker webApi = new WebApiWorker(); var geoResponse = await webApi.GetGeocodeAsync("address"); }

Categories : C#

Keeping CPU Usage Low for a certain amount of time. c#
int secondsWhileLowUsage = 0; do { cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); var usage = cpuUsage.NextValue(); do { Thread.Sleep(TimeSpan.FromSeconds(1)); usage = cpuUsage.NextValue(); if (usage > 10.00) secondsWhileLowUsage = 0; Console.WriteLine(usage + "%"); } while (usage > 10.00); secondsWhileLowUsage ++; } while (secondsWhileLowUsage < 5) Process proc = new Process(); proc.StartInfo = new ProcessStartInfo(@"C:Documents and Settings cgamesDesktopGame1.exe"); proc.Start();

Categories : C#

Node.js console gets closed immediately after i execute the program from Visual Studio 2012 in Windows 8
Instead of directly executing node app.js from Visual Studio, you could instead call a batch file: wait.bat app.js Which inside of wait.bat it simply: node %1 pause press [enter] or, you could do this on one line, or wrap it in a module or a function: require('readline') .createInterface(process.stdin, process.stdout) .question("Press [Enter] to exit...", function(){ process.exit(); }); It's using an currently marked as "unstable" module of Node to read line input from stdin. It ignores the input though and then closes the process using the exit function.

Categories : Javascript

RAM usage limit for .NET applications on Windows Server 2012?
It's not a question of "why is the server swapping" so much as "why is my app eating so much RAM?" STRONG SUGGESTION: Download the Microsoft CLR profiler: http://www.microsoft.com/en-us/download/details.aspx?id=16273 http://msdn.microsoft.com/en-us/library/ff650691.aspx To your original question "Why does the server use swap even if it should have plenty of free RAM?" - there are many possible reasons. You'll need to have administrative access to the server to determine exactly what's going on. These links might help: http://serverfault.com/questions/305295/why-does-windows-2008-use-swap-before-the-memory-is-full http://blogs.technet.com/b/askperf/archive/2008/03/25/lock-pages-in-memory-do-you-really-need-it.aspx <= You need to consider not just your app, but other things runn

Categories : C#

How to get connection/network usage time on android
How about an connection check like public boolean isOnline() { // check if an internet connection is present ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (!(netInfo != null && cm.getActiveNetworkInfo().isAvailable() && cm .getActiveNetworkInfo().isConnected())) { return false; } return true; } And then counting time ... Dont forget the <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> in the Manifest.

Categories : Android

Usage of Node JS with PHP in Real time Scenario
It's hard to say from what you provided. Node.js seems to be used here for realtime transmition only. When you first load the page, php output the old (allready posted) messages from a table. Later, when a new message is sended, php store it into the table (for later access) then send it to node.js which will then broadcast it to other clients. Node.js don't seems to be used here for message persistency. The exact behavior of node.js is hard to explain here. In a chat application it can be used as a push server (take a message as entry, then push it to other clients) but it has the capacity to be used as a full blown webserver too...

Categories : PHP

Weird time behaviour with $_SESSION usage
Your example seems somewhat contrived. The PHP time() function should return a much higher number: int time() Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). For an example of how to use the time() function go to the manual page. It shows clearly that you may be better off using date() for your purposes. You should be clear about where you are setting $_SESSION['mailtime']. In your example the output indicates that the lines you are setting the variable some seconds before you are comparing it to time(). To debug, you have to show your code, not just an artificial example.

Categories : PHP

Writing a method to play every track in a track list exactly once in random order
Can you use Collections.shuffle() in your code ? As per the docs : Randomly permutes the specified list using a default source of randomness. All permutations occur with approximately equal likelihood. You can shuffle the List and get the first element from the shuffled List each time.

Categories : Java

What slows down Java if CPU usage low, hdd usage low, memory usage low?
You can test what is the bottle neck by taking different parts out of the equation. To take out the CPU, just read the files and don't do anything else. To take out the disk, keep reading the same file again and again, assuming it fits in your file cache. Compare this to the time for everything.

Categories : Java

Compile time error due to invalid method usage
The error message here is telling you everything you need: your evaluate method call has the wrong signature. Either pass the correct parameters (Node, short, Object), or overload the method with a signature you prefer (i.e. (Document, QName)). You'll have to either build the correct parameters from the ones you're currently using, or you'll have to write your own version of the evaluate method.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.