Daily Archives

Articles indexed Thursday December 20 2012

Page 3/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • Is there another way to restart Ubuntu 12.04's sound system if pulseaudio/ALSA don't work?

    - by Ricardo Altamirano
    I was listening to music, and my sound suddenly went dead in all my applications. I'm using Ubuntu 12.04, which uses pulseaudio, so I tried sudo /etc/init.d/pulseaudio restart, but nothing happened. According to lsof | grep pcm, nothing is using the soundcard at the moment, although I'm not entirely sure if my source for that command is applicable. Is there a way another way to restart Ubuntu 12.04's sound system from the command line without rebooting the system?

    Read the article

  • how do i fix this: the networking and wireless are enabled. but list of networks under wireless networks not available

    - by Ayesha Ahmad
    i started working with ubuntu 11.10 last year. i upgraded to 12.04 a week back. since then i have had all sorts of problems with network connection. first had to install the new driver. the hardware switch somehow got disabled then the above problem arrived. even tho the options are all enabled, the OS is not able to detect scan available network connections. also i have to bring to notice that once in a while it does get connected, can not explain how it happens. I want to fix this problem once and for all. please help. ifconfig: eth0 Link encap:Ethernet HWaddr f0:4d:a2:51:b3:c8 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:44 eth1 Link encap:Ethernet HWaddr 1c:65:9d:67:d5:e1 inet6 addr: fe80::1e65:9dff:fe67:d5e1/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:170 TX packets:0 errors:27 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:17 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:344 errors:0 dropped:0 overruns:0 frame:0 TX packets:344 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:20336 (20.3 KB) TX bytes:20336 (20.3 KB) lshw -c network *-network description: Wireless interface product: BCM4313 802.11b/g/n Wireless LAN Controller vendor: Broadcom Corporation physical id: 0 bus info: pci@0000:03:00.0 logical name: eth1 version: 01 serial: 1c:65:9d:67:d5:e1 width: 64 bits clock: 33MHz capabilities: bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=wl0 driverversion=5.100.82.38 latency=0 multicast=yes wireless=IEEE 802.11 resources: irq:17 memory:f0500000-f0503fff *-network description: Ethernet interface product: AR8152 v1.1 Fast Ethernet vendor: Atheros Communications Inc. physical id: 0 bus info: pci@0000:04:00.0 logical name: eth0 version: c1 serial: f0:4d:a2:51:b3:c8 capacity: 100Mbit/s width: 64 bits clock: 33MHz capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=atl1c driverversion=1.0.1.0-NAPI firmware=N/A latency=0 multicast=yes port=twisted pair resources: irq:44 memory:f0400000-f043ffff ioport:2000(size=128) iwconfig lo no wireless extensions. eth1 IEEE 802.11 Access Point: Not-Associated Link Quality:5 Signal level:0 Noise level:196 Rx invalid nwid:0 invalid crypt:0 invalid misc:0 eth0 no wireless extensions. lspci 00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18) 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06) 00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06) 00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06) 00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06) 00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06) 00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6) 00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06) 00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06) 00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06) 00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06) 03:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01) 04:00.0 Ethernet controller: Atheros Communications Inc. AR8152 v1.1 Fast Ethernet (rev c1) ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05) ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05) ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05) ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05) ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05) ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05) I hope this information is of some help.

    Read the article

  • Dual boot windows 8 and Ubuntu with Windows 8 Boot manager

    - by Mevin Babu
    I have two partitions on my hard-didk , I have installed ubuntu on my 1st partition and windows 8 later on another partition.Now i can only boot into windows 8 because it doesn't recognize Ubuntu. How would i dual boot my PC without using grub . I would like using Windows 8 boot manager as its pretty neat. I tried using easyBCD but it doesn't work.It causes the boot manager to switch to windows 7 Boot Manager .Is there anyother work around or solution Any help would be appreciated. Note: The windows 8 boot Manager is sky blue color interactive menu with mouse and other options and windows 7 boot manager is the normal black and white one where you can only use your keyboard

    Read the article

  • install qutecom cannot find msg722.so file, how to solve the problem?

    - by weixi
    I build the qutecom-3.0 on ubuntu 11.04, during install process, It shows: CMake Error at /home/student/qutecom-3.0/build/qutecom/src/presentation/qt/cmake_install.cmake:122 (FILE): file INSTALL cannot find "/home/student/qutecom-3.0/build/bin/plugins/mediastreamer2/msg722.so". Call Stack (most recent call first): /home/student/qutecom-3.0/build/qutecom/src/cmake_install.cmake:37 (INCLUDE) /home/student/qutecom-3.0/build/qutecom/cmake_install.cmake:38 (INCLUDE) cmake_install.cmake:49 (INCLUDE) make: *** [install] Error 1

    Read the article

  • `xcalib -i -a` controls only one of two screens - can it control both?

    - by drevicko
    I am using 2 screens, and wish to invert the colors on both of them without using compiz (I'm using gnome shell). I can use xcalib -invert -alter as suggested in this question, but it only inverts one of the screens. Is there a way to specify both of them, or even which of them, using xcalib? Is there another way? With xcalib, you can specify which screen to alter with the -d (-display) or -s (-screen) options, but alas, X seems to be aware of just one screen: when I use the w command I only see one (the usual ":0") ps: this question was originally posted by k0pernikus as a comment here.

    Read the article

  • Live USB does not work

    - by MARUF SARKER
    I've made live USB using these "Universal-USB-Installer-1.9.1.9", "unetbootin-windows-581", "YUMI-0.0.8.0" & "LinuxLive USB Creator 2.8.18" in "FAT32" format, but unfortunately I could not boot using the pen-drive. My BIOS supports boot from USB drive. When I am booting from the live usb, it just show black screen with a blinking "_", but nothing happens after that( I have waited more than 10 minutes, but nothing happens). So, can anyone please help me on this? [Additional Info.: I've made Bootable USB using PowerISO and that booted, but it was not possible to access the USB normally afterwards,because PowerISO formatted the USB Drive as RAW(or anything I don't know) and it became 8GB to 700MB, afterwards I had to format it using MiniTool Partition manager.]

    Read the article

  • team viewer 8 beta wont run

    - by Conner Jones
    I installed team viewer 7 and then one of my friends using windows got version 8 so I installed the beta of version 8 for linux. When I try to run it for terminal I get these errors i atempted to do as the comment bellow said and when trying to run teamveiwer i stil got an error conner@DemonicGrace:~$ teamviewer Init... Checking setup... Launching TeamViewer... wine: cannot find L"C:\windows\system32\winemenubuilder.exe" err:wineboot:ProcessRunKeys Error running cmd L"C:\windows\system32\winemenubuilder.exe -a -r" (2) err:winedevice:ServiceMain driver L"MountMgr" failed to load err:secur32:SECUR32_initSchannelSP libgnutls not found, SSL connections will fail fixme:heap:HeapSetInformation (nil) 1 (nil) 0 fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),0,3,(nil),0,(nil)) - stub! fixme:heap:HeapSetInformation (nil) 1 (nil) 0 fixme:process:SetProcessShutdownParameters (00000100, 00000000): partial stub. fixme:resource:GetGuiResources (0xffffffff,0): stub fixme:win:EnumDisplayDevicesW ((null),0,0x32df64,0x00000000), stub! fixme:win:EnumDisplayDevicesW (L"\\.\DISPLAY1",0,0x32dc1c,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),1,0x32df64,0x00000000), stub! please help me out if anyone has ideas im more than willing to listen

    Read the article

  • Can't connect to my own wifi network

    - by Nicolas
    I use ubuntu 12.04 on various differents laptops/netbooks on my home. I was able to connect to my own wifi network. But sometimes, I couldn't connect to my wifi network, it ask me for password again and again. After many tries (a lot of them), sometimes I can connect, but sometimes I can't. I have this problem with a Samsung netbook and with a HP laptop. Right now, I can't connect with the HP laptop. I'll be grateful for any help. Best regards, Nicolás

    Read the article

  • Installing Chrome Java Plugin

    - by kyleskool
    I've been trying to install the Java plugin for Chrome for a couple hours now, and I figured it was time to ask people with more experience. I can't seem to get it working. My current Java version is the 64-bit OpenJDK 1.6.0_24. I tried installing the IcedTea plugin to no avail. I have Ubuntu 12.04 64-bit installed at the moment. When I tried testing if java was enabled in Chrome, any website with a Java applet would not load (when I disabled the plugin, they loaded, but not the applet). I followed the instructions from here: http://technonstop.com/install-java-plugin-ubuntu-linux which said to create this script and run it: JAVA_HOME=/usr/lib/jvm/jdk1.7.0 MOZILLA_HOME=~/.mozilla mkdir $MOZILLA_HOME/plugins ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins Note: You may need to change the value of JAVA_HOME so that it correctly points to your installation of the JDK. 64-bit users will need to change the final line to: ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins but this did not work as well. I just test it in Firefox and it's working. Still nothing for Chrome

    Read the article

  • Is there a shell-independent HUD-like menu search tool for Gnome?

    - by Redsandro
    The Ubuntu HUD - you love it or you hate it. Personally I rather like a classic desktop, so I use Xfce and Cinnamon, and I don't want to lose my menu in applications. But the HUD is pretty awesome when your menus are complex and you forgot where an option sits. This makes that search trick very interesting. I know the HUD is Unity specific. I am looking for a HUD-like tool to complement the menu in shells other than Unity. There is Appmenu Runner for KDE that does this. There is also appmenu-qt for KDE. Problem with the above is that it uses KDE libs, and it only works for KDE apps. This is Linux, there aught to be something like this for GNOME/GTK apps, right? Looking for any tool that can search the menus. I already use(d) Kupfer and Gnome-do, something like that would suffice if only it includes searching the menus for the currently focussed application.

    Read the article

  • Can't get my graphics driver (GMA 3150) to work

    - by bracus
    I've been searching like crazy trying to find a fix for this, it's the only thing that's not completely working on my setup. I see posts where people say it should be working but it just isn't. I have a Gateway LT2802u netbook and I installed 11.10 on this 2 days ago. Everything works except for accelerated graphics. At first I couldn't watch a simple flash video at all, but somehow I got it to work. Now the last problem I have is I can't watch HD videos, my screen resolution won't go higher than 1024x600, and my under my graphics driver it says "Unknown". After doing as much research as possible, I've come to the conclusion that it's the GMA 3150 graphics driver. There is a bunch of talk on it all over the interwebs but nothing lately. I've tried the fixes that some people have used but most when I try to get the package it's no longer there or available if that makes sense. I'm loving everything Ubuntu has to offer but it'll really bite if I can't use it any more because of this problem. Does anybody have any ideas? You'd really be helping a lot.

    Read the article

  • Where in the filesystem should I store shared data?

    - by misterben
    Where in the unix filesystem is the conventional location to save non-user specific data, for example data shared via nfs or ftp, or backups? I could obviously create and use any arbitrary folder (such as /home/shared, /data or /var/data), but I'm really wondering if there are any "best" or "common" practice guidelines. The Filesystem Hierarchy Standard doesn't specify a location for shared data. For backups, I tend to use /var/backups, but as several cronjobs write to it should it really be left for their use?

    Read the article

  • Is there a tool that allows site users to schedule meetings with each other? [closed]

    - by Andrew Min
    I'm the webmaster for a debate team, and we're trying to find a tool that allows us to have multiple team members say when they're available and see who else is available during those timeslots for one-on-one practice rounds. I suppose we could use something like Doodle, but that would involve recreating the Doodle every week. There are many scheduling tools available, but they're usually built so that you can sign up to meet with a specific individual (think a doctor or a professor's office hours), whereas you could be paired with ANY individual.

    Read the article

  • Ideas for attack damage algorithm (language irrelevant)

    - by Dillon
    I am working on a game and I need ideas for the damage that will be done to the enemy when your player attacks. The total amount of health that the enemy has is called enemyHealth, and has a value of 1000. You start off with a weapon that does 40 points of damage (may be changed.) The player has an attack stat that you can increase, called playerAttack. This value starts off at 1, and has a possible max value of 100 after you level it up many times and make it farther into the game. The amount of damage that the weapon does is cut and dry, and subtracts 40 points from the total 1000 points of health every time the enemy is hit. But what the playerAttack does is add to that value with a percentage. Here is the algorithm I have now. (I've taken out all of the gui, classes, etc. and given the variables very forward names) double totalDamage = weaponDamage + (weaponDamage*(playerAttack*.05)) enemyHealth -= (int)totalDamage; This seemed to work great for the most part. So I statrted testing some values... //enemyHealth ALWAYS starts at 1000 weaponDamage = 50; playerAttack = 30; If I set these values, the amount of damage done on the enemy is 125. Seemed like a good number, so I wanted to see what would happen if the players attack was maxed out, but with the weakest starting weapon. weaponDamage = 50; playerAttack = 100; the totalDamage ends up being 300, which would kill an enemy in just a few hits. Even with your attack that high, I wouldn't want the weakest weapon to be able to kill the enemy that fast. I thought about adding defense, but I feel the game will lose consistency and become unbalanced in the long run. Possibly a well designed algorithm for a weapon decrease modifier would work for lower level weapons or something like that. Just need a break from trying to figure out the best way to go about this, and maybe someone that has experience with games and keeping the leveling consistent could give me some ideas/pointers.

    Read the article

  • Determining whether two fast moving objects should be submitted for a collision check

    - by dreta
    I have a basic 2D physics engine running. It's pretty much a particle engine, just uses basic shapes like AABBs and circles, so no rotation is possible. I have CCD implemented that can give accurate TOI for two fast moving objects and everything is working smoothly. My issue now is that i can't figure out how to determine whether two fast moving objects should even be checked against each other in the first place. I'm using a quad tree for spacial partitioning and for each fast moving object, i check it against objects in each cell that it passes. This works fine for determining collision with static geometry, but it means that any other fast moving object that could collide with it, but isn't in any of the cells that are checked, is never considered. The only solution to this i can think of is to either have the cells large enough and cross fingers that this is enough, or to implement some sort of a brute force algorithm. Is there a proper way of dealing with this, maybe somebody solved this issue in an efficient manner. Or maybe there's a better way of partitioning space that accounts for this?

    Read the article

  • Online games programming basics

    - by Renkon
    I am writing with regard to an issue I am having nowadays. I have come up with an interesting idea of making an online game in C#, yet I do not have the knowledge to work with more than a player. Basic games like a TIC-TAC-TOE or a SNAKE were done already, and I would like to do a simple, but online, game. Would you mind giving me some tutorials or guides related to that? I would really like to learn how to work online with the client/server structure (though, I do know the basics about that structure). I look forward to reading from you. Yours faithfully, Renkon.

    Read the article

  • Camera doesn't move

    - by hugo
    Here is my code, as my subject indicates i have implemented a camera but I couldn't make it move. #define PI_OVER_180 0.0174532925f #define GL_CLAMP_TO_EDGE 0x812F #include "metinalifeyyaz.h" #include <GL/glu.h> #include <GL/glut.h> #include <QTimer> #include <cmath> #include <QKeyEvent> #include <QWidget> #include <QDebug> metinalifeyyaz::metinalifeyyaz(QWidget *parent) : QGLWidget(parent) { this->setFocusPolicy(Qt:: StrongFocus); time = QTime::currentTime(); timer = new QTimer(this); timer->setSingleShot(true); connect(timer, SIGNAL(timeout()), this, SLOT(updateGL())); xpos = yrot = zpos = 0; walkbias = walkbiasangle = lookupdown = 0.0f; keyUp = keyDown = keyLeft = keyRight = keyPageUp = keyPageDown = false; } void metinalifeyyaz::drawBall() { //glTranslatef(6,0,4); glutSolidSphere(0.10005,300,30); } metinalifeyyaz:: ~metinalifeyyaz(){ glDeleteTextures(1,texture); } void metinalifeyyaz::initializeGL(){ glShadeModel(GL_SMOOTH); glClearColor(1.0,1.0,1.0,0.5); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glDepthFunc(GL_LEQUAL); glClearColor(1.0,1.0,1.0,1.0); glShadeModel(GL_SMOOTH); GLfloat mat_specular[]={1.0,1.0,1.0,1.0}; GLfloat mat_shininess []={30.0}; GLfloat light_position[]={1.0,1.0,1.0}; glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glEnable(GL_LIGHT0); glEnable(GL_LIGHTING); QImage img1 = convertToGLFormat(QImage(":/new/prefix1/halisaha2.bmp")); QImage img2 = convertToGLFormat(QImage(":/new/prefix1/white.bmp")); glGenTextures(2,texture); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img1.width(), img1.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img1.bits()); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img2.width(), img2.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img2.bits()); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really nice perspective calculations } void metinalifeyyaz::resizeGL(int w, int h){ if(h==0) h=1; glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, static_cast<GLfloat>(w)/h,0.1f,100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void metinalifeyyaz::paintGL(){ movePlayer(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); GLfloat xtrans = -xpos; GLfloat ytrans = -walkbias - 0.50f; GLfloat ztrans = -zpos; GLfloat sceneroty = 360.0f - yrot; glLoadIdentity(); glRotatef(lookupdown, 1.0f, 0.0f, 0.0f); glRotatef(sceneroty, 0.0f, 1.0f, 0.0f); glTranslatef(xtrans, ytrans+50, ztrans-130); glLoadIdentity(); glTranslatef(1.0f,0.0f,-18.0f); glRotatef(45,1,0,0); drawScene(); int delay = time.msecsTo(QTime::currentTime()); if (delay == 0) delay = 1; time = QTime::currentTime(); timer->start(qMax(0,10 - delay)); } void metinalifeyyaz::movePlayer() { if (keyUp) { xpos -= sin(yrot * PI_OVER_180) * 0.5f; zpos -= cos(yrot * PI_OVER_180) * 0.5f; if (walkbiasangle >= 360.0f) walkbiasangle = 0.0f; else walkbiasangle += 7.0f; walkbias = sin(walkbiasangle * PI_OVER_180) / 10.0f; } else if (keyDown) { xpos += sin(yrot * PI_OVER_180)*0.5f; zpos += cos(yrot * PI_OVER_180)*0.5f ; if (walkbiasangle <= 7.0f) walkbiasangle = 360.0f; else walkbiasangle -= 7.0f; walkbias = sin(walkbiasangle * PI_OVER_180) / 10.0f; } if (keyLeft) yrot += 0.5f; else if (keyRight) yrot -= 0.5f; if (keyPageUp) lookupdown -= 0.5; else if (keyPageDown) lookupdown += 0.5; } void metinalifeyyaz::keyPressEvent(QKeyEvent *event) { switch (event->key()) { case Qt::Key_Escape: close(); break; case Qt::Key_F1: setWindowState(windowState() ^ Qt::WindowFullScreen); break; default: QGLWidget::keyPressEvent(event); case Qt::Key_PageUp: keyPageUp = true; break; case Qt::Key_PageDown: keyPageDown = true; break; case Qt::Key_Left: keyLeft = true; break; case Qt::Key_Right: keyRight = true; break; case Qt::Key_Up: keyUp = true; break; case Qt::Key_Down: keyDown = true; break; } } void metinalifeyyaz::changeEvent(QEvent *event) { switch (event->type()) { case QEvent::WindowStateChange: if (windowState() == Qt::WindowFullScreen) setCursor(Qt::BlankCursor); else unsetCursor(); break; default: break; } } void metinalifeyyaz::keyReleaseEvent(QKeyEvent *event) { switch (event->key()) { case Qt::Key_PageUp: keyPageUp = false; break; case Qt::Key_PageDown: keyPageDown = false; break; case Qt::Key_Left: keyLeft = false; break; case Qt::Key_Right: keyRight = false; break; case Qt::Key_Up: keyUp = false; break; case Qt::Key_Down: keyDown = false; break; default: QGLWidget::keyReleaseEvent(event); } } void metinalifeyyaz::drawScene(){ glBegin(GL_QUADS); glNormal3f(0.0f,0.0f,1.0f); // glColor3f(0,0,1); //back glVertex3f(-6,0,-4); glVertex3f(-6,-0.5,-4); glVertex3f(6,-0.5,-4); glVertex3f(6,0,-4); glEnd(); glBegin(GL_QUADS); glNormal3f(0.0f,0.0f,-1.0f); //front glVertex3f(6,0,4); glVertex3f(6,-0.5,4); glVertex3f(-6,-0.5,4); glVertex3f(-6,0,4); glEnd(); glBegin(GL_QUADS); glNormal3f(-1.0f,0.0f,0.0f); // glColor3f(0,0,1); //left glVertex3f(-6,0,4); glVertex3f(-6,-0.5,4); glVertex3f(-6,-0.5,-4); glVertex3f(-6,0,-4); glEnd(); glBegin(GL_QUADS); glNormal3f(1.0f,0.0f,0.0f); // glColor3f(0,0,1); //right glVertex3f(6,0,-4); glVertex3f(6,-0.5,-4); glVertex3f(6,-0.5,4); glVertex3f(6,0,4); glEnd(); glBindTexture(GL_TEXTURE_2D, texture[0]); glBegin(GL_QUADS); glNormal3f(0.0f,1.0f,0.0f);//top glTexCoord2f(1.0f,0.0f); glVertex3f(6,0,-4); glTexCoord2f(1.0f,1.0f); glVertex3f(6,0,4); glTexCoord2f(0.0f,1.0f); glVertex3f(-6,0,4); glTexCoord2f(0.0f,0.0f); glVertex3f(-6,0,-4); glEnd(); glBegin(GL_QUADS); glNormal3f(0.0f,-1.0f,0.0f); //glColor3f(0,0,1); //bottom glVertex3f(6,-0.5,-4); glVertex3f(6,-0.5,4); glVertex3f(-6,-0.5,4); glVertex3f(-6,-0.5,-4); glEnd(); // glPushMatrix(); glBindTexture(GL_TEXTURE_2D, texture[1]); glBegin(GL_QUADS); glNormal3f(1.0f,0.0f,0.0f); glTexCoord2f(1.0f,0.0f); //right far goal post front face glVertex3f(5,0.5,-0.95); glTexCoord2f(1.0f,1.0f); glVertex3f(5,0,-0.95); glTexCoord2f(0.0f,1.0f); glVertex3f(5,0,-1); glTexCoord2f(0.0f,0.0f); glVertex3f(5, 0.5, -1); glColor3f(1,1,1); //right far goal post back face glVertex3f(5.05,0.5,-0.95); glVertex3f(5.05,0,-0.95); glVertex3f(5.05,0,-1); glVertex3f(5.05, 0.5, -1); glColor3f(1,1,1); //right far goal post left face glVertex3f(5,0.5,-1); glVertex3f(5,0,-1); glVertex3f(5.05,0,-1); glVertex3f(5.05, 0.5, -1); glColor3f(1,1,1); //right far goal post right face glVertex3f(5.05,0.5,-0.95); glVertex3f(5.05,0,-0.95); glVertex3f(5,0,-0.95); glVertex3f(5, 0.5, -0.95); glColor3f(1,1,1); //right near goal post front face glVertex3f(5,0.5,0.95); glVertex3f(5,0,0.95); glVertex3f(5,0,1); glVertex3f(5,0.5, 1); glColor3f(1,1,1); //right near goal post back face glVertex3f(5.05,0.5,0.95); glVertex3f(5.05,0,0.95); glVertex3f(5.05,0,1); glVertex3f(5.05,0.5, 1); glColor3f(1,1,1); //right near goal post left face glVertex3f(5,0.5,1); glVertex3f(5,0,1); glVertex3f(5.05,0,1); glVertex3f(5.05,0.5, 1); glColor3f(1,1,1); //right near goal post right face glVertex3f(5.05,0.5,0.95); glVertex3f(5.05,0,0.95); glVertex3f(5,0,0.95); glVertex3f(5,0.5, 0.95); glColor3f(1,1,1); //right crossbar front face glVertex3f(5,0.55,-1); glVertex3f(5,0.55,1); glVertex3f(5,0.5,1); glVertex3f(5,0.5,-1); glColor3f(1,1,1); //right crossbar back face glVertex3f(5.05,0.55,-1); glVertex3f(5.05,0.55,1); glVertex3f(5.05,0.5,1); glVertex3f(5.05,0.5,-1); glColor3f(1,1,1); //right crossbar bottom face glVertex3f(5.05,0.5,-1); glVertex3f(5.05,0.5,1); glVertex3f(5,0.5,1); glVertex3f(5,0.5,-1); glColor3f(1,1,1); //right crossbar top face glVertex3f(5.05,0.55,-1); glVertex3f(5.05,0.55,1); glVertex3f(5,0.55,1); glVertex3f(5,0.55,-1); glColor3f(1,1,1); //left far goal post front face glVertex3f(-5,0.5,-0.95); glVertex3f(-5,0,-0.95); glVertex3f(-5,0,-1); glVertex3f(-5, 0.5, -1); glColor3f(1,1,1); //right far goal post back face glVertex3f(-5.05,0.5,-0.95); glVertex3f(-5.05,0,-0.95); glVertex3f(-5.05,0,-1); glVertex3f(-5.05, 0.5, -1); glColor3f(1,1,1); //right far goal post left face glVertex3f(-5,0.5,-1); glVertex3f(-5,0,-1); glVertex3f(-5.05,0,-1); glVertex3f(-5.05, 0.5, -1); glColor3f(1,1,1); //right far goal post right face glVertex3f(-5.05,0.5,-0.95); glVertex3f(-5.05,0,-0.95); glVertex3f(-5,0,-0.95); glVertex3f(-5, 0.5, -0.95); glColor3f(1,1,1); //left near goal post front face glVertex3f(-5,0.5,0.95); glVertex3f(-5,0,0.95); glVertex3f(-5,0,1); glVertex3f(-5,0.5, 1); glColor3f(1,1,1); //right near goal post back face glVertex3f(-5.05,0.5,0.95); glVertex3f(-5.05,0,0.95); glVertex3f(-5.05,0,1); glVertex3f(-5.05,0.5, 1); glColor3f(1,1,1); //right near goal post left face glVertex3f(-5,0.5,1); glVertex3f(-5,0,1); glVertex3f(-5.05,0,1); glVertex3f(-5.05,0.5, 1); glColor3f(1,1,1); //right near goal post right face glVertex3f(-5.05,0.5,0.95); glVertex3f(-5.05,0,0.95); glVertex3f(-5,0,0.95); glVertex3f(-5,0.5, 0.95); glColor3f(1,1,1); //left crossbar front face glVertex3f(-5,0.55,-1); glVertex3f(-5,0.55,1); glVertex3f(-5,0.5,1); glVertex3f(-5,0.5,-1); glColor3f(1,1,1); //right crossbar back face glVertex3f(-5.05,0.55,-1); glVertex3f(-5.05,0.55,1); glVertex3f(-5.05,0.5,1); glVertex3f(-5.05,0.5,-1); glColor3f(1,1,1); //right crossbar bottom face glVertex3f(-5.05,0.5,-1); glVertex3f(-5.05,0.5,1); glVertex3f(-5,0.5,1); glVertex3f(-5,0.5,-1); glColor3f(1,1,1); //right crossbar top face glVertex3f(-5.05,0.55,-1); glVertex3f(-5.05,0.55,1); glVertex3f(-5,0.55,1); glVertex3f(-5,0.55,-1); glEnd(); // glPopMatrix(); // glPushMatrix(); // glTranslatef(0,0,0); // glutSolidSphere(0.10005,500,30); // glPopMatrix(); }

    Read the article

  • NUL symbol gets inserted anywhere in the XML

    - by Racs
    I am using Oracle 11g and when I query data from database manually, it looks ok. But when I view it using Notepad++, there is a special character that gets inserted anywhere in the xml produced. Please see image below: I tried everything and deleted some parts of the xml, updated the db and query again but the invalid character just differ in location. Any idea is much appreciated, thanks! Best regards, Racs

    Read the article

  • Binding Click event in KnockoutJS

    - by user1918553
    I have a which has a css binding according to the value of 'rowState' as follows which is working fine. Now, I need to bind the 'click' event to fire only if the rowState is not 2. I tried the following, but with no success. I do not want to use the if statement as the div has got lots of content which I would need to repeat. The only difference is to make the div not clickable if rowState is 2. Could you please help me to sort this out?

    Read the article

  • Find the end/finish coordinates you a UISwipeGestureRecognizer

    - by Code
    I can find the start coordinates of where a swipe starts by doing the following - (void)oneFingerSwipeUp:(UISwipeGestureRecognizer *)recognizer { CGPoint point = [recognizer locationInView:[self view]]; NSLog(@"Swipe up - start location: %f,%f", point.x, point.y); } Is it possible to find the coordinates where the swipe ended? I looked into the docs and its not mentioned. Is there some work around for this? Many Thanks, -Code

    Read the article

  • Count the number of dates between two dates

    - by Matt Mitchell
    I'm looking to count the dates covered (inclusive) between two DateTimes (not .TotalDays) For example: 2012-2-1 14:00 to 2012-2-2 23:00 -> 2 2012-2-1 14:00 to 2012-2-2 10:00 -> 2 2012-2-1 14:00 to 2012-2-1 15:00 -> 1 2012-1-1 00:00 to 2012-12-31 23:59 -> 366 I can get this functionality with the code below: DateTime dt1 = new DateTime(2000,1,2,12,00,00); DateTime dt2 = new DateTime(2000,1,3,03,00,00); int count = 0; for (DateTime date = dt1; date.Date <= dt2.Date; date = date.AddDays(1)) count++; return count; Is there a better way?

    Read the article

  • jQuery - Animate function

    - by Arun Kumar
    I have a piece of code shown below: $(".tagArea li").mouseover(function(){ $(this).animate({ borderWidth: "2px" }, 1000 ); }); $(".tagArea li").mouseout(function () { $(this).animate({ borderWidth: "1px" }, 1000 ); }); When I try to hover it on a particular list item, it properly animates but doesn't stop doing just once. It keeps doing 2 or 3 times. How to avoid this, I 've tried many a times but no positive result occurs to me. Kindly help.

    Read the article

  • How to extract data from a text file

    - by šljaker
    I need to parse some large text file and extract Display name and area code only if it matches the following pattern: Line starts with display name (any number of words) Followed by 6 digits (can contain spaces) Followed by #text tag e.g. John doe 123 456 #text some text Display name: John doe Area code: 123 456 Test 123456 #text Display name: Test Area code: 123456 Test 123 #test Invalid, area code contains only 3 digits Test 123456 #test1 Invalid, contains invalid tag Test 123g45 #test Invalid, area code contains letters etc. I know how to open the text file and read it line by line, but having trouble with writing the regular expression. Any help would be greatly appreciated! edit: I have tried this: private static void Main(string[] args) { string text = "John Doe 123 45 #text Lorem ipsum dolor :)"; string pattern = @"(\w+)*([0-9]{2,5}).([0-9]{2,5}).#text"; Match match = Regex.Match(text, pattern, RegexOptions.IgnoreCase); if (match.Success) { string key = match.Groups[0].Value; Console.WriteLine(key); } }

    Read the article

  • How to set credential persistence permanent on Android

    - by doreamon
    My app has save login credential feature, so I store cookies for the next use after succeeding to sign in. However, after a time period, the session will be time out and cannot log in with the cookies any more. On iOS, after setting credential persistence to permanent, the app works nicely even after restarting the phone: [[challenge sender] useCredential:[NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistencePermanent] forAuthenticationChallenge:challenge]; On Android, I cannot find out such kind of this option. Here is from my HttpHelper class: ((AbstractHttpClient) HttpHelper.client).getAuthSchemes().register("ntlm",new NTLMSchemeFactory()); NTCredentials creds = new NTCredentials(user, pass, "", domain); ((AbstractHttpClient) HttpHelper.client).getCredentialsProvider().setCredentials(AuthScope.ANY, creds); The server is SharePoint so I have to deal with ntlm authentication by following this instruction If you have idea, please let me know. Thank you.

    Read the article

  • Regular expression to truncate a String

    - by user470184
    To truncate a String here is what I'm using : String test1 = "this is test truncation 1.pdf"; String p1 = test1.substring(0, 10) + "..."; System.out.println(p1); The output is 'this is te...' How can I access the file name extension so that output becomes : 'this is te... pdf' I could use substring method to access the last three characters but other file extensions could be 4 chars in length such as .aspx Is there a regular expression I can use so that "this is test truncation 1.pdf" becomes "this is te... pdf"

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >