Posts

Showing posts from March, 2013

ruby on rails - CKEDITOR toolbar is not showing up fully -

i getting weird behavior using ckeditor rails, tried both of gems : ckeditor gem , ckeditor_rails gem in different app have (rails v4.2.0 , rails v4.2.1 , rails v4.2.2) i have text id="ck" <p contenteditable="true" id="ck">some dummy text</p> and using inline editing option $(document).ready(function(){ ckeditor.disableautoinline = true; ckeditor.inline("ck"); }); in rails 4.2.1 , 4.2.2 noticed toolbar not show buttons, while show buttons (i mean full toolbar) rails 4.2.0 so hypotheses there maybe bugs within the last versions of rails... created new gemset , installed rails 4.2.0 see if still work, doesn't ! i not sure what's wrong... hope can help for land on page searching answer. plugin needs used on div element , not on p element; here same issue tinymce tinymce align text buttons don't work on inline editing thanks pointing me here bro.

c# - How to pass values - in a loop - to a user control -

the code page used test calling user control dynamically. <%@ page language="c#" autoeventwireup="true" codefile="testuc.aspx.cs" inherits="testuc" %> <%@ register tagprefix="uc" tagname="testuc" src="nccsbyrole.ascx" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:placeholder runat="server" id="placeholder1"></asp:placeholder> </div> </form> </body> </html> the code behind page: using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui;

hbase - spark-submit no class found - htrace -

i trying run spark example code hbasetest command line using spark-submit instead run-example, in case, can learn more how run spark code in general. however, told me class_not_found htrace since using cdh5.4. located htrace jar file having hard time adding path. this final spark-submit command have still have class not found error. can me this? #!/bin/bash export spark_home=/opt/cloudera/parcels/cdh/lib/spark /bin/bash $spark_home/bin/spark-submit \ --master yarn-client \ --class org.apache.spark.examples.hbasetest \ --driver-class-path /etc/hbase/conf:$spark_home/examples/lib/*.jar:/opt/cloudera/parcels/cdh-5.4.2-1.cdh5.4.2.p0.2/lib/hbase/lib/*.jar \ --jars $spark_home/examples/lib/*.jar:/opt/cloudera/parcels/cdh-5.4.2-1.cdh5.4.2.p0.2/lib/hbase/lib/*.jar \ $spark_home/examples/lib/*.jar \ myhbasetablename note: htrace-core-3.0.4.jar, htrace-core-3.1.0-incubating.jar, htrace-core.jar located under '/opt/cloudera/parcels/cdh-5.4.2-1.cdh5.4.2.p0.2/lib/hbase/lib/'.

ajax - AngularJS: http, promise (not loading fast enough) -

i using $http method , getting data use on input field autocomplete. this data small can still happen user typing in input field before data has beed loaded. i make $http call when user has typed in input field. there other solutions? somehow prevent page rendering?

python - Postgresql & psycopg2: database does not exist -

i trying establish connection database this: psycopg2.connect(database="movies", user="lfcj", host="127.0.0.1"); my pg_hba.conf file has line: type __ database___user__address___method local lfcj peer i trying use peer identification, , user name lfcj . when log in postgresql this, grant privileges lfcj , , run \list : psql lfcj -h 127.0.0.1 -d movies enter password: 'mypassword' psql (9.4.1) ssl connection (protocol: tlsv1.2, cipher: ecdhe-rsa-aes256-gcm-sha384, bits: 256, compression: off) type "help" help. movies=# grant privileges on database movies lfcj grant option; movies=#\list i information: list of databases name | owner | encoding | collate | ctype | access privileges --------+----------+----------+-------------+-------------+----------------------- movies | lfcj | utf8 | en_us.utf-8 | en_us.utf-8 | =tc/lfcj

Custom thumb for a seekbar in Android -

