Daily Archives

Articles indexed Saturday August 23 2014

Page 10/15 | < Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • RT3290 Bluetooth not pairing in Ubuntu 14.04

    - by Nashhole
    I recently followed the instructions listed in the following link to get my RT3290 bluetooth working on my laptop. These instructions have yielded the most progress I have had in the year I have had this laptop. My machine now sees my bluetooth, I can scan for and see devices, and other devices and see my laptop, but pairing continually fails. Ralink RT 3290 Bluetooth Problem on Ubuntu 14.04 -lscpi reads 04:00.1 Bluetooth: Ralink corp. RT3290 Bluetooth -rfkill list reads 0: hci0: Bluetooth Soft blocked: no Hard blocked: no -dmesg | grep Blue reads [ 5.965811] Bluetooth: Core ver 2.17 [ 5.965833] Bluetooth: HCI device and connection manager initialized [ 5.965840] Bluetooth: HCI socket layer initialized [ 5.965842] Bluetooth: L2CAP socket layer initialized [ 5.965847] Bluetooth: SCO socket layer initialized [ 6.038085] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 6.038088] Bluetooth: BNEP filters: protocol multicast [ 6.038096] Bluetooth: BNEP socket layer initialized [ 6.058013] Bluetooth: RFCOMM TTY layer initialized [ 6.058024] Bluetooth: RFCOMM socket layer initialized [ 6.058029] Bluetooth: RFCOMM ver 1.11 Any one have any thoughts or ideas I could try? Thanks in advance for your time and assistance.

    Read the article

  • Grub rescue after installing Ubuntu from USB

    - by Victor Suarez
    I have Windows 7 installed in my internal HDD and wanted to try out Ubuntu so I have an USB to put Ubuntu LiveUSB on and installed Ubuntu on a external HDD and everything worked out fine. Now the problem. If I remove the external HDD and try to boot Windows normally it shows the grub rescue screen. The only way to boot into Windows is by having the external HDD attached. Is there any way I can make it so I won't have to have the external HDD attached to be able to boot my Windows 7?

    Read the article

  • How to join video files from terminal?

    - by Leon Vitanos
    I have tried avidemux2_cli, mencoder, ffmpeg, cat.. But this doesn't always work (With the most of the times the error is that the audio codec is not the same) Maybe i put wrong options in the commands. So the commands: cat Sample.avi rrr.avi > complete.avi ffmpeg -i Sample.avi -i output.avi -vcodec copy -acodec copy complete.avi mencoder -ovc lavc -oac copy Sample.avi rrr.avi -o complete.avi avidemux2_cli --audio-codec copy --video-codec copy --output-format avi --load Sample.avi -append output.avi --save video.avi The cat problem is that it doesn't show error but it doesn't work always..Like the complete.avi will be exactly the same with Sample.avi Fmmpeg does nothing. The complete.avi is always the same with Sample.avi Mencoder error: All files must have identical audio codec and format for -oac copy. So the complete.avi is the same with Sample.avi avidemux2_cli there is no error but the complete.avi is again the same with Sample.avi.. So to sum up, all complete.avi are the same with Sample.avi.. And the problem is that they don't have the same audio codec ( i quess ).. Any ideas?

    Read the article

  • i want to access mysql database table on given conditions in drop down menu [on hold]

    - by user3909877
    as the code below is accesing the database table directly but i want it to display the table content on giving conditions in drop down menu like when i select islamabad in one drop down menu and lahore in other as given in code and press search buttonn then it display the table flights.but it is displaying it directly <p class="h2">Quick Search</p> <div class="sb2_opts"> <p> </p> <form method="post" action=""> <p>Enter your source and destination.</p> <p> From:</p> <select name="from"> <option value="Islamabad">Islamabad</option> <option value="Lahore">Lahore</option> <option value="murree">Murree</option> <option value="Muzaffarabad">Muzaffarabad</option> </select> <p> To:</p> <select name="To"> <option value="Islamabad">Islamabad</option> <option value="Lahore">Lahore</option> <option value="murree">Murree</option> <option value="Muzaffarabad">Muzaffarabad</option> </select> <input type="submit" value="search" /> </form> </form> </table> <?php $from = isset($_POST['from'])?$_POST['from']:''; $to = isset($_POST['to'])?$_POST['to']:''; if( $from =='Islamabad'){ if($to == 'Lahore'){ $db_host = 'localhost'; $db_user = 'root'; $database = 'homedb'; $table = 'flights'; if (!mysql_connect($db_host, $db_user)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); $result = mysql_query("SELECT * FROM {$table}"); if (!$result) { die("Query to show fields from table failed"); } $result = mysql_query("SELECT * FROM {$table}"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "<h1>Table: {$table}</h1>"; echo "<table border='1'><tr>"; while($row = mysql_fetch_row($result)) { echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>\n"; } } } mysqli_close($con); ?>

    Read the article

  • Google indexing pages with #! although we don't have any

    - by Benjamin Gruenbaum
    Our company has developed a Single Page Application using AngularJS and its routing. Google indexed our site decently with JavaScript but it did not index some pages very well so we have developed an HTML only version. We have followed the Ajax Crawling Specification posted here and have a <meta name='fragment' content='!'> tag and canonical urls. We expect http://www.example.com/foo/bar to be fetched from http://www.example.com/?_escaped_fragment_=/foo/bar. However, we have found out that when we rolled the AJAX specification we now have all pages indexed twice, once with the JavaScript version as http://www.example.com/foo/bar and once with the new version as http://www.example.com/#!/foo/bar. This is harmful to us since it's duplicate content and also mis-representing out site. I have tried looking for similar questions here and in the Google product forum but could not come up with anything.

    Read the article

  • How to motivate visitors to comment

    - by Michal
    At first I must apologize, because I am not sure if this question is valid for webmasters topic. I deal with the problem as being webmaster, however, i think this question is more related with marketing. Nevertheless, I was searching for marketing stack-overflow at meta stack-overflow and did not find such page. Background Four days ago, I launched a portal with database of barber salons at which people can find a salon through various criterions, see its photos, details, and also put a comment with their own opinion. The development took me half a year and it took me other 2 months to fill the database with information about barbers (I've also hired another three people to this job). I have not a big problem with getting people to my portal, I pay for PPC, comment on barber discussions etc.. In past four days I've reached a satisfactory number of visitors. Problem I deal with fact that everyone wants to search and read comments, but no one is willing to put her/his own opinion to barber. So I've tried following (2 days ago): Made comment anonymous, no one has to be afraid of compromise her/his identity with a salon owner I prepared a competition for users in which they can win a cosmetic package if they comment on at least three different salons I payed for PPC campaign on facebook which is telling people about the competition I registered competition on 20 portals for competitions And the result: People are commenting on facebook that the competition is a good idea They are giving likes on facebook But no one put a single comment to a barber salon I am getting little confused about what am I doing wrong. I will be thankful for any advice.

    Read the article

  • How to track users who access an app three times a week in Google Analytics

    - by exceptionerror
    I have an IOS app that is being tracked, and I'm looking to find unique users who use the app 3 or more times a week. I am able to find users who logged three sessions in a particular week, but I'd like to find users who log three sessions every week since a given start period. Similarly, I'd like to find the number of users who use the app 1 time a week and one and 1 time a month. Is this possible through Google Analytics?

    Read the article

  • Connecting Google Analytics with Custom Search Engine AdSense

    - by Yochai Timmer
    I have a Custom Search Engine that I've created with AdSense. I've put that search engine as a site search in my Google Sites page. I've connected both the Custom Search Engine and the Google Site to my Analytics page via their settings pages. Now, I'm trying to get Analytics to show me the AdSense for Search statistics. I've managed to connect the Google Sites page, to the Analytics, and I can see the search statistics in the Analytics as well. But I can't get it to show the actual AdSense for Search statistics from the Custom Search Engine. How can I configure everything so I can get the AdSense for Search statistics of my Custom Search Engine in my Analytics page?

    Read the article

  • Jumping Physics

    - by CogWheelz
    With simplicity, how can I make a basic jump without the weird bouncing? It jumps like 2 pixels and back Here's what I use y += velY x += velX then keypresses MAX_SPEED = 180; falling = true; if(Gdx.input.isKeyPressed(Keys.W)) {//&& !jumped && !p.falling) { p.y += 20; } if(!Gdx.input.isKeyPressed(Keys.W)) p.velY = 0; if(Gdx.input.isKeyPressed(Keys.D)) p.velX = 5; if(!Gdx.input.isKeyPressed(Keys.D) && !(Gdx.input.isKeyPressed(Keys.A))) p.velX = 0; if(Gdx.input.isKeyPressed(Keys.A)) p.velX = -5; if(!Gdx.input.isKeyPressed(Keys.A) && !(Gdx.input.isKeyPressed(Keys.D))) p.velX = 0; if(p.falling == true || p.jumping == true) { p.velY -= 2; } if(p.velY > MAX_SPEED) p.velY = MAX_SPEED; if(p.velX > MAX_SPEED) p.velX = MAX_SPEED;

    Read the article

  • How do you create a .XNB Font file for use with CocosSharp?

    - by Chris Pietschmann
    I know the .XNB file format is an XNA thing and that CocosSharp inherits this from its MonoGame roots. However there doesn't seem to be any information on how to create your own .XNB fonts to use with CocosSharp. I've tried searching but can find any information. Could someone explain it here or point me to a tutorial on how to create .XNB font file for use with CocosSharp? A site to download already compiled .XNB Fonts would also be acceptable. Update: Another thing that makes this tricky is that I guess XNA Game Studio could be used, but it's not compatible with Windows 8.1; which is what I currently use for my dev machine...

    Read the article

  • WebGL First Person Camera - Matrix issues

    - by Ryan Welsh
    I have been trying to make a WebGL FPS camera.I have all the inputs working correctly (I think) but when it comes to applying the position and rotation data to the view matrix I am a little lost. The results can be viewed here http://thistlestaffing.net/masters/camera/index.html and the code here var camera = { yaw: 0.0, pitch: 0.0, moveVelocity: 1.0, position: [0.0, 0.0, -70.0] }; var viewMatrix = mat4.create(); var rotSpeed = 0.1; camera.init = function(canvas){ var ratio = canvas.clientWidth / canvas.clientHeight; var left = -1; var right = 1; var bottom = -1.0; var top = 1.0; var near = 1.0; var far = 1000.0; mat4.frustum(projectionMatrix, left, right, bottom, top, near, far); viewMatrix = mat4.create(); mat4.rotateY(viewMatrix, viewMatrix, camera.yaw); mat4.rotateX(viewMatrix, viewMatrix, camera.pitch); mat4.translate(viewMatrix, viewMatrix, camera.position); } camera.update = function(){ viewMatrix = mat4.create(); mat4.rotateY(viewMatrix, viewMatrix, camera.yaw); mat4.rotateX(viewMatrix, viewMatrix, camera.pitch); mat4.translate(viewMatrix, viewMatrix, camera.position); } //prevent camera pitch from going above 90 and reset yaw when it goes over 360 camera.lockCamera = function(){ if(camera.pitch > 90.0){ camera.pitch = 90; } if(camera.pitch < -90){ camera.pitch = -90; } if(camera.yaw <0.0){ camera.yaw = camera.yaw + 360; } if(camera.yaw >360.0){ camera.yaw = camera.yaw - 0.0; } } camera.translateCamera = function(distance, direction){ //calculate where we are looking at in radians and add the direction we want to go in ie WASD keys var radian = glMatrix.toRadian(camera.yaw + direction); //console.log(camera.position[3], radian, distance, direction); //calc X coord camera.position[0] = camera.position[0] - Math.sin(radian) * distance; //calc Z coord camera.position[2] = camera.position [2] - Math.cos(radian) * distance; console.log(camera.position [2] - (Math.cos(radian) * distance)); } camera.rotateUp = function(distance, direction){ var radian = glMatrix.toRadian(camera.pitch + direction); //calc Y coord camera.position[1] = camera.position[1] + Math.sin(radian) * distance; } camera.moveForward = function(){ if(camera.pitch!=90 && camera.pitch!=-90){ camera.translateCamera(-camera.moveVelocity, 0.0); } camera.rotateUp(camera.moveVelocity, 0.0); } camera.moveBack = function(){ if(camera.pitch!=90 && camera.pitch!=-90){ camera.translateCamera(-camera.moveVelocity, 180.0); } camera.rotateUp(camera.moveVelocity, 180.0); } camera.moveLeft = function(){ camera.translateCamera(-camera.moveVelocity, 270.0); } camera.moveRight = function(){ camera.translateCamera(-camera.moveVelocity, 90.0); } camera.lookUp = function(){ camera.pitch = camera.pitch + rotSpeed; camera.lockCamera(); } camera.lookDown = function(){ camera.pitch = camera.pitch - rotSpeed; camera.lockCamera(); } camera.lookLeft = function(){ camera.yaw= camera.yaw - rotSpeed; camera.lockCamera(); } camera.lookRight = function(){ camera.yaw = camera.yaw + rotSpeed; camera.lockCamera(); } . If there is no problem with my camera then I am doing some matrix calculations within my draw function where a problem might be. //position cube 1 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.translate(worldMatrix, worldMatrix, [-20.0, 0.0, -30.0]); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); setShaderMatrix(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.vertexAttribPointer(shaderProgram.attPosition, 3, gl.FLOAT, false, 8*4,0); gl.vertexAttribPointer(shaderProgram.attTexCoord, 2, gl.FLOAT, false, 8*4, 3*4); gl.vertexAttribPointer(shaderProgram.attNormal, 3, gl.FLOAT, false, 8*4, 5*4); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, myTexture); gl.uniform1i(shaderProgram.uniSampler, 0); gl.useProgram(shaderProgram); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); //position cube 2 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); mat4.translate(worldMatrix, worldMatrix, [40.0, 0.0, -30.0]); setShaderMatrix(); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); //position cube 3 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); mat4.translate(worldMatrix, worldMatrix, [20.0, 0.0, -100.0]); setShaderMatrix(); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); camera.update();

    Read the article

  • Algorithm to shift the car

    - by Simran kaur
    I have a track that can be divided into n number of tracks and a car as GamObject. The track has transforms such that some part of the track's width lies in negative x axis and other in positive. Requirement: One move should cross one track. On every move(left or right), I want the car to reach exact centre of the next track on either sides i.e left or right. My code: Problem: : Because of negative values , somewhere I am missing out something that is making car move not in desirable positions and that's because of negative values only. variable tracks is the number of tracks the whole track is divided in. variable dist is the total width of the complete track. On left movement: if (Input.GetKeyDown (KeyCode.LeftArrow)) { if (this.transform.position.x < r.renderer.bounds.min.x + box.size.x) { this.transform.position = new Vector3 (r.renderer.bounds.min.x + Mathf.FloorToInt(box.size.x), this.transform.position.y, this.transform.position.z); } else { int tracknumber = Mathf.RoundToInt(dist - transform.position.x)/tracks; float averagedistance = (tracknumber*(dist/tracks) + (tracknumber-1)*(dist/tracks))/2; if(transform.position.x > averagedistoftracks) { amountofmovement = amountofmovement + (transform.position.x - averagedistance); } else { amountofmovement = amountofmovement - (averagedistance - transform.position.x); } this.transform.position = new Vector3 (this.transform.position.x - amountofmovement, this.transform.position.y, this.transform.position.z); } }

    Read the article

  • 2D Pixel/sprite game in unity? [on hold]

    - by acidzombie24
    Hi I'm an absolute newbie in unity. In the past I was told unity is terrible for 2d games so I look away after looking at it for a few days. I don't remember if this was right before unity4 came out or after. I hear unity is fairly good at 2d now. I tried googling for tutorials but I'm doing it wrong. I could not find a good tetris or tic tac toe tutorial. What assets/tutorials do I want for a 2D game? Side question is what tutorials are good if I want to make a fire emblem/advance wars type game (HUD heavy grid base game)

    Read the article

  • Inverse projection: question about w coordinate

    - by fayeWilly
    I have to perform in shader an inverse projection from a u/v of a render target. What I do is: Get NDC as 2*(u,v,depth) - 1 Then world space as tmp = (P*V)^-1 * (NDC,1.0); world space = tmp/tmp.w; This apparently works, but I am confused about the w division there. Why this work? Shouldn't be a multiplication by a w somewhere (as in the "forward" pipeline there is the perpsective division?) Thank you, Faye

    Read the article

  • Why do camera's aspect ratio look good on computer but not on Android devices?

    - by Pooya Fayyaz
    I'm developing a game for Android devices and I have a script that solves the aspect-ratio problem for computer screens but not for my intended target platform. It looks perfect on computer, even when re-sizing the game screen, but not when running my game in landscape mode on mobile phones. This is my script using UnityEngine; using System.Collections; using System.Collections.Generic; public class reso : MonoBehaviour { void Update() { // set the desired aspect ratio (the values in this example are // hard-coded for 16:9, but you could make them into public // variables instead so you can set them at design time) float targetaspect = 16.0f / 9.0f; // determine the game window's current aspect ratio float windowaspect = (float)Screen.width / (float)Screen.height; // current viewport height should be scaled by this amount float scaleheight = windowaspect / targetaspect; // obtain camera component so we can modify its viewport Camera camera = GetComponent<Camera>(); // if scaled height is less than current height, add letterbox if (scaleheight < 1.0f && Screen.width <= 490 ) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } else // add pillarbox { float scalewidth = 1.0f / scaleheight; Rect rect = camera.rect; rect.width = scalewidth; rect.height = 1.0f; rect.x = (1.0f - scalewidth) / 2.0f; rect.y = 0; camera.rect = rect; } } } I figured that my problem occurs in this part of the script: if (scaleheight < 1.0f) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } Its look like this on my mobile phone (portrait): and on landscape mode:

    Read the article

  • Which game logic should run when doing prediction for PNP state updates

    - by spaceOwl
    We are writing a multiplayer game, where each game client (player) is responsible for sending state updates regarding its "owned" objects to other players. Each message that arrives to other (remote) clients is processed as such: Figure out when the message was sent. Create a diff between NOW and that time. Run game specific logic to bring the received state to "current" time. I am wondering which sort of logic should execute as part of step #3 ? Our game is composed of a physical update (position, speed, acceleration, etc) and many other components that can update an object's state and occur regularly (locally). There's a trade off here - Getting the new state quickly or remaining "faithful" to the true state representation and executing the whole thing to predict the "true" state when receiving state updates from remote clients. Which one is recommended to be used? and why?

    Read the article

  • pyscripter Rpyc error

    - by jf328
    pyscripter 2.5.3.0 x64, python 2.7.7 anaconda 2.0.1, windows 7 I was using pyscripter and EPD python happily in 32 bit, no problem. Just changed to 64 bit anaconda version and re-installed everything but now pyscripter cannot import rpyc -- it runs with internal engine (no anaconda), but no such error in pure python. Thanks very much! btw, there is a similar SO post few years ago, but the answer there does not work. *** Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32. *** Internal Python engine is active *** *** Internal Python engine is active *** >>> import rpyc Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Anaconda\lib\site-packages\rpyc\__init__.py", line 44, in <module> from rpyc.core import (SocketStream, TunneledSocketStream, PipeStream, Channel, File "C:\Anaconda\lib\site-packages\rpyc\core\__init__.py", line 1, in <module> from rpyc.core.stream import SocketStream, TunneledSocketStream, PipeStream File "C:\Anaconda\lib\site-packages\rpyc\core\stream.py", line 7, in <module> import socket File "C:\Anaconda\Lib\socket.py", line 47, in <module> import _socket ImportError: DLL load failed: The specified procedure could not be found. >>> C:\research>python Python 2.7.7 |Anaconda 2.0.1 (64-bit)| (default, Jun 11 2014, 10:40:02) [MSC v.1500 64bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://binstar.org >>> import rpyc >>>

    Read the article

  • StringIndexOutOfBoundsException error in main method

    - by Ro Siv
    I am obtaining a StringIndexOutOfBoundsError when running my main method. Here is the output of my program in the command line. "Please enter the shift, 1 for day, 2 for night" 1 "you entered a number for the shift" "Please enter the hourly pay Rate" 2 "you entered a number for the pay Rate" "Please enter the employees name" brenda "cat6b" "your value you entered is correct 0-9 or a - z" "Please enter the employee number" 100e "cat41" "your value you entered is correct 0-9 or a - z" "Please enter current date in XXYYZZZZ format, X is day, Y is month, Z is year" 10203933 "cat81 " "your value you entered is correct 0-9 or a - z" 90 1 valye of array is 1 81 0 value of array is 0 82 2 value of array is 2 83 0 value of array is 0 84 3 value of array is 3 85 9 value of array is 9 86 3 value of array is 3 87 3 value of array is 3 "Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 8 at java.lang.String.charAt(String.java:658) at ProductionWorker<init>(ProductionWorker.java:66) at labBookFiftyFour.main(labBookFiftyFour.java:58)" "Press any key to continue . . ." Ignore the cat parts in the code, i was using a println statement to test the code. Ignore the value of array output as well, as i wanted to use an array in the program later on. Here is my main method. import java.math.*; import java.text.DecimalFormat; import java.io.*; import java.util.*; public class labBookFiftyFour { public static void main(String[] args) { Scanner myInput = new Scanner(System.in); int shift = -1; double pRate = -2; String name = " "; String number = " "; String date = " "; while(shift < 0 || pRate < 0 ) { System.out.println("Please enter the shift, 1 for day, 2 for night"); if(myInput.hasNextInt()){ System.out.println("you entered a number for the shift"); shift = myInput.nextInt(); } System.out.println("Please enter the hourly pay Rate"); if(myInput.hasNextDouble()){ System.out.println("you entered a number for the pay Rate"); pRate = myInput.nextDouble(); } else if (myInput.hasNext()) { System.out.println("Please enter a proper value"); myInput.next(); } else { System.err.println("No more input"); System.exit(1); } } myInput.nextLine(); //consume newLine System.out.println("Please enter the employees name"); name = myInput.nextLine(); //use your isValid method if(isValid(name)) { System.out.println("your value you entered is correct 0-9 or a - z "); } System.out.println("Please enter the employee number"); number = myInput.nextLine(); //use your isValid method if(isValid(number)) { System.out.println("your value you entered is correct 0-9 or a - z "); } System.out.println("Please enter current date in XXYYZZZZ format, X is day, Y is month, Z is year"); date = myInput.nextLine(); //use your isValid method if(isValid(date)) { System.out.println("your value you entered is correct 0-9 or a - z "); } ProductionWorker myWorker = new ProductionWorker(shift, pRate, name, number, date); //int day and night , double payRate System.out.println("THis is the shift " + myWorker.getShift() + " This is the pay Rate " + myWorker.getPRate() + " " + myWorker.getName() + " " + myWorker.getNumber() + " " + myWorker.getDate()); } //Made this method for testing String input for 0-9 or a - z values , put AFTER main method, but before end of class public static boolean isValid(String stringName) //This method has to be static, for some reason? { System.out.println("cat" + stringName.length() + stringName.charAt(0)); boolean flag = true; int index = 0; while(index < stringName.length()) { if(Character.isLetterOrDigit(stringName.charAt(index))) { flag = true; } else { flag = false; } ++index; } return flag; } } Here is my employeeOne. java Superclass public class employeeOne { private String name; private String number; private String date; public employeeOne(String name, String number, String date) { this.name = name; this.number = number; this.date = date; } public String getName() { return name; } public String getNumber() { return number; } public String getDate() { return date; } } Here is my ProductionWorker.java subclass, which extends employeeOne public class ProductionWorker extends employeeOne { private int shift; //shift represents day or night, day = 1, night = 2 private double pRate; //hourly pay rate public ProductionWorker(int shift, double pRate, String name, String number, String date) { super(name, number, date); this.shift = shift; if(this.shift >= 3 || this.shift <= 0) { System.out.println("You entered an out of bounds shift date, enter 1 for day or 2 for night, else shift will be day"); this.shift = 1; } this.pRate = pRate; boolean goodSoFar = true; int indexNum = 0; int indexDate = 0; if(name.length() <= 10 && number.length() <= 4 && date.length() < 9 ) { goodSoFar = true; } else { goodSoFar = false; } while(goodSoFar && indexNum < 3) //XXXL XXX digits 1-9, L is a letter A -M { if(Character.isDigit(number.charAt(indexNum))) { goodSoFar = true; } else { goodSoFar = false; } ++indexNum; } while(goodSoFar && indexNum < 4) { if(Character.isLetter(number.charAt(indexNum))) { goodSoFar = true; } else if(Character.isDigit(number.charAt(indexNum))) { goodSoFar = false; } else if(Character.isDigit(number.charAt(indexNum)) == false && Character.isLetter(number.charAt(indexNum)) == false) { goodSoFar = false; } ++indexNum; } int[] dateValues = new int[date.length()]; while(goodSoFar && indexDate <= date.length()) //XXYYZZZZ { System.out.println("" + date.length() + indexDate + " " + date.charAt(indexDate)); if(Character.isDigit(date.charAt(indexDate))) { dateValues[indexDate] = Character.getNumericValue(date.charAt(indexDate)); System.out.println("value of array is " + dateValues[indexDate]); ++indexDate; } else { goodSoFar = false; } } if(goodSoFar) { System.out.println("your input is good so far"); } else { System.out.println("your input is wrong for name or number or date"); } } public int getShift() { return shift; } public double getPRate() { return pRate; } }

    Read the article

  • How do I suppress this output?

    - by David
    I have a code chunk in an R Markdown file. ```{r} library(UsingR) ``` Using knitHTML to compile causes the following output, which never happened before I updated to the latest versions of R and RStudio: ## Loading required package: MASS ## Loading required package: HistData ## Loading required package: Hmisc ## Loading required package: grid ## Loading required package: lattice ## Loading required package: survival ## Loading required package: splines ## Loading required package: Formula ## ## Attaching package: 'Hmisc' ## ## The following objects are masked from 'package:base': ## ## format.pval, round.POSIXt, trunc.POSIXt, units ## ## Loading required package: aplpack ## Loading required package: tcltk ## Loading required package: quantreg ## Loading required package: SparseM ## ## Attaching package: 'SparseM' ## ## The following object is masked from 'package:base': ## ## backsolve ## ## ## Attaching package: 'quantreg' ## ## The following object is masked from 'package:Hmisc': ## ## latex ## ## The following object is masked from 'package:survival': ## ## untangle.specials ## ## ## Attaching package: 'UsingR' ## ## The following object is masked from 'package:survival': ## ## cancer How can I suppress this output? Note: echo=FALSE did not work.

    Read the article

  • How do I get PyLint to find namespace packages?

    - by tjd.rodgers
    I have a virtualenv where I've installed two packages, both using the company.project_name namespace. So the first package is importable from company.project_name.one and the second from company.project_name.two. The challenge is that I can't seem to be able to run PyLint on either one of them. If I issue: $ pylint company.project_name.one I get: ************* Module company.project_name.one F: 1, 0: No module named project_name.one(fatal) I suspect that I'm probably doing something wrong. Is there a proper way to do this? Edit: I should have made it clear that company.project_name and company are namespace packages and not regular packages.

    Read the article

  • Get value of element in Multi-Dimensional Array

    - by George
    Here is my foreach loop to get at the values from a multi-dimensional array $_coloredvariables = get_post_meta( $post->ID, '_coloredvariables', true ); foreach ($_coloredvariables as $key => $value) { var_dump($value); } Which outputs this: array 'label' => string 'Color' (length=5) 'size' => string 'small' (length=5) 'displaytype' => string 'square' (length=6) 'values' => array 'dark-night-angel' => array 'type' => string 'Image' (length=5) 'color' => string '#2c4065' (length=7) 'image' => string '' (length=0) 'forest-green' => array 'type' => string 'Color' (length=5) 'color' => string '#285d5f' (length=7) 'image' => string '' (length=0) 'voilet' => array 'type' => string 'Color' (length=5) 'color' => string '#6539c9' (length=7) 'image' => string '' (length=0) 'canary-yellow' => array 'type' => string 'Color' (length=5) 'color' => string 'grey' (length=4) 'image' => string '' (length=0) And then to only get the values array I can do this: foreach ($_coloredvariables as $key => $value) { var_dump($value['values']); } which outputs this: array 'dark-night-angel' => array 'type' => string 'Image' (length=5) 'color' => string '#2c4065' (length=7) 'image' => string '' (length=0) 'forest-green' => array 'type' => string 'Color' (length=5) 'color' => string '#285d5f' (length=7) 'image' => string '' (length=0) 'voilet' => array 'type' => string 'Color' (length=5) 'color' => string '#6539c9' (length=7) 'image' => string '' (length=0) 'canary-yellow' => array 'type' => string 'Color' (length=5) 'color' => string 'grey' (length=4) 'image' => string '' (length=0) What I can't figure out is how to get these elements in the array structure "dark-night-angel", "forest-green", "voilet", "canary-yellow" Without using specific names: var_dump($value['values']['dark-night-angel']) Something that is more dynamic, of course this doesn't work: var_dump($value['values'][0][0]); thanks

    Read the article

  • UISegmentedControl is hidden under the titleBar

    - by shay te
    i guess i am missing something with the UISegmentedControl and auto layout. i have a TabbedApplication (UITabBarController), and i created a new UIViewController to act as tab. to the new view i added UISegmentedControl, and place it to top using auto layout. i guess i don't understand completely something , cause the UISegmentedControl is hiding under the titleBar . can u help me understand what i am missing ? thank you . import Foundation import UIKit; class ViewLikes:UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "some title"; var segmentControl:UISegmentedControl = UISegmentedControl(items:["blash", "blah blah"]); segmentControl.selectedSegmentIndex = 1; segmentControl.setTranslatesAutoresizingMaskIntoConstraints(false) self.view.addSubview(segmentControl) //Set layout var viewsDict = Dictionary <String, UIView>() viewsDict["segment"] = segmentControl; //controls self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-[segment]-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: viewsDict)) self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-[segment]", options: NSLayoutFormatOptions(0), metrics: nil, views: viewsDict)) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }

    Read the article

  • Android material L image transition interpolator

    - by Diolor
    This is more of a mathematics question rather than programming. Well, I would like to ask id you know what is the interpolator described in Material design: It looks to be an AccelerateDecelerateInterpolator but the deceleration effect decays slower. My best hatch is : public class MaterialInterpolator implements Interpolator { @Override public float getInterpolation(float input) { if(input<1./3f) return new AccelerateInterpolator().getInterpolation(input); else return new DecelerateInterpolator().getInterpolation(input); } } Which creates a gap between the values: Time / Value 0.3,0.09 0.317,0.100489 0.333,0.110889 <-- gap 0.35,0.57750005 0.367,0.599311 0.383,0.61931103 0.4,0.64 Source: http://www.google.com/design/spec/patterns/imagery-treatment.html

    Read the article

  • How to copy files without slowing down my app?

    - by Kevin Gebhardt
    I have a bunch of little files in my assets which need to be copied to the SD-card on the first start of my App. The copy code i got from here placed in an IntentService works like a charm. However, when I start to copy many litte files, the whole app gets increddible slow (I'm not really sure why by the way), which is a really bad experience for the user on first start. As I realised other apps running normal in that time, I tried to start a child process for the service, which didn't work, as I can't acess my assets from another process as far as I understood. Has anybody out there an idea how a) to copy the files without blocking my app b) to get through to my assets from a private process (process=":myOtherProcess" in Manifest) or c) solve the problem in a complete different way Edit: To make this clearer: The copying allready takes place in a seperate thread (started automaticaly by IntentService). The problem is not to separate the task of copying but that the copying in a dedicated thread somehow affects the rest of the app (e.g. blocking to many app-specific resources?) but not other apps (so it's not blocking the whole CPU or someting) Edit2: Problem solved, it turns out, there wasn't really a problem. See my answer below.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >