on-internet

selenium webdriver url navigation (on microsoft edge with window10) , hang after 28/29th url

I have been doing URL navigation ( list of URL in a file ) using selenium webdriver for microsoft edge browser on window 10 machine. I have written automation script in python. code snippet : driver = webdriver.Edge() driver.set_page_load_timeout(60) for url in list_of_url: #100 url print "navigating url :",url driver.get(url) So after navigating 28th url, Script got hanged on 29th URL on "driver.get(url)" line ,and never return. I have also tried with different list of urls, the behavior is same, got hanged on 29th url. Pls look into this issue.

Join the discussion →

counterup the numbers with setInterval (jQuery)

I'm trying to counter up the numbers defined in data attribute with set interval. My code is here. $( ".number" ).each(function(index) { var INCREMENT = $(this).data('increment'); var START_VALUE = 0; var count = 0; count = INCREMENT; $(this).html(count); window.setInterval( function(index){ count += INCREMENT; $('.number').html(count); }, 1000); }); I'm able to get the numbers initially, but with setInterval, all using the first number in the array. WORKING FIDDLE

Join the discussion →

com.amazonaws.AmazonClientException: Unable to execute HTTP request: peer not authenticated

I created a new account on amazon aws to use s3 bucket and I've written this code to upload one image file to s3 bucket but it gives me this exception: >Unable to execute HTTP request: peer not authenticated. This is my main method: public class Main2 { public static void main(String[] args) throws IOException { File file=new File("C:\\Users\\KDSss\\OneDrive\\Pictures\\my photo 001.jpg"); try { InputStream targetStream = new FileInputStream(file); S3Upload.uploadImage(targetStream, "Discussion", "jpg"); } catch (FileNotFoundException e) { e.printStackTrace(); } } } And this is my S3Upload.java

Join the discussion →

How to write a file path that will point to a directory?

How to write a file path that will point to a directory. From what I have googled, /path means root, ./path means current directory, ../path means parent directory I am playing with Framer.js + Yeoman. If you look at the screenshot attached: myLayers = Framer.Importer.load("../imported/test1") is not working? When I put the "imported" folder under the "app" folder it is working.

Join the discussion →

Session not updating after some ajax call requests

I am updating a session using an ajax call. PHP public function mymethod() { //Session Increament $addrowcount=1; $addrowcount +=$this->session->userdata('row'); $this->session->set_userdata('row', $addrowcount); echo $addrowcount; } jQuery jQuery.ajax({url: "myurl.com/mycontroller/mymethod/",dataType: "json", async: false, success: function(data){}}); But the session is not updating or not getting increased after 20 to 23 ajax calls.

Join the discussion →

Nginx : detect mobile and forward to desktop

I have a problem i want to detect the domain and the device and forward the response to the desktop, www server section of nginx. With a rewrite this is done but the problem is the url, is cleared and substitute with my url, the configuration is the following : server { listen 80 default_server; #this detects any domain server_name ~^(www\.)?(?<domain>.+)$; root /home/someone/main; index index.html index.htm; set $mobile_rewrite do_not_perform; # this regex string is actually much longer to match more mobile devices if ($http_user_agent ~* '(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows Ph

Join the discussion →

Copy the content of one HTML table into another using JavaScript Revisited

I'm teaching myself JavaScript and I need to copy one table into another. I've been able to reproduce @Gushiken's code and @Quentin's response with this example: HTML: <button onclick="copytable()">Copy Table</button> <br /> <br /> <table id="TableA"> <!--<tbody></tbody>--> </table> <br /> <table id="TableB" style="border:solid"> <thead> <tr> <td id="col1">Column 1</td> <td id="col2">Column 2</td> <td id="col3">Column 3</td> </tr> </thead> <tbody> <tr> <td>Data a</td> <td>Data b</td> <td>Data c</td> </tr> </tbody> </table> <br /> JavaScript: function copytable() { var source = document.getElem

Join the discussion →

Android - get imageView XY coordinates

I need to know XY coordinates of an ImageView. This coordinates will be used to position a new ImageView on an RelativeLayout overlay that should have the same position of starting ImageView. Summerize: 1) ImageView1 = getcoordinates XY 2) button click 3) Overlay RelativeLayout that cover entire window. ImageView1 will be behind this RelativeLayout overlay 4) Create ImageView2 in RelativeLayout overlay that should be positioned exactly on ImageView1 Any help? Thanks

Join the discussion →

Package management in Git for Windows (Git Bash)?

I'm reading the github wiki for git-for-windows and it says that msys2 bundles pacman: https://github.com/git-for-windows/git/wiki/Package-management But when I invoke it I get: $ pacman bash: pacman: command not found Does anyone have an idea what is going on? Which git version does this wiki refer to? Is there a way to install additional packages to msys2 inside Git for windows?

Join the discussion →

Gradle fails to download external dependency from local artifactory which should be downloaded form mavenCentral

