Posts

Showing posts from March, 2015

SQLite Reorder Table? -

can reorder sqlite table columns via query? i prefer query method, if not possible there other way? yes, control order of columns order name them in query. both these queries return same rows, columns in different order. select first_column_name, second_column_name mytable; select second_column_name, first_column_name mytable; if want appear columns in base table have been permanently changed, can use view. create view mytable_reordered select second_column_name, first_column_name mytable; if wanted make change transparent application programs, you'd first rename table, create view, giving old name of table. finally, you'd jump through whatever hoops dbms requires in order make view updatable. in sqlite, think means writing code implement instead of triggers .

git svn - I tagged in git-svn, and now my master always commits to the svn tag! -

i've got basic git-svn setup: [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hidedotfiles = dotgitonly autocrlf = true [svn-remote "svn"] url = https://svnserver:8443/svn/project fetch = trunk:refs/remotes/trunk branches = branches/*:refs/remotes/* tags = tags/*:refs/remotes/tags/* i created tag off trunk (master in git) issuing following: git svn tag -m "3.6.1" 3.6.1 this created new tag in svn @ /tags/3.6.1. in addition, saw new /remotes/tags/3.6.1 listed in remote branches. at point, i'd checkout out local branch 3.6.1 remote , made changes. merged them master (i think big mistake). master seems think has history 3.6.1 tag. now every time commit master dcommit, they're going 3.6.1 tag! jakes@mymachine /cygdrive/d/projec

facebook - <fb:comments-count> not working on my WordPress powered blog -

i using facebook comments plugin on wordpress , comments box working fine want access number of counts on index page , on single pages. on pages, facebook javascript loaded on pages. here's code used: <fb:comments-count href=<?php echo get_permalink() ?>/></fb:comments-count> comments but doesn't count fb comments. is there simple code let me retrieve number of comment counts? thanks, include function somewhere in template file : function fb_comment_count() { global $post; $url = get_permalink($post->id); $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url); $json = json_decode($filecontent); $count = $json->$url->comments; if ($count == 0 || !isset($count)) { $count = 0; } echo $count; } use in homepage or wherever <a href="<?php the_permalink() ?>"><?php fb_comment_count() ?></a> had same problem, function worked m

flex - >500 lines in <fx:Script> and it all stops working -

well, it's little ridiculous; , unbelievable, when have more 5 hundred lines of actionscript in tags in mxml flex main.mxml, syntax highlighting, error , syntax verification, error reporting, "problems" pane, , compilation fail. upon removing chunk of code, works again. i don't see why adobe release product such flash builder 4.5 premium, have big of problem; , nobody notice. therefore believe problem has computer, or project; there's ay more people have had happen if can't find on google. additionally, many objects have been defined in mxml properties above code, in states, showing warning: access of undefined property down side of document. however, these warnings not showing in "problems pane", , aren't yellow squigly underlining right sections of code pertain message. steps have taken try , fix this: have tried restarting, re-installing ide (adobe flash builder 4.5). have tried creating new project. have tried splitting code sm

unix - Prevent FIFO from closing / reuse closed FIFO -

consider following scenario: a fifo named test created. in 1 terminal window (a) run cat <test , in (b) cat >test . possible write in window b , output in window a. possible terminate process , relaunch , still able use setup suspected. if terminate process in window b, b (as far know) send eof through fifo process , terminate well. in fact, if run process not terminate on eof, you'll still not able use fifo redirected process. think because fifo considered closed. is there anyway work around problem? the reason why ran problem because i'd send commands minecraft server running in screen session. example: echo "command" >fifo_to_server . problably possible using screen i'm not comfortable screen think solution using pipes simpler , cleaner one. a reading file. when reaches end of file, stops reading. normal behavior, if file happens fifo. have 4 approaches. change code of reader make keep reading after end of file. that's say

.net - Error MC4108 on build server but not in Visual Studio -

in spirit of solution found should shared, getting following error when building wpf project using tfs. project build fine on local dev machine, on build server using vs or msbuild, not when built via tfs. error mc4108: root of template content section cannot contain element of type '{0}'. frameworkelement , frameworkcontentelement types valid. it pointing custom control contained within data template: <window.resources> <datatemplate x:key="tabitemtemplate"> <d:connectioncontrol /> </datatemplate> </window.resources> the workaround found wrap custom control in grid: <window.resources> <datatemplate x:key="tabitemtemplate"> <grid> <d:connectioncontrol /> </grid> </datatemplate> </window.resources> i guess it's not bad workaround, markup in question should have worked.