Image
i want create custom thumb seekbar should this: one solution this one , png pictures used draw thumb. i believe should possible use xml only, since similar thumb: thumb.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:height="30dp" android:width="30dp"/> <stroke android:width="18dp" android:color="#882ea5de"/> <solid android:color="#2ea5de" /> <corners android:radius="1dp" /> </shape> just need add second border (white stroke around), can skip manage pictures different screen resolutions (hdpi/mdpi/xhdpi/xxhdpi). i have tried different combination shapes "oval" , "ring", not result required. how can make it? i not manage find solution xml, why used picture solve this, little this answer : created image of thumb seekbar_thumb_icon.png , saved

php - Simple HTML DOM Memory issue -

i'm trying use php simple html dom parser parse information sql query results. seems, there huge memory problem it. create html table using sql query results , export html table csv file. new code not efficient one. when query results small csv file created successfully. when query results large, exported csv file not have sql results , instead shows : fatal error: call member function find() on boolean in /opt/lampp/htdocs/test.php on line 101 this function takes sqlresult , creates html table , exports csv file: echo sql_to_html_table($sqlresult, $delim="\n" ); function sql_to_html_table($sqlresult, $delim="\n") { // starting table include_once('simple_html_dom.php'); $htmltable = "<table>" . $delim ; $counter = 0 ; // putting in lines //while( $row = $sqlresult->mysqli_fetch_assoc() ){ while($row = mysqli_fetch_assoc($sqlresult)) { if ( $counter===0 ) { // table header $htmltable .= "<tr>" . $

javascript - Can't get array by $resource -

can't array $resource . can me? when use $http well i have error in console: typeerror: undefined not function @ http://127.0.0.1:9000/bower_components/angular-resource/angular-resource.js:597:29 @ foreach (http://127.0.0.1:9000/bower_components/angular/angular.js:327:18) @ angular.module.provider.$get.resource.(anonymous function).$http.then.value.$resolved (http://127.0.0.1:9000/bower_components/angular-resource/angular-resource.js:595:19) @ deferred.promise.then.wrappedcallback (http://127.0.0.1:9000/bower_components/angular/angular.js:11616:81) @ http://127.0.0.1:9000/bower_components/angular/angular.js:11702:26 @ scope.$get.scope.$eval (http://127.0.0.1:9000/bower_components/angular/angular.js:12797:28) @ scope.$get.scope.$digest (http://127.0.0.1:9000/bower_components/angular/angular.js:12609:31) @ scope.$get.scope.$apply (http://127.0.0.1:9000/bower_components/angular/angular.js:12901:24) @ done (http://127.0.0.1:9000/bower_components/angular/angular.js:8487:45) @ c

sql - ANSI JOIN ORACLE with 2 common tables -

i want on oracle ansi join: select * ticket, --here have more tables relates ticket ticket_evo, user usr_client, user usr_support ticket.id = ticket_evo.id --ticket_evo child of ticket , ticket.cd_user = usr_client.cd_user --ticket has client user opened ticket , ticket_evo.cd_user = usr_support.cd_user --ticket_evo has support user answer client on each evolution thank you! select * ticket join ticket_evo on ticket.id = ticket_evo.id join user usr_client on ticket.cd_user = usr_client.cd_user join user usr_support on ticket_evo.cd_user = usr_support.cd_user

c# - Is it possible to include variables in TileSource.uriFormat? -

i have maptilelayer specifying tilesource for tilesource mytilesource = new tilesource(); for tilesource need specify uri format. want include variable inside string because have folders being dynamically created, , want uriformat point correct folders. so how create correct .uriformat parameters/variables? mytilesource.uriformat = ????? i don't believe uriformat supports local folders. possible load tiles local folders in wpf control outlined in blog post: https://blogs.bing.com/maps/2015/08/24/local-tile-layers-in-bing-maps-wpf/

Does WSO2 API Manager 1.8 supports the integration with HSM SafeNet Luna? -

we have hsm (i.e. safenet luna) , levarage api key management instead of wso2 api key manager. know whether wso2 api manager 1.8 supports integration safenet luna hsm. if yes, can please provide documentation same. wso2 api manager 1.8 not suport integration safenet luna hsm

java - Hibernate Cascade and Foreign Key issues -

