Posts

Showing posts from April, 2012

how do i pagination works in HTML -

i created site, , added pages site, since page size exceeds need create pagination in html have created method <a href="page1.html">1</a><a href="page2.html">2</a><a href="page3.html">3</a> in way created problem when add new page need replace code again this <a href="newpage1.html">1</a><a href="page1.html">2</a><a href="page2.html">3</a><a href="page3.html">4</a> ever time when add new page need replace code ther way without php can sombody me idea in html do not re-invent wheel. use datatables, provide sorting, pagination (client side , server side), export , number of additional features. http://datatables.net/ include files , add this. $(document).ready(function() { $('#example').datatable(); } ); this basic , example, should go it. http://datatables.net/examples/data_sources/d

php - Log out when click on link -

i'm having trouble log in code website, system allows user log in , log out when user logged in , clicks on webpage link, signs them out. want them stay logged in on pages until user clicks log out themselves. the loginform.php: <div id="contact"> <form id="form" action="<?php $_server['php_self'];?>" method="post"> username: <input type="text" name="liusername" id="liusername"> password: <input type="password" name="lipassword" id="lipassword"> <input type='submit' value='login' name="lisubmit"> </form> </div> php code on heading.php: <?php if ($_session['loggedin'] === true){ echo "you have signed in - <a href='loggedout.php'>click here log out</a>"; } else { include 'loginform.php

r - Replace values in a data.frame column based on values in a different column -

