Posts

Showing posts from January, 2012

Possible memory leak in android. Might be using the wrong cleanup method, or missing something -

i have memory leak. here's code package fourguys.testing.intenttest; import android.app.activity; import android.media.mediaplayer; import android.os.bundle; import android.os.handler; import android.os.message; import android.media.mediaplayer; import android.media.audiomanager; import android.content.context; public class canvasdrawingactivity extends activity { private static final int fire = 0; private int initvolume = 0; private handler handler; private mycanvas v; private mediaplayer mp; private audiomanager am; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); = (audiomanager)this.getsystemservice(context.audio_service); // method gets current volume setting music initvolume = am.getstreamvolume(audiomanager.stream_music); am.setstreamvolume(audiomanager.stream_music,100,audiomanager.flag_remove_sound_and_vibrate); mp = mediaplayer.creat...

sql server - Is it possible to Add column to multiple table simultaneously? -

i using sql server. want add single column named [datecreated] multiple tables. possible single statement add column tables in database? i stumble upon answer joe steffaneli in suggested query in turn returns rows consisting alter table statements. query follows : select 'alter table ' + quotename(s.name) + '.' + quotename(t.name) + ' add [datemodified] datetime' sys.columns c inner join sys.tables t on c.object_id = t.object_id inner join sys.schemas s on t.schema_id = s.schema_id left join sys.columns c2 on t.object_id = c2.object_id , c2.name = 'datemodified' c.name = 'datecreated' , t.type = 'u' , c2.column_id null /* datemodified column not exist */ is there way can execute returned rows? sorry english. you need this. check script want before running (adds non null column default value of getdate() )! declare @dy...

syntax - Simple Javascript if statement problem -

i'm sure solution glaringly obvious, i've spent hour faffing appreciate help! the following javascript meant make div visiable , div invisible if variable loggedin="true": /* javascript */ function showarticle() { document.getelementbyid('full').style.display = 'block'; document.getelementbyid('summary').style.display = 'none'; } var loggedin="true"; var owned="true"; if (loggedin="true") { document.write("logged in"); } if (owned="true") { showarticle(); } . <!-- html --> <div id="summary">lorem ipsum dolor sit amet, consectetur adipisicing elit.</div> <div id="full" style="display:none;">lorem ipsum dolor sit amet, consectetur adipisicing elit. nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur. <div> am right in thinking issue calling of showarticle function? ...

java - DBUnit and Oracle JDBC (ClassCastException) -

