w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Display different messages to returning visitors and new visitors
Probably the easiest thing to do would be to set a cookie t track if they have visited the site before. setcookie("FirstVisit", '1'); Then your welcome method would then become something like this: function DisplayWelcomeMessage() { if (isset($_COOKIE['FirstVisit']) && $_COOKIE['FirstVisit'] == 1) { // Display a welcome message // Update the cookie so that they don't get this message again setCookie("FirstVisit", "0"); } else { // Do something different for people who have visited before } } You can lookup the documentation for setCookie here

Categories : PHP

get the information on the last closed iOS App
It is not possible to get the last closed iOS app, but if you have two apps and you want to be able to move between the apps you may be able to use URL schemes. URL Schemes Documentation Here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

Categories : IOS

Can I get a visitors default currency symbol with javascript?
As far as I know, There are no libraries or ECMA script to help with this. I would go about it as: Get the locale of the visitor and implement custom logic to show currency based on the given locale. You can try implementing the logic with help of Accept-Language header. Though, there are best practices when using Accept-Language header. http://www.w3.org/International/questions/qa-accept-lang-locales If targeting Modern browser, One can also use geolocation to determine the location and have a custom logic to show currency based on the location. Though, users can deny permission to get the geo location.

Categories : Javascript

Get visitors language & country code with javascript (client-side)
navigator.language isn't reliable as one of your linked questions states. The reason this is asked a lot, but you're still searching says something about the problem. That language detection purely on the client side is not anything close to reliable. First of all language preferences should only be used to detect language preferences - i.e. not location. My browser is set to en_US, because I wanted the English version. But I'm in the UK, so would have to alter this to en_GB to have my country detected via my browser settings. As the 'customer' that's not my problem. That's fine for language, but no good if all the prices on your site are in $USD. To detect language you really do need access to a server side script. If you're not a back end dev and want to do as much as possible on the

Categories : Javascript

Is it wise to use the noscript tag for tracking visitors who have javascript disabled, since noscript is deprecated?
Visitors that have JavaScript disabled means practically: Screen readers for blind people - I don't see a reason they should download images Some bored admin viewing page with text-mode browser - no images downloaded as well Google BOT or some other bot crawling pages - they would do with the links what they want, for example ignore it Scripts writing the page for offline usage, that would save the image or not, depending on the settings (in most cases not) The only place where such image-tracking could have work are the HTML mail messages, but such images are normally blocked, or you could fall under spam filter.

Categories : HTML

how to find when ad has been closed Revmob cocos2Dx
I need to check that the ad has been closed Revmob offers an option to pass custom delegate when launching: RevMobAds.h: + (RevMobAds *)startSessionWithAppID:(NSString *)anAppId andDelegate:(id<RevMobAdsDelegate>)adelegate; The RevMobAdsDelegate allows you to implement a function, which would be called when the ad gets closed by user (which is what you want). RevMobAdsDelegate.h: /** Fired by Fullscreen and popup. */ - (void)revmobUserClosedTheAd; Basically you want to implement that delegate callback and you are set. Personally I prefer to make my AppController implement the required delegate protocol (in your case - RevMobAdsDelegate): AppController.h: @interface AppController : NSObject <UIApplicationDelegate, RevMobAdsDelegate> And then, in AppController.m

Categories : C++

where do I find page source of pages on my system which I opened in Chrome and then Closed
it should be at ~/Library/Caches/Google/Chrome. good luck digging there :S this issue of loosing files was fixed years ago, learn how to use git http://try.github.io/

Categories : Osx

Check a web form is closed / refreshed in javascript
The function work fine IE but not in other browsers. That's absolutely normal. Other browsers simply do not allow you to be alerting in this function. Check that fiddle out in Chrome: Sorry, you should forget about alerting in an onbeforeunload handler. The only thing you should be doing in this handler is returning a string result: window.onbeforeunload = function (e) { var y = window.event.clientY;// e.pageY || e.clientY; if (y < 0) { return 'Window closed'; } else { return 'Window refreshed'; } }; It's the responsibility of the browser to decide how to display this information to the user, not you by telling it to explicitly alert.

Categories : C#

Trying to toggle a drawer open and closed with javascript
Try event delegation, since you are working with dynamic selector values $(document).on('click', '.arrow-up', function() { $('.portfolio-details').css('height',250); $('.portfolio-details h2 span').removeClass('arrow-up'); $('.portfolio-details h2 span').addClass('arrow-down'); }); $(document).on('click', '.arrow-down', function() { $('.portfolio-details').css('height',25); $('.portfolio-details h2 span').addClass('arrow-up'); $('.portfolio-details h2 span').removeClass('arrow-down'); });

Categories : Javascript

How to use a regular expression for checking if comment is closed in javascript?
There is no way to use regular expressions for checking parenthesis. In order to check if brackets or comment (e.g. /../) are closed, you have to iterate over a string, count the number of opening brackets, and of closing brackets, and to compare. Example: function check(str) { var paranCount = 0; for (var i = 0; i < str.length; i++) { if (str[i] == '[') paranCount++; else if (str[i] == ']') paranCount--; if (paranCount < 0) return false; } return !paranCount; } Note: This only applies to code pieces that do not contain string (for example), though the inline string "asfasdf[[[" is legal inside the code, yet this function will not deem it so. With the absence of other limitations to the code, you should use a

Categories : Javascript

How to find information in powershell?
I am not familiar with powershell scripting but found this, maybe some reference to use: http://technet.microsoft.com/eng-us/scriptcenter/powershell%28en-us%29.aspx http://technet.microsoft.com/en-us/library/hh857339.aspx#BKMK_wps4 On the first link are PowerShell Scripting Webcasts to find and more. Scheduling Jobs with the Windows PowerShell API: http://msdn.microsoft.com/en-us/library/windows/desktop/jj150476%28v=vs.85%29.aspx Guide to getting started with Windows PowerShell: http://technet.microsoft.com/library/ee221100.aspx About Windows PowerShell, following help topics: get-command : Gets information about cmdlets from the cmdlet code. get-member : Gets the properties and methods of an object. where-object : Filters object properties. about_object : Exp

Categories : Powershell

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

How can one find out more information when a JVM becomes unresponsive to SIGQUIT?
You can't, this is why it's called "hang". JVM process is unresponsive due to internal issues (e.g. infinite loop, deadlock...), so it won't respond. This could be due to a bug in the JVM implementation. You can try to debug the JVM to find out what's happening. HotSpot is GPL so you can get the source code as well. If you suspect something in your code is causing this hanging (for example, JVM always hangs when you perform a specific operation), you can paste it so we can take a look.

Categories : Java

"Could not find any information for class named ViewController"
I would try to remake the .m and .h files in question and give them an original name, not generic like "ViewController". Try something more along the lines of what you want that file to do, and ending in View Controller (i.e. "PizzaDecoraterViewController") Then select the ViewController that you want to connect to those files. Make sure that you select the ViewController, not just an object within. Click the black bar at the bottom (the one that has the "First Responder" and "Exit" icons). The entire ViewController should outline blue. Then go to the Custom Class section in the Identity Inspector and you should see a grayed out "UIViewController" in the first field. In that field, type in the name of the .h or .m file that you want it to connect to (Start typing PizzaDecorator... and it

Categories : IOS

How do I find the Collection Membership Information with PowerShell
Rather than connecting to each computer and extracting the information (slow) get it from the straight from the database.... [CmdletBinding()] param ( [string] $hosts = "", [string] $sccmsrv = "", [Parameter(Mandatory=$False,Position=3)] [string] $path = "" ) $usage = "USAGE: List-AdvertCollMembershipSCCM.ps1 -sccmsrv SCCMSERVER -hosts 'host1 host2 host3' -path 'c: empOutfile.csv'" if ($host -and $sccmsrv){ Write-Host "" Write-Host -ForegroundColor Yellow "SCCM Server: $sccmsrv" Write-Host -ForegroundColor Yellow "Looking at hosts: $hosts" #### Function for executing a SQL query with integrated authentication function execSQLQuery ([string]$fSQLServer, [string]$db, [string]$query){ $objConnection = New-Object System.Data.SqlCli

Categories : Powershell

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

Find cells with more than one email and separate them into different tables with all of the other information the same
Use ( lets call it contacts table ) ID | NAME | ADDRESS ==================================== 1 | Bob | 999 bob street, UK 2 | Jimmy | 123 jimmy house, USA Join it with (lets say contacts_emails table): ID | Contact_id | EMAIL =============================================================================== 1 | 1 | bob@email.com 2 | 2 | jimmy@email.com 3 | 2 | jimmy-partner@email.com

Categories : PHP

Bunch of Could not find schema Information for element statements for xaml file
I think there is no way to fix this issue. I had this issue also in the past and after googling I ended up that it is a nown issue in Visual Studio 2010. The problem I also noticed was that in my application (with multiple projects) Visual Studio did not build a part of my projects any more. Only deleting the ouput files helped. Therefore I switched to Sharp Develop. Until now I dont have any strange issues with XAML or references any more. But maybe also a switch to VS2012 will help.

Categories : Wpf

Unable to find element with id == bla bla (WARNING: The server did not provide any stacktrace information)
Did you try the following code. d.findElement(By.id("username")).sendKeys("admin"); Thread.sleep(3000); d.findElement(By.id("password")).sendKeys("admin"); Thread.sleep(3000); driver.findElement(By.id("button")).submit(); I guess the driver was unable to recognize the sequence that has been given to find the element. HTH, Sham_

Categories : Internet Explorer

Send information from the WCF to JavaScript
SignalR is a good way to do it, you can see this in detail in the following question: Use SignalR to notify from wcf to JS

Categories : Javascript

Get information about the Visitor (Javascript / PHP)
If you would like to Geo Locate your visitors, and discover their physical location based off their IP, MaxMind has a great service with a free option. http://www.maxmind.com/en/geolocation_landing

Categories : PHP

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

Pop up message for first time visitors
You have problems in your getCookie function. Try with this: CODE function getCookie(c_name) { var c_value = document.cookie; var c_start = c_value.indexOf(" " + c_name + "="); if (c_start == -1) { c_start = c_value.indexOf(c_name + "="); } if (c_start == -1) { c_value = null; } else { c_start = c_value.indexOf("=", c_start) + 1; var c_end = c_value.indexOf(";", c_start); if (c_end == -1) { c_end = c_value.length; } c_value = unescape(c_value.substring(c_start, c_end)); } return c_value; } example here: http://jsfiddle.net/TWB68/1/

Categories : Javascript

SQL Query - Determining new visitors each day
[Edit - altered to use a DateTimeOffset instead] I've come up with the following, starting off with creating the base MyTable: -- Test data creation to match schema & examples create TABLE MyTable ( HitDate DateTimeOffset NOT NULL, IpAddress varchar(15) ) insert into MyTable values ('7/10/2013 8:05:29 -07:00', '111.222.333.444') insert into MyTable values ('7/10/2013 12:05:29 -07:00', '111.222.333.222') insert into MyTable values ('7/9/2013 9:05:29 -07:00', '111.222.333.444') insert into MyTable values ('7/9/2013 10:05:29 -07:00', '111.222.333.555') insert into MyTable values ('7/8/2013 11:05:29 -07:00', '111.222.333.222') insert into MyTable values ('7/8/2013 4:05:29 -07:00', '111.222.333.555') -- actual solution starts here create TABLE #MyTable ( HitDate date, IpA

Categories : SQL

Antlr4 visitors and members
This example by Bart Kiers really helped me: If/else statements in ANTLR using listeners There's more info if you grab the example source files: https://github.com/bkiers/Mu

Categories : Java

How to get traffic sources of my visitors?
you may get visitor IP-Address for unique visitor. Which technology you are used? If you are used PHP Technology.Here is the code for find IP echo SERVER['REMOTE_ADDR'];

Categories : Google Analytics

Block visitors from autosurf
According to http://www.wpwebhost.com/how-to-block-traffic-from-autosurf-sites-using-htaccess/ you can block AutoSurf with .htaccess. Copypasta: RewriteCond %{HTTP_REFERER} auto_surf_site.com [NC,OR] RewriteCond %{HTTP_REFERER} auto_surf.com [NC,OR] RewriteRule .* - [F] I guess you could add a RewriteRule for every site you wanted to block. Also note that blocking according to the referer probably doesn't catch 100% of visitors from that site.

Categories : PHP

Checked exceptions in visitors
You have two options: Handle the exception inside the visitor method itself. Wrap your checked exception in an unchecked exception. One possibility is ParseCancellationException, but you'll have to determine for yourself whether or not that makes sense in your application. try { ... } catch (IOException ex) { throw new ParseCancellationException(ex); }

Categories : Ant

Blocking Visitors Referred From Indicated Domains
Found another route to go.. still .htaccess, but a different syntax that separates out the testing of the referrer from the forbidding of the referrer. # Deny access to all with status "banned" SetEnvIfNoCase Referer "^http://([a-z0-9-]+.)?sweetfreestuff.com.*$" banned # Enable Rewrite mode Options +FollowSymlinks RewriteEngine On # 301-Redirect to themselves RewriteCond %{ENV:banned} ^1$ RewriteCond %{HTTP_REFERER} ^(.*)$ # In any case => 403-Forbidden Page Order Deny,Allow Deny from env=banned

Categories : Htaccess

Restrict domain to Chrome visitors? Possible?
Yes you can. The browser that is accessing the page is in the _SERVER array. If you find that the accessing browser is not Chrome, then just send a 404 header.

Categories : PHP

SQL output unique visitors for each hour
It gets complicated with CASE statements, but here you are. I felt like a challenge before going to bed table stats(id,unique_visitors,time_period) select DATE_FORMAT(time_period ,'%Y-%m-%d') as date, sum(CASE WHEN EXTRACT(hour from time_period) = 00 THEN unique_visitors ELSE 0 END) as '00', sum(CASE WHEN EXTRACT(hour from time_period) = 01 THEN unique_visitors ELSE 0 END) as '01', sum(CASE WHEN EXTRACT(hour from time_period) = 02 THEN unique_visitors ELSE 0 END) as '02', sum(CASE WHEN EXTRACT(hour from time_period) = 03 THEN unique_visitors ELSE 0 END) as '03', sum(CASE WHEN EXTRACT(hour from time_period) = 04 THEN unique_visitors ELSE 0 END) as '04', sum(CASE WHEN EXTRACT(hour from time_period) = 05 THEN unique_visitors ELSE 0 END) as '05', sum(CASE WHEN EX

Categories : Mysql

How do I count unique visitors to my site?
Unique views is always a hard nut to crack. Checking the IP might work, but an IP can be shared by more than one user. A cookie could be a viable option, but a cookie can expire or be modified by the client. In your case, it don't seem to be a big issue if the cookie is modified tho, so i would recommend using a cookie in a case like this. When the page is loaded, check if there is a cookie, if there is not, create one and add a +1 to views. If it is set, don't do the +1. Set the cookies expiration date to whatever you want it to be, week or day if that's what you want, and it will expire after that time. After expiration, it will be a unique user again!

Categories : PHP

How to get Device Information Using HTML5 Javascript & Phonegap
Although I never worked on such area. But what I can suggest is- You will need to write android native plugin to achieve the same. I think there should be android api to read memoryinfo and cpuinfo file if not you can directly read /proc/cpuinfo and /proc/memoryinfo to get ram and cpu related information. Hope it will give you some insight. Below is the link of related question - Android How do you get total memory RAM in the device?

Categories : Javascript

How to access html information that is generated by javascript?
Selenium is probably what you're looking for; it's a browser automation framework. You can use Python but Selenium actually uses Firefox to parse a site's content (last time I heard). You can get the python version here but there are other options.

Categories : Java

Look for in Mysql table and pass information from the javascript
What you are doing now is pretty much the standard. If you dont want to use this method then I suggest that you look into session. On your first page you will need to include the line: <?php session_start(); then your normal code. Once you have read the information from the database then place the values into session variables; $_SESSSION['var1'] = $result['id']; //--- continue for all the values you want to save On the second page you will need to do the reverse <?php session_start(); $id = $_SESSION['var1'];

Categories : PHP

Tracking online visitors per page in a website
You could build something not much complex using SignalR and javascript. A javascript in each page would inform the SignalR service that someone is in there and the server would aggregate it and broadcast it to everyone that is in the same page.

Categories : C#

realtime visitors with nodejs & redis & socket.io & php
If visitors use your website as normal website without Socket.IO, then you might rethink the whole approach of tracking. In order to do it efficiently without any work on front-end that could lead to performance issues think of this approach: I would choose MongoDB (feel free to use redis with similar approach) with smart expire indexing (this will create expire document if Now - timestamp will be longer then 10 seconds) db.views.ensureIndex({ timestamp: 1 }, { expireAfterSeconds: 10 }) And would create index for product for fast counting db.views.ensureIndex({ product: 1 }) You can create documents, with this structure: _id: '(int)userId' product: '(int)productId' timestamp: new Date() (have expire index on this one.) When user comes to view Product, PHP would record userId (_id), pro

Categories : Node Js

Googly analytics count visitors from one page to another
That's called "navigation summary" in GA. It's in the content reports, "Content"->"All Pages", then select the navigation summary tab (not in the main navigation, but one of the tabs above the data table). Makes more sense if you drill down to a specific page first.

Categories : Google Analytics

Counting visitors in a node http server
The request to favicon.ico is triggering an extra request (I confirmed this by logging the details for each request and then making a normal request with Chrome). You will need to look explicitly for the type of request (url, method, etc) you're wanting to match. Also, keep in mind, if your server dies, which it probably will at some stage, your count will be reset. If you don't want that, you should persist it somewhere less volatile, such as a database.

Categories : Node Js

How to use this dictionary to show the file information in template in javascript?
Use ajax call : say your ajax_template.html : {% for choice in overview %} <tr> <td><input type="checkbox" name="choice_stop" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked_stop()"/></td> <td><label for="choice{{ forloop.counter }}">{{ choice.name }}</label></td> <td>{{ choice.source }}</td> <td><div id="remPercentage{{ forloop.counter }}"></div></td> <td>{{ choice.start_date }}</td> <td><div id="remTime{{ forloop.counter }}"></div></td> <td>{{ choice.human_size }}</td> <td><input type="checkbox" disabled {{ choice.flag_email }} /></td>

Categories : Javascript



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