Posts

c++ - Odd results using glTexImage2D -

c++ - Odd results using glTexImage2D - i've been trying figure out how glteximage2d works , seeing odd results pretty clear-cut code. code draws rough circle 256*256 length unsigned array , sends info out become texture. texture displayed turning out variations of reddish , orange no matter combinations select within image creation loop: unsigned* info = new unsigned[256*256]; (int y = 0; y < 256; ++y) (int x = 0; x < 256; ++x) if ((x - 100)*(x - 100) + (y - 156)*(y - 156) < 75*75) data[256*y + x] = ((156 << 24) | (256 << 16) | (156 << 8) | (200 << 0)); else data[256*y + x] = 0; // i'd expect transparent , above transparent , green, it's reddish somehow. glbindtexture(gl_texture_2d, texid); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_linear); gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_linear); glteximage2d(gl_texture_2d, 0, gl_rgba8, 256, 256, 0, gl_rgba...

java - Spring 3 wrongly binding request data on all model attributes -

java - Spring 3 wrongly binding request data on all model attributes - i have page submits data. submited fields include id parameter. <form:form modelattribute="command" action="info.html"> <form:input path="id"/> ... </form:form> my comand object pojo such id field: public class mycommand { private integer id; public integer getid() { homecoming id; } public void setid(integer id) { this.id = id; } .... } this annotated in controller this: @modelattribute("command") public mycommand initializecommand() { homecoming new mycommand(...); } while handler method looks this: public void handle(@modelattribute("command") mycommand cmd, ...) when submit form, spring binds parameters command object. binds parameters every object found in model (to model attributes) has id property. example, bean like: public class foobar { private integer ...

java - UTFDataFormatException and ClassNotFoundException when adding an image to Liferay portlet -

java - UTFDataFormatException and ClassNotFoundException when adding an image to Liferay portlet - i utilize liferay 5.2.3 on tomcat 5.5. added tag <img alt="g.png" src="<%= request.getcontextpath() %>/images/g.png"> to 1 of jsps dispatch portlet to, , received: class="lang-none prettyprint-override"> error [http-8080-processor22] (standardwrappervalve.java:253) servlet.service() servlet jsp threw exception java.io.utfdataformatexception: invalid byte 1 of 1-byte utf-8 sequence. @ org.apache.jasper.xmlparser.utf8reader.invalidbyte(utf8reader.java:621) @ org.apache.jasper.xmlparser.utf8reader.read(utf8reader.java:492) @ org.apache.jasper.xmlparser.xmlencodingdetector.load(xmlencodingdetector.java:1000) @ org.apache.jasper.xmlparser.xmlencodingdetector.skipstring(xmlencodingdetector.java:951) @ org.apache.jasper.xmlparser.xmlencodingdetector.scanxmldecl(xmlencodingdetector.java:1209) ...

android - Custom listview with two buttons in each row -

android - Custom listview with two buttons in each row - i have spent literally 2 days trying sort issue. if help massively appreciative. what i'm trying achieve: have listview, whereby player can add together new entries (players), through text field (for player name), , submit button. in each field of listview, display player name, , 2 imagebuttons. 1 male symbol, , 1 female symbol. male symbol toggled default, , user can set player beingness male or female toggling either male button or female button. finally, 1 time user moves onto next screen (a new activity), application save player names , attached sex form of storage , proceed next activity. what have achieved: i have simple array adapter, upon player adding new player name list, run notifydatasetchanged() on it. adapter set utilize custom row layout file. within layout file, looks this: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas....

c# - Trigger SelectedIndex changed whilst clicking on any control within a ListBoxItem area -

c# - Trigger SelectedIndex changed whilst clicking on any control within a ListBoxItem area - i've info template listboxitem contains of few buttons, , few custom controls grid or chart. each button bound appropriate command handler, selectedindex property of listview command bound viewmodel's propery well. the problem: in command handlers (which bound buttons) can't resolve selected item/index because not changing whilst clicking on button or other command within listbox item, when clicking on listboxitem area - selectedindex changing. question is how trigger selectedindex changed whilst clicking on command within listboxitem? add listbox.resources <listbox.resources> <style targettype="{x:type listboxitem}"> <style.triggers> <trigger property="iskeyboardfocuswithin" value="true"> <setter property="isselected" value="true" /> ...

authentication - Login System using PHP -

authentication - Login System using PHP - i'm new in php. newbie, started first project. made login scheme webapp. there's problem. when seek access index or main page, asks login, when i'm seek access other page, doesn't inquire me login. how can manage same restriction pages? login code here. <? $connection=mysql_connect("localhost","admin",""); if(!$connection) { die("database connection failed: " . mysql_error()); } //select database utilize $db=mysql_select_db('vss',$connection); if(!$db) { die("database selection failed: " . mysql_error()); } $username=$_post['username']; $password=$_post['password']; // $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); // $query="select *from user username='$username'and password='$password'...

javascript - Callbacks not working properly -

javascript - Callbacks not working properly - i'm @ loss. in code, #options should wind fading in, doesn't. css attributes set, though. $("#content > p").animate({ opacity: '0' }, function() { $(this).css("display", "none"); $("#options").css("opacity", "0").show(0, function() { $("#options").fadein(); }); }); the opacity still beingness set 0 . you can alter fadein() to... $("#options").animate({ opacity: 1}, 500); jsfiddle. javascript callback jquery-callback