Posts

Showing posts from March, 2011

css - how to use own material design icons with materializecss? -

i need know how add own mdi icons in custom classes. provided mdi classes provided don't meet expectations. how can add , use them default one <i class="mdi-image-facebook"></i> <i class="mdi-image-linkedin"></i> thanks in advance well, alternative solution provided website. it's include preety number of icons such social buttons. http://materialdesignicons.com/getting-started you have add css link icons , add them classes <link href="css/materialdesignicons.min.css" media="all" rel="stylesheet" type="text/css" /> and <i class="mdi mdi-facebook-box"></i> <!-- facebook box -->

HTML/CSS: empty page + only header page when printing table -

Image
i cannot understand why there's blank page + page table header in document. the rest ok cannot rid of these 2 pages. this full html code: <!doctype html> <html lang="en" > <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <style media="print" type="text/css"> h1:not(:first-child) { page-break-before: always; } table { page-break-before : avoid; page-break-inside : avoid; padding: 0;border-collapse: collapse; } table tr { border-top: 1px solid #cccccc; background-color: white; margin: 0; padding: 0; } table tr:nth-child(2n) { background-color: #f8f8f8; } table tr th { font-weight: bold; border: 1px solid #cccccc; margin: 0; padding: 6px 13px; } table tr td { border: 1px solid #cccccc; margin: 0; padding: 6px 13px; } table tr th :first-child, table tr td :first-child { margin-top: 0; } table t...

html - Javascript vertical line coming from the bottom of an element -

my idea make lolipop has infinite vertical line coming off of bottom of circle (in case rectangle). read may done using css :after psuedoelements limit want do. prefer have line own element. there way go this? a div small width , lot more higher height make perfect "stick". example (rectangular lolipop :d): css: #lolipop { height: 400px; width: 200px; position: absolute; bottom: 0; } #lolipop .rect { width: 100px; height: 75px; background-color: red; margin: 0 auto; } #lolipop .stick { width: 5px; height: 325px; background: green; margin: 0 auto; } html: <div id="lolipop"> <div class="rect"></div> <div class="stick"></div> </div> demo: http://jsfiddle.net/uao97l8q/

Shiny R: Populate a list from input and return list on output via reactive -

