Posts

Showing posts from June, 2015

css - Use scroll bar as timeline for an animation in jquery -

i'm trying animate element (an svg) when scroll, far triggered animation while scrolling, want scroll act "timeline", when scroll animation starts, if stop scrolling animation pauses, , if go animation goes backwards. guess parallax scroll. i know there plugins out there solves problem, since have time wondering if posible jquery. so question is: there way plain jquery? this looks along same lines of you're looking for: jquery/javascript opacity animation scroll the fiddle in example uses scroll position control opacity, feel largely same animation control: http://jsfiddle.net/z7e9u/1/ var fadestart=100 // 100px scroll or less equiv 1 opacity ,fadeuntil=200 // 200px scroll or more equiv 0 opacity ,fading = $('#fading') ; $(window).bind('scroll', function(){ var offset = $(document).scrolltop() ,opacity=0 ; if( offset<=fadestart ){ opacity=1; }else if( offset<=fadeuntil ){ o

string formatting - How can I round and print a floating point number in a minimum width format in Perl -

i wanted like: printf('%3.3f%% ', $percent); but i'm still getting output as: 99.999% 100.000% i like: 99.999% 100.000% so pads less full width spaces. format specifier accomplish i'm trying do? the number before dot represents minimum value full field width , need 7 in there allow 3 digits before , after decimal point, , 1 more point itself: printf "%7.3f%%\n", $_ 99.999, 100; output 99.999% 100.000%

Insertion sorting algorithm in C++ -

i creating insertion algorithm sorting in c++. here is: void mysort2(int a[], const int num_elements) { int x[num_elements]; bool inserted(false); x[0] = a[0]; for(int = 1; < num_elements; i++) { inserted = false; for(int j = 0; j < i; j++) { if(a[i] < x[j]) { inserted = true; memmove(x + j + 1, x+j, (num_elements - j - 1)*sizeof(int*)); x[j]=a[i]; break; } } if(!inserted) { x[i] = a[i]; } } print(x, num_elements); } when tested data set: int num_elements(7); int a[] = {2, 1, 3, 7, 4, 5, 6}; the code works expected, printing 1, 2, 3, 4, 5, 6, 7 however, when make input bigger 7, program has segmentation error , dumps core. have tried data sets smaller 7 elements , again works expected. do need using dynamically allocated memory, or there , error in algorithm? thanks!

javascript - jQuery swap image on hover, then replace it with original on hover off -

i using following code swap image src out on hover of child's parent. how can save original source in variable , on hover off return image original source? $("#parent span").hover(function(){ var currentimage = $('img', ).attr("src","images/orbs/yellowbar.png"); $('img', ).attr("src","images/yellowbar.png"); },function(){ $('img', ).attr("src",currentimage); }); define currentimage outside of function: var currentimage; $("#parent span").hover(function() { currentimage = $('img', this).attr("src", "images/orbs/yellowbar.png"); $('img', this).attr("src", "images/yellowbar.png"); }, function() { $('img', this).attr("src", currentimage); });

Python 2 - How would you round up/down to the nearest 6 minutes? -

