Posts

javascript - Creating web application using ruby only without using any framework -

i have develop application in ruby without using framework (rails, sinatra, shoes n all). there way can create html pages, css files , call ruby script on click of button. there method it. why want this? frameworks take away of hard work you. if want extremely lightweight, use rack. everything need should there, or dig source code @ https://github.com/rack/rack started

android - How to implement card layout as in new Google Play -

Image
i implement androidy list tile layout new google play below: don't need implement exact content, tile-like layout of list items. know attributes should set, such color, margin, , how set subtle shadow below each item? i have following listview <listview android:id="@+id/cardlist" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margintop="6dp" android:background="@color/light_gray" android:cachecolorhint="@null" android:divider="@null" android:fadingedge="none" android:listselector="@android:drawable/selector" /> and selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/pressed" android:state_pressed="true"/> ...

java - Synchronizing on a passed object, JFrame is freezing -

i created jframe contains , internalframe draws figures moving(each figure thread ) wanted pausebutton make pause, wanted synchronize them on passed object. but when hit pause button whole window freezing , cannot hit play button thing 1 running @ time, want them running pause. class extends jframe{ .... object o = new object(); jbuttton pausebutton = new jbutton("pause"); jbuttton playbutton = new jbutton("play"); b b = new b(o); pausebutton.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent arg0) { synchronized (synchronizator) { try { synchronizator.wait(); } catch (interruptedexception e) { e.printstacktrace(); } } } }); playbutton.addactionlistener(new actionlistener() { @ov...

php - Retrieve data from MySQL database after jQuery autocomplete -

have implemented on site jquery autocomplete function works well. however, use result autocomplete retrieve selected person's telephone number database. the database structure this; id | name | type | tel | mobile | email | level =============================================== 1 | john smith | judge | 01234 567890 | 07812 345678 | jsmith@example.com | bs 2 star here updated code far autocomplete function <script> jquery(document).ready(function($) { $('#inputchiefjudge').autocomplete({ source:'lookups/shows-sj-searchforjudge.php', change: function (event, ui) { $.ajax({ type: post, url: 'lookups/shows-sj-findtel.php', data: 'id='+ id, success: function(data) { details = $.parsejson(data); $('#inputchiefjudge').text("hello"); $('#chiefjudgetel').text(d...

javascript - addthis.toolbox() method: buttons cut off and alt text displaying -

as i'm doing jquery html replacement on responsive design, suggested use addthis.toolbox method instead of init method addthis. even though code specifying 32x32 pixel buttons they're getting displayed bottom half of graphic cut off , alt text displaying. here's code: <div id="zazoo" class="addthis_toolbox addthis_default_style addthis_32x32_style"> <a class="addthis_button_facebook_follow" addthis:userid="example"></a> <a class="addthis_button_twitter_follow" addthis:userid="example"></a> <a class="addthis_button_google_follow" addthis:userid="xx"></a> <a class="addthis_button_youtube_follow" addthis:userid="example"></a> </div> <script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=example&async=1"> </script> <script type="text/javascript"> addthis.toolbox(...

javascript - JSON encoding by browser -

i sending below json response: { "employees": [ { "firstname":"john" , "lastname":"doe" }, // response json { "firstname":"peter" , "lastname":"jones" } ] } but browsers interpreting above json { "firstname":"john" , "lastname":"doe" }, // interpreted json { "firstname":"peter" , "lastname":"jones" } it trailing out wrapped object of json. i thought because default, first tag read. however,that can still loop through records, since still in array format. to prevent this, should include tag, example: { "data":{ "employees":[ { "firstname":"john", "lastname":"doe" }, { "firstname":"peter", "lastname"...

c# - Ragdoll joint angle constraints -

i doing c# project on ragdolls based on thomas jakobsen's article http://www.gpgstudy.com/gpgiki/gdc%202001%3a%20advanced%20character%20physics i have converted logic 2d , seems working having problems implementing angle constraints. this code using @ moment: public static void satisfyangleconstraint(particle p1, particle p, float minangle, float maxangle) { float a1 = (float)math.atan2(p1.m_x.x - p1.getfixpoint().x, p1.m_x.y - p1.getfixpoint().y); float a2 = (float)math.atan2(p.m_x.x - p.getfixpoint().x, p.m_x.y - p.getfixpoint().y); float diffangle = a2 - a1; game.currentgame.window.title = "a " + diffangle; //vector2 oldposition = p.m_x; if (diffangle > maxangle) p.m_x = rotatepoint(p.m_x, p.getfixpoint(), (diffangle - maxangle)); else if (diffangle < minangle) p.m_x = rotatepoint(p.m_x, p.getfixpoint(), (diffangle - minangle)); //p.m_oldx += p.m_x - oldposition; } particles p1 , p joints , getfixpoint()...