Posts

jquery - Play sound when receiving a web chat message -

how can add simple sound when message arrives in web chat session jquery? i noticed on chat @ http://chat.stackoverflow.com , want emulate in own software. jplayer allows this, , avoid flash (with html5 <audio> tag). edit: drachenstern noted in comments, chat uses jplayer. code chat page: <div id="jplayer" style="position: absolute; top: 0px; left: 0px;"> <embed name="jqjp_flash_0" id="jqjp_flash_0" src= "http://or.sstatic.net/chat/jplayer.swf" width="0" height="0" bgcolor="#ffffff" quality="high" flashvars="id=jplayer&amp;fid=jqjp_flash_0&amp;vol=80" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage= "http://www.macromedia.com/go/getflashplayer" /> <div id="jqjp_force_0" style="text-indent: -9999px;"> 0.7310569109395146 </div> </...

java - Issue to call setMessage() on ProgressDialog -

i'm having issue creating progressdialog in oncreatedialog() method. code follows: dialog dialog; switch(id){ case connecting: dialog = new progressdialog(this); dialog.setmessage("connecting").settitle(""); return dialog; eclipse throws me error setmessage wouldn't valid method of type progressdialog, though expect there since documentation api8 (which use) says so. afaik instantiation should possible since progressdialog ihnerits dialog right? can me @ this? it's weird. you need change code to: dialog dialog; switch(id){ case connecting: dialog = new progressdialog(this); ((progressdialog)dialog).setmessage("connecting"); dialog.settitle(""); return dialog; alliteratively, can change dialog type progresssdialog if returning progresssdialog, doubt it.

c++ - Adding All Array Elements Together -

i wanted know how add of elements of float array , make sum float average;. have use loop or there way add element 0 1 2 3, etc.? you may use loop, or can use std::accumulate . #include <iostream> #include <numeric> int main() { float arr[17] = { 1, 2, 3, }; //sum array const float sum = std::accumulate(arr, arr+17, 0.0 ); std::cout << "sum: " << sum << "\n"; std::cout << "average: " << sum/17 << "\n"; }

iphone - Draw a 3x3 grid in Cocoa-Touch -

i plan on making main menu application contains 9 square boxes in 3x3 grid fashion. i appreciate if give me ideas on how create , if applicable tutorials/source code on how create effect. i recommend aqgridview . see examples, included.

mysql select statement result limit -

i have query: select id, name categories parent_id in ( select id categories top_main_place > 0 ) it selects child info (outer select) of parent nodes (inner select) the problem is: don't need have child nodes data, maximum 6 child nodes data per parent id how can reach result? btw, sorry poor english you should order outer query parent_id, give each row row number (resetting row number whenever parent_id changes) , filter out row row number greater 6, check out this question example , sql code.

graphics - DirectX10 Skydomes -

i'm trying implement skydome in directx10 having real problems trying find tutorial online how go this. looked through 4 pages of results got looking "directx10 skydomes" in search function. does here know of site/books/tutorials etc can me in production of creating semi-decent looking skydome? sdks directx, ogre3d , possibly scenix include demos sky-boxes , sky-domes. conceptually they're simple (use large inward facing hemisphere or box , move model camera (eye) position never move relative it). quick google yielded tutorial in ogre3d wiki goes more detail concept http://ogre3d.org/tikiwiki/tiki-index.php?page=basic+tutorial+3#sky steps are: 1. create large hemisphere model (flip normals have face inwards). 2. map "fish-eye" sky texture 3. load , render in directx non-lit shader (so no shading applied... sky texture).

c# - How do I progressively render a header before content in ASP.NET master pages? -

i have large slow asp.net site uses master pages. i've identified user have better experience if can see header , navigation while rest of page being generated/processed/loaded database. i've done simple tests , can response.write() followed response.flush() in page_load(), , iis use chunked encoding , send output browser while rest of page renders. i want same thing, send master page header , navigation. any pointers on how achieve this? using asp.net 4 , iis 7.5 edit if can give pointers on how change site use ajax without having change every page , link, i'd appreciate it. thanks! i suggest use control caching. asp.net provides native caching of pages , controls. see these links know more. asp.net caching: techniques , best practices http://msdn.microsoft.com/en-us/library/aa478965.aspx asp.net caching http://msdn.microsoft.com/en-us/library/xsbfdd8c(v=vs.100).aspx control caching as have mentioned, appears use page-caching. try u...