Daily Archives

Articles indexed Saturday September 15 2012

Page 10/13 | < Previous Page | 6 7 8 9 10 11 12 13  | Next Page >

  • Edge flicker when moving Camera (2D)

    - by Matthias Reisner
    I have a Orthographic camera. I have a fixed landscape texture and a texture for a moveable object. If the object moves to the right the camera will also move with the object. When I also draw an score text that should have fixed position on the screen, that score text position will be update too if the camera's position gets updated so that it looks like that it is fixed on the screen. But if I do that, I have some edge flickering at the text object. I'am using SpriteBatch! Is there another approach to implement a fixed positioned object on the screen?

    Read the article

  • Best Way To Develop Robust Cross-Platform Application?

    - by Clay
    Windows C programmer here (going back to 1992 and Windows95 back when it was called Windows93). Can function in C++, but mostly still a C programmer. Looking to build a cross-platform casual game. Very numbers heavy with only a few artistic embellishments and animations, so perhaps a development environment for business apps might be the best option. Or an easy-to-use 2D game dev platform. Target platforms: Windows, Mac, MS Tablet, iPhone, iPad, Android. I currently develop on Windows with Visual Studio 2012, but we could spend up to $50K on hardware/software/middleware if necessary. Not very competent getting open-source software working. Would rather pay the money and jump right into app development. Recommendations?

    Read the article

  • How to code UI / HUD in Entity System?

    - by Sylpheed
    I think I already got the idea of the Entity System inspired by Adam Martin (t-machine). I want to start using this for my next project. I already know the basic of Entity, Components, and Systems. My problem is how to handle UI / HUD. For example, a quest window, skill window, character info window, etc. How do you handle UI events (eg. pressing a button)? These are stuff that doesn't need to be processed every frame. Currently, I'm using MVC to code UI but I don't think that'll be compatible for Entity System. I've read that Entity System is embedded on a larger OOP. I don't know if UI is outside of ES or not. How do I approach this one?

    Read the article

  • Well-tested libraries for player ratings?

    - by Lucky
    It's common in games to implement some sort of numerical ranking system -- the ELO system is usually used in chess. I could implement this system naively using Wikipedia's descriptions, but I suspect that this would open up a whole box of problems that have already been solved: rating inflation, etc -- for instance, the ELO system has a K constant that's 'fudged' according to rating, duration, pairings, statistics, ... What are some libraries (I'm looking at Python, but anything is okay) that implements rating systems? It also doesn't have to be ELO.

    Read the article

  • What platform were old TV video games developed on?

    - by Mihir
    I am very eager to know how TV video games (which we all used to play in our childhood) were developed and on which platform. I know how games are developed for mobile devices, Windows PC's and Mac but I'm not getting how (in those days) Contra, Duck Hunt and all those games were developed. As they have high graphics and a large number of stages. So how did they manage to develop games in such a small size environment and with lower configuration platform?

    Read the article

  • 3ds Max CAT to XNA

    - by user12214
    Has anyone successfully used the CAT bone system in 3ds Max and exported the file into XNA? If so, what was your method of doing so? There are a number of methods of doing this apparently, but the ones I've tried have not worked. I used the Panda Exporter which creates a .X file. This seems to be the latest way of going about this, but when it's loaded in XNA, there is an error saying something about the bone weights. This happens when I export with and without CAT bones.

    Read the article

  • CSS Zebra Stripe a Specific Table tr:nth-child(even)

    - by BillR
    I want to zebra stripe only select tables using. I do not want to use jQuery for this. tbody tr:nth-child(even) td, tbody tr.even td {background:#e5ecf9;} When I put that in a css file it affects all tables on all pages that call the same stylesheet. What I would like to do is selectively apply it to specific tables. I have tried this, but it doesn't work. // in stylesheet .zebra_stripe{ tbody tr:nth-child(even) td, tbody tr.even td {background:#e5ecf9;} } // in html <table class="zebra_even"> <colgroup> <col class="width_10em" /> <col class="width_15em" /> </colgroup> <tr> <td>Odd row nice and clear.</td> <td>Some Stuff</td> </tr> <tr> <td>Even row nice and clear but it should be shaded.</td> <td>Some Stuff</td> </tr> </table> And this: <table> <colgroup> <col class="width_10em" /> <col class="width_15em" /> </colgroup> <tbody class="zebra_even"> The stylesheet works as it is properly formatting other elements of the html. Can someone help me with an answer to this problem? Thanks.

    Read the article

  • gdb + nasm debug info not being created

    - by cpowel2
    I am relatively new to assembly language programming and am trying to debug a small .asm file that I wrote in Ubuntu. I am however running into an issue where my symbol table is not being loaded and was looking for some help. I am compiling my program as follows. nasm -f elf -g -F dwarf bs.asm gcc -m32 -g bs.o -o bs which produces the executable bs when I run gdb bs I get a message that says no debugging symbols and when I try to set a break point by b main it says function not defined even though its in the file and I can run it using ./bs I read a couple posts that suggested adding the -F dwarf when assembling but that didn't help if anyone has any insight I would greatly appreciated your input. Thanks in advance

    Read the article

  • Drop down select to change a second drop down select automatically

    - by zvzej
    I have a webpage where I have a form with several areas to input text and two drop down select options countries is the first one and depending in witch country is chosen the second should display the estates for that country to choose. my page connects to my db from where it gets the countries and estates.... I have a table with the country names and one table for each country estates. so all I'm trying to do is making it change the states to choose from automatically depending witch country got selected with out summiting the form since that enters a new entry to another table in my db. I seen that using javascript is the way to go but can't get it to work in my case since I don't want to be sent to another page or summit the form. here is part of my code any help will be greatly appreciated. Thanks $paissql = "SELECT * FROM Paises_table"; $paisresult = mysql_query($paissql); ?> <script language="text/javascript"> function showMe(str) { <? $estadosql = "SELECT * FROM ".str."_table"; $estadoresult = mysql_query($estadosql); ?> } </script> <TABLE BORDER="2" CELLPADDING="2" CELLSPACING="2" ALIGN="CENTER"> <form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST> <TR><th> id </th> <td><?php echo $row_to_edit['id']?></td> </TR> <TR><th>Nombre:</th><td><input type="TEXT" name=Nombre value="<?php echo $row_to_edit['Id_Nombre']?>" SIZE="100"></td></TR> </td></TR> <TR><th>Pais:</th><td> <select name=Pais onchange="showMe(this.value);" > <? while($rowp = mysql_fetch_array($paisresult)) { $pais = $rowp['Name']; ?> <option value=<?php echo $pais; ?> <?php if($row_to_edit['Pais']==$pais) { echo ' selected="true"';} ?> ><?php echo $pais; ?> </option> <? } ?> </select></td></TR> <TR><th>Estado:</th><td> <select name=Estado > <? while($rowe = mysql_fetch_array($estadoresult)) { $estado = $rowe['Estado']; ?> <option value=<?php echo $estado; ?> <?php if($row_to_edit['Estado']==$estado) { echo ' selected="true"';} ?> ><?php echo $estado; ?></option> <? } ?> <TR><th>Ciudad:</th><td><input type="TEXT" name=Ciudad value="<?php echo $row_to_edit['Ciudad']?>" SIZE="100"></td></TR> <TR><th>Website:</th><td><input type="TEXT" name=website value="<?php echo $row_to_edit['website']?>" SIZE="100"></td></TR> <TR><td> </td> <td> <input type="HIDDEN" name="id" value="<?php echo $edit_id?>"> Para agregar preciona aqui: <input type="SUBMIT" name="ACTION" value="AGREGAR"> </td> </TR> </form> </TABLE> <BR> <BR>

    Read the article

  • Monotouch Binding to Linea Pro SDK

    - by jeffrapp
    I'm trying to create a binding to the Linea Pro (it's the barcode scanner they use in the Apple Stores, Lowes) SDK. I'm using David Sandor's bindings as a reference, but the SDK has been updated a few times since January of 2011. I have most everything working, except for the playSound call, which is used to, well, play a sound on the Linea Pro device. The .h file from the SDK has the call as follows: -(BOOL)playSound:(int)volume beepData:(int *)data length:(int)length error:(NSError **)error; I've tried using int[], NSArray, and an IntPtr to the int[], but nothing seems to work. The last unsuccessful iteration of my binding looks like: [Export ("playSound:beepData:length:")] void PlaySound (int volume, NSArray data, int length); Now, this doesn't work at all. Also note that I have no idea what to do with the error:(NSError **)error part, either. I am lacking some serious familiarity with C, so any help would be extremely appreciated.

    Read the article

  • AddThis Social SignIn and Django

    - by piokuc
    I am developing a Django website. I've been using django-registration for user registration so far but I would really like to allow users to login to my site using their Facebook, Twitter, Google, etc accounts. I am using addthis sharing buttons. I just noticed they introduced a social sign in solution. The idea seems great, you integrate your authentication system with their service once, and your users can login via all of the popular social networking sites. Has anybody integrated addthis social signin plugin with a django website? How can you use it along side django-registration? Are there any similar, alternative solutions?

    Read the article

  • checkins/recent not returning comments or even counts of comments

    - by Gilbert
    My application has been using the checkins/recent endpoint to show where all the current users friends are currently at and I had included a button the user could press to comment on a checkin. The button used to have the comment count on it until recently. It seems the checkins/recent endpoint no longer returns comments or even a comment count for those checkins. I would have to query each checkin in order to get the comment count which adds to the data usage not to mention API usage counts. Is there another way to do this that I'm not seeing? Could you please at least put the comment count back? You have the photo information, why not comments? Thanks

    Read the article

  • Java UnknownFormatConversionException

    - by user1672458
    The code below is throwing this error, and I'm not sure why. It's clearly a problem with outputting String.format to the str variable, but I don't know what's wrong with it. Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = 'i' at java.util.Formatter$FormatSpecifier.conversion(Unknown Source) at java.util.Formatter$FormatSpecifier.<init>(Unknown Source) at java.util.Formatter.parse(Unknown Source) at java.util.Formatter.format(Unknown Source) at java.util.Formatter.format(Unknown Source) at java.lang.String.format(Unknown Source) at Donor.toString(Donor.java:41) at Donor.main(Donor.java:65) - import java.util.Scanner; public class Donor { public String name; public int age; public double donation; Donor() { //Initialized to these values for debugging name = "NoName"; age = 0; donation = 0; } Donor(String nameinit, int ageinit, double donationinit) { name = nameinit; age = ageinit; donation = donationinit; } public String toString() { String str = ""; str = String.format("%s-30%i-6$%d-20", name, age, donation); return str; } public static void main(String[] args) { Scanner input = new Scanner(System.in); String nameinit = null; int ageinit = -1; double donationinit = -1; String outp = null; System.out.print("Enter the donor's name: "); nameinit = input.nextLine(); System.out.print("Enter the donor's age: "); ageinit = input.nextInt(); System.out.print("Enter the donation amount: "); donationinit = input.nextDouble(); Donor d = new Donor(nameinit, ageinit, donationinit); outp = d.toString(); System.out.printf("%s30 %s6 %s10", "Name", "Age", "Donation"); System.out.print("\n" + outp); input.close(); } }

    Read the article

  • NodeJS + Express: res.redirect('back'); with params

    - by Ilya Rusanen
    I have register form on every page of my website. During registration some error may occur. After cathing error, I have to return user to previous page, showing some error tips. The problem is I dont know from which page user performs registration. That's why I use res.redirect('back');. However, I cant just redirect user back, I have to show him whats wrong. Thats why I have to pass some parameter. But res.redirect('back', (reg_error:'username')}) can not be used directly 'cause res.redirect() doesn't support parameters. How can I render prevous page with some parameter? Thanks!

    Read the article

  • Need help setting up json array

    - by torr
    A database query returns several rows which I loop through as follows: foreach ($query->result() as $row) { $data[$row->post_id]['post_id'] = $row->post_id; $data[$row->post_id]['post_type'] = $row->post_type; $data[$row->post_id]['post_text'] = $row->post_text; } If I json_encode the resulting array ($a['stream']) I get { "stream": { "1029": { "post_id": "1029", "post_type": "1", "post_text": "bla1", }, "1029": { "post_id": "1030", "post_type": "3", "post_text": "bla2", }, "1029": { "post_id": "1031", "post_type": "2", "post_text": "bla3", } } } But the json should actually look like this: { "stream": { "posts": [{ "post_id": "1029", "post_type": "1", "post_text": "bla1", }, { "post_id": "1030", "post_type": "3", "post_text": "bla2", }, { "post_id": "1031", "post_type": "2", "post_text": "bla3", }] } } How should I build my array to get this json right?

    Read the article

  • Can a real number "cover" all integers within its range?

    - by macias
    Is there a guarantee that a real number (float, double, etc) can "cover" all integers within its range? By cover I mean, that for every integer within its range there is such real number that this equality holds: real == int Or in another example, let's say I have the biggest real number which is smaller than given integer. When I add "epsilon" will I get this number equal to given integer or bigger than integer? (I know that among real numbers you should not write comparisons as == for equality, I am simply asking for better understanding subject, not for coding comparisons.)

    Read the article

  • How can I get my app ready for the iPhone 5

    - by RazorSharp
    Apple just announced the iPhone 5 with a 4 inch screen and a 16:9 aspect ratio. Of course, they only give developers two weeks to scramble to update their apps without being able to test. I'd like to update my app for the iPhone 5's new big screen, but there's nothing on Apple's developer site about the iPhone 5 or making your apps ready for a larger screen. It would be a pain to have to write my own logic for testing whether the device is an iPhone 5 and then displaying a custom storyboard file for it. Does anyone know how the new sizing works or if there are any hidden Xcode for this?

    Read the article

  • Better way to "find parent" and if statements

    - by Luke Abell
    I can't figure out why this isn't working: $(document).ready(function() { if ($('.checkarea.unchecked').length) { $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('checked').addClass('unchecked'); } else { $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('unchecked').addClass('checked'); } }); Here's a screenshot of the HTML structure: http://cloud.lukeabell.com/JV9N (Updated with correct screenshot) Also, there has to be a better way to find the parent of the item (there are multiple of these elements on the page, so I need it to only effect the one that is unchecked) Here's some other code that is involved that might be important: $('.toggle-open-area').click(function() { if($(this).parent().parent().parent().parent().parent().parent().parent().hasClass('open')) { $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('open').addClass('closed'); } else { $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('closed').addClass('open'); } }); $('.checkarea').click(function() { if($(this).hasClass('unchecked')) { $(this).removeClass('unchecked').addClass('checked'); $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('open').addClass('closed'); } else { $(this).removeClass('checked').addClass('unchecked'); $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('closed').addClass('open'); } }); (Very open to improvements for that section as well) Thank you so much! Here's a link to where this is all happening: http://linkedin.guidemytech.com/sign-up-for-linkedin-step-2-set-up-linkedin-student/ Update: I've improved the code from the comments, but still having issues with that first section not working. $(document).ready(function() { if ($('.checkarea.unchecked').length) { $(this).parents('.whole-step').removeClass('checked').addClass('unchecked'); } else { $(this).parents('.whole-step').removeClass('unchecked').addClass('checked'); } }); -- $('.toggle-open-area').click(function() { if($(this).parent().parent().parent().parent().parent().parent().parent().hasClass('open')) { $(this).parents('.whole-step').removeClass('open').addClass('closed'); } else { $(this).parents('.whole-step').removeClass('closed').addClass('open'); } }); $('.toggle-open-area').click(function() { $(this).toggleClass('unchecked checked'); $(this).closest(selector).toggleClass('open closed'); }); $('.checkarea').click(function() { if($(this).hasClass('unchecked')) { $(this).removeClass('unchecked').addClass('checked'); $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('open').addClass('closed'); } else { $(this).removeClass('checked').addClass('unchecked'); $(this).parent().parent().parent().parent().parent().parent().parent().removeClass('closed').addClass('open'); } });

    Read the article

  • Async friendly DispatcherTimer wrapper/subclass

    - by Simon_Weaver
    I have a DispatcherTimer running in my code that fire every 30 seconds to update system status from the server. The timer fires in the client even if I'm debugging my server code so if I've been debugging for 5 minutes I may end up with a dozen timeouts in the client. Finally decided I needed to fix this so looking to make a more async / await friendly DispatcherTimer. Code running in DispatcherTimer must be configurable whether it is reentrant or not (i.e. if the task is already running it should not try to run it again) Should be task based (whether or not this requires I actually expose Task at the root is a gray area) Should be able to run async code and await on tasks to complete Whether it wraps or extends DispatcherTimer probably doesn't really matter but wrapping it may be slightly less ambiguous if you don't know how to use it Possibly expose bindable properties for IsRunning for UI

    Read the article

  • Change Text on Landscape mode with Java Code and not XML (Android)

    - by Chowza
    I wrote my layout entirely in java code because it was just more convenient. (I had a lot of textViews and using for statements were more convenient). However, my TextViews require the day of the week and in portrait mode, I would like to cut the day of the week to a short form. For example, I want "Sunday" to show "Sun" for portrait mode, but "Sunday" for landscape mode. I understand how to do this in XML files, but how do I do it in code? I.e. sample code: LinearLayout parent = new LinearLayout(getApplicationContext()); parent.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT)); TextView example = new TextView; example.setLayoutParams(mparams); example.setText("Sunday"); //<--make this "Sun" when in portrait but "Sunday" in landscape parent.addView(example);

    Read the article

  • Import a number of csv files and replace NA by Zeros

    - by tao.hong
    I know how to do this individually. However, I have more than 1000 files. I decided to use a for loop. However, it seems like I did not find the correct way to evaluate my variables. Here is my code setwd('C:/data') filenames=dir() #find file names for (i in filenames){ adt = substr(x = i, start = 1, stop = nchar(i)-4) name=paste("data_", adt, sep="") assign(name, read.csv(i,header=T,sep=",")) #read each file and assign a variable name starting with data_ to it func=paste('name[is.na(name)] <- 0',sep="") # here is the place I have problem. R will not consider name is a parameter whose values change in each iteration eval((text=func)) }

    Read the article

  • Using regex and javascript to make links clickable but not overwrite pre-existing links?

    - by Lexsym
    I need to make links clickable using javascript and I thought regex would be the easiest not to mention fastest way. I want all links to be clickable, and to not rewrite the already clickable links that exist. Example: Here is a link to visit http://www.example.com/page Please take a look <a href="http://www.example.com/page">here</a>. Becomes: Here is a link to visit <a href="http://www.example.com/page">http://www.example.com/page</a> Please take a look <a href="http://www.example.com/page">here</a>. Another example: Here is a link to visit http://www.example.com/page Please take a look here: <a href="http://www.example.com/page">http://www.example.com/page</a> Becomes: Here is a link to visit <a href="http://www.example.com/page">http://www.example.com/page</a> Please take a look here: <a href="http://www.example.com/page">http://www.example.com/page</a>

    Read the article

  • Error in bisection method code in Matlab

    - by Amanda Collins
    I need to write a proper implementation of the bisection method, which means I must address all possible user input errors. Here is my code: function [x_sol, f_at_x_sol, N_iterations] = bisection(f, xn, xp, eps_f, eps_x) % solving f(x)=0 with bisection method % f is the function handle to the desired function, % xn and xp are borders of search, % f(xn)<0 and f(xp)>0 required, % eps_f defines how close f(x) should be to zero, % eps_x defines uncertainty of solution x if(f(xp) < 0) error('xp must be positive') end; if(f(xn)>0) error('xn must be negative') end; if (xn >= xp) error ('xn must be less than xp') end; xg=(xp+xn)/2; %initial guess fg=f(xg); % initial function evaluation N_iterations=1; while ( (abs(fg) > eps_f) & (abs(xg-xp) > eps_x) ) if (fg>0) xp=xg; else xn=xg; end xg=(xp+xn)/2; %update guess fg=f(xg); %update function evaluation N_iterations=N_iterations+1; end x_sol=xg; %solution is ready f_at_x_sol=fg; if (f_at_x_sol > eps_f) error('No convergence') end and here is the error message I receive when I try to test this in Matlab: >> bisection(x.^2, 2, -1, 1e-8, 1e-10) Attempted to access f(-1); index must be a positive integer or logical. Error in bisection (line 9) if(f(xp)<0) I was attempting to see if my error codes worked, but it doesn't look like they do. I get the same error when I try to test it on a function that should work.

    Read the article

  • Export a SQL database into a CSV file and use it with WEKA

    - by Simon
    How can I export a query result from a .sql database into a .csv file? I tried with SELECT * FROM players INTO OUTFILE 'players.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY ';';` and my .csv file is something like: p1,1,2,3 p2,1,4,5 But they are not in saparated columns, all are in 1 column. I tried to create a .csv file by myself just to try WEKA, something like: p1 1 2 3 p2 1 4 5 But WEKA recognizes p1 1 2 3 as a single attribute. So: how can I export correctly a table from a sql db to a csv file? And how can I use it with WEKA?

    Read the article

  • Create class instance in assembly from string name

    - by Arcadian
    I'm not sure if this is possible, and I'm quite new to using assemblies in C#.NET. What I would like to do is to create an instance of a class when supplied the string name of that class. Something like this: using MyAssembly; namespace MyNameSpace { Class MyClass { int MyValue1; int MyValue2; public MyClass(string myTypeName) { foreach(Type type in MyAssembly) { if((string)type == myTypeName) { //create a new instance of the type } } AssignInitialValues(//the type created above) } //Here I use an abstract type which the type above inherits from private void AssignInitialValues(AbstractType myClass) { this.value1 = myClass.value1; this.value2 = myClass.value2; } } } Obviously you cannot compare strings to types but it illustrates what I'm trying to do: create a type from a supplied string. Any thoughts? EDIT: After attempting: var myObject = (AbstractType) Activator.CreateInstance(null, myTypeName); AssignInitialValues(myObject); I get a number of errors: Inconsistent accessibility: parameter type 'MyAssembly.AbstractType' is less accessible than method 'MyNameSpace.MyClass.AssignInitialValues(MyAssembly.AstractType)' 'MyAssembly.AstractType' is inaccessible due to it's protection level The type or namespace name 'MyAssembly' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'AbstractType' could not be found (are you missing a using directive or an assembly reference?) Not exactly sure why it can't find the assembly; I've added a reference to the assembly and I use a Using Directive for the namespace in the assembly. As for the protection level, it's calling classes (or rather the constructors of classes) which can only be public. Any clues on where the problem is? UPDATE: After looking through several articles on SO I came across this: http://stackoverflow.com/a/1632609/360627 Making the AbstractTypeclass public solved the issue of inconsistent accessibility. The new compiler error is this: Cannot convert type 'System.Runtime.Remoting.ObjectHandle' to 'MyAssembly.AbstractType' The line it references is this one: var myObject = (AbstractType) Activator.CreateInstance(null, myTypeName); Using .Unwrap() get's me past this error and I think it's the right way to do it (uncertain). However, when running the program I then get a TypeLoadException when this code is called. TypeLoadException: Could not load type ‘AbstractType’ from assembly ‘MyNameSpace'... Right away I can spot that the type its looking for is correct but the assembly it's looking in is wrong. Looking up the Activator.CreateInstance(String, String) method revealed that the null as the first argument means that the method will look in the executing assembly. This is contrary to the required behavior as in the original post. I've tried using MyAssembly as the first argument but this produces the error: 'MyAssembly' is a 'namespace' but is used like a 'variable' Any thoughts on how to fix this?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13  | Next Page >