Daily Archives

Articles indexed Monday June 11 2012

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

  • Problems with icons and shutting down Ubuntu 12.04

    - by Anders
    I recently upgraded from 11-10 to 12.04 as a dual boot (Windows 7) and am having problems with shutting down. I installed from a CD that I burned from the iso file, and to get it to boot from the CD, I needed to install the special help program from Windows that would then recognize the CD as the system booted.The installation gave me my own user account as well as a guest account. For the User account there is no "gear" icon (in the upper RH side) from which to access the shut down menu. Interestingly the icons for the Home folder, the Ubuntu One folder, and the System Settings folder are missing, although there are blank places shows these names if the mouse cursor is positioned over these areas. They will even launch with the press of a key - but no icons are visible. For the Guest account, all of these icons are visible and usable. The problem that occurs in shutting down is that I need to leave the User account, move to the Guest account (so that I can access the top right "gear" icon that has the shut down menu item) and press the shut down button. The problem here is that when the shut own menu appears and I press the confirmation that I wish to shut down the computer, the page blanks (as one might hope in the process of closing down), and then pops up with the log in menu, giving the option of logging in as a User or as a Guest. So the questions are: 1) how do you reinstate the far right top icon from which you can access the shut down drop down menu in the User account page. 2) how do you get the icons to display properly on the Left hand side (Home, Ubuntu One, System Settings, and Workspace Switcher) 3) how do you get the system to turn of when you press the shut down button! Boy oh boy! Thanks a bunch for any help!

    Read the article

  • How to keep "dot files" under version control?

    - by andrewsomething
    Etckeeper is a great tool for keeping track of changes to your configuration files in /etc A few key things about it really stand out. It can be used with a wide variety of VCSs: git, mercurial, darcs, or bzr. It also does auto commits daily and whenever you install, remove or upgrade package. It also keeps track of file permissions and user/group ownership metadata. I would also like to keep my "dot files" in my home directory under version control as well, preferably bazaar. Does anyone know if a tool like etckeeper exists for this purpose? Worst case, I imagine that a simple cron job running bzr add && bzr ci once or twice a day along with adding ~/Documents, ~/Music, ect to the .bzrignore Anyone already doing something similar with a script? While I'd prefer bazaar, other options might be interesting.

    Read the article

  • Hosting a magnet link site which could possibly infringe copyrighted material?

    - by Griff
    I have for the last 3 months built a crawler, indexer and alot of other things for what started out to be a home project for indexing magnet links on the internet. As my project grew I have thought about releasing my collected data (which at the minute is on a public domain but with no access) to the public. Whatever the crawler sucks in goes in, and whatever the indexer decides to index gets indexed as it is a fully automated process. My question is as follows; Considering that most of the data that is collected from what I have built points to illegal copyrighted material (as most magnet links do) where would it be best to host such a site. I notice all of the already public torrent sites are hosted in India is this because there laws are less strict on copyright infringement? Have any of you hosted such a site, and if so what problems have you ran into? And as always any advice on being a webmaster for this type website?

    Read the article

  • How much does game development mathematics change over time?

    - by FlightOfGrey
    This question is mainly aimed at this book, Essential Mathematics for Games and Interactive Applications, Second Edition which I have seen highly recommended all around the internet, so I'm sure there are people on here who own a copy. What I want to know specifically is if any of the information would be out dated since the book was released on June 2, 2008? Also interested to see how the mathematics behind game development has changed over time.

    Read the article

  • Dynamically load images inside jar

    - by Rahat Ahmed
    I'm using Slick2d for a game, and while it runs fine in Eclipse, i'm trying to figure out how to make it work when exported to a runnable .jar. I have it set up to where I load every image located in the res/ directory. Here's the code /** * Loads all .png images located in source folders. * @throws SlickException */ public static void init() throws SlickException { loadedImages = new HashMap<>(); try { URI uri = new URI(ResourceLoader.getResource("res").toString()); File[] files = new File(uri).listFiles(new FilenameFilter(){ @Override public boolean accept(File dir, String name) { if(name.endsWith(".png")) return true; return false; } }); System.out.println("Naming filenames now."); for(File f:files) { System.out.println(f.getName()); FileInputStream fis = new FileInputStream(f); Image image = new Image(fis, f.getName(), false); loadedImages.put(f.getName(), image); } } catch (URISyntaxException | FileNotFoundException e) { System.err.println("UNABLE TO LOAD IMAGES FROM RES FOLDER!"); e.printStackTrace(); } font = new AngelCodeFont("res/bitmapfont.fnt",Art.get("bitmapfont.png")); } Now the obvious problem is the line URI uri = new URI(ResourceLoader.getResource("res").toString()); If I pack the res folder into the .jar there will not be a res folder on the filesystem. How can I iterate through all the images in the compiled .jar itself, or what is a better system to automatically load all images?

    Read the article

  • How to refactor and improve this XNA mouse input code?

    - by Andrew Price
    Currently I have something like this: public bool IsLeftMouseButtonDown() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Pressed; } public bool IsLeftMouseButtonPressed() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Released; } public bool IsLeftMouseButtonUp() { return currentMouseState.LeftButton == ButtonState.Released && previousMouseSate.LeftButton == ButtonState.Released; } public bool IsLeftMouseButtonReleased() { return currentMouseState.LeftButton == ButtonState.Released && previousMouseSate.LeftButton == ButtonState.Pressed; } This is fine. In fact, I kind of like it. However, I'd hate to have to repeat this same code five times (for right, middle, X1, X2). Is there any way to pass in the button I want to the function so I could have something like this? public bool IsMouseButtonDown(MouseButton button) { return currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } public bool IsMouseButtonPressed(MouseButton button) { return currentMouseState.IsPressed(button) && !previousMouseState.IsPressed(button); } public bool IsMouseButtonUp(MouseButton button) { return !currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } public bool IsMouseButtonReleased(MouseButton button) { return !currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } I suppose I could create some custom enumeration and switch through it in each function, but I'd like to first see if there is a built-in solution or a better way.. Thanks!

    Read the article

  • Ogre 3d and bullet physics interaction

    - by Tim
    I have been playing around with Ogre3d and trying to integrate bullet physics. I have previously somewhat successfully got this functionality working with irrlicht and bullet and I am trying to base this on what I had done there, but modifying it to fit with Ogre. It is working but not correctly and I would like some help to understand what it is I am doing wrong. I have a state system and when I enter the "gamestate" I call some functions such as setting up a basic scene, creating the physics simulation. I am doing that as follows. void GameState::enter() { ... // Setup Physics btBroadphaseInterface *BroadPhase = new btAxisSweep3(btVector3(-1000,-1000,-1000), btVector3(1000,1000,1000)); btDefaultCollisionConfiguration *CollisionConfiguration = new btDefaultCollisionConfiguration(); btCollisionDispatcher *Dispatcher = new btCollisionDispatcher(CollisionConfiguration); btSequentialImpulseConstraintSolver *Solver = new btSequentialImpulseConstraintSolver(); World = new btDiscreteDynamicsWorld(Dispatcher, BroadPhase, Solver, CollisionConfiguration); ... createScene(); } In the createScene method I add a light and try to setup a "ground" plane to act as the ground for things to collide with.. as follows. I expect there is issues with this as I get objects colliding with the ground but half way through it and they glitch around like crazy on collision. void GameState::createScene() { m_pSceneMgr->createLight("Light")->setPosition(75,75,75); // Physics // As a test we want a floor plane for things to collide with Ogre::Entity *ent; Ogre::Plane p; p.normal = Ogre::Vector3(0,1,0); p.d = 0; Ogre::MeshManager::getSingleton().createPlane( "FloorPlane", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, p, 200000, 200000, 20, 20, true, 1, 9000,9000,Ogre::Vector3::UNIT_Z); ent = m_pSceneMgr->createEntity("floor", "FloorPlane"); ent->setMaterialName("Test/Floor"); Ogre::SceneNode *node = m_pSceneMgr->getRootSceneNode()->createChildSceneNode(); node->attachObject(ent); btTransform Transform; Transform.setIdentity(); Transform.setOrigin(btVector3(0,1,0)); // Give it to the motion state btDefaultMotionState *MotionState = new btDefaultMotionState(Transform); btCollisionShape *Shape = new btStaticPlaneShape(btVector3(0,1,0),0); // Add Mass btVector3 LocalInertia; Shape->calculateLocalInertia(0, LocalInertia); // CReate the rigid body object btRigidBody *RigidBody = new btRigidBody(0, MotionState, Shape, LocalInertia); // Store a pointer to the Ogre Node so we can update it later RigidBody->setUserPointer((void *) (node)); // Add it to the physics world World->addRigidBody(RigidBody); Objects.push_back(RigidBody); m_pNumEntities++; // End Physics } I then have a method to create a cube and give it rigid body physics properties. I know there will be errors here as I get the items colliding with the ground but not with each other properly. So I would appreciate some input on what I am doing wrong. void GameState::CreateBox(const btVector3 &TPosition, const btVector3 &TScale, btScalar TMass) { Ogre::Vector3 size = Ogre::Vector3::ZERO; Ogre::Vector3 pos = Ogre::Vector3::ZERO; Ogre::Vector3 scale = Ogre::Vector3::ZERO; pos.x = TPosition.getX(); pos.y = TPosition.getY(); pos.z = TPosition.getZ(); scale.x = TScale.getX(); scale.y = TScale.getY(); scale.z = TScale.getZ(); Ogre::Entity *entity = m_pSceneMgr->createEntity( "Box" + Ogre::StringConverter::toString(m_pNumEntities), "cube.mesh"); entity->setCastShadows(true); Ogre::AxisAlignedBox boundingB = entity->getBoundingBox(); size = boundingB.getSize(); //size /= 2.0f; // Only the half needed? //size *= 0.96f; // Bullet margin is a bit bigger so we need a smaller size entity->setMaterialName("Test/Cube"); Ogre::SceneNode *node = m_pSceneMgr->getRootSceneNode()->createChildSceneNode(); node->attachObject(entity); node->setPosition(pos); //node->scale(scale); // Physics btTransform Transform; Transform.setIdentity(); Transform.setOrigin(TPosition); // Give it to the motion state btDefaultMotionState *MotionState = new btDefaultMotionState(Transform); btVector3 HalfExtents(TScale.getX()*0.5f,TScale.getY()*0.5f,TScale.getZ()*0.5f); btCollisionShape *Shape = new btBoxShape(HalfExtents); // Add Mass btVector3 LocalInertia; Shape->calculateLocalInertia(TMass, LocalInertia); // CReate the rigid body object btRigidBody *RigidBody = new btRigidBody(TMass, MotionState, Shape, LocalInertia); // Store a pointer to the Ogre Node so we can update it later RigidBody->setUserPointer((void *) (node)); // Add it to the physics world World->addRigidBody(RigidBody); Objects.push_back(RigidBody); m_pNumEntities++; } Then in the GameState::update() method which which runs every frame to handle input and render etc I call an UpdatePhysics method to update the physics simulation. void GameState::UpdatePhysics(unsigned int TDeltaTime) { World->stepSimulation(TDeltaTime * 0.001f, 60); btRigidBody *TObject; for(std::vector<btRigidBody *>::iterator it = Objects.begin(); it != Objects.end(); ++it) { // Update renderer Ogre::SceneNode *node = static_cast<Ogre::SceneNode *>((*it)->getUserPointer()); TObject = *it; // Set position btVector3 Point = TObject->getCenterOfMassPosition(); node->setPosition(Ogre::Vector3((float)Point[0], (float)Point[1], (float)Point[2])); // set rotation btVector3 EulerRotation; QuaternionToEuler(TObject->getOrientation(), EulerRotation); node->setOrientation(1,(Ogre::Real)EulerRotation[0], (Ogre::Real)EulerRotation[1], (Ogre::Real)EulerRotation[2]); //node->rotate(Ogre::Vector3(EulerRotation[0], EulerRotation[1], EulerRotation[2])); } } void GameState::QuaternionToEuler(const btQuaternion &TQuat, btVector3 &TEuler) { btScalar W = TQuat.getW(); btScalar X = TQuat.getX(); btScalar Y = TQuat.getY(); btScalar Z = TQuat.getZ(); float WSquared = W * W; float XSquared = X * X; float YSquared = Y * Y; float ZSquared = Z * Z; TEuler.setX(atan2f(2.0f * (Y * Z + X * W), -XSquared - YSquared + ZSquared + WSquared)); TEuler.setY(asinf(-2.0f * (X * Z - Y * W))); TEuler.setZ(atan2f(2.0f * (X * Y + Z * W), XSquared - YSquared - ZSquared + WSquared)); TEuler *= RADTODEG; } I seem to have issues with the cubes not colliding with each other and colliding strangely with the ground. I have tried to capture the effect with the attached image. I would appreciate any help in understanding what I have done wrong. Thanks. EDIT : Solution The following code shows the changes I made to get accurate physics. void GameState::createScene() { m_pSceneMgr->createLight("Light")->setPosition(75,75,75); // Physics // As a test we want a floor plane for things to collide with Ogre::Entity *ent; Ogre::Plane p; p.normal = Ogre::Vector3(0,1,0); p.d = 0; Ogre::MeshManager::getSingleton().createPlane( "FloorPlane", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, p, 200000, 200000, 20, 20, true, 1, 9000,9000,Ogre::Vector3::UNIT_Z); ent = m_pSceneMgr->createEntity("floor", "FloorPlane"); ent->setMaterialName("Test/Floor"); Ogre::SceneNode *node = m_pSceneMgr->getRootSceneNode()->createChildSceneNode(); node->attachObject(ent); btTransform Transform; Transform.setIdentity(); // Fixed the transform vector here for y back to 0 to stop the objects sinking into the ground. Transform.setOrigin(btVector3(0,0,0)); // Give it to the motion state btDefaultMotionState *MotionState = new btDefaultMotionState(Transform); btCollisionShape *Shape = new btStaticPlaneShape(btVector3(0,1,0),0); // Add Mass btVector3 LocalInertia; Shape->calculateLocalInertia(0, LocalInertia); // CReate the rigid body object btRigidBody *RigidBody = new btRigidBody(0, MotionState, Shape, LocalInertia); // Store a pointer to the Ogre Node so we can update it later RigidBody->setUserPointer((void *) (node)); // Add it to the physics world World->addRigidBody(RigidBody); Objects.push_back(RigidBody); m_pNumEntities++; // End Physics } void GameState::CreateBox(const btVector3 &TPosition, const btVector3 &TScale, btScalar TMass) { Ogre::Vector3 size = Ogre::Vector3::ZERO; Ogre::Vector3 pos = Ogre::Vector3::ZERO; Ogre::Vector3 scale = Ogre::Vector3::ZERO; pos.x = TPosition.getX(); pos.y = TPosition.getY(); pos.z = TPosition.getZ(); scale.x = TScale.getX(); scale.y = TScale.getY(); scale.z = TScale.getZ(); Ogre::Entity *entity = m_pSceneMgr->createEntity( "Box" + Ogre::StringConverter::toString(m_pNumEntities), "cube.mesh"); entity->setCastShadows(true); Ogre::AxisAlignedBox boundingB = entity->getBoundingBox(); // The ogre bounding box is slightly bigger so I am reducing it for // use with the rigid body. size = boundingB.getSize()*0.95f; entity->setMaterialName("Test/Cube"); Ogre::SceneNode *node = m_pSceneMgr->getRootSceneNode()->createChildSceneNode(); node->attachObject(entity); node->setPosition(pos); node->showBoundingBox(true); //node->scale(scale); // Physics btTransform Transform; Transform.setIdentity(); Transform.setOrigin(TPosition); // Give it to the motion state btDefaultMotionState *MotionState = new btDefaultMotionState(Transform); // I got the size of the bounding box above but wasn't using it to set // the size for the rigid body. This now does. btVector3 HalfExtents(size.x*0.5f,size.y*0.5f,size.z*0.5f); btCollisionShape *Shape = new btBoxShape(HalfExtents); // Add Mass btVector3 LocalInertia; Shape->calculateLocalInertia(TMass, LocalInertia); // CReate the rigid body object btRigidBody *RigidBody = new btRigidBody(TMass, MotionState, Shape, LocalInertia); // Store a pointer to the Ogre Node so we can update it later RigidBody->setUserPointer((void *) (node)); // Add it to the physics world World->addRigidBody(RigidBody); Objects.push_back(RigidBody); m_pNumEntities++; } void GameState::UpdatePhysics(unsigned int TDeltaTime) { World->stepSimulation(TDeltaTime * 0.001f, 60); btRigidBody *TObject; for(std::vector<btRigidBody *>::iterator it = Objects.begin(); it != Objects.end(); ++it) { // Update renderer Ogre::SceneNode *node = static_cast<Ogre::SceneNode *>((*it)->getUserPointer()); TObject = *it; // Set position btVector3 Point = TObject->getCenterOfMassPosition(); node->setPosition(Ogre::Vector3((float)Point[0], (float)Point[1], (float)Point[2])); // Convert the bullet Quaternion to an Ogre quaternion btQuaternion btq = TObject->getOrientation(); Ogre::Quaternion quart = Ogre::Quaternion(btq.w(),btq.x(),btq.y(),btq.z()); // use the quaternion with setOrientation node->setOrientation(quart); } } The QuaternionToEuler function isn't needed so that was removed from code and header files. The objects now collide with the ground and each other appropriately.

    Read the article

  • Where is the "ListViewItemPlaceholderBackgroundThemeBrush" located?

    - by Dimi Toulakis
    I have a problem understanding one style definition in Windows 8 metro apps. When you create a metro style application with VS, there is also a folder named Common created. Inside this folder there is file called StandardStyles.xaml Now the following snippet is from this file: <!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage --> <DataTemplate x:Key="Standard250x250ItemTemplate"> <Grid HorizontalAlignment="Left" Width="250" Height="250"> <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}"> <Image Source="{Binding Image}" Stretch="UniformToFill"/> </Border> <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}"> <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/> <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/> </StackPanel> </Grid> </DataTemplate> What I do not understand here is the static resource definition, e.g. for the Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" It is not about how you work with templates and binding and resources. Where is this ListViewItemPlaceholderBackgroundThemeBrush located? Many thanks for your help. Dimi

    Read the article

  • Benchmark of Java Try/Catch Block

    - by hectorg87
    I know that going into a catch block has some significance cost when executing a program, however, I was wondering if entering a try{} block also had any impact so I started looking for an answer in google with many opinions, but no benchmarking at all. Some answers I found were: Java try/catch performance, is it recommended to keep what is inside the try clause to a minimum? Try Catch Performance Java Java try catch blocks However they didn't answer my question with facts, so I decided to try it for myself. Here's what I did. I have a csv file with this format: host;ip;number;date;status;email;uid;name;lastname;promo_code; where everything after status is optional and will not even have the corresponding ; , so when parsing a validation has to be done to see if the value is there, here's where the try/catch issue came to my mind. The current code that in inherited in my company does this: StringTokenizer st=new StringTokenizer(line,";"); String host = st.nextToken(); String ip = st.nextToken(); String number = st.nextToken(); String date = st.nextToken(); String status = st.nextToken(); String email = ""; try{ email = st.nextToken(); }catch(NoSuchElementException e){ email = ""; } and it repeats what it's done for email with uid, name, lastname and promo_code. and I changed everything to: if(st.hasMoreTokens()){ email = st.nextToken(); } and in fact it performs faster. When parsing a file that doesn't have the optional columns. Here are the average times: --- Trying:122 milliseconds --- Checking:33 milliseconds however, here's what confused me and the reason I'm asking: When running the example with values for the optional columns in all 8000 lines of the CSV, the if() version still performs better than the try/catch version, so my question is Does really the try block does not have any performance impact on my code? The average times for this example are: --- Trying:105 milliseconds --- Checking:43 milliseconds Can somebody explain what's going on here? Thanks a lot

    Read the article

  • I want to retrieve check items of list view

    - by kamil
    for(int i=0;i < users.size();i++) { map = new HashMap<String, String>(); map.put("id",String.valueOf(i)); map.put("userID", String.valueOf(users.get(i).getUserId())); map.put("emailID", users.get(i).getEmailAddress()); memList.add(map); } ListAdapter adapter = new SimpleAdapter(this, memList , R.layout.member_list_view, new String[] { "emailID" },new int[] { R.id.memTextView}); memberList.setAdapter(adapter); I have to retrieve the checked items on a separate button listener. how can I? I am using a customize list view. Plz help...

    Read the article

  • MyFaces Test Framework not working with JSF 2.1

    - by Karl Kildén
    we have a lot of tests that uses Myfaces Test Framework for JSF 2.0. http://myfaces.apache.org/test/index.html Problem is we can't get it to work with JSF 2.1. Does anyone know a workaround or a way to solve this? When we run the tests we get the following error: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory It works fine with jsf 2.0 though. A typical use case in our code: // code block; assertFalse("Error message not expected. ", facesContext .getMessages().hasNext()); JSF 2.1 has a few syntax changes so my guess would be that's the problem.

    Read the article

  • NoSuchProviderException: smtp with log4j SMTP appender

    - by user1016403
    I am using log4j to send an email when there is an exception. below is my log4j properties file configuration. log4j.rootLogger=WARN, R, email log4j.appender.R=org.apache.log4j.ConsoleAppender log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{HH:mm:ss} %-5p [%c{1}]: %m%n log4j.appender.email=org.apache.log4j.net.SMTPAppender log4j.appender.email.BufferSize=10 log4j.appender.email.SMTPHost=myhost.com [email protected] [email protected] log4j.appender.email.Subject=Error log4j.appender.email.layout=org.apache.log4j.PatternLayout mine is maven project i have added dependencies for mail.jar, activation.jar and smtp.jar. But on application server startup itself i get below error: [ERROR] log4j:ERROR Error occured while sending e-mail notification. [ERROR] javax.mail.NoSuchProviderException: smtp [ERROR] at javax.mail.Session.getService(Session.java:782) [ERROR] at javax.mail.Session.getTransport(Session.java:708) [ERROR] at javax.mail.Session.getTransport(Session.java:651) [ERROR] at javax.mail.Session.getTransport(Session.java:631) [ERROR] at javax.mail.Session.getTransport(Session.java:686) [ERROR] at javax.mail.Transport.send0(Transport.java:166) Am i missing any thing here? What is the root cause of the error? is it because of incorrect SMTP host name? or is it because of any missing/conflicting dependencies?

    Read the article

  • Get records using left outer join

    - by Devendra Gohil
    I have two tables as given below Table A Table B Table C ============= ============== ========= Id Name Id AId CId Id Name 1 A 1 1 1 1 x 2 B 2 1 1 2 y 3 C 3 2 1 3 z 4 D 4 2 3 4 w 5 E 5 3 2 5 v Now I want all the records of Table A with matching Id column CId from Table B where CId = 1. So the output should be like below : Id Name CId 1 A 1 2 B 1 3 C 1 4 D Null 5 E Null Can anyone help me please?

    Read the article

  • MYSQL - Adding result set A to result set B? Please see my example

    - by BlackberryFan
    I have two mysql tables. They are laid out in this manner: user_info id | emailContact _______________________ 1 | [email protected] 3 | [email protected] user_biz_info id | emailContact _________________________ 8 | [email protected] 9 | [email protected] What kind of join would I use to create a result set of information like this: id | emailContact ________________________________ 1 - [email protected] 3 - [email protected] 8 - [email protected] 9 - [email protected] I have tried the following: SELECT p.id, p.emailContact, b.id, b.emailContact FROM user_info p, user_business_info b But it seems that this is an incorrect approach. Would someone be able to suggest the correct approach in this or possibly point me in the direction of some tutorials that cover this type of mysql join, as this is what I assume is needed in this case. Thanks for your time in reading through my question!!

    Read the article

  • Number range for color in GLSL

    - by kotoko
    I'm figuring out how to set a colour in a Fragment Shader. This statement gl_FragColor = (0.1,0.6,1,1); gives me white regardless of what I enter in the first 3 values. I was expecting to either give it values between 0 and 255 or 0 and 1 but neither seems to work. I can change how bright it is with values from 0 to 1 in the fourth value, but nothing for colour. Can anybody tell me if: gl_FragColor is the right variable to set. What is the range of values for the first three values. What am I currently making the Shader do.

    Read the article

  • Implementing rounded corners on slide down navigation menu

    - by Nick
    I am working on the slide down menu you can see here. I have rounded corners on both ul#navigation and ul.subnavigation. When the submenu slides down it is possible to see the border at the bottom of ul.subnavigation overlap with the content of ul#navigation, when I would like it to slide down smoothly, without the 'flicker'. I am aware that this issue is caused by the rounded corners. I need ul.subnavigation to cover the rounded corners at the bottom of ul#navigation when the menu drops down, without seeing the double border-bottom issue. I hope this is clear! Code is below. Thanks, Nick HTML <ul id="navigation"> <li class="dropdown"><a href="#">menu</a> <ul class="sub_navigation"> <li><a href="#">home</a></li> <li><a href="#">help</a></li> <li><a href="#">disable tips</a></li> </ul> </li> </ul> JQUERY $('.dropdown').hover(function() { $(this).find('.sub_navigation').slideToggle(); });? CSS ul#navigation, ul.sub_navigation { margin:0; padding:0; list-style-type:none; min-width:100px; background-color: white; font-size:15px; font-family: Trebuchet MS; text-align: center; -khtml-border-radius: 0 0 5px 5px; -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; border:1px black solid; border-top:none; } ul.sub_navigation { margin-left:-1px; position: absolute; top:28px; } ul#navigation { float:left; position:absolute; top:0; } ul#navigation li { float:left; min-width:100px; } ul.sub_navigation { position:absolute; display:none; } ul.sub_navigation li { clear:both; } a, a:active, a:visited { display:block; padding:7px; }

    Read the article

  • Strip parity bits in C from 8 bits of data followed by 1 parity bit

    - by dubnde
    I have a buffer of bits with 8 bits of data followed by 1 parity bit. This pattern repeats itself. The buffer is currently stored as an array of octets. Example (p are parity bits): 0001 0001 p000 0100 0p00 0001 00p01 1100 ... should become 0001 0001 0000 1000 0000 0100 0111 00 ... Basically, I need to strip of every ninth bit to just obtain the data bits. How can I achieve this? This is related to another question asked here sometime back. This is on a 32 bit machine so the solution to the related question may not be applicable. The maximum possible number of bits is 45 i.e. 5 data octets This is what I have tried so far. I have created a "boolean" array and added the bits into the array based on the the bitset of the octet. I then look at every ninth index of the array and through it away. Then move the remaining array down one index. Then I've got only the data bits left. I was thinking there may be better ways of doing this.

    Read the article

  • json jquery post request

    - by John
    <script type="text/javascript"> $(document).ready(function() { $("a").click(function() { var content = $('#content').html(); var data = {"content":content}; $.ajax({ type: "POST", dataType: "json", url: "ajax.php", data: {content:content}, success function (data) { alert('Hello!'); } }); }); }); </script> <div id="content"><?php echo $content; ?></div> ajax.php echo json_encode($_POST['content']); ?> Nothing happens... WhatI really want to achieve is to get that alert box and get the return data, but I am lost since I don't get any errors or nothing.

    Read the article

  • Copy and Store LPTSTR in class causes crash

    - by Jake M
    I am attempting to copy a LPTSTR and store that string as a member variable in an object. But my attempts to copy the LPTSTR seem to fail and when I go to access/print the value of the copied LPTSTR I get a program crash. Is it possible to copy a LPTSTR and store it in my class below or is it better to just use a TCHAR*? class Checkbox { private: LPTSTR text; HWND hwnd; public: Checkbox(HWND nHwnd, LPTSTR nText) { lstrcpy(checkText, text); } void print() { // Causes a crash MessageBox(hwnd, text, text, MB_OK); } };

    Read the article

  • Two differents FOSUser in application

    - by Jérôme Boé
    I face a problem with FOSUserBundle. In my Symfony2 application, I want to implement two differents User. I have one entity User, for basic user, and one entity UserPro with more informations. My problem is that I want to configure my bundle with this two entities: fos_user: db_driver:     orm firewall_name: main user_class:    Btp\UserBundle\Entity\User fos_userpro: db_driver:     orm firewall_name: pro user_class:    Btp\UserProBundle\Entity\UserPro And so, use fos_user and fos_userpro as provider in my security.yml. I'm no sure it's be possible. I obtain an error : There is no extension able to load the configuration for "fos_userpro" (in /..../app/config/config.yml). Looked for namespace "fos_userpro", found "framework", "security", ... And when I take a look in FOSUserBundle files, I feel that fos_user is not a configuration variable and is directly written in strings. Thanks.

    Read the article

  • Using textbox text in javascript

    - by Jambo
    I am working with Twitter widgets with the following script- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <input type="button" value="Run Function" onclick="test();" /> <script> function test() { new TWTR.Widget({ version: 3, type: 'profile', rpp: 8, interval: 30000, width: 315, height: 340, theme: { shell: { background: '#333333', color: '#ffffff' }, tweets: { background: '#000000', color: '#ffffff', links: '#4aed05' } }, features: { scrollbar: false, loop: false, live: false, behavior: 'all' } }).render().setUser(document.getElementById('TextBox1').value).start(); } When using the function test(); in the button click it is ocming up with the error - Error: Unable to get value of the property 'value': object is null or undefined So it seems like it is not getting to the value at - (document.getElementById('TextBox1').value) I am not sure why it is null if the text box has a value and then the script is run on the button click?

    Read the article

  • dynamic HREF attribute by XSLT

    - by ofortuna
    Can anyone plese advice how I can have dynamic HREF attribute in the place of http://abc.com by XSLT in following code snippet? <xsl:for-each select="MenuItems/mainmenu"> <a href="http://abc.com"> <span><xsl:value-of select="menuName"/></span> </a> </xsl:for-each> sample xml <MenuItems> <mainmenu> <menuID>1</menuID> <menuName>Home</menuName> <menuLink>http://aaa.com</menuLink> <subMenuList> <menuID>2</menuID> <menuName>Home</menuName> <menuLink>http://a1.com</menuLink> </subMenuList> <subMenuList> <menuID>3</menuID> <menuName>List of RCCs</menuName> <menuLink>http://a2.com</menuLink> </subMenuList> <subMenuList> <menuID>4</menuID> <menuName>Turnover Workout</menuName> <menuLink>http://a3.com</menuLink> </subMenuList> </mainmenu> <MenuItems>

    Read the article

  • CKeditor with a CKFinder custom config file

    - by Daan
    I know it is possible to load a custom config file for CKFinder CKFinder.config.customConfig = baseUrl + '/js/ckfinder_config.js'; However, when I load CKFinder within the CKEditor I don't know how to load the custom config for CKFinder. I only got these options: CKEDITOR.editorConfig = function( config ) { config.filebrowserBrowseUrl = baseUrl ; config.filebrowserImageBrowseUrl = baseUrl ; config.filebrowserFlashBrowseUrl = baseUrl ; config.filebrowserUploadUrl = baseUrl ; config.filebrowserImageUploadUrl = baseUrl ; config.filebrowserFlashUploadUrl = baseUrl ; } Is there a way?

    Read the article

  • Changing font size of legend title in Python pylab rose/polar plot

    - by LaurieW
    I'm trying to change the font size of the title of an existing legend on a rose, or 'polar', plot. Most of the code was written by somebody else, who is away. I've added:- ax.legend(title=legend_title) setp(l.get_title(), fontsize=8) to add the title 'legend_title', which is a variable that the user enters a string for in a a different function that uses this code. The second line of this doesn't return an error but doesn't appear to do anything either. The complete code is below. 'Rose' and 'RoseAxes' are modules/functions written by somebody. Does anyone know of a way to change the legend title font size? I've found some examples for normal plots but can't find any for rose/polar plots. from Rose.RoseAxes import RoseAxes from pylab import figure, title, setp, close, clf from PlotGeneration import color_map_xml fig = figure(1) rect = [0.02, 0.1, 0.8, 0.8] ax = RoseAxes(fig, rect, axisbg='w') fig.add_axes(ax) if cmap == None: (XMLcmap,colors) = color_map_xml.get_cmap('D:/HRW/VET/HrwPyLibs/ColorMapLibrary/paired.xml',255) else: XMLcmap = cmap bqs = kwargs.pop('CTfigname', None) ax.box(Dir, U, bins = rose_binX, units = unit, nsector = nsector, cmap = XMLcmap, lw = 0, **kwargs ) l = ax.legend() ax.legend(title=legend_title) setp(l.get_texts(), fontsize=8) setp(l.get_title(), fontsize=8) Thanks for any help

    Read the article

  • Open-source navigation software and 3rd party hardware

    - by anttir
    I'm a bit fed up with the current navigator (TomTom) as it turned to adware after six months of use. "Please buy new maps at www.tomtom.com, click this button to see what you wanted to do". Is there any (good) OSS navigation software with support for proprietary hardware? I'm perfectly happy to purchase separate maps and hardware for the software as long as I don't have to give my money to TomTom or Navigon.

    Read the article

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