Posts

Showing posts from July, 2012

extjs3 - how to avoid the automatic rounding of decimal value in extjs ? -

how avoid automatic rounding of decimal value in extensible java script? example if enter 2.003 rounded 2 or times if enter 2.039 accepting 2.0388888887 please me out. for numberfields can use decimal precision config the maximum precision display after decimal separator (defaults 2) technically tofixed: fixprecision : function(value) { var nan = isnan(value); if (!this.allowdecimals || this.decimalprecision == -1 || nan || !value) { return nan ? '' : value; } return parsefloat(parsefloat(value).tofixed(this.decimalprecision)); },

Filtering sql data with multiple filter vb.net (winform) -

i want filtering data sql datagrid. i have : 1 table (tablex) 3 columns col1 col2 col3 1/x/10 bjb 1/20/20 1/y/10 bjb 1/20/30 1/x/10 bjb 1/20/30 1/y/10 bjb 1/20/20 2 datagrid (dg1, dg2) i want insert : dg1 col1 "1/x/10" , col3 "10/20/20" dg2 col1 "1/y/10 , col3 "10/20/20 i can filter 1 col3 "select col1, col2, col3 tablex col3='10/20/20'" how filter col1 witch contain "x" or "y" , col3? ========================================================================== o yeah.. answer. this dg1 ("select col1, col2, col3 tablex col1 ('%/x/%') , col3='10/20/20'") and dg2, different x , y..lol ("select col1, col2, col3 tablex col1 ('%/y/%') , col3='10/20/20'") select col1, col2, col3 tablex col3='10/20/20' , (col1 '%/x/%' or col1 '%/y/%')

How to get geolocation of facebook status using facebook graph API -

