Daily Archives

Articles indexed Friday June 13 2014

Page 3/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • how to run mysql drop and create synonym in shell script

    - by bgrif
    I have added this command to a script I am writing and I am running into a issue with it not logging onto mysql and running the commands. How can i fix this and make it run. #! /bin/bash Subject: Please stage the following TFL09143 Locator Bulletin to all TF90 staging environments: # This next section is to go to mysql server and make changes. you can drop and create synonyms truncate a table and insert into a different one. you will be able to verify the counts to the different locations # $ mysql --host=app03-bsi --u "" --p "" "TF90BPS" -bse "drop synonym TF90.BTXADDR && drop synonym TF90.BTXSUPB && CREATE SYNONYM TF90.BTXADDR FOR TF90BP.TFBPS2.BTXADDR && CREATE SYNONYM TF90.BTXSUPB FOR TF90BP.TFBPS3.BTXSUPB && TRUNCATE TABLE TF90BP.TFBPS3.BTXSUPB SELECT * FROM TF90BP.TFBPS2.BTXSUPB; select count () from TF90BP.TF90.BTXADDR select count() from TF90BPS.TF90.BTXADDR; select count() from TF90BP.TF90.BTXSUPB; select count() from TF90BPS.TF90.BTXSUPB;" $ mysql --host=app03-bsi --u "" --p "" "TF90LMS" -bse "drop synonym TF90.BTXADDR && drop synonym TF90.BTXSUPB && CREATE SYNONYM TF90.BTXADDR FOR TF90LM.TFBPS2.BTXADDR && CREATE SYNONYM TF90.BTXSUPB FOR TF90LM.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90LM.TFLMS2.BTXADDR;TRUNCATE TABLE TF90LM.TFLMS3.BTXSUPB;INSERT INTO TF90LM.TFLMS3.BTXSUPB SELECT * FROM TF90LM.TFLMS2.BTXSUPB;Verify select count() from TF90LM.TF90.BTXADDR;select count() from TF90LMS.TF90.BTXADDR;select count() from TF90LM.TF90.BTXSUPB;select count() from TF90LMS.TF90.BTXSUPB" $ mysql --host=app03-bsi --u "" --p "" "TF90NCS" -bse "drop synonym TF90.BTXADDR && drop synonym TF90.BTXSUPB && CREATE SYNONYM TF90.BTXADDR FOR TF90NC.TFBPS2.BTXADDR && CREATE SYNONYM TF90.BTXSUPB FOR TF90NC.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90NC.TFNCS2.BTXADDR; TRUNCATE TABLE TF90NC.TFNCS3.BTXSUPB; INSERT INTO TF90NC.TFNCS3.BTXSUPB SELECT * FROM TF90NC.TFNCS2.BTXSUPB; Verify select count() from TF90NC.TF90.BTXADDR; select count() from TF90NCS.TF90.BTXADDR;select count() from TF90NC.TF90.BTXSUPB;select count() from TF90NCS.TF90.BTXSUPB" $ mysql --host=app03-bsi --u "" --p "" "TF90PVS" -bse "drop synonym TF90.BTXADDR && drop synonym TF90.BTXSUPB && CREATE SYNONYM TF90.BTXADDR FOR TF90PV.TFBPS2.BTXADDR && CREATE SYNONYM TF90.BTXSUPB FOR TF90PV.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90PV.TFPVS2.BTXADDR;TRUNCATE TABLE TF90PV.TFPVS3.BTXSUPB;INSERT INTO TF90PV.TFPVS3.BTXSUPB SELECT * FROM TF90PV.TFPVS2.BTXSUPB;Verify select count() from TF90PV.TF90.BTXADDR;select count() from TF90PVS.TF90.BTXADDR;select count() from TF90PV.TF90.BTXSUPB;select count() from TF90PVS.TF90.BTXSUPB" TFL09143 Staging cd \ntsrv\common\To\IT-CERT-TEST\TFL09143 #change to mapped network drive cp -p TFL09143.pkg /d:/tf90/code_stg && /tf90bp/code_stg && /tf90lm/code_stg && /tf90pv/code_stg # Copies the package from the networked folder and then copies to the location(s) needed.# InvalidInput="true" if [ $# -eq 0 ] ; then echo "This script sets up TF90 Staging" echo -n "Which production do you want to run? (RB/TaxLocator/Cyclic)" read ProductionDistro else ProductionDistro="$1" fi while [ "$InvalidInput" = "true" ] do if [ "$ProductionDistro" = "RB" -o "$ProductionDistro" = "TaxLocator" -o "$ProductionDistro" = "Cyclic" ] ; then InvalidInput="false" break else echo "You have entered an error" echo "You must type RB or TaxLocator or Cyclic" echo "you typed $ProductionDistro" echo "This script sets up TF90 Staging" read ProductionDistro fi done InvalidInput="true" if [ $# -eq 0 ] ; then echo "This script sets up RB TF90 Staging" echo -n "Which Element do you want to run? (TF90/TF90BP/TF90LM/TF90PV/ALL)" read ElementDistro else ElementDistro="$1" fi while [ "$InvalidInput" = "true" ] do if [ "$ElementDistro" = "TF90" -o "$ElementDistro" = "TF90BP" -o "$ElementDistro" = "TF90LM" -o "$ElementDistro" = "TF90PV" -o "$ElementDistro" = "ALL" ] ; then InvalidInput="false" break else echo "You have entered an error" echo "You must type TF90 or TF90BP or TF90LM or TF90PV" echo "you typed $ElementDistro" echo "This script sets up TF90 Staging" read ElementDistro fi done if [ "$ElementDistro" = "TF90" ] ; then cd /d/tf90/code_stg vim TFL09143.pkg export var=TF90_CONNECT_STRING=DSN=TF90NCS;export Description=TF90NCS;export Trusted_Connection=Yes;export WSID=APP03- BSI;export DATABASE=TF90NCS; export DATASET=DEFAULT pkgintall -l -v ../TFL09143.pkg fi if [ "$ElementDistro" = "$TF90BP" ] ; then cd /d/tf90bp/code_stg vim TFL09143.pkg export TF90_CONNECT_STRING=DSN=TF90BPS;export Description=TF90BPS;export Trusted_Connection=Yes;export WSID=APP03- BSI;export DATABASE=TF90BPS; start tfloader -l –v ../TFL09143.pkg fi if [ "$ElementDistro" = "$TF90LM" ] ; then cd /d/tf90lm/code_stg vim TFL09143.pkg export TF90_CONNECT_STRING=DSN=TF90LMS;export Description=TF90LMS;export Trusted_Connection=Yes;export WSID=APP03- BSI;export DATABASE=TF90LMS; start tfloader -l -v ../TFL09143.pkg fi if [ "$ElementDistro" = "TF90PV" ] ; then cd /d/tf90pv/code_stg vim TFL09143.pkg export TF90_CONNECT_STRING=DSN=TF90PVS;Description=TF90PVS;Trusted_Connection=Yes;WSID=APP03- BSI;DATABASE=TF90PVS; start tfloader -l –v ../TFL09143.pkg fi exit 0

    Read the article

  • JDK 8 install in ubuntu

    - by maamaa
    I'm tring to install jdk 8 for weeks, but it fails.Following are some outputs, sudo update-alternatives --config java There is only one alternative in link group java (providing /usr/bin/java): /opt/java-oracle/jdk1.8.0/bin/java Nothing to configure. which java /usr/bin/java java bash: /usr/local/java/jdk1.7.0_51/bin/java: No such file or directory ls -l /usr/bin/java /usr/bin/java -> /etc/alternatives/java ls -l /etc/alternatives/java /etc/alternatives/java -> /opt/java-oracle/jdk1.8.0/bin/java sudo update-alternatives --config javac /opt/java-oracle/jdk1.8.0/bin/javac 1 manual mode javac Error: could not find libjava.so Error: Could not find Java SE Runtime Environment. If you can please give me a help to slove this problem. Thank You

    Read the article

  • Tp_smapi on Thinkpad T440

    - by user2597381
    I have a Thinkpad T440 with Ubuntu 14.04 (using i3wm). I have had trouble installing tp_smapi. I successfully installed it with dpkg -- can't remember whether I used apt or just downloaded it somewhere -- but I can't load the module. When I use modprobe on tp_smapi, I get this: "modprobe: ERROR: could not insert 'tp_smapi': No such device or address" Note that this is different from the error I get when I mistype the module name. I read somewhere that I might have to rebuild my kernel for it to work, but I'd thought that the kernel I was using (3.13.0-24) had that already set up. Has anyone gotten it to work? I hate how Lenovo manages the batteries!

    Read the article

  • Error installing Copy.com client

    - by jimirings
    I'm trying to install copy.com's client on Ubuntu 13.10 but when I do, I get the following error message: Gtk-Message: Failed to load module "canberra-gtk-module" (CopyAgent:4430): LIBDBUSMENU-GTK-CRITICAL **: watch_submenu: assertion 'GTK_IS_MENU_SHELL(menu)' failed From there, it initially appears that the Copy client installs correctly. I am prompted to login and their icon shows up in the task bar. However, sync does not work properly. Items placed in my Copy folder on other devices (or through the web interface) sometimes download to this machine, and sometimes don't. I have investigated the first error message and found this solution, that I should insall the libcanberra-gtk-module. But when trying to install it, it is already installed. Just to be sure, I reinstalled it but it seems to have had no effect. I attempted to investigate the second error message and found that lots of different programs give similar error messages, but all of the solutions I could find seemed to be specific to the program that was under discussion on that particular thread. Any thoughts on how I could solve this? Or at least what I can try next?

    Read the article

  • Dual boot windows 8.1 acer V3-571G with Ubuntu 13.10

    - by tara512
    I am trying to dual boot my acer which came with windows 8 pre-installed. I tried using the tutorial here doing it the simple way but when I load Ubuntu from my transcended flash drive it says that there is no other operating system installed. I tried partitioning my hard drive but I seem to have 3 recovery partitions and even though I have 485GB free I can only allocate 100GB to the new partition. I would like to have most of my hard drive allocated to Ubuntu and just use the windows for programs like microsoft office.

    Read the article

  • Unable to install ZFS (Ubuntu 13.10)

    - by user209707
    I'm fairly new to Ubuntu and wanted to setup a server running ZFS/XBMC - The XBMC install went fine, however I ran into trouble getting ZFS working. Configuration : Ubuntu 13.10 (GNU/Linux 3.12.0-rc7+ x86_64) I attempted to install ZFS native using : sudo add-apt-repository ppa:zfs-native/stable sudo apt-get update sudo apt-get install ubuntu-zfs This failed to install due to "Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed." Trying sudo modprobe zfs shows FATAL error : module not found. Here, they mentioned it was to do with lacking build dependences- I followed the answer which was to run sudo apt-get remove --purge ubuntu-zfs zfs-dkms zfsutils spl spl-dkms libzfs1 dkms Then, REBOOT. Then, do: sudo apt-get install linux-headers-generic build-essentia sudo apt-get install ubuntu-zfs " This leaves me in the same situation with "Building only for 3.12.0-rc7+ Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed." when trying to install ubuntu-zfs. Trying sudo apt-get install --reinstall zfs-dkms also does not work.

    Read the article

  • Install wont boot up, stuck on loading text dots / restarts

    - by Franz Mayo Horkovic
    Friend gave me her laptop, we agreed on Ubuntu, but I have troubles even booting up live version (see the notebook). I tried 12.04 64bit on USB stick, it does nothing, when I choose booting live version, it just restarts PC. Then I tried 32bit version, it starts loading, but its stuck on loading components, printing on black screen just dots ........... I Googled it, found similar problem - somebody suggested to use older version and then upgrade it. I went through 11.04, 10.04 - 64 and 32 same result. Restart or infinite loading. I did memtest, it showed 4 errors, Windows Vista is running "fine", no "bluescreens" etc. Any ideas what am I doing wrong?

    Read the article

  • NIS client authentication

    - by Tarun Gupta
    How to configure the nis client on ubuntu? and how to configure system authentication? there is no option for system authentication like system setting system info in my system etc. when ever i go to software center and search them nis authentication then i got one package for nis authentication and i try to install them then one error occur that is remove hostname utility. when i try to remove hostname utility then it does not remove.

    Read the article

  • Can I force window to open on top of other windows when opened by keyboard shortcut?

    - by Rasmus
    I use SpaceFM as my primary file manager on Ubuntu. I typically open folder directly by keyboard shortcuts, so, e.g. Ctrl+Super+W opens my Work folder. Specifically, I use execute the command spacefm -w /home/rasmus/Work/ by the above shortcut, with the -w ensuring that SpaceFM opens a new window. However, this new window is not always open on top of the last active window on the workspace. This is rather annoying, as it means I sometimes have to "dig" for the newly opened window. So, my question is: Is there something additional I can add to the executed command that will ensure that the fresh window is opened on top? Alternative solutions to the same effect are welcome.

    Read the article

  • Should I Use WordPress Category Archives or Regular Pages When Considering SEO?

    - by user1151640
    I've built a WordPress site based on posts and category archives (no pages). The menu redirects to different category archive pages that have a description, an image, and the relevant posts. Now that almost everything is finished I've started to worry and wonder if that was a good decision from an SEO standpoint Will Google consider category archives a bad idea for sitelinks compared to using regular pages?

    Read the article

  • How to you prevent someone from getting a "new free trial period" by just creating a new login?

    - by Clay Nichols
    I am considering several options for the Trial version of our web app. The one I favor the most is the classic trial period. Of course, it's a LOT easier for someone to hack this system. They can defeat the various methods of fingerprinting the user, thusly: Browser cookie: Clear their cookies completely (or just for our site) or use a different device. Although Evercookie may help with the former. Email address: Create a new login (with a new email address) I'm going to monitor things for a while and just see how it goes. If it's a problem I'll consider requiring a credit card number matched to a name and billing zip code. Each such "ID constellation" would be considered one user. Someone could still have multiple credit card numbers but we could flag the same name+zipcode coming up again. Are there any better ways to do this?

    Read the article

  • Cannot add DataTables.net javascript into Joomla 1.5

    - by mfmz
    I've been having this problem where i couldn't add Datatables.net javascript into my Joomla article. I have been trying to include it through Jumi. To say that my editor strips of the tag is somewhat not right as I have been able to execute Google Chart API in Joomla which also uses javascript. Any clue why? The code is as below : <link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script> <script type="text/javascript"> $(document).ready( function () { var table = $('#example').DataTable(); } ); </script>

    Read the article

  • Failing Screen Resize Method

    - by StrongJoshua
    So I want my game to draw to a specific "optimal" size and then be stretched to fit screens that are a different size. I'm using LibGDX and figured that I could just draw everything to a FrameBuffer and then resize that buffer to the appropriate size when drawing it to the actual display. However, my method does not work, it just results in a black screen with the top right quarter of the screen white.Intermediary is the FBO, interMatrix is a Matrix4 object, and camera is an OrthographicCamera. @Override public void render() { // update actors currentStage.act(); //render to intermediary buffer batch.setProjectionMatrix(interMatrix); intermediary.begin(); batch.begin(); currentStage.draw(); batch.flush(); intermediary.end(); //resize to actual width and height Sprite s = new Sprite(intermediary.getColorBufferTexture()); s.flip(true, false); batch.setProjectionMatrix(camera.combined); batch.draw(s.getTexture(), 0, 0, width, height); batch.end(); } These are the constructors for the above mentioned objects (GAME_WIDTH and HEIGHT are the "optimal" settings, width and height are the actual sizes, which are the same when running on desktop). intermediary = new FrameBuffer(Format.RGBA8888, GAME_WIDTH, GAME_HEIGHT, false); interMatrix = new Matrix4(); camera = new OrthographicCamera(width, height); interMatrix.setToOrtho2D(0, 0, GAME_WIDTH, GAME_HEIGHT); Is there a better way of doing this or can is this a viable option and how do I fix what I have?

    Read the article

  • Tunnels in pseudo 3D racing game

    - by Nicholas
    How would one go about doing tunnels in a pseudo 3D racing game ? The main problem I have at the moment is perspective - I cant think of a way, beyond having to Z sort the sprites and tunnel coordinates, so that vehicles are displayed in front of the tunnel entrance and somehow block the display when out of site. I would like my tunnels to be used on both flat, curved and hills and slopes. The tunnel enterance/exit is made up of 3 separate graphics, (left, right and top), whilst inside the tunnel it is just one line graphic along the top (the idea being its supposed to be a set distance above the current vertical road position). As you can see from the picture, the vehicles are still being rendered whilst in the tunnel. I've converted the Code Incomplete road system to GLBasic.

    Read the article

  • XNA - Strange Texture Rendering Issue Using XNA BasicEffect

    - by Spencer Marr
    I have been reading and working through Riemers 3D XNA tutorials to expand my knowledge of XNA from 2D into 3D. Unfortunately I am having rendering issues that I am unable to solve and I need a point in the right direction. I am not expecting the Models to look identical to Blender but there is some serious discoloring from the texture files once rendering through XNA. The Character model is using completely incorrect colors (Red where Grey should be) and the Cube is rendering a strange pattern where a flat color should be drawn. My sampling mode is set to PointClamp. The Character model that I created has a 32 by 32 pixel texture that has been UV mapped to the model in blender. The model was then exported to .FBX. For the Cube Model a 64 by 64 pixel texture is used. foreach (ModelMesh mesh in samuraiModel.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.Projection = Projection; effect.View = View; effect.World = World; } mesh.Draw(); } Does this look like it is caused by a mistake I made while UV Mapping or Creating Materials in Blender? Is this a problem with using the default XNA BasicEffect? Or something completely different that i have not considered? Thank You!

    Read the article

  • Multiple enemy array in LibGDX

    - by johnny-b
    I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And if the bullet hits the ball then the ball pops. so the bullet should change to a different sprite or texture. same with the ball pop. But all that happens is the bullet if touched pops and nothing else happens. And if modified then the bullet keeps flashing as the update is way too much. I have added COMMENTS in the code to explain more on the issues. below is the code. if more code is needed i will provide. Thank you public class GameRenderer { private GameWorld myWorld; private OrthographicCamera cam; private ShapeRenderer shapeRenderer; private SpriteBatch batcher; // Game Objects private Ball ball; private ScrollHandler scroller; private Background background; private Bullet bullet1; private BulletPop bPop; private Array<Bullet> bullets; // This is for the delay of the bullet coming one by one every 30 seconds. /** The time of the last shot fired, we set it to the current time in nano when the object is first created */ double lastShot = TimeUtils.nanoTime(); /** Convert 30 seconds into nano seconds, so 30,000 milli = 30 seconds */ double shotFreq = TimeUtils.millisToNanos(30000); // Game Assets private TextureRegion bg, bPop; private Animation bulletAnimation, ballAnimation; private Animation ballPopAnimation; public GameRenderer(GameWorld world) { myWorld = world; cam = new OrthographicCamera(); cam.setToOrtho(true, 480, 320); batcher = new SpriteBatch(); // Attach batcher to camera batcher.setProjectionMatrix(cam.combined); shapeRenderer = new ShapeRenderer(); shapeRenderer.setProjectionMatrix(cam.combined); // This is suppose to produce 10 bullets at random places on the background. bullets = new Array<Bullet>(); Bullet bullet = null; float bulletX = 00.0f; float bulletY = 00.0f; for (int i = 0; i < 10; i++) { bulletX = MathUtils.random(-10, 10); bulletY = MathUtils.random(-10, 10); bullet = new Bullet(bulletX, bulletY); AssetLoader.bullet1.flip(true, false); AssetLoader.bullet2.flip(true, false); bullets.add(bullet); } // Call helper methods to initialize instance variables initGameObjects(); initAssets(); } private void initGameObjects() { ball = GameWorld.getBall(); bullet1 = myWorld.getBullet1(); bPop = myWorld.getBulletPop(); scroller = myWorld.getScroller(); } private void initAssets() { bg = AssetLoader.bg; ballAnimation = AssetLoader.ballAnimation; bullet1Animation = AssetLoader.bullet1Animation; ballPopAnimation = AssetLoader.ballPopAnimation; } // This is to take the bullet away when clicked or touched. public void onClick() { for (int i = 0; i < bullets.size; i++) { if (bullets.get(i).getBounds().contains(0, 0)) bullets.removeIndex(i); } } private void drawBackground() { batcher.draw(bg1, background.getX(), background.getY(), background.getWidth(), backgroundMove.getHeight()); } public void render(float runTime) { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT); batcher.begin(); // Disable transparency // This is good for performance when drawing images that do not require // transparency. batcher.disableBlending(); drawBackground(); batcher.enableBlending(); // when the bullet hits the ball, it should be disposed or taken away and a ball pop sprite/texture should be put in its place if (bullet1.collides(ball)) { // draws the bPop texture but the bullet does not go just keeps going around, and the bPop texture goes. batcher.draw(AssetLoader.bPop, 195, 273); } batcher.draw(AssetLoader.ballAnimation.getKeyFrame(runTime), ball.getX(), ball.getY(), ball.getWidth(), ball.getHeight()); // this is where i am trying to make the bullets come one by one, and if removed via the onClick() then bPop animation // should play but does not??? if(TimeUtils.nanoTime() - lastShot > shotFreq){ // Create your stuff for (int i = 0; i < bullets.size; i++) { bullets.get(i); batcher.draw(AssetLoader.bullet1Animation.getKeyFrame(runTime), bullet1.getX(), bullet1.getY(), bullet1.getOriginX(), bullet1.getOriginY(), bullet1.getWidth(), bullet1.getHeight(), 1.0f, 1.0f, bullet1.getRotation()); if (bullets.removeValue(bullet1, false)) { batcher.draw(AssetLoader.ballPopAnimation.getKeyFrame(runTime), bPop1.getX(), bPop1.getY(), bPop1.getWidth(), bPop1.getHeight()); } } /* Very important to set the last shot to now, or it will mess up and go full auto */ lastShot = TimeUtils.nanoTime(); } // End SpriteBatch batcher.end(); } } Thank you

    Read the article

  • Android Activity access Unity Classes

    - by Anomaly
    I have made my own C# classes in Unity, is there any way I can access these classes from the Android Activity that starts the UnityPlayer? Example: I have a C# class called testClass in Unity: class testClass{ public static string myString="test string"; } From the Android activity in Java I want to access that class: string str=testClass.myString; Is this possible? If so, how? Or is there some other way to do this? In the end I basically want to communicate between my Android activity and the UnityPlayer object. Thanks in advance. EDIT: Ok so I looked at building Android plugins for Unity but this wasn't satisfactory to me. I ended up building a socket client-server interface in Unity with C# and another one in Java for the Android app: So Unity listens on port X and broadcasts on port Y The Android activity listens on port Y and broadcasts on port X This is necessary as both interfaces are running on the same host. So that's how I solved my problem, but I'm open for any suggestions if anyone knows a better way of communicating between the Unityplayer and your app.

    Read the article

  • Detecting walls or floors in pygame

    - by Serial
    I am trying to make bullets bounce of walls, but I can't figure out how to correctly do the collision detection. What I am currently doing is iterating through all the solid blocks and if the bullet hits the bottom, top or sides, its vector is adjusted accordingly. However, sometimes when I shoot, the bullet doesn't bounce, I think it's when I shoot at a border between two blocks. Here is the update method for my Bullet class: def update(self, dt): if self.can_bounce: #if the bullet hasnt bounced find its vector using the mousclick pos and player pos speed = -10. range = 200 distance = [self.mouse_x - self.player[0], self.mouse_y - self.player[1]] norm = math.sqrt(distance[0] ** 2 + distance[1] ** 2) direction = [distance[0] / norm, distance[1 ] / norm] bullet_vector = [direction[0] * speed, direction[1] * speed] self.dx = bullet_vector[0] self.dy = bullet_vector[1] #check each block for collision for block in self.game.solid_blocks: last = self.rect.copy() if self.rect.colliderect(block): topcheck = self.rect.top < block.rect.bottom and self.rect.top > block.rect.top bottomcheck = self.rect.bottom > block.rect.top and self.rect.bottom < block.rect.bottom rightcheck = self.rect.right > block.rect.left and self.rect.right < block.rect.right leftcheck = self.rect.left < block.rect.right and self.rect.left > block.rect.left each test tests if it hit the top bottom left or right side of the block its colliding with if self.can_bounce: if topcheck: self.rect = last self.dy *= -1 self.can_bounce = False print "top" if bottomcheck: self.rect = last self.dy *= -1 #Bottom check self.can_bounce = False print "bottom" if rightcheck: self.rect = last self.dx *= -1 #right check self.can_bounce = False print "right" if leftcheck: self.rect = last self.dx *= -1 #left check self.can_bounce = False print "left" else: # if it has already bounced and colliding again kill it self.kill() for enemy in self.game.enemies_list: if self.rect.colliderect(enemy): self.kill() #update position self.rect.x -= self.dx self.rect.y -= self.dy This definitely isn't the best way to do it but I can't think of another way. If anyone has done this or can help that would be awesome!

    Read the article

  • Problem with AssetManager while loading a Model type

    - by user1204548
    Today I've tried the AssetManager for the first time with .g3db files and I'm having some problems. Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: data/data at com.badlogic.gdx.assets.AssetManager.handleTaskError(AssetManager.java:508) at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:342) at com.lostchg.martagdx3d.MartaGame.render(MartaGame.java:78) at com.badlogic.gdx.Game.render(Game.java:46) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:207) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: data/data at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:119) at com.badlogic.gdx.assets.AssetLoadingTask.update(AssetLoadingTask.java:89) at com.badlogic.gdx.assets.AssetManager.updateTask(AssetManager.java:445) at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:340) ... 4 more Caused by: com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/data at com.badlogic.gdx.utils.async.AsyncResult.get(AsyncResult.java:31) at com.badlogic.gdx.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:117) ... 7 more Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/data at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140) at com.badlogic.gdx.assets.loaders.TextureLoader.loadAsync(TextureLoader.java:72) at com.badlogic.gdx.assets.loaders.TextureLoader.loadAsync(TextureLoader.java:41) at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:69) at com.badlogic.gdx.assets.AssetLoadingTask.call(AssetLoadingTask.java:34) at com.badlogic.gdx.utils.async.AsyncExecutor$2.call(AsyncExecutor.java:49) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\data (Internal) at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:132) at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:586) at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220) at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137) ... 9 more Why it tries to load that unexisting file? It seems that the AssetManager manages to load my .g3db file at first, because earlier the java console threw some errors related to the textures associated to the 3D scene having to be a power of 2. Relevant code: public void show() { ... assets = new AssetManager(); assets.load("data/levelprueba2.g3db", Model.class); loading = true; ... } private void doneLoading() { Model model = assets.get("data/levelprueba2.g3db", Model.class); for (int i = 0; i < model.nodes.size; i++) { String id = model.nodes.get(i).id; ModelInstance instance = new ModelInstance(model, id); Node node = instance.getNode(id); instance.transform.set(node.globalTransform); node.translation.set(0,0,0); node.scale.set(1,1,1); node.rotation.idt(); instance.calculateTransforms(); instances.add(instance); } loading = false; } public void render(float delta) { super.render(delta); if (loading && assets.update()) doneLoading(); ... } The error points to the line with the assets.update() method. Please, help! Sorry for my bad English and my amateurish doubts.

    Read the article

  • linking jpeg image in html to php code

    - by Avtar Brar
    im creating a website which includes a button (JPEG image) that will locate ('a ref') a php file. I need the php to be called when the 'email.jpg' button is clicked on but only shows up as pure text in a web browser. any ideas on how to resolve this? any help is much appreciated! thanks MAIN HTML SITE CODE <div id="content-container"> <p align="center"><a href="video.mp4" class="html5lightbox" data-width="720" data-height="404"><img src="bg.jpg" width="1023" height="820" id="imgvideo" /></a> <div align="center"> <table width="1027" height="46" border="0" cellpadding="0px"> <tr> <td><a href="mail.php"><img src="email.png" width="130" height="46" /></a></td> </tr> </table> </div> </div> PHP FILE CODE (mail.php) <?php /*EMAIL TEMPLATE BEGINS*/ $imgSrc = 'bg.jpg'; $imgDesc = 'test_sell_new/'; $imgTitle = 'bg.jpg'; $subjectPara1 = 'Now Available'; $subjectPara2 = NULL; $subjectPara3 = NULL; $subjectPara4 = NULL; $subjectPara5 = NULL; $message = '<!DOCTYPE HTML>'. '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'. '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'. '<html xmlns="http://www.w3.org/1999/xhtml">'. '<head>'. '<title>Available Now</title>'. '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'. '</head>'. '<body style="background-color:#ffffff; padding:0; margin:-10px 0 0 0; _margin:0 0 0 0; *margin:0 0 0 0; text-align:center;">'. '<table border="0" cellpadding="0" cellspacing="0" width="1024" style="background-color:#ffffff; font-family:Arial, Helvetica, sans-serif; font-size:10px; padding-top:0px; margin:auto;">'. '<tr>'. '.<td><a href="index.html" style="text-decoration:none"><p style="color:#000000; text-align:center; margin:10px 0 0 0; *margin:0 0 0 0; _margin:0 0 0 0; font-family:Arial, Helvetica, sans-serif; font-size:11px;">Having trouble viewing this message? Click here.</p></a></td>'. '</tr>'. '<tr>'. '<td>'. '<table border="0" cellspacing="0" cellpadding="0" width="100%" height="820">'. '<tr>'. '<td>'. '<a href="index.html"><img src="bg.jpg" width="1024" height="820" border="0" /></a><br />'. '</td>'. '</tr>'. '</table>'. '</td>'. '</tr>'. '</table>'. '</body>'. /*EMAIL TEMPLATE ENDS*/ $to = '[email protected]'; $subject = 'IT WORKS!'; $from = '[email protected]'; $headers = "From: " . $from . "\r\n"; $headers .= "Reply-To: ". $from . "\r\n"; $headers .= "CC: [email protected]\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; ?>

    Read the article

  • set width of bars in matlab bar plot on logarithmic scale

    - by KatyB
    I am a bit confused on how to draw a bar graph for the following example: x_lims = [1000,10000;10000,100000;100000,1000000;1000000,10000000;10000000,... 100000000;100000000,1000000000;1000000000,10000000000;... 10000000000,100000000000;100000000000,1e12]; ex1 = [277422033.049038;24118536.4203188;2096819.03295482;... 182293.402068030;15905;1330;105;16;1]; Here, x_lims is the x axis limits for each individual bar and ex1 is the count. How can I plot these on a bar graph so that the width of each individual bar along the x axis is defined by the distance between x_lims(:,1) and x_lims(:,2) and the y value is defined by ex1? So far I have: bar(log10(x_lims(:,1)),log10(ex1)); set(gca,'Xtick',3:11,'YTick',0:9); set(gca,'Xticklabel',10.^get(gca,'Xtick'),... 'Yticklabel',10.^get(gca,'Ytick')); But I would like to (1) have the labels to be the same as if they were created using semilogx or semilogy e.g. 10^9, and (2) I would like to remove the space between the bars, for the first bar, for example, I would like to have it extend horizontally from 1000 to 10000 and then the second bar from 10000 to 100000, and so on. How can this be done?

    Read the article

  • Is it possible to set different select2 parameters at different times?

    - by ReiMasuro
    From playing around I can see that this code $("#Selected3").select2({ minimumInputLength: 3 }); $("#Selected3").select2({ placeholder: "Show a placeholder" }); will show me the placeholder but remove the minimumInputLength parameters value. Does anyone know a way please that this example could be modified so that the placeholder will be added without losing the minimum..Length value. Any answers will need to allow for the possibility of the statements being in separate files, i.e. one on the page and another in a referenced .js file. I am aware that this would be much easier if I set all the parameters at once, e.g. $("#Selected3").select2({ minimumInputLength: 3, placeholder: "Show a placeholder" }); but I am working within a framework which won't currently allow that. EDIT: For anyone who is willing to give this a shot but doesn't know select2 the library comes from here Select2 on GitHub

    Read the article

  • How to rotate 3D axis(XYZ) using Yaw,Pitch,Roll angles in Opengl

    - by user3639338
    I am working Pose estimation with capturing from camera with Opencv. Now I had three angle(Yaw,Pitch,Roll) from each frame(Head) using my code.How to rotate 3D axis(XYZ) those three angle using opengl ? I draw 3D axis using opengl. I have Problem with rotate this axis for returning each frame(Head) using VideoCapture camera input from my code.I cant rotate continuously using returning three angle my code.

    Read the article

  • Right way to access the Google Cloud Storage bucket via Public API

    - by SyBer
    I'm trying the following request to access the bucket by using curl, via the public API: curl -X POST -H 'Content-Type: image/jpeg' -d @xxx.jpeg 'https://www.googleapis.com/upload/storage/v1/b/clips.eyecam.com/o?uploadType=media&name=x.jpeg&key=XXX' With XXX being the generated key in the Public API. However I'm getting an authorization failure: { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } } Seems the request is incorrect and does not pass the authorization key, any idea what would be the right form of the request?

    Read the article

  • What does "static" mean in the context of declaring global template functions?

    - by smf68
    I know what static means in the context of declaring global non-template functions (see e.g. What is a "static" function?), which is useful if you write a helper function in a header that is included from several different locations and want to avoid "duplicate definition" errors. So my question is: What does static mean in the context of declaring global template functions? Please note that I'm specifically asking about global, non-member template functions that do not belong to a class. In other words, what is the difference between the following two: template <typename T> void foo(T t) { /* implementation of foo here */ } template <typename T> static void bar(T t) { /* implementation of bar here */ }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >