Posts

Showing posts from September, 2012

PrimeFaces Scrollable DataTable -

i facing problem primefaces datatable scrollable="true" , columns shrink , column header doesn't align columns. have seen lot of posts on stackoverflow same problem, couldn't solution, 1 have solution now??? <p:datatable id="iddatatbl" styleclass="lineitemdatatableqs hightlines" draggablecolumns="false" binding="#{<somebean>.<datatable>}" scrollable="true" scrollheight="150" rows="25" value="#{<somebean>.<datamodel>}" rowselectlistener="#{<somebean>.<methodcall>}" selectionmode="single" var="lineitemdata" rowsperpagetemplate="5,25" rowindexvar="linerowindex" selection="#{quotesummarybackingbean.selectedlineitemrowslist}"> . . . . <lot of columns.. 31> . . . </p:datatable> i cant post code :( in production in trouble, here code datatable tag, , there co

java - How to serialize and deserialize a CipherInputStream object -

i having problem serializing cipherinputstream object. exception whenever try this, here snippet of code public class crypto implements java.io.serializable { public crypto(string filename) { cipher cipher = cipher.getinstance("aes/ecb/pkcs5padding"); secretkeyspec secretkey = new secretkeyspec(key(), "aes"); cipher.init(cipher.encrypt_mode, secretkey); cipherinputstream cipt = new cipherinputstream(new fileinputstream(new file(filename)), cipher) bytearrayoutputstream baos = new bytearrayoutputstream(); objectoutputstream obj = null; try { obj = new objectoutputstream(baos); obj.writeobject(cipt); byte[] bv = baos.tobytearray(); system.out.println(bv); } catch(exception b) { b.printstacktrace(); } { obj.close(); baos.close(); } } } exception:

android - Horizontal Single Bar Graph with Two color representation -

Image
what easiest way create horizontal single bar graph in android 2 colors representations? this the amount 64% increased 100% timely manner (animation??? :( ) svg or image views or how? this layout achieves above, adjust p3 textview width (red background) in code percentage of p1 textview width (blue background) changing p4 textview text current percentage (consider percentage reaches 100% labels overlap, suggest setting text value on p3 after limit, 85%, , hiding p4. suggest using asynctask (or other threading method) if increasing percentage incrementally see ui updates. @ android tween animation. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dp" android:orientation="horizontal" android:padding="5dp"> <textview android:id="@+id/bar" android:layout_width="5dp"

Showing Date in different format in javascript datepicker -

i new javascript , trying make date-picker widget, have selected date in mm/dd/yy format,how can date "thu(day),25th july(date,month) ,2013" kind of format , how set input value current date.here's fiddle, http://jsbin.com/idowik/3/ http://jsbin.com/idowik/3/edit there warnings , please bear me , please open output in new tab. thank you, read docs date object: http://www.w3schools.com/jsref/jsref_obj_date.asp . need described there. have @ following code: <!doctype html> <html> <body> <input id="dateinput" type="text"></input> <button id="convertbutton">convert string</button> <a id="datestring"></a> <script type="text/javascript"> var dateinput = document.getelementbyid("dateinput"); var button = document.getelementbyid("convertbutton"); var datestri

android json multi dimensional array -

i have problem access json data in multi dimensional array. https://openligadb-json.heroku.com/api/matchdata_by_group_league_saison?group_order_id=20&league_saison=2010&league_shortcut=bl1 my code works fine getjsonarray("matchdata"); but can not access matchdata->match_results->match_result[0]->result_name or matchdata->goals->goal[0]->goal_getter_name here code: jsonobject json = null; json = jsonfunctions.getjsonfromurl("http://openligadb-json.heroku.com/api/matchdata_by_group_league_saison?group_order_id="+ group_order_id +"&league_saison="+ league_saison +"&league_shortcut=" + league_shortcut); if (json != null){ try{ jsonarray openbuli = null; openbuli = json.getjsonarray("matchdata"); mylist.clear(); for(int i=0;i<openbuli.length();i++){ hashmap<string, string> map

c# - How to write file chunk by chunk in WinRT? -

i trying write buffer data file. receive buffer data in callback function continuously. need read buffer , save in file received. repeated till complete file,i data chunk of 4k in size. below code either throws exception or output file corrupted. please let me know how in winrt. storagefile file = await windows.storage.applicationdata.current.localfolder.createfileasync(strfilename, windows.storage.creationcollisionoption.replaceexisting); public async void receive(byte[] buffer) { using (var ostream = await file.openstreamforwriteasync()) { await ostream.writeasync(buffer, 0, buffer.length); } } the problem in signature of receive . because it's void , not awaited , can run writting processes in same time (that's causes exception, and/or corrupted datas). i suggest use instead : storagefile file = await windows.storage.applicationdata.current.localfolder.createfileasync(strfilename, windows.storage.creationcollisionoption.replaceexisting); public

asp.net - How to change web service URL dynamically or easily? -

i have few web service references in asp.net vb web application .net 4 , using vs2010. 1 of them wcf service (i think has .svc @ end) , 2 of them .asmx services. have change them quite change different environment such development, test, production. right click on service reference (.svcmap file) , choose configure service reference. update service reference , web.config. override binding setting such maxreceivedmessagesize="2147483647" have put in web.config every time change url. i wondering if there easier way change url doing. have seen similar posts on setting url behaviour = dynamic don't have option in mine , don't know why. with .net 4, looks proxy class has constructor takes useful parameters. try instantiating proxy class this: myservice.foosoapclient foo=new myservice.foosoapclient("myservicesoap",myurl); the myservicesoap name comes app.config file. name property in <client> <endpoint ... name="myservicesoap"

Automate a legacy Java application from C# -

i have old legacy java application i'd automate c#. problem don't have source code of application , programmer has long since left company. 'decompile' .jar file i'm no java programmer either, , don't think having access source code (without comments) me further. so far managed (kinda successfully) automate application's login dialog, using following code (i'm polling in loop because there might more 1 instance of java app): while (true) { var processes = process.getprocesses().where(p => p.mainwindowtitle.equals("title of java login window")); foreach (var process in processes) { var handle = process.mainwindowhandle; setforegroundwindow(handle); await task.delay(500); sendkeys.sendwait("the password"); sendkeys.sendwait("{tab}"); sendkeys.sendwait("the username"); se

android edittext - setContentView in a fragment -

i tried use setcontentview in fragment. not possible. know why? , how can fix problem? my destination open new view, if login right. hope u understand mean. package de.ibers.coffeelist; if (isvalid) { button buttonlogin = (button)rootview.findviewbyid(r.id.btn_login); buttonlogin.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { edittext pinedit = (edittext) getview().findviewbyid(r.id.et_pin); string inputpin = pinedit.gettext().tostring(); if(inputpin.equals(_pin)) { setcontentview(r.layout.buyview); } else { log.d("buttonlogin ", "faild"); } } }); override oncreateview method in fragment. @override public view oncreateview(layoutinflater inflater, viewgroup contain

typescript - ng-click not triggering Angularjs -

i need call function in type script view using angular.js. technologies use angular.js typescript , asp.net mvc3. this link in ui. <div id="left_aside" ng-controller="mygivingportfoliocontroller"> <div class="charity_portfolio_tile" ng-repeat="tile in vm.tiles.tilecontainerentity" > <a href="#" ng-click="delete(tile.id)" class="delete_button">delete</a> </div> when click link doesnt invoke method. delete = function (id:number) { alert("called " + id.tostring()); } then changed function below. delete(charityid: number) { var id = charityid; alert(id.tostring()); } though changed code, didn't work. don't know reason this. class mycontroller implements imycontroller { tiles: tilecontainerentities; constructor($scope, $http: ng.ihttpservice) { $scope.vm = this; $http.get("/api/privateapi/test/1").success((responc

c# - Extracting an unknown string between two known strings -

i have following string: string nextevent = "[[\"nextdata\", \"random message\"], [\"moreinfo\", {\"num\": 3204}]]" i need "random message" (without quotes) seperate string. now, easy if random message constant, it's not. let's it's generated through user input, , different in value , length every time. how go extracting message there? i've tried using substring indexof, got wrong results every time, it's quite confusing. if you'd 'brute force' method: string nextevent = "[[\"nextdata\", \"random message\"], [\"moreinfo\", {\"num\": 3204}]]"; string tmp = nextevent.trim(new char[] { '[', ']' }); string[] sa = tmp.split(','); string rndmsg = sa[1].trim().trim(new char[] { '[', ']', '\"' });

How to use same android button to start an activity and do a function in previous activity? -

i have sms application.here wish use send button send sms in activity move on new activity.i have written code send sms.but dono how go activity @ same time.kindly help.this code. btn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { string mobileno=pno.gettext().tostring(); string text=msg.gettext().tostring(); sentsms(mobileno,text); } }); use this: intent intent = new intent(this, yoursecondactivity.class); startactivity(intent); in onclick, be: btn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { string mobileno=pno.gettext().tostring(); string text=msg.gettext().tostring(); sentsms(mobileno,text); intent intent = new intent(this, yoursecondactivity.class);

c++ - Compose panorama doesn`t work -

i try use different way stitching images, got following error...i try change format of images or size nothing happens...any ideas? error: error: assertion failed (imgs.size() == imgs_.size()) in unknown function, file ......\src\opencv\modules\stitching\src\stitcher.cpp , line 128 my code: int main( int argc, char** argv ) { stitcher stitcher = stitcher::createdefault(); mat image11,image22; mat pano,output_frame; vector<mat> imgs,currentframes; // load images mat image1= imread( argv[1] ); mat image2= imread( argv[2] ); printf("-- umwandlung works"); currentframes.push_back(image1); currentframes.push_back(image2); stitcher.estimatetransform( currentframes ); stitcher.composepanorama(currentframes, output_frame ); waitkey(0); } the question similiar one: using compose panorama without estimatetransform i've answered there.

objective c - NSDateFormatter dateFromString returns null -

i want concatenate 2 nsdates via nsdatecomponents , [nsstring stringwithformat] [dtformatter datefromstring] . first 1 has complete format consisting of yyyy-mm-dd hh:mm:ss . second 1 has information hour , minute. want second date have other information first date excepting seconds (will added automatically?). think works until dtformatter formats string date. searched on stackoverflow no solution fix issue: my code : //pdate has complete date format nsdatecomponents *datecomponentscomplete = [[nscalendar currentcalendar] components:nsyearcalendarunit |nsdaycalendarunit | nsmonthcalendarunit fromdate:self.pdate]; //sunrise has incomplete format nsdatecomponents *datecomponentsincompletesunrise = [[nscalendar currentcalendar] components:nshourcalendarunit | nsminutecalendarunit fromdate:self.sunrise]; nsinteger day = [datecomponentscomplete day]; nsinteger month = [datecomponentscomplete month]; nsinteger year = [datecomponentscomplete year]; nsinteger hour = [datecompone

cakephp - Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE\cake\libs\view\helpers\paginator.php, line 194] -

i have table of users' details (first name, last name etc). trying use cakephp's paginator helper have links on fields instead of plain text viewer can sort fields in direction he/she may want to. getting warning 'warning (2): array_merge() [function.array-merge]: argument #1 not array [core\cake\libs\view\helpers\paginator.php, line 194]'. in controller have used following code: class userscontroller extends appcontroller { var $name = 'users'; var $helpers = array('html','form', 'paginator'); var $paginate = array( 'limit' => 30, 'order' => array( 'user.user_id' => 'asc' ) ); } in view have used following code: $tableheaders = array($this->paginator->sort('first name', 'first_name', array('model' => 'user')), $this->paginator->sort('last name', 'last_name', array('model&#

webspeech api - Using Google Voice Recognition API in building an iOS application -

i developing ios application voice recognition functionality. found way use google web speech api voice recognition , text-to-speech purposes. works fine. wondering if legal use google web speech api in ios application? there limits of usage api? tried find terms of service it, not find any. record voice standard ios format (example mpeg4). convert recording in flac format (you cannot inside xcode, used php service ffmpeg command). call google service following code: nsmutableurlrequest *urlgooglerequest = [[nsmutableurlrequest alloc]initwithurl:urlgoogle]; [urlgooglerequest sethttpmethod:@"post"]; [urlgooglerequest addvalue:@"audio/x-flac; rate=16000" forhttpheaderfield:@"content-type"]; nsurlresponse* response = nil; nserror* error = nil; [urlgooglerequest sethttpbody:audiodataflac]; nsdata* googleresponse = [nsurlconnection sendsynchronousrequest:urlgooglerequest returningrespo

javascript - drawing to canvas fails on first load. Refresh and it works -

here function. drawbuttons: function() { gamecontroller.ctx.strokestyle='pink'; gamecontroller.ctx.fillstyle='rgba(128,128,128,1)'; gamecontroller.ctx.linewidth=2; this.roundedrect(gamecontroller.ctx,105,162,160,50,10,true,true); this.roundedrect(gamecontroller.ctx,105,240,160,50,10,true,true); gamecontroller.ctx.fillstyle = 'rgba(153,051,000,1)'; gamecontroller.ctx.font = "35px ar darling"; gamecontroller.ctx.filltext("1 player",120,200); gamecontroller.ctx.filltext("2 player",120,278); } none of gets drawn on first load of webpage. can add code show call method if wishes see that. maybe have add .onload(), know how when adding image canvas, not filltext etc. thanks. window.onload within drawbuttons method solution. drawbuttons: function() { window.onload = (function(){ gamecontroller.ctx.strokestyle='pink'; gamecontroller.ctx.fillstyle='rgba(128,12

symfony - What does the yellow color warning icon mean in Symfony2 web profiler? -

Image
it's requests count did orm (doctrine), why it's yellow? solution a: http://github.com/doctrine/doctrinebundle/blob/master/resources/views/collector/db.html.twig#l6-l12 yellow color mean more 50 requests , no more my intuition "yellow" means : notice: large amount of requests should reduce performance reasons. and "red" mean : warning: huge amount of requests should reduce performance reasons. edit: exact values doctrinebundle handles choose color status db requests amount (vendor/doctrine/doctrine-bundle/doctrine/bundle/doctrinebundle/resources/views/collector/db.html.twig) : <span class="sf-toolbar-status{% if 50 < collector.querycount %} sf-toolbar-status-yellow{% endif %}">{{ collector.querycount }}</span> from 0 50 => green from 51 => yellow no "red status" db requests amount

c++ - need design help using private inheritance -

i have problem following situation: library (cardreader) implements iso7816 protocol , communicates smart card (implemented me). i have implement proprietary protocol use library. in cardreader there following classes apdurequest , apduresponse. , cardreader class implements functions send , receive these messages. class apduresonse { public: /* ctor, copy ctor, move ctor, copy =, , move = operators. */ //... int statusword() const { return ...; } int sw1() const { return ...; } int sw2() const { return ...; } }; on other hand in software have hierarchy independent implentare messages , smart card. interface of base class: enum class messagereskind { /* ... */ }; class imessageres { public: virtual ~imessageres() {}; virtual int statusword() const = 0; virtual int sw1() const = 0; virtual int sw2() const = 0; virtual messagereskind kind() const = 0; virtual void print( std::ostream& ) = 0; }; now doubt how de

apache - Regex redirecting page to unwanted page -

i using htaccess clean url, following rule profile page rewriterule ^([0-9a-z]+)$ profile.php?user=$1 but have other pages followers, following of loggedin user can see followers @ /followers page , rule is rewriterule ^following$ follow.php?follow=following rewriterule ^followers$ follow.php?follow=followers but when go /followers getting redirected profile.php (first rule above), can see in first rule after domain name localhost/text_that_comes_here goes profile.php what solution /followers , other pages redirected correctly. you should put more specific rules before more generic ones. in case, rules ^following$ , ^followers$ more specific ^([0-9a-z]+)$ ... cause "following" , "followers" catched first rule ^([0-9a-z]+)$ , , therefore redirecting profile.php reordering .htaccess following should trick: rewriterule ^following$ follow.php?follow=following rewriterule ^followers$ follow.php?follow=followers rewriterule ^([0-9a-z]+)$

php - CakePHP : Multiple views from One Controller -

i working in cakephp 1st time. need create multiple views single controller. eg: have settings table. schema of settings table 1.id 2.name 3.type i have created model , controller using cake bake. have multiple views data goes settings table. data of designations, departments, qualifications, projects , many other things go type field of settings table names entered. so when m creating model , controller thru cake bake creating view per settings table, whereas need view pages per types, i.e create designation, create departments, create projects , view, edit , delete files them. pls me find way achieve that.. you can add views creating .ctp file in respective views folder (views/"modelname"/add_department.ctp) in "modelname" controller add function adddepartment() { // logic here } but if want set type, can create normal add.ctp , create selectbox different possible types.

What is the meaning of “bool operator()(TypeName *n) const” in C++ -

for example bool operator()(point *p) const; {return f(p->pt);} is possible returns boolean if true call f? this overloads function-call operator type, case 1 argument compatible point* passed. example, if declared on type foo : foo foo; point point; // calls operator() method. bool returnvalue = foo(&point); there nothing magical body of method; call function f , passing in p->pt , , return result of expression bool. (what happening within method depends on type of f .)

python - Selenium - can I disable javascript only for several urls? -

i need disable javascript several urls, i.e.: browser.get('http://mydomain.com/page1') # actions js off browser.get('http://mydomain.com/page2') # actions js on browser.get('http://mydomain.com/page3') # actions js on browser.get('http://mydomain.com/page4') # actions js off i know can pass firefox profile webdriver.firefox() js off, apply pages. , think creating new webdriver.firefox() instance each page not idea. what best way solve problem? tia! split tests 2 big groups. 1 group runs tests js disabled , other group runs js enabled. that way, pay initial setup cost twice (instead of once per test). alternatively, organize js in such way goes through global symbol (jquery uses $ ). now need 2 implementations of framework. 1 normal implementation , other mock/no-op implementation doesn't when functions of called. you can use browser.executescript() assign 1 of implementations global symbol. there couple of downsides, t

How to combine multiple images together with specified proportions in python -

how 1 go creating montage of different images, relative sizes proportional given quantity? for instance if have: img1=image1.png img2=image2.png img3=image3.png render(file=img1,size=300px x 300px,file=img2,size=100px x 100px,file=img1,size=500px x 500px) which render image including of images 1-3 relative sizes. any achieving appreciated!

sql server - SQL query: How to select record from other table where no record exist or count = 0 (conditional) -

i had 2 tables: table 1: staffdb sid | name 1 | peter 2 | mary 3 | john table 2: employment history (staff have more 1 records) histid | sid | positionid | iscurrent | startdate | enddate 1 | 1 | 123 | 0 | dd-mm-yyyy | dd-mm-yyyy 2 | 1 | 221 | 1 | dd-mm-yyyy | 3 | 2 | 434 | 0 | dd-mm-yyyy | dd-mm-yyyy for example, in table 2. peter (sid=1) had 2 records, 2nd record current record (iscurrent=1) mary (sid=2) had 1 non current record john (sid=3) don't have record how can write sql query select staff don't have employment history or don't have current record (iscurrent=1) for above example, should returns mary , john. thanks use left join , check null primary key on joined table: select staffdb.* staffdb left join employmenthistory on staffdb.sid = employmenthistory.sid , employmenthistory.iscurrent = 1 employmenthistory.histid null or use exists - possibly

How to "create" HTML elements via Javascript? -

perhaps there's better way word question saying "dynamically create dom elements via javascript", decided write simple title in case latter wrong. anyway, there way can "spawn" html elements via javascript? example, can click button on site, , paragraph appear? you can use createelement() this: var el = docment.createelement("elementtype"); this create element, if replace elementtype type of element ("div", "p", etc.) after that, can use native .appendchild() or .insertbefore() methods on whichever element want attach new created element onto. var attachto = document.getelementbyid('appendtome'); attachto.appendchild(el); and it'll on page after last element inside of element. references: https://developer.mozilla.org/en-us/docs/web/api/document.createelement https://developer.mozilla.org/en-us/docs/web/api/node.appendchild https://developer.mozilla.org/en-us/docs/web/api/node.insertbefo

How do I stop "A lock is not available for <dataset>" errors in SAS? -

i consistently "a lock not available" errors when running sas programs. happens if perform operations on same dataset multiple times in 1 program. after researching error, it's understanding means 2 programs trying access same dataset. in other words, it's similar trying open document in use else or yourself. here example of code giving me error: data tstone.map; infile <path> delimiter = ',' truncover firstobs=2 dsd termstr=cr lrecl=32760; format assessment_edition $45.; format ... input assessment_edition :$45. ... ; run; data tstone.map; set tstone.map; drop districtname ...; run; i entered "..." in few places have long lists of fields import or drop. so, first i'm imported csv file, , performing data step overwrite file dropping fields don't need. should note when run programs not lock errors. no other users accessing these datasets, local machine. also, if highlight , run 2 data steps

Rails: ActiveRecord query regarding size of association -

i'm trying figure out how produce query, using activerecord. i have following models class activity < activerecord::base attr_accessible :limit, ... has_many :employees end class user < activerecord::base belongs_to :activity end each activity has limit, say, integer attribute containing maximum amount of users may belong it. i'm looking way select activities have spots available, i.e. number of users smaller limit. any ideas? thanks i think sql syntax aim be: select * activities activities.limit > ( select count(*) users users.activity_id = activities.id) in rails-speak ... activity.where("activities.limit > (select count(*) users users.activity_id = activities.id)") not sure whether column name "limit" going give problems it's reserved word. might have quote in sql. i'd consider counter cache users on activities table, make perform better. databases support

How do I link multiple TFS 2012 Build Definitions into a single build definition -

how or can i, create hierarchy of build definitions in tfs 2012? i have master build script (.cmd) calls multiple child scripts (.cmd). want migrate tfs build system , maintain hierarchy. i can't seem figure out if possible using tfs 2012 build system. here's i'm talking about: masterbuildscript.cmd call componentscript1 call componentscript2 call componentscript3 call ... call packaging routine components componentscript1.cmd build solution componenta1 build solution componenta2 build solution componenta3 ... componentscript2.cmd build solution componentb1 build solution componentb2 build solution componentb3 ... more components... is there way standard tfs 2012 build definitions? - bruce there way without doing custom coding. have make minor addition build process template, however. doesn't use code, uses windows workflow foundation. essentially, need setup tfs team build definitions each .cmd build script have. 1 master build, 1 each co

Cannot find octokit gem when running ruby, but irb can find it -

i ran rvm implode fresh install, reinstalled rvm , ruby. installed octokit gem want run. when run require 'octokit' in irb works, when try command line, such: ruby file.rb file.rb is: require 'octokit.rb' require 'csv.rb' csv.open("node_attributes.csv", "wb") |csv| csv << [octokit.user "dbussink"] csv << [octokit.user "sferik"] end i get: 1:in require: no such file load -- /octokit (loaderror) which ruby yields /usr/bin/ruby , which irb yields /usr/bin/irb , which octokit yields octokit not found . further, rvm list yields: rvm rubies =* ruby-2.0.0-p247 [ x86_64 ] # => - current # =* - current && default # * - default and, gem list octokit yields: *** local gems *** octokit (1.25.0, 1.4.0) how can make sure can find octokit when running ruby command line? i've tried changing path, using explicit path in require command, etc., nothing seems work!

xml - What is the syntax to properly use a variable in a Qt Qml XmlLIstModel query -

import qtquick 2.0 import qtquick.xmllistmodel 2.0 xmllistmodel { id: ios_elementsmodel source: "/testcode/positionersandrepeaters/positionersandrepeaters/menuitems.xml" query: "/menuitems/menuitem" xmlrole { name: "id"; query: "id/number()" } xmlrole { name: "type"; query: "type/string()" } xmlrole { name: "index"; query: "index/string()" } xmlrole { name: "verbage"; query: "verbage/string()" } xmlrole { name: "parentpageid"; query: "parentpageid/number()" } xmlrole { name: "destinationpageid"; query: "destinationpageid/number()" } } i using qt qml (qt quick) xmllistmodel defined above. i have tested above code , returns of items in xml file. i use variable filter items. such parentpageid = $myselectedpage. how do this? the problem xmllistmodel exists represent source xml. if want have f

css float - Create columns in CSS menu -

i'm attempting build phone directory css dropdown menu. i'm aiming render typical phone book would, names aligned left , phone extensions/numbers aligned right, so: james t. kirk x1701 mr. spock (123) 555-8795 the html pretty straightforward: <ul id="phone"> <li> phone category 1 <ul> <li> <span class="phone-description">phone description 1</span> <span class="phone-number">x55555</span> </li> <li> <span class="phone-description">longer phone description 2</span> <span class="phone-number">(800) 555-1234 x1701</span> </li> </ul> </li> ... </ul> the basic formatting simple well: body {background: #999;} ul {list-style: none; margin: 0; padding: 0;} li {margin: 0; padding: 0.4em 2em 0.

HTML/CSS Define a selection of characters' styling via CSS -

how can define selection of characters' styling via css? for example, have code in g supposed have special font/size , uru supposed styled. <font style="font-family: blessedday; font-size: 180px;">g</font>uru the above works assuming not practice. how can css class definition? similar, use spans: <span class="biggie">g</span>uru css: .biggie { font-family: blessedday; font-size: 180px; } note "blessedday" not seem freely available webfont.

bigcommerce - Updating Order to shipped without tracking inventory -

how can update order shipped contains untracked product using bigcommerce web api ? i have order product not being tracked part of inventory on bigcommerce . i need make appropriate web api call update status shipped. have tried make call using put /orders/id/shipments/id.json call below <?xml version="1.0" encoding="utf-8" ?> <shipment> <tracking_number/> <order_address_id>533</order_address_id> <items> <item> <order_product_id>628</order_product_id> <quantity>1</quantity> </item> </items> </shipment> , following 400 bad request response. <?xml version="1.0"?> <errors> <error> <status>400</status> <message>the field 'quantity' invalid.</message> <details> <invalid_reason>the quantity specified greater q

ios - Edit Google spreadsheet automatically from command line -

i´m trying make collection of scripts in php , bash ask bugsense errors in app, make need , upload couple of files google docs in company can see data date. i because, know, bugsense gives me information of last 30 days cannot store there historical of applications crashes. the problem i´m having how edit google spreadsheet without deleting , uploading again. mean, i´m doing right is: google docs $google_doc $google_doc_tsv now have file want edit, delete drive because if upload again not override , have files same name: google docs delete $google_doc --yes after need file , upload again: google docs upload $google_doc_tsv the problem i´m having new file everytime script runned cannot share document because i´m deleting everytime , uploading new one. the other thing googlecl allows edit file: google docs edit $google_doc --format tsv --editor vim but this, proccess not automatic because need deal vim. i´ve been checking everywhere nothing found solves problem.

mime types - How do I get Chrome to open M3U *outside* the browser -

Image
i'm running chrome on windows 7. have winamp mp3 player, , associated m3u files in operating system. when double-click m3u file in windows explorer, winamp opens it. however, in chrome, when clicking on link points .m3u file, instead of opening m3u file in winamp, chrome handles right there in browser. what i've tried: right-click m3u link, , download it. right-click on downloaded file name @ bottom of chrome window, , select open files of type. once downloaded, can click file in downloads bar, , open winamp then. great not have download first , click. thanks! sandra this chrome plugin handling instead of having chrome download it. settings>advanced>content settings>disable individual plugins... and disable or modify whichever 1 handling m3u files. if still doesn't work, there may silver shield icon displayed in on right side of address/search bar, next bookmark star: i encountered when running on self-signed ssl home server , ha

ios - Why is there no UIActivity for Flickr? -

a large variety of uiactivities have been published provide support additional services in ios: https://github.com/shu223/uiactivitycollection why has no flickr uiactivity been published? googling yields no mention of this. i'm guessing there's flickr authentication not play nice uiactivitycontroller i'd appreciate additional info. numerous blogs have reported 'possible' flickr integration in ios 7 can't wait , i'd prefer use uiactivitycontroller on objectiveflickr or sharekit. thanks. as mentioned in question, there support flickr in ios. uikit/uiactivity.h: uikit_extern nsstring *const uiactivitytypeposttoflickr ns_available_ios(7_0); and others mentioned, you're free build own uiactivity subclass supports flickr uploading well. suggest note on subclassing uiactivity in docs .

iOS Core Data - Removing object from relationship causes another relationship to become nil -

i have app using core data there multiple profiles. there multiple categories , products. each category can have multiple products, , each product has 1 category. each profile has relationship products , categories, don't have show everything. i'm running problem removing product relationship of profile ends it's category property nil. required property, fails context save. the category objects not being deleted.

c# - Way to force User to Enter Password in MVC to perform certain Actions -

i have crud model in mvc project. trying make user enter password if user authenticated when performing actions. [httppost] [validateantiforgerytoken] public actionresult delete_mv(mainvehicle c, int id = 0) { //verify user password //provide backup/download link userdata , delete data on server }

algorithm - Finding presence of palindromic sequence in a string -

how find if string contains contiguous palindromic sequence ? try naive solution in o(n^2) time n string size , efficient algos ? well looking palindrome isn't particularly interesting since every 1 character string palindrome. if looking longest palindrome may interested in manacher's algorithm . a description of algorithm can found here .

pygtk - Gtk3 appIndicator - update icon/text without user input -

so have python script sync's files nas every x minutes. trying write app indicator (ubuntu) follow process of above script. if embed indicator code script , use glib.timeout_add(10, handler_timeout) indicator cannot updated until sync done - i.e see layout below: * setupindicator() sync(): update app indicastor syncing sync nas - takes 5mins update app indicator - sync comlplete glib.timeout_add(30minutes, self.sync) gtk.main() * this want of course doesn't work this. trouble don't know go here - how can achieve this? i think need put nas functionality thread , thread kicked off @ each update. the first/last thing thread update indicator busy/idle. i've written appindicator (python 3, gtk+ 3) ubuntu called indicator-ppa-download-statistics , found here implements similar concept (i understand) want. i'm not sure if you'd need use locking mechanism or global flag i've used in instance, @ least threaded approach allow

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL -

warning: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'color:red'> and code : $db->query("update members set id='{$this->test['id']}', lvl='{$this->userlvl}', ip='{$this->test['ip']}', time='{$this->test['time']}', linechat='{$this->test['msg']}' user='{$this->test['name']}'"); i'm beginner please tell me must ^^ i have tried $fixchat = mysql_real_escape_string($this->test['msg']); $fixname = mysql_real_escape_string($this->test['name']); $db->query("update members set id='{$this->test['id']}', lvl='{$this->userlvl}', ip='{$this->test['ip']}', time='{$this->test['time']}', linechat='{$fixchat}' user='{$fixname}'"); but got error

apache - URL: transform "/news.php?id=1" to "/news/1/" -

i'm trying make more cleaner url's website. have allready found lots of questions regarding removal of file extensions in url's , managed working. want take step further though transforming url http://www.site.com/news.php?id=1 http://www.site.com/news/1/ . couldn't find answer specific question i'm asking here. how achieve url's that? rewrite rules allready have in htaccess: rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(([a-za-z0-9\-]+/)*[a-za-z0-9\-]+)?$ $1.php there plenty of questions out there answer question. there 2 things have do: redirect ugly url fancy url, user sees fancy url internally rewrite fancy url ugly url, server can execute it. you can find documentation mod_rewrite here . solution uses [end] flag available apache 2.3.9 , up. can find documentation here . trailing ? in first rule discards query string. #redirect ugly url fancy url rewritecond %{query_string} id=([^&]*) rewriterule ^news\.p

c++ - Can't find memory leak detected by Valgrind -

i'm working on program , have memory leak can't nail down. i'm not experienced c/c++ either. i'll post 1 of valgrind errors , class definitions , functions relevant... if forget something, ask , update :) reason not posting of valgrind report there lot of them, similar... difference stack trace has. i started out designing rather poorly, fix memory leaks, idea create global factory add objects in order delete them later. replaced every occurrence of "new" factory method create it.. in case, class column. i'm positive every object created makecolumn deleted, use vector store pointer. function iterate through vector , delete each item in being called before program ends. this valgrind report makes me think somehow, string not being unallocated. set glibcxx_force_new variable, , makes no difference in leaks detected. using gcc 4.7.2. also, yes, receiving information antlr generated parser... not matter, antlr handles it's own memory. char pointe

c++ - Multimap insertion crashes after 1 insert -

i writing program spellchecker, implements crude version(for simplicity) of soundexing incorrectly spelled word. goal: while iterating set, holds words in dictionary, soundex code generated, inserted multimap soundex being key, , word dictionary being associated data. issue: after loop iterates once, program crashes. have narrowed down issue being actual insertion itself. note: d pointer holds multimap. multimap sndxmap; code: replacementchooser::replacementchooser(const dictionaries& dictionary) { //loop through dictionary, giving word extendedsoundex for(dictionaries::iterator = dictionary.begin(); it!=dictionary.end();it++) { string code = extendedsoundex(*it,-1); d->sndxmap.insert(multimap<string,string>::value_type(code,*it)); //crashes } }

c# - Filter GridView with Javascript -

i have function in javascript makes filters in gridview. but, function makes filter column, ie needed "input" per column in gridview filter gridview. how can adapt function 1 "input" gridview columns? i've adapted function. originaly, gets values in "table" not in grdiview, situation don't see solution. i'm clear? my function: $(function () { $("#tabela input").keyup(function () { var index = $(this).parent().index(); var nth = "#gridview1 td:nth-child(" + (index + 1).tostring() + ")"; var valor = $(this).val().touppercase(); $("#gridview1 tbody tr").show(); $(nth).each(function () { if ($(this).text().touppercase().indexof(valor) < 0) { $(this).parent().hide(); } }); }); $("#tabela input").blur(function () { $(this).val(""); }); }); my gridview: <asp:gridview id="gridview1" runat="server"

regex - Replace pattern with one space per character in Perl -

let's i'm trying match url regular expressions: $text = 'http://www.google.com/'; $text =~ /\bhttp:\/\/([^\/]+)/; print $1; # prints www.google.com i replace pattern matches 1 space each character in it. instance, considering example above, end text: # http:// / is there simple way this? finding out how many characters matched pattern has , replacing same number of different characters? thank you. one simple way is: $text =~ s!\b(http://)([^/]+)!$1 . " " x length($2)!e; the regexp \b(http://)([^/]+) matches word boundary, literal string http:// , , 1 or more non-slash characters, capturing http:// in $1 , non-slash characters in $2 . (note i've used ! regexp delimiter above instead of usual / avoid leaning toothpick syndrome .) the e switch @ end of s/// operator causes substitution $1 . " " x length($2) evaluated perl code instead of being interpreted string. evaluates $1 followed many spac

ios - Load data before UITableViewController will be shown -

i have app, , must info internet. request url in block , made after uiviewcontroller appear, , makes app crash on runtime because use info construct uiviewcontroller. i don't know how assure code block finish tasks , later use info. * edit * now app shows empty table, , dont know how make shows info get. maybe reloadtable, don't know how. help! storecontroller.m - (void)viewdidload { [super viewdidload]; _productdata = [productdata productdata]; [_productdata backendtest]; } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [_listofchips count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { productcellcontroller *cell = (productcellcontroller*)[tableview dequeuereusablecellwithidentifier:simpletableidentifier]; if (cell == nil) { nsstring* namenib = uiuserinterfaceidiompad == ui_user_interface_idiom()

How to Delay between subsequent append html to a div using Jquery or javascript? -

this question has answer here: how add delay in javascript loop? 17 answers in application facing problem setting delay when appending html div within array. (subsequent time). please see following code. 10 times appending " hello world" text div. want delay after each append. function somefunction(){ for(var i=0;i<10;i++) { addelement(); } } function addelement() { $('.somediv').append('<div>hello world</div>'); } i have tried this: function somefunction(){ for(var i=0;i<10;i++) { settimeout(function(){ addelement(); },1000); } } but not working. how can this. try this: function somefunction() { (var = 0; < 10; i++) { settimeout(function(){ addelement(); }, 1000 * i); } } function adde

c# - Capturing responses from shell -

when send command command prompt in run command prompt commands how can capture response future work in code or save it? possible capture responses when sending commands way in? you need set redirectstandardoutput = true; . example might be: class program { static void main() { // // setup process processstartinfo class. // processstartinfo start = new processstartinfo(); start.filename = @"c:\7za.exe"; // specify exe name. start.useshellexecute = false; start.redirectstandardoutput = true; // // start process. // using (process process = process.start(start)) { // // read in text process streamreader. // using (streamreader reader = process.standardoutput) { string result = reader.readtoend(); console.write(result); } } } } i grabbed example here , pasted code here posterity.

Styling Google Map in Android -

i think know answer this, can style google map v2? style, mean using google maps api styled map wizard ( http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html ) can used pull json styling data javascript api. google seems have pulled off ingress, hoping there's way. can't seem find way suspect google using inside knowledge ingress. know sure? to style map, call googlemap.setmapstyle() passing mapstyleoptions object contains style declarations in json format. can load json raw resource or string,in mapready() function ... after ading json call map ready function @override public void onmapready(googlemap googlemap) { mmap = googlemap; try { // customise styling of base map using json object defined // in raw resource file. boolean success = mmap.setmapstyle( mapstyleoptions.loadrawresourcestyle( this, r.raw.style_json));

How to generate TypeScript or ActionScript UML class diagrams? -

Image
are there tools can generate uml class diagram project in typescript or similar language actionscript? using uml diagram feature introduced intellij editor jetbrains , works typescript. open diagram popup go settings >>> search uml , find keyboard shortcut it. or right click on class name >>> diagrams >>> show diagram popup show class properties , methods: righ click on diagram popup >>> show categories >>> methods or properties tips you find many options show through right click on diagram popup. you can zoom on diagram objects (if there details) holding alt key when hovering on them