there numerous examples of people rounding nearest ten minutes can't figure out logic behind rounding nearest six. thought matter of switching few numbers around can't work. the code i'm working located @ my github . block i've got isn't close working (won't give output) is: def companytimer(): if minutes % 6 > .5: companyminutes = minutes + 1 elif minutes % 6 < 5: companyminutes = minutes - 1 else: companyminutes = minutes print companyminutes looking @ now, see logic incorrect - if working, add , subtract 1 minute portion of code doesn't make sense. anyway, have no idea how remedy - point me in right direction, please? ps - i'm making personal use @ work.. not asking job me keep track of hours @ work. don't want there issues that. thanks! here's general function round nearest x : def round_to_nearest(num, base): n = num + (base//2) return n - (n % base) [round_to_

login - Log in Using Google Plus Android ERROR -

i trying log in using google + having problem. heres import code: package info.androidhive.gpluslogin; import java.io.inputstream; import android.app.activity; import android.content.intent; import android.content.intentsender.sendintentexception; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imageview; import android.widget.linearlayout; import android.widget.textview; import android.widget.toast; import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.googleplayservicesutil; import com.google.android.gms.common.signinbutton; import com.google.android.gms.common.api.googleapiclient; import com.google.android.gms.common.api.googleapiclient.connectioncallbacks; import com.google.android.gms.com

Find deprecated API in Google Scripts -

i have message stating our google apps domain using api deprecated soon. when @ list of upcoming apis don't see believe using, have copied code various example sources , may missing something. outside looking @ every line of code in various spreadsheets, forms, etc, there way determine code in files might using api go away? if have o manually @ them sure miss something. , if in old test script can gladly throw them away. trying efficiently find problems area non-profit , time has been volunteer time better spent on new directions. regards, karl s you can run report admin console see in domain scopes have been authorized. https://admin.google.com/adminhome?#reports:subtab=token-audit here can search scopes of depreciating apis. if found return app associated them here scopes depreciating. https://apps-apis.google.com/a/feeds/.*?/(user|nickname|emaillist)/ and https://apps-apis.google.com/a/feeds/(group|user|alias|customer|orgunit|orguser)/

asp.net - Blank custom 404 page after deploying to IIS 7.5 -

incorrect urls http://localhost:54321/foo/bar , errors httpnotfound() handled in localhost without problems. after deploying iis 7.5, return blank page on both of above scenarios. i've seen else had problem here (it comment moulde several upvotes). code: web.config <system.web> <customerrors mode="off" redirectmode="responseredirect"> <error statuscode="404" redirect="~/error/notfound"/> </customerrors> </system.web> <httperrors errormode="custom" existingresponse="replace"> <remove statuscode="404" /> <error statuscode="404" responsemode="executeurl" path="/error/notfound"/> <remove statuscode="500" /> <error statuscode="500" responsemode="executeurl" path="/error/error"/> </httperrors> errorcontroller public class errorcontroller : controller {

Hexadecimal to Binary Error Java -

i trying convert hexadecimal binary problem result ignoring zeroes should on left hand side crucial me. my code: public static void main(string[] args) { // todo auto-generated method stub scanner scan; int num; system.out.println("hexadecimal binary"); scan = new scanner(system.in); system.out.println("\nenter number :"); num = integer.parseint(scan.nextline(), 16); string binary = integer.tobinarystring(num); system.out.println("binary value : " + binary); } output : when giving input 0000000000001a000d00 should output as 00000000000000000000000000000000000000000000000000011010000000000000110100000000 but instead 11010000000000000110100000000 leaving initial zeroes. how should exact number. in advance. you can try solution link ( how 0-padded binary representation of integer in java? ) provided @johnh, combined calculating length of binary representation of hex number. each hexadecimal

java - Prevent Managed Bean From Being Instantiated Multiple Times -

i'm new java sorry if terminology not correct. i have managed bean setup (policyinformation) session scope instantiate in java code with: thispolicy = (policyinformation) utils.getsessionmapvalue("policyinformationbean"); if (thispolicy == null) { thispolicy = new policyinformation(); } the code above checks if bean exists, , if does, uses object in session map. seems work great. however, if add label on xpage display value policyinformation managed bean following code (using expression language): <xp:label value="#{policyinformationbean.name}"/> the managed bean runs twice: once when call in java class, , again when add label above. is there way can prevent second call when adding label on xpage? can somehow value java session map in xpage label? faces-config: <managed-bean> <managed-bean-name>policyinformationbean</managed-bean-name> <managed-bean-scope>session</managed-bean-scope> <managed-bean-

html5 - javascript. Show embeded pdf on click -

when click link "show pdf" want display embeded pdf. there must wrong. pdf load. help? check out fiddle: http://jsfiddle.net/benjones337/7jkmvll9/2/ <!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset=utf-8 /> <script type="text/javascript"> window.onload = function() { document.getelementbyid("showpdf").onclick = function() { document.getelementbyid("thepdf").style.visibility = "visible"; } } </script> </head> <body> <div> <object data="http://www.elml.org/website/en/download/gitta_databases.pdf" type="application/pdf"> <embed id="thepdf" src="http://www.elml.org/website/en/download/gitta_databases.pdf" width="700" height="575" type="application/pdf" /> </object>

ios - Length of String as extension of String -

i know there lots of pointers duplicates worked before updated xcode 6.3 , has problem it. the script: extension string { func removecharsfromend(count:int) -> string { var getself = self string var stringlength = count(getself.utf16) let substringindex = (stringlength < count) ? 0 : stringlength - count return self.substringtoindex(advance(self.startindex, substringindex)) } } error : cannot invoke 'count' argument of list of type '(string.utf16view)' i want point out new method counting works everywhere else have used out (outside of extension). thanks in advance. count name of extension method parameter , hides swift library function count() . can rename parameter or call var stringlength = swift.count(getself.utf16) explicitly. but note counting number of utf-16 code units wrong here, should var stringlength = swift.count(getself) to count number of characters in string, because adv

java - Processing a file with JFileChooser -

hey guys running issue program. trying program show text files, , once user selects one, file information should displayed in textbox in gui. getting error: filechooserdemo3.java:66: error: unreported exception ioexception; must caught or declared thrown while ((strline = br.readline()) != null) { why happening? have catch statement.. help! import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.scanner; import java.io.*; class filechooserdemo3{ jlabel jlab; jbutton jbtnshow; jfilechooser jfc; jtextarea jta; jscrollpane scrollpane; filechooserdemo3() { //create new jframe container. jframe jfrm = new jframe("jfilechooser demo"); //specify flowlayout layout manager jfrm.setlayout(new flowlayout()); //give frame initial size jfrm.setsize(800,800); //end program when user closes application jfrm.setdefaultcloseoperation(jframe.exit_on_close); //cre

java - how to implement analytics in spring integration project? -

i working on spring integration project , want implement analytics. basic idea capture method name, timestamp , number of times called in gateways. is there default package / class available log these details? here thought , need suggestion before proceed further step 1 : add method name gateway method header <int:gateway id="gateway" service-interface="org.pro.gateway.samplegateway"> <int:method name="method1" request-channel="request.input.channel" reply-channel="reply.output.channel"> <int:header name="methodname" value="placeorder"/> </int:method> </int:gateway> step 2 : add spring wire tap interceptor, apply pattern matches input channel. message header name in wiretap channel , log it. <int:wire-tap channel="wiretapchannel" pattern="input*" /> <int:service-activator ref="analyticsbean" method="fo

ldap - OpenDSObject C# equivalent? -

i have old vb script uses opendsobject - opendsobject("ldap://server:389/dc=com/dc=domain/ou=organizational unit/uid=" & user & "","cn=common name","password",ads_secure_authentication) i trying convert c#. using directoryentry class. directoryentry uentry = new directoryentry( "ldap://server:389/dc=com/dc=domain/ou=organizational unit" ); uentry.username = "common name"; uentry.password = "password"; i getting authentication error. username property need sam name? can use common name directory entry method?

r - Remove line break in textOutput in Shiny Dashboard notification -

Image
i created notification within shiny dashboard displays icon , number of users registered in last day. if put in dummy text, icon , text aligned on same 'row'. if use rendertext pull number dynamically, line break added after icon. here's ui code: dropdownmenu(type = "notifications", notificationitem(text = textoutput("regis")", icon("users")) here's server code: output$regis <- rendertext({ count <- registrationstoday() paste(count,"new registrations today.",sep=" ") }) i've tried fix can't figure out. ideas? an interim solution problem posted here: https://github.com/rstudio/shinydashboard/issues/21 i tested , worked. notificationitem( text = tags$div(textoutput("regis"),style = "display: inline-block; vertical-align: middle;"), icon("users") ) hope helps!

macros - Subset based on criteria in sas -

let's hope have worded question correctly. i have pulled series of cricketing scorecards , have 'x' scorecards (datasets) each containing 'n' rows of observations. want create 'k' subsets 'x' scorecards automatically dividing each scorecard dataset 8. (for e.g. 1 of scorecards has 168 observations therefore scorecard broken 21 subsets, while scorecard contains 128 entries broken 16 subsets). i want transpose each of 'k' subsets, give me dataset containing 1 row. want stack 'k' transposed datasets create 1 big dataset. small example: nt broom b henry 21 12 15 3 1 140 jd ryder b henry 1 3 2 0 0 50.00 (small extract 1 of scorecards) above dataset divided 2 subsets, each of 2 subsets transposed produce below (2) datasets: nt broom b henry 21 12 15 3 1 140.00 jd ryder b henry 1 3 2 0 0 50.00 the 2 datasets stacked on top of each: nt broom b henry 21 12 15 3 1 140.00 jd ryder b henry 1 3 2 0 0 50.00 h

vbscript - HTA : how to pick up value from each drop down list and search? -

Image
i trying make hta working, add value each drop down list , search accordingly in directory can selected button. can make form of hta dont know how make search working. also how can move directory selection button beginning of line? user can pick directory first pick want search. <html> <head> <hta:application id="2014-03" applicationname="2014-03" version="1.1" border="thin" borderstyle="static" caption="yes" contextmenu="no" icon="c:\icon\32x32.ico" innerborder="no" maximizebutton="no" minimizebutton="no" navigatable="no" scroll="no" scrollflat="no" selection="no" showintaskbar="yes" singleinstance="yes" sysmenu="yes" windowstate="normal" > <script language="vbscript"> sub runsearc

Google Maps API how to add current traffic conditions on routes -

any great thank in advance. i have code display main route , alternative route, i'm trying display traffic conditions of route example: if go maps , directions show red or yellow lines on route. determined traffic conditions. there way show traffic conditions on map? i know theirs traffic condition service, shows traffic of area. need traffic on route. my code var lontlatobejct = sharedproperties.getstring(); var myoptions = { zoom: 10, center: new google.maps.latlng(lontlatobejct.strloclatitude, lontlatobejct.strloclongitude), maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: false }; var mapobject = new google.maps.map(document.getelementbyid("divmap"), myoptions); var mapcanvas = document.getelementbyid('divmap'); var start = document.getelementbyid('txtstartingaddress').value.tostring(); var end = document.getelementbyid(

Export Mysql data to a customized XLS file using php -

Image
first of all, know process of exporting mysql data excel file using php. have specific requirement , want know if can done or not. have googled, didn't specific information or method regarding same. this xls template : overview: column c fixed , others scrollable. there couple of organizations. data starting col-c8 col-l8 stored on mysql table of organization (e.g. organization1). data of col-c1 col-c5 & d1 d5 on mysql table of organization1. so every organization there 2 different mysql tables. requirement : the goal export data mysql , add excel file according image above. problem : adding data mysql table excel pretty easy if requirement replicate same on excel sheet. have no idea how customization. like pulling data 2 different tables , adding them different columns in excel sheet. please let me know if possible. , if yes, kindly direct me references on how achieve this. thank you! try phpexcel . library allows read , write from/to .

scripting - No such file or directory from sh script -

looking origin of error message: processing: +([^_]).flv date: +([^_]).flv: no such file or directory i started getting @ point in last few months (can't when wasn't logging cron output. know, know!). when wrote this, worked ok @ least 2 months. i'm wondering if there sh update broke it? the script runs via crontab , gets .flv files in current directory without underscore , processes each one. checks modified date files have been created in last 24 hours , runs yamdi meta tag injector .flv files. it seems it's not recognizing pattern pattern , looking actual file me. if run script ssh shell works ok, it's when running via cron gives error. shopt -s extglob now=$(date +"%s") f in +([^_]).flv; echo "processing: $f" age=$(date -r "$f" +"%s") calc=$(((now-age) / 60 / 60)) if(( calc < 24 )); echo "$f age=$calc" yamdi -i "$f" -o "

ipad - IOS Photos - Requesting Image for Asset with Swift -

i have updated post on 10 april 2015 new info ... i have app copying contents of cloud photo album local album on ios device. using following code : func fetchfullsizeimageforasset(asset:phasset) -> (uiimage)? { // image asset ( nil ) var myimage:uiimage? let requestoptions = phimagerequestoptions() requestoptions.synchronous = true requestoptions.networkaccessallowed = true requestoptions.deliverymode = .highqualityformat let screensize: cgsize = uiscreen.mainscreen().bounds.size let targetsize = cgsizemake(screensize.width, screensize.height) let imagemanager = phimagemanager() imagemanager.requestimageforasset(asset phasset, targetsize: targetsize, // targetsize: phimagemanagermaximumsize, gives null image ! contentmode: .aspectfit, options: requestoptions, resulthandler: { (result, info) -> void in

php curl work fine on localhost but no result on server -

i use php curl, works fine on localhost no result on server (after 60 sec trying) $ch = curl_init ($url); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_proxy, 'x.x.x.x:808'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt ($ch, curlopt_cookiejar, $ckfile); curl_setopt ($ch, curlopt_returntransfer, true); echo $output = curl_exec ($ch);

asp.net web api - parsing boolean value with Json -

i'm using json send objects android application web api application. when try send object contains boolean value value deserialized false if true in json ! here exemple : public class myobject{ public boolean value1; public string value2; } and have method object server : public string postobject(string url, object obj) throws parseexception, ioexception { defaulthttpclient client = new defaulthttpclient(); httppost httppost = new httppost(url); stringentity stringentity = new stringentity(new gsonbuilder().setdateformat("yyyy-mm-dd't'hh:mm:ss").create().tojson(obj)); httppost.setentity(stringentity); httppost.setheader("accept", "application/json"); httppost.setheader("content-type", "application/json"); httppost.setheader("accept-encoding", "gzip"); httpresponse httpresponse = client.execute(httppost); httpentity httpentity = httpresponse.getentity()

javascript - Table doesn't reset when click on X -

Image
i have following javascript: $(function(){ $table = $('#mytable') .tablesorter({ theme: 'blue', widthfixed: true, headertemplate: '{content} {icon}', widgets: ['zebra','filter'], widgetoptions: { zebra: ["even", "odd"], // filter_anymatch replaced! instead use filter_external option // set use jquery selector (or jquery object) pointing // external filter (column specific or match) filter_external : '.search', // add default type search first name column filter_defaultfilter: { 1 : '~{query}' }, // include column filters filter_columnfilters: true,

file upload - Keep getting Notice: Undefined index: file_name in D:\xampp\htdocs\andalusia\app\root\includes\file_uploader.php on line 10 {} -

i keep getting: notice: undefined index: file_name in d:\xampp\htdocs\andalusia\app\root\includes\file_uploader.php on line 10 {} the code supposed file name browser form input , extract it. working before, reason started getting above error. file_uploader.php : <?php global $resp; $fileuploader=new fileuploader($_get['file_name']); class fileuploader{ public function __construct($file_name){ $url = "http://guessit.io/guess?filename="; $theurl = $url . $file_name; $encoded = urlencode($theurl); $ch = curl_init(); curl_setopt($ch,curlopt_url,$theurl); curl_setopt($ch,curlopt_returntransfer,true); curl_setopt($ch,curlopt_header, false); global $resp; $resp = curl_exec($ch); curl_close($ch); return $resp; } public function upload($current,$uploadfile){ if(move_uploaded_file($current->tmp_name,$uploadfile)){ return true; } } } function upfilestoobj($filearr){ foreach($f

android - FragmentTransaction#add(int, Fragment) not doing anything -

i have actionbaractivity (which, way, extends android.support.v4.app.fragmentactivity ) , want add fragment topmost. here code: fragmenttransaction ft = getsupportfragmentmanager().begintransaction(); notificationsfragment fragment = new notificationsfragment(); ft.add(r.id.pager, fragment).commit(); where: notificationsfragment extends android.support.v4.app.fragment r.id.pager id of root view (which android.support.v4.view.viewpager ) when code above runs, nothing happens. no exceptions, crashes or visual changes. nothing. i've seen fragmenttransaction not doing anything , there suggestion there telling use replace instead of add , , when tried that, pager's fragment (remember, root view pager) being displayed disappeared. i have no idea what's going on, , i'm new android. doing wrong? note: minimum api target in ics ( 15 ), don't need support older versions, solution involving newer apis preferred. i have used viewpager in applic

php - Associative array from form inputs -

i'm building calculator mmo guild. @ moment i'm looking way make data more easy access calcules. basically, have form 5 text fields (just test, there lot more), , select list (for choose proper equation). example code: <input type="text" id="strength" name="strength" value="0"> <input type="text" id="dexterity" name="dexterity" value="0"> <select name="equation" id="equation"> <option name="damage" id="damage">damage</option> <option name="defense" id="defense">defense</option> </select> so form procesed through php file. <form action="file.php" method="post"> //inputs here <input type="submit" value="calculate"> </form> at moment i'm receiving data in php file vars: $strength = (int)$_post['str

side by side - Visual Studio 2012 Debug .exe Needs Microsoft.VC90.DebugCRT -

when build debug configuration, .exe fails launch. it reports the application has failed start because side-by-side configuration incorrect. please see application event log or use command-line sxstrace.exe tool more detail. i used sxstrace.exe tool. reports following error: error: cannot resolve reference microsoft.vc90.debugcrt,processorarchitecture="amd64",publickeytoken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8". i've read lot of posts related these side-by-side errors. tried installing visual studio 2008 redistributable packages hoping missing debug .dll installed in c:\windows\winsxs. however, saw debug versions of applications , various visual c++ dlls not redistributable. at https://msdn.microsoft.com/en-us/library/8kche8ah%28v=vs.110%29.aspx . how can resolve issue? your manifest file debug build incorrect. here mine looks vs2013. notice "require debug crt" option. loa

angularjs - Mongodb data corruption from heroku app cause & prevention -

i have free heroku plan , nodejs app on heroku server. nodejs app built meanjs, code mongodb connections find in configuration files. use mongolab free mongo database store data. (depending on how interact/change code believe), mongodb data corrupted. believe true because use script register names, , can log them awhile until receive no user/pass error. if error , create new user, user can logged in , out. of user data still in database. have few other crud modules use different collections in same database, , (so far) have not seen happen data, or anything any of data besides password. don't know error possibly coming from, or code relevant, haven't touched config files @ , knowledge haven't written code looks @ user passwords @ all. also, user object empty (user = "") in markup, bug introduced after original, believe while trying find out going on. again, don't have clue though, included in case. thanks! after lot of trial , error, found caus

ajax - How to use NodeJS with node-rest-client methods to post dynamic data to front end HTML -

i rather new nodejs able articulate question(s) properly. goal create nodejs application use node-rest-client data , asynchronously display in html on client side. i have several node-rest-client methods created , calling data operation when user navigates /getdata page. response logged console i'm stumbling on best method dynamically populate data in html table on /getdata page itself. i'd follow node best practices, ensure durability under high user load , make sure i'm not coding piece of junk. how can bind data returned express routes html front end? should use separate "router.get" routes each node-rest-method? how can bind request button , have new data when clicked? should consider using socket.io, angularjs , ajax pipe data server side client side? -thank reading. this example of route rendering getdata page calling getdomains node-rest-client method. page rendering correct , data returned getdomains printed console, i'm having trouble

Python Requests get doesn't return unless a timeout is specified -

this request never returns (or @ least not within patience): import requests r = requests.get('http://en.wikipedia.org/w/api.php?rcprop=ids&format=json&action=query&rclimit=10&rctype=edit&list=recentchanges&rcnamespace=0', headers={'user-agent': 'api test'}) hitting ctrl+c produces traceback: ^ctraceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in return request('get', url, **kwargs) file "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) file "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs) file "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs)

javascript - Facebook like button redirect even after liked -

i using edge create function got question facebook button redirect? fb.event.subscribe('edge.create', function(response) { location.href = 'http://yourdomain.com/post/id'; } ); so code working - page liked , redirect page, but seems function when user haven't liked page when user liked page, button "in liked state" , still want user redirect when click button is there function still? or how can check if user liked page, maybe in way can display button have redirect onclick them

swift - touchesbegan/moved/ended not working with xcode 6.3 -

i'm having same problem listed beta 6.3 here: overriding method selector 'touchesbegan:withevent:' has incompatible type '(nsset, uievent) -> ()' but fixes listed there not working me. i've changed line: override func touchesbegan(touches: nsset, withevent event: uievent) { to this: override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { the error i'm getting is: "method not override method superclass" does know if fixes listed above 6.3 beta working final 6.3? the correct answer here . keep override , change signature this override func touchesbegan(touches: set<nsobject>, withevent event: uievent)

mysql - retrieve blob file stored in database php pdo -

Image
i want retrieve blob file have stored in database , create link download or view of file. retrieving data entry database if ($stmt - > rowcount() > 0) { while ($selected_row = $stmt - > fetch(pdo::fetch_assoc)) { $basicinfo[] = array('remarks' => $selected_row['remarks'], 'filename' => $selected_row['nameoffile'], 'type' => $selected_row['file_type'], 'size' => $selected_row['filesize']); } } the column name of blob file fileblob try added 'fileblob' => $selected_row['fileblob'] when add code no result. want know how correctly retrieve blob file , able show/download using link. fyi my database looks this.

c - Are variable array parameters allowed to have as index variables outside the function? -

my book states: "the expression used specify length of" variable array "could refer variables outside function". guess book means: int main(void) { int xternal = 3; int variable_array[xternal]; function(variable_array); } void function(int variable_array[xternal]) { ... } i understood variables outside function invisible it. wrong? i presume referring variable-length-array parameters of c99. i think textbook trying can use length specifier not other arguments of function, e.g.: void f(int array_len, char array[array_len]); but outside still visible, global variable: int some_value; void f(char array[some_vaue]); keep in mind - not mean compiler array bounds checks you. useful when use multidimensional arrays navigate on inner dimensions. so instead of code: int *arr = malloc(sizeof(int)*nrows*ncols); void f(int *a) { int row, int column; ...calculate row, column int value = a[row*ncols+column]; .

c# - How to get Track Source in BackgroundMediaPlayer in Windows Phone 8.1 -

code in wp8.0 if (backgroundaudioplayer.instance.playerstate == playstate.playing) { if (backgroundaudioplayer.instance != null && backgroundaudioplayer.instance.track.source.tostring().contains("claps.mp3")) { backgroundaudioplayer.instance.stop(); } } when convert code wp8.1 universal apps, replaced backgroundaudioplayer backgroundmediaplayer, , tried below code if(backgroundmediaplayer.current.currentstate==mediaplayerstate.playing) { if(backgroundmediaplayer.current!=null && ) { backgroundmediaplayer.current.pause(); } } for second if condition compare present source track user input. how present track source in backgroundmediaplayer. please me solve error. there no way directly source media player. need make own mechanism saving source somewhere after setting (like local settings) , checking it.