My gradle build fails due to an error from artifactory: FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':PublishService:compile'. > Could not resolve org.geotools:gt-wfs:9.0. Required by: infraview_gradle:PublishService:0-SNAPSHOT > net.infraview:infraview_context:0-SNAPSHOT infraview_gradle:PublishService:0-SNAPSHOT > net.infraview:infraview_srv_masterdata:0-SNAPSHOT > Could not HEAD 'http://beast:8082/artifactory/libs-snapshot-local/org/geotools/gt-wfs/9.0/gt-wfs-9.0.pom'. Received status code 409 from server: Conflict The geo

Join the discussion →

Keycloak retrieve custom attributes to KeycloakPrincipal

In my REST service I can obtain the principal information after authentication using KeycloakPrincipal kcPrincipal = (KeycloakPrincipal) servletRequest.getUserPrincipal(); statement. Keycloak principal doesn't contain all the information I need about the authenticated user. Is it possible to customize my own principal type? On the keycloak-server-end, I've developed a user federation provider. I saw that UserModel makes possible to add a set of custom attributes to my user. Is it possible to insert my custom principal in that code? Is it possible to retrieve this attributes from keycloak princ

Join the discussion →

C# sort datagridview on column header click

:) I have a datagridview and I fill it by List (I get data from 2 text files), but when I tried to click on a column header (I tried with all columns headers), I can't sort my datagridview data. This is my code: public class Data1 { public string Campionato { get; set; } public string Data { get; set; } public string Home { get; set; } public string Away { get; set; } public int HSFT { get; set; } public int ASFT { get; set; } public int HSHT { get; set; } public int ASHT { get; set; } public int HSSH { get; set; } public int ASSH { get; set; } } public class Data2 { public string Home { get;

Join the discussion →

npm: How to install all dependencies at once