so i'm trying latitude , longitude of facebook statuses map them, can give me idea on how that. thanks ... firs make api call - /me/statuses status of user. permission required: user_status demo you'll response as- { "data":[ { "id": "10152044171758611", "updated_time": "2014-02-15t12:12:59+0000" }, { "place": { "id": "xxxxxxxxxxxxx", "name": "xxxxxxx", "location": { "city": "xxxxxxx", "country": "xxxxxx", "latitude": 28.573024614741, "longitude": 77.230443565217, "street": "xxxxxxxxxx", "zip": "xxxxxxxx" } }, "id": "xxxxxxxxx"...

html - Make a image in division responsive -

i having images in carosuel effect keeps images in division.i want make images responsive.despite of adding class="img-responsive" to img tag image not giving responsive effect can 1 me? , wanted know if there way make division responsive? yes there is, <style> @media screen , (max-width: 980px) { .img-responsive { //insert css 980 width lower }} @media screen , (max-width: 700px) , (min-width : 400px) { .img-responsive { //insert css 700 width lower //css not work @ lower 400px } } </style> note can change value of max width depending on want change div. can set min-width determine minimum width css take effect cheers

responsive design - Changing .text() depending on the window size with jQuery -

i've got simple function finds , shows first sentence of every paragraph: function firstsentence(){ $('p').each(function(){ var p = $(this).text(); var s = p.split('.'); var f = s[0]; $(this).text(f + '...'); }); } and use when window size less 600: $(window).resize(function(){ if ($(window).width() < 600) { firstsentence(); } else { // normal please! } }); however, when user resizes window above 600, content not change back. what best way content reverted, if user resizes larger window ( > 600 )? before else, need store original text in each paragraph. e.g. this: var originaltexts = $('p').map(function () { return $(this).text(); }); and then, "back normal code": $('p').each(function (key) { $(this).text(originaltexts[key]); });

nsis - How to change Progress bar length in MUI instfiles page and arrange button position? -

i'm using mui page instfiles in installer , want change length of progress bar , position of "show details" button in it. possible still using mui page or have make own custom page nsdialogs ? you can use resource hacker edit ${nsisdir}\contrib\uis\modern.exe , use new ui resource: !define mui_ui mynewui.exe !include mui2.nsh ... the other alternative call setwindowpos or movewindow system plugin @ run-time bit harder do...

microcontroller - GPIO programming of MSP430? -

i going through datasheet of msp430 series. my doubt : there register enabling or disabling pull , pull down registers.(pxren) my question , if configure pin input , disable internal pull , pull down registers using register pxren , state of pin @ time , tri stated? yes. when configure pin gpio input high-z, i.e. tri stated. that's perfect input pin, external hardware define level. when enable rxen resistor pull or down. depends on value in out register.

android - Issue on creating starting window -

i want put application on system/app. while i'm installing app in android board, working fine. but, when trying run app put /system/app. showing following error. java.lang.runtimeexception: binary xml file line #31: must supply layout_height attribute. w/windowmanager( 591): @ android.content.res.typedarray.getlayoutdimension(typedarray.java:491) w/windowmanager( 591): @ android.view.viewgroup$layoutparams.setbaseattributes(viewgroup.java:5459) w/windowmanager( 591): @ android.view[ 2330.757820] mdp4_overlay_mdp_perf_upd mdp bw changed [0] 1 4 .viewgroup$marginlayoutparams.<init>(viewgroup.java:5594) w/windowmanager( 591): @ android.widget.linearlayout$layoutparams.<init>(linearlayout.java:1809) w/windowmanager( 591): @ android.widget.linearlayout.generatelayoutparams(linearlayout.java:1721) w/windowmanager( 591): @ android.widget.linearlayout.ge[ 2330.775766] mdp4_overlay_mdp_perf_upd mdp bw changed [1] 4 1 ne...

android - AsyncTask in separate object -

i want background tasks in android send request api, can't work way want. these scripts: activity class public class sampleactivity extends activity { private apirequest ar; private string parameters; ... private void callapi() { this.apirequest = new apirequest(this.parameters); } } apirequest class public class apirequest { private string response; public apirequest(parameters) { new backgroundtask().execute(parameters); } protected class backgroundtask extends asynctask<string, string, string> { @override protected string doinbackground(string... args) { // stuff here } @override protected void onpostexecute(string response) { this.response = response; } } somehow, can't seem update response string onpostexecute method. know onpostexecute supposed update ui thread, want update object first, runs in ui thread (i think)....

java - Wrong Content-Length for response text with umlaut -

there problem associated umlaut. description on request: @requestmapping(value = "/description", method = requestmethod.post, consumes = "application/json", produces = "text/plain;charset=utf-8") @responsebody private string getdescription() { return "ärchik"; } on frontend response.responsetext fails score last letter response.responsetext = "ärchi" i found problem in wrong content-length: 7 if set content-length:8, work , return full description "ärchik" but not understand why 8? "ärchik".getbytes("utf-8").length = 7 response headers cache-control:must-revalidate content-length:7 content-type:text/plain;charset=utf-8 date:mon, 14 apr 2014 09:08:26 gmt server:apache-coyote/1.1 i'm turning core of comment answer, since seems on right track. the reason string 1 byte longer expected 'ä' got encoded 3 bytes not two. can happen if...

android - Touch bounds for custom buttons in a circle menu -

Image
i'll need implement ui reflects layout of real object. below layout client wants. each black block button, need custom drawable , listener s, state s, etc. i'd use custom implementation of button widget, far know accept rectangular touch targets , laying them out tricky. what use achieve layout? please note: 2 central button should semicircle cutted in half (with padding between 2), not strange shieldy shape, i'm not photoshop. edit: suggested in question use touchlistener on layout , fake click on right button. main problem solution i'll need know bounds of drawable, not rectangular ones of button's bounding box (that rectangular). how that?

ios - Error while i'm uploading an iphone app using application loader -

this first question here :) hope can find useful answers problem, have made iphone application mobione , , have ipa file application , , i'm trying upload on itunes using application loader i'm facing errors on picture http://oi62.tinypic.com/4id5k.jpg so 1 tell me how avoid messages , upload application on apple store? regards make sure have selected correct provisioning profile build ipa, since uploading on apple app store, developer or adhoc/distribution provisions should not selected.

C++: getting errors with some code -

i kind of stuck code im doing. have in comments. //write function computes average value of array of floating-point data: //double average(double* a, int size) //in function, use pointer variable, not integer index, traverse array //elements. #include <iostream> using namespace std; double average(double* a, int size) { double total = 0; double* p = a; // p starts @ beginning of array (int = 0; < size; i++) { total = total + *p; // add value p points p++; // advance p next array element } return total / size; } to start not running. , 2ndly, going doing problem correctly? tried following book go through elements , average out after... have strong feeling im missing something. sorry if seems obvious of guys. still pretty new of , teacher doesn't exactly... doesn't teach coding aspect of c++. read 5 out of 200+ slides , hand tracing(not pseudo code) , throws wolves randomly picking coding assign...

javascript - Call function of angularjs instead of jquery -

angularjs has functions override jquery functions. e.g., wrap() function there in angular.js , in jquery-1.10.2 want call wrap() function of angular.js how should call it? for now, when try call in directive this, calls jquery's wrap() function: element.wrap(outerdiv); the need of is, wrap() function doesn't work if it's called jquery. though wraps elements, doesn't give angular environment, e.g. {{ name }} not print name property. when removed jquery file, wrap() function of angular.js called , worked fine. the angular js function .wrap() same jquery function .wrap() . quoted docs: if jquery available, angular.element alias jquery function. if jquery not available, angular.element delegates angular's built-in subset of jquery, called "jquery lite" or "jqlite." source so meaning if have jquery included, angular js function wrap() alias jquery function wrap else jqlites .wrap() (which same).

c# - RadioButtons are not mutually exclusive, despite same GroupName (ASP.NET) -

i using listview, represents list of products 1 of them should chosen. in itemtemplate, gave radiobutton same groupname property in order them mutually exclusive. however, not work right of products can chosen @ once. doing wrong? thanks <itemtemplate> <li class="product" id='<%#eval("productid")%>'> <asp:radiobutton groupname="products" id="radiobutton1" runat="server" /> </li> </itemtemplate>

javascript - Show div upon hover -

i want show div menu upon hovering text box reason not showing . here css .search:hover #search_drop { display:block; } #search_drop { display:none; height:500px; width:500px; background:#000; position:absolute; top:0px; } here html <div id="navigation_s" style="float:left"> <ul > <li > <div class="search"> <div id="search_drop"> test </div> <form action="" id="searchform"> <input type="text" name="search" id="searchbox" placeholder="looking something?"/> <input type="submit" id="searchbutton" value="go"/> </form> </div> </li> </ul> </div> all want on hoverin...

javascript - InDesign: How can I get paragraph contents with its characterStyles? -

i'm trying write custom export script indesign (i have cc 9.2, target cs6). when process paragraph, can paragraphstyle , content. don't understand is: how can content and characterstyles of content? i'm looking @ docs, don't understand how can descend paragraph , find characterstyles , text parts applied. if, instance, have paragraph following: my nice paragraph. i want know "my " , " paragraph." have style1, while "nice" have style2. the end result should like: [ { text: "my ", style: "style1" }, { text: "nice", style: "style2" }, { text: " paragraph.", style: "style1" } ] how can obtain information? use textstylerange property of paragraph. a textstylerange 1 single continuous range of text same formatting. not matter indesign whether formatting 'local' or applied through character style. oblig...

Processing images using hadoop -

i'm new hadoop , i'm going develop application process multiple images using hadoop , show users results live, while computation in progress. basic approach distribute executable , bunch of images , gather results. can results interactively while computing process in progress? are there other alternatives hadoop streaming, such use case? how can feed executable images? can't find examples other feeding stdin. for processing images on hadoop best way organize computations be: store images in sequence file. key - image name or id, value - image binary data. way have single file images need process. if have images added dynamically system, consider aggregating them in daily sequence files. don't think should use compression sequence file general compression algorithms not work images process images. here have number of options choose. first use hadoop mapreduce , write program in java java able read sequence file , directly obtain "value" o...

java - Jar File is running in my computer but not Running in another computer -

this question has answer here: how fix java.lang.unsupportedclassversionerror: unsupported major.minor version 41 answers i created jar file in laptop , runs fine in computer without trouble when use same in friend's laptop shows , exception , file not run. it's still laptop. what's reason? name of jar = blueserver.jar has 1 class. classname= server.java 1 external library used name= bluecove.jar used accessing bluetooth java. ide used=eclipse used eclipse creating jar,already checked option "pacakage required libraries generated jar" this error came while try run same jar in computer.... java -jar blueserver.jar exception in thread "main" java.lang.unsupportedclassversionerror: server : unsupported major.minor version 51.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(clas...

ios - Undefined symbols for architecture i386: for OpenCV project -

Image
i trying build this project , display below error, undefined symbols architecture i386: "cv::merge(std::vector<cv::mat, std::allocator<cv::mat> > const&, cv::_outputarray const&)", referenced from: -[rrmainviewcontroller colorsobeledge:isvertical:] in rrmainviewcontroller.o "cv::split(cv::mat const&, std::vector<cv::mat, std::allocator<cv::mat> >&)", referenced from: -[rrmainviewcontroller colorsobeledge:isvertical:] in rrmainviewcontroller.o "cv::exception::exception(int, std::string const&, std::string const&, std::string const&, int)", referenced from: -[rrmainviewcontroller floodfillpostprocess:withcolor:] in rrmainviewcontroller.o ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) i have added opencv.framework , added line in .pch file #ifdef __cplusplus #import <opencv2/opencv.hpp> #endif added l...

c# - Kinect Face Tracking Gestures -

Image
i working on kinect face tracking i want implement facial expressions. have: au1 – jaw lowerer aus au2 – lip stretcher aus i want implement other gestures like: right eye blink left eye blink both eye blink and other gestures described here: https://www.youtube.com/watch?v=6nfsea7coxq http://futuretechblog.com/?p=71 i have face model points: but best way this? now 1 idea calculate distance between specyfic points. example: var distance = math.sqrt(math.pow(facepoints[10].x - facepoints[35].x, 2) + math.pow(facepoints[10].y - facepoints[35].y, 2)); grab statistic of gestures exel graph , this: if(disnace<calculatedvalue) my questions are: my idea correct? can idea? do know dll detcet face gestures kinect c# sdk.? do have samples of detect gestures? do have other ideas how detect gestures? thanks! :) your idea rather correct. have developed gestures myself couple applications, eat gesture, call gesture, swipe gesture etc. ...

firefox - working with tabs in selenium webdriver in Ruby -

i'm testing firewall, want open set of pages simultaneously each in new tab, save tab id in threads , when threads finished, analyze tabs 1 one. here sample code: require 'selenium-webdriver' require 'thread' mutex = mutex.new profile = selenium::webdriver::firefox::profile.new profile["webdriver.load.strategy"] = "unstable"; browser = selenium::webdriver.for :firefox,:profile => profile max = 100; th = [] max.times{ |i| th[i] = thread.new { mutex.synchronize # todo browser.open_new_tab # todo thread.current["tab_id"] = browser.get_tab_id thread.current["i"] = browser.get("http://foo.bar?id=#{i}") end } sleep 2 } th.each{|t| t.join tab = t["tab_id"] # todo browser.open_tab(tab) analyse_content # method } what should use in todo lines? attention: since i'm using multi threading, dont want use alt + tab

reporting services - How to implement Underlay Following Sections in SSRS? -

i trying implement underlay following sections in ssrs. there way achieve this? in crystal reports there underlay following section check box through can achieve this. want use feature because in details section there 1 column (unit area) repeats data in each row due totals @ group footer comes wrong (due duplicate unit area) workaround correct totals work me if underlay not possible. googled underlay feature , solution find of using matrix per below msdn post. let me know if there other possible workarounds or solutions. http://social.msdn.microsoft.com/forums/en-us/1284e27c-de34-4670-a214-67fbe18470b3/underlay-following-section-like-crystal-reports?forum=sqlreportingservices this issue has been frustrating figure out, figured out how mimic crystal's underlay following sections behavior in ssrs!!! stumbled across solution , after finding have searched on method used , found many articles referencing it, never equating solution mimicking crystal's underlay pr...

android - how to execute app as system user? -

i want write in /sys/class/camera/rear_flash don't have permissions, file has read , write permissions user "system" , user within group "radio" (rw- rw- r--). can launch app "system" user or user within "radio" group without being root? to run app system have install follow: copy apk in sd card , executing these adb commands adb shell su cd sdcard/ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system cat yourapp.apk > /system/app/yourapp.apk chmod 644 /system/app/yourapp.apk reboot

jpa - Default name for database objects -

i'm trying find out column name jpa uses when there's no explicit name set. example: @entity public class testtype { private boolean active; private character testtypecode; public boolean getactive() { return active; } public void setactive(boolean active) { this.active = active; } @id public character gettesttypecode() { return testtypecode; } public void settesttypecode(character testtypecode) { this.testtypecode = testtypecode; } } what name used primary key column, column name used property "active" , table name used. i'm looking specification of names jpa uses default. it chapter "2.13 naming of database objects" specifies ( jpa 2.0 spec ). this specification requires following regard interpretation of names referencing database objects. these names include names of tables, columns, , other database elements. such names include names resul...

ios - AudioSessionGetProperty deprecated, how to know device is silenced -

i'm trying detect user's device silenced or not ( button on side of phone ). found method detect this, audiosessiongetproperty deprecated in ios7. - (bool)deviceissilenced { cfstringref state; uint32 propertysize = sizeof(cfstringref); osstatus audiostatus = audiosessiongetproperty(kaudiosessionproperty_audioroute, &propertysize, &state); if (audiostatus == kaudiosessionnoerror) { nslog(@"audio route: %@", state) // "speaker" regardless of silent switch setting, "headphone" when headphones plugged in return (cfstringgetlength(state) <= 0); } return no; } anyone got solution this? according sound switch , there no public api detect state of silent switch, provide hack (using public apis , therefore believed ok ap store approval, still treated caution): http://sharkfood.com/content/developers/content/sound%20switch/

php - Eloquent select from database, get results newer than a given unix timestamp -

i select rows database newer specified unix timestamp specified in parameters. the column created_at datetime in table tracks . parameter $timestamp unix timestamp (an integer). so trying tracks::where('created_at','>=',$timestamp)->get(); returns tracks, no matter $timestamp specify. however can see type problem, , have tried different things writing 'unix_timestamp(created_at)' instead of created_at, no luck. so assume there elegant , simple way of doing this. can me? there 2 ways solve this. use tracks::where(db::raw('unix_timestamp(created_at)'),'>=',$timestamp) use datetime or carbon object. like this: $timestamp = carbon\carbon::createfromtimestamp($timestamp); tracks::where('created_at','>=',$timestamp)->get();

asp.net - SQL Server 2012 - Intermittant Timeout Issue -

i having darnest time trying figure out happening... a simple query alter procedure [dbo].[splistcounties] @pstatenumeric int select distinct a.county, a.countynumeric dbo.geolocations inner join dbo.zipcodes b on b.cityname = a.featurename , a.statealpha = b.stateabbr a.statenumeric = @pstatenumeric , a.county<>'' , a.countynumeric<>'' , (b.citytype = 'a' or b.citytype='d') order county asc if run query through analyzer literally takes less second. produces barnstable 1 berkshire 3 bristol 5 dukes 7 essex 9 franklin 11 hampden 13 hampshire 15 middlesex 17 nantucket 19 norfolk 21 plymouth 23 suffolk 25 worcester 27 if run query through vs2013 asp.net literally hangs , times out. i not understanding heck problem. i have standard dal has been developed query database ensure connections , transactions closed. doing little more complicated query town on same tables has no problem on same page. i have tr...

ios - storing NSData in an array -

i stored decoded base64 image in nsdata , want make array of it. used below code not working. please help! nsmutablearray * searchresultsimages = [[nsmutablearray alloc]init]; (int i=0; i<searchresults.count; i++) { nsstring *images = [[searchresults objectatindex:i] objectatindex:3]; [base64 initialize]; nsdata *data = [base64 decode:images]; [searchresultsimages addobject:data]; nslog(@"searchresultsimages: %@", searchresultsimages); }

javascript - How to close a dialog and return another link (not go back)? -

i want closed dialog open page2 not go page1. i tried bind pagehide event on dialog this, first goes page1 open page2, not direct open page2. $("#dialog").bind("pagehide", function() { $.mobile.changepage("#page2"); }); <div data-role="page" id="page1"> <div data-role="content"> page1 <a href="#dialog" data-iconpos="notext" data-transition="slide">open dialog</a> <a href="#page2" data-iconpos="notext" data-transition="slide">open page2</a> </div> </div> <div data-role="page" id="page2"> <div data-role="content">page2</div> <a href="#page1" data-iconpos="notext" data-transition="slide">open page1</a> </div> <div data-role="dialog" id="dialog"> <div data-role=...

uiimage - Fetch image from url in iOS -

i'm trying fetch image url , show in imageview. image encoded in base64encoded data. using following code it uiimage *image = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:url scale:2.0]; [imageview setimage: image]; can 1 suggest problem in it. one strong possibility datawithcontentsofurl failed whatever reason. should use datawithcontentsofurl:options:error: instead , perform error handling. edit : in fact, shouldn't use nsdata methods @ downloading image data. apple docs state suitable local resources , recommend use nsurlsession method when downloading: (nsurlsessiondatatask *)datataskwithurl:(nsurl *)url completionhandler:(void (^)(nsdata *data, nsurlresponse *response, nserror *error))completionhandler

google app engine - How to use Blobstore Services File upload with JQuery? -

i trying upload file blobstore jquery / ajax. there possibility of uploading file blobstore jquery or ajax in java application? read docs server side blob upload . see client side: sending multipart/formdata jquery.ajax

Does pixate/freestyle font-family changes font size as well? -

when set font-family labels, fonts resized predefined size. label{ font-family: "verdana"; } is there way set font-family , keep original font-size defined in storyboard file? i've seen issue well, , don't think there fix. you might consider few other options: instead of setting custom sizes on labels, add pixate styleclass instead. can whatever want customize label style in css. if font size set on specific labels in storyboard, use verdana in storyboard's font selector , don't use pixate: http://d.pr/i/pqcb i hope helps.

git - How to hide the access keys of aws amazon productively in VagrantFile file -

i have vagrant + puppet project in public git had problems sending access_key_id public keys , secret_access_key along vagrantfile file. crackers used aws in name. since remove keys before updating online git, , every time need add keys in file again if want manipulate machines in aws. is there way vagrant recognizing these variables using environment variable? in way can declare outside file , every time make "vagrant up" machine automatically load values ​​without need add in hand? i use ubuntu "12:04" in machines. thanks. yep, think can use environment variables this: access_key_id -> aws_access_key secret_access_key -> aws_secret_key you can see in source code of vagrant-aws .

c# - Async call to a WebService method (Completed() methods not created) -

i'm using vs2013 ultimate on windows 8.1 create metro app consumes data webservice (the webservice methods not marked async). i've seen lot of examples on here using async() , completed() methods but: once add service reference service contains [methodname]async() methods can't find anywhere [methodname]completed() methods. clientwebservicesoapclient service = new clientwebservicesoapclient(); service.openasync( ); task<callmethodresponse> methodtask = service.callmethodasync(new callmethodrequest(new callmethodrequestbody("parama", "paramb", ""))); bool returnvalue = methodtask.result.body.callmethodresult; service.closeasync(); this, obviously, not work. how can result of callmethodasync() if don't have possibility put handler on callmethodcompleted()? and also, why i'm not having completed() methods?

.net - What is the difference between CommandTimeout and QueryTimeout on the app.config file when using the iSeries Access ODBC Driver? -

i working .net console application who's iseries datasource moved. after move application experienced timeouts led me believe 1 of timeouts needed increased (and yes network connections optimized). this part of error console application started generating: error message: error [hy000] [ibm][system access odbc driver][db2 i5/os]sql0666 - sql query exceeds specified time limit or storage limit. when increased commandtimeout in code 60 120 worked. think it'd ideal set timeout @ connection string removed line. at connection string added querytimeout=120 . when ran program, received above error once again. fyi, here's connection string looks like: "driver=iseries access odbc driver;system=x.x.x.x;uid=something;pwd=something;querytimeout=120" what noticed doing data fetch seemed not timeout when querytimeout set 0 on connection string. setting else fail. meanwhile commandtimeout property in .net code changed needed , work. bringing me questi...

javascript - angular scope in controllers + directives -

i'm new angular , i'm having issue scope between directive , controller. here code: controller: var myapp = angular.module('myapp', []); myapp.controller('testctrl', function ($scope, $http) { $scope.dosomething = function() { alert("testing scope"); }; }); directive: myapp.directive('keyevents', function($document) { return { restrict: 'a', link: function(scope, element, attrs) { $document.on('keypress', function(e) { switch (e.keycode) { case (49): dosomething(); break default: } }); } }; }); html: <script src= "js/main.js"></script> <script src = "js/keyevents.js"></script> <body ng-app ="my...

android - Changes to the layout of item at position 0 of the gridview -

i have gridview inflating relativelayout . consider example of layout: 0 1 2 3 4 5 ...... ...... i have progress bar in layout, want apply layout @ position 0. , update using async task after adapter set. ofcourse gridview cannot access view @ position 0 , show/hide progressbar whenever gets rendered again. should in order fix layout of first child of gridview , not let change whenever user scrolls through items? this method of getview() : public view getview(int position, view convertview, viewgroup parent) { viewholder holder = null; if (convertview == null) { convertview = inflater.inflate(r.layout.gridview_tvguide, null); holder = new viewholder(); holder.image = (imagebutton) convertview.findviewbyid(r.id.image); holder.showtitle = (textview) convertview .findviewbyid(r.id.showtitle); holder.showduration = (textview) convertview .findviewbyid(r....

c# - How to identify which button is clicked in dynamically allocated buttons in Window Store App -

i developing windows 8 app. buttons dynamically populated in listview. i've created click event, how identify button selected? code wrote not working, here is textblock lblusername = new textblock(); lblusername = (textblock)lstpeoples.findname("lblusername"); pagetitle.text = lblusername.text; the xaml code list view follows <listview x:name="lstpeoples" horizontalalignment="left" height="571" margin="34,47,0,0" grid.row="1" verticalalignment="top" width="455" selectionmode="multiple" background="{staticresource comboboxitemdisabledforegroundthemebrush}" borderbrush="white"> <listview.itemtemplate> <datatemplate> <grid height="80"> <grid.columndefinitions> <columndefinition width="120" /> <columndefinit...

mysql - How to pass multi word string as a variable used in url in php -

i making voice dictionary. here code.its working fine no errors slight problem. line towards end have problem. http://tts-api.com/tts.mp3?q=$z";?>" type="audio/mp3" /> $x , $y variables contain single word ..so converted speech without need of encoding , code works fine them. when write $y stores meaning , speech output not there meaning contains multi word string has encoded first ( dont know how encode it). plz tell me changes have in order convert meaning part text speech. i tried http://tts-api.com/tts.mp3?q=.urencode($y)"; ?>" type="audio/mp3" /> but didnt work. plz help <html> <head> <title>word meanings</title> <?php mysql_connect("localhost", "root", "radhika"); mysql_select_db("dictionary"); if(isset($_post['submit1'])) { $req=$_request['word']; $strsql = "select * dict word='$req'"; $rs = mysql_query($str...

c - typedef a function interface (not function pointer) -

if typedef this: typedef int (read_proc_t)(char *page, char **start, off_t off, int count, int *eof, void *data); as defined here what technique called? if typedef way, means create type read_proc_t ; later, create own version of read-proc-t , my_read_proc , have struct this: struct test { read_proc_t read_proc; } struct test t; i can this: t.read_proc_t = my_read_proc; is correct? normally, if typedef read_proc_t function pointer: typedef int (*read_proc_t)(char *page, char **start, off_t off, int count, int *eof, void *data); i have assign my_read_proc function address function pointer, this: (*t.read_proc_t) = &my_read_proc; in circumstance choose one? the difference in first case type read_proc_t not implicit pointer semantic, while in second case becomes pointer type. the difference between 2 variables of first type cannot created in contexts. example, illegal define struct th...

ibm mobilefirst - how to upload the image in worklight -

how can upload image sql database? current mysql query: create table upload ( id int not null auto_increment, name varchar(30) not null, type varchar(30) not null, size int not null, content mediumblob not null, primary key(id) ); html file <form method="post" enctype="multipart/form-data"> <input type="hidden" name="max_file_size" value="2000000"> <input type="file" id="userfile" name="userfiles"> <br> <input type="submit" id="upload" value="uploadimage "name="uploads"onclick="upload()"> </form> i don't know sql query, doesn't tell much. what need base64 encode image , save string database. when want pull image , display it, need decode string image.

dart - AngularDart routes: Optional parameter -

is possible setup optional route parameters without setting secondary route? want set simple rest type interface path defined such: reports/:reporttype/:reportid navigating reports/:reporttype allow listing completed reports of specified type , navigating full path bring specific report. first portion have working fine, i'm unable determine how make last segment optional. using following route definition, enter method called when parameters specified: void routesinit(router router, routeviewfactory view) { view.configure({ 'report' : ngroute( // :rptid cannot null (aka not provided) path: '/reports/:rpttype/:rptid', enter: (routeenterevent e) { print(e.parameters); }) }); } i've tried standard type optional braces around :rptid such parents /reports/:rpttype(/:rptid) , square braces /reports/:rpttype(/:rptid) no avail. i've tried following: void routesinit(router router, routeviewfactory...

java - Jsoup - How to choose an action of a form from several actions, then selecting an option -

i using jsoup develop application. code below not able specific action (that choose each time) , select option drop down menu. please me explain why not working.....or suggest me other way.... html code .. acct selected default. how select option? <form name="prod_sel" action="course_open4.asp" method="post"> <p><select name="course" size="1"> <option value="acct" selected>acct</option> <option value="ae">ae</option> <option value="arc">arc</option> <option value="are">are</option> </select></p> after selecting option, want submit form , go next page <p align="center"><input type="submit" value="submit" name="b1"></p></form> this second action , submission button <form name="prod_sel" action="course_open3.asp" me...

windows phone 8 - Debug with the emulator -

i trying modify icon in manifest file. when tried debug, error: the application not launched debugging. ensure target device screen unlocked. what have do? similar issue presented here: http://blogs.msdn.com/b/wsdevsol/archive/2013/08/17/top-5-commonly-encountered-issues-and-solutions-using-the-windows-phone-8-emulator.aspx

php - Fetching and printing a single value from database using laravel -

i'm trying create settings page creating table settings company_name column. idea fetch single value company_name , print in title of pages , name going appearing. not sure how convert array return db::select able print correctly. the code: public function __construct() { $company_name = db::table('settings')->select('company_name')->get(); return view::share('company_name', $company_name); } and print in blade system {{ $company_name }}, although can't convert array string. either use eloquent (that recommend) : $company_name = setting::first()->company_name; or using fluent : $company_name = db::table('settings')->company_name;

java - Oracle - Multi-line SQLs via JDBC - Apex SQL Workshop or SQL Plus -

through java/grails webapp, i'd have form/program allows user upload sql file (or paste contents) , have executed. sql workshop in oracle apex does. ideal solution if embed sql workshop comes in apex within webapp. i've seen posts regarding multi-line sql files.. involve parsing semi-colons, , couldn't find 1 seemed handle , declare-begin-end blocks , oracle ddls @ same time. plus, seem try re-invent sql plus does. being able invoke sql plus great, i'm not sure there's way cleanly through web-app? questions: 1) there anyway "embed" sql workshop comes apex within custom web-app? 2) if not... there "clean" way invoke sql plus through grails/java web-app? 1 platform independent? please feel free provide feedback... i'm new web development appreciate advice.

javascript - In .net, how can I download this remote file -

i trying build marquee reads remote rss feed. ajax request failing due can assume cross domain restrictions. here code: $(function () { $.ajax({ url: 'http://www.theleafchronicle.com/section/news01&template=rss_weblogs&mime=xml', datatype: 'xml', type: 'get', success: function (xml) { $(xml).each(function () { var title = $(this).find("title").text(); var des = $(this).find("description").text() + ' - '; var wrapper = "<span class='single-feed'></span>"; $(".feed-container").append($(wrapper).html(des)); }); }, error: function (err) { } }); }); this code failed, instead tried downloading xml locally , worked. concern how can download code via batch file or possibly .net executable? have tried system.net.webclient.downloadfile method , brings page instead of intended xml. ...

php - Laravel - Create method that can be called both statically and non-statically -

i wanted create method in user model behaves differently when called statically or non-statically. should this: public function foo() { // based on http://stackoverflow.com/questions/3824143/how-can-i-tell-if-a-function-is-being-called-statically-in-php if(isset($this) && get_class($this) == __class__) { $static = true; } else { $static = false; } if($static) $user = auth::user(); else $user = $this; // stuff user return $user->bar; // ... } but gives me error: non-static method user::foo() should not called statically, assuming $this incompatible context . basically: you can call static methods non-static method not vice versa. so can use magic methods this: public function __call($method, $args) { return call_user_func(get_class_name($this) .'::'. $method, $args); } like this, can call every static method syntax of non-static method.

knockout.js - Knockout Validtion - Hide error messages -

i never want error messages appear on view (i using toastr display errors generated knockout validation). in code, using: insertmessages: false. suppresses errors unless user enters data in required field, removes data, , tabs out of control. can't figure out how hide error messages when user tabs out of input control. here code excerpts- viewmodel- lcamount: ko.observable(lcamount).extend({ insertmessages: false, required: { message: 'lc amount required' } }) var saveall = function () { try { var goahead = true; var changes = false; saveflag(true); ko.utils.arrayforeach(loandetails(), function (item) { if (item.lcamount != '') changes = true; if (item.errors().length > 0) { goahead = false; logerror("errors on form: " + item.errors(), item, true); } ...

navbar - Collapse navigation bar issue in bootstrap 3 -

Image
went through suggestion adding navbar-right, still getting it. html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bootstrap practice</title> <!-- bootstrap --> <link href="css/bootstrap.css" rel="stylesheet"> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!-- warning: respond.js doesn't work if view page via file:// --> <!--[if lt ie 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <bo...

MySQL date fetched with one hour behind from PHP -

hi please me one. , dont downvote because have done research, did not find anything. i have weird issue mysql datetime fields in correct daylight saving times. when select them through php still in winter time, meaning minus 1 hour. how can fix this? update timezone gmt+1 correct. mysql db correct. this not mysql. it default php timezone settings. see http://www.php.net/manual/de/function.date-default-timezone-set.php

Are these button native from the google maps component in Android? -

Image
the app cups , when click marker appears 2 button one route , 1 navigation i search google maps api v2 android , didnt find native. is function , if there isnt, how can that? thanks! no not built maps api did create image looks location button. have create view lays ontop of map position them want

c# - Designer Issue + Entity Framework (WPF MVVM) -

background, wpf project uses entity framework when run works fine, designer gives following error. unhandled exception specified named connection either not found in configuration, not intended used entityclient provider, or not valid. i have coped connection string ui still problem i have following binding datacontext="{binding source={x:static viewmodel:viewmodellocator.mainwindowviewmodelstatic}}" which relates class initialises new mainwindowviewmodel(new uidataprovider()); which has following private readonly iuidataprovider _dataprovider; private ilist<customer> _customers; public ilist<customer> customers { { if (_customers == null) { getcustomers(); } return _customers; } } public mainwindowviewmodel(iuidataprovider dataprovider) { _dataprovider = dataprovider; tools = new observablecollection...

android - Center textview below image view -

Image
i need center textview below image view. row screenshot getting now: i need put textview text "30" below image view thumbs hand, , centered. height position fine now. like this: this layout file: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#5981b2" android:orientation="vertical" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="2dp" android:src="@drawable/facebook" /> <imageview android:id=...

AngularJS directive dynamic templates -

sorry, maybe it's stupid question i'm still learning. i'm trying make directive differtent templates based on scope value. this done far don't know why doesn't work http://jsbin.com/mibeyotu/1/edit html element: <data-type content-attr="test1"></data-type> directive: var app = angular.module('myapp', []); app.directive('datatype', function ($compile) { var testtemplate1 = '<h1>test1</h1>'; var testtemplate2 = '<h1>test2</h1>'; var testtemplate3 = '<h1>test3</h1>'; var gettemplate = function(contenttype){ var template = ''; switch(contenttype){ case 'test1': template = testtemplate1; break; case 'test2': template = testtemplate2; break; case 'test3': template = testtemplate...

jsf 2 - How to add multiple message validation in only one growl message -

i have p:growl show message validation, shows growl each message validation, there way show multiples messages validation in 1 message p:growl? it's how growl works. each message appear in own panel. don't think can change unless develop custom growl component on own , put <p:messages> in :)

c++ - how to synchronize N processes -

q1. (see code below) if comment while loop. can communicate through ipc. why while loop, i'm getting no output? q2. there better way communicate between processes rather using pipe, (through signals or semaphores if yes kindly provids examples. #include <iostream> #include <unistd.h> #include <sys/wait.h> #include <stdlib.h> using namespace std; int main(){ int person_from_whom_token_starts =1; bool started = false ; int tok_value = 3; int ivetoken = 4; int tok_value_const = 5; int x; bool y; int fd[2]; int status = 0; pipe(fd); switch(fork()){ case -1: cout << "errr" << endl; break; case 0: close(fd[0]); dup2(fd[1],1); while(1){ cout << person_from_whom_token_starts << started << tok_value << ivetoken << tok_value_const; sleep(3); }...

javascript - Why is a URL in the middle of a function not causing an error? -

by mistake, url pasted javascript snippet. reduced minimum, looked this: function(){ /* bunch of code */ http://www.stackoverflow.com /* bunch of code */ return "it still works"; } it overlooked quite time, because did not produce error. why that? why function still run without erroring? you're defining label called http . // in url comments rest out. see: https://developer.mozilla.org/en-us/docs/web/javascript/reference/statements/label

php - How To Get The Last Entry From MYSQL Database? -

i trying last id entered database. here code use: $test_query = "select * table order id desc limit 1"; if ( mysql_query($test_query) ) { echo 'ok!'; $results = mysql_fetch_array($test_query); echo $results['id']; print_r ($results); } the output have 'ok!'. what do wrong? you need use output of mysql_query in mysql_fetch_array . $res = mysql_query($test_query); if ($res === false) { throw new exception("query failed"); } $row = mysql_fetch_array($res); echo $row["id"]; keep in mind reads one row. if want more use while loop construction can find here: http://php.net/mysql_fetch_array if did insert query use mysql_insert_id() fetch id. feature of mysql. works in conjunction auto_increment option. also, if new site you're building use mysqli_* functions instead of mysql_* . latter deprecated.

html - Knitr, convert to base64 and CSS style -

i'm little new great library (and html) might noob question. i have situation i'm unable figure out - how can add css styling image while encoding in base64? code in rmarkdown file (which pass knit2html ) - <img src="someimage.png", width = "75%", border = "2"> # converts base64 width , border correctly applied <img class="displayed", src="someimage.png"> # not convert base64, points local path style correctly applied is there way second 1 convert base64 while applying style too? or doing wrong? sessioninfo , if needed - > sessioninfo() r version 3.0.2 (2013-09-25) platform: x86_64-w64-mingw32/x64 (64-bit) other attached packages: [1] markdown_0.6.5 xtable_1.7-1 knitr_1.5 audio_0.1-4 ggplot2_0.9.3.1 [6] scales_0.2.3 stringr_0.6.2 reshape2_1.2.2 reshape_0.8.4 plyr_1.8 [11] data.table_1.9.2 thanks! try this: <style> .displayed { border: solid...

Android MediaPlayer/VideoView error (1, -2147483648) -

i've been having inconsistent experience setting videoview's video file path. videoview myvideoview = findviewbyid(r.id.videoview); ... myvideoview.setvideopath(videofilename); ... myvideoview.start(); videofilename absolute path of video in cache directory: string videofilename = new file(context.getcachedir(), "myawesomevideo.mp4").getabsolutepath(); in android sdk >= 16 (jelly bean), works fine , awesome video plays. in android 4.0.4 (sdk = 15), mediaplayer breaks when myvideoview.start() called. the error ever-unhelpful: error (1, -2147483648) what missing here? loading file directly package assets (res/raw) or internet ( http://something.com/myawesomeinternetvideo.mp4 ), can't figure out how read files out of cache directory! as turns out, error -2147483648 indicates unknown error. have video encoding, it's worth checking file path exists and videoview has permission read it . my issue was writing files context.mode_priv...

ios - Proper way to dispose of CAKeyFrameAnimation -

Image
what's proper way dispose of cakeyframeanimation has custom events? made test project demonstrating i'm doing in simplest way possible. here xamarin studio project here xcode instruments memory allocations trace to reproduce did during memory allocations trace, run project. press green button 10 times. (every time press green button, blue square animates). evaluate memory usage. notice in createanimationeventhandler_position_animationstopped function, i'm disposing of animation. but notice instruments telling me have ton of non-objects leaking memory... what's causing that? , how dispose of cakeyframeanimations correctly? i tried few different ways dispose of it. here results. after 10 button presses around 30-100kb of non-objects absorbing memory. must doing wrong. and here's code @ (but it's in project attached): public override void viewdidload () { base.viewdidload (); // perform additional setup after l...