Do you need to HTML encode Title tags? -

should htmlencode title tags in head section of html page? eg <title>this & that</title> or <title>this &amp; that</title> yes should use &amp; instead of & inside <title> tag, same other tag in html or xml document.

php - Get size of remote file from URL? -

possible duplicate: php: remote file size without downloading file i want find size of file php when user enters link of file uploaded on different site. how? i assume want size of remote file. following php code should trick: <?php // url file (link) $file = 'http://example.com/file.zip'; $ch = curl_init($file); curl_setopt($ch, curlopt_nobody, true); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, true); curl_setopt($ch, curlopt_followlocation, true); $data = curl_exec($ch); curl_close($ch); if (preg_match('/content-length: (\d+)/', $data, $matches)) { // contains file size in bytes $contentlength = (int)$matches[1]; } ?> you first need obtain url file which, in relation mediafire , other file sharing websites, need code obtain after satisfying free user waiting period.

javascript - How to change parentNode style attributes on childNode events -

hey guys, have ul so: <ul id="list"> <li class="something"> <div class="btns" onclick="add(this)"> + </div> <div class="btns" onclick="sub(this)"> - </div> </li> <li class="something new"> <div class="btns" onclick="add(this)"> + </div> <div class="btns" onclick="sub(this)"> - </div> </li> </ul> css wise, class 'something' contains background image. what want achieve here, when add() or sub() function calls made, background-image property of parentnode of element made call changes... so way, don't have go around making id's each element, , can reuse same functions... what have this, doesn't work (rather, code i've written wrong): function add(x) { var y = x.parentnode.style; if (y.backgroundimage ==

What is Lazy Binary Search? -

i don't know whether term "lazy" binary search valid, going through old materials , wanted know if can explain algorithm of lazy binary search , compare non-lazy binary search. let's say, have array of numbers: 2, 11, 13, 21, 44, 50, 69, 88 how number 11 using lazy binary search? as far aware "lazy binary search" name " binary search ".

asp.net mvc - Getting VS2010, and specifically a Razor view, to recognize custom "data-" attributes as valid -

Image
i know html5 supports custom data-* attributes , , know vs2010 sp1 supposed have html5 support included . however, when installed vs2010 sp1, i'm still getting validation errors on elements data-* attributes. for example, this: <a id="clicky" data-for="@model.id">clicky</a> yields following warning in vs2010: validation (xhtml 1.0 transitional): attribute 'data-for' not valid attribute of element 'a'. while understand these warnings , can safely ignored, i'm trying keep site standards compliant possible, , if warnings list spammed these warnings, won't able see valid warnings through noise. am doing wrong, or must live seeing these warnings? thanks in advance. there little dropdown need change use html5 or others (xhtml 5, xhtml 1.1, etc.) click view --> toolbars --> html source editing. there dropdown. choose html5.

android - I cant find a difinitive way to save the state of a spinner in onSaveInstanceState, and recall it . . . please help -

i cant find difinitive way save state of spinner in onsaveinstancestate, , recall . . . please help. i have spent hours looking , cannot find this. . . . want temporarily. not want use sharedpreferences. for spinner think use arraylist have save arraylist @override protected void onsaveinstancestate(bundle outstate) { outstate.putstringarraylist("arruserids", arruserids); super.onsaveinstancestate(outstate); } and can restore arraylist onrestoreinstancestate method @override protected void onrestoreinstancestate(bundle savedinstancestate) { arruserids = savedinstancestate.getstringarraylist("arruserids"); super.onrestoreinstancestate(savedinstancestate); }

programming languages - It's considered a bad pratice use return to end a function? -

i'm php , actionscript developer, , in of functions use return end it. example: private function lolsome(a:string):void { if(a == "abs"){return void;} // function's code } i place function's code else , prefer way because in opinion, more legible. want know if considered bad practice or that. thanks! i consider bad practice if have returns inside long complicated functions because can harder else understand algorithm when looking @ it. however, bad practice have big long functions in first place (they should split multiple smaller functions). overall, consider validating parameters , state @ beginning of function , returning practice, not ok. but still careful not litter function several different returns within main logic.

.net - Extension methods on IEnumerable<T>: how is it performance? -

from mentor: prefer native methods (implemented directly on collection) on extension methods of ienumerable, because: the linq-to-objects extension methods implemented on ienumerable, meaning in worst-case scenario (when item search not exist in collection) have enumerate thru elements. if have contains or exists method implemented directly on collection, make use of internal knowledge , maybe hash table or other quick operation. i confused, because think microsoft should have implemented hash table ienumerable contains/exists already. quick benchmark list , ienumerable show no differences: static void main(string[] args) { console.write("input number of elements: "); int count = convert.toint32(console.readline()); console.write("input number of loops: "); int loop = convert.toint32(console.readline()); random r = new random(); stopwatch sw = new stopwatch(); (int = 0; < loop; i++) { v

database - Truly virtual FTP -

i looking set ftp server without connecting file system. i want use database store of many large files on site each user have access to. because of number , size of files involved, files cannot stored on single server link based setup not useful. i imagining ftp server act pass-through backend cdn stores files , checks remote database files present. does system exist? if doesn't exist, open source ftp server easiest modify suit needs? have looked @ jscape? costs money has capability

uitableview - UITableViewCell wrap text in UINavigationController app -

i having tableview different heights each cell based on size of text. calculate rowsize in delegate method -tableview:heightforrowatindexpath , , assign text in datasource method -tableview:cellforrowatindexpath . able realize appropriate height based on text, not able make text wrap around; instead disappears off screen. using navigation-based app generate tableview in child view controller using nib. played around of options tableview, can't make text wrap. see next wrap if textview, want entire content displayed in cell, without scroll bars in table cell itself. possible? here updated code, height adjusting correctly, cell not word wrapping... - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { nsstring *string = [self.quizdictionary objectforkey:[_temp objectatindex:testkv]]; cgsize stringsize = [string sizewithfont:[uifont boldsystemfontofsize:15] constrainedtosize:cgsizemake(320, 9999)

.net - Convert different formats to uncompressed audio c# -

just wondering if can recommend .net library converts audio formats uncompressed in c#? if there no .net library c library work well. writing application requires uncompressed audio sample. thanks help, ben here examples of how use c# libraries convert audio 1 format another: http://www.codeproject.com/kb/audio-video/aumplib.aspx http://www.alvas.net/alvas.audio.aspx change audio format in c#

multithreading - Asynchronous calling mechanism design c# -

the requirement continuosly read data hardware , send data upper layers further processing. presently use synchronous mechanism. i.e request --> wait --> read ---> send processing. { int ix = iy; iy = 0; if(ix<1) { while (((ix = readsst(ref sbuffer)) < 1) && bprocessnotended == true) { if (ix < 0) // bt error { eerr = cerror.buff_kill; //throw error , exit break; } thread.sleep(2); itimeout += 2; if (itimeout > timeout_2000) { eerr = cerror.timeout_err; objlogger.writeline("hw timed out"); break; } } } ibytesread = ix; if

ruby - JSON with Rails -

someone please this!!! i'm trying parse json object in javascript within rails, , nothing seems work. the story in controller is: def map @nodes = node.all @json = {"nodes" => @nodes.as_json(:only => [:id, :lat, :lon])} end in view, have simple javascript: <script type="text/javascript"> var stuff = <%= @json %>; var json = json.parse(stuff); alert("text"); </script> i'm trying see if code runs through first 2 lines alert message, never works, throwing me unexpected token error (usually colon or { ). i've tried doing eval method, doesn't work. can please me parse json in javascript? eternally grateful.... you can go current approach, there few correction need make work @json not json here, hash , when assign javascript variable looks like stuff = {"nodes" => node value} here => not accepted in javascript, not valid json object. you need convert hash object in

Run video from html5 Video tag in android -

i want use html5 support in android webview. when trying run html5 video in webview not working working in android web browser. thanks. android's webview provides many html5 features, such , geolocation, features not enabled default. furthermore, of steps enable features. try html5webview it may you.

android - Post to user facebook wall not working when Facebook app is installed on device/emulator -

i've built activity uses this implementation (see accepted answer) post status update on user's facebook wall. it works no problem if emulator/phone not have facebook app installed. if emulator/phone has facebook app installed, facebook app loads login screen, after trying login, facebook app disappears bringing me app. has had experience when facebook app installed? my code: public class achievementactivity extends activity implements dialoglistener, onclicklistener{ private facebook facebook; button facebookpostbutton; string defaultfacebookpost; @override public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); requestwindowfeature(window.feature_custom_title); setcontentview(r.layout.achievements); getwindow().setfeatureint(window.feature_custom_title, r.layout.custom_title_layout); view achievementdivider = (view)findviewbyid(r.id.achievementdivider); int[] colors = {0, 0xff00ffff, 0}; achievementd

jqGrid Retain Invalid Cell Value After EditRules Pop Up -

@oleg - new jqgrid.i have 3 issues. urgent required. using jqgrid 3.8, inline edit mode. i want retain invalid cell values after pop invalid cell. also want set focus invalid cell. i have "add row" , filter tool bar feature in jqgrid. have used oleg's solution in creating drop down filter tool bar (posted in jquery thread). ** - problem: ** calling setsearchselect aftersavecell , because want add new values in filter drop down every time add or delete column.(note: column textbox). filter tool bar isn't getting refreshed if use var sgrid = $("#list")[0]; sgrid.triggertoolbar(); see code below setting toolbar. <script type="text/javascript"> var mydata = [ {id:"1", name:"miroslav klose", category:"sport", subcategory:"football"}, {id:"2", name:"michael schumacher", category:"sport", subcategory:"formula 1"}, {

64bit - How to force gcc to use all SSE (or AVX) registers? -

i'm trying write computationally intensive code windows x64 target, sse or new avx instructions, compiling in gcc 4.5.2 , 4.6.1, mingw64 (tdm gcc build, , custom build). compiler options -o3 -mavx . ( -m64 implied) in short, want perform lengthy computation on 4 3d vectors of packed floats. requires 4x3=12 xmm or ymm registers storage, , 2 or 3 registers temporary results. should imho fit snugly in 16 available sse (or avx) registers available 64bit targets. however, gcc produces suboptimal code register spilling, using registers xmm0-xmm10 , shuffling data , onto stack. question is: is there way convince gcc use registers xmm0-xmm15 ? to fix ideas, consider following sse code (for illustration only): void example(vect<__m128> q1, vect<__m128> q2, vect<__m128>& a1, vect<__m128>& a2) { (int i=0; < 10; i++) { vect<__m128> v = q2 - q1; a1 += v; // a2 -= v; q2 *= _mm_set1_ps(2.); } } here vec

SharePoint:FormField in a custom webpart? -

on home page, want simple webpart allow users fill entry in list. the list have, let's say, 3 fields : title (text), body (rich text), category (lookup). i don't want use standard dataformwebpart because have bit of code-behind fill technical hidden fields of list (actually, don't exclude dataformwebpart, didn't find how use code behind). so started implement custom webpart. because don't want have handle manually each field input, started use formfield control, automatically choose rendering control, , provide value property correct format : <sharepoint:formfield runat="server" id="fldtitle" fieldname="title" /> this code not sufficient, have specified listid : <sharepoint:formfield runat="server" id="fldtitle" fieldname="title" listid="{title list guid}" /> this working quite correctly. can in code access fldtitle.value retrieve user input. but have include we

printing - how to set print settings with javascript? -

i want set print settings like: portrait / landscape, no. of copies, no. of pages, page size , quality using javascript is there way achieve this? if yes please tell me how this. this can not done js. thing can print css: <link rel="stylesheet" type="text/css" href="print.css" media="print" /> this used when print. ps: , im happy can't done. imagine every website mess print params.

python - Any flaw in the logic of using qtimer and qthread? -

i have gui developed using pyqt4 has run button. on run button click, invoke timer , thread. timer keeps monitoring thread. on thread invoke command prompt execute test cases. want thread alive till command prompt opened , want dead once close command prompt. the code had written achieve below. logic flaws? or better way achieve this? self.connect(self.run_button, signal('clicked()'), self.runscript) def runscript(self): self.timer = qtimer() self.timer.connect(self.timer, signal("timeout()"),self.senddata) self.timer.start(1000) def senddata(self): if self.run_timer: run_monitor_object = runmonitor() print 'starting thread...........' run_monitor_object.start() self.run_timer = false if run_monitor_object.isalive(): print 'thread alive...' else: print 'thread dead....' class runmonitor(threading.thread): def __init__(self, parent=none): threadin

sql server 2005 - T-SQL Query Self join via Date Table -

i trying write query joins table via date table. date table populated day per row dates on 200 years (don't ask didn't design it). has column date , 1 previous working date (i.e. if monday prev date previous friday). the other table lets call prices has date column , id determine type of price comes once each day. need join prices against via date table have each day alongside previous day using type column determine ones belong each other. todays date | todays price | previous working day date | previous working day price | price type any ideas? maybe this: select today.date, today.price, yesterday.date, yesterday.price, today.pricetype price today inner join dates d on today.date = d.date inner join price yesterday on d.yesterdaydate = yesterday.date , today.pricetype = yesterday.pricetype

php - C++ application collapsing after some hours -

i have application written in c++ uses opencv 2.0, curl , opensurf library. first php script (cron.php) calls proc_open , calls c++ application (called icomparer). when finishes processing n images returns groups saying images same, after script uses: shell_exec('php cron.php > /dev/null 2>&1 &'); die; and starts again. well, after 800 or 900 iterates icomparer starts breaking. system don't lets me create more files, in icomparer , in php script. proc_open(): unable create pipe many open files (2) shell_exec(): unable execute 'php cron.php > /dev/null 2>&1 &' and curl fails too: couldn't resolve host name (6) everything crashes. think i'm doing wrong, example, dunno if starting php process php process release resources. in "icomparer" i'm closing opened files. maybe not releasing mutex mutex_destroy... in each iterator c++ application closed, think stuff released right? what have watch for? have

asp.net - Clear IE cache C# -

i have problem internet explorer , cache (i think). easy explained, i'm trying edit user in sql database using linq-to-sql, works perfectly. after user edited, sends me page i've made list of users, , can click on user want edit. the problem is, if click on same user edited, changes haven't been done, in database, have been changed, think there might problem ie cache or something. anyone knows if there way in visual studio clear ie cache specific page? know can press ctrl+f5, want update without having press ctrl+f5. btw, website programmed in c# , .net 4.0. you need refresh data context . l2s doesn't 'cache', such, needs prompting refresh data database, depending on how you've done data update.

c++ - How can I create a variable with the same type as a given function? -

i have c++ function like int f( const std::string &s, double d ); now i'd create variable holds pointer f . variable should have correct type ( int (*)( const std::string &, double ) - don't want write out type explicitely. i'd deduce f don't repeat type signature. eventually, i'd able write along lines of: typeof<f>::result x = f; to achieve this, tried this: // never implemented, used deduce return type can typedef'ed template <typename t> t deducetype( t fn ); template <typename t> struct typeof { typedef t result; }; // ... typeof<deducetype(f)>::result x = f; my hope maybe return type of function ( deducetype , in case) used template argument alas - seems can't that. does know how this? i'm looking c++03 solution. c++0x added decltype want (if understood correctly). another option might boost::typeof intended provide same functionality until decltype supported in compilers.

html - How to ignore the extra white space in Google Chrome in a right aligned table row? -

i have table right align cells generated @ server side. each line within cell optional, enclosed in if-then statement @ server side. the sample html shows 3 columns, first column faulty in google chrome. columns 2 & 3 correct, yet strange, because html same, except newlines , whitespaces. when @ first column in google chrome notice right margin doesn't align 100% each line within cell. this problems not exist in firefox or ie, in google chrome. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> </head> <body> <table border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #000000;"> <tbody> <tr> <td style="text-align: right;border: 1px s

What is the meaning of "Window Size" in a TCP Header? -

i want know "window size" in tcp header. why used? "the transmission control protocol (tcp) receive window size maximum amount of received data, in bytes, can buffered @ 1 time on receiving side of connection. sending host can send amount of data before waiting acknowledgment , window update receiving host."

How to connect twitter-client application in android -

previously working on how connect android application twitter , posting tweet things have done when twitter application browsable. want things when twitter application client. give me idea or how it. on browsable app. things working fine me have no idea when application client time getting 401 error, know using callback url work when application browsable, cant thing when application client...any suggestions? using out_of_band able login page cant able authorization token further use when press key main activity comes having no authorization token. authurl = provider.retrieverequesttoken(consumer, oauth.signpost.oauth.out_of_band); if understand question correctly talking following setting twitter app: application type: client --- browser if developing android application should use browser (like did before). not work client. please explain why trying change client?

unit testing - How to make jmunit run all tests and still fail at the end if any tests failed -

when switch off haltonfailure or haltonerror in jmunit tests this: <jmunit haltonerror="false" haltonfailure="false" failureproperty="testfailure"> <formatter type="xml" /> <classpath> <path path="${jar_location}" /> <path path="${build}" /> </classpath> <!-- add --> <test name="com.example.tests.test1" todir="${reports}" /> <test name="com.example.tests.test2" todir="${reports}" /> <test name="com.example.tests.etc" todir="${reports}" /> </jmunit > the build succeeds when tests failed. if turn halts on, of course halts upon first failure. behaviour want tests executed regardless of how many of them fail, if of them failed build won't successful. reason want reports can correctly show how many passes , failures, , tests failing. how achieve t

java - Error on customers computer -

i have java client server program works fine on half dozen computere causing negativearraysizeexception on site. this code location = message.indexof("last"); location += 5; end = message.indexof('&', location); int size = end - location; error line char[] lastc = new char[size]; message.getchars(location, location+size, lastc, 0); string firsts = new string(firstc); string lasts = new string(lastc); message xml message reading. location integer points the location of character in message, first name in case. size length of persons name. as far can tell size being set negative number , don't know why. does know how fix or better of finding length of name ? this part of server side. the trouble end less location. issue message expecting , 1 receiving; rest of logic works messages. check message string.

objective c - Setting View controls according to the Orientation -

i created view based application. ui control's created thorough code.but view changing according orientation.can have properties avoid problem enable following function on filenameviewcontrol.m of project. -(bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { // return yes supported orientations return ((interfaceorientation == uiinterfaceorientationportrait) ); } change uiinterfaceorientationportrait according orientation if have deleted commented tags, add this.

c# - facebook getResponse() method - allow login -

i working on facebook. ask how getresponse() http page. have url facebook login login using c# application when click allow exploer page links error. why? doing wrong? should redirect page after client clicks allow? how programatically that? thx. in url have redirect option. <script> fb.init({ appid:'your_app_id', cookie:true, status:true, xfbml:true }); fb.api('/me', function(user) { if(user != null) { var image = document.getelementbyid('image'); image.src = 'https://graph.facebook.com/' + user.id + '/picture'; var name = document.getelementbyid('name'); name.innerhtml = user.name } }); </script>

dns - Getting a forwarded URL from thousands of different domains in Google App Engine -

i asked question before, cannot account details back, i'm asking again: i have series of different domain names point (via url forwarding domain host) google app engine application reads forwarding url is. if domain typed in original xyz.com, when forwarded application, can return original domain name was. i'm using python variant. how best can without coding each , every variant? so example might have aaa.com , bbb.com , ccc.com should point same appspotdomain, , wish somehow determine referring url was. have thousands of domains , have url forwarding set-up. unless put in header there smart way pull out referring url. have tried os.environ["server_name"] route gives app-engine domain. try os.environ['http_referer'] or self.request.headers['referer'] be careful though, might not available.

joomla - Kunena And Jomsocial Integration -

we using kunena , jomsocial , works great. possible stop changes in forum showing in jomsocial's recent activity list have private forums , not want changes in forum appear general users in jomsocial. we using kunena 1.6.1 any great. thanks richard this older version might still apply 1.6.x: http://www.kunena.org/forum/11-jomsocial/63170-enable-jomsocial-user-points-disable-activity-stream

iphone - Customizing image view in openFlow Library -

i have use openflow library in iphone project.if used openflow library knows images comes in it.i want ask can possible customize the imageview in images come want add share , + button expands , shrink image coming in flow. any suggestions appreciated your problem solved? if not can use 1 tricky way. on home screen showing cover flow add uibutton , set frame according cover flow image view. , set event of this. may solved problem. thx

android - emulator - internet connection issue -

i have set proxy settings in emulator , can access normal internet on emulator's browser. when try run application, gives error when change url services running inside organisation can fetch data!!! what issue here , how connect urls outside org through app??? thanks abhinav tyagi error: 05-11 17:12:28.867: warn/system.err(847): java.io.filenotfoundexception: http://google.co.in 05-11 17:12:28.917: warn/system.err(847): @ org.apache.harmony.luni.internal.net.www.protocol.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:1162) 05-11 17:12:28.917: warn/system.err(847): @ com.xml.xml_test.getxml(xml_test.java:65) 05-11 17:12:28.928: warn/system.err(847): @ java.lang.reflect.method.invokenative(native method) 05-11 17:12:28.939: warn/system.err(847): @ java.lang.reflect.method.invoke(method.java:521) 05-11 17:12:28.957: warn/system.err(847): @ android.view.view$1.onclick(view.java:2067) 05-11 17:1

asp.net - System.Diagnostics will allow user kill their own process in IIS7 -

hosted customers in iis7 can use asp.net , system.diagnostics list system's process id. can kill ones belong own application pools. seems big security problems in iis7 shared hosting environment. suggestions on how prevent normal users accessing system.diagnostics? how limit administrators only? unlike windows 2003 , iis6, many shared windows 2008/iis7 hosting environments provide customers dedicated application pools , full trust. whilst customers may able launch , kill own processes (including own worker processes), provided identity of account site runs under locked down no real harm can done. benefit customer having code kills own application pool (other force restart of worker process allow application_start type events fire if need reload settings there)? i work shared hoster, provide customers ability start, stop , recycle dedicated pools via our admin system, doing in code pretty same thing. the worst can happen customer launches process consumes lar

android - ListView selection problem with rating control? -

friends, i have created simple custom listview adapter ratingbar in it. now have noticed 1 thing cannot rate rating bars in listview because when click on listview row particular row gets selected. any 1 guide me how select individual items in android listview? <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <listview android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/android:list" /> </linearlayout> and listview_item design <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:orientation="horizontal" android:layout_h

ASP.NET master page - control if menu html is shown or not -

i'm creating asp.net site pages need have div floated left site menu in , other pages don't have menu div , instead content takes entire page width. i'm planning use master pages - wondering how best achieve - few immediate thoughts spring mind: create 2 master pages, 1 menu , 1 without. when creating content pages choose master inherit from. straightforward, may require more rework if site design changes create single master page content placeholder menu. on each page include menu div if needed (seems more messy approach) nested master pages? it seems may common problem, interested in how addressed. note questioning need having pages without menu - simpler if pages had same structure. nested master pages standard answer , should work well. an alternative approach occurs me put menu in panel control on master page , expose property lets toggle visibility of panel. have not tried yet, not sure how practical is, might fun concept play with. if

facebook - Redirect an Iframe page tab running on wordpress -

i wish redirect iframe page tab running on wordpress open custom shopping cart tab. put want click page menu tab named products here- http://facebook.com/halfpriceheaven ( tab hidden now) when clicked want custom tab shop page open. can done , how please. if want redirect user within facebook page tab iframe, depending on website language can achieve this. in php instance: header("location: my_page.php"); otherwise, if want redirect user website outside facebook, use like: <script>top.location.href="http://example.com/page.php"</script>

PHP - retrieve first element of json string without converting to array -

i have json string, probing follows: $playedon = $query -> data -> artist -> services_played_on i want first element of services_played_on, unsure how this.. if array i'd $query[data][artist][services_played_on][0], various reasons mess other code have. have ideas how can using -> notation? -----edit----- thanks answers, needed was: $playedon = $query -> data -> artist -> services_played_on[0] (i can't submit answer yet, 'new' user) just decode json first. $jset = json_decode($json, true); echo $jset["data"]["artist"]["services_played_on"][0];

android - IllegalArgumentException: View not attached to window manager . Dialog.dismiss -

i have little error want rid of. have no idea why error occurs. simulator , test phone runs perfect! info have stacktraces got app users in android market. java.lang.illegalargumentexception: view not attached window manager @ android.view.windowmanagerimpl.findviewlocked(windowmanagerimpl.java:355) @ android.view.windowmanagerimpl.removeview(windowmanagerimpl.java:200) @ android.view.window$localwindowmanager.removeview(window.java:432) @ android.app.dialog.dismissdialog(dialog.java:278) @ android.app.dialog.access$000(dialog.java:71) @ android.app.dialog$1.run(dialog.java:111) @ android.os.handler.handlecallback(handler.java:587) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:123) @ android.app.activitythread.main(activitythread.java:4627) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:521) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:858) @ com.andr

java - Redirect commons-logging output in Maven3 Mojo -

for flyway maven plugin, need call number of libraries log using commons-logging (flyway, spring, ...) in maven2, use maven-plugin-log4j accomplish this. output looks like: [info] [flyway:history {execution: default-cli}] [info] hsql not support locking. no concurrent migration supported. in maven3 however, doesn't work well: [info] --- flyway-maven-plugin:1.3.2-snapshot:history (default-cli) @ flyway-sample --- 15.04.2011 09:49:10 com.googlecode.flyway.core.dbsupport.hsql.hsqldbsupport <init> info: hsql not support locking. no concurrent migration supported. how can clean logging output in maven3? you should use abstractmojo.getlog() use maven provided logger.

geolocation - use KML , address lookup, directions and 'share map' on the same map -

i want use kml (or xml) file places, @ same time able search places, use directions or 'share map' functionality. @ moment when try in google or bing, once use kml file , search new place, loose kml placemarks.. is there way google or bing maps? google can handle 1 query @ time. there no way of overlaying queries (ie you're kml , search term) default. you using javascript , google maps api. http://code.google.com/apis/maps/documentation/javascript/

javascript - Avoid that script in MasterPage and in Iframe child page is executed twice -

i have developed script jquery everytime <select> selection changed logic executed. initially added script masterpage , in order sure every page considered - however, have external pages ( aspx ) not use masterpage and, consequence, don't have script. to solve added same script custom control, rendered <select> , present in external pages. unfortunately in way script executed twice, instead of once. how can change code in order ensure script executed in every page, once? user .net's clientscriptmanager.registerclientscriptinclude, has key parameter, register each key once. in masterpage , user control, make sure register them using same key. you use jquery see if registered , add id: function requireonce(url) { if (!$("script[scr='" + url + "']").length) { $('head').append("<script type='text/javascript' src='" + url + "'></script>"); }

php - Filtering User Input -

i've read quite few q&a's on filtering user input here, of time answer depends on you're doing. here's i'm doing: data submitted via form used in mysql query: function clean($field, $link) { return mysql_real_escape_string($field, $link); } data submitted via form displayed on html/php page or in email: function output_html($value) { return stripslashes(htmlspecialchars($value)); } data displayed database: function output_db($value) { return stripslashes($value); } is sufficient needs? there i'm not considering? thanks! use mysql_real_escape_string() when inserting strings sql queries, no matter input comes from. use htmlspecialchars() or htmlentities() when inserting strings html code, no matter input comes from. use urlencode() when inserting values query string of url, no matter values come from. if data comes user, should these things because there chance user trying bad things. security aside--what if

python - QuerySet caching: executing get after filter was fired -

how many database queries executed following code: q = somemodel.objects.filter(pk__in=ids) print q # actual query executed , result # set evaluated m = q.get(pk=ids[0]) print m # reuse evaluated result set # or hit database second time? since querysets evaluated lazily if do: q = somemodel.objects.filter(pk__in=ids) ...immediately folllowed (i.e., without using print ): m = q.get(pk=ids[0]) you'll end 1 sql query. it'll and first query second. it's safe continue adding querysets way. in django 1.3 logging revamped , can nice logging in interactive console: >>> import logging >>> l = logging.getlogger('django.db.backends') >>> l.setlevel(logging.debug) >>> l.addhandler(logging.streamhandler()) which give sort of debugging info actual query executed: (0.013) select "someapp_somemodel"."id", "someapp_somemodel"."question", "somea

asp.net - Error displaying details (ObjectContext instance has been disposed) -

i'm building asp.net mvc 3 app , i've got model looks so: public partial class flavor { // ... public string name { get; set; } public bool hasnuts {get; set; } public virtual icollection<saledata> sales {get; set;} // ... } which retrieves data db such: public partialviewresult details(int id) { using (var db = new icecreamdbflavors()) { flavor someflavor = db.flavors.find(id); someflavor.sales = db.sales.where(c => c.flavorid == id).tolist(); return partialview("details", someflavor); } } over on view this: <fieldset> <legend>sales data</legend> @foreach (var sale in model.sales) { <div>weekly</div> <div>@sale.weekly</div> } </fieldset> if don't retrieve sales data, flavor data displays fine no errors, adding call retrieve list of sales data causes error "the objectcontext instance has been disposed , can no longer

mxml - Flex 4 UIMovieClip Modify the Width of a Child DisplayObject -

i have collection of uimovieclip components reside in s:hgroup tag. in actionscript code modifying width of child clip in 1 of uimovieclips these changes not reflected s:hgroup. <s:hgroup id="_buttongroup"> <uiassets:navigationtabbuttonswc id="_lobby" /> <uiassets:navigationtabbuttonswc id="_achievements" /> </s:hgroup> <fx:script> <![cdata[ protected function init() : void { // hgroup not pickup change , buttons // no longer evenly spaced out , overlap! _lobby.getchildbyname("background").width += 200; } ]]> </fx:script> thanks! there's few reasons this. changing 1 child's width doesn't mean it'll change whole uimovieclip's width, should check first. second, flex has specific way of doing things (called component lifecycle), uimovieclip doesn't implement can't manage width in '