i have data.frame: df <- data.frame(id = rep(c("one", "two", "three"), each = 10), week.born = na) df$week.born[c(5,15,28)] <- c(23,19,24) df id week.born 1 1 na 2 1 na 3 1 na 4 1 na 5 1 23 6 1 na 7 1 na 8 1 na 9 1 na 10 1 na 11 2 na 12 2 na 13 2 na 14 2 na 15 2 19 16 2 na 17 2 na 18 2 na 19 2 na 20 2 na 21 3 na 22 3 na 23 3 na 24 3 na 25 3 na 26 3 na 27 3 na 28 3 24 29 3 na 30 3 na for one week.born values should 23 . two week.born values should 19 . one week.born values should 24 . whats best way this? i create data.frame containing mapping , simple join: require(dplyr) map <- data.frame(id=c("one","two","three"), new.week.born=c(

android - How to call an item using java? -

i have layer-list in drawable , contains item has drawable assigned it: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/first" android:id="@+id/first"> </item> </layer-list> and want change drawable of item using java, idea how this??

python 2.7 - SQL Query not working as it should -

so have 3 tables: authors: -------- id name 1 john 2 sue 3 mike authors_publications: --------------------- authorid paperid 1 1 1 2 2 2 3 1 3 2 3 3 publications: ------------- id year 1 2004 2 2005 3 2004 i'm trying join them count number of publications each author has had on 2004. if didn't publish should zero ideally result should this: id name publications_2004 1 john 1 2 sue 0 3 mike 2 i tried following: select a.id, name, count(*) publications_2004 authors_publications ap left join authors on ap.authorid=a.id left join publications p on p.id=ap.paperid year=2004 group ap.authorid i don't understand why it's not working. removing authors haven't published in 2004. your statement taking result set returned join's , them trimming off records year<>2004 .

Need Help Reading JSON object from a URL in a HTML -

i trying create website in can particular json object url , display on website. field trying display uv_index out of 3 fields. nothing being printed out. don't know if getting json object. <!doctype html> <html> <body> <h2>epa </h2> <p id="demo"></p> <script> var getjson = function(url) { return new promise(function(resolve, reject) { var xhr = new xmlhttprequest(); xhr.open('get', url, true); xhr.responsetype = 'json'; xhr.onload = function() { var status = xhr.status; if (status == 200) { resolve(xhr.response); } else { reject(status); } }; xhr.send(); }); }; getjson('http://iaspub.epa.gov/enviro/efservice/getenvirofactsuvdaily/zip/92507/json').then(function(data) { document.getelementbyid('uv_index').innerhtml=json.result; alert('your json result is: ' + json.result); //you can comment this, used

inputstreamreader - I made a simple android app so far and its not working. InputBufferedReader is the cause I think -

added alot of tv.settext( ) in order know of lines being executed , try block breaks. ending result of 'tv' 4. public class main extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); textview tv = (textview) findviewbyid(r.id.textview); bufferedreader reader = null; try{ tv.settext("1"); url url = new url("https://www.google.com"); tv.settext("2"); httpurlconnection conn = (httpurlconnection) url.openconnection(); tv.settext("3"); stringbuilder sb = new stringbuilder(); tv.settext("4"); reader = new bufferedreader(new inputstreamreader(conn.getinputstream())); tv.settext("5"); string line; tv.settext("6"); while((line = reader.readline()) != null){ tv.append(line + "\n"

Persisting variable values between scenarios in capybara -

i have code below if "#{w}" != emailofuser globalvariableforsecemail("#{w}") end def globalvariableforsecemail(useremail) $secuseremail = useremail + "rms.com" end the problem have first time scenario run , succeeds, second time run scenario $secuseremail value not input onto text box. want use variable across scenarios in feature file , run feature multiple times, how can achieve this? it's best avoid global variables across scenarios. if want it, put global variable in background/before block in feature spec

css - Container with max-width won't wrap inline-block children when resized -

given html : <section class="wrapper clearfix"> <section class="col"> <img src="http://placehold.it/200x120" alt=""> </section> <section class="col"> <img src="http://placehold.it/200x120" alt=""> </section> </section> ...and css @media screen , (max-width: 600px) { .col { max-width: 150px; } } .wrapper { max-width: 500px; margin: 0 auto; background: grey; font-size: 0; } .col { width: 200px; margin-right: 100px; display: inline-block; } .col:last-child { margin-right: 0px; } img { max-width: 100%; } demo - http://jsfiddle.net/j77cd856/4/ the container won't wrap around elements when media query gets activated. same thing happens floated children (which normal, guess?) i managed fix following clearfix, still don't know why happens or whether there better w

function - R Debugger doesn't stop at breakpoints -

i'm running script in r (using r studio) calls several nested functions (the script calls function, has code, , calls function, etc). need debug function several levels down. can first function called script placing breakpoint on line function call, , stepping function. however, when try repeat step next function (by having breakpoint @ line next function call), r keeps running code until it's done. using 'continue' command claims "continue execution until next breakpoint encountered." i can other functions stepping through line line, , stepping each function once reach it, take long time need way. any thoughts appreciated debug convenient problems of sort. say, want go through function myfun step step. run debug(myfun) before run code , behave if had breakpoint on first line of function. this works also, if function called within other functions or if inside package. in latter case, particularly useful, because can not change code of fun

python - How to add a chart to a PDF using ReportLab -

i've python project generates pdf data in web app in python using reportlab. it's building large text string , adding canvas, , generating pdf canvas. i've been asked add line chart in middle of pdf. i've found lot of info out there on how turn chart directly pdf in reportlab, example this: adding graph reportlab pdf but nothing how add chart pdf part of other formatted content. here's code i'm working with: class genpdf(r): @tornado.web.authenticated def get(self): """takes text , generates pdf""" msg = gen_report(subject, test_name) filename = "filename.txt" self.set_header("content-type", 'application/pdf; charset="utf-8"') self.set_header("content-disposition", "attachment; filename=%s.pdf" %filename) io = stringio.stringio() c = canvas.canvas(io, pagesize=a4) imagem = canvas.imagereader(stringio.stringio(o

php - WP Job Manager - Orderby Customfield -

i'm using plugin wp job manager, , have custom field meta_key = rating. i want able order listings rating , via short code "orderby". normally posts imagine in funcitons.php: $args = array( 'orderby' => 'meta_value', 'meta_key' => 'rating', 'meta_query' => array( array( 'key' => 'rating', 'value' => null, 'compare' => '!=' ) ), // end of meta_query 'fields' => 'id', 'exclude' => array( 1 ), ); anyone knows how this? try adding functions.php: function args_function_rating_dsaw($args) { $args['orderby'] = 'meta_value_num'; $args['order'] = 'desc'; $args['meta_key'] = 'rating'; return $args; }

java - How to get the Files that have changed since the last run of a Gradle Task? -

i have following gradle task: class mytranslatetask extends defaulttask { @inputfiles filecollection srcfiles @outputdirectory file destdir @taskaction def run() { ... } } how can files srcfiles have changed since last run of task? gradle 1.6 introduced incubating feature called incrementaltasksinputs allows access files changed or removed since last task run. ref: https://gradle.org/docs/current/dsl/org.gradle.api.tasks.incremental.incrementaltaskinputs.html class incrementalreversetask extends defaulttask { @inputdirectory def file inputdir @outputdirectory def file outputdir @taskaction void execute(incrementaltaskinputs inputs) { inputs.outofdate { change -> def targetfile = project.file("$outputdir/${change.file.name}") targetfile.text = change.file.text.reverse() } inputs.removed { change -> def targetfile = project.f

ractivejs - Remove the first item on click in Ractive.js -

i have list of 4 items , need remove first item every time button clicked. implemented simple solution based on splice method seems work on first click. further click doesn't change thing. here html: <script type="text/ractive" id="template1"> {{#each posts}} <div style="background-color: red">{{text}}</div> {{/each}} <button on-click="removefirst">remove first</button> </script> <main></main> , javascript: var ractive1 = new ractive({ template: '#template1', el: 'main', data: { posts: [ {text: "post 1"}, {text: "post 2"}, {text: "post 3"}, {text: "post 4"} ], } }); ractive1.on({ removefirst: function() { ractive1.splice('posts', 0, 1, []); } }); and jsfiddle demo . when call splice on array, first argument index start removing elements

c - Risk of losing data when sending variables through pipe? -

i have following code: #include <unistd.h> #include <stdio.h> #include <sys/wait.h> #include <sys/types.h> // may not needed #include <sys/stat.h> // may not needed #include <stdlib.h> #include <string.h> typedef struct { int pid; char arg[100]; int nr; } str; int main() { int c2p[2]; pipe(c2p); int f = fork(); if (f == 0) { str s; s.pid = 1234; strcpy(s.arg, "abcdef"); s.nr = 1; close(c2p[0]); write(c2p[1], &s, sizeof(str)); close(c2p[1]); exit(0); } wait(0); close(c2p[1]); str s; read(c2p[0], &s, sizeof(str)); printf("pid: %d nr: %d arg: %s", s.pid, s.nr, s.arg); close(c2p[0]); return 0; } i have worked fine until (pid, nr , arg never altered), but: when child process done, memory segment (used child) destroyed (marked free)? if so, there risk between time of writing , time of r

string - Remove part of variable name for all variables in R -

i have dataset in of variable names begin string prior "." batch remove whole dataset.for example: frame <- data.frame("sec.xx" = rnorm(10), "sec2.zz" = rnorm(10), "sec3.yy" = rnorm(10)) names(frame) i remove in of names prior "." such resulting variable names "xx", "zz", "yy". , thoughts. you use sub function. > names(frame) <- sub(".*\\.", "", names(frame)) > names(frame) [1] "xx" "zz" "yy"

sql server - Create Trigger for Speific Column -

trying create trigger specific column can trigger whole table work. create trigger nameblock on tblcustomer insert begin rollback transaction print 'name edit not allowed!' end i want creates trigger if update customername done column in table create trigger nameblock on tblcustomer update if update(name) begin rollback transaction raiserror('name edit not allowed!',16,1) end to cover commented point can use below trigger too. create trigger nameblock on tblcustomer instead of update begin update tblcustomer set phone=i.phone,address=i.adress inserted inner join tblcustomer on (tblcustomer.id=i.id) i.name=tblcustomer.name if update(name) print 'name edit not allowed!' end

twitter bootstrap - jQuery datepicker: options ignored selecting the text field -

i'm trying use datepicker https://bootstrap-datepicker.readthedocs.org/en/latest/ into specific i'm using "component" view, text field button ar side. i've set datepicker ask year (among decades), month , day, i've set language italian , date format dd/mm/yyyy. that works correctly if use button select date, if give focus text field, datepicker appears default view: montly view pick date, english language , mm/dd/yyyy format date. this code in use: <input data-provide="datepicker" class="form-control" id="birthdate" placeholder="data di nascita" readonly="readonly" name="birthdate" type="text"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> $('.input-group.date').datepicker({ format: "dd/mm/yyyy", weekstart: 1, startview: 2, clearbtn: true, language: "it", autoclos

how does visual studio determines the active solution configuration? -

i using vs 2013 , created custom solution configuration -- "debug flag" - "any cpu". have central version control system, checkin our code. reason everyones' vs environment has new configuration active. don't want show active others unless explicitly change it. didn't find option set default active configuration on vs. ideas, why getting new custom config active one?

javascript - Angularjs - Cross Controller Calculation -

i trying create application angularjs, it's large application needs broken down multiple controllers. need calculate across controllers. angular.module('cross.controller.demo',[]); angular.module('cross.controller.demo').controller('kidsctrl', function ($scope) { $scope.kids = [ {"name":"john", "expense":"1000"}, {"name":"anna", "expense":"900"}]; }); angular.module('cross.controller.demo').controller('housectrl', function ($scope) { $scope.house = {"category":"utilities", "expense":"2000"}; }); angular.module('cross.controller.demo').controller('resultctrl', function ($scope) { $scope.result = {"category":"total", "expense":"2000"}; }); <!doctype html> <html ng-app="cross.controller.demo"> <scr

java - SymmetricDS exceptions -

i'm running 2 instances of symmetricds mysql. i have start , stop synchronizations, use: update sym_channel set enabled=0/1; for reason when synchronize ( enabled=1 ), following error: caused by: com.mysql.jdbc.exceptions.jdbc4.mysqlintegrityconstraintviolationexception: cannot add or update child row: foreign key constraint fails (`test_db`.`defectstdreference`, constraint `relationship72` foreign key (`improve_notice_doc_id`, `defect_id`, `client_id`) references `improvementnoticedefect` (`doc_id`, `defect_id`, `client) yet, in time synchronization finishes successfully, exception slowing down process. do have idea may have casued this? have created own channels or using default? if created own can synchronize independently of each other. result if have foreign key between 2 tables , parent table uses channela , child table uses channelb possible changes in channelb synchronize before channela causing foreign key error. @ times channelb may pro

What is the correct way to make a custom .NET Exception serializable? -

more specifically, when exception contains custom objects may or may not serializable. take example: public class myexception : exception { private readonly string resourcename; private readonly ilist<string> validationerrors; public myexception(string resourcename, ilist<string> validationerrors) { this.resourcename = resourcename; this.validationerrors = validationerrors; } public string resourcename { { return this.resourcename; } } public ilist<string> validationerrors { { return this.validationerrors; } } } if exception serialized , de-serialized, 2 custom properties ( resourcename , validationerrors ) not preserved. properties return null . is there common code pattern implementing serialization custom exception? base implementation, without custom properties serializableexceptionwithoutcustomproperties.cs: namespace serializableexceptions { using system;

How to download, compile & install ONLY the libpq source on a server that DOES NOT have PostgreSQL installed -

how can download, compile, make & install libpq source on server (ubuntu) not have postgresql installed? i have found libpq source here . not seem separable entire postgresql. in advance. i not want install entire postgresql. want use libpq c interface postgresql on different server (also ubuntu) have installed. i found this old link indicates above possible not how it. i have found libpq source here. not seem separable entire postgresql. it has configured entire source tree because that's generates necessary makefile parts. once configured, make && make install can run inside src/interfaces/libpq directory alone, , rest being left out completely. in steps: download source code archive, example https://ftp.postgresql.org/pub/source/v9.4.1/postgresql-9.4.1.tar.bz2 unpack build directory: tar xjf ~/downloads/postgresql-9.4.1.tar.bz2 apt-get install libssl-dev if it's not installed already cd , configure: cd postgresql-9.4.1; ./co

javascript - jQuery code isn't working when loading the page -

i'm having issue. have html page has javascript code , jquery code in same script tag. here html javascript , jquery: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>page</title> <!-- css --> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <link href="css/nivo-lightbox.css" rel="stylesheet" /> <link href="css/nivo-lightbox-theme/default/default.css" rel="stylesheet" type="text/css" /> <link href="css/animate

c++ - IMediaSample Time and MediaTime -

what primary difference between settime , setmediatime? right in directshow livesource calculate time this reference_time rtstart = m_rtlastsampletime; m_rtlastsampletime += pvih->avgtimeperframe; pms->settime(&rtstart, &m_rtlastsampletime); pms->setsyncpoint(true); pms->setdiscontinuity(rtstart <= 1); this doesn't work encoders. i've noticed source work these encoders set mediatime , seem jump up. media times : optionally, filter can specify media time sample. in video stream, media time represents frame number. in audio stream, media time represents sample number in packet. example, if each packet contains 1 second of 44.1 kilohertz (khz) audio, first packet has media start time of 0 , media stop time of 44100. in seekable stream, media time relative start time of stream. example, suppose seek 2 seconds start of 15-fps video stream. first media sample after seek has time stamp of 0 media time of 30. renderer , mux filters

html - Showing and hiding content with AngularJS -

i trying tab between different content views using angular. starts out showing no content, , toggles between 2 views after clicking on option. what want show first view on load, , let me toggle between two. here current code: <div ng-app=""> <div class="wrap"> <h1>hello there!</h1> <p>push radio buttons change content!</p> <form> <label for="first">show first content</label> <input id="first" type="radio" name="content" ng-model="content" value="first"> <br /> <label for="other">show other content</label> <input id="other" type="radio" name="content" ng-model="content" value="other"> </form> <div class="wrapper"> <p ng-show="content == 'first'">this fi

javascript - Chrome extension: Open html in the crx file with no icon on tab -

hi developing simple chrome extension substitutes current default new tab page opening index.html in extension's .crx directory. currently new tab page has been modified new index.html page, however, there no icon on tab. may ask why? much! current problem new tab page opened no icon on tab current problem the extension directory looks this: directory code of manifest.json follows { "manifest_version": 2, "name": "千山", "version": "0.1.0", "description": "测试", "icons": {"16": "icon200.png", "48": "icon200.png", "128": "icon200.png"}, "browser_action": { "default_icon": "icon.png" , "default_title": "测试", "default_popup": "popup.html" }, "chrome_url_overrides": { "newtab&

flattening list of lists in Scala with out using flatten method giving bad result -

i tried flatten list of lists using below code. when put on paper, should work think misinterpreted or ignorant of how lists work. 1 tell me went wrong. val = list(list(1,2,3),list(4,5,6),list(7,8,9)) def flatten(xss : list[list[any]]) : list[any] = { def flat(xs : list[any]) : list[any] = xs match { case nil => nil case head :: nil=> head :: nil case head :: tail => head :: flat(tail) } xss match { case nil => nil case head :: nil => flat(head) case head :: tail => flat(head) :: flatten(tail) } } flatten(a) you can pattern match deep structure: def flatten[t](xss: list[list[t]]): list[t] = xss match { case nil => nil case nil :: tail => flatten(tail) case (innerhead :: innertail) :: tail => innerhead :: flatten(innertail :: tail) }

php - Correct regex to detect font family names from google font link src -

i've been trying array of fonts i'm enqeueing on wordpress theme. testing. on input: http://fonts.googleapis.com/css?family=arimo:400,700|quicksand:400,700|cantarell:400,700,400italic,700italic|muli:300,400,300italic,400italic|roboto+slab:400,700|share:400,700,400italic,700italic|inconsolata:400,700|karla:400,700,400italic,700italic|maven+pro:400,500,700,900|roboto+slab:400,700|open+sans:400italic,600italic,700italic,400,600,700 what need on output this: array( [0] => 'arimo', [1] => 'quicksand', [2] => 'cantarell', ... on ) till now, have done 1 little problem. my code: $input = 'http://fonts.googleapis.com/css?family=arimo:400,700|quicksand:400,700|cantarell:400,700,400italic,700italic|muli:300,400,300italic,400italic|roboto+slab:400,700|share:400,700,400italic,700italic|inconsolata:400,700|karla:400,700,400italic,700italic|maven+pro:400,500,700,900|roboto+slab:400,700|open+sans:400italic,600italic,700italic,400,600,700&#

View gets pushed up when Personal Hotspot is ON (IOS App - Objective C) -

i have problem have no idea on how solve it, i'm developing ios app using objective-c , whenever personal hotspot turned on view gets pushed under (so lose 20px of navigationbar), tried found solution online found none, can please give me advice on how possibly solve this? edit: problem should library i'm using slide menu: https://github.com/aryaxt/ios-slide-menu root view controller has class slidenavigationcontroller, i've tried remove , view doesn't pushed before.. has had similar issue? this because slide menu set self.view.frame.origin.y 0 when it's activated. to solve this, need manually adjust offset according height of status bar. there 2 places can find rect.origin.y = 0 in slidenavigationcontroller.m , 1 in movehorizontallytolocation (it's handling 'pushing' animation) , other in initialrectformenu (the initialization method frame). need change 0 correct offset 2 lines. the implementation of calculating offset can fo

Java Integration testing with Arquillian, database cleanup -

i making integration tests, , need clean database between tests can make correct asserts, , tests wont result in errors failed while seeding database or unable clean database. . pom: <dependencymanagement> <dependencies> <dependency> <groupid>org.jboss.arquillian</groupid> <artifactid>arquillian-bom</artifactid> <version>1.1.2.final</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies> </dependencymanagement> <dependency> <groupid>org.jboss.arquillian</groupid> <artifactid>arquillian-bom</artifactid> <version>1.1.2.final</version> <type>pom</type> </dependency> <dependency> <groupid>org.jboss.arquillian.container</groupid> <artifactid>arquillian-glassfish-embedded-3.1</artifactid> <version>1.0.0.cr4</version>

Torch: Model fast when learning/testing, slow when using it -

i have issue using learned model torch. i followed howto http://code.cogbits.com/wiki/doku.php?id=tutorial_supervised train model. fine, model trained , have corrects results when use model. it's slow ! the testing part training this: model:evaluate() -- test on test data print('==> testing on test set:') t = 1,testdata:size() -- disp progress xlua.progress(t, testdata:size()) -- new sample local input = testdata.data[t] if opt.type == 'double' input = input:double() elseif opt.type == 'cuda' input = input:cuda() end local target = testdata.labels[t] -- test sample local pred = model:forward(input) confusion:add(pred, target) end -- timing time = sys.clock() - time time = time / testdata:size() print("\n==> time test 1 sample = " .. (time*1000) .. 'ms') i have following speed recorded during testing: ==> time test 1 sample = 12.419194088996ms (of course vary, it's ~12ms). i w

jquery - How to update row in the table when data is updated using ajax mvc -

i have data table , data displayed in have add edit , delete option once new data added based on response appending row table getserverdata("supplier/addsupplier/", supplierdetails, function (data) { if (data != null) { var row = ""; var address = data.address; var area = data.area; var supplierid = data.supplierid; var suppliername = data.suppliername; var email = data.email; } row += "<tr><td>" + supplierid + "</td><td>" + suppliername + "</td><td>" + address + "</td><td>" + area + "</td><td>" + email + "</td><td><i class='tbl_edit_btn fa fa-edit editsupplier' onclick=\"editsupplier(" + supplierid + ")\"></i><i class='tbl_del_btn fa fa-trash' data-id=" + supplierid + "></i></td></tr>

objective c - iOS: Launch A Custom Message To Be Handled By AppDelegate -

i attempting call method in app delegate piece of code going shared between many other applications. instead of retrieving reference app delegate i'd launch message app delegate can respond if happens implement right function, similar how can implement methods applicationdidreceivememorywarning if want respond system memory warnings. is possible or option have reference app delegate in code , check if responds selector before calling method? posting notification via nsnotificationcenter best bet. i'd suggest checking out objc.io article: http://www.objc.io/issue-7/communication-patterns.html . it's great overview of different patterns decoupling code.

mercurial - How to pull latest remote changes into remote repo (while using mqueues) -

the hg book recommends following workflow updating mqueue patches when remote repository has been updated link : hg qpush --all # qsave depricated (according hg qsave --help). appears have been # depricated since @ least 2010. additionally, qsave not working in environment # due organization's commit hooks hg qsave hg pull hg update --clean hg qpush -m -a the qsave command says: > command deprecated, use "hg rebase" instead. what new recommended workflow? want do: check out code make commits (probably not using mqueues) pull latest changes remote repo integrate changes repo. open rebase or merge workflow, want use kind of 3-way merge tool resolve conflicts edit : workflow using is: hg qpop --all hg pullup hg qpush # repeat until no patches left. the issue workflow generates .reject files. i know can a: hg qpush --all hg pull --rebase the issue don't know how abort or undo since modifies patches. think creates kind of

windows - apt-get not working in Cygwin -

i'm of cygwin newbie, might problem, i'm trying install package using apt-get , it's telling me there's no such command. installed on windows 7. the best got searching other questions here , across net need install specific (or run setup file update) when installing, it's not clear me need install or run or whatever. how install or update cygwin able use apt-get or, alternatively, how install packages basic, default installation of cygwin have? thank you. you can use : apt-cyg it works apt-get in terms of command line arguments, using apt-cyg instead.

java - How to fill page with overlay -

Image
i have transparent overlay in android app when user click on it,it fade can't fill activity below image mainactivity : <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:text="this original view" /> </relativelayout> overlayactivity : <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <imagevie

iphone - Using enum and switch case combination in Swift -

this question has answer here: switch in swift - case label in switch should have @ least 1 executable statement 2 answers noop swift's exhaustive switch statements 2 answers here code: enum gamescreen { case ksceneflashscreen case kscenemainmenu case kscenegamescreen case kscenestorescreen case kscenegameover } class ysgamemanager: nsobject { func replacegamescene(inscreen: gamescreen) { switch inscreen { case gamescreen.kscenegamescreen: //error here case gamescreen.kscenemainmenu : //here error } } } eror log: 'case' label in 'switch' should have @ least 1 executable statement how use enum in switch case in swift ? there's error because haven't got a

java - Camera Preview upside down -

front camera displaying upside down. reading each frame. think know put code.in surfacechanged don't know how do. @override public void surfacechanged(surfaceholder mholder, int arg1 , int arg2 , int arg3) { if (mholder.getsurface() == null) { return; } mcamera.setpreviewcallback(previewcallback); try { mcamera.setpreviewdisplay(mholder); mcamera.startpreview(); return; } catch (exception exception) { log.d("cameraview", (new stringbuilder()).append("error starting camera preview: ") .append(exception.getmessage()).tostring()); } } what have tried. private android.hardware.camera.previewcallback previewcallback = new android.hardware.camera.previewcallback() { public void onpreviewframe(byte abyte0[] , camera camera) { int[] rgbdata = yuvutils.decodegreyscale(abyte

javascript - highcharts gapsize in milliseconds -

to plot set of values on time line i'm using highstock (highchart same). with highstock, it's possible set attribute gapsize mark a 'gap' (a blank hole of missing data) if more x intervals missing. the 'interval' calculated automatically smallest interval in serie. if dataset doesn't contain equally spaced intervals result unpredictable , shown in example, can full of gaps: https://jsfiddle.net/ptysyo4p/5/ series : [{ data : data, type: 'areaspline', fillopacity: .35, gapsize: 5, <-- responsible it ideal set size of interval manually or directly setting gapsize time interval instead number of intervals . possible? update: by looking in code think closestpointrange ( https://github.com/highslide-software/highcharts.com/search?p=1&q=closestpointrange&utf8=%e2%9c%93 ). ideas if can set @ without breaking anything?

html - Using Ajax with Javascript -

my assignment make 2 separate paragraphs hide , show using jquery. have done successfully. our next step add in javascript ajax code in order allow 2 paragraphs show , hide. have created 2 separate html files in order accomplish this. my problem is, can't figure out how display both paragraphs @ once. either 1 shows or 1 paragraph appears twice, in both divs. thank you! var xhr = new xmlhttprequest(); xhr.onload = function(){ if (xhr.status === 200){ document.getelementbyid('get').innerhtml = xhr.responsetext; document.getelementbyid('set').innerhtml = xhr.responsetext; } }; xhr.open('get', 'share.html', true); xhr.send(null); xhr.open('get', 'network.html', true); xhr.send(null); that's because in onload callback of xhr request, you're setting both get , set elements same response text, why 1 paragraph appears twice. create 2 different xmlhttprequest objects , have different on

fiware - I have a missing matching_table.conf -

when enter /usr/cygnus/bin/cygnus-flume-ng agent --conf /usr/cygnus/conf/ -f /usr/cygnus/conf/agent_1.conf -n cygnusagent -dflume.root.logger=debug,console output: 2015-04-22 14:45:14,308 (lifecyclesupervisor-1-4) [error - es.tid.fiware.fiwareconnectors.cygnus.interceptors.destinationextractor.initialize(destinationextractor.java:84)] runtime error (file not found. details=/usr/cygnus/conf/matching_table.conf (no such file or directory)) 2015-04-22 14:45:14,309 (lifecyclesupervisor-1-4) [error - org.apache.flume.lifecycle.lifecyclesupervisor$monitorrunnable.run(lifecyclesupervisor.java:253)] unable start eventdrivensourcerunner: { source:org.apache.flume.source.http.httpsource{name:http-source,state:idle} } - exception follows. java.lang.illegalstateexception: running http server found in source: http-source before started one.will not attempt start. @ com.google.common.base.preconditions.checkstate(preconditions.java:145) @ org.apache.flume.source.http.httpsource.start(httpsour

vb.net subtraction giving error message for subtracting two numbers -

i trying use code in vb.net num_days = todate_split(0) - fromdate_split(0) to find out number of days between. example, todate_split(0) equals 20 , fromdate_split(0) equals 5 should return 15 but error saying: operator '-' not defined types 'char' , 'char' update: i using code too: fromdate_split.split("/") to split strings they in date format, example 30/12/2015 and want difference between 2 dates (days) what want parse dates , timespan : dim todate datetime = datetime.parse(todatestring) dim fromdate datetime = datetime.parse(fromdatestring) dim diff timespan = todate - fromdate this way number of days with: dim days int32 = diff.days

android - What is the proper use case for AppCompatCallback? -

the revision notes mention appcompatcallback needs implemented able perform callbacks. android docs cryptically state "implemented in order appcompat able callback in situations." what situations? support library activities or fragments need? proper use case appcompatcallback ?

What in this code causes memory leak in C#? -

in windows task manager discovered memory usage of program increases on time while it's running. memory leak caused code below. code loop iterating on list of images , resizes them according code example in msdn. resources seem managed , freed .dispose(). foreach ( string file in files ) { image = image.fromfile( file ); rectangle croprect = new rectangle( 0, 0, 1000, 1000 ); bitmap src = ( bitmap ) image; bitmap target = new bitmap( croprect.width, croprect.height ); using ( graphics g = graphics.fromimage( target ) ) { g.drawimage( src, new rectangle( 0, 0, target.width, target.height ), croprect, graphicsunit.pixel ); } image.dispose(); image = image.fromhbitmap( target.gethbitmap() ); src.dispose(); target.dispose(); image.dispose(); } could advise please can cause of memory leak in code? from docs of gethbitmap : you

scala - Akka - how to check how long a message was in inbox? -

how check in akka how long message in inbox? want make log message if message in inbox long. like: override def receive: receive = { case message => val timeininbox = ... if (timeininbox > treshold) log.warn("bla bla bla doom coming") there metrics / telemetry libraries available can provide information. 1 kamon.io (open source), gives "time-in-mailbox" metric, see http://kamon.io/documentation/kamon-akka/0.6.6/actor-router-and-dispatcher-metrics/ another 1 (non-free, closed source) " lightbend telemetry ", calls "mailbox time", see http://developer.lightbend.com/docs/monitoring/latest/instrumentations/akka/akka.html#actor-metrics

javascript - How to show horizontal scrollbar if user resizes the window created on fullpage.js -

i created simple webpage uses fullpage.js script. works sample page provided author . now, put there min-width on page, when user decides resize window horizontally , make small enough - instead of shrinking divs inside - display browser-native horizontal scrollbars. tried add either: body { min-width: 900px; width: 100%; } or same in other css tag: .section { text-align:center; width: 100%; min-width: 900px; } but none of worked well. found this communication author of plugin, i'm not sure if response helpful enough. can me implementation of feature? thanks! so decided make test page myself , read on plugin. coming conclusion way go instead of trying alter plugin : $(document).ready(function() { $('#fullpage').fullpage({responsive: 900}); }); it's right here comment on github question linked (blush). disadvantage of triggers vertical scrollbar well. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++