i try populate list on shiny elements of list passed on shiny input. list should accumulate made choices. list should sent shiny output. list can send output. list of length 1 , single element gets updated input does. interested in "names" of list, why assign value 1 each name element: ui.r shinyui( fluidrow( column(1, # reactive input selectinput("input1", label = "select parameter 1", choices = c("none",letters[1:16]), multiple = t), selectinput("input2", label = "select parameter 2", choices = c("none",c(1:24) ) multiple = t), # printout of list htmloutput("printoutlist") ) # end of column ) # end of fluid row ) # end of shiny ui shiny.r # create e...

html - Bootstrap dropdown not working inside Horizontal description -

i'm trying display dropdown menu inside horizontal description dropdown menu doesn't toggle. <div class="container-fluid"> <div class="row vertical-align"> <dl class="dl-horizontal"> <dt> <div class="dropdown"> <button type="button" class="btn btn-default btn-block dropdown-toggle" data-toggle="dropdown" aria-expanded="false">le panneau latéral <span class="caret"></span></button> <ul class="dropdown-menu" role="menu"> <li><a href="#" role="menuitem">test1</a></li> <li><a href="#" role="menuitem">test2</a></li> </ul> </div> </dt> <dd>le panneau latéral est composé de différentes sections dynamiques qui...

android - Java - Keep getting a path error even after using urlencode -

i'm trying httpget. here string being passed: fullstring = "?none=" + node1 + "&ntwo=" + node2 + "&nthree=" + node3 + "&nfour=" + node4 + "&power=" + power + "&color=" + colorrgb; all variables single integer except color 9 digits. that string passed function doing following: string get_url = urlencoder.encode("http://192.168.30.80/" + str, "utf-8"); httpclient client = new defaulthttpclient(); httpget httpget; responsehandler<string> responsehandler = new basicresponsehandler(); httpget = new httpget(get_url); string content = client.execute(httpget, responsehandler); i tried: string get_url = "http://192.168.30.80/" + str; but gave me illegal character error. after trying urlencode a: java.lang.illegalstateexception: target host must not null, or set in parameters. scheme=null, host=null, path=http://192.168.30.80/[ljava.lang.string;@1a50d83...

codeigniter - Grocery Crud with Image Crud -

i've grocery crud on system , want use image crud grocerycrud multiple file upload. i've 2 tables attraction , attraction_images. attractions ------> id , title, description attraction_images -----> attraction_id,attraction_image public function attraction() { try{ $crud = new grocery_crud(); $crud->set_theme('datatables'); $crud->set_table('attractions'); $crud->set_subject('attraction'); $crud->required_fields('title'); $crud->field_type('description', 'text'); $crud->columns('title','description','image'); $crud->callback_before_insert(array($this,'remove_special_char')); $crud->set_field_upload('image','assets/uploads/files'); $crud->callback_column('image', array($this, 'callback_images')); $output = $crud->render(); $...

ios - Downcasting UIImage to a UIImage subclass and calling method -

hi have subclass of uiimage called sasuploadimage. here's sasuploadimage.h #import <uikit/uikit.h> @class device; @interface sasuploadimage : uiimage @property(nonatomic, weak) nsstring *timestamp; @end here's .m #import "sasuploadimage.h" @implementation sasuploadimage @synthesize timestamp; @end so in class want set timestamp property. create property called sasuploadimage , try reference uiimage object. here's how it: self.sasuploadimage = (sasuploadimage*)info[uiimagepickercontrolleroriginalimage]; info[uiimagepickercontrolleroriginalimage] <-- returns uiimage now can't reference uiimage object , call settimestamp. that's why tried downcast (sasuploadimage*) however, following error terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uiimage settimestamp:]: unrecognized selector sent instance 0x170086180' i see why have error trying called unrecognised method, i...

java - How this bitshift to build the number works? -

i saw method used faster reading of positive value of long. public static long readlong(inputstream in) throws ioexception { long n = 0; int c = in.read(); while (c < 48 || c > 57) { c = in.read(); } while (c >= 48 && c <= 57) { n = (n<<3) + (n<<1) + (c-'0'); c = in.read(); } return n; } while understand of part, i'm not able this: bit shifting odd number build number n = (n<<3) + (n<<1) + (c-'0'); why ignore 3rd bit , how it's able build it? if of explain me in simple way, helpful. thanks! n << i n * 2^i . so, (n<<3) + (n<<1) = (n * 2^3) + (n * 2^1) = n * (2^3 + 2^1) = n * 10 basically, means shift value of n 1 digit left. adding c + '0' means adding last digit integer value of c .

angularjs - using data from a promise in an angular controller -

inside of controller calling service contains array of data work in drinklibrary . drinklibrary has getdrinks -method getting data database. app.controller('analysiscontroller',function(drink,drinklibrary,$scope){ console.log('connected'); var drinkset = function(){ drinklibrary.getdrinks().success(function(data){ var caffeinedata = data; }); }; drinkset(); }); when call success() getting data want inside of caffeinedata . when call drinkset() getting data need inside of browser console. in controller. however, limited caffeinedata exist inside of drinkset -method. is there better way set might able use data in chart? where want data available? there number of things can do. example: app.controller('analysiscontroller',function(drink,drinklibrary,$rootscope,$scope){ console.log('connected'); var drinkset = function(){ drinklibrary.getdrinks().success(function(data...

javascript - $(element).width() reports differently values on Safari mobile -

i'm using script total width of horizontal div: $(document).ready(function(){ $('.portfolio li').each(function(index) { totalwidthportfolio += parseint($(this).width(), 10) + 12; }); $('.portfolio').css({ 'width' : totalwidthportfolio , 'visibility' : 'visible' }); }); the problem on desktop, script returned 23406 , on mobile (safari , chrome), returned 22522. i tried outerwidth(true) result same. here css: .portfolio{ margin: 0; padding: 0; list-style-type: none; position: absolute; top: 50%; transform: translatey(-50%); visibility: hidden; } li{ float: left; padding-right: 12px; display: block; box-sizing: border-box; } li img{ display: block; max-width: 100%; height: auto; } update the problems occurs on portrait mode the value returned depends how browser parse yours li element. try add display: block properties on css ...

android - RecyclerView Viewholder reusing -

i creating recyclerview expand when user touches , closes when user touches again. below code: public class recyclerviewadapter extends recyclerview.adapter<recyclerviewadapter.recviewholder> { arraylist<string> values; arraylist<integer> expandedposition; public static class recviewholder extends recyclerview.viewholder { ... private boolean resultsopened = false; ... relativelayout favheaderlayout; relativelayout favresultslayout; public recviewholder (view itemview) { super(itemview); favheaderlayout.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (!resultsopened) { expandlayout(); } else { favresultslayout.setvisibility(view.gone); resultsopened = false; } ...

ios - UISplitViewController isn't displaying master and detail views only the master view- iOS7 -

Image
i have uispltviewcontroller set initial view controller in storyboard, , have 2 other controllers representing master & detail views. when app launchs: in ios8: master , detail views both displayed. in ios7: master view displayed. how can fix this? edit: this how story board looks like. this how split view controller looks in ios8 and how looks in ios7

requirejs - Absolute path for almond when using require.js optimize -

i'm trying code optimize single file using apparently non-standard setup , i'm struggling understand different paths mean. imagine i'm making variant of r the requirejs command-line tool includes almond. want able wrap almond using almond included tool. my directory structure someappfolder | +--main.js in related folder myrplusalmondbuilder | +--myrplusalmonbuilder.js | +--node_modules | +--almond | | | +--almond.js | +--requirejs | ... so, want myrplusalmondbuilder able build single js bundle main.js this cd myrplusalmondbuilder node myrplusalmondbuilder.js someappfolder/main.js here's simple myrplusalmondbuilder.js var requirejs = require('requirejs'); var path = require('path'); var filename = process.argv[2]; var dirname = path.dirname(filename); var barename = path.basename(filename, ".js"); var config = { baseurl: dirname, name: "node_modules/a...

ibm mq - How to get information about message retrieved from queue -

i'm new in ibm mq. using following code can put message in queue , message. public void queueput() { queue = queuemanager.accessqueue("q1", mqc.mqoo_output + mqc.mqoo_fail_if_quiescing); mqmessage message = new mqmessage(); message.writestring("stackoverflow"); mqputmessageoptions putmessageoptions = new mqputmessageoptions(); putmessageoptions.options += mqc.mqpmo_async_response; queue.put(message, putmessageoptions); } public void queueget() { queue = queuemanager.accessqueue("q2", mqc.mqoo_input_as_q_def + mqc.mqoo_fail_if_quiescing); mqmessage gotmessage = new mqmessage(); queue.get(gotmessage); string str = message.readstring(gotmessage.messagelength); } you can see i'm writing message 'q1' , reading 'q2' since q1 alias queue now, thing want information message got in queueget function. want know gotmessage comes 'q1' if i...

PLSQL triggers and normal triggers -

could tell me difference between plsql trigger , trigger. in oracle docs finding 2 chapters of triggers. unable clear picture between two if @ reference on oracle triggers ( http://docs.oracle.com/cd/b28359_01/appdev.111/b28370/triggers.htm#lnpls020 ) you'll see this: a trigger named pl/sql unit stored in database , executed (fired) in response specified event occurs in database. so triggers written in pl/sql, why find syntax in pl/sql reference ( http://docs.oracle.com/cd/e11882_01/appdev.112/e25519/triggers.htm#lnpls020 ). bottom line, there 1 object being discussed: trigger. trigger object in database written in pl/sql. described in oracle documentation , again in pl/sql language reference.

swift - Cannot invoke initializer for type 'sqlite3_destructor_type' -

so far answer martin r has worked perfectly. starting swift2 raises error cannot invoke initializer type 'sqlite3_destructor_type' argument list of type '(copaquepointer)' in lines: private let sqlite_static = sqlite3_destructor_type(copaquepointer(bitpattern: 0)) // https://stackoverflow.com/a/26884081/1271826 private let sqlite_transient = sqlite3_destructor_type(copaquepointer(bitpattern: -1)) taken github post provided courtesy of @martinr answer is internal let sqlite_static = unsafebitcast(0, sqlite3_destructor_type.self) internal let sqlite_transient = unsafebitcast(-1, sqlite3_destructor_type.self)

c++ - FloatingRateBond cashflow retrieval and printing -

i using floatingratebond class create floating rate bond object, have priced correctly. however, need retrieve cashflows , dirty price decompose yield. have been trying following without success: leg cf=floatingratebond.cashflows(); leg::iterator it; for(it=cf.begin();it!=cf.end();++it) cout<<"type: "<<typeid(*it).name()<< " value:" << *it<<endl; output: type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14362a50 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14362c40 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14362e70 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x143630a0 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x143632d0 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14363500 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14363730 type: n5boost10shared_ptrin8quantlib8cashfloweee value:0x14363960 type: n5b...

ms access 2003 - Data type mismatch in criteria expression c# -

the following exception thrown when run below code: system.data.oledb.oledbexception data type mismatch in criteria expression private void buttonup_click(object sender, eventargs e) { try { connection.open(); oledbcommand command = new oledbcommand(); command.connection = connection; string query = "update data set name ='"+txtnl.text+"' , period ='"+txtper.text+"' , dob = '"+txtmonth.text+"', price = '"+txtprice.text+"', follow = '"+combofw.text+"' id = "+txtid.text+" "; //(id,name,period,dob,price,follow) messagebox.show(query); command.commandtext = query; command.executenonquery(); messagebox.show("data edited/updated successful"); connection.close(); } catch (exception ex) { messagebox.show("error " + ex); } } how can fix this? o...

c# - Custom encoding map multiple characters to one byte -

i trying write custom encoding, allows me use table file map specific characters bytes. unfortunately there characters not inside common unicode sheet (like buttons of video game, end of string identifiers, special ligaturs) wanted include encoding via escapes, example "\du" or "direction up" map arrow kind of character. problem is, if encoder gets character buffer "mid-sentence" there might not complete escape string in buffer, , program throws exception. (this happens when using streams example, create 1-4kb chunks of char data) is there way of telling c# encoder "reconsider" string, abort here when slidng further take @ characters again because might incomplete? my code, if of looks follows: public override int getbytes(char[] chars, int charindex, int charcount, byte[] bytes, int byteindex) { if (chars == null) throw new argumentnullexception("chars"); if (charindex > chars.length || charindex < 0...

Returning Top Customers by Territory For Each of the Last 4 Years and Summing Them SQL Server 2008 -

forgive me long title, succinctly put problem. have table contains sales data sale sales date, territory, customer info etc each sale. want return top 10 customers in each territory each of last 4 years sales value. if customer shows on multiple years top tens, should sum total value of years , order total value. therefore, if top 10 customers same 4 years, have 10 results. if if top 10 customers different 4 years, have 40 results. want query read in today's date, don't have update years searching each new year. having trouble begin, , yes new sql. the table "bookings". have put field types , sample data below: [bks_bookdate] (datetime), [bks_territorycodes] (nvarchar(255)), [bks_cus_recordid] (uniqueidentifier), [bks_bookamt] (money). sample data: bks_bookdate bks_territorycodes bks_cus_recordid bks_bookamt '2006-09-07 17:00:00.000' 'mf - usa' 'ef928a2e-1a71-4231-bfa9-0b1d2e903469' '1190.00' '2006-09-15 1...

ios - Why does an orientation change AutoLayout for my UITableViewCell? -

Image
i trying use autolayout inside uitableviewcell objective-c. not using nib/xib/storyboard. create views in code. here's uitableviewcell: @implementation settlementtableviewcell - (instancetype) initwithreuseidentifier:(nsstring *)reuseidentifier { self = [super initwithstyle:uitableviewcellstyledefault reuseidentifier:reuseidentifier]; if (!self) return nil; [self setselectionstyle:uitableviewcellselectionstylenone]; _order = [[uilabel alloc] init]; [_order settranslatesautoresizingmaskintoconstraints:no]; [_order setfont:[uifont preferredfontfortextstyle:uifonttextstyleheadline]]; [[self contentview] addsubview:_order]; _amount = [[uilabel alloc] init]; [_amount settranslatesautoresizingmaskintoconstraints:no]; [_amount setfont:[uifont preferredfontfortextstyle:uifonttextstyleheadline]]; [_amount settextalignment:nstextalignmentright]; [[self contentview] addsubview:_amount]; _pickupdate = [[uilabel alloc] init]; ...

inheritance - Static interface equivalent C# -

i've worked singletons in past , i'm aware it's solution people trying solve static interface problem. in case, can't use singleton because have external class i'm inheriting , have no control on 1 (a library). basically, have many classes inheriting "tablerow" (the class in library) , need every single of these classes implement static method (ex: getstaticidentifier). eventually, need store these objects in 1 of base types, , use static method on specific type. my question, there solution using singleton? there feature i'm not aware of in c# me solve problem? it seems want supply meta-information along subclasses of tablerow ; meta-information can retrieved without instantiating particular subclass . while .net lacks static interfaces , static polymorphism, can (to extent, see below) solved custom attributes . in other words, can define custom attribute class stores information want associate type: [attributeusage(attributetarget...

python django class based view and functional view -

i curious 1 better django's class based view or functional view , why. i feel functional view quiet easy lengthy , class based view can work few lines of code. is there performance issue these views? can guide me why use django's cbv ? on later day functional view depriciated? thank you class based view , functional view both has use cases. none better. it's depends on you, how using it. performance difference between cbv , fv negligible. still there no possibility of cbv or fv deprecated. has been discussed in lots of places including so , reddit .

c++11 - Understanding C++ Primer 5th ed solution posted by Moothy section 2.21 -

i'm newbie c++ , i'm working through exercises on chapter 2. have question on exercise 2.21. solution given moothy found on github exercise 2.21 explain each of following definitions. indicate whether illegal and, if so, why. int = 0; (a) double* dp = &i; answer: (a): illegal, cannot initialize variable of type 'double *' rvalue of type 'int *' i don't understand last part of answer " .. rvalue of int *". &i address of variable , never pointer mentioned here. why mention pointer here? , why rvalue of pointer int? int* means variable can contain address of integer variable. address of integer variable when placed on right hand side of assignment left hand side should int* otherwise give wrong results. that's told here. where pointer? dp pointer not integer pointer that's why error. rvalue - value appears in rhs of assignment operator. a=b (r-value) do know ...

Excel VBA - Click a specific pixel location in an open IE window -

i have existing macro navigates web page in existing ie window. there way can instruct excel click on specific pixel location? here plain english template accomplish ie.navigate "somesite.com" ie.document ie.click pixel 500,500 end 1, install autoit 2, add reference autoitx.dll (tools--reference--browse , navigate autoitx.dll) 3. add sinppet code set x = createobject("autoitx3.control") x.mouseclick "left", 500, 500

matlab - Loop Through Loading Files Error With Same Name -

i have question how load in data multiple directories, files need load have same name. here's have far: for = 1:numel(smoothlist1) % loop through smoothing directories path2 = sprintf('%s%s/trade-off_curves',path1,smoothlist1(i).name); cd(path2); disp(['changed directories ', path2]); data{i} = load('results.xy'); end i loop through each directory in list call smoothlist1 . within each ' smoothlist1 directory, change directories ~/smoothlist1/curves/ . within directory, there file called results.xy . need load each of results.xy file each ~smoothlist1/curves directory, unsure how that. have above loads in final results.xy file in last smoothlist1/curves/ directory. so question is, how loop through loading in results.xy file multiple directories? have tried doing data(j) = results.xy , add counter j , did not work. load these results.xy files separate filenames well. thank help.

How do I populate an Excel field with changing web data? -

i'm building list on excel 2011 (mac version). first column list of websites. second column list of corresponding alexa global ranks. the problem: alexa rankings change on daily basis , list needs stay up-to-date. can link excel alexa, each time website's alexa rank changes, it's corresponding excel field changes accordingly? ex of website's alexa page: http://www.alexa.com/siteinfo/cnn.com you external data web, using excel's inbuild ability so. extremely time consuming. if did example above have create worksheet cnn's alexa page linked it. have find cell contained text "global rank iconx y" x , y numeric values. these values global ranking , change in last 3 months respectively. in example cell a87. it's of cleaning redundant data cell using formula like: =left(substitute(a87, "global rank icon", ""), find(" ", substitute(a87, "global rank icon", ""))) this leaves needing ...

node.js - Error: Cannot find module '/usr/lib/node_modules/node-inspector/lib/InjectorServer.js' -

Image
i work on mean.js application (on top of express.js > node.js). succeed debug locally (on kubuntu) node inspector, no problem. fail debug remotely (from ubuntu server) , after pushed app on network. i error on devtools console: page.getresourcecontent failed. error: enoent, open '/home/remi/publisher-server/server.js' error: cannot find module '/usr/lib/node_modules/node-inspector/lib/injectorserver.js' but server.js 's file permissions 775 , , owned me. if @ screenshot can see browser access files tree , contents: however, if @ one, you'll see server.js seems unreadable (content tab empty): here steps follow: i login server ssh options redirect the 5858 port ssh -l 5858:localhost:5858 my-remote-host from ssh session run app --debug option: $ cd ~/publisher-server $ node --debug server.js debugger listening on port 5858 application loaded using "development" environment configuration mean.js application starte...

typo3 6.2.x - creating extension not working: Table does not exist -

i'm new in typo3 cms , i'm creating new extension following error when try execute query repository. 1247602160: table 'hr.tx_hr_domain_model_job' doesn't exist this controller <?php namespace hr\hr\controller; class hrcontroller extends \typo3\cms\extbase\mvc\controller\actioncontroller { protected $jobsrepository; protected $objectmanager; public function initializeaction() { parent::initializeaction(); $this->objectmanager = \typo3\cms\core\utility\generalutility::makeinstance('typo3\\cms\\extbase\\object\\objectmanager'); $this->jobsrepository = $this->objectmanager->get('hr\\hr\\domain\\repository\\jobrepository'); } /** * jobs list * * @return void */ public function listaction() { $this->view->assign('jobs', $this->jobsrepository->findall()); } } and job repository class <?php namespace hr\hr\d...

javascript - How can I fade out/in a view based on a SELECT change? -

this simple if don't mind blatantly violating mvc, since i'm trying learn play nice angular, i've been tearing hair out on innocuous little things this. all want div#thisshouldfade fade out when new thing chosen, fade in new data. here's html: <body ng-app="myapp"> <div ng-controller="mycontroller myctrl"> <select ng-model="myctrl.currentthing" ng-options="object.name object in myctrl.things"> <option value="">--choose thing--</option> </select> <div id="thisshouldfade">{{myctrl.currentthing.data}}</div> </div> </body> and javascript: angular.module("myapp", []) .controller("mycontroller", function(){ this.things = [ { name: "thing one", data: "this data thing one" }, { name: "thing two", data: "this data thing two" }, ...