No internet access on Android Emulator, Shared Internet Connection |
Finally I sorted out my problem.
It was problem due to dns server address.
I did below steps
open CMD
Goto your android-sdk/tools path, Like my path is G:Andriod
Developmentandroid-sdk ools
type this command G:Andriod Developmentandroid-sdk ools>emulator.exe
-avd Android_2.3.3 -dns-server 8.8.8.8 -scale 0.75
here Android_2.3.3 is your AVD name, -dns-server 8.8.8.8 will set your DNS
address to 8.8.8.8 or 8.8.8.8:55 and -scale will scale your AVD to
specified value.
this will start a new emulator.
Enjoy :)
Hope may be helpful to others
|
Can android differentiate between a lost internet connection and no internet connect? |
You need to use a BroadcastReceiver that will be triggered when the
connectivity status for Wi-Fi has changed.
Set following things before registering BroadcastReceiver:
private class ConnectionChangeReceiver extends BroadcastReceiver {
public void onReceive( Context context, Intent intent ) {
Log.d(tag, "Inside Broadcast Reciever");
CheckWifiStatus();
}
}
private void RegisterWifiWatcher()
{
if(wifiWatcher == null)
wifiWatcher = new ConnectionChangeReceiver();
final IntentFilter intentFilter= new IntentFilter();
intentFilter.addAction("android.net.wifi.WIFI_STATE_CHANGED");
intentFilter.addAction("android.net.wifi.STATE_CHANGE");
registerReceiver(wifiWatcher, intentFilter);
}
WIFI_STATE_CHANGED :
Broadcast intent action indicating that Wi-Fi has been enabled,
|
Linux skip /root/.gvfs when executing df command with non-root user |
I got the solution for my own question :)
In df command you can pass the file system types which you would like to
exclude, in this case it is 'fuse.gvfs-fuse-daemon'.
So when I execute the below the command I no more get this message "df:
`/root/.gvfs': Permission denied"
df -x fuse.gvfs-fuse-daemon
For more details one can look into df --help option.
|
Is sudo-ing tomcat's startup with a non-root user the same as running it as root? |
Do be aware that the recommended solution to run tomcat on port 80 is to
use mod-jk with the Apache web server, not to have tomcat listen on port 80
directly.
|
Root immediate child nodes icons not visible when hiding root |
JTree#setShowsRootHandles(boolean newValue) controls the state of the
handles for root elements.
Normally, this is false. Try changing to true
|
Reset MAMP Pro username and password to root/root |
Assuming you still know the password, you can change the password back to
root using
/Applications/MAMP/Library/bin/mysqladmin -u root -p password root
It'll prompt you to enter a password again, after which it'll be reset to
root
|
Read and Write root folder wihout root |
You can use run-as on some devices to execute commands as a particular
package. Google have fixed this on Jelly Bean so it no longer works:
adb shell
run-as app.package.name
cp /data/data/package.name/file.txt /sdcard/
exit
adb pull /sdcard/file.txt ~/
Here is a good article explaining file access in Android without root
permissions, including a one-liner for the above script.
It details how to use the new backup command:
backup -f ~/data.ab -noapk app.package.name
And how to extract the contents of the resulting .ab file:
dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf -
You will most likely need the android.permission.BACKUP permission.
|
Browsing into a folder in Hadoop |
Specify the directory name, as follows:
hadoop fs -ls tmp
Sample output from my Demo VM:
hadoop fs -ls
[cloudera@localhost ~]$ hadoop fs -ls
Found 12 items
-rw-r--r-- 1 cloudera supergroup 46 2013-06-18 21:18
/user/cloudera/FileWrite.txt
-rw-r--r-- 1 cloudera supergroup 13 2013-06-18 15:34
/user/cloudera/HelloWorld.txt
drwxr-xr-x - cloudera supergroup 0 2013-07-01 22:07
/user/cloudera/hiveext
drwxr-xr-x - cloudera supergroup 0 2012-06-12 15:10
/user/cloudera/input
-rw-r--r-- 1 cloudera supergroup 176 2013-06-18 23:07
/user/cloudera/input_data.txt
drwxr-xr-x - cloudera supergroup 0 2012-09-06 15:44
/user/cloudera/movies_input
drwxr-xr-x - cloudera supergroup 0 2012-09-06 17:02
/user/cloudera/movies_output
drwxr-xr-
|
SVN (svnserve) virtual root --root= not recognized |
svn+ssh handles the whole transaction including writing and reading the
files so it ignores the --root parameter in svnserve.
Here is how to fix it over at serverfault --
Basically you just make svnserve into a script that calls svnserve with the
proper variables.
|
How to add location-aware browsing in website? |
I guess the reebok site is using the HTML5 Geolocation API.
Try the code below and it should recreate the behaviour. The code is taken
directly from this page.
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation.getCurrentPosition
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
console.log('Your current position is:');
console.log('Latitude : ' + crd.latitude);
console.log('Longitude: ' + crd.longitude);
console.log('More or less ' + crd.accuracy + ' meters.');
};
function error(err) {
console.warn('ERROR(' + err.code + '): ' + err.message);
};
navigator.geolocation.getCurrentPosition(success, error, options);
|
Node / Express Directory Browsing |
You can create artist objects and push() each one you create into an array.
Similarly, album and song may be objects push()ed into corresponding arrays
attached to their parent objects.
var artists = [];
// for each artist we have
var artist = {};
artist.name = 'Music Artist 1';
artist.albums = [];
// for each album we have
var album = {};
album.title = 'Album Nr1'
album.songs = [];
// for each song that we have
var song = {};
song.title = 'Track 1';
album.songs.push(song);
// end song loop
artist.albums.push(album);
// end album loop
artists.push(artist)
// end artist loop
If you then need this information in JSON format, you can parse it using a
JSON parser. Or you can programma
|
Cookies, JavaScript, Python, Browsing-but-not-really |
You could try the requests library and the Session object, it automatically
manages cookies, e.g.:
>>> import requests
>>> s = requests.Session()
>>> r =
s.get('http://www.THEWEBSITE.com/custserv/locate_store.cmd')
>>> print r.status_code
200
>>> for c in s.cookies:
>>> print c
<Cookie JSESSIONID=<ID> for www.THEWEBSITE.com/>
<Cookie PIPELINE_SESSION_ID=<ID> for www.THEWEBSITE.com/>
>>> payload = { 'form_state' : 'selectThisStoreForm', 'storeId' :
'62012' }
>>> r =
s.post('http://www.THEWEBSITE.com/custserv/save_user_store.cmd',
data=payload)
>>> print r.status_code
200
>>> for c in s.cookies:
>>> print c
<Cookie JSESSIONID=<ID> for www.THEWEBSITE.com
|
how to split url when browsing i want only specific value form url |
As you mentioned in your comment you would like to see
com.eamobile.monopoly_row_wf
Hence the code for that is
String standard = "https://play.google.com/store/apps/details?id=";
String id= url.substring(standard.length(), url.indexOf("&"));
Toast.makeText (getApplicationContext(), id.toString(),
Toast.LENGTH_SHORT).show ();
|
Keeping same div while browsing to other pages of a website |
If you look at the url you will see that orkut is a single-page site (for
the most part).
This means that if you click on a link, just another div will open (loaded
with AJAX), but the complete page itself will not be reloaded.
The effect you are talking about is similar to the effect that SoundCloud
uses as well: music keeps playing while browsing to new 'pages'. If you
want to implement this effect, I suggest you read the following (duplicate)
question:
Continuing music playback even while changing pages
|
Sync website browsing to another machine? |
Having spent a long time looking into this I've found a solution, SignalR -
http://signalr.net/ for ASP.NET allows you to do exactly what I require, I
won't go into detail here as the post would become huge but for anyone
wanting to do the same in future then visit http://signalr.net/ and have a
read, it's amazing technology!
|
c# showing error while browsing a webpage |
private void button1_Click(object sender, EventArgs e)
{
SetupTest()
driver.Navigate().GoToUrl("webaddress");
driver.FindElement(By.TagName("Atlast")).Click();
Thread.Sleep(5000);
}
You need to be calling SetupTest in your button click code. Why? This is
where you are creating your new instance of the IWebDriver, therefore it
needs to be called otherwise any references to driver will simply refer to
null (by default).
|
How to detect whether a site is browsing from IPAD or not |
if (preg_match('/ipad/i', $ua))
{
$platform = 'iPad';
}
here is what i use for rest of them:
if (preg_match('/linux/i', $ua))
{
$platform = 'Linux';
}
elseif (preg_match('/ubuntu/i', $ua))
{
$platform = 'Ubuntu';
}
elseif (preg_match('/macintosh|mac os x/i', $ua))
{
$platform = 'Mac';
}
elseif (preg_match('/windows|win32/i', $ua))
{
$platform = 'Windows';
}
if (preg_match('/android/i', $ua))
{
$platform = 'Android';
}
if (preg_match('/palm/i', $ua))
{
$platform = 'Palm';
}
if (preg_match('/iphone/i', $ua))
{
$platform = 'iPhone';
}
if (preg_match('/blackberry/i', $ua))
{
$platform = 'Blackberry';
|
Access browsing history in ember |
Reopen Ember.Route to store the currentPath when a route is exited:
Ember.Route.reopen({
deactivate: function() {
var applicationController = this.controllerFor('application');
App.previousPath = applicationController.get('currentPath');
}
});
Then in your cancel method:
goBack: function () {
if (SettingsApp.previousPath == 'nodes.show') {
this.transitionToRoute(SettingsApp.previousPath,
this.get('content'));
} else {
this.transitionToRoute(SettingsApp.previousPath);
}
},
cancel: function () {
this.stopEditing();
this.goBack();
},
Note: you might want to provide some fallback in case the app is loaded in
the nodes.edit route.
|
Suspend browsing while AJAX scripts are running? |
You cannot suspend browsing per-se, but you can cough up a decent looking
'wait, loading' block on top of a full-page shadow that warns the user that
things are happening. That, or disable every href on the page via
javascript, which is hardly advisable. :)
Other than that, you have no control over the client whatsoever.
P.S.: If by "dialog" you mean an alert, kill that thought with fire
immediately.
|
Code responsible for browsing Firefox's desktop |
The implementation is pretty arcane and ancient.
file channel handler will create an nsDirectoryIndexStream. This stream
will return a specifically crafted text-only representation of the listing
(Try View Source to see how it looks like). The file channel handler also
sets a special mime type APPLICATION_HTTP_INDEX_FORMAT =
"application/http-index-format"
Via the nsIStreamConverterService, a stream converter implemented in
nsIndexedToHTML will now produce the final output stream doing a
application/http-index-format -> text/html conversation.
Finally, the output html links some style sheet via
chrome://global/skin/dirListing/dirListing.css, which is in fact part of
the platform specific themes, to give the result a more native-looking
appearance.
|
Specific view element for browsing PDF documents |
Maybe you can try with ICEpdf:
http://www.icesoft.org/java/projects/ICEpdf/overview.jsf
ICEpdf is an open source PDF engine for viewing, printing, and annotating
PDF documents. The ICEpdf API is 100% Java, lightweight, fast, efficient,
and very easy to use.
ICEpdf can be used as standalone open source Java PDF viewer, or can be
easily embedded in any Java application to seamlessly load or capture PDF
documents.
ICEpdf have more features that simple viewer. Another solutions is use
JPedal:
JPedal - http://sourceforge.net/projects/jpedal/
JPedal have the advantage that there are plug ins for Eclipse and Netbeans.
Both frameworks are LGPL with some of the features only available througth
a commercial license, but for your purposes you don't need a commercial
license.
|
JMS - Browsing queue messages before they are consumed by consumer |
You can create a queue browser, possibly using a message selector:
this.queueBrowser = getQueueSession().createBrowser(getQueue(),
selector);
A selector is like a "where clause" for selecting messages.
Update
If you have one queue with a "normal" consumer, and you like to browse the
queue before the real consumer consumes the message. If the real consumer
consumes first, your browser won't see the message. That's not reliable.
Therefore you should use two queues. Your browsing application acts as a
"man in the middle" or like a bridge, it will always get all messages
posted into the 1st queue, and it has to send it on a 2nd queue. The real
consumer is connecting to the 2nd queue. So both consume normally.
Another possibility is to change the sender: It could send the message
|
iPad Full-Screen Mode Allow Browsing |
I asked a similar question over on AskDifferent - Hiding URL Bar on iPad.
The answer I received there suggested distributing the web app's
configuration file, which allows you to configure many more options. The
end-user must agree to the profile installation, but having a controlled
device will limit any frustration with this fact. The details of this were
linked to in the above answer, but it appears to be broken now.
Alternatively, Chrome has a full screen browser mode that can be taken
advantage of. Given a controlled device you could simply use the
alternative browser.
|
How can I detect a change in private browsing mode |
The way I got around this was to:
make an ajax request to a script on the server at ask for remote ip address
Store the ip address in localstorage
Periodically make the same ajax request
Attempt to compare the new IP address with that in localstorage
As localstorage is not available in private browsing, step 4 should return
false
|
How to Implement the folders browsing using two Fragments in a activity? |
Try using a temporary fragment in between to hold the right fragment while
you replace it with the new detailed one. then you can replace the left
fragment with the temporary fragment where you stored the right fragment.
|
Private browsing mode in UIWebView and sessionStorage |
Yes UIWebView does have the private browsing mode by default. The Cookie
data is accessible by the App only.
NSHTTPCookie's singleton instance stores the Cookie information of the
UIWebView. You may need to use deleteCookie: method to clear the cached
data.
|
Tracking browsing pattern of website user |
Depends on how large your traffic is.
If you want to follow a pattern then the best way would be to use Google
Analytics funnels.
If you want to process all traffic by yourself I would just process the
access_log files using Hive or some dedicated tool.
I would not save the traffic directly in a database (it's not cheap to
scale for high traffic). Maybe you can save the traffic in a csv file on
disk and insert it in mysql using a cron and the LOAD DATA syntax which is
much faster.
|
Background Chrome Browsing Session issue |
the answer was rather complex because i couldnt transfer the data i needed
from the background browsing session to my current browsing session i had
to use the users username stored in a session as a unique identifier
between my java application and my Php/MySQL server because it was stored
in both the background browsing session and the current browsing session
thus it was a common piece of data linked to both the java app and my
server I simply used the common data to read and write from the database
pulling and pushing the other information that i required.
|
Selectively remove Chrome browsing history |
Try searching www.pythonismyfavoritest.com in the search bar in
chrome://history/ and then remove each item by clicking the check box in
the left and then hitting the "remove selected items" button.
The chrome history api works with url such
chrome://history/#q=hello&p=0
|
Sub folder directory browsing in Amazon S3 bucket |
http://shrub.appspot.com should do what you're looking for. You'll need to
write your own webapp using a server-side language, or you can fork Shrub
and modify it for your own needs.
|
How to open an URL in PRIVATE TAB (Incognito Browsing) from other android app |
Add flag= FLAG_ACTIVITY_NO_HISTORY
Intent yourIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(yourUrl));
yourIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
context.startActivity(yourIntent);
|
Apache virtual host for browsing with IP address |
I am personally using this one for IP Vhost
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin contact@steelbrain.com.pk
DocumentRoot /var/www/ipbased/
ServerName 192.168.1.1
ServerAlias 192.168.1.1 192.168.1.2
</VirtualHost>
|
Evidences for automatic browsing-Log file analysis |
The article on how to identify robots has some good information. Other
things you might consider.
If you see a request for an HTML page, but it isn't followed by requests
for the images or script files that the page uses, it's very likely that
the request came from a crawler. If you see lots of those from the same IP
address, it's almost certainly a crawler. It could be the Lynx browser
(text only), but it's more likely a crawler.
It's pretty easy to spot a crawler that scans your entire site very
quickly. But some crawlers go more slowly, waiting 5 minutes or more
between page requests. If you see multiple requests from the same IP
address, spread out over time but at very regular intervals, it's probably
a crawler.
Repeated 403 (Unauthorized) entries in the log from the same IP. It's r
|
Full screen browsing with javascript using setInterval |
Switching to full screen is a potential security problem, and as such
usually has to be tied to a user event (like clicking a button) to be
actioned. In this case you wouldn't be able to switch to full screen from a
setInterval event. There are other reasons why a switch to full screen
might fail.
Firefox specifically will log a message to the error console if the switch
to full screen fails. Both Firefox and Chrome have opt-in switches that
might allow this.
From the MDN page on this:
It's not guaranteed that you'll be able to switch into fullscreen mode.
For example, <iframe> elements have the mozallowfullscreen attribute
(webkitallowfullscreen, etc) in order to opt-in to allowing their content
to be displayed in fullscreen mode.
See the reference on MDN for more details
|
Python: How to choose file with a GUI but prevent browsing to other directories? |
I don't think this is possible with the standard file dialogs. But you
could write your own. Just use a treeview widget to display all files (and
relevant information) in the directory. The User can multi select the files
and you can delete them after the user dismisses the dialog.
|
Error 500 browsing to webpage which functions correctly on localhost |
I had similar problem, and there are a lot of pitfalls I came across. I
will try to provide their full list to help you check them:
allow Directory browsing in your IIS
in the folder, where the website is physically saved, check whether IUSR
and IIS_IUSR have the permissions to read and browse
check, whether you have allowed accessing the port in your firewall
check, whether the IP address is correct. It is possible, that your
external IP does not redirect to the internal IP. Or maybe (I made the
rookie mistake) you are trying to browse the internal IP instead of
external.
I hope this will help. If any questions, do not be afraid to ask.
|
How to retrieve Safari's Complete Browsing History Programmatically? |
I got it. Please follow following path then you will retrieve Browser
history for iOS7 iPhone.
/private/var/mobile/Applications//Library/Safari/History.plist
In iOS7 safari app not a system app. When you open Applications folder then
you can find history and other plist files.
|
I have to delete all browsing data every time I login to admin |
This could be myriad things, but I'd check that your cookie domain at
System -> Configuration -> Web -> Session Cookie Management
matches your new www.example.com domain name.
|
Browsing path in Delphi XE4 doesn't function the way Embarcadero says |
The documentation is accurate. It correctly describes the browsing path.
However, it's not uncommon for the IDE to get confused. If the project
doesn't compile then code browsing doesn't work. Often a full re-build will
be enough to make code browsing work again. But sometimes that's not
enough. In which case any attempt to help solve your problem would likely
require an SSCCE.
But as to the question you asked, the documentation is correct in its
description of the browsing path.
|
Disabling caret browsing in Firefox source view |
A possible workaround: access the configurations (about:config) and go to
view_source.editor.external, double click to set to true; then modify
view_source.editor.path to a text editor (mine is at c:Program
FilesNotepad++
otepad++.exe). This will let you see (and navigate in) the source in an
application of your choosing.
|