Posts

Showing posts from May, 2015

c - Taglib for Android -

i trying compile taglib android. have downloaded latest version taglib here . after compiling arm-linux build have imported in application, when try call function tag_c.h getting following error: sharedlibrary : taglibwav.so /home/test/workspacenew/androidtaglibexample/obj/local/armeabi/ objs/squared/taglibwav.o: in function `java_com_android_androidtag_wavfiledetails_taglibwav': /home/test/workspacenew/androidtaglibexample/jni/taglibwav.c:30: undefined reference `taglib_set_strings_unicode' collect2: ld returned 1 exit status make: *** [/home/test/workspacenew/androidtaglibexample/obj/ local/armeabi/taglibwav.so] error 1 application configuration information is: taglib ./configure :- ./configure cc="/home/hcl/taglib/taglib/toolchain/bin/arm-linux-androideabi-gcc"\ --host="arm-linux" \ --build="arm" \ --enable-static="no" \ --enable-shared="yes" \ --prefix="/home/test/workspacenew/androidtaglibexample/j

marshalling - Grails JSON marshaller for FieldErrors -

i'm trying create custom marshaller org.springframework.validation.fielderror can avoid putting extraneous , possibly sensitive data in json response, includes mycommandobject.errors . however fielderror marshaller isn't working @ all, have in bootstrap.groovy under init method. def fielderrormarshaller = { log.info("field error marshaller $it") def returnarray = [:] returnarray['field'] = it.field returnarray['message'] = it.message return returnarray } json.registerobjectmarshaller(fielderror, fielderrormarshaller) i not seeing explicit errors or marshaller logging. idea might going wrong here? grails register instance of validationerrorsmarshaller handle errors, fielderror marshaller never called. //convertanother not called each error. that's reason of custom marshalled not been called. (object o : errors.getallerrors()) { if (o instanceof fielderror) { fi

c++ - delete via a pointer to Derived, not Base -

