Daily Archives

Articles indexed Thursday October 31 2013

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

  • Glitch-free cross-fades in HTML5

    - by Alexander Gladysh
    In my HTML5 canvas game, I need to cross-fade two sprites which have some glow around them. (Glow is backed into sprites.) Initially, the first sprite is visible. During the cross-fade the first sprite should vanish, and be replaced with the second one. How exactly the cross-fade is done — does not matter, as long as it is smooth and there are no visual glitches. I've tried two techniques: During the cross-fade I simultaneously interpolate alpha of the first sprite from 1.0 to 0.0, and alpha of the second sprite — from 0.0 to 1.0. With this technique I can see background in the middle of the cross-fade. That's because both sprites are semi-transparent most of the time. During the cross-fade I first interpolate alpha of the second sprite from 0.0 to 1.0 (first sprite alpha is at 1.0), and then interpolate alpha of the first sprite from 1.0 to 0.0. With this technique background is not seen, but the glow around sprites flashes during the cross-fide — when both sprites are near the full visibility. In non-HTML5 game I'd use shaders to do cross-fade separately in RGB and alpha channels. Is there a trick to do the cross-fade I need in HTML5 without visual glitches?

    Read the article

  • Feasability of mobile 2D multiplayer RPG game with interactive bitmap background

    - by user2827214
    I'm looking to develop a 2D multiplayer RPG game for Android, with a bird's eye view similar to that of zelda/pokemon. The game is very simple in all ways since my intent is for thousands of players to occupy the same world which I imagine requires good performance. However, I am unsure about the performance requirements of two properties: the tile map that is used as a background is dynamic (interactive). For example, a player steps in the water, and the water turns black. Every tile in the game does this. the tile map is the same object used for all players, but it is displayed differently on each user's mobile device, even though the players exist in the same world. For example, the water that turned black is displayed as red on all other players' screens. I have knowledge of java, but almost none regarding game dev. tools. Is there a best process for these requirements? Should I develop in pure java, or use some tool like Slick2D etc.? How performance intensive are these properties, if even possible? Edit: There are no collisions in the game or difficult animations, I am imagining simply changing the colors of the tiles (like in the examples), and a client-server architecture

    Read the article

  • Runescape Private Server - How does it work?

    - by Friend of Kim
    I've seen a lot of Runescape private servers lately. How do they work? Most of them are based on the old Runescape, but a few look exactly like the real Runescape. How do they make the servers? Has the source code of the game been leaked on several occasions, and is that used to make Runescape servers? Or have some people just replicated Runescape, and tried to make the same game themselves (and "stolen" the 3D objects and texture from Jagex to make it look the same, and written the code to be able to replicate most functions of Runescape)?

    Read the article

  • NoInitialContextException: in ejb 3

    - by JavaDeveloper
    My client class code Hashtable hs = new Hashtable(); hs.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); hs.put(Context.PROVIDER_URL, "jnp://10.20.52.41:1200"); hs.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); Context context = new InitialContext(hs); System.out.println("-----"); try { Example helloWorld = (Example) context .lookup("Example"); helloWorld.display("HelloWorld"); } catch (NamingException e) { System.out.println("naming exception occoured"); e.printStackTrace(); } My session bean code public class Example implements javax.ejb.SessionBean { //method here.. } getting following exception. how to resolve? Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.(InitialContext.java:197) at comtest.client.Example.main(Test.java:22) Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654) ... 4 more

    Read the article

  • using itext how to extracta string in java

    - by user2455183
    I am finding the string in between 123 and 321 and making it as bold. For that I used the Pattern to get the string before 123, text between 123 and 321 and text after 321. Could anyone please help me get all the strings between 123 and 321. Pattern p = Pattern.compile("^.*?(123)"); Matcher m = p.matcher(meredithEditorialSectionSegment); while (m.find()) { String desc = m.group(); String segDesc = (desc.substring(0, desc.length() - 3)); segmentDesc.add(new Chunk(segDesc, sectionDescriptionFont)); } descBold = meredithEditorialSectionSegment.substring(meredithEditorialSectionSegment.indexOf("123") + 3); descBold = descBold.substring(0, descBold.indexOf("321")); segmentDesc.add(new Chunk(descBold, sectionDescriptionBoldFont)); Matcher matcher = Pattern.compile("(?<=321).*").matcher(meredithEditorialSectionSegment); matcher.find(); segmentDesc.add(new Chunk(matcher.group(), sectionDescriptionFont));

    Read the article

  • How to find specific value of the node in xml file

    - by user2735149
    I am making windows phone 8 app based the webservices. This is my xml code: - <response> <timestamp>2013-10-31T08:30:56Z</timestamp> <resultsOffset>0</resultsOffset> <status>success</status> <resultsLimit>8</resultsLimit> <resultsCount>38</resultsCount> - <headlines> - <headlinesItem> <headline>City edge past Toon</headline> <keywords /> <lastModified>2013-10-30T23:45:22Z</lastModified> <audio /> <premium>false</premium> + <links> - <api> - <news> <href>http://api.espn.com/v1/sports/news/1600444?region=GB</href> </news> </api> - <web> <href>http://espnfc.com/uk/en/report/381799/city-edge-toon?ex_cid=espnapi_public</href> </web> - <mobile> <href>http://m.espn.go.com/soccer/gamecast?gameId=381799&lang=EN&ex_cid=espnapi_public</href> </mobile> </links> <type>snReport</type> <related /> <id>1600444</id> <story>Alvardo Negredo and Edin Dzeko struck in extra-time to book Manchester City's place in the last eight of the Capital One Cup, while Costel Pantilimon kept a clean sheet in the 2-0 win to keep the pressure on Joe Hart. </story> <linkText>Newcastle 0-2 Man City</linkText> - <images> - <imagesItem> <height>360</height> <alt>Man City celebrate after Edin Dzeko scored their second extra-time goal at Newcastle.</alt> <width>640</width> <name>Man City celeb Edin Dzeko goal v nufc 20131030 [640x360]</name> <caption>Man City celebrate after Edin Dzeko scored their second extra-time goal at Newcastle.</caption> <type>inline</type> <url>http://espnfc.com/design05/images/2013/1030/mancitycelebedindzekogoalvnufc20131030_640x360.jpg</url> </imagesItem> </images> Code behind: myData = XDocument.Parse(e.Result, LoadOptions.None); var data = myData.Descendants("headlines").FirstOrDefault(); var data1 = from query in myData.Descendants("headlinesItem") select new UpdataNews { News = (string)query.Element("headline").Value, Desc = (string)query.Element("description"), Newsurl = (string)query.Element("links").Element("mobile").Element("href"), Imageurl=(string)query.Element("images").Element("imagesItem").Element("url").Value, }; lstShow.ItemsSource = data1; I am trying to get value from xml tags and assign them to News,Desc, etc. Everything works fine except Imageurl, it shows NullException. I tried same method for Imageurl, i dont know whats going wrong. Help..

    Read the article

  • Prevent click event on the clicked element?

    - by nainy
    I have a click event on the body of my document: $("body").on('click.findElem', function(e) { e.stopPropagation(); e.preventDefault(); self.hinter(e.target); return false; }); It basically catches the clicked target and does something to it. However, there are some targets that already have a click event on them, and they prevent my click from being executed at all. How do I overcome that issue? I tried unbinding it, but the click doesn't even work at all to actually execute the unbinding.

    Read the article

  • Self organizing layouts

    - by user613326
    Quite a while ago i was more in websites building then i am now. In my time there where huge debates about what to use; tables or pure CSS alternatives. I went out of the webdesigning, but now an old question re-surfaces. What i would like to create is a web page design that depending on screensize, would self organize the page into columns, so that for example on a PDA it would show 1 column On an old computer monitor, it would show 2 colomns, and on a widescreen laptop it would show 3 columns. I forgot how this was called and how it was done in the past, it had to do with XML and storing data seperate from design (if i remember well), perhaps these days better methods exist to do that, does this, anyone ring this a bell ? Also i note a lot is possible with Jquery and and brouwser depending webkits. But i need to make sure that it would run on all (modern) brouwsers : Iexplorer, Firefox, chrome And Jquery is nice too, but i am kinda woried that some day one of these brouwser vendors decides that jscript like java isnt enabled by default (or is that very unlikely ?)11 Perhaps someone can point me to a method that is the prefered way to do this.

    Read the article

  • Linq Getting Customers group by date and then by their type

    - by Nitin varpe
    I am working on generating report for showing customer using LINQ in C#. I want to show no. of customers of each type. There are 3 types of customer registered, guest and manager. I want to group by customers by registered date and then by type of customer. i.e If today 3 guest, 4 registered and 2 manager are inserted. and tomorrow 4,5 and 6 are registered resp. then report should show Number of customers registerd on the day . separate row for each type. DATE TYPEOF CUSTOMER COUNT 31-10-2013 GUEST 3 31-10-2013 REGISTERED 4 31-10-2013 MANAGER 2 30-10-2013 GUEST 5 30-10-2013 REGISTERED 10 30-10-2013 MANAGER 3 LIKE THIS . var subquery = from eat in _customerRepo.Table group eat by new { yy = eat.CreatedOnUTC.Value.Year, mm = eat.CreatedOnUTC.Value.Month, dd = eat.CreatedOnUTC.Value.Day } into g select new { Id = g.Min(x => x.Id) }; var query = from c in _customerRepo.Table join cin in subquery.Distinct() on c.Id equals cin.Id select c; By above query I get minimum cutomers registerd on that day Thanks in advance

    Read the article

  • Cannot find symbol - variable

    - by Ben Garside
    I'm new to Java, and I'm trying to get user input, store each line of input as a variable and then return each value so that it can be passed on somewhere else. When I try and compile it is telling me that it can't find the variable magnitude. I'm assuming it won't find the others either. I'm guessing that this is because I've declare the variables inside of the "try" but don't know how to get it so that the return statement accepts them. Code is as follows: public Earthquake userAddEarthquake() { Scanner scanner = new Scanner(System.in); try{ // convert the string read from the scanner into Integer type System.out.println("Please Enter An Earthquake Magnitude: "); Double magnitude = Double.parseDouble(scanner.nextLine()); System.out.println("Please Enter The Earthquakes Latitude Position: "); scanner = new Scanner(System.in); Double positionLatitude = Double.parseDouble(scanner.nextLine()); System.out.print("Please Enter The Earthquakes Longitude Position: "); scanner = new Scanner(System.in); Double positionLongitude = Double.parseDouble(scanner.nextLine()); System.out.print("Please Enter The Year That The Earthquake Occured: "); scanner = new Scanner(System.in); int year = Integer.parseInt(scanner.nextLine()); System.out.println("Magnitude = " + magnitude); } catch(NumberFormatException ne){ System.out.println("Invalid Input"); } finally{ scanner.close(); } return new Earthquake(magnitude, positionLatitude, positionLongitude, year); }

    Read the article

  • Increase width of divs, displayed side by side, using draggable events

    - by Vaibhav Shukla
    I have two divs of fixed length as of now, which loads external URL by dynamically embedding iframes inside them. Divs are appearing next to each other - one on left and other right. As of now, I have fixed their width to 50% each. But, I want to give user a flexibility to increase the width of any div to view the URL inside easily without scrolling horizontally. Something like dragging the border separating the two divs to either left or right according to his need. Is there a way I could achieve this? Please suggest any library or something. I have gone through a library twentytwenty which is used for images. I don't know how will that work for dynamic iframes. Here is the JSFiddle which displays the divs. <div> <div id="originalPage" style="width:54%;height: 730px;float:left"> <p>one div </p> </div> <div id="diffReport" style="width:45%; height: 730px;float:right"> <p>another div</p> </div> </div>

    Read the article

  • disable the Home Button and Back Button"

    - by michael
    i want way to disable the Home Button & Back Button when click on checkbox in application , my application on version 4.2.2 i have code but not work when click on checkbox work stop to application public void HardButtonOnClick(View v) { boolean checked1 = ((CheckBox) v).isChecked(); if(checked1) { SQLiteDatabase db; db = openOrCreateDatabase("Saftey.db", SQLiteDatabase.CREATE_IF_NECESSARY, null); db.setVersion(1); db.setLocale(Locale.getDefault()); db.setLockingEnabled(true); ContentValues values = new ContentValues(); values.put("hardBtn", "YES"); db.update("Setting", values, "id = ?", new String[] { "1" }); Toast.makeText(this, "Hard Button Locked", Toast.LENGTH_LONG).show(); //SharedPreferences pref = getSharedPreferences("pref",0); //SharedPreferences.Editor edit = pref.edit(); //edit.putString("hard","yes"); //edit.commit(); /* String Lock="yes" ; Bundle bundle = new Bundle(); bundle.putString("key", Lock); Intent a = new Intent(Change_setting.this, ChildMode.class); a.putExtras(bundle); startActivity(a);*/ super.onAttachedToWindow(); this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); isLock = true; } else { SQLiteDatabase db; db = openOrCreateDatabase("Saftey.db", SQLiteDatabase.CREATE_IF_NECESSARY, null); db.setVersion(1); db.setLocale(Locale.getDefault()); db.setLockingEnabled(true); ContentValues values = new ContentValues(); values.put("hardBtn", "NO"); db.update("Setting", values, "id = ?", new String[] { "1" }); //SharedPreferences pref = getSharedPreferences("pref",0); //SharedPreferences.Editor edit = pref.edit(); //edit.putString("hard","no"); //edit.commit(); Toast.makeText(this, "Hard Button Un-Locked", Toast.LENGTH_LONG).show(); isLock = false; } } how can work it??

    Read the article

  • Inorder tree traversal in binary tree in C

    - by srk
    In the below code, I'am creating a binary tree using insert function and trying to display the inserted elements using inorder function which follows the logic of In-order traversal.When I run it, numbers are getting inserted but when I try the inorder function( input 3), the program continues for next input without displaying anything. I guess there might be a logical error.Please help me clear it. Thanks in advance... #include<stdio.h> #include<stdlib.h> int i; typedef struct ll { int data; struct ll *left; struct ll *right; } node; node *root1=NULL; // the root node void insert(node *root,int n) { if(root==NULL) //for the first(root) node { root=(node *)malloc(sizeof(node)); root->data=n; root->right=NULL; root->left=NULL; } else { if(n<(root->data)) { root->left=(node *)malloc(sizeof(node)); insert(root->left,n); } else if(n>(root->data)) { root->right=(node *)malloc(sizeof(node)); insert(root->right,n); } else { root->data=n; } } } void inorder(node *root) { if(root!=NULL) { inorder(root->left); printf("%d ",root->data); inorder(root->right); } } main() { int n,choice=1; while(choice!=0) { printf("Enter choice--- 1 for insert, 3 for inorder and 0 for exit\n"); scanf("%d",&choice); switch(choice) { case 1: printf("Enter number to be inserted\n"); scanf("%d",&n); insert(root1,n); break; case 3: inorder(root1); break; default: break; } } }

    Read the article

  • mySQL need to merge fields and get unique rows

    - by jiudev
    i have a database with +1 million rows and the stuktur looks like: CREATE TABLE IF NOT EXISTS `Performance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `CIDs` varchar(100) DEFAULT NULL, `COLOR` varchar(100) DEFAULT NULL, `Name` varchar(255) DEFAULT NULL, `XT` bigint(16) DEFAULT NULL, `MP` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), KEY `CIDs` (`CIDs`), KEY `COLOR` (`COLOR`), KEY `Name` (`Name`), KEY `XT` (`XT`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; insert into `Performance` (`id`, `CIDs`, `COLOR`, `Name`, `XT`, `MP`) VALUES (1, '1253374160', 'test test test test test', 'Load1', '89421331221', ''), (2, '1271672029', NULL, 'Load1', '19421331221', NULL), (3, '1188959688', NULL, 'Load2', '39421331221', NULL), (4, '1271672029', NULL, 'Load3', '49421341221', 'Description'), (5, '1271888888', NULL, 'Load4', '59421331221', 'Description'); The Output should look like: +----+------------+--------------------------+-------------+-------------+-------+-----------+---------+ | id | CIDs | COLOR | XT | MP | Name | PIDs | unqName | +----+------------+--------------------------+-------------+-------------+-------+-----------+---------+ | 1 | 1253374160 | test test test test test | 89421331221 | | Load1 | 1,2 | Load1 | | 3 | 1188959688 | NULL | 39421331221 | NULL | Load2 | 3 | Load2 | | 4 | 1271672029 | NULL | 49421341221 | Description | Load3 | 4,5 | Load3 | +----+------------+--------------------------+-------------+-------------+-------+-----------+---------+ any ideas, how i could do this as fast as possible? I have tried with some group by, but it takes some Minutes :/ Thanks Advance //edit: for the solution with the group by, i needed 4 subquerys :/ //edit2: as requested: select id, CIDs, COLOR, XT, MP, Name, concat(PIDs,",",GROUP_CONCAT(DISTINCT id)) as PIDs, IFNULL(Name,id) as unqName from ( select id, CIDs, COLOR, XT, MP, Name, concat(PIDs,",",GROUP_CONCAT(DISTINCT id)) as PIDs, IFNULL(MP,id) as unqMP from ( select id, CIDs, COLOR, XT, MP, Name, concat(PIDs,",",GROUP_CONCAT(DISTINCT id)) as PIDs, IFNULL(XT,id) as unqXT from ( select id, CIDs, COLOR, XT, MP, Name, GROUP_CONCAT(DISTINCT id) as PIDs, IFNULL(COLOR,id) as unqCOLOR from Performance group by unqCOLOR ) m group by unqXT ) x group by unqMP ) y group by unqName

    Read the article

  • Echo mysql results in a loop?

    - by Roy D. Porter
    I am using turn.js to make a book. Every div within the 'deathnote' div becomes a new page. <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page </div> //ends book What I am doing is trying to get 3 'content' (content being a name and cause of death) divs onto 1 page, and then generate a new page. So here is what i want: <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"> //creates new page but leaves it open <div> CONTENT </div> <div> CONTENT </div> <div> CONTENT </div> </div> //ends the page </div> //ends book Seems simple enough, however the content is data from a MySQL DB, so i have to echo it in using PHP. Here is what i have so far <div id="deathnote"> <div style="background-image:url(images/coverpage.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <?php $pagecount = 0; $db = new mysqli('localhost', 'username', 'passw', 'DB'); if($db->connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $sql = <<<SQL SELECT * FROM `TABLE` SQL; if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } //IGNORE ALL OF THE GARBAGE ABOVE. IT IS SIMPLE CONNECTING SCRIPT THAT I KNOW WORKS //THE METHOD I AM HAVING TROUBLE WITH IS BELOW $pagecount = 0; while($row = $result->fetch_assoc()){ //GETS THE VALUE (and makes sure it isn't nothing echo '<div style="background-image:url(images/paper.jpg);">'; //THIS OPENS A NEW PAGE while ($pagecount !== 3) { //KEEPS COUNT OF HOW MUCH CONTENT DIVS IS ON THE PAGE while($row = $result->fetch_assoc()){ //START A CONTENT DIV echo '<div class="content"><div class="name">' . $row['victim'] . '</div><div class="cod">' . $row['cod'] . '</div></div>'; //END A CONTENT DIV $pagecount++; //UP THE PAGE COUNT } } $pagecount=0; //PUT IT BACK TO 0 echo '</div>'; //END PAGE } $db->close(); ?> <div style="background-image:url(images/backpage.jpg);"></div> //BACK PAGE </div> At the moment i seem to be causing and infinite loop so the page won't load. The problem resides within the while loops. Any help is greatly appreciated. Thanks in advance guys. :)

    Read the article

  • Caveates on the html options of <pre> <code> [on hold]

    - by user2935199
    Over at html syntax to display literal string i asked about displaying a literal. When i tried : http://sdrv.ms/1bEsPWz (as the posted sample will not display, i need to show a picture, as i don't have 10 xxx, i can't insert a picture, I am only left with a skydrive reference) In english, the and syntax was tried but it failed to show all content inside the block. It only showed the "is equal to - pre sample " part. I thought - did not care what was inside ? Can some explain how to make a truely literal block display ? I have my reasons why i don't want to have the " syntax in the html. Thanks

    Read the article

  • Canvas - @font-face doesn't work on IE9+

    - by iMoses
    I've created a widget which allows the user to locate free-text over an image using a textarea. When saving the image a background canvas application reads the text and calculates its position, then it draws the text to the canvas over the image and saves a new image file. The font I use for this widget is league-gothic which I am importing using the @font-face method. This seems to work great and without any issues on all browsers except (of-course) for IE9 and IE10. When using internet explorer you can clearly see that the font was indeed loaded since the textarea uses the same font, but when trying to draw the text onto the canvas the font-family reverts to one of its fallback, in this case Arial. I've searched quite a bit and found nothing. Unlike most font issues I found that concern the canvas element, I am completely sure that the font has indeed loaded as I am viewing it before saving the result. Anything at all will help me at the moment. If you have any insight, experience with similar bugs or whatever, please share :) Thanks in advance. P.S. I can't expose a code example at the moment, but if it becomes a problem I'll do my best to provide one.

    Read the article

  • easyui how to set a event on load tab error

    - by joaner
    I'm use easyui tabs load html content: contents.tabs('add',{ title: title, href: href, closable: true, extractor:function(data){ console.log(data); return data; } }); sometime I maybe got a 404, 500 response, but the response error message is not display in the new window. The tab window always show loading style. So I try to find a onLoadError event to catch this error in office manual: http://www.jeasyui.com/documentation/tabs.php , but not exists. Please tell me how to do let me exit the loading status.

    Read the article

  • Keeping Velocity Constant and Player in Position - Sidescrolling

    - by user2904951
    I'm working on a Little Mobile Game with Cocos2D-X and Box2D. The Point where I got stuck is the movement of a box2d-body (the main actor) and the according Sprite. Now I want to : move this Body with a constant velocity along the x-axis, no matter if it's rolling (it's a circleshape) upwards or downwards keep the body nearly sticking to the ground on which it's rolling keep the Body and the according Sprite in the Center of the Screen. What I tried : in the update()- method I used body->SetLinearVelocity(b2Vec2(x,y)) to higher/lower values, if the Body was passing a constant value for his velocity I used to set very high y-Values in body->SetLinearVelocity(b2Vec2(x,y)) First tried to use CCFollow with my playerSprite, which was also Scrolling along the y-axis, as i only need to scroll along the x-axis, so I decided to move the whole layer which is containing the ambience (platforms etc.) to the left of my Screen and my Player Body & Player sprite to the right of the Screen, adjusting the speed values to Keep the Player in the Center of the Screen. Well... ...didn't work as i wanted it to, because each time i set the velocity manually (I also tried to use body->applyLinearImpulse(...) when the Body is moving upwards just as playing around with the value of velocityIterations in world->Step(...)) there's a small delay, which pushes the player Body more or less further of the Center of the Screen. ... didn't also work as I expected it to, because I needed to adjust the x-Values, when the Body was moving upwards to Keep it not getting slowed down, this made my Body even less sticky to the ground.... ... CCFollow did a good Job, except that I didn't want to scroll along the y-axis also and it Forces the overgiven sprite to start in the Center of the Screen. Moving the whole Layer even brought no good results, I have tried a Long time to adjust values of the movement Speed of the layer and the Body to Keep it negating each other, that the player stays nearly in the Center of the Screen.... So my question is : Does anyone of you have any Kind of new Approach for me to solve this cohesive bunch of Problems ? Cheers, Seb

    Read the article

  • How to read postgresql dump file in Python

    - by xorsyst
    I'd like my Python script to read some data out of a postgresql dump file. The Python will be running on a system without postgresql, and needs to process the data in a dump file. It looks fairly straightforward to parse the CREATE TABLE calls to find the column names, then the INSERT INTO rows to build the contents. But I'm sure there would be quite a few gotchas in doing this reliably. Does anyone know of a module which will do this?

    Read the article

  • PHP Connect to 4D Database

    - by Matt Reid
    Trying to connect to 4D Database. PHPINFO says PDO is installed etc etc... Testing on localhost MAMP system. However when I run my code I get: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /Applications/MAMP/htdocs/4d/index.php:12 Stack trace: #0 /Applications/MAMP/htdocs/4d/index.php(12): PDO->__construct('4D:host=127.0.0...', 'test', 'test') #1 {main} thrown in /Applications/MAMP/htdocs/4d/index.php on line 12 My code is: $dsn = '4D:host=127.0.0.1;charset=UTF-8'; $user = 'test'; $pass = 'test'; // Connection to the 4D SQL server $db = new PDO($dsn, $user, $pass); try { echo "OK"; } catch (PDOException $e) { die("Error 4D : " . $e->getMessage()); } Can't put my finger on the error, i'm using the settings under the PHP tab... Thank you.

    Read the article

  • get the current time in C

    - by Antrromet
    I want to get the current time of my system. For that i'm using the following code in C. time_t now; struct tm *mytime = localtime(&now); if ( strftime(buffer, sizeof buffer, "%X", mytime) ) { printf("time1 = \"%s\"\n", buffer); } But the problem of this code is that its giving some random time.Also the random time is different all the time.I want the current time of my system. Can anyone please tell me how to solve this issue?

    Read the article

  • Advantages of a deployment tool over shell

    - by Jimmy
    Currently I have all of my deployment scripts in shell, which installs about 10 programs and configures them. The way I see it shell is a fantastic tool for this: Modular: Only one program per script, this way I can spread the programs across different servers Simple: Shell scripts are extremely simple and don't need any other software installed One-click: I only have to run the shell script once and everything is setup Agnostic: Most programmers can figure out shell, and don't need to know how to use a specific program. Versioning: Since my code is on github a simple git pull and restart all of supervisor will run my latest code. My question is, with all of these advantages, why is it people are constantly telling me to use a tool such as ansible or chef, and not to use shell.

    Read the article

  • performance monitor in iis 7 to monitor which website is using most resources (asp.net)

    - by Karl Cassar
    I am using Windows Server 2008 R2 and IIS 7.5, and am hosting multiple websites on the same webserver. Is it possible to use Performance Monitor to know on average which website is using the most resources? I've added a user-defined Data Collector Set in Performance Monitor collecting data for 1 day. However, I could not find any details which hint which website is using the most resources. Which counters are crucial to monitor websites? The generated report tells me that the top process is w3wp##1 - how can I know which website it corresponds to? I've also tried to add counters for ASP.Net Applications for all object instances, however % Managed Processor Time (estimated) is 0 at all times.

    Read the article

  • Posting data from multiple servers routing through one server to client server

    - by Swaroop Kundeti
    I have 5 webservers behind Load balancer and we have a client server at other end. Client has white listed my 5 webserver public ip so that my webservers will post a file to the client server. Here the problem is my webservers is going to increase and i cannot always ask client to make my new webserver ip's white list. So i would like to make my infra this way, my webservers will post data to the client server routing from a single server. Like assume that web-1 is main server and the remaining 4 web servers will post data to client server routing through main web-1. I was told that this can be achieved by doing IP Tunneling. But i have no idea how to do that. Would be great for any kind of help.

    Read the article

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