I installed eslint and when running command npm run lint then every time it asks to install all dependencies one by one. Is there any command option to install all once rather than running npm run lint all the time? package.json { "private": true, "devDependencies": { "gulp": "3.9.0", "laravel-elixir-livereload": "1.1.2", "babel-eslint": "4.1.1", "eslint": "1.3.1", "eslint-config-airbnb": "0.0.8", "eslint-plugin-react": "3.3.1", "laravel-elixir-eslint": "1.0.0" }, "dependencies": { "laravel-elixir": "3.2.6", "bootstrap-sass": "3.3.5", "jquery": "2.1.4" }, "scripts": { "lint": "./node_modules/.

Join the discussion →

android - cursor didn't have _data column not found

When run below code to query a file on sdcard, I always get a null. public String getRealPathFromURI(Context context, Uri uri) { String fileName="unknown"; if (uri.getScheme().toString().compareTo("content") == 0) { Cursor cursor = context.getContentResolver().query(uri,null,null,null,null); if (cursor.moveToFirst()) { Log.e(TAG, "dump cursor:" + DatabaseUtils.dumpCursorToString(cursor)); int column_index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA); String name = cursor.getString(column_index); if (name != null) { uri = Uri.parse(cursor.getString(column_index)); fileName = uri

Join the discussion →

Entity Framework, not mapped property in query

I'm creating an entity model in which I want to put a not mapped properties. These properties are there to simplify access to values from relationship. Model shown is just a simple example. In users_roles entity, named UserRole, I want to have UserName property and RoleName. public class UserRole { public int Id { get; set; } public int IdUser { get; set; } public int IdRole { get; set; } public User User { get; set; } public Role Role { get; set; } [NotMapped] public string UserName { get { return User.Name; } } [NotMapped] public string RoleName { get { return Role.Name; } } } It's important

Join the discussion →

Count variable does not reset in javascript when re-initialized

I've encountered an odd situation. I'm building a nice little Tic-Tac-Toe game in JS, and I can't figure out why the count variable will not reset when I init() a second time. The first game works well; the second game count does not reset to 0 even though the var count resets in init(). Game rules: game starts with X and should always start with X. You'll note that the second game starts with O. Would anyone care to take a look? Fiddle: http://jsfiddle.net/1ommcdxg/ var board; var gameBoard; var winners = [ [0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6] ]; var count; v

Join the discussion →

How to implement swipe view on fragment

I'm trying to implement a swipe inside a fragment! My application use a Navigation Drawer Layout and I change view with the drawer. All the view that I show are fragment. Now, I want to implement into a specific fragment an horizontal swipe. How can I do this thing? my code is here : public class MybookingFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { final View Rootview = inflater.inflate(R.layout.mybooking, parent, false); ViewPager viewPager = (ViewPager) Rootview.findViewById(R.id.viewpager); FragmentManager frag

Join the discussion →

Could not find uri with key dfs.encryption.key.provider.uri to create a keyProvider in HDFS encryption for CDH 5.4

CDH Version: CDH5.4.5 Issue: When HDFS Encryption is enabled using KMS available in Hadoop CDH 5.4 , getting error while putting file into encryption zone. Steps: Steps for Encryption of Hadoop as follows: Creating a key [SUCCESS] [tester@master ~]$ hadoop key create 'TDEHDP' -provider kms://[email protected]/key_generator/kms -size 128 tde group has been successfully created with options Options{cipher='AES/CTR/NoPadding', bitLength=128, description='null', attributes=null}. KMSClientProvider[https://10.1.118.1/key_generator/kms/v1/] has been updated. 2.Creating a directory [SUCCESS] [tester@m

Join the discussion →

Getting trouble in assigning id value in database in php [duplicate]

I am writing a simple registration page using PHP and a MySQL database. id column of Table is defined as "AUTO INCREMENTED". The registration process is working well, i.e. data is getting inserted into the database. Currently I have 3 records in my table: Raghvendra Surendra Mohit Now my problem is: when I delete the 3rd record ("3. Mohit"), my database table now looks like this: Raghvendra Surendra Now, when I add another record, my table looks like this: Raghvendra Surendra Varun What is want is something like this: Raghvendra Surendra Varun Sorry for my english.. please help me!

Join the discussion →

How to detect if page has completely loaded in Selenium?

What I am to do is trying to iterate over all select values and grab some data. Data is loaded via AJAX so the page isn't reloading - the data in the table is just changing. As you can see I have tried to use explicit wait but that doesn't work - select value can be "4" but information in the table can still belong to the "3" value. I would like to know how can I be sure that the page is really updated? There're some similar questions but I didn't find proper solution. for i in range(N): try: driver.find_element_by_xpath("//select[@id='search-type']/option[@value='%s']"%i).click() driver.find_

Join the discussion →

Smarty: How can I pass on the incrementing {counter} value in the {include} function?

This smarty code loops (by calling upon itself with {include}) through a multidimensional array and puts the data per dimension into a multidimensional HTML list. I would like pass on an incrementing value. So how can pass on the {counter} value in the {include} function? <ul class="{$ulId}"> {foreach from=$tree item=wrapper} {assign var="idcat" value=$wrapper.idcat} {assign var="url" value=$wrapper.item->getLink()} {assign var="name" value=$wrapper.item->get('name')} {if $idcat|in_array:$path} {assign var="aClass" value='active'} {else} {assign var="aClass" value=''} {/if} <li> <a class="{$aC

Join the discussion →

getting the table names and their row counts using a query in oracle db

I have a database and I want to get the names of the tables in that database along with the number of data rows in those tables. select table_name from dba_tables where owner = 'owner' returns the names of all the tables in the database, but I can't get the number of rows in each table. Querying the num_rows column would not give the row count in real time since it requires all the tables to run the "analyze" command on them. Is there a way to get both columns, the table name and the row count of each respective table using a single query?

Join the discussion →

Video Streaming over bluetooth

I want to stream a video from my Android phone to another Android phone over Bluetooth. I know about a VDP to use, but this application is not available in Android SDK. There is the A2dp Bluetooth profile, which is responsible for audio streaming only. Is there a different method in order to implement it with Android SDK?

Join the discussion →

How can I list all vhosts in nginx

Is there a command that will list all vhosts or servers running under nginx on CentOS? I would like to pipe the results to a text file for reporting purposes. I'm looking for something similar to this command that I use for Apache: apachectl -S 2>&1 | grep 'port 80'

Join the discussion →

How to provide ID counter starting from 1 for each new user?

I am implementing a multi-users website. They can create "items". When a new user registers and creates his first item I want it to have an ID of 1, not 2728 (its ID from DB). So I need some kind of mapping? E.g. | real_item_id | fake_item_id | 2728 1 So for each Account I will have a table with fake_id starting from 1 and incrementing every time a User creates an item? Maybe there is another, better approach?

Join the discussion →

PowerShell Active Directory Loop Through All User Properties

I'm currently working on some PowerShell to update Active Directory User Attributes. The script will read the updated attributes from a CSV. What I would like to achieve is to iterate through users and compare each user attribute against the value stored in the CSV. If the CSV attribute value doesn’t match the user's Active Directory attribute I would like to update the value in Active Directory At present I can select a user and display the all the properties using the following: Get-ADUser -Filter "UserPrincipalName -eq '$($upn)'" -Properties * -SearchBase 'DC=core,DC=com' What I'm strugglin

Join the discussion →

iOS Beta Testflight build still in process after 24 hr

I have uploaded the build on testflight beta on 2nd Sept 2015 (India) but it is still listed under Processing state. Dont know what is the issue with it. I have uploaded the older version on 31st Aug 2015 and it gets approved in just 15-20 mins. The code is same but just increment its build version. Don't know what the issue is. Can anyone help me? Here is the screenshot which is uploaded but still in processing state.

Join the discussion →

How to integrate CANOE with Jenkins?

I want to integrate CANOE with Jenkins. Can anybody please tell me how to do that. For now I am able to open CANOE window through Jenkins. But it shows a disclaimer on startup. I want to click on "I accept" button automatically through Jenkins using any command. Can you please tell me how to do that or what is that command?. Is there any other way to click on that button without pressing the key?

Join the discussion →

Mysql same row copy-same table 120 times

Simple mysql table: CREATE TABLE `users` ( `id` INT NOT NULL AUTO_INCREMENT , `name` TEXT NOT NULL , `surname` text NOT NULL , `city` text NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM And inserted like: INSERT INTO `users` (`id`, `name`, `surname`, `city`) VALUES (1,`rock`,`fixed`,`london`); How can i enter same table detail of one row 100 times with different primary id?

Join the discussion →
Older stories