on-internet

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 →

Filter list of dictionaries

This is my example: dictlist = [{'first': 'James', 'last': 'Joule'}, {'first': 'James','last': 'Watt'}, {'first': 'Christian','last': 'Doppler'}] I am trying to get the last name. If this was in a model, the code would be: getdata = Name.objects.filter(name="Christian") getLastName = getdata.last and I would get "Doppler".

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 →

Insert excel data before the pivot table

I keep getting this error: Run-time error '5': Invalid procedure call or argument: I am just learning VBA...& yes, I have searched for the answer on here before I tried to ask this question. First I tried to add single quotes to the TableDestination(however there's no space in the sheet name), & then I tried to refresh the table which I did, no bueno. I also made sure that the pivot table name was unique and not previously used, lastly I came across a solution to remove the Sheets.Add statement and leave TableDestination:="". This worked but when I generate the report it inserts the pivot tabl

Join the discussion →

spring-data-mongo querying arrays example

I am newbie to the spring-data-mongo. I've the following documents Food and I would like to query using Querying Arrys. I've following Food collection > db.food.find() { "_id" : 1, "fruit" : [ "apple", "banana", "peach" ] } { "_id" : 2, "fruit" : [ "apple", "kumquat", "orange" ] } { "_id" : 3, "fruit" : [ "cherry", "banana", "apple" ] } > And I am using following query I get the proper data. Now same I would like to achieve using Spring-data-mongo > db.food.find({fruit : {$all : ["apple","banana"]}}) { "_id" : 1, "fruit" : [ "apple", "banana", "peach" ] } { "_id" : 3, "fruit" : [ "cherry", "ba

Join the discussion →

Generate Client Web Service With Maven And Axis

I have a problem when Maven is generating the source code for a client web service with Axis. I need consume the wsdl from url exposed by other company. For example, this is the wsdl content in url http://127.0.0.1:8080/ESBService/Example?wsdl <wsdl:definitions xmlns:ns0="http://www.davivienda.com/xml/Example" xmlns:wsp200607="http://www.w3.org/2006/07/ws-policy" xmlns:wsp200409="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schem

Join the discussion →

ADFS 2.0, how to clear the credential cache?

I hit this signout issue for a long time and couldn't find a solution. At the beginning it was my website using ADFS 2.0 couldn't signout even if the correct signout url has been opened. I thought that was some cookies not cleared. After that, I found that it was probably the problem of ADFS server. I have tried: Stop iis server, so I don't have my website at all, just testing adfs. Clear my browser cookies. Close and reopen. So it is clean. Directly logon to adfs, e.g.: https://mydomain/adfs/ls/?wtrealm=mysite&wa=wsignin1.0 , here i get the popup window for username and password. Directly log

Join the discussion →

How to upload file using Volley library in android?

I already have a sub class of Request<JSONObject> that is used for http post to the server. The problem is, I have no idea on how can I add a parameter for a file. Posting string to the server is easy. but I need to add file as a different parameter. How can I do it? public class AddNewPetRequest extends Request<JSONObject> { private Response.Listener<JSONObject> listener; public AddNewPetRequest(String url, Map<String, String> params, Response.Listener<JSONObject> reponseListener, Response.ErrorListener errorListener) { super(Request.Method.GET, url, errorListener); this.listener = reponseLis

Join the discussion →

How to load more elements with AngularJS?

for a while I am trying to find how to make a load more(elements from an array) button,using Angular. I have 9 elements in array, I use ng-repeat to loop them, and limitTo:3 to output first 3. Questions: 1: is possible to make a load more button using only angular?(load more button is at bottom in example) 2: if not, how to make this work using jQuery? http://plnkr.co/edit/1gHB9zr0lbEBwlCYJ3jQ Thanks!

Join the discussion →

The connection manager will not acquire a connection because the connection manager OfflineMode property is TRUE

I am trying to store connections in the configuration table, but getting the below errors. SSIS is not configured as Offline mode. An error has occurred while connecting Oracle Server: Exception from HRESULT: 0xC0202009. Validation error. Oracle to BO: The connection manager "Oracle Server" will not acquire a connection because the connection manager OfflineMode property is TRUE. When the OfflineMode is TRUE, connections cannot be acquired. The connection manager will not acquire a connection because the connection manager OfflineMode property is TRUE

Join the discussion →

Validate a form to ensure atleast one radio button is checked in a group

I am making a form with radio buttons in it. I am able to validate all other input except radio button. I got a accepted solution for this in this site Using JQuery to check if no radio button in a group has been checked but this is not working for me http://jsfiddle.net/ghan_123/trr185L2/2/ my code <input type='radio' name='datetime' value='1'>1 <input type='radio' name='datetime' value='2'>2 <input type='radio' name='datetime' value='3'>3 <input type='radio' name='datetime' value='4'>4 <input type='radio' name='datetime' value='5'>5 <br><button id='buttonnew'>validate</button> jquery $(docum

Join the discussion →

Git for Windows doesn't execute my .bashrc file

I've just installed Git for Windows 2.5.0 on Windows 7, and it appears that my .bashrc file is not being executed when I run Git Bash. I created the file like so: Administrator@HintTech-Dev MINGW64 / $ pwd / Administrator@HintTech-Dev MINGW64 / $ cd ~ Administrator@HintTech-Dev MINGW64 ~ $ pwd /c/Users/Administrator Administrator@HintTech-Dev MINGW64 ~ $ touch .bashrc Administrator@HintTech-Dev MINGW64 ~ $ vi .bashrc [... I insert the line "ZZZTESTVAR=234" (without the quotes) into the file in vim ...] Administrator@HintTech-Dev MINGW64 ~ $ exit Yet, when I next run Git Bash: Administrator@Hin

Join the discussion →

Using a VBScript to send an email through Outlook

I've recently wrote a VBScript to send an email using Outlook. Everything works great untill it gets to the sending point. I'm assuming since it only opens a single message, and since the message was sent... the Window closes and Outlook is killed. Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(0) objMail.Display 'To display message objMail.Recipients.Add ("[email protected]") objMail.Subject = "Mail Subject" objMail.Body = "This is Email Body" objMail.Send objOutlook.Quit Set objMail = Nothing Set objOutlook = Nothing All the information is entered

Join the discussion →

Break tie function js

I'm learning JS and I'm making an app to find the winners per hole in a golf game. The player with less strokes is the winner of the hole, but sometimes more than one player could tie the hole with the same number strokes, so, to find the winner of the hole I need to evaluate the number of strokes from the tied players in the next hole and break the tie, if the tie persist, I need to evaluate the next hole and so on. The function foo should return an array with the index, position or names from the winner or winners of the hole (if the tie was impossible to break). Here's my code: var players

Join the discussion →

spring error :org.springframework.web.context.ContextLoader - Context initialization failed

I am developing a simple project in spring but I have the following problem org.springframework.web.context.ContextLoader - Context initialization failed this is the controller: package com.linedata.jaba.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.linedata.jaba.metier.IBanqueMetier; @Controller public class BanqueController { @Autowired private IBanqueMetier metier; @RequestMapping(value="/index") public String index() { return "banque"; }

Join the discussion →

Import PSD to canvas

I am building a application using fabricjs for creating the custom products. I wanted to know if we can import the PSD files directly to canvas? Like all the layers are automatically converted to canvas objects and are set with the appropriate properties. Thanks Rahul

Join the discussion →

Is it possible to Proguard an Android library module, but not the application module?

I'm hoping somebody can answer what I think is a basic Gradle/Proguard question. I have a very basic Android project. This project contains the main app module, named app, and a library module for the Android Support libraries, named AndroidSupport. I wish to run Proguard exclusively on AndroidSupport (i.e. NOT on the overall application) because I'm having trouble running instrumentation tests on the application when it is Proguard-ed. My hope is that I can minify AndroidSupport on its own so that I don't need to Proguard my application code (and thus, avoid the problem of tests not running).

Join the discussion →

How to write unit test for switch case using jasmine

below is my code var s=function(){ return 'API CALL';//Through some API call i am getting and integer value }; switch(s()){ case 0: store.p1="Some Text"; break; case 1: store.p1="Some Other Text"; break; case 2: store.p1="Another Text"; break; } In the above function i am firing API call,which returns an integer value(0,1,2) and storing it in 's', i wanted to write unit test using jasmine..., could anyone please help how to write test case?! Note: 'store' is global variable and p1 is a another variable in 'store' where i want to store the value of 's'.

Join the discussion →
Older stories