i implemented basic smart pointer class. works following type of code. (considering base1 has public constructor) sptr<base1> b(new base1); b->myfunc(); { sptr<base1> c = b; sptr<base1> d(b); sptr<base1> e; e = b; } but in test code has protected constructor(i need way). , code sptr<base1> sp(new derived); produces following error (notice derived): sptr.cpp: in instantiation of ‘my::sptr<t>::~sptr() [with t = base1]’: sptr.cpp:254:39: required here sptr.cpp:205:9: error: ‘base1::~base1()’ protected sptr.cpp:97:17: error: within context the problem have make sure delete via pointer derived, not base1. how can that? here class code (clipped show constructor , distructor , class members) template <class t> class sptr { private: t* obj; // actual object pointed rc* ref;// reference object keep track of count public: //declarations template <typename t> sptr<t>::sptr():obj(null),ref(

php - Using preg_match or regx to replace a lot of words inside a html -

is there solution me convert html of following format <span xmlns:v="http://rdf.data-vocabulary.org/#"> <span typeof="v:breadcrumb"> <a href="http://link1.com/" rel="v:url" property="v:title">home</a> </span> / <span typeof="v:breadcrumb"> <a href="http://link2.com/" rel="v:url" property="v:title">child 2</a> </span> / <span typeof="v:breadcrumb"> <a href="http://link3.com/" rel="v:url" property="v:title">child 3</a> </span> / <span typeof="v:breadcrumb"> <span class="breadcrumb_last" property=&

perl - Process two space delimited text files into one by common column -

this question has answer here: merge 2 files key if exists in first file / bash script [duplicate] 2 answers i have 2 text files like: col1 primary col3 col4 blah 1 blah 4 1 2 5 6 ... and cola primary colc cold 1 1 7 27 foo 2 11 13 i want merge them single wider table, such as: primary col1 col3 col4 cola colc cold 1 blah blah 4 7 27 2 1 5 6 foo 11 13 i'm pretty new perl, i'm not sure best way this. note column order not matter, , there a couple million rows. files unfortunately not sorted. my current plan unless there's alternative: given line in 1 of files, scan other file matching row , append them both necessary new file. sounds slow , cumbersome though. thanks! solution 1. read smaller of 2 files line line, using standard cpan delimited-file pa

html5 - Assigning value of 'this' in JavaScript constructor -

i'm learning javascript , i'm playing html5 canvas api. since first have create canvas element, , 2d/3d context (which 2 unconnected variables) seemed logical create merge 2 one. idea have graphics ( gfx ) object (which context object) , graphics.canvas reference canvas element can gfx.fillrect(0,0,150,75); , maybe re size canvas gfx.canvas.width = x; etc... when try create constructor function, doesn't work out, have come solution return context object canvas property i'm not sure if right way. what best approach problem? here's code: function canvas (context, width, height) { var canvas = document.createelement('canvas'), contex = canvas.getcontext(context); = contex; // <<-- getting error here this.canvas = canvas; this.canvas.width = width; this.canvas.height = height; this.append = function () { document.body.appendchild(this.canvas); }; } function canvas2 (context, width, height) {

php - class variable functions -

say $this->varname equal string is_callable() returns true. call i'd have $temp = $this->varname; $temp(); or... there way call without having create 2 lines? the problem doing $temp = $this->varname() that'll try call method within class called varname() - won't call function @ $this->varname. thanks! you have or use call_user_func(_array) . or anthony has suggested me on internals ( http://www.mail-archive.com/internals@lists.php.net/msg64647.html ) can ${'_'.!$_=$this->varname}(); . there exists pull request php being discussed on internals: https://github.com/php/php-src/pull/301 (and rfc https://wiki.php.net/rfc/fcallfcall )

unix - Automatic generation of AC_CONFIG_FILES input -

when creating configure.ac file standard practice seems to explicitly hard code list of makefiles should created corresponding makefile.in. seems should not necessary, list generated sort of glob specification (e.g. */makefile.in ) or shell command (e.g. find -name makefile.in ). unfortunately doesn't seem facility built autoconf! i'm new m4 haven't come across running shell commands generate m4 input values. can hacked generating configure.ac file cat -ing files , shell commands seems unnecessarily complex. is there standard way of doing this? if not why not? there issues? despite comments ended doing anyway. didn't mention in question autogeneration being done, in ad-hoc way ( cat ing various files, of generated on fly, create configure.ac) , wanted clean up. in build script have: confdir="config/configure.ac_scripts" # generate sorted list of makefiles in project, wrap # autoconfigure command , put file. makefile_list="$(find -typ

html - Adding drop down effect on css menu -

* i exhaustedly searched site answer before posting question, attempted multiple solutions , nothing worked exact codes. while may find duplicate questions on site. don't consider duplicate unless coding same solutions. nothing on site worked exact coding therefore needed post exact code help. * i have menu looks 1 below. , drop down on it. right nested ul spreads throughout page. needs show in nice drop down section under administration. have tried searching , asking colleagues none of them have done before. have created jsfiddle here: http://jsfiddle.net/z3lpm/ <div id="menu"> <ul> <li><a href="#">home</a></li> <li><a href="#">administration</a> <ul> <li><a href="#">products</a></li> </ul> </li> </ul> </div> (not full menu point.) and css: #menu{ width: 100%; border: 1px s

java - SQlite WHERE statement not working? -

i making app stores books titles, date added , date book needs returned by. below, show where statement gets books due returned between today's date , 2 days hence, returned listview. not work, however, , i'm not sure i'm going wrong: public cursor fetchalldue() { //get todays date calendar cal=calendar.getinstance(); int currentday=cal.get(calendar.day_of_month); //add days on todays date cal.set(calendar.day_of_month, currentday+2); cal.gettime(); //result //format string string formatteddate = new simpledateformat("dd-mm-yyyy hh:mm").format(cal.gettime()); //get todays date calendar cal1=calendar.getinstance(); int currentday1=cal1.get(calendar.day_of_month); //atodays date cal1.set(calendar.day_of_month, currentday1); cal1.gettime(); //result //format string string formatteddate1 = new simpledateformat("dd-mm-yyyy hh:mm").format(cal1.gettime()); //body = date added,

sql server - Data gets truncated while inserting JSON data -

Image
i have sql table has 'text' datatype. trying insert json data using cfqueryparam cf_sql_longvarchar, have in coldfusion variable. however, when checked value in column, i'm losing data. compared total length of column insql table data being held. i've enough datalength left in column. this has settings in datasource under cf admin. i mess clob , char buffer values , see can come with.

c# - Request.Params to String gives incomplete data -

don't know if character encoding issue i made post request asp.net page, send xml, in order value variable made this string selectionxml = httputility.urldecode(request.params["selection"]); this example of xml <?xml version="1.0" encoding="utf-8"?> <featureset> <layer id="0adcf012"> <class id="mytable"> <id>aaaaaaamvea=</id> <id>aaaaaac+5ea=</id> </class> </layer> </featureset> the problem is, when perform above sentence xml <?xml version="1.0" encoding="utf-8"?> <featureset> <layer id="0adcf012"> <class id="mytable"> <id>aaaaaaamvea=</id> <id>aaaaaac 5ea=</id> </class> </layer> </featureset> i.e. second id tag (aaaaaac 5ea=) appears without plus sign (+) unlike original xml (aaaaaac+5ea=) how can fix issue? edit: add more code, asp.net page

ruby on rails - Nested Attributes: unwanted validation despite of reject_if : All_blank -

i new rails advise appreciated. i have class entry nested attributes addresses, /app/models/entry.rb class entry < activerecord::base has_many :addresses, :dependent => :destroy accepts_nested_attributes_for :addresses, :allow_destroy => true, :reject_if => :all_blank end with class addresses this /app/models/address.rb class address < activerecord::base belongs_to :entry validates :zip, :presence => true end and in nested form have /app/view/entries/_form.html.slim = simple_form_for(@entry) |f| = f.error_notification - @entry.addresses.build .form-inputs = f.simple_fields_for :addresses |address| = render 'address_form', :f => address the idea when form rendered, 'build' create empty 'address' in addition current addresses listed in database. when changes saved, if new address created still empty, rejected , not saved database.

ruby - Editing file in Rails (using text area) -

i want edit file stored on hdd rails in way: 1. open file , load content 'text_area' (or other field can edit it) 2. edit content in 'text_area' 3. save changes file i have code here: 1) [controller] def show @myfile = file.read("/home/pi/www/web-svn/repositories/repo2/hooks/post-commit.tmpl") end 2) [view] <%= text_area_tag(:message, @myfile, :size => "100x60") %> 3) ??? here problem, how pass edited text controller again , save changes. if have better idea whole procedure can pass usefull code. in controller's edit() method, determine filename url , read file contents specified file instance variable (@myfile). render view, passed browser, edited user, , edited text passed server post data. rails puts post data params hash , calls controller's update() method. in update() filename determined url, modified contents retrieved params hash , written file. lather, rinse, repeat. added: this off t

