Posts

Showing posts from September, 2012

jquery - How to get clone html hidden id while clicks on cancel button -

i have clone html data here need delete 1 record need id cancel record. here html code: <div id="allergies" class="clone"> <div class="copy"> <input type="hidden" id="allergyid" value=""> /*rest of code html data*/ <a class="addallergy" id="addallergy">save , add allergy</a> <a class="removeallergy" id="removeallergy">cancel</a> </div> <div> here javascript code: var p=$('.copy').length; var h=0; for(var i=0 ; i<data.allergies.length ; i++){ var cloned = $(".copy:first").clone(true) . .appendto('#allergies').addclass("childallergyclass" + (i + 1)); $(".childallergyclass"+ ++h+" #allergyid").val(data.allergies[i].allergyid); } now html code be: <div

c# - How to queue up system process start -

i've written following code loop around load of data table rows , generate pdf if doesn't exist. works, launches wkhtmltopdfs in 1 go 30 processes started , kill server, d'oh! what's best way launch 1 process @ time , not start second until previous 1 has run? db db = new db(); datatable dtposters = db.getdatatable("select * invoices pdfgenerated <> 1 or pdfgenerated null"); foreach (datarow dr in dtposters.rows) { //generate poster, if exsists (don't!) directory.createdirectory(string.format("d:\\invoices\\")); string filepath = string.format("d:\\invoices\\{0}.pdf", dr["invoicenumber"].tostring()); if (!file.exists(filepath)) { string cmd = string.format("c:\\services\\automafe\\wkhtmltopdf.exe http://invoicegen/viewinvoice.aspx?invoicenumber={0} {1}", dr["in

How to play multiple audio files sequentially in html 5? -

i wanted autoplay multiple audio files sequentially. below code plays audios @ same time. <audio src="26de96c4000ceccafc415c5f191b5836.wav" autoplay ></audio> <audio src="0001.wav" autoplay ></audio> please advice whether can played sequentially. thanks vinoth remove "autoplay" attribute "audio" tags , use javascript: http://jonhall.info/how_to/create_a_playlist_for_html5_audio the method "ended" called when 1 "audio" tag finishes: <audio ... ended="nextaudionode.play();"> http://www.w3schools.com/tags/ref_av_dom.asp

Deleting fixed number of data from file in java or android -

my question clear. per current api can delete whole file or delete whole content of file. need deleting fixed number of bytes ( data ) file. if have file of size 30mb. wanna delete 2mb of data (from starting position not ending position). file reduce 28mb. in advance use filechannel.truncate(n) trim file specified size n. long n = 4096; file file = new file("file_path"); randomaccessfile raf = new randomaccessfile(file, "rw"); filechannel fc = raf.getchannel(); fc.truncate(n); fc.size()

javascript - Leaflet: how to affect all markers on a map? -

basically, have several markers on leaflet map. using jquery. @ moment, if want fill marker's popup ajax, have use code: var marker = l.marker([51.5, -0.09]).addto(map); var marker2 = l.marker([51.49, -0.09]).addto(map); marker.on("click", function () { $.ajax({ type: "get", url: "home/transactionform", datatype: "html", success: function(ajaxresult) { marker.setpopupcontent(ajaxresult); }, error: function (ajaxresult) { alert("filling popup failed!"); } }); }); marker2.on("click", function () { $.ajax({ type: "get", url: "home/transactionform", datatype: "html", success: function(ajaxresult) { marker2.setpopupcontent(ajaxresult); }, error: function (ajaxresult) { alert("filling popup failed!");

javascript - How to Test an optional member of an object? -

what best technique test optional object member. right prefacing expect statements if: if(object.member) expect(object).to.have.a.property('member').that.is.a('string'); but there must method more inline stylistically. e.g. expect(object).to.have.an.optional.property('member').that.is.a('string'); or (adding empty chain, readability): expect(object).to.have.an.optional.property('member').that.would.be.a('string'); or (moving optional provide alternative version of expect): optionally.expect(object).to.have.a.property('member').that.is.a('string'); update - started write code (new chai) see if accomplish targeting, added small plugin: module.exports = function(chai, utils) { var assertion = chai.assertion , = utils.inspect , flag = utils.flag; var optional_flag = 'chai-optional/option' assertion.addproperty('optional', function() { flag(this,

ms access - How to store data where the columns need to be different everytime? -

i writing crud application store client information. however, each client requires different data stored. e.g. 1 client may require data relating vehicle stored whilst requires information regarding fishing rods stored. have many new clients each week , have 100 current ones. there anyway around creating new table each client? edit: using access 2010 don't store information on different products in different columns! must normalize database . in case need have @ least 3 tables table customer -------------- customerid (pk) name address etc. table product ------------- productid (pk) name price etc. table customeritem ------------------ customeritemid (pk) customerid (fk) productid (fk) date remarks etc. if storing orders (or invoices) must replace customeritem table following 2 tables: table order ----------- orderid (pk) customerid (fk) date etc. table orderitem --------------- orderid (pk, fk) productid (pk, fk) quantity price etc. (pk) denotes primary k

java - Xamarin Studio - Packaging error - "jarsigner.exe" exited with code 1. (MSB6006) -

Image
i attempting build , deploy debug version of xamarin android application android emulator. following error when trying run app in emulator: "c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(2,2): error msb6006: "jarsigner.exe" exited code 1. (msb6006) (testapp) the strange detail able build , deploy same app no issues yesterday. error appeared today. there have been no code changes in project - code change has not caused problem. i appreciate community. this old thread i'm sure else: i've had same issue while trying deploy app using release mode. resolved performing following step:

Dojo Calendar MatrixView -

Image
trying widget render in basic way. <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=8"> <link rel="stylesheet" href="/eca/resources/dojox/calendar/themes/tundra/matrixview.css"> <link rel="stylesheet" href="/eca/resources/dojox/grid/resources/tundragrid.css"> <link rel="stylesheet" href="/eca/resources/dojox/calendar/themes/tundra/calendar.css"> <link rel="stylesheet" href="/eca/resources/styles/app.css"> <link rel="stylesheet" href="/eca/resources/dojo/resources/dojo.css"> <link rel="stylesheet" href="/eca/resources/dijit/themes/dijit.css"> <link rel="stylesheet" href="/eca/resources/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" type="text/css" href=&q

rdf - How to integrate several SPARQL queries -

this query: prefix pizza: <http://www.data.gov/semantic/data/alpha/1458/dataset-1458.rdf#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dgtwc: <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#> prefix xsd: <http://www.w3.org/2001/xmlschema#> select ?chem <http://ontomatica.com/public/ontologies/dataset-1458.rdf> { ?s dgtwc:uses_property ?chem . filter (regex(str(?chem), '.*sel.*')) . } produces result this query: prefix pizza: <http://www.data.gov/semantic/data/alpha/1458/dataset-1458.rdf#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?method <http://ontomatica.com/public/ontologies/dataset-1458.rdf> { ?s rdfs:label ?method filter regex(?method, 'selenium', 'i') } produces result for <rdf:description rdf:about="#entry6483"> , how write query produce result? ------------------------------------------------------ | chem

c# - Foreach way to iterate through years given months? -

var months = 36; to iterate through years , have access each year number (according how many months have (above)), i'm doing: var years = convert.toint32(months / 12); (int = 1; <= years; i++) { var year = 12 * i; } however, i'm sure there must way of populating new list of integers part of foreach , looping through them (giving me access current element rather recalculating again inside for loop). i'm looking writing foreach . possibly linq .select() ? don't current approach. desired result foreach(var year in new list<int>(){ 1, 2, 3}) { } something this?: foreach (var year in enumerable.range(1, months / 12))

c# - Snap window size to fixed multiples -

the windows command console allows resize window multiple of character size. "snapping" of window size instantaneous , not flicker. in native code, done processing wm_sizing message , modifying rect structure accordingly. in c#, tried overriding onresize method, computing "snapped" size, , setting form's clientsize property accordingly. unfortunately, size keeps jumping between snapped size , whatever size cursor dictates. protected override void onresize(eventargs e) { int tgtcols = (clientsize.width + 4) / 8; int tgtlines = (clientsize.height + 8) / 15; if (cols != tgtcols || lines != tgtlines) { cols = tgtcols; lines = tgtlines; int tgtwidth = cols * 8; int tgtheight = lines * 15; //clientsize = new size(tgtwidth, tgtheight); size = new size(tgtwidth + exwidth, tgtheight + exheight); } base.onresize(e); } as can see, i've tried using both size , clientsize properties,

excel - Get sub-parts of text in cell -

Image
i have spreadsheet in excel 1 product per row , height , width of each item according text in column. have dimensions text in column: 8" h x 8" w 2.5" h x 3.5" w per side 8" h x 8" w 1 color left side 1" h x 3" w and put height in column (b) , width in column (c). this: (a) (b) (c) 8" h x 8" w 8 8 2.5" h x 3.5" w 2.5 3.5 per side 8" h x 8" w 8 8 1 color left side 1" h x 3" w 1 3 i started snippet can't figure out how desired part: sub numberextractor() dim cell integer cell = 2 449 if instr(cells(cell, 17), """ h") > 0 cells(cell, 18).value = left(cells(cell, 17), instr(cells(cell, 17), " ") - 1) end if if instr(cells(cell, 17), """ w") &

c# - Topshelf WhenContinued not working -

topshelf not working when add whencontinued in configuration. working fine start , stop methods. not have code in continue method block running ( simple console.writeline ) hostfactory.run(x => { x.setdescription("data service - poc"); x.setdisplayname("data service"); x.setservicename("dataservice"); x.enablepauseandcontinue(); x.service<sampleservice>(s => { s.constructusing(() => new sampleservice()); s.whenstarted(v => v.start()); s.whenstopped(v => v.stop()); // s.whencontinued(v => v.continue()); }); x.runaslocalsystem(); }); what missing ? it compiling fine. not calling of methods . see console flash , disappear. cant read on console. if comment out line s.when

ios - How detect change status @property objective c -

i've little problem , don't know how solve it: i've develop little game in skspritekit , detect when bool @property (play/pause) change status. i've viewcontroller (uiviewcontroller class) superviewcontroller of game, singleton called backgroundcommon (nsobject class) include @property bool pause , stored methods common background, , skscenes write @proprety of backgroundcommon class. when skscene change or button press... system write @property . find solution apparently works nothing works me. link official documentation if follow guide problems are: backgroundcommon class not instancied because class used store methods for me observer viewcontroller , here must instace backgroundcommon class(i'm not sure) is viewcontroller bank object (like official documentation)? is backgroundcommon person object (like official documentation)? i tried on viewcontroller: - (void)viewdidload { [super viewdidload]; backgroundcommon *bkc = [[background

ssis - OLE DB SOURCE truncation -

i have ole db source , flat file destination set of objects on ssis package. getting warning on ole db object data truncation field. field called pricing_specialist_c. part of subquery. in below query. when run query using preview inside ole db edit window, there no truncation. set length of field in question 100 characters string in connection. however, in flat file truncated @ 15 characters. why this? heres query (with of stuff removed) select dbo.salesquotationtable.custaccount 'account_number__c', oem 'oem_c', (select name userinfo salesquotationtable.salestaker = userinfo.networkalias) 'pricing_specialist_c' dbo.salesquotationtable left outer join dbo.contactperson on dbo.salesquotationtable.contactpersonid = dbo.contactperson.contactpersonid createddate >= convert(varchar(10), getdate() - 30, 101) or --only update quotes created in 2013 or after (modifieddate >= convert(varchar(10), getdate() - 30, 101) ,

group by - How can I use SQL to return a list of customers with both a home phone & cell phone, home phone only, cell phone only, and no phone? -

i hope making more difficult is. here problem: need write sql query count customers in customer_table have phone_type of "home phone" , "cell phone" (i.e., these customers have 2 rows in table) customers have "home phone" (these customers have 1 row in table) customers have "cell phone" (these customers have 1 row in table) , customers have neither phone_type (these customers have @ least 1 row in table). here brief example of how should work: sample data in customer_address table: account_no phone_type ---------- ---------- home phone cell phone b home phone c home phone d cell phone e work phone f no phone on paper, query return like: phone types | account numbers ------------------------------------------------------- both "home phone" , "cell phone" | ----------------------------------------------------

sql server - T-SQL Query Gives Different Results when declaring integer vs calculating in-query -

so i've been experimenting sql random number generation in query, , noticed odd. let's run following query: declare @random int = cast(rand(checksum(newid())) * 5 int) + 1; select choose(@random,'one','two','three','four','five') sql random number gen little bulky, basic idea here simple - pick random number between 1 , 5, display number text select window. works expected. however, if take same query, paste random number formula method instead of declaring integer, it's on 1 line: select choose(cast(rand(checksum(newid())) * 5 int) + 1,'one','two','three','four','five') i still values 1 5 when run query, null. null comes pretty often, 1 in 5 times. if put both queries ssms , run them next each other few times, see null value second query, first never null. so why that? aren't these same calculation? have no idea why these 2 queries give different results, feel can

How to disable Kendo UI Editor completely including shortcuts -

i have tried following: disable or make kendo editor read-only and disabled keydown/keyup/keypress, there event fires underline, bold, etc. via shortcuts (ctrl + b, ctrl + u). i want disable , make editor read or disabled. i doubt there true way disable editor found work around now. $("#editorselector").off("keyup keydown keypress"); i turn off event , rebind events.

c# - Windows Phone 8.1 app MediaCapture under exposed -

i trying capture pictures directly camera in windows phone 8.1 store app. i have succeeded in initializing mediacapture device , take photographs black or way way under exposed. can point me in direction of how camera auto expose , if possible trigger focus catastrophic failure when call photomanager.videodevicecontroller.focuscontrol.focusasync() ? for auto-focus use code: mediacapture = new mediacapture(); var settings = new mediacaptureinitializationsettings(); settings.streamingcapturemode = streamingcapturemode.video; settings.photocapturesource = photocapturesource.videopreview; await mediacapture.initializeasync(settings); var focussettings = new focussettings(); focussettings.autofocusrange = autofocusrange.fullrange; focussettings.mode = focusmode.auto; focussettings.waitforfocus = true; focussettings.disabledriverfallback = false; mediacapture.videodevicecontroller.focuscontrol.configure(focussettings); for exposure, try this: await mediacapture.vid

php - Foreach skip user by capability -

i have code: foreach( get_users() $user ) { // set user id $user_id = $user->data->id; // users contributors or above if (!user_can( $user_id, 'edit_posts' ) ) return; // rest of code here } as can see, have set affects users can edit_posts . not working, can not use if (!user_can( $user_id, 'edit_posts' ) ) return; within foreach or doing wrong? it looks wish run code if user_can function returns value. you have 2 options here; first, closer have, uses continue control structure: foreach( get_users() $user ) { // set user id $user_id = $user->data->id; // users contributors or above if (!user_can( $user_id, 'edit_posts' ) ) continue; // rest of code here } however, lots of developers believe if need use continue you've got poorly written code somewhere. matter of opinion, opt option 2, place code wish run inside if block: foreach( get_users() $user

c# 4.0 - How to insert data in mysql database using C# -

string query2 = "insert library_database.status_of_issue values('"; query2 = query2 +textbox2.text + "','"; query2 = query2 + textbox1.text + "', curdate(),adddate(curdate(), interval 14 day)"; cmd = new mysqlcommand(query2, con); mysqldatareader d1 = cmd.executereader(); messagebox.show("issed..."); d1.close(); missing closing parenthesys values clause, query should rewritten avoid sql injection , insert query executed executenonquery string query2 = @"insert library_database.status_of_issue values(@p1, @p2, curdate(),adddate(curdate(), interval 14 day))"; cmd = new mysqlcommand(query2, con); cmd.parameters.addwithvalue("@p1", textbox2.text); cmd.parameters.addwithvalue("@p2", textbox1.text); int rows = cmd.executenonquery(); if(rows > 0) messagebox.show("insert ok...");

java - Multiple keyspace support for spring-data-cassandra repositories? -

does spring data cassandra support multiple keyspace repositories in same application context? setting cassandra spring data configuration using following javaconfig class @configuration @enablecassandrarepositories(basepackages = "com.blah.repository") public class cassandraconfig extends abstractcassandraconfiguration { @override public string getkeyspacename() { return "keyspace1"; } i tried creating second configuration class after moving repository classes different package. @configuration @enablecassandrarepositories(basepackages = "com.blah.secondrepository") public class secondcassandraconfig extends abstractcassandraconfiguration { @override public string getkeyspacename() { return "keyspace2"; } however in case first set if repositories fail configured column family entities not found in keyspace. think looking column family in second keyspace. does spring-data-cassandra support multiple keyspace repositories? pl

Display JSON or XML data on Freeboard(Web Dashboard) -

i developing iot system school project. i have setup dht11 temp/humidity sensor , raspberry-pi(with node-red) i able data sensor using nodes on node-red ,and can send data xively. the question want display data xively on free web dashboard.(freeboard,etc.) (i have written c# pages connect xively activate/deactivate sensor , view statistics on laptop.) i able convert sensor's data json or xml through node-red. there 2 solutions problem. connect freeboard node-red on device https://gist.github.com/dceejay/fb47301b759222e05f84 connect freeboard directly datasource (xively, local-harddive ,etc) http://buglabs.tumblr.com/post/96482541531/using-the-freeboard-tm-json-datasource-with-third-party (for second method, guess there's bug in freeboard value not updated regularly. link issue request on github : https://github.com/freeboard/freeboard/issues/55 update matter asap. update : freeboard have solved issue.

couchbase where can I execute cbq command -

i have couchbase server , want connect query engine. asked lot , found have use command ./cbq-engine -couchbase http://--couchbase-server-name--:8091/ regarding have many questions command, should put username , password, why should use port 8091 when server working online port 8080, don't want answer of questions, need know should execute command? i tried on cmd on got cbq not defined. i on windows 7 64bit please help since you're on windows, believe difference it's cbq.exe , you'll need have in path or in directory. downloads posted @ http://www.couchbase.com/communities/n1ql have cbq.exe included: . ├── license.txt ├── readme ├── cbq-engine.exe ├── cbq.exe ├── data ├── start_tutorial.bat └── static 2 directories, 5 files also note java 2.0, node.js 2.0 , other sdks have experimental support n1ql querying.

c# - Add a new collection inside a custom configuration section -

i have custom configuration section , need add new namevalue thing it here hierarchy -organizationconfigurations |-organizationconfigselector |-specificconfigurations |-organizationconfig now need add element called skiplanguages organizationconfig , simple collection element going hold strings. here xml sample <?xml version="1.0" encoding="utf-8" ?> <matcher type="host" match="hornet" servicename="config-hornet"/> <matcher type="parameter" match="vtdev" servicename="config-test-server"/> <organizationconfig name="config-hornet"> <add name="organization_identifier" value="sampleorg"/> <add name="allow_selfregistration" value="true"/> <add name="applicationselector" value=""/> <add name="registrationselector" value=""/> <add n

select - Compare row name with one cell in sql -

i have 2 tables. 1 table id, date, menu1, menu2, menu3 , table id, id_date, number, menu_number. in second table there data users have ordered menu in specific day. example: id: 1 id_date: 2014-09-09 number: 4000 menu_number: menu1. , information want give out number, date , menu on date stands in first table. select distinct b.id, b.id_date, b.menu, s.date ordering b, menu_plan s b.id_date = s.date , b.number = '4000859' this sql statement gives me menu number specific day. want content menu on specific day table 1. how work? or should in way , write in second table instead of menu number full menu? select distinct b.id, b.id_date, menu = case s.menu_number when 'menu1' b.menu1 when 'menu2' b.menu2 when 'menu3' b.menu3 else 'unknown' end, s.date ordering b join menu_plan s on b.id_date = s.date b.number = '400

postgresql - extract the max value from string in sql -

i work postgresql , want extract max value query: select max (num_ordre_decision) decision the problem num_ordre_decision contains kind of data: '4/35/677' '4/35/1001' the type of column string . when run query have max value: '4/35/1001' which false . i want compare 677 1001 in order have max value '4/35/677' in previous case. i think should use split in query. update i tried query: select max(split_part(num_ordre_decision, '/', 3)) decision; i have value: '99' when try run query select split_part(num_ordre_decision, '/', 3) decision; i result '' '' '677' '1001' '99' this result '' appears because real value in table not contain separator '/' . think max(split_part(num_ordre_decision, '/', 3) makes sum meaning makes 9+9 . correct result should 1001 so must compared numbers. updated : i want use query in project i

node.js - Passport.js session management without cookie -

i'm pretty new node world. have looked around few days, , can't find way existing npm "official" solutions. if there apologies, i'll better in finding right node resources. i have implemented working passport local policy following various examples available on internet. works well i want implement session management, don't want use cookies , use get / post parameters instead. reason behind i'm building api service might have work custom protocols (other http) cookies/headers don't exist. i have seen sessions support implementation passport , seems rely on express/connect session package, that, in turn, seems support cookie , have no way read/write sessions key in post / get parameters. before roll out own bespoke solution, point me available, if exists? so can this. passport.js uses npm express-session middleware actual session infrastructure. since express supports pipelined arbitrary middleware managed use following workar

How do I crop/resize a background/border out of an image with GraphicsMagick -

Image
i have images in large set of images have white (or black) border surrounds image itself. how can i... crop image size without said background/border resize image fill given output size centered. for example, have uploaded image 1280x1024px in size, has white (or black) border interior size 800x700 (may not centered), want crop out border, resize fill 640x480 output. take interior image, fill 640x480 cropping additional 100px of height original. i'd prefer can batch/shell script graphics magick, accept solution via phantomjs well. i'd prefer avoid additional tools/languages if @ possible. trim remove borders according corners pixels, extent , gravity make image size , align accordingly, also see geometry parameters, convert -trim source.png trim.png convert -extent 800x600 -gravity center trim.png frame.png here dimensions of images shown : source : 722 x 480 trim : 640 x 400 frame : 800x 600 edit this resize image fit 800 pixe

ruby - How to extract information from a gem -

i need extract information gem such summary, authors , version , need in ruby code , gem still compressed in .tar file. can me? you should use gem contents gemname [gemname ...] [options] information of gem. can read on useful gem commands in following articles: 25 gem commands rubygems ruby gems guide . if need in ruby, can invoke bash command using ruby , pipe output appropriate stream . please let me know if have questions!

c - Couchbase: (Error while establishing TCP connection) -

i'm new couchbase , trying become old this. at moment, i'm having problem, couldn't find solution in internet. i'm trying compile , run code: couchbase example compiling with: gcc -wall -g -o main main.c -lcouchbase (it compiles fine). running with: ./main couchbase://127.0.0.1:8092/user1 pass after calling lcb_get_bootstrap_status(instance) , says: (error while establishing tcp connection) yes, have created 'user1' bucket, password: 'pass', , have disabled iptables too. i'm using couchbase-server 2.5.1, on ubuntu 14.04 so, can me fix this? port 8092 not correct port, in fact view api (capi, couch api, map reduce etc.) port. should typically not place port unless server configured listen on non standard port in first place.

c - Accessing calloced array in GAS assembly -

i have c function allocated memory array going filled natural numbers n. lets say, n = 10; array = calloc(n, sizeof(int)); i call upon assembly function have written, don't seem able access array fields. manage find value of n located @ 8(%ebp), , have checked gdb equals n set in c code. however, when try access first element in array, , move to, example %esi, value not 0 should be. that using following code movl 12(%ebp), %esi edit; of course fill array natural numbers before calling assembly function. did not want type in loop here. as understands it, parentheses de-refrences first element of array, , copies esi, however, esi contains huge negative number when use info registers on breakpoint set after code in gdb. so, how access arrays calloced beforehand, , passed assembly function? not possible derefrence, , copy single element? here c function calls upon assembly function int main(int argc, char *argv[]){ int n = 10; int *array = calloc(n,

css - how to align span with textbox in html list elements? -

i have list of questions , each question have text box aligned @ right corner of page. using html list display question , each list element has span css class, works fine when browser page 75 % zoom. if increase/decrease zoom size, span element floating across page. this have currently .listright { position: absolute; right: 28.5em; } <ol style="padding-left:10px"> <li>some question text. may long or short. text box should displayed properly. <span class="listright"> <input type="text" name="text1" id="text1" dir="rtl" value="7" class aria-required="true" maxlength="4" style="width:4em;float:right;"/> </span> </li> <li> question 2 text. actual text displayed dummy text.

Gradle config file for L version and old versions of android -

i'm trying create android app new material design theme , can't work on previous versions of android. i cant find resource correct configuration. this gradle file: apply plugin: 'com.android.application' android { buildtoolsversion '20' defaultconfig { applicationid "com.appname" versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } productflavors { l { compilesdkversion 'android-l' minsdkversion 'l' targetsdkversion 'l' } old { compilesdkversion 19 minsdkversion 11 targetsdkversion 19 } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:support-v4:21.0.0-rc1' } } the app crashes , cant find material desig

ruby on rails - customize a chartkick bar_chart -

Image
i'm trying draw chart of user stories, grouped priority, this: <%= bar_chart @stories.group(:priority).where(:priority => ["1", "2", "3", "4"]).count %> turns out chart drawed want chart display description of priority. actually, 1 means 'low' , 3 means 'high. how can this?

twitter bootstrap - Chrome weird glitch while using Boostrap and Masonry.js -

i've been working on website has bootstrap core, , when included masonry image layout (+using bootstrap grid) bug occurs on chrome: video but if disable masonry transition, fine. any appreciated.

Conditional relationship creation using LOAD CSV in neo4j -

my task import number of friend or follow relationships simple neo4j graph db. input data csv following structure: owner,friend,type bob,charlie,friend alice,chris,follower in above example charlie friend of bob , chris follower of alice. want bulk import these neo4j using load csv i'm having trouble creating conditional relationships during import. import code looks like: load csv headers "file:./graph.csv" csvline csvline.owner owner, csvline.friend friend, csvline.type type merge (o:person { name: owner }) merge (c:person { name: friend }) merge (u)<-[:is_friend {type: type}]-(c); i'd rather have 2 types of relationships is_friend , follows . when try conditional statements like: case when type == "friend" merge (u)<-[:is_friend]-(c) else (u)<-[:follows]-(c); i receive syntax errors on use of case is there way make conditional relationships during bulk import csv this? there excellent blog post on @ htt

java - Crawling GitHub with JGit -

i'm trying crawl github wiki jgit. when try 1 url, worked fine. tried random url , got error. please see extract of code: import java.io.file; import java.io.ioexception; import org.eclipse.jgit.api.git; import org.eclipse.jgit.api.errors.gitapiexception; public class main { // url error string url = "https://github.com/radiant/radiant.wiki.git"; // url works // string url = "https://github.com/wardcunningham/smallest-federated-wiki.wiki.git"; public static void main(string[] args) { main m = new main(); m.jgittest(); system.out.println("done!"); } public void jgittest() { try { file localpath = file.createtempfile("testgitrepository", ""); localpath.delete(); git.clonerepository().seturi(url).setdirectory(localpath).call(); } catch (ioexception | gitapiexception e) { system.err.println("excepton: &quo

import - R Error: unknown input format -

nei <- readrds(unz(tf, filename = "summaryscc_pm25.rds", open = "", encoding = getoption("encoding"))) variable tf temporary file specific location saved on hard drive. understanding format unz() is: unz(description, filename, open = "", encoding = getoption("encoding")) as read documentation, interpreting application of code accurate that: description specific zip file destination, outputs in var tf c://...//345du.zip filename summaryscc_pm25.rds, file extracted from tf open established in var black should fine encoding labels language type. within context of code above, receive "error: unknown input format" r 3.1.1. need clarification on might happening interpret code same as: nei <- readrds("summaryscc_pm25.rds") am misinterpreting this? i found data online can read file. available here: https://www.linkedin.com/today/post/article/20140617173447-5576436-explore-n-analyze

javascript - mulitple divs with different css -

i'm working mapquest , leaflet. can have multiple maps on screen @ same time. have edited leaflet.css file, , change size of icons within map, zoom map @ , change icon sizes in leaflet.css file such: if (map.getzoom()=== 13) { $('.leaflet-label').css('font-size', '24px'); } the above label, pretty same icon/markers. because have 4 maps, use same leaflet.css file. when zoom in on 1 particular map, labels/markers/icons other maps change too, though zoom being utilized on 1 map. my html looks this: <link rel="stylesheet" href="leaflet.css" /> <link rel="stylesheet" href="leaflet.label.css" /> <div class="maps" style="width:400px; height:400px; left:1400px;" id="map"></div> <div class="maps" style="width:400px; height:400px; top:-400px;" id="map2"></div> <div class="maps" style="width:400px;

uiviewcontroller - iOS - Using dealloc to remove observer -

i have basic question regarding removing observer. i have viewcontroller parent class inherited 3 viewcontroller child classes. eg. bookvc -> bookhotelvc, bookflightvc, booktrainvc here, added observer in viewdidload of parent class (i [super viewdidload] in child viewcontrollers) notifies method written in parent class. code- [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(bookingcompleted:) name:@"bookingcompleted" object:nil]; now want remove observer when move away of child viewcontrollers, can't write [super dealloc] in dealloc of each child viewcontroller because arc doesn't permit this. how can remove observer set ? because whenever move child viewcontroller, new observer added causes weird things (like, calling method twice/thrice... - invoking alert twice/thrice...). kindly suggest. removing observers in dealloc fine, not call [super dealloc] (as saw, arc enabled, compiler won't let you), write:

impresspages - Every page a random picture with ipSlot -

i have problem. every page gets same header image. use following code: <?php $options = array('id' => 'image', 'width' => '500', 'class' => 'cssclass(optional)'); echo ipslot('image', $options); ?> i choose a![enter image description here][1] random image on each page without using blocks. thanks! add current page id image id , have separate image each page. eg.: $options = array('id' => 'image' . ipcontent()->getcurrentpage()->getid(), 'width' => '500', 'class' => 'cssclass(optional)'); echo ipslot('image', $options);

Convert Google Spreadsheet to Excel XLS with Script -

let me first realize question has been asked before, sincere apologies bringing again. however, have tried of suggestion , can't work out. trying write script take google spreadsheet, convert excel xls/xlsx format , email converted file attachment. here's coding tries create converted file. function googleoauth_(name,scope) { var oauthconfig = urlfetchapp.addoauthservice(name); oauthconfig.setrequesttokenurl("https://www.google.com/accounts/oauthgetrequesttoken?scope="+scope); oauthconfig.setauthorizationurl("https://www.google.com/accounts/oauthauthorizetoken"); oauthconfig.setaccesstokenurl("https://www.google.com/accounts/oauthgetaccesstoken"); oauthconfig.setconsumerkey('anonymous'); oauthconfig.setconsumersecret('anonymous'); return {oauthservicename:name, oauthusetoken:"always"}; } function test(){ var id = docslist.getfilebyid('file_id_here'); var url = 'https://docs.google.com/fe

c# - WCF security failing -

i self-hosting wcf service. service should provide custom authentication method can used authenticate our customer applications connect it. have written custom username/password validator, don't think it's being used. when attempt call service, message "the local security authority cannot contacted." app.config: <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="basichttpbehavior"> <servicemetadata httpgetenabled="true" httpgeturl="http://win8drewdev:8001/testservice/mex"/> <servicecredentials> <servicecertificate findvalue="0e 99 26 9b 04 20 93 86 5e 65 ad bb 7e 6d ea 62 8a 8a 07 7a" storelocation="currentuser" storename="my" x509findtype="findbyserialnumber"/> <usernameauthentication usernamepasswordvalidationmode="custom" customusernamepasswordvalidat