Daily Archives

Articles indexed Thursday July 5 2012

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

  • Double X-screens on one monitor

    - by user75226
    I have two monitors connected currently, my laptop display and an old dell monitor. For some reason one monitor (the dell) has double everything (it will make sense when you see the image). I think it came about when one day I tried using separate x-screen instead of just twin view for a specific reason I don't remember why (I was trying to get the Menu bar to show on my laptop monitor instead of the Dell I believe, it only shows up on the left-most monitor it seems) but anyhow I was wondering if anyone can help me fix this issue. Thanks.

    Read the article

  • How to mount ext4 partition?

    - by Flint
    How do I mount an ext4 partition as my user account so I wouldn't require root access to r/w on it? I used -o uid=flint,gid=flint on the mount command but I keep getting mount: wrong fs type, bad option, bad superblock on /dev/sda7, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so Another thing, I want avoid using udisks for now as it doesn't let me mount to my specified mount point name.

    Read the article

  • How to list missing partitions?

    - by celebrimbor
    I have installed Ubuntu on one of my partition and Crunchbang on the other partition. As I wanted to make some continuous space, I moved Crunchbang partition and then checked fdisk output which looks like this Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc7996dfa Device Boot Start End Blocks Id System /dev/sda1 * 63 80324 40131 de Dell Utility /dev/sda4 81918 625139711 312528897 f W95 Ext'd (LBA) /dev/sda5 81920 211816447 105867264 83 Linux /dev/sda6 299100160 341043199 20971520 83 Linux /dev/sda7 341045248 625139711 142047232 7 HPFS/NTFS/exFAT I cannot see sda2 and sda3 partition. How to find them?

    Read the article

  • Creating a bootable CD based on Ubuntu Server

    - by 0xC0000022L
    Note: bootable here refers to an Installation CD, not to the El Torito bootable CD standard if narrowly construed, or to a Live CD if widely construed. What tools exist to create a bootable CD based on Ubuntu 12.04? Unlike the Live CD used for the Desktop edition, the Server edition doesn't use Casper and that's exactly what I want. I.e. this question is not about a live CD! I have read InstallCDCustomization, but that only covers preseeding, adding modules etc. What I would like to achieve is rather to build a bootable CD from scratch, preferably based on the kernel of my running system, the bash and other binaries from that running system. I know how to preseed my own installation CD, so I'm comfortable with the tools involved there. However, that skips important parts such as creating the directory structure that is expected on a bootable CD. And that's what I'm looking for. I guess the question could be summed up as: what tools are the Ubuntu build masters using to author the alternate and server installation CDs and where can I find documentation for these? I would prefer doing this on the terminal (because that's how I run the Ubuntu Server installations themselves). But if I need a second machine with GUI to do it, I can certainly live with that.

    Read the article

  • Booting Ubuntu shows only cursor, no desktop features

    - by jlkkljh
    I'm trying to install Ubuntu and have been trying since 2010 on my Win XP (2006-2008 I don't know which year's version exactly). I'm trying to get rid of XP and every time I install Ubuntu it doesn't work. I've tried all the options on the install list from Wubi and from inside the installer. I've tried a lot of different stuff and all it will load is a mouse cursor and a black screen. Please do help out with suggestions/advice. Thanks in advance.

    Read the article

  • Ubuntu 12.04 wireless detected, but can't connect to 128-bit WEP enabled microsoft MS-700 base station

    - by ubuntufan
    I installed Ubuntu 12.04 on a Presario R 3000. The Wireless card was not detected (firmware missing). Based on several related posts, I downloaded and installed the b43 driver and wireless was finally enabled. However, I am unable to connect to my base station successfully. The base station is configured for WEP 128-bit. I tried both infrastructure mode and ad-hoc mode (with the channel, band, etc. configured). Appreciate any help in trying to get past this.

    Read the article

  • Network manager indicator missing

    - by Jarmo
    I recently upgraded from 11.10 to 12.04. My first attempt failed, and I received an error stating that not all of the required packages were downloaded. Before (successfully) attempting again, I noticed that there was no longer a networking indicator in the upper panel. The indicator did not reappear with the installation of 12.04. To be clear, my wireless connection has experienced no problems, despite the missing indicator. Here are the solutions that I have found which did not work for me: Editing /etc/NetworkManager/NetworkManager.conf and replacing [ifupdown] managed=false with =true. Reinstalling network-manager (via apt-get install --reinstall). I am currently running 12.04 on an Asus Eee PC 1005 HA, and I am new to seeking solutions through forums, so I apologize if I have neglected to provide some vital information about my hardware.

    Read the article

  • Why must I restart for HDMI audio?

    - by David Shochat
    I have a System76 Lemur Ultra laptop, which has an HDMI port. When I plug in the HDMI cable, it is recognized immediately for video, but not for audio, i.e., it does not show up in the Output tab of the Sound Settings dialog. However, if I do a full restart with the cable plugged in, then it does show up and can be selected. I've also discovered that manually killing and restarting pulseaudio with the HDMI plugged in will force it to be recognized as an available audio output. So my question is, what is broken here? I've thought about writing a bug in launchpad, but I don't know which component is malfunctioning. Is it the kernel? ALSA? Pulse Audio? Something else? By the way, the same bug seems to exist in reverse, namely if I disconnect the HDMI, it is still listed in the Output tab until I again restart the OS. This is 12.04 LTS.

    Read the article

  • Error while running Jetty Server on port 80 as non root user

    - by user75016
    All, I was trying to setup jetty on port 80 but its giving exception saying permission denied as below. I have setup jetty to work with setuid and configured start.ini as follows: OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations,jta,jdbc,setuid (below as first configuration file in start.ini) etc/jetty-setuid.xml and jetty-setuid.xml file with username and group name of non root user. 2012-07-03 15:29:02.411:INFO:oejdp.ScanningAppProvider:Deployment monitor /opt/jetty-hightide-8.1.3.v20120416/contexts at interval 1 2012-07-03 15:29:02.454:WARN:oejuc.AbstractLifeCycle:FAILED [email protected]:80: java.net.SocketException: Permission denied java.net.SocketException: Permission denied at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:182) at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:311) at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:260) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.server.Server.doStart(Server.java:273) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1215) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1138) 2012-07-03 15:29:02.455:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@66da9ea4: java.net.SocketException: Permission denied java.net.SocketException: Permission denied

    Read the article

  • How do I format my entire HDD?

    - by Hjke123
    Ok I have recently made some mistakes with installing some operating systems that I should have just kept on a live cd not ubuntu but another os and with my ocd when I saw my lot's of different partitions I just wanted to reset my computer so it boot's up and doesn't load any os and I have to put in my ubuntu live cd and install that and that would be my only os on this computer so I want to know how I can just wipe my entire hard drive so when it boot's I get to put my live cd in and start anew?

    Read the article

  • How do I fix Flash player in Chrome 20?

    - by r0ckarong
    I just updated to Chrome 20.0.1132.43 which includes Flash 11.3.31.109. Since that update most of the flash videos I watch online will randomly display erratic behavior (skipping like a broken CD, "fast forwarding" at twice the frame rate with the audio being scrambled due to too fast playback, restarting every video after two seconds, fullscreen overlay being displayed but no image, fullscreen taking several seconds to actually show a picture, youtube player to go fullscreen but then hang in the controls fadeout animation with no picture -sound keeps playing). Is there anything I can do to resolve or work around this? I'm using Ubuntu 12.10 64Bit and the latest nvidia-current drivers 295.40 on a Geforce GT 440. It used to work in previous versions of Google Chrome.

    Read the article

  • Why does 12.04 upgrade abort with out of space error when I have lots of it?

    - by Kristian Thomsen
    When upgrading Ubuntu from 11.10 to 12.04 I discovered an unexpected problem. The upgrade was stopped because there wasn't enough free space for the installation. I managed to free some space and do the upgrade but now a prompt appears after logging in saying I'm out of space. This prompt asks me if I want to examine the problem. The "Disk Usage Analyser" is opened. In the top it says: Total filesystem capacity: 47.0 GB (used: 13.5 GB available: 33.4 GB) Folder -- Usage -- Size / -- 100% -- 12.5 GB usr -- 44.8 % -- 5.6 GB home -- 30.3 % -- 3.8 GB lib -- 13.0 % -- 1.6 GB var -- 9.1 % -- 1.1 GB boot 2.5 % 309.5 GB and a lot of small contributors like: etc, opt, sbin, bin etc. I do not really understand this problem since the analyser in the top says that I have 33.4 GB left in this file system. What can I do to make Ubuntu use the remaining space? Running df -i in the terminal gives: Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda7 610800 576874 33926 95% / udev 213451 563 212888 1% /dev tmpfs 218524 486 218038 1% /run none 218524 3 218521 1% /run/lock none 218524 7 218517 1% /run/shm /dev/sda8 2264752 16371 2248381 1% /home The output of df -h Filesystem Size Used Avail Use% Mounted on /dev/sda7 9,3G 7,8G 1,1G 88% / udev 993M 4,0K 993M 1% /dev tmpfs 401M 884K 400M 1% /run none 5,0M 0 5,0M 0% /run/lock none 1003M 152K 1002M 1% /run/shm /dev/sda8 35G 4,0G 29G 13% /home /dev/sda2 101G 64G 37G 64% /media/A2C8E28BC8E25CD3 Running sudo fdisk -l gives Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000080 Device Boot Start End Blocks Id System /dev/sda1 63 96389 48163+ de Dell Utility /dev/sda2 * 98304 210434488 105168092+ 7 HPFS/NTFS/exFAT /dev/sda3 210436094 312576704 51070305+ f W95 Ext'd (LBA) /dev/sda5 306279288 312576704 3148708+ dd Unknown /dev/sda6 210436096 214341631 1952768 82 Linux swap / Solaris /dev/sda7 214343680 233873407 9764864 83 Linux /dev/sda8 233875456 306278399 36201472 83 Linux Partition table entries are not in disk order

    Read the article

  • Auto update not working

    - by Mifas
    When I get new updates, I can't install them. When I try to install I get the following error message. installArchives() failed: Preconfiguring packages ... Preconfiguring packages ... Preconfiguring packages ... Preconfiguring packages ... (Reading database ... (Reading database ... 5%% (Reading database ... 10%% (Reading database ... 15%% (Reading database ... 20%% (Reading database ... 25%% (Reading database ... 30%% (Reading database ... 35%% (Reading database ... 40%% (Reading database ... 45%% (Reading database ... 50%% (Reading database ... 55%% (Reading database ... 60%% (Reading database ... 65%% (Reading database ... 70%% (Reading database ... 75%% (Reading database ... 80%% (Reading database ... 85%% (Reading database ... 90%% (Reading database ... 95%% (Reading database ... 100%% (Reading database ... 191976 files and directories currently installed.) Preparing to replace resolvconf 1.63ubuntu11 (using .../resolvconf_1.63ubuntu14_all.deb) ... Unpacking replacement resolvconf ... Preparing to replace libutouch-geis1 2.2.9-0ubuntu2 (using .../libutouch-geis1_2.2.9-0ubuntu3_i386.deb) ... Unpacking replacement libutouch-geis1 ... Preparing to replace vino 3.4.1-0ubuntu1 (using .../vino_3.4.2-0ubuntu1_i386.deb) ... Unpacking replacement vino ... Processing triggers for ureadahead ... ureadahead will be reprofiled on next reboot Processing triggers for man-db ... Processing triggers for gconf2 ... Processing triggers for desktop-file-utils ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for gnome-menus ... Processing triggers for libglib2.0-0 ... Setting up oracle-java7-installer (7u3-0~eugenesan~precise4) ... Downloading... --2012-05-23 19:40:37-- http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz Resolving download.oracle.com (download.oracle.com)... 223.224.12.144, 223.224.12.146 Connecting to download.oracle.com (download.oracle.com)|223.224.12.144|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz [following] --2012-05-23 19:40:38-- https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 173.223.2.174 Connecting to edelivery.oracle.com (edelivery.oracle.com)|173.223.2.174|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/errors/download-fail-1505220.html [following] --2012-05-23 19:40:41-- http://download.oracle.com/errors/download-fail-1505220.html Connecting to download.oracle.com (download.oracle.com)|223.224.12.144|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5307 (5.2K) [text/html] Saving to: `./jdk-7u3-linux-i586.tar.gz' 0K ..... 100%% 52.9K=0.1s 2012-05-23 19:40:41 (52.9 KB/s) - `./jdk-7u3-linux-i586.tar.gz' saved [5307/5307] Download done. sha256sum mismatch jdk-7u3-linux-i586.tar.gz Oracle JDK 7 is NOT installed. dpkg: error processing oracle-java7-installer (--configure): subprocess installed post-installation script returned error exit status 1 No apport report written because MaxReports is reached already Setting up resolvconf (1.63ubuntu14) ... Setting up libutouch-geis1 (2.2.9-0ubuntu3) ... Setting up vino (3.4.2-0ubuntu1) ... Processing triggers for resolvconf ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place Errors were encountered while processing: oracle-java7-installer Error in function:

    Read the article

  • Do or can robots cause considerable performance issues?

    - by Anicho
    So the question in the title is exactly what I am trying to find out. My case is: At work we are in a discussion with team members who seem to think bots will cause us problems relating to performance when running on our services website. Out setup: Lets say I have site www.mysite.co.uk this is a shop window to our online services which sit on www.mysiteonline.co.uk. When people search in google for mysite they see mysiteonline.co.uk as well as mysite.co.uk. Cases against stopping bots crawling: We don't store gb's of data publicly available on the web Most friendly bots, if they were to cause issues would have done so already In our instance the bots can't crawl the site because it requires username & password Stopping bots with robot .txt causes an issue with seo (ref.1) If it was a malicious bot, it would ignore robot.txt or meta tags anyway Ref 1. If we were to block mysiteonline.co.uk from having robots crawl this will affect seo rankings and make it inconvenient for users who actively search for mysite to find mysiteonline. Which we can prove is the case for a good portion of our users.

    Read the article

  • Scalable web-hosting for a youtube-like service (no, not porn) [closed]

    - by Crawling Pasta Hellion
    Possible Duplicate: How to find web hosting that meets my requirements? My business partner and I are looking for a European web-hosting service (we are situated in Europe). That service needs to be, needs to have: international servers, a server for each continent at the very least. a high amount of bandwidth. highly scalable, since we are expecting to start off small, but as our user base grows so will everything else (again, no porn or phallic jokes) need to do. a moderate to supreme customer service. of course a small downtime per annum. affordable at first, fair as we grow. I think that is all. Any input is greatly appreciated. Thank you in advance.

    Read the article

  • CSS tags/media queries for chrome on iPhone [migrated]

    - by Mick79
    So Chrome is here for iOS.. Hoorah! However now due to the different screen layout (no footer toolbar) it messes with the ability to make a perfect layout for iphone web pages. I have a site for my company that resided perfectly inside an iphone screen, no scrolling required, it looked like an app. However now that chrome is here (and wildly popular) with its different screen layout, sites that were sized for iphone safari now look odd. Is there, or will there be, ways to isolate out chrome from safari and give them different CSS?

    Read the article

  • How to determine the amount to spend per phrase on Adwords research?

    - by Anonymous -
    My company would like to start a PPC advertising campaign. Whilst I understand the concept and how to set everything up from a technical point of view, this is something I've never done before. Logically, we'd like to test out a wide range of keywords that we think would lead to conversions, which we've put together through brainstorming and with some help from Google's External Keyword Tool. Sub-question whilst I remember - am I correct in thinking that in Google's keyword tool, keywords that we think will perform well that have a low competition yet high monthly searches are good since there will be less advertisers, meaning our bid per click will be less? Is there a common benchmark or process of doing a round of tests with keywords? Should we wait for 100 clicks on each keyword, see which ones have lead to the most sales (or rather, sales that are sustainable with the cost per click of that keyword), then drop the ones which aren't converting and put that budget onto the converting keywords? We realistically have a few hundred keywords/phrases we would like to test, but spending $100 per keyword/phrase is going to work out as quite an expensive test. It would be nice to be able to spend $5-10 per phrase, but I don't think the sample size would be great enough to determine anything usefully reliable. Another approach might be to setup all the keywords, and those that bring the most sales within x hours/days would be the ones we use. What is the common procedure with things like this? I know there are a plethora of companies that specialize in exactly this, but this is something we anticipate doing a lot in the future, so it would make sense to do it in house if at all possible.

    Read the article

  • Where should I redirect (removed) phishing pages

    - by tinjaw
    I was unfortunately the victim of a PHP exploit. Looking through my webserver logs, people are still attempting to reach the URL used in the phish. I want to redirect them to a site that will educate these people on what phishing is. My question: Is there a (generic / vendor-neutral) phishing education website that you suggest I send them to with a 301 redirect? (I assume a 301 is the best option.)

    Read the article

  • Implementing AS 2.0 with FSM?

    - by Up2u
    i have seen many of references of AI and FSM like : http://www.richardlord.net/blog/fini...n-actionscript and sadly im still can't understand the point of the FSM on AS2.0 is it a must to create a class of each state ? i have a project of game and also it has an AI, the AI has 3 state n i said the state is distanceCheck, ChaseTarget, and Hit the target, the game that i create is FPS game and play via by mouse so what i mean is i have create an AI ( and is success ) but i want to convert it to FSM method ... i create : function of CheckDistanceState() and in that function i have to locked the target with an array, and sort it with the nearest distance and locked it and it trigger the function ChaseState(), and in the ChaseState() i insert the Hit() function to destroy the enemy, the 3 function that i created , i call it in the AI_cursor.onEnterframe, ( FPS game that only have a cursor in stage ) is there any chance to implement FSM to my code without to create a class ?? from what i read before , to create a class mean to create an external code outside of the frame ( i used to code in frame) and i stil dont understand about it. sorry if my explaination not clear ...

    Read the article

  • Controlling a GameObject from another GameObject's script component

    - by OhMrBigshot
    I'm creating a game where when starting the game, a Cube is duplicated GridSize * GridSize times when the game starts. Now, after the cubes are duplicated I want to attach a variable to them, say "Flag" which is a bool, from another script component (let's say I have a Prefab that generates the cloned cubes). In short, I have something like this: CreateTiles.cs : Attached to Prefab void Start() { createMyTiles(); // a function that clones the tiles flagRandomTiles(); // a function that (what I'm trying to do) "Flags" 10 random cubes } CubeBehavior.cs : Attached to each Cube public bool hasFlag; // other stuff Now, I want flagRandomTiles() to set a Cube's hasFlag property via code, assuming I have access to them via a GameObject[] array. Here's what I've tried: Cubes[x].hasFlag = true; - No access. Making a function such as Cubes[x].setHasFlag(true) - still no access. Initializing Cubes as a CubeBehavior object array, then doing the above - GameObjects can't be converted to CubeBehaviors - I get this error when I try to assign the Cubes into the array. How do I do this?

    Read the article

  • Issue with a point coordinates, which creates an unwanted triangle

    - by Paul
    I would like to connect the points from the red path, to the y-axis in blue. I figured out that the problem with my triangles came from the first point (V0) : it is not located where it should be. In the console, it says its location is at 0,0, but in the emulator, it is not. The code : for(int i = 1; i < 2; i++) { CCLOG(@"_polyVertices[i-1].x : %f, _polyVertices[i-1].y : %f", _polyVertices[i-1].x, _polyVertices[i-1].y); CCLOG(@"_polyVertices[i].x : %f, _polyVertices[i].y : %f", _polyVertices[i].x, _polyVertices[i].y); ccDrawLine(_polyVertices[i-1], _polyVertices[i]); } The output : _polyVertices[i-1].x : 0.000000, _polyVertices[i-1].y : 0.000000 _polyVertices[i].x : 50.000000, _polyVertices[i].y : 0.000000 And the result : (the layer goes up, i could not take the screenshot before the layer started to go up, but the first red point starts at y=0) : Then it creates an unwanted triangle when the code continues : Would you have any idea about this? (So to force the first blue point to start at 0,0, and not at 50,0 as it seems to be now) Here is the code : - (void)generatePath{ float x = 50; //first red point float y = 0; for(int i = 0; i < kMaxKeyPoints+1; i++) { if (i<3){ _hillKeyPoints[i] = CGPointMake(x, y); x = 150 + (random() % (int) 30); y += -40; } else if(i<20){ //going right _hillKeyPoints[i] = CGPointMake(x, y); x += (random() % (int) 30); y += -40; } else if(i<25){ //stabilize _hillKeyPoints[i] = CGPointMake(x, y); x = 150 + (random() % (int) 30); y += -40; } else if(i<30){ //going left _hillKeyPoints[i] = CGPointMake(x, y); //x -= (random() % (int) 10); x = 150 + (random() % (int) 30); y += -40; } else { //back to normal _hillKeyPoints[i] = CGPointMake(x, y); x = 150 + (random() % (int) 30); y += -40; } } } -(void)generatePolygons{ static int prevFromKeyPointI = -1; static int prevToKeyPointI = -1; // key points interval for drawing while (_hillKeyPoints[_fromKeyPointI].y > -_offsetY+winSizeTop) { _fromKeyPointI++; } while (_hillKeyPoints[_toKeyPointI].y > -_offsetY-winSizeBottom) { _toKeyPointI++; } if (prevFromKeyPointI != _fromKeyPointI || prevToKeyPointI != _toKeyPointI) { _nPolyVertices = 0; float x1 = 0; int keyPoints = _fromKeyPointI; for (int i=_fromKeyPointI; i<_toKeyPointI; i++){ //V0: at (0,0) _polyVertices[_nPolyVertices] = CGPointMake(x1, y1); //first blue point _polyTexCoords[_nPolyVertices++] = CGPointMake(x1, y1); //V1: to the first "point" _polyVertices[_nPolyVertices] = CGPointMake(_hillKeyPoints[keyPoints].x, _hillKeyPoints[keyPoints].y); _polyTexCoords[_nPolyVertices++] = CGPointMake(_hillKeyPoints[keyPoints].x, _hillKeyPoints[keyPoints].y); keyPoints++; //from point at index 0 to 1 //V2, same y as point n°2: _polyVertices[_nPolyVertices] = CGPointMake(0, _hillKeyPoints[keyPoints].y); _polyTexCoords[_nPolyVertices++] = CGPointMake(0, _hillKeyPoints[keyPoints].y); //V1 again _polyVertices[_nPolyVertices] = _polyVertices[_nPolyVertices-2]; _polyTexCoords[_nPolyVertices++] = _polyVertices[_nPolyVertices-2]; //V2 again _polyVertices[_nPolyVertices] = _polyVertices[_nPolyVertices-2]; _polyTexCoords[_nPolyVertices++] = _polyVertices[_nPolyVertices-2]; //CCLOG(@"_nPolyVertices V2 again : %i", _nPolyVertices); //V3 = same x,y as point at index 1 _polyVertices[_nPolyVertices] = CGPointMake(_hillKeyPoints[keyPoints].x, _hillKeyPoints[keyPoints].y); _polyTexCoords[_nPolyVertices] = CGPointMake(_hillKeyPoints[keyPoints].x, _hillKeyPoints[keyPoints].y); y1 = _polyVertices[_nPolyVertices].y; _nPolyVertices++; } prevFromKeyPointI = _fromKeyPointI; prevToKeyPointI = _toKeyPointI; } } - (void) draw { //RED glColor4f(1, 1, 1, 1); for(int i = MAX(_fromKeyPointI, 1); i <= _toKeyPointI; ++i) { glColor4f(1.0, 0, 0, 1.0); ccDrawLine(_hillKeyPoints[i-1], _hillKeyPoints[i]); } //BLUE glColor4f(0, 0, 1, 1); for(int i = 1; i < 2; i++) { CCLOG(@"_polyVertices[i-1].x : %f, _polyVertices[i-1].y : %f", _polyVertices[i-1].x, _polyVertices[i-1].y); CCLOG(@"_polyVertices[i].x : %f, _polyVertices[i].y : %f", _polyVertices[i].x, _polyVertices[i].y); ccDrawLine(_polyVertices[i-1], _polyVertices[i]); } } Thanks

    Read the article

  • Using Lerp to create a hovering effect for a GameObject

    - by OhMrBigshot
    I want to have a GameObject that has a "hovering" effect when the mouse is over it. What I'm having trouble with is actually having a color that gradually goes from one color to the next. I'm assuming Color.Lerp() is the best function for that, but I can't seem to get it working properly. Here's my CubeBehavior.cs's Update() function: private bool ReachedTop = false; private float t = 0f; private float final_t; private bool MouseOver = false; // Update is called once per frame void Update () { if (MouseOver) { t = Time.time % 1f; // using Time.time to get a value between 0 and 1 if (t >= 1f || t <= 0f) // If it reaches either 0 or 1... ReachedTop = ReachedTop ? false : true; if (ReachedTop) final_t = 1f - t; // Make it count backwards else final_t = t; print (final_t); // for debugging purposes renderer.material.color = Color.Lerp(Color.red, Color.green, final_t); } } void OnMouseEnter() { MouseOver = true; } void OnMouseExit() { renderer.material.color = Color.white; MouseOver = false; } Now, I've tried several approaches to making it reach 1 then count backwards till 0 including a multiplier that alternates between 1 and -1, but I just can't seem to get that effect. The value goes to 1 then resets at 0. Any ideas on how to do this?

    Read the article

  • Weird appearance for a 3D XNA ground

    - by Belos
    I wanted to add a ground so I can know the position of a helicopter in the world. But the ground appeared in a weird way: http://i.stack.imgur.com/yTSuW.jpg The ground had the following texture: http://i.stack.imgur.com/pdpxB.png EDIT: Sorry, I forgot to post the code: public class ImportModel { public Vector3 Position { get; set; } public Vector3 Rotation { get; set; } public Vector3 Scale { get; set; } Model Model; Matrix[] modeltransforms; GraphicsDevice GraphicDevice; ContentManager Content; BoundingSphere sphere; bool boundingimplemented = false; public ImportModel(string model, GraphicsDevice gd, ContentManager cm, Vector3 position, Vector3 rot, Vector3 sca) { GraphicDevice = gd; Content = cm; Position = position; Rotation = rot; Scale = sca; Model = Content.Load<Model>(model); modeltransforms = new Matrix[Model.Bones.Count]; Model.CopyAbsoluteBoneTransformsTo(modeltransforms); } public void Draw(Camera camera) { Matrix baseworld = Matrix.CreateScale(Scale) * Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z) * Matrix.CreateTranslation(Position); foreach (ModelMesh mesh in Model.Meshes) { Matrix localworld = modeltransforms[mesh.ParentBone.Index] * baseworld; foreach (ModelMeshPart meshpart in mesh.MeshParts) { BasicEffect effect = (BasicEffect)meshpart.Effect; effect.World = localworld; effect.View = camera.View; effect.Projection = camera.Projection; effect.EnableDefaultLighting(); } mesh.Draw(); } } public BoundingSphere BoundingSphere { get { if (!boundingimplemented) { foreach (ModelMesh mesh in Model.Meshes) { BoundingSphere transformed = mesh.BoundingSphere.Transform( modeltransforms[mesh.ParentBone.Index]); sphere = BoundingSphere.CreateMerged(sphere, transformed); } Matrix worldTransform = Matrix.CreateScale(Scale) * Matrix.CreateTranslation(Position); BoundingSphere transforme = sphere; transforme = transforme.Transform(worldTransform); return transforme; } else { Matrix worldTransform = Matrix.CreateScale(Scale) * Matrix.CreateTranslation(Position); BoundingSphere transformed = sphere; transformed = transformed.Transform(worldTransform); return transformed; } } } } Then I call the class from the Game1 class: ImportModel ground = new ImportModel("ground", GraphicsDevice, Content, Vector3.Zero, Vector3.Zero, new Vector3(20f)); EDIT2:This is how the scene looks from top: i.stack.imgur.com/Hs983.jpg

    Read the article

  • History.js not working in Internet Explorer

    - by Wilcoholic
    I am trying to get history.js to work in Internet Explorer because I need history.pushState() to work. I have read over the instructions on GitHub (https://github.com/balupton/History.js/) and have tried implementing it, but havent had any success. Here's what I have <!DOCTYPE html> <html> <head> <!-- jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <!-- History.js --> <script defer src="http://balupton.github.com/history.js/scripts/bundled/html4+html5/jquery.history.js"></script> <script type="text/javascript"> function addHistory(){ // Prepare var History = window.History; // Note: We are using a capital H instead of a lower h // Change our States History.pushState(null, null, "?mylink.html"); } </script> </head> <body> <a href="mylink.html">My Link</a> <a href="otherlink.html">Other Link</a> <button onclick="addHistory()" type="button">Add History</button> </body> Not sure what I'm doing wrong, but it's definitely not working in IE. Any help is appreciated

    Read the article

  • Socket - Adress already in use

    - by Hamza Karmouda
    I'm new to socketand i try to code an Server and client on the same application just to see how it work. here's my code : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ((Button)this.findViewById(R.id.bouton1)).setOnClickListener(this); } public void onClick(View v) { TCPServer server = new TCPServer(); TCPClient client = new TCPClient(); server.start(); client.start(); } public class TCPServer extends Thread { @Override public void run() { try { ServerSocket s = new ServerSocket(8080,0,InetAddress.getLocalHost()); Socket cli = s.accept(); byte[] b = new byte[512]; int n; InputStream is = cli.getInputStream(); while((n=is.read(b))>0){ Log.d("TCPServer",new String(b)); if(new String(b).contains("\r\n\r\n"))break; b = new byte[512]; } OutputStream os = cli.getOutputStream(); os.write("Hello".getBytes()); } catch (Exception e) { e.printStackTrace(); } } } public class TCPClient extends Thread { @Override public void run() { try { Socket s = new Socket(InetAddress.getLocalHost().getHostAddress(),8080); //Socket s = new Socket("www.google.com",80); //Log.i("",s.getLocalAddress().getHostAddress()); byte[] b = new byte[512]; int n; if (s.isConnected()) { OutputStream os = s.getOutputStream(); os.write("Hi How are you \r\n\r\n".getBytes()); InputStream is = s.getInputStream(); while((n=is.read(b))>0){ Log.d("TCPClient",new String(b)); b = new byte[512]; } } s.close(); } catch (Exception e) { e.printStackTrace(); } } } the code work fine but just for the first time i click my button. the error is java.net.BindException: Address already in use .

    Read the article

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