c# - make server-client work unlimitedly -

how can make server , client run unlimitedly , able exchange data(meaning, until application closed), instead of run 1 exchange of information only. tried while(true) maybe didn't put on right place , can't reach methods closing , stopping socket , listener. here's of code of server: public static void startserver() { try { ipaddress ip = ipaddress.parse("192.168.1.11"); tcplistener mylistener = new tcplistener(ip, 8000); mylistener.start(); socket s = mylistener.acceptsocket(); byte[] b = new byte[100]; int k = s.receive(b); ... other actions ... s.close(); mylistener.stop(); } and then main() invoke it. client same story. you can create infinite loop contains receive function processing data, , returns receive. way server excepts data client until server, or client t

c# - Match all words in any order -

how match search string every word using linq? i.e. "apple orange" should match on "orange apple" not "apple orange fred". this query here works find if single word matches, not work all() words matching. var match = "apple orange pear".split() .intersect("orange pear fred".split()) .any(); the idea similar thread. word-wise super string search given string check if each word exists in check list: var words = "orange pear fred".split(); var wordstocheck = "apple orange".split(); var match = words.all(w => wordstocheck.contains(w)); or produce difference of 2 sequences. if there no elements in difference, words in check list: var match = !words.except(wordstocheck).any();

ruby - Rails: Adding methods to ActiveRecord models -

i'm writing first rather simple ruby on rails (3.2) application. idea manage email accounts. schema rather simple: t.string "email" t.string "password" the activerecord model defined as: class mailuser < activerecord::base attr_accessible :email, :password i've been using scaffolding form_for(@mailuser) , @mailuser.update_attributes(params[:mailuser]) magic. works well. now quirk user should allowed edit user part (e.g. "foo") of email while domain (e.g. "example.org") must stay untouched. email field contains complete email address (e.g. "foo@example.org"). in edit form don't display fields email password but rather userpart password where userpart shown @mailuser.userpart (editable) + domain (not editable). so thought i'd solve adding getter , setter user part this: class mailuser < activerecord::base attr_accessible :email, :password # getter user part (left o

android - Best way to display top level list -

i working on first android application. right uses fragments separate between main sections of app (error code lookup , deal of week fragments) , want create third fragment of our common programming information. in programming information have several brands (of equipment use) display lot of details (which phone number, port, ssl options, etc, use). i looking @ expandablelistview thinking maybe might best way, wondered if there might option. because don't way expandablelistview looks. feels outdated compared rest of ui using holo , actionbar. any suggestions? love "sub-fragment" layout if exists. you may want libs in github. there lot of diferent way of displaying things... : stiskylistheaders emilsjolander https://github.com/emilsjolander/stickylistheaders .... you can see of libs curently used , stable in app : "libraries developers" it's on store

c# - Can I suppress this message? >> One or more applications are using the iTunes scripting interface -