i want dump test db raw xml file using dbunit , i'm getting classcastexception. below code: new flatxmlwriter(new fileoutputstream("expected_ds.xml")). write(getdbunitconnection().createdataset(new string[]{"tab1","tab2"})); and result : java.lang.classcastexception: org.apache.commons.dbcp.delegatingresultset cannot cast oracle.jdbc.oracleresultset i'm using ojdbc14-10.2.0.3.0.jar, commons-dbcp-1.2.2.jar , dbunit-2.4.7.jar. is bug in oracle jdbc ? in ojdbc driver have found sth that: /** * * todo unittests missing * @author phil barr * @author last changed by: $author: jbhurst $ * @version $revision: 1072 $ $date: 2009-10-12 19:46:45 +0200 (lun, 12 ott 2009) $ * @since 2.4.0 */ public class oraclexmltypedatatype extends blobdatatype { public object getsqlvalue(int column, resultset resultset) throws sqlexception, typecastexception { byte[] data = new byte[0]; oracleresultset oracler...

c++ - char* to std::string -

i have character array (char* pdata) in c++, want copy data (from pdata) in std::string. code looks this: std::string ssomedata(pdata+8);//i want copy data starting index 8 till end the problem when above statement executes string contains nothing in it. guess pdata not terminated '\0' thats why not working. regards, jame. if know size of pdata , can use construct-from-iterators constructor: std::string ssomedata(pdata + 8, pdata + size_of_pdata);

silverlight 4.0 - Using Framework Entities, when Include a linked table then Orderby -

i have query made in framework entities uses int id passed in, brings correct question 1 table , brings corresponding answers table using include. what want happen included answers ordered id's. have searched not found answer works. code below original query works orderby inserted. orderby achieves nothing. how answers in order in database, id's? public question getquestionbyid(int id) { question questions; using (var context = new entities()) { questions = context.questions.include("answers").orderby(answer => answer.id).first(question => question.id == id); return questions; } } you can't (to knowledge) questions = context.questions.include("answers") .orderby(answer => answer.id) .first(question => question.id == id); the parameter pass orderby here ( answer => answer.id ) misleading: you're ordering questions, not answers. clarify, write t...

Creating installer for a c++ windows service Dynamically -

i have created windows service checks status of printer. user can download service website. need query status of printers used user. when user clicks on download button want store user information in file service can use. service use information fetch printers database. want include file in installer. have create installer @ runtime(i.e. when user click download button on website). how can create installer win service dynamically using c#? note: win service written in c++. know wix. in wix can create custom actions arbitrary code write (you provide .dll can built using c++). in custom action can generate user/location customization file.

maven - Snapshot and artifacts -

i new build process. can give me details snapshot , artifacts. the best source remains sonatype books on maven (and on product nexus ;) see their list of other resources ) for instance: release , snapshot repositories a repository stores 2 types of artifacts: releases , snapshots. release repositories stable, static release artifacts. snapshot repositories updated repositories store binary software artifacts projects under constant development.

c# - Window Operator does not work with itself? -

i have bit of code expect work in way, , doesn't, wondering doing wrong : class program { static void main(string[] args) { var ints = observable.interval(timespan.frommilliseconds(1000)); var windowed = ints.window(() => ints.select(i => / 3).distinctuntilchanged()); windowed.subscribe(handlenewwindow); console.readline(); } public static void handlenewwindow(iobservable<long> ints) { console.writeline("new sequence received"); ints.subscribe(console.writeline); } } output should : new sequence received 0 1 2 new sequence received 3 4 5 new sequence received 6 7 8 ... but : new sequence received 0 new sequence received 1 new sequence received 2 new sequence received 3 new sequence received 4 new sequence received 5 new sequence received 6 ... note if use different line define window, such : var windowed = ints.window(() => observable.interval(timesp...

elf - Creating a relocatable shared library with binutils -

i have custom toolchain generates relocatable shared libraries. works equally custom elf loader loads these memory, fixing them up. trying persuade gcc , binutils produce elf files compatible loader. unfortunately, appear binutils refusing generate relocatable shared objects. it'll generate pic shared objects, don't want due overhead of got/plt (and besides, custom elf loader doesn't support it). , it'll generate relocatable objects, they're not dynamic objects , don't have appropriate sections elf loader wants able load them. i'm not clear why gnu ld refuses allow me specify --relocatable , -shared on same command line. can enlighten me? , know incantation make ld generate object files i'm looking for? i see nobody has answered question, think i'll try. i'll try show how works means of practical example. here c code, has artificial purposeful mix of external global functions , data -- bread , butter of relocations. /* hell...

iphone - How to change truncate characters in UILabel? -

when text of uilabel gets truncated there 3 dots inserted default. possible change these characters or disable them? why dont code count length of string , makes substring if exceeding view. or want raw effective method

local storage - Using localStorage in store in Sencha Touch -

i'm trying build store elements localstorage in sencha touch application. the localstorage want data localstorage["feeds"] , looks this: "[{"title":"title 1","url":"http://stackoverflow.com"}, {"title":"title2","url":"http://google.com"}]" i'm trying store following: var feedspanel; var store; ext.setup({ icon: 'icon.png', glossonicon: false, onready: function(){ ext.regmodel("feedmodel", { fields: [ { name: "title", type: "string" }, {name: "url", type:"string"} ] }); store = new ext.data.store({ proxy: new ext.data.localstorageproxy({ id: 'feeds' }), model:"feedmodel" }); when in chrome try store.load(), fails because of typeerror: cannot read property 'title' of null. ho...

iphone - What's the difference between these Objective C method styles? -

there seems 2 standard ways of writing methods in objective c, , can't quite grasp difference , why 1 used rather other. example, uiwebviewdelegate: - (void)webviewdidfinishload:(uiwebview *)webview { } - (void) webview:(uiwebview *)webview didfailloadwitherror:(nserror *)error { } why isn't second 1 written webviewdidfailloadwitherror, or why doesn't first 1 match second style? another example, time uitableviewdatasource: - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return 0; } how come numberofsectionsintableview doesn't follow same format other methods? i'm sorry if simple question - it's been bugging me while , i'd clear in head! thanks in advance help. it comes down number of arguments. pretty every delegate method passes sender of method first argument. if method not need further arguments...

jsf primefaces datatable filtering issues -

i using primefaces , datatable. few columns dates or currencies. if try filter those, there awkward behaviours. when start typing filter works until first delimiter (dot date example, filters 11. next character let table display no entry). is possible apply dateconverter? here code now: <p:column filterby="#{cou.startdate}" headertext="#{text['date']}" filtermatchmode="contains" sortby="#{cou.startdate}" > <h:outputtext value="#{cou.startdate}" > <f:convertdatetime pattern="dd.mm.yyyy" /> </h:outputtext> </p:column> instead of directly using cou.startdate model, can instead following: create new transient property in model class. @transient private string dateforfilter; public string getdateforfilter() { return dateforfilter; } public void setdateforfilter(string dateforfilter) { this.dateforfilter = dateforfilter; } cre...

css - Required Field Indicator not working in IE7 and IE6 -

i'm using cakephp's field validation , standard css based 'required field' indicator (red asterisk) , works peachy browsers except (of course) ie7 , ie6. i seems don't css constructs indicator. found blog post mark story (here http://mark-story.com/posts/view/hacking-the-cakephp-formhelper-adding-required-indicators ) 2008 suggests hacking cake code display correctly. having been more 2 years ago, hope better solution has been created or had been addressed somehow in newer versions of cake released then. it's such standard thing can't imagine hasn't been addressed. i'm not finding obvious here @ stackoverflow or google searches @ large. being dense , missing obvious? there standard/easy way or image based fix (as suggested 1 of commenters of above mentioned post) way go? you make field bold or that

search - Which PHP data structure for quick single VALUE lookups with unique KEY? -

i have dynamically generated list of url's our internal network. each url, want to: find ip of url. compare ip list of ip's , associated server. return server associated ip. the ip of course unique in list of ip's, there recommended way store list of ip values can supply ip (key) , associated server (value)? i've looked @ multidimensional arrays, or brute force -- create array each individual server's ip list -- seems inefficient. here php want have (psuedo): $ipserverlist = array(0 => array(ip=>1.2.3.4,server=>"server1"), 1 => array(ip=>2.1.3.4,server=>"server2"), 2 => array(ip=>3.1.3.3,server=>"server1")); getserver("url1.mycoolurl.com"); function getserver($url) { $ip = gethostbyname($url); "search $ipserverlist $ip , return 'server' value" // } are there specific ways should storing ip/server list? recommended built in php functio...

Struts2 & jquery - custom pagination - how to go to page2 without hitting the db again -

thanks in advance input. using struts2 , jquery in app. i tried use displaytag pagination tables have images , there wasn't way make displaytag work images. so have custom coded pagination uses <s:subset> works great far except don't know how make go page. basically in <s:subset> want change start attribute , refresh jsp. code evaluates start attribute correctly given page number. my s:subset tag below, <s:subset source="pageablelist.pagedlist" count="pageablelist.pagesize" start="pageablelist.start" > <s:iterator> i think want use <s:url> display clickable page numbers i'm having trouble there. i have page numbers in list (which evaluate in action class right after search completes), in jsp need display clickable page numbers, iterate through list, displaying page numbers below - <s:iterator value="pagenumlist" > | <a href='#'> <s:property/>...

ASP.NET / AJAX Download Manager? -

i have asp.net page loggd in user goes , theres bunch of dynamically generated links zip files or owns , can downloads. currently click download , have no way of knowing if completes succesfully etc can't log it. log attempt. is there download manager or solution can use have progress bars on site, can queue multiple ones , most importantly can track failed , successful downloads. thanks! you cannot pure asp.net , ajax browser sandbox doesn't give access users computer save files. so need use sort of plugin. here's activex plugin want works in ie , expensive. wouldn't go there... as using asp.net, better option write own download utility in silverlight. bare in mind though, you'll annoy of users forcing them use downloader , take considerable effort high speed, robust downloader can compete existing browser download managers out there. eg free download manager

xpath - Parse XML structure in .net 2 -

i have following xml fragment <converters c1="xxx" c2="zzz"> <converter c1="yyy" c2="zzz" buy="0.99899070428571424" sell="0.99966215285714288" /> <converter c1="xxx" c2="yyy" buy="1.5503238471428571" sell="1.550773867142857" /> <converter c1="xxx" c2="zzz" buy="1.5487591119281807" sell="1.5502499426226253" /> </converters> i trying retrieve value of number in "buy" attribute converter has c1="xxx" , c2="zzz". i can't use linq xml unfortunatley or easy (for me). guess stuck using xpath i've created xpathnavigator can't syntax valu want anyone, idea how this? if use xpathdocument can do foreach (xpathnavigator buy in new xpathdocument("input.xml").createnavigator().select("converte...

asp.net mvc - value provider and collections -

i'd access in actionfilter property. propert collection. usually access values using valueprovider this filtercontext.controller.valueprovider.getvalue("prop"); but isn't working in case of collection. is there way collection ? you use filtercontext.actionparameters . example: model: public class myviewmodel { public ienumerable<string> collection { get; set; } } action filter: public class myactionfilterattribute : actionfilterattribute { public override void onactionexecuting(actionexecutingcontext filtercontext) { var value = filtercontext.actionparameters["model"]; // todo: value base.onactionexecuting(filtercontext); } } controller: public class homecontroller : controller { [myactionfilter] public actionresult index(myviewmodel model) { return view(); } } request: /?collection[0]=foo&collection[1]=bar

Jquery conflict? Quicksand vs. Gallerific cancel eachother -

im using galleriffic (a dynamic gallery jquery plug) , quicksand (a jquery filtering plug). here working example: http://www.metropoliscreative.com/jake_test/test1.html if click thumbnails, load in big pane. if select project type or industry, sort thumbnails based on data types. however, issue once sort them, galleriffic functionality stops working. i'm not getting errors in console, nor code changing once sort thumbnails(from can see in inspector). i'm not sure issue be. thank in advance help. as far aware, jquery events attached elements upon page load, if thumbnails being created dynamically - jquery hasn't attached galleriffic functionality them. way round it, re-attach gallerific functionality on callback after quicksand has finished calling in new thumbnails. $quicksand.quicksand($filtereddata, { duration: 1000, easing: 'easeinoutquad', adjustheight: 'false' }, function() { $('#thumbs').galleriffic({ ...

Jquery stop form submit unless checkbox selected -

i've got code, doesn't seem return true. alert shows up. thoughts (without needing create var in store checkbox has been selected seems bit hacky). thanks. $("#form").submit(function(e) { $('input[type=checkbox]').each(function () { if(this.checked){ return true; } }); alert("please select @ least 1 upgrade."); return false; }); you don't need loop determine if checkbox checked. :checked selector filters out not checked. can use $.length count of checked inputs. $("#form").submit(function(e) { if(!$('input[type=checkbox]:checked').length) { alert("please select @ least 1 upgrade."); //stop form submitting return false; } return true; }); additionally, using approach, small change should make work $("#form").submit(function(e) { $('input[type=checkbox]').each(function () { if($(this)....

ios - Does anyone have any examples on how to create a path using MKOverlayPathView? -

i've been looking @ apple's ios class reference documentation, , unfortunately none wiser. have downloaded sample code kmlviewer they've overcomplicated it... want know how generate path , add mkmapview . documentation talks of using cgpathref , doesn't explain how. could or point me in right direction please? thanks! here's how generate path , add overlay mkmapview . i'm going use mkpolylineview , subclass of mkoverlaypathview , shields having refer cgpath since instead create mkpolyline (containing data of path) , use create mkpolylineview (the visual representation of data on map). the mkpolyline has created c array of points ( mkmappoint ), or c array of coordinates ( cllocationcoordinate2d ). it's shame mapkit doesn't use more advanced data structures such nsarray , it! i'm going assume have nsarray or nsmutablearray of cllocation objects demonstrate how convert c array of data suitable mkpolyline . array called locatio...

Android List view color change -

i having list view in wanna change color when user clicks or scroll down on list.. included listselector in xml attributes not working.. there way color change when list scroll down.. my code : <listview android:id="@+id/allcity" android:listselector="@drawable/list" android:cachecolorhint="#00000000" android:layout_width="fill_parent" android:layout_height="fill_parent" /> where drawable/list blue background image..

iphone - Fade bottom of UIWebView using CSS -

i'm trying fade out bottom of uiwebview in detailview. it's more fading last 20-40 px. i'm using csstricks code "readmorefade" ( link ). simplified version pasted below. my problem when start scrolling in uiwebview, faded area stays there block. i'm attaching screenshot shows this. suggestions or hints? thank you. screenshot: http://i51.tinypic.com/2rmxsfp.png <!doctype html> <html> <head> <title>fade bottom</title> <style> body{background:#fff} p { color:#000; margin:0 auto; text-align:justify; text-indent:30px; width:600px; } #fadebottom { background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,0)),color-stop(1, rgba(255,255,255,0.7))); bottom:0; height:50px; left:0; position:fixed; width:100%; } </style> </head> <body> <p>some long text here. lorem ipsum?</p> <div id="fadebottom">...

ruby on rails - acts_as_ferret with German umlauts -

i managed setup app search based on acts_as_ferret. overall works fine. can't find results words umlauts (e. g. “getränke”). i added environment.rb , rebuilt index scratch, no better results. ferret.locale = "de_de.utf-8" i double checked database table, think should perfect: default charset=utf8 collate=utf8_bin btw: data displayed fine in database table (viewed sequel pro). then opened index file textmate search entry “getränke” , fugured, textmate opened mac roman encoding , display umlaut this getr‰nke i reopened index file utf-8 encoding, strange charackters displayed rectangles questionmarks. how can find results searching words german umlauts? this did trick environment.rb $kcode = 'u' env['lang'] = 'de_de.utf-8' ferret.locale = "de_de.utf-8" database.yml development: encoding: utf8

Spring MVC Portlet: Accessing beans from portlet context in root context -

it possible access portlet context bean root application context in spring mvc portlet? if publishcontext property of dispatcherportlet is true (default value) can portlet appcontext javax.portlet.portletcontext as: applicationcontext otherportletcontext = portletcontext.getattribute(frameworkportlet.portlet_context_prefix + otherportletname); then use bean of other portlet context as: portletbean = otherportletcontext.getbean(beanname, beanclass); note can javax.portlet.portletcontext object implementing portletcontextaware .

asp.net - Selector for dynamically generated ID -

i have series of div id tagged conventional: <div id="result<%=order.id %>"> the handler submits form can find out order.id via: frominput.split(",")[1] so how element concatenated static part of div id? $('#frmchooseoptions').ajaxsubmit({ beforesubmit: checkready, target: "#result" + frominput.split(",")[1] }); mny thx i had right idea split string wrong: var divnum = frominput.split(","); divnum = divnum[1]; then: ... target: "#result" + divnum

css - IE has different height/width for div than Firefox -

i'm having trouble div height , width in ie. on web page, http://www.ricominciodame.it/eventi.php , there div s blackboard style. in firefox, work fine, in ie (both 7 , 8) width lower , background cut. the following css: div.evento { background : white url("images/sfondo_evento.png") top no-repeat; width : 260px; height : 207px; margin:5px; margin-left:0px; margin-bottom : 20px; padding-left : 20px; padding-right : 20px; padding-top : 20px; padding-bottom : 20px; color : white; } how can fix problem? your page running in ie quirks mode caused doctype . have use of these http://www.w3.org/qa/2002/04/valid-dtd-list.html also, it's validate web site, w3 validator .

wpf - Scaling controls in Silverlight shrinks the control but not the space it occupies -

i'm noticing if use scaletransform on control silverlight, shrinks visible aspects of control, not space occupies (i.e., bounding box). is there anyway override behavior control and bounding box both shrink when apply scaletransform? or there other way shrink usercontrol? if plain shrink adjusting height/width, lot of details disappear (they don't anti-alias properly). (note: i'm observing behavior in expression blend, assume applies silverlight/wpf controls in general.) for sake of context, i'm trying make image button placing usercontrol inside button. i'm transforming usercontrol x = 0.15 & y = 0.15. usercontrol shrinks properly, button looks has massive padding on because usercontrol's bounding box doesn't shrink accordingly. apply scaletransform whole button, it's button has huge bounding box, , creates other problems. you need use layouttransform , not rendertransform . since isn't supported out of box silverlight, can ...

c++ - Handling very large images in Qt -

i can't qt work on images beyond 10,000x10,000. i'm dealing huge satellite images around 2gb each. considered using memory mapping image still occupies space in memory. qfile file("c://qt//a.ras"); file.open(qiodevice::readonly); qint64 size = file.size(); uchar *img=file.map(0,size); qimage i(img,w,h,qimage::format_argb32); can tell me more efficient way deal large images in qt? qgraphicsview , set of image tiles, view handles scrolling , world coords you. have either pre-chop images tiles in advance or pull section of image data on fly

Generic Rails XML response to successful AJAX action? -

i think should easy syntax question, i'm not sure if approach correct. i'm using paperclip accept file upload flash. action creates object , saves upload, when tries generate xml response default xml generator think chokes trying include paperclip attachment in xml file. rails shows 406 error , flash throws i/o error. i found a resource on embedding paperclip attachments in xml total overkill. flash needs success or failure message. like: def jpg_stream @photo = photo.new(:name => params[:name], :uploaded => time.now) @photo.image = params[:image] respond_to |format| if @photo.save format.xml { "<success/>" } else format.xml { render :xml => @photo.errors, :status => :unprocessable_entity } end end end what should line be? format.xml { "<success/>" } edit this error stack trace. think rails has no problems returning whatever generated, 406 error means browser/flash n...

javascript - Where does node.js sit in the client <--> web server flow? -

Image
with respect how node.js fits in clients , web servers, description below correct? (a) clients (b) node.js running on web server (c) "services" hosting business logic, database access routines, e.g. "getcustomer()". simplicity assume service (c) exposes rest interface. so in flow, client (a) request resource node.js (b) in turn dispatch request (with it's async , evented i/o goodness) service (c) might go , customer information , returns node.js (b) via callback , in turn node.js returns response client. 1.is correct? two related questions: 2.how node.js know service dispatch request to? have create api "stubs" in node.js mirror service apis, since client isn't talking directly services? 3.how session state handled in architecture? first of "diagram" of usual flow: client | v re...

imageview - Android Changing image size depending on Screen Size? -

so need change size of image depending on area of screen. image have half of screen height, because otherwise overlaps text. so height= 1/2 screen height. width = height*aspect ratio (just trying keep aspect ratio same) i found was: display mydisplay = ((windowmanager) getsystemservice(context.window_service)).getdefaultdisplay(); int width =mydisplay.getwidth(); int height=mydisplay.getheight(); but how change image height in java? or xml if possible? can't seem find working answer. you can layoutparams in code. unfortunately there's no way specify percentages through xml (not directly, can mess around weights, that's not going help, , won't keep aspect ratio), should work you: //assuming layout in linearlayout root linearlayout layout = (linearlayout)findviewbyid(r.id.rootlayout); imageview image = new imageview(this); image.setimageresource(r.drawable.image); int newheight = getwindowmanager().getdefaultdisplay().getheight() / 2; int orgwid...

visual studio - Can an ASP.Net 3.5 site run on a server with ASP.Net 4.0 on it? -

can asp.net 3.5 site run on server asp.net 4.0 on it? on server has 4.0 asp.net framework installed on site making 3.5. need have 3.5 framework installed make page work? yes, does, in likelihood, 3.5 framework should installed. if not, ensure gets installed. however, it's best install versions in order... have had issues in past when 4.0 installed first , "lesser" version afterward, or when 2.0 installed before 1.1. it's practice install them in correct order.

asp.net mvc - Facebook FBML <fb:name> tag not working for some users -

i have weird behavior when using facebook <fb:name> tag in application. for example have list of users rendered on web page , using <fb:name> fbml tag generate link user profile. example generated link for: <fb:name uid="627670450" useyou="false"></fb:name> be: http://www.facebook.com/profile.php?id=627670450 , facebook display: "this content unavailable" and know user exists because can verify it: http://graph.facebook.com/627670450 for other fbuser id's generated links works fine example: http://www.facebook.com/profile.php?id=100000032667354 displays user profile page no problems. any ideas why users facebook wouldn't display profile page? on front end i'm generating around 100 users , it's doing half of them. should add profile <fb:profile-pic> tag works fine every user can see users profile images. the reason can think of privacy settings user use block profile displayed i...

sql - Error when executing a stored Procedure -

i trying execute stored procedure failing while inserting data 1 table table. error cannot insert duplicate key row in object 'extpndpart1' unique index 'idx_primary' i know error comes when destination table has primary key on particular column , source table has duplicates in column. hv condition drops primary key in stored procedure. if exists (select * dbo.sysindexes name = n'pk_extpndpart1' ) alter table [dbo].[extpndpart1] drop [pk_extpndpart1] can 1 me?? seems you're looking for/dropping wrong index. you're dropping pk_extpndpart1 error refers idx_primary .

How do I list associated attributes in my Rails 3 view? -

i have customers model: class customer < activerecord::base has_many :phone_numbers end and phone numbers model class phonenumber < activerecord::base belongs_to :customer end in view, i'm doing this: <table id="customersearch"> <tr> <th>last name</th> <th>first name</th> <th></th> <th></th> <th></th> </tr> <% @customers.each |customer| %> <tr> <td><%= customer.last_name %></td> <td><%= customer.first_name %></td> <td><%= link_to 'show', customer %></td> <td><%= link_to 'edit', edit_customer_path(customer) %></td> </tr> <% end %> </table> and here controller action: def index @customers = customer.find(:all, :limit => 10, :order => 'last_name') flash.now[:notice] = 'enter customer las...

Multithreading Python FS Crawler -

i've written python function scours filesystem using provided directory pattern, optional 'actions' take provided @ each level. tried multi-threading since of volumes on network shares , want minimize io blocking. started using multiprocessing pool class, since convenient...(seriously, no pool class threading?) function unravels provided fs pattern as possible , submits newly returned paths pool until no new paths returned. got work great when using function , class directly, trying use function class , program seems hang. simplify rewrote function using threads instead of processes, , wrote simple threadpool class... same problem. here's simplified version of code still exhibits same problems: file test1.py: ------------------------------------------------ import os import glob multiprocessing import pool def mapglob(pool,paths,pattern): results = [] paths = [os.path.join(p,pattern) p in paths] result in pool.map(glob.glob,paths): resul...

osx - How can I open external websites in Excel 2011 for Mac? -

in excel 2010 it's easy me make macro opens website, selects data website, , pastes workbook. i've searched everywhere figure out how can on mac running excel 2011, i'm guessing since reintroducing vba mac version of office may not have capabilities (yet). can me figure out how if possible? look querytables answer in how can send http post request server excel using vba? that's working on both windows , mac.

graphics - OpenGL application fades when texturing an object -

i have application animates person traversing halls of spaceship. have created opengl dll application links to. purpose of opengl dll intercept specific calls, , when these calls intercepted. the main call concerned intercepting wglswapbuffer ( think thats name ). in call, render 3d object ( half sphere or half cylinder ) , specify texture coordinates each vertex. capture output of framebuffer, , use texture contents of sphere using glcopyteximage2d, or that. after stuff, dll calls real dll , real swapbuffer method called. when place dll in same folder application, expect, dome graphics textured onto it. did not expect screen fades constently. mean looks way supposed to, , on second interval, screen fade completly black, , come being normal. repeats average frequency of second, faster, slower, seems depend on hard processor working. any ideas? turns out blending. in swapbuffer method, disabled blending, did stuff, , re-enabled blending, , works.

css - How do you make a <div> less than 13px tall in IE6? -

Image
how make divs short in ie6? no matter if use 0.3em or 3px, ie6 forces minimum of 13px. ie6 firefox 3.6.13 (looks quite similar in other modern browsers) html <div id="fileprogressbar" style="display:none"> <div id="fileprogressfill"></div> </div> css #fileprogressbar { height: 0.3em; background: #444; background: -moz-linear-gradient( top, #333, #666 ); background: -webkit-gradient( linear, left top, left bottom, color-stop(0, #333), color-stop(1, #666) ); border-top: 1px solid #000; } #fileprogressfill { height: 100%; width: 0; background: #0088cc; background: -moz-linear-gradient( top, #0099e5, #006699 ); background: -webkit-gradient( linear, left top, left bottom, color-stop(0, #0...

How can I create a line chart with two different scales using g.raphael or jquery svg? -

i need plot torque curve similar graph here http://www.fordscorpio.co.uk/flatspot.htm in javascript..preferably using g.raphael. suggestions welcome. thank you! you can create own axis objects follows. (have lost source/gist url snippet can't give credit it's due) axis = r.g.axis(85,230,310,null,null,4,2,["1", "2", "3", "4"], "|", 0); axis.text.attr({font:"12px arial", "font-weight": "regular", "fill": "#333333"}); // y-axis denoted setting orientation 1 axis2 = r.g.axis(40,230,300,0,400,10,1); so create normal line graph 2 series , draw axis otherwise, set multiple axes , tweak labels :- var lines = r.g.linechart(10, 10, 300, 220, [[1, 2, 3, 4, 5, 6, 7],[3.5, 4.5, 5.5, 6.5, 7, 8]], [[12, 32, 23, 15, 17, 27, 22], [10, 20, 30, 25, 15, 28]], {nostroke: false, axis: "1 1 1 1", symbol: "o", smooth: true}); lines.axis[0].text.items[3].attr(...

post - How do I prevent a redirect after using PHP cURL to upload images to another site? -

a site has form allow uploading 1 image @ time. use php curl upload multiple images zip file, works. i see curl_exec response , curl_getinfo data in browser after uploads done. however, able see them split second before redirected site images uploaded to: $ch = curl_init($this->adata['urldata']['actionurl']); foreach ($this->adata['images'] $afile) { $suploadfile = $this->curluploadfilename($afile); $apostdata = array('sfromurl' => $sfromurl, 'token' => $stoken, 'uploadfile' => $suploadfile, 'upload' => 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_useragent, $_server['http_user_agent']); curl_setopt($ch, curlopt_referer, $_server['http_referer']); curl_setopt($ch, curlopt_cookie, $scookies); curl_setopt($ch, curlopt_postfields, $apostdata); curl_setopt($ch, curlopt_returntransfer...

ruby - Differences between Proc and Lambda -

ruby has differences between procs created via proc.new , lambda (or ->() operator in 1.9). appears non-lambda procs splat array passed in across block arguments; procs created via lambda not. p = proc.new { |a,b| + b} p[[1,2]] # => 3 l = lambda { |a,b| + b } l[[1,2]] # => argumenterror: wrong number of arguments (1 2) does have insight motivations behind behavior? there 2 main differences between lambdas , non-lambda proc s: just methods, lambdas return themselves, whereas non-lambda proc s return enclosing method, blocks. just methods, lambdas have strict argument checking, whereas non-lambda proc s have loose argument checking, blocks. or, in short: lambdas behave methods, non-lambda proc s behave blocks. what seeing there instance of #2. try block , method in addition non-lambda proc , lambda, , you'll see. (without behavior, hash#each real pita use, since does yield array two-elements, pretty want treat 2 arguments.)

Google Video does not embed in IE -

this google video embedded code not work in ie. blank space. <embed id=videoplayback src=http://video.google.com/googleplayer.swf?docid=7406382850822714049&hl=en&fs=true style=width:400px;height:326px allowfullscreen=true allowscriptaccess=always type=application/x-shockwave-flash> </embed> chrome , ff works fine. question is: how can create alt picture embedded video(for example if video not loaded correctly, picture link video shown. thanks imho simple link video link solve. <embed id=videoplayback src=http://video.google.com/googleplayer.swf?docid=7406382850822714049&hl=en&fs=true style=width:400px;height:326px allowfullscreen=true allowscriptaccess=always type=application/x-shockwave-flash> </embed> video not loading correctly? click <a href="videourl">here</a> by way afaik internet explorer doesn't support embeddings.

android - How to manage a multitable database? -

i got done reviewing notepad tutorial , looking @ how database. if wanted expand multi-table database, add new provider class did possibly needed table? second if don't mind answering second related question, uri , how use them android? searched around , came "universal resource identifier". thank ~aedon the idea of provider deals type of public resource. have contact provider or note provider. provider isn't tied database in way. note provider might accessing dozens of tables behind provider interface. you can think of provider interface being being public api resources. available applications on phone mechanism sharing common resource. method of implementing api implementation detail provider itself. provider might not use database @ (perhaps uses web service only) or might use multitable/multidatabase design. a uri universal resource indicator. cliff's notes of this: uri has scheme , locator. in android, scheme, portion of uri befor...

Using node.js HTTP remote client request doesn't return any body -

i'm using node.js download webpage. however, it's not receiving chunks of data: console.log('preparing request ' + url) u = require('url').parse(url) var remote_client = http.createclient(80, u['host']); var request = remote_client.request("get", u['pathname'], {"host": u['host']}); console.log("request made") request.addlistener('response', function (response) { response.setencoding('binary') var body = ''; response.addlistener('data', function (chunk) { body += chunk; console.log('chunk received') }); }); the last console message "request made". there no console messages "chunk received" or like. thoughts? this example worked me: var sys = require('sys'), http = require('http'); var connection = http.createclient(8080, ...

javascript - Jquery Tooltip plugin, don't repeat div append? -

ok, can't see this. i'm making tooltip plugin can applied multiple items. i have multiple anchors on page when mousedover act tooltips. use variable c_ttip act identifier div because don't want set id on it. i want keep appending tooltip , applying class , css on , on if same anchor remoused on before tooltip mouseout activates timeout removes it. script dev page, http://kalluna.com/_dev-js.do var c_ttip = $('<div>'); return this.each(function() { $(this).mouseover(function() { c_ttip.appendto(document.body).hide(); c_ttip.html('inside tooltip').addclass('c_ttip_box').css({'top' : obj.position().top + 20, 'left' : obj.position().left}).show(); }).mouseout(function() { timer = settimeout(function() { c_ttip.fadeout(200, function() { c_ttip.remove();}); }, 2000); }); }); you can store object triggered tooltip , verify object different before adding div. like: var c_ttip...

python - Celery with Django - deployment -

i considering using celery in project. found lot of information how use etc. interested in how deploy/package solution. i need run 2 components - django app , celeryd worker (component sends emails). example django app use email_ticket task email support tickets. create tasks.py in django app. @task def email_ticket(from, message): ... do deploy django app , run celeryd separate process same path? ./manage.py celeryd ... what workers on different servers? deploy whole django application , run celeryd? understand use celery worker, use celerycam , celerybeat. any feedback appreciated. thanks thanks feedback. this covered in documentation here . gist need download init scripts , setup config. once that's done celeryd start on boot , you'll off , running.

.net - Ranking Priority using DropDownList in C# -

my idea build ranking priority using dropdownlist asp server control. here's setup: have 3 dropdownlists , has 3 items ("first", "second", "third") on each dropdownlists. when have chosen 1st dropdownlist assuming item have selected "first" , on 2nd dropdownlist default selecteditem "first" item of 1st dropdownlist on have selected must swapped on 2nd dropdownlist. in short there unique selecteditems on each dropdownlist , in every selectedindexchanged event occuring there swapping of items on 3 dropdownlists. that's ranking priority be. my question be, how can swapped previous item on dropdownlist going 1 dropdownlist have selected on , placed new item? here's code: protected void dropdownlistpriority_selectedindexchanged(object sender, eventargs e) { dropdownlist ddlrank = (dropdownlist)sender; int swapindex; string sameddlselecteditemid; //get list of ddls list<dropdownlist...

c# - Best Application Design for Software As Service -

using asp.net mvc3 c# , ms sql 2008 i'm developing software service site. it's car inventory app car dealers. have few ideas of architecture of site wanted second opinion. each dealer restricted layout, can upload logo , select color theme's. at first thought creating separate sites each dealer, upgrading nightmare. so thought is, 1 main site dynamically changes based on hostname. ie. if miamicars.carinventory.com entered, see color scheme , logo. i have 1 master database users , company settings, separate database each site bulk of data (car inventory, etc). way can backup , handle each site's data individually, main code of application in 1 place. also, each company have directory store individual images. any feedback welcomed. thanks considering these multiple companies, recommend looking multi-tenant designs . know looks more complex helps grow application cleanly grow. here blog entry pretty interesting asp.net mvc . here interesting...

hash - Password + Salt + SecretSauce? Helpful, or just a little obscurity? -

standard password security involves generating random salt each user, somehow combining salt password , hashing them together, , storing both hash , salt in database. what if, instead of hash($salt . $password) , added in passphrase well, stored in source code or in server config file: $secret_sauce = 'tehb%l1yg*@t$g2uff'; // perhaps imported config file $hash = hash($salt . $secret_sauce . $password); does add added benefit, or thin layer of security obscurity applied top? for password files little obscurity added on top. however, scheme called "keyed hash" , can used symmetric (shared-secret) signatures: if have such hash, , input data, can sure signature created knows secret bit. of course, unlike public-key signature, cannot verify without knowing secret key.

Hadoop and MySQL Integration -

we implement hadoop on our system improve performance. the process works this: hadoop gather data mysql database process it. output exported mysql database. is implementation? improve our system's overall performance? requirements , has been done before? tutorial help. thanks altough not regular hadoop usage. migh make sense in following scenario: a) if have way partition data inputs (like existing partitioning). b) processing of each partition relatively heavy. give number of @ least 10 seconds of cpu time per partition. if both conditions met - able apply desired amount of cpu power make data processing. if doing simple scan or aggregation - think not gain anything. on other hand - if going run cpu intensive algorithms on each partition - indeed gain can significant. mention separate case- if processing require massive data sorting. not think mysql in sorting billions of records. hadoop it.

jquery - select time range issue -

i'm having weird issue using fullcalendar jquery plugin. works fine except when i'm in "week" view, when choose time slot, seems automatically choose slot 30-60 minutes greater want choose. for exampl, if want select 3 pm slot, when click on 3 pm slot, highlights either 3:30 or 4 pm slot. this bothering me , can't figure out how solve it. have feeling has css styling on side? want point out had change original width of calendar 900 pixels 100% in order fit had. think somehow messed calculations related offset of mouseclicks? it´s been year since posted this, in case else searching similar issue found in fullcalendar issue tracker: http://code.google.com/p/fullcalendar/issues/detail?id=1035&q=select&colspec=id%20type%20status%20milestone%20summary%20stars it changes line(3152) in fullcalendar.js: slotheight = slottablefirstinner.height() + 1; // +1 border for one: slotheight = slottablefirstinner.parents('tr').outerheight(...

osx - Using Eclipse on the Mac and the Alt Key in mappings -

Image
one thing has frustrated me using eclipse on mac keyboard mappings require alt or option key. i'm used using eclipse in linux environment, , using key in mappings isn't issue. however, on mac purpose entering special characters. is there way switch eclipse's default key mappings work correctly? i use commands alt + shift + c , alt + shift + t , , few others quite frequently, , not being able slows me down. use i'm used switching environments little more transparent. is you're looking for? modify go "binding:" , press hotkeys

rss - Feed API: are their any API exist to read the feed easily -

suppose have 10 feed urls. if want read them, need make 10 requests , need parse every response. feed not well-defined, may error when parser parses them. are there apis read feed making request them , give me result through response or json? that mean making 1 request instead of 10, no need parse result , make less processing. apis that? yes, there : http://superfeedr.com/ normalize data, deal polling or find best way content in realtime. finally, push content you, in format want (atom or json).