i learning hibernate cascade implement our application. application's sql server database design based on legacy db model weak/improper fk relation. , having trouble mapping entities while using hibernate cascade fetch data related tables. consider scenario: table_a: cola1 , cola2 makes composite key (int) (int) (string) cola1 cola2 cola3 1 1 dummy111 1 2 dummy222 2 1 dummy333 2 2 dummy444 table_b colb1 , colb2 makes composite key (int) (int) colb1 colb2 1 1 1 2 2 1 2 2 table_c colc1 , colc2 makes composite key (int) (int) (int) (str) (str) colc1 colc2 colc3 colc4 colc5 1 1 1 aa dummy999 1 2 1 bb dummy888 1 2 2 aa dummy777 colc1 , colc3 makes foreign key (cola1 , cola2 table_a when colc4=aa) or (colb1 , colb2 table_b when colc4=bb). fk not defined in table or schema written on documents , implemented

php - set value from two select query in one array -

my 2 select query want fetch records in single array how possible set values in 1 array different select query $partyid = isset($_request['partyid']) ? $_request['partyid'] : 0; $k = 0; $clientdetail = array(); $selectclient = "select * client partyid = ".$partyid; $selectclientres = mysql_query($selectclient); while($clientrow = mysql_fetch_array($selectclientres)) { $clientdetail[$k]['clientid'] = $clientrow['clientid']; $clientdetail[$k]['particular'] = $clientrow['particular']; $clientdetail[$k]['clitranstype'] = $clientrow['clitranstype']; $clientdetail[$k]['cdate'] = date('d-m-y',strtotime($clientrow['cdate'])); $clientdetail[$k]['rate'] = $clientrow['rate']; $clientdetail[$k]['diff'] = $clientrow['diff']; $clientdetail[$k][&

javascript - Workaround for vertical scrolling in Vis.js -

after implementing timeline vis.js found out cannot handle situation when there many groups fit canvas. currently doesn't provide vertical scrollbar , couldn't make scrollable dragging. is there known temporary workaround it? manual manipulation basing on events perhaps? aside vis.js works great , shame if had rewrite other timeline library because of 1 thing. you can add css: .vis-timeline { overflow-y: scroll; }

ruby on rails - ActiveRecord::ConnectionNotEstablished - No connection pool for X -

i can't make sinatra/ruby app hosted on heroku works desired. fiddled setup trying resolve issue far no results. activerecord::connectionnotestablished - no connection pool user: 2015-06-25t14:26:11.736854+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:566:in `retrieve_connection' 2015-06-25t14:26:11.736856+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection' 2015-06-25t14:26:11.736858+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:87:in `connection' user 1 of activerecords table , app fails because try query it. i use sinatra puma backup. here procfile: web: ruby app/my-server.rb -s puma i checking how many open connections there using: select count(*) pg_stat_activity pid <> pg_backend_pid() , u

php - Get fetchall result from different class -

let me explain i'm trying do. in 1 dbcommand.php file have : class dbcommand extends pdodb { public function selectall() { $stmt = $this->dbh->prepare("select hwid,username,pcname users"); $stmt->execute(); $columnn = array(); $result_returned = $stmt->fetchall(pdo::fetch_class); foreach($result_returned $key=>$result) { $columnn['hwid'] = $result->hwid; $columnn['username'] = $result->username; $columnn['pcname'] = $result->pcname; //return $columnn; //$columnn= new us($result->hwid,$result->username,$result->pcname); } return $columnn; } } and i'm trying result on page called view.php $cmd = new dbcommand(); //$get = $cmd->getinfo('1234'); $result=$cmd->selectall(); echo '<tr ><td ><input type="checkbox" class="checkthis" /></td><

linux - How to remove Ubuntu entries from UEFI -

i 've got issue uefi boot values. in past installed ubuntu 14.10 lts dual-boot system. working ok, until decited remove it. deleted ubuntu partitions , merged them windows partition. working fine, except when check boot menu inside bios, there still value considering ubuntu. http://i.imgur.com/xo9tf82.jpg i followed guide: https://askubuntu.com/questions/63610/how-do-i-remove-ubuntu-in-the-bios-boot-menu-uefi value still remaining there. there way completeley remove without loosing values point windwows system. my laptop lenovo g50-70 thank in advance! boot live linux cd using legacy, have usb stick you. run lsblk find out efi partition is $ lsblk mount efi partition , usb stick 2 separate folders (replace sda1 path of efi partition , sdb1 path of usb. $ mkdir /mnt/usb $ mkdir /mnt/efi $ mount /dev/sda1 /mnt/efi $ mount /dev/sdb1 /mnt/usb cd efi folder of efi partition $ cd /mnt/efi/efi move folder "ubuntu" usb can restore if goes wrong

osx - Why does setting frameInterval on a SKView not work? -

i'm trying reduce framerate maximum of 30 fps. official documentation says use: skview.frameinterval = 2; i read through available documentations every similar question asked here on stackoverflow or in other pages/blogs/etc. tried in many ways ever tried set property did not affect fps. i not using other timing mechanisms spritekit. setting accordingly documentation , answers here on stackoverflow. i started basic spritekit template provided xcode , tried set frame rate property did not work out. does experience similarities? there alternative way reduce max fps? else can try reduce fps? btw.: working on os x , have first-gen retina macbook pro - maybe it's hardware issue? edit: i not overriding -(void)update: method - -(void)didsimulatephysics this in nsviewcontroller subclass set in interface builder. self.spritekitview outlet nsview of nsviewcontroller -subclass -(void)setupspritekitview { self.spritekitview.frameinterval = 2; self.sprite

Python app using Requests has missing files and errors after cx_freeze -

edit: so ended using portable python . goal run python script on windows server doesn't have python installed, , that's pp can do. not solution original question, if else runs in same issue that's 1 way solve it. i've built python program uses requests library. works fine when run normally, not after freezing executable cx_freeze. i've looked @ , tried answers these questions: requests library | frozen app | requests & cx_freeze so neither adding: import requests.certs build_exe_options = {"include_files" : [(requests.certs.where(),'cacert.pem')]} nor os.environ["requests_ca_bundle"] = os.path.join(os.getcwd(), "cacert.pem") are working me. my request looks this: def get_response(id = constant_id, token = constant_token, page = none): url = 'https://scm.commerceinterface.com/api/v2/get_orders' return requests.get(url, params = {'supplier_id':id, 'token':token, '

c# - Linq - group each class -

i need removing duplicates form emailaddresses list. need add code group emailaddresses within emailaddresses class. sql returning duplicate email addresses because of different telephone numbers. suggestions? thanks. here code: 1. classes public class student { public string studentid { get; set; } public string gender { get; set; } public list<emailaddresses> emailaddresses { get; set; } } public class emailaddresses { public string emailaddress { get; set; } } 2. data coming sql query studentid emailaddresses ispreferred number telephonetype 123456789 maryjoe@gmail.com false 5556565 present evening phone 123456789 maryjoe@gmail.com false 8885566 permanent day phone

java - Exporting Data from cassandra to mongodb -

i have program exports data directly cassandra mongodb.it works fine but, doesn't copies counter type column cassandra mongodb. leaves blank. public class export { static string keyspace = "db1"; static string table = "results"; static string host = "localhost"; @suppresswarnings("deprecation") static mongo mongo = new mongo("localhost", 27017); @suppresswarnings("deprecation") static db db = mongo.getdb("mydb"); static dbcollection collection = db.getcollection("results"); public static void main( string[] args ) throws ioexception { cluster.builder clusterbuilder = cluster.builder() .addcontactpoints(host); cluster cluster = clusterbuilder.build(); session session = cluster.connect(keyspace); statement stmt = new simplestatement("select * " + table); stmt.setfetchsize(1); resultset rs = session.execute(stmt); iterator<row> iter = rs.

javascript - color sides of 3d pie chart in highcharts -

i want make pie chart can give color side of 3d pie chart, darker blue color. i can configure lighter blue color, side color taken based on main color of pie. i want individually color both main surface , sides. var chart = new highcharts.chart({ chart: { renderto: 'container', type: 'pie', options3d: { enabled: true, alpha: 60 } }, plotoptions: { pie: { depth: 150, animation: false, states: { hover: false } } }, series: [{ data: [ ['apple', 8] ] }], tooltip: { enabled: false } }); <!doctype html> <html> <head> <title>tyre</title> </head> <body> <div id="container" style="height: 400px"></div> <script src="http://code.highcharts.com/adapters/standalone-framework.js"></script> <script src="http://co

How to Hide MasterView in UISplitViewController in iOS -

when touched webview added in detailview, hide master view in landscape i using xamarin.ios c#, couldnt that.. https://forums.xamarin.com/discussion/3578/uisplitview-comes-up-in-landscape-with-master-view-hidden i followed here.. didnt me.. how hide-show when touch screen of detailview.. add method appdelegate.m , user when need detialview diplay. -(void)setdetailview:(int)num listofarray :(nsarray *)arr didselectviewcontroller:(uiviewcontroller *)viewcontroller diffclassid:(nsstring *)strid { if ([viewcontroller iskindofclass:[detailviewcontroller class]]) { detailviewcontroller *viewdetail = [[detailviewcontroller alloc] initwitharticle:num inarticlesarray:arr]; viewdetail.navigationitem.leftbarbuttonitem = splitviewcontroller.displaymodebuttonitem; viewdetail.navigationitem.leftitemssupplementbackbutton = no; detailnav=[[uinavigationcontroller alloc]initwithrootviewcontroller:viewdetail];

How to query couchbase for a document using the rest API -

i know how views, example: http://127.0.0.1:8092/<my_bucket>/_design/all/_view/all?full_set=true&key=<my_document_key>&connection_timeout=60000 and tried: http://127.0.0.1:8091/contacts/hello (after creating via ui document key hello). , response "not found." what doing wrong? thanks, michael there no rest api retrieving documents key. can either write own thin service layer uses client sdk internally, or of couchbase 4.0, use n1ql rest api document through query key: select * bucket use keys [docid]; you can read using n1ql service endpoint here: http://developer.couchbase.com/documentation/server/4.1/n1ql/n1ql-rest-api/index.html (edit: changed n1ql syntax work. gerald.)

Regex for Multiple Deny Selection -

i new regex world. have been using regex while today found problem couldn't resolve. searched forum got no luck. i have negative match. have match tables eos.1 , eos.2 there eos.9000 tables. not consecutive, have leave behind tables 90 , 91 , 2293 , 3750 , etc. i tried pattern: eos\.(?!91|90|2300|2504|3747|3750|100|3788|2303|2304|2293) however, matches eos. part, not numbers. thank much. you may use below regex: \beos\.(?!(91|90|2300|2504|3747|3750|100|3788|2303|2304|2293)\b)(?:[1-9][0-9]{0,2}|[1-8][0-9]{3}|9000)\b see demo this regex matches full word eos followed literal . , numbers 1 9000, excluding in negative lookahead. your eos\.(?!91|90|2300|2504|3747|3750|100|3788|2303|2304|2293) regex matches eos. part because look-aheads not consume characters, check presence or absence.

python - How to divide matrix elements by corresponding matrix row sum in numpy? -

this question has answer here: numpy divide row row sum 2 answers for example, m= [[1,2], [7,8]] then want [[1/3, 2/3], [7/15, 8/15]] i'm trying vectorized. 1 idea have write s = np.sum(m, axis=1) ; gives corresponding row sums. maybe transpose s , , copy along columns, elementwise division of m/s , seems hacky. what's right way? use tile repeat along dimension on sum operated. m / np.tile(np.sum(m, 1), (1, m.shape[1]))

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

html - Make **Responsive navigation** supporting different devices such as mobile, tab and desktop -

Image
i have navigation want make responsive navigation supporting different devices such mobile, tab , desktop. i ng-including menu.html file in sidebar mobile, , including same hmtl file in header desktop. the question how make styles mobile sidebar stay on mobile , add second styles desktop. this sidebar using mobile: http://pages.revox.io/dashboard/latest/html/index.html disabling show desktop and including menu in header desktop: http://pages.revox.io/dashboard/latest/html/tabs_accordian.html both of styles need included in resources of theme. here structure using both sidebar , header right now <ul id="menu-lg" class="menu-items text-uppercase list-inline nav-tabs-simple" role="tablist"> <li class="sm-m-t-20 list-unstyled active" ui-sref-active="open" data-toggle="tab"> <span class="icon-thumbnail hidden-md hidden-lg"><i class="fa fa-dashboard&quo

ios - PFImageView not showing up in the window -

i'm trying hand @ parse snapchat clon , going fine, when have display images user pfimageview not showing up, have no idea no errors show no subview. the offending part: func checkformessages() { if pfuser.currentuser()?.username != nil { println("checking msgs") var query = pfquery(classname: "image") query.wherekey("recipientusername", equalto: pfuser.currentuser()!.username!) var msgs = query.findobjects() println("\(msgs?.count) \(pfuser.currentuser()!.username!) recipientusername") var done = false if let msg = msgs as? [pfobject] { msgreceived in msg { if done == false { var imageview: pfimageview = pfimageview() imageview.file = msgreceived["image"] as? pffile imageview.loadinbackground({ (photo, error) -> void in if error == nil { var displa

html - Ionic: How to center a div? -

the situation: i making app using ionic framework . in 1 page need display image. image has horizontally centered. attempt 1: following documentation have divided 1 row 3 equal columns , put image in second one. <div class="row"> <div class="col col-33"></div> <div class="col col-33"> <img src="{{ data.logo }}" alt=""> </div> <div class="col col-33"></div> </div> but unfortunately image far centered. tend stay in left half of screen. attempt 2: trying old css tricks. <div style="margin: 0 auto;"> <img src=" {{ data.logo }} " alt="" > </div> but again not getting desired result. the question: how can center div in ionic framework? you found answer instead: in css: .center { margin-left: auto; margin-right: auto; display: block; } and add class i

Use python to create a nested json -

{"0":{"posted_date":"25 jun 2015"},"1":{"posted_date":"26 jun 2015"}} note: that '0' , '1' variable - 'count', variable generate through repeat/loop "posted_date" string "25 jun 2015" , "26 jun 2015" variable - 'date' how create json output above python? [edit-not working code] import json final = [] count = 0 postid = 224 while postid < 1200: final.append({count: {"posted_id":postid}}) count = count + 1 postid = postid * 2 print str(json.dumps(final)) import json dates = ["25 jun 2015", "26 jun 2015", "27 jun 2015"] result = {} each, date in enumerate(dates): result.update({each: {"posted_data": date}}) jsoned = json.dumps(result) you don't need use "count" variable

javascript - auto-suggest keyboard event not working on keyup event -

i creating auto-suggest scratch. using jquery-ajax function data server. doing filtering data on keyup event auto suggestion. now after filtering want navigate list items using keyboard's arrow keys problem every time pressing arrow key list being refreshed on keyup event clears selection happened through arrow key. i track trace code , came know reason. here code : var $listitems = $('li.suggestion-item'); var key = event.keycode,$current, $selected = $listitems.filter('.selected'); if ( key != 40 && key != 38 ) { return key; } $listitems.removeclass('selected'); switch(key){ case 40: // down key if (! $selected.length || $selected.is(':last-child')) { $current = $listitems.eq(0).addclass('selected'); } else { $current = $selected.removeclass('selected').next().addclass('selected'); } break; case 38: // key i

ios - UITableView: Set table header view height based on screen size -

Image
i have table view table header view created through interface builder inside same xib. want set height of header based on screen size, example 50% of screen height. here static height on iphone 4s: and here is on iphone 6: note content of header static. i cannot set constraints header using auto layout. tried set height constraint based on height of table view not seem possible in interface builder. control-dragging not work. cannot drag line header table view or header itself. how can set header's height based on screen size? unfortunately, table header views cannot sized using auto layout. can use auto layout elements inside header have specify header's size explicitly setting frame. if header's height static , known @ compile time can use ib. however, if height dynamic or depends on device (as in case), have set in code. a quite flexible solution create custom subclass of uitableview , adapt header's frame in layoutsubviews method. w

android - GCM Notifications in my app overlaps the older and displays the newest one. -

hi friends have created android project using gcm messaging. able send , receive notifications perfectly. problem arises when ever send more 1 notification. second notification overlaps first one. precise - suppose have sent 3 notifications in day, , meanwhile user of app offline comes online receive notifications able see last one. notification tone playing 3 times last notification visible. instead see 3 notifications 1 after other. how resolve problem please me. thank in advance. may looking this: notification inbox style gets updated when notification comes you need use inboxstyle achieve this. notification noti = new notification.builder() .setcontenttitle("5 new mails " + sender.tostring()) .setcontenttext(subject) .setsmallicon(r.drawable.new_mail) .setlargeicon(abitmap) .setstyle(new notification.inboxstyle() .addline(str1) .addline(str2) .setcontenttitle("") .setsummarytext(&quo

java - how to inject parent class property with spring annotation -

parent class this: public class basedao{ private dbroute defaultdb; public dbroute getdefaultdb() { return this.defaultdb; } public void setdefaultdb(dbroute defaultdb) { this.defaultdb = defaultdb; } } i have create beans below: <bean id="adsconfigdb" class="net.flyingfat.common.dbroute.config.dbroute"> <constructor-arg value="adsconfig" /> </bean> <bean id="adsbizdatedb" class="net.flyingfat.common.dbroute.config.dbroute"> <constructor-arg value="adsbizdate" /> </bean> i want inject superclass property defaultdb in subclass through byname, not bytype, in subclass inject defaultdb using adsconfigdb or adsbizdatedb . there way spring annotations? tried autowired or resource constructor doesn't work. way, know can done using xml. @qualifier annotation – annotation used avoid conflicts in bean mapping , need pr

css - Three column layout -

beginning layout 2 column column-left fixed , column-right liquid have need add third column of widht fixed. have code: <did id="#container"> <div id="#col1"> left fixed 15em </div> <div id="#col2"> center liquid </div> <div id="#col3"> right fixed 15em </div> </div> with css: #container { background-color: #ffffff; height: auto; overflow: hidden; } #col1 { float: left; margin: 1em; padding: 0.5em; width: 15em; } #col2 { float: none; width: auto; overflow: hidden; margin: 1em; padding: 0.5em; } #col3 { float: right; margin: 1em; padding: 0.5em; width: 15em; } the result third column located below second column right. how can fix problem? final result should layout 3 column left , right column fixed , central column liquid. thank much. i use css tables these layouts: note shouldn't use # in id attribute. #container { wid

sql server - Invalid Column Name Exception on Entity Framework -

while using entity framework , creating unit tests on tables, peculiar error has occurred on 1 of them. while adding entry table "users", error there invalid column name "setup_pk". here's thing, field not specified anywhere in code. searched entire solution , field not mentioned anywhere. accessed database , field not there on table "users". i've made few unit tests other tables, 1 1 have given me sort of error on field cannot seem find anywhere. i'd know if there someway can fix or if there else need check. regards thank all, figured out. database configuration file pointing older version of database.

ruby - How does Rails handle multiple incoming requests? -

how rails, handle multiple requests different users without colliding? logic? e.g., user1 logged in , browses site. @ same time, user2, user3, ... log in , browse. how rails manage situation without data conflict between users? one thing bear in mind here though users using site simultaneously in browsers, server may still handling single request @ time. request processing may take less second, requests can queued processed without causing significant delays users. each response starts blank slate, taking information request , using data database. not carry on 1 request next. called "stateless" paradigm. if load increases, more rails servers can added. because each response starts scratch anyway, adding more servers doesn't create problems "sharing of information", since information either sent in request or loaded database. means more requests can handled per second. when feeling of "continuity" user, example staying logged we

swift - Office 365 iOS SDK - How to invoke SharePoint REST API -

all ios sdk samples provide working code accessing mail, calendar, odfb files, none show how access sharepoint list items. trying simple rest call in swift, keep getting following error: [0] (null) @"error_description" : @"unsupported security token. here subset of code when app starts: var resourceid : string = "https://mytenant.sharepoint.com" var authorityurl : string = "https://login.windows.net/common/" var clientid : string = "xxd4200eb-7284-41be-a434-abb269b82f0f" var redirecturi : nsurl = nsurl(string: "http://www.mycompanywebsite.com")! override func viewdidload() { super.viewdidload() var defaults: nsuserdefaults = nsuserdefaults.standarduserdefaults() var er : adauthenticationerror? = nil var authcontext:adauthenticationcontext = adauthenticationcontext(authority: authorityurl, error: &er) authcontext.acquiretokenwithresource(resourceid, clientid: clientid, redirecturi: redirecturi)

javascript - jquery, append multiple values to one input hidden -

i have following variable var $pk3s_c = $('<input id = query_form_tbl_info_'+query_index +'_pk3ss[] name =query_form[tbl_info]['+query_index+'][pk3ss][] type = hidden></input>'); and array var pk3s = opts[tbl]["cols"]; during iteration through array, want append elements of array $pk3s_c $.each(pk3s, function(i,pk3){ $pk3s_c.attr('value',pk3); }) the code above not working, shows me have appended last element of pk3s, , not of them. how can append each element of p3ks hidden input? you aren't going array string field without converting string. the json format very useful this // convert array string var mystring = json.stringify(myarray); // put string field it's value $('input').val(mystring); javascript can interpret resulting string , server side languages can convert string array value can understand (see php , ruby ) here an example in jsfiddle

javascript - HTML not rendering the img after I change src on the run time -

i have following code - <html> <head> <script> function myfunction() { var x = document.getelementbyid("myfile"); alert(x.value); document.getelementbyid("picture").src=x.value; } </script> </head> <body> <input type="file" id="myfile"><br> <button onclick="myfunction()">render this</button> <img id="picture" src="c:\users\shin\desktop\410.svg"> </body> </html> initailly showing image, after select file , click button, shows me path in alert box but, doesnt render new pic , showing red cross @ place see in image when src incorrect. used chrome browser. try this... <html> <head> <script> function myfunction() { var input = document.getelementbyid("myfile"); var freader = new filereader(); freader.readasdataurl(input.files[0

video - What kind of encoder is suitable for AVIREAD in Matlab? -

i have raw video (no header, y-channel). want denoise algorithm on video. convert raw video useing ffmpeg several encoders. fail open function aviread. error using aviread, unable locate decompressor decompress video stream r210 uncompressed rgb 10-bit v210 uncompressed 4:2:2 10-bit v308 uncompressed packed 4:4:4 v410 uncompressed 4:4:4 10-bit y41p uncompressed yuv 4:1:1 12-bit yuv4 uncompressed packed 4:2:0 mjpeg mjpeg (motion jpeg) ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -r 25 -pix_fmt gray -i wka00002.y -c:v v308 wka00002_uncompavi.avi what kind of encoder suitable aviread in matlab? thanks lot aviread has been removed latest versions of matlab. use videoreader instead. motion jpeg avi supported videoreader. if want try other formats, first check file can opened using windows media player? if so, use videoreader try , read file. if not work, can provide link file using? hope helps. dinesh

angularjs - Google I/O 2015 page like transition animations -

recently google i/o 2015 event page , transition animations between different states. know used polymer that, i'm trying recreate such delayed animations in angular (1.4.1) , angular-material , ui-router. basically want achieve workflow: before state change, animate leaving components of app leave basic structure of app (some basic holder containers) make state change - resolve resources (rest api call) transition new state, basic app structure (holders) animate entering elements (with different delays) this not trivial task, , ng-animate not helpful, want use as possible. 1 drawback is, leaving css classes not added, before promises resolved, other it, @ 1 moment, both - old , new state view present on page. i tried create directive: (function() { 'use strict'; angular .module('climbguide') .directive('cganimateelement', cganimateelement); /* @nginject */ function cganimateelement($animate, $rootscope,