i writing small c sharp program interface itunes using itunes windows com api. program has running before itunes starts , after itunes closes down. want detect when itunes closes down using onquittingevent. private void itunes_onquittingevent() { // remove handlers itunes com object. app.onplayerplayevent -= itunes_onplayerplayevent; app.onquittingevent -= itunes_onquittingevent; bnitunesrunning = false; // release com object. app = null; console.writeline("itunes closing!"); } however c sharp program running, when close down itunes warning message: "one or more applications using itunes scripting interface" , 20 second countdown before itunes closes. my question: can use itunes windows com onquittingevent event handler sort of un-instantiate itunesapp object reference in c sharp code @ point of me closing down itunes application , not have warning message appear on screen?? there way supp

objective c - What does CALayer know that I do not when zooming -

Image
how can draw smoothly calayer while zooming? as seen in third (tallest) image white border drawn accurate, anti-aliased rendering. however neither labels (even though set contentscalefactor ) nor hand drawn circles (even though turn anti aliasing on) are. how can have anti-aliased rendering either uikit components or hand-drawn graphics scale zooming factor smoothly calayer does? what's magic? the white border drawn using view's calayer: self.layer.cornerradius = frame.size.width / 2.0f ; self.layer.bordercolor = [uicolor whitecolor].cgcolor ; self.layer.borderwidth = 3.0f ; the numbers uilabel's cgfloat contentscale = self.zoomscale * [uiscreen mainscreen].scale; // handle retina label.contentscalefactor = contentscale; and given: typedef struct { cgrect rect ; cgcolorref color ; } eventcolor ; the 4 circles drawn using coregraphics ::cgcontextsetallowsantialiasing(context, true) ;

Python Data Structure Recommendations for a 2D Grid -

i looking implement ant colony optimization algorithm in python, though new both python , object oriented programming learning curve has been rather steep. @ point, stuck how address following situation: as ants walk around 2d grid, encounter obstacles, pheromone deposits other ants, food, etc. data structure use represent 2d world , aforementioned properties of each cell? i had tried 2d array, thinking array[x-coord][y-coord] point {} (dictionary) appropriate properties (obstacle: 'yes / 'no', pheromone level: x %, etc.) . unfortunately, though numpy lets me create 2d array, cannot assign dictionary objects various coordinates. from numpy import * myarray = array([[1,2,3,4], [5,6,7,8], [9,10,11,12]]) myarray[2][2]={} returns: traceback (most recent call last): file "/users/amormachine/desktop/pythontest.py", line 7, in <module> myarray[2][2]={} typeerror: long() argument must string or number, n

c# - Invoke or BeginInvoke cannot be called Error -

i have program used clients world wide. check error logs , quite few seem having exception (listed below) thrown can't figure out or trace. i have invokes protected invokerequired. i'm thinking, if should use use if (handlecreated) instead. i not sure or when exception thrown. in start up, after initializecomponent();, have tasks require access controls such datagridview. however, said, try protect them invokerequired. not sure if that's place causing problem. what suggestions perform try , trace problem? anyway, exception: system.invalidoperationexception: invoke or begininvoke cannot called on control until window handle has been created. @ system.windows.forms.control.waitforwaithandle(waithandle waithandle) @ system.windows.forms.control.marshaledinvoke(control caller, delegate method, object[] args, boolean synchronous) @ system.windows.forms.control.invoke(delegate method, object[] args) @ system.windows.forms.control.invoke(delegat

c++ - Converting int to char* -

i'm creating matrix multiplied one. matrix values arguments (*argv[]). until created this: for(int i=0; i<2; i++) { for(int j=0; j<2; j++) { sec[i][j]=argv[gv]; gv++; } } for(int i=0; i<2; i++) { for(int j=0; j<2; j++) { int = (int)fir[i][j]; int b = (int)sec[i][j]; int r = a*b; res[i][j]=(char)(r); //the problem here } cout<<endl; } the problem code crashes when want show matrix. problem can in marked place. any ideas how solve simple problem? :) thanks in advance! the problem asked about as didn't show declarations can't tell sure, if crash occurs @ indicated position didn't reserve enough space res . sure declared this? char res[2][2]; other problems i'm not sure trying in first loop, if if the identifier argv references parameter passed main in: int main (int argc, char *argv[]) argv array of pointers strings not array of value of firs

c# - nested hashset of lists? -

i'm working on 1 of project euler problems, , wanted take approach of creating list of values, , adding list hashset, way evaluate in constant time if list exists in hashset, end goal count number of lists in hashset end result. the problem i'm having when create list in manner. hashset<list<int>> finallist = new hashset<list<int>>(); list<int> candidate = new list<int>(); candidate.add(5); finallist.add(candidate); if (finallist.contains(candidate) == false) finallist.add(candidate); candidate.clear(); //try next value obviously finallist[0] item cleared when clear candidate , not giving me desired result. possible have hashset of lists(of integers) this? how ensure new list instantiated each time , added new item hashset, perhaps in loop testing many values , possible list combinations? why don't use value unique each list key or identifier? create hashset keys unlock lists.

sockets - Google Chrome Packaged App - FTP mechanism -

i'm looking perform simple ftp retr of image @ known server location within google chrome packaged app. i'm exploring following avenues: xmlhttprequest (which throws exception 101: cross domain allowed http) tcp chrome.socket.write (sends packets ok, no way receive tcp data? edit: wrong ) websockets (which throws exception 18: websocket port 21 blocked) <webview> (pulls data alright in sandboxed process, no way intercept it) i've tried considering other possible approaches (my device runs telnet server on port 23) don't think there shortcuts here. could chrome app possibly capture webview's pixeldata in html5 canvas? have overlooked other communications mechanisms? guidance appreciated. edit: apsillers/sowbug's comment per chrome.socket.read has reopened avenue #2. woops! using on port per pasv response allowed me perform stream , retrieve image data - thanks. if helps else, here's beginnings of socket object , ftp client run

php - Basic Regular Expression for -

for reason stuck making past extremely basic regular expressions. i'm trying make regular expression kind of looks url. want basic checking. i match following patterns x "something". x://x.x x://x.x... etc. x.x x.x... etc if string contains 1 of these patterns, sufficient checking me. way url www.example.com:8888 still match. have tried many different regex combinations preg_match , cannot seem behave way want to. have consulted many other related regex questions on readings have not helped me. any help? happy provide more information if don't know else need. it takes practice here 1 made using regex tester ( http://www.regextester.com/ ) check pattern: ^.+(:\/\/|\.)([a-za-z0-9]+\.)+.+ my approach build pattern beginning , add on 1 piece @ time. cheatsheet extremely helpful remembering http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/ is. basically pattern starts @ beginning of string , checks characters

url - zend framework get id in /delete/2 -

i'm using zend, , wonder how id in such url : /delete/2 i know can using : // if url /delete/id/2 $request->getparam('id'); but want have url first 1 /delete/2 sounds more logical me. ideas? thanks help i think should able solve kind of problem using routes. can create route for /delete/2 by adding example config.ini file: [production] routes.delete.route = "delete/:id" routes.delete.defaults.controller = delete routes.delete.defaults.action = index routes.delete.id.reqs = "\d+" here specify url match, in words starting colon : variables. can see, can set requirements on variables regex-style. in example, id 1 or more digits, resulting in \d+ requirement on variable. this route point url index action of delete controller , sets id get-var. can alter .ini code suit specific needs. the routes can added putting following code inside bootstrap: $config = new zend_config_ini('/path/to/config.ini', &#

php - how can I make an object from string contains printed object -

i have code: test controller: class test extends ci_controller{ public function print_object(){ $x = (object) array('a'=>'a', 'b'=>'b', 'c'); echo '<pre>'.print_r($x, true).'</pre>'; } } test2 controller: class test2 extends ci_controller{ public function get_printed_object(){ $url = "http://localhost/project/test/print_object"; (object) $str = file_get_contents($url); echo $str->a; //won't make it. resulting error } } the line echo $str->a; was resulted warning : trying property of non-object is possible me re-make $x object printed string? the main issue have file_get_contents returns string output of url. $str therefore string , cast won't change that. if want convert object can json_encode

java - Should I split up my XStream converter per class? -

i working on program uses xstream write out xml. stands have 1 class implements converter. single converter takes in entire configuration hashmap @ root , value of each key new instance of vmwareserver class in turn has hashmap value of key new instance of vmwarevirtualmachine class. each of respective classes have methods setting , getting things ip address , port number . what wondering if proper way implement xstream converter, or should create separate converter convert each class xml on own? i can show code if there still questions mean. this debatable, argue having separate converter each class. has several benefits: if later need return subset of complete view, able decompose structure along class-based lines (perhaps, example, limit information permissions). if need return different representations in different contexts, can on class-by-class basis rather duplicating of presentational logic in monolithic class.

javascript - Assign ID to datatable row from json data -

i'm new datatable jquery plugin. got stuck more 2 days. have json data, still cant load table , want assign first column id of row here html: <table cellpadding="0" cellspacing="0" border="0" class="display" id="accdetailtable"> <thead> <tr> <th>currency</th> <th>current/savings account no.</th> <th>securities account no.</th> </tr> </thead> <tbody> </tbody> </table> and initialization var otable=$('#accdetailtable').datatable( { "bprocessing": true, "bserverside": true, "sajaxsource": contextpath + "/user/investorajax?method=getinvestoraccdetaillist", "ideferloading": 57, } ); return jsondata server : {"secho":1,"icolumns":4,"

c - storage size of isn’t known using sigaltstack struct -

i'm using sigalstack struct, details at: here (mac osx) here (linux) i'm declaring struct sigaltstack aa; and keep getting following error error: storage size of ‘aa’ isn’t known i read , checked storage size of ‘names’ isn’t known i'm declaring it, doesn't apply. you can't use uninitialized alternate stack that. have allocate space stack in ss_sp field , set corresponding size in ss_size field. the man7 link linked has more information on this. in fact, provides example @ bottom of page: stack_t ss; ss.ss_sp = malloc(sigstksz); if (ss.ss_sp == null) /* handle error */; ss.ss_size = sigstksz; ss.ss_flags = 0; if (sigaltstack(&ss, null) == -1) /* handle error */; hope helps.

database connection - ImportError: No localization support for language 'eng' in python -

i getting importerror: no localization support language 'eng' when using mysql connector python. traceback below. traceback (most recent call last): file \"db_module.py\", line 151, in querydatabase file \"\\share\app\modules\mysql\connector\__init__.py\", line 44, in connect file \"\\share\app\modules\mysql\connector\connection.py\", line 106, in __init__ file \"\\share\app\modules\mysql\connector\connection.py\", line 325, in connect file \"\\share\app\modules\mysql\connector\connection.py\", line 288, in _open_connection file \"\\share\app\modules\mysql\connector\network.py\", line 326, in open_connection file \"\\sfs\show_time\showtime_package\showtime\modules\mysql\connector\errors.py\", line 160, in __init__ file \"\\share\app\modules\mysql\connector\locales\__init__.py\", line 52, in get_client_error importerror: no localization support language 'eng' and curr

javascript - Length of Quadratic Curve -

i have bezier curve on html5 canvas , need figure out length of curve. how can easy? lets : var canvas = document.getelementbyid('mycanvas'); var context = canvas.getcontext('2d'); context.beginpath(); context.moveto(188, 130); context.beziercurveto(140, 10, 388, 10, 388, 170); context.linewidth = 10; how can figure out length of curve have created? //t you'll have find mathematically, using parameters pushed in. use reference: calculate length of segment of quadratic bezier

objective c - Label outside the tableView in the same view Controller does not scroll along with table View -

i want label , table view inside same view controller. have added objects in storyboard problem label not scrolling along table view. tried putting label , table view in scroll view doesn't scroll view doesn't scroll. can please tell me how can scroll label along table view. thanks in advance.

magento - Category coming at inappropriate place -

Image
i worked on this , live now. please have @ it. problem category named "carbide rod" not assigned "pcd inserts" category. still showing. don't know whats problem in it. please me on it. you have enabled flat tables used on front, idea. thing remember, though, perform category flat data re-index in admin panel. go system > index management , reindex of category flat data. next should flush cache storage @ system > cache management. if won't help, check how category tree looks on store view level. magento allows have different category trees each store view.

How to convert HTML using replace or remove commoand in C# or Java -

html 1 m getting in string -> s= "<html> <head> <link rel='stylesheet' type='text/css' href='http://www.taxmann.com/css/taxmannstyle.css' /> </head> <body ><html> <body style='background-color:black;font-size:30px;color:#fff;'> <div id=\"digest\">\r\n <p class=\"threedigest\">st : extended period of limitation cannot invoked not paying tax if there divergence of opinion during relevant period , judgments in favour of assessee, there no suppression/wilful mis-statement assessee</p>\r\n </div></body></html></body></html>" note : getting html correct but string html 2 -> "<html>

Android Display a notification into the statusbar without an expandable view -

i need something. try display notification android statusbar. it inform user synchronization server in progress. now, use code , works fine : notificationcompat.builder builder = new notificationcompat.builder(this) .setsmallicon(android.r.drawable.stat_notify_sync).setwhen(system.currenttimemillis()) .setautocancel(false).setongoing(true); notificationmanager nm = (notificationmanager) this.getsystemservice(context.notification_service); notification notif = builder.getnotification(); nm.notify(1, notif); the 1 problem view created when user expand statusbar. want display small icon on top of status bar, without contentview. anyone know how ? in advance! this not possible. the rationale this: if user looks @ status bar , sees icon, should have way of figuring out icon means. therefore there must row in notification panel corresponding each icon. i suggest creating notification explains, have done in question, synchro

rotation - Can't get transformed points out of a kinetic JS line -

i have been able draw line using kinetic js, follows: var track129 = new kinetic.spline({ points: [ {x: 3, y: 400}, {x: 196, y: 400}, {x: 213, y: 395}, {x: 290, y: 345}, {x: 319, y: 324}, {x: 389, y: 253}, {x: 457, y: 184}, {x: 471, y: 173}, {x: 481, y: 173}, {x: 682, y: 173}, // blue track branches red track (129, 009). {x: 708, y: 171}, {x: 740, y: 186}, {x: 773, y: 218}, {x: 799, y: 240}, {x: 822, y: 251}, {x: 845, y: 254}, {x: 866, y: 251}, {x: 894, y: 238}, {x: 934, y: 204} ], stroke: 'blue', strokewidth: 2, linecap: 'round', tension: .2 }); layer.add(track129); i rotate line using following command: track129.setrotationdeg(45); the visual display updates. attempt transformed points out of rotated line so: var myspleenpoints = track129.getpoints(); i end getting same array of points entered. i've tried offset , translation in effort see if can derive absolute coordinates of rotated points i've had no luck. can me extract actual

iphone - iPad application strange behavior -

i working on simple video player base application in have 8 buttons, on click of buttons video plays , when video playing complete button image changed. if user close video button image not change. this small app working perfect me , when send client behave strange, buttons works , of them can't. how resolve it! i had same issue ipad. buttons worked fine on simulator, on ipad worked randomly. figured out gesture recognizer precise on touchupinside event. if tap , move finger millimeter touch event being canceled, thinks it's swipe. solved little hack, removing addtarget:action:forcontrolevents: , writing own method gesturerecognizer .

sql server - Simplify SQL Column lookup Query -

i want query database sys tables list of table, column, , primary key information query: select t.name [tablename] , (select max(column_id) sys.columns c c.object_id = t.object_id) [columncount] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 1) [column01] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 2) [column02] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 3) [column03] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 4) [column04] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 5) [column05] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 6) [column06] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 7) [column07] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 8) [column08] , (select name sys.columns c c.object_id = t.object_id , c.column_id = 9) [column09] , (select name sys.columns c c.obj

asp.net - How to access a value which is associated with a dropdownlist item? -

this dropdown list code........ <td valign="top" align="center"> <asp:dropdownlist id="studentnamedropdownlist" runat="server" width="150px" datasourceid="sqldatasource2" datatextfield="studentname" datavaluefield="studentname" autopostback="true"> </asp:dropdownlist> <asp:sqldatasource id="sqldatasource2" runat="server" connectionstring="<%$ connectionstrings:dbbilling2.0connectionstring3 %>" selectcommand="select [studentid], [studentname] [tblstudentinfo] ([class] = @class)"> <selectparameters> <asp:controlparameter controlid="classdropdownlist" name="class" propertyname="selectedvalue" type="string" /> </selectparameters> </asp:sqldatasource> <br /> want

knockout.js with binding -

this basic question in following view model populating self.userdata ajax call. want display information in ui , figured 'with' binding way go.. since self.userdata empty until ajax function called error binding html <div data-bind="with: userdata"> <div data-bind="text: userid"></div> ... </div> model var viewmodel = function () { var self = this; self.userdata = {}; self.login = function(data) { var postdata = { ..trimmed out.. }; $.ajax({ type: "post", url: "myservice", data: postdata }).done(function (data, status) { self.userdata = ko.mapping.fromjs(data, userdata); console.log(self.userdata); }).fail(function (data, status) { alert('could not login'); }); } }; ko.applybindings(new view

html - how to remotely check a website? -

i build free widget customers want them put website link on websites want check regularly websites html code site link , if remove link stop widget automatically. want know thinking correctly? mean, possible check websites' code remotely? if possible how start? thought getting html of page using php method file_get_content , parse returned file not because did not find way parse returned string. $html = htmlentities(file_get_contents('http://example.com/')); echo $html; i use dom : <?php $doc = new domdocument(); $doc->loadhtml('http://example.com'); $exm = $doc->getelementsbytagname('a'); print_r($exm); //will print domnodelist object ( ) ?> i not want use "regexp" not reliable of time if there ideas or tips provided thankful use dom dig in page content: http://php.net/dom

entity framework - How to avoid invalid concurrent modifications in EF 4 -

i have 3-tier application: client application server application database server the server uses entity framework 4 read , write data to/from database. imagine following situation: client application creates instance of entity rowversion property. @ point in time, property equal null. client application sends request "save instance in database" server. server saves object in database , automatically sets value of rowversion property. @ client side, value still equal null. client application modifies object created in first step, sends request server , server gets concurrency exception when trying save new version of object. are there standard mechanisms solving type of problem? i dont know how system works inside (think communication between client , server goes using api). see trying handle situation when 2 clients modifying same entity , need notify client if trying save version older current. so next: on step 3 server must return vers

embedded - What does TDO on 4th bit in ICSP SendCommand header mean? (PIC32MX, ICSP 2-wire 4-phase) -

Image
right i'm trying implement flash programming specification pic32mx. i'm working pic32mx512l , pic32mx512h. pic32mx512l must transfer program 2 wires pgec2 , pged2 of pic32mx512h. right i'm trying execute check device operation. specified, i'm entering programming mode mclr-juggling , executing setmode (6b011111) on tms clock while tdi clock stays low. tap controller replies zeroes (every tdo low). after must execute sendcommand( mtap_sw_mtap ) select mtap controller. sequence shifted (header) 01 01 00 00_ | (data) 00 00 10 00 00 | (most sign. bit) 01 | (footer) 01 00 the first bit of each pairs tdi , second -- tms. write tdi on first clock, tms on second clock , read tdo during third , fourth clock. sequence feeded left right. shifted bits hold value during each clock fall. the issue after shifting first 4 pairs, tdo line goes on fourth pair high (on third clock) , low @ end of 4-phase part (on fourth clock). i've marked spot underscore in sequence

multithreading - Any connection between mirroring a binary tree and blocking queue in Java -

i believe mirroring binary tree straight-forward in java like: http://stackoverflow.com/questions/4366251/mirror-image-of-a-binary-tree however, met interview question relates problem multithreading in java,i.e., blocking queue(java.util.concurrent) to best of knowledge, don't see apparent connection between 2 concepts, give me hint might missing something? thanks! in general the recursive structure of tree mirroring reveals solution. first given root node, swap left child right child on main thread. apply mirror on left node , mirror on right node. mirroring left node independent of mirroring right node, can them on separate threads. keep following rules in order avoid having many threads. current thread swaps left , right child of node operating on. delegates mirroring of new left child new thread, , proceeds handle mirroring of right node. note each node encounter spawning new thread. if tree unbalanced , has left children, spawn o(n) threads n number o

Heroku and Environments -domains are not working -

i finding managing production , staging env's on heroku painful process esp domains, git etc. 1) created app called htest. 2) in htest directory did below: heroku create --app htest-staging --remote staging heroku create --app htest-production --remote production heroku domains:add staging.mydomain.com --app htest-staging --remote staging heroku domains:add production.mydomain.com --app htest-production --remote production 3) committed app , started service git push staging master heroku ps --app htest-staging --remote staging 3) add domain route53 cname of htest-staging.herokuapp.com heroku info --app htest-staging === htest-staging web url: http://htest-staging.herokuapp.com/ as expected web page not found. what more troubling when go http://htest-staging.herokuapp.com/ on page: heroku | welcome new app! refer documentation if need deploying. my python app should have said hello world. so..how resolve?

jquery - Drop item from one sortable list to another -

i have 2 sortable lists not connected each other: <ul id="list1"> <li>item1</li> <li>item2</li> <li>item3</li> </ul> <ul id="list2"> <li>container 1</li> <li>container 2</li> <li>container 3</li> </ul> jquery: $("#list1").sortable({ items: "li", distance: 25, out: function (event, ui) {}, over: function (event, ui) {}, stop: function (event, ui) {} }); $("#list2").sortable({ items: "li", distance: 25, out: function (event, ui) {}, over: function (event, ui) {}, stop: function (event, ui) {} }); how can make possible drop item of first list item of second one, , 1 dropped , dropped? live jsfiddle edit:i want create relation between elements of first list second. if user drags item first list , drops item of second list, should 1 relation (e.g. item1 - co

php - Add Laravel task to cron with parameters -

i want add laravel task cron, use run command line (and runs succesfully) php artisan cron:hourly --env=staging translated cron: /usr/bin/php -q /home/usr/public_html/staging/artisan cron:hourly --env=staging i assume there problem parameter --env=staging because got error when cron executed (without parameter can't run task in staging environment): uncaught exception 'pdoexception' message 'sqlstate[hy000] [1045] access denied user ''@'localhost' could explain me the right syntax execute laravel task in cron? update actually, problem happening if place cron command inside sh script. due unknown reason, script not send "--env=staging" argument, , ends on error described. the error message suggests environnement ist not set properly. i'm not sure why there problem though. please see crontab file, reference. works on debian linux installation. note -f flag, problem. 0 23 * * * /usr/bin/php -q -f /home/usr/de