Posts

Showing posts from June, 2011

javascript - compressing image in client side in codeigniter -

<div class="container"> <div class="row"> <form action="<?php echo base_url();?>product-compress" method="post" enctype="multipart/form-data" onsubmit="return handlefiles()" > <input type="file" name="images" value="" id="imagefile" class="btn btn-default"> <input type="submit" name="submit" value="submit" class="btn btn-default"> <input type="hidden" id="my_hidden" name="my_hidden" value=""> </form> </div> </div> <img src="" id="image"> <script> function handlefiles() { var filestoupload = document.getelementbyid("imagefile").files; var file = filestoupload[0]; // create image var img = docume

python - Swig tool and C++. Being too clever -

Image
http://www.swig.org/papers/pytutorial98/pytutorial98.pdf comes above link: i know old publication possible information outdated. i ask: "seems work fine c++ if aren't being clever" mean, clever? is there known situation/case shuold careful programming c++ modules , extending python using swig tool? the slide strange , misleading. swig not transform pass-by-value pass-by-reference @ all. let me try clarify example: let's in example have c++ function double dot_product(vector a, vector b); now in plain c++ (no swig, no wrapping) may use function in following examples: 1. vector = vector(1,0); vector b = vector(0,1); double 0 = dot_product(a, b); 2. vector *a = new vector(1,0); vector *b = new vector(0,1); double 0 = dot_product(*a, *b); in both cases, function in fact called in same way using call-by-value. swig wraps objects structure contains pointer object, under hood swig passes pointers around everything, , therefore uses

Importing data from oracle using sqoop -

i using below command import table hadoop oracle using sqoop. m getting errors. noob in hadoop have no idea how fix it. sqoop import --connect "jdbc:oracle:thin:@172.16.10.112:1523:tabs" --username testuser1 --password testuser1 --table tabs.user_info --target-dir /tmp –verbose generic hadoop command-line arguments: (must preceed tool-specific arguments) generic options supported -conf <configuration file> specify application configuration file -d <property=value> use value given property -fs <local|namenode:port> specify namenode -jt <local|resourcemanager:port> specify resourcemanager -files <comma separated list of files> specify comma separated files copied map reduce cluster -libjars <comma separated list of jars> specify comma separated jar files include in classpath. -archives <comma separated list of archives> specify comma separated archives unarchived on compute machines. general comm

Google analytics API PHP Get data tablet/phone/deskop -

i have attached api , able acquire data type. returning visitor new visitor etc .. can not pull data on device, whether on mobile, tablet. i'm confused how write expoler not find it. public function getresultsgraph1() { return $this->analytics->data_ga->get( 'ga:' . $this->accounts, $this->startdate, $this->enddate, 'ga:sessions', array( 'metrics' => 'ga:sessions,ga:bouncerate')); } any advice on how it? you need add dimension ga:devicecategory return desktop, tablet, or mobile. $optparams = array( 'dimensions' => 'ga:devicecategory'); return $service->data_ga->get( table_id, '2010-01-01', '2010-01-15', 'ga:sessions', $optparams);

javascript - Swapping <div> position causes loss of CSS3 transition effect -

i've got issue seems caused altering position of 2 <divs> within parent, re-ordering them. both divs have transition css rule applied so: -webkit-transition: .2s ease-in-out; -moz-transition: .2s ease-in-out; transition: .2s ease-in-out; when call swap position: function swapelements(first, second) { $(first).insertbefore(second); } the first element not having transition effect applied browser, doesn't animate @ after having been swapped previous/second element. this problem i'm listening transition end callback more work within <div> (initializing gallery): if (modernizr.csstransitions) { $(roomcolumn).one('transitionend webkittransitionend otransitionend mstransitionend', function () { if (!gallery.hasclass('slick-initialized')) { $(gallery).slick({ lazyload: 'progressive', slidestoshow: 1, slidestoscroll: 1,

maven - How to download artifact to local repository from 3-rd party repository and USE IT later? -

i verify in desktop 3-rd party library meet needs. i added dependency project: <dependency> <groupid>com.oopsconsultancy</groupid> <artifactid>xmltask</artifactid> <version>1.16</version> </dependency> my project not compile: could not resolve dependencies project other-repo:other-repo:jar:0.0.1-snapshot: not find artifact com.oopsconsultancy:xmltask:jar:1.16 in central ( https://repo.maven.apache.org/maven2 ) -> [help 1] that ok, because xmltask located in 3rd party repository. downloaded them manually: mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -drepourl=https://maven.atlassian.com/3rdparty/ -dartifact=com.oopsconsultancy:xmltask:1.16 artifacts downloaded local repository: repositoryurl parameter deprecated. use remoterepositories instead resolving com.oopsconsultancy:xmltask:jar:1.16 transitive dependencies downloading: https://maven.atlassian.com/3rdparty/com/

javascript - Upload file to Node.js with HTML -

i'm trying make api upload file using node.js server. undefined response. i following tutorial https://www.youtube.com/watch?v=utfz-5wkpro node.js: var express = require('express'); var app = express(); var bodyparser = require('body-parser'); app.use(bodyparser.json()); app.post("*", function(req, res) { res.end(json.stringify(req.files) + "\n"); }); console.log("server @ 8080"); app.listen(8080); html <html> <head> <form method="post" enctype="multipart/form-data" action="http://localhost:8080"> <input type="file" name="myimage" /> <input type="submit" name="submit" value="submit"/> </form> </head> </html> after clicking submit got undefined response. bodyparser.json() … you've set parser json formatted requests enctype=&

mesos - Integrate Apache Aurora with dcos -

there 2 mesos frameworks support gpu resources: marathon , aurora. launch batch jobs on mesos agents gpu resources. so, aurora supports such kind of jobs. aurora not supported dcos officially @ moment. i'v tried integrate not successful. dcos mesos masters don't register aurora framework exhibitor creates records aurora. i'v not managed find records aurora in mesos masters logs. here aurora-scheduler config: #!/bin/bash glog_v=0 libprocess_port=8083 #libprocess_ip=127.0.0.1 java_home=/opt/mesosphere/active/java/usr/java java_opts="-server -djava.library.path='/opt/mesosphere/lib;/usr/lib;/usr/lib64'" path=$path:/opt/mesosphere/bin mesos_native_java_library=/opt/mesosphere/lib/libmesos.so ld_library_path=$ld_library_path:/opt/mesosphere/lib java_library_path=$java_library_path:/opt/mesosphere/lib # flags control behavior of aurora scheduler. # full list of available flags, run /usr/lib/aurora/bin/aurora-scheduler -help aur

java - I'm getting error in @OneToMany hibernate mapping? -

i'm trying have 1 many connection between 2 classes im getting error org.hibernate.annotationexception: illegal attempt map non collection @onetomany . here code, job.java @onetomany @joincolumn(name = "id", referencedcolumnname = "id", insertable = false, updatable = false) private set<jobcostsplit> jobcostsplit; jobcostsplit.java @column(name = "job_id") private long jobid; @jsonignore @onetomany @joincolumn(name = "job_id", referencedcolumnname = "id", insertable = false, updatable = false) private job job; you annotate job @onetomany . means have 1 attribute on job , more on jobcostsplit . so if want have 1 job , more jobcostsplit have set this: @manytoone @joincolumn(name = "job_id", referencedcolumnname = "id", insertable = false, updatable = false) private job job;

vue.js - Html attributes, Migrating to VueJs 2 -

i want migrate vue.js application 2.0 version. application single-file webpack project , use "html attribute" setting param app. i setting app that: <body> <app url="https://api.com" env="dev"></app> </body> i attribute in vue.js 1.0 that export default { props: ['env'], data () { return { } }, computed: { calling: function () { console.log(this.env) } } } my problem simple, in vue.js 1.0 attributes "this.attribute" in vue.js 2 code return undefined value. how can receive html attributes in vue.js 2.0 ?

amp html - Google AMP: Form submission failed:: Unexpected token < in JSON at position 1 -

i have added form using amp-form component , validates perfectly. however, when submit form error: log.js:399 uncaught syntaxerror: form submission failed:: unexpected token < in json @ position 1 any idea? this isn't amp problem it's syntax error message states. json being sent/returned to/from server. sure you're sending/receiving think you're sending/receiving? the error message me means you're not getting json, html. i've experienced error upon form submission via ajax , erroring out because server returning html message browser display, code expecting json returned. look in debugger console @ being returned under network tab server. after locate network call in list under network tab, you'll select response tab (sub tab of network). guess response tab show nothing html, character in position 1 being ....... "<". that html clue why it's failing well. good luck, hope helps!

c++ - program crash in std::sort() sometimes, can't reproduce -

description: my program crash in std::sort() , write minimal program reproduce situation, alright. here minimal example: typedef struct st { int it; char ch; char charr[100]; vector<string *> *vs; } st; bool function(st *&s1, st *&s2) { static int = 1; cout<<i<<" "<<&s1<<" "<<&s2<<endl; ++i; return s1->it > s2->it; } int main(int argc, char **argv) { vector<st *> ar; (int = 0; < 100; ++i) { st *s = new st; s->it = urandom32(); ar.push_back(s); } ar.clear(); (int = 0; < 100; ++i) { st *s = new st; s->it = urandom32(); ar.push_back(s); } sort(ar.begin(), ar.end(), function); return 0; } here gdb stack info: 0 0x00007f24244d9602 in article_cmp (cand_article_1=0x7f23fd297010, cand_article_2=0x4015 ) @ src/recom_frame_worker.h:47 1 0x00007f24244fc

printf - Can't even print out an array -

i'm trying print out array not working. currently using sublime text 2 , node build, not sure if have declare before writing code. here's code: string card[] = new card[2] card[0] = "ace"; card[1] = "two"; card[3] = "three"; for(int i=0; i< card.length; i++) { system.out.print(""+card[i]); } the debugger gave me following result: (function (exports, require, module, __filename, __dirname) { string card[] = new card[2] syntaxerror: unexpected identifier @ object.exports.runinthiscontext (vm.js:76:16) @ module._compile (module.js:542:28) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.runmain (module.js:604:10) @ run (bootstrap_node.js:394:7) @ startup (bootstrap_node.js:149:9) @ bootstrap_node.js:509:3 [finished in 0.1s exit code 1] looks you&

Issue Exporting array to CSV in powershell -

i have following code queries mssql server database, , compares result csv, rows in csv not match counterpart row in database added new csv, create csv contains changed lines , discards ones havent changed. $pricecsv = import-csv c:\users\user\desktop\pricedelta\products.csv $newpricecsv = @(,@("sku","brandname","id","name","1stcheapestdistributorname","1stcheapestdistributorprice","1stcheapestdistributorstock","1stcheapestdistributorproductname","1stcheapestdistributordeliverycost","2ndcheapestdistributorname","2ndcheapestdistributorprice","2ndcheapestdistributorstock","2ndcheapestdistributorproductname","2ndcheapestdistributordeliverycost","3rdcheapestdistributorname","3rdcheapestdistributorprice","3rdcheapestdistributorstock","3rdcheapestdistributorproductname","3rdcheapestdistributordeliveryco

vba - Send selection from Excel by email as attachment -

i using macro send workbook attachment (book1.xlsx) sub macro2_sendbyemail() ' copy sheet(1) thisworkbook.sheets(1).copy ' send email activeworkbook .sendmail recipients:=array("address@company.com", "address2@company"), subject:="addresses [" & format(date, "dd/mm/yy") & "]" .close savechanges:=false end end sub but cannot find out how edit code send first 3 columns of workbook ... thanks help! you may try out: option explicit sub macro2_sendbyemail() ' copy sheet(1) dim my_range range dim l_row long l_row = thisworkbook.sheets(1).usedrange.rows.count thisworkbook.sheets(1) set my_range = .range(.cells(1, 1), .cells(l_row, 3)) end my_range.copy ' send email activeworkbook .sendmail recipients:=array("address@company.com", "address2@company"), subject:="addresses [" & format(date, "dd/mm/yy&quo

powershell - How to Connect to Azure from Visual Studio Code Terminal -

i have installed required software , azure powershell cmdlets on local system. tried execute powershell script connecting azure visual studio code terminal. below error. import-module microsoft.online.sharepoint.powershell function publishtoazure{ add-azureaccount ...... ...... } error is.. add-azureaccount : handle invalid visual studio code settings: // place settings in file overwrite default settings { "terminal.integrated.shell.windows": "c:\\windows\\sysnative\\windowspowershell\\v1.0\\powershell.exe" } console of windows azure active directory module windows powershell properties target is: c:\windows\system32\windowspowershell\v1.0\powershell.exe -noexit -command "import-module msonline" system properties: 64bit win7 os you may connect , manage azure resources within vs code's terminal window installing microsoft azure cli 2.0. ( https://aka.ms/installazurecliwindows ). after cli 2.0 installed in environment

elixir - Why are pin operators necessary in Ecto queries? -

in elixir, pin operator used prevent variable rebinding. however, regard ecto query like from u in user, where: u.username == ^username the authors of programming phoenix state (in chapter 7) that remember, ^ operator (called pin operator) means want keep ^username same. but doesn't sound right, because apparently, comparison in query shall not cause rebinding of variables. are authors of book (which josé valim co-authored) mistaken? pin operator in ecto queries merely construct of ecto dsl instead of usual elixir pin operator? or query chance rebind username after macros expanded? ecto's queries rely on macros provide powerful dsl use. means that, whatever comes after from , not "regular" elixir code, dsl transformed sql query. so, caret there not pin operator per se, , has nothing pattern matching (although still can called "pin operator" because people forget words such caret , ampersand , asterisk ). it's convenient op

php - Authorization Header missing in Xampp/Apache? -

i trying send authorization header php xampp/apache not recognize , header empty. looking here solutions, tried many things like: rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] in htaccess , it's still not sending authorization header. sending authorization: bearer <token> any ideas? i'm having same problem. i have website hosted in third party, , authorization header no longer reaching php scripts. found possible solution: apache proxypass removes authorization header give try, i'll same thing , see if works.

javascript - VueJS component with DOM elements outside of $el -

i'm new vue , coming custom-built front-end framework we've been using time. now we've started slowing rolling in vue in our website , refactoring of our old components, , i've run bit of problem. the question is: there way component instantiate dom elements outside of scope (for example @ end of )? we need these bits outside of components' container because, example, in case of dropdowns, obscured when 1 of parent elements has overflow: hidden; any ideas appreciated!

java - How to get email messages not older than X seconds? -

i use code search through gmail inbox: session session = session.getdefaultinstance(new properties()); store store = session.getstore("imaps"); store.connect("imap.googlemail.com", 993, email, password); folder emailfolder = store.getfolder("inbox"); emailfolder.open(folder.read_write); message[] messages = emailfolder.search(new andterm(new searchterm[] { new subjectterm(subject), new fromterm(new internetaddress(sender)), new youngerterm((int)timeunit.minutes.toseconds(3)) })); but error: javax.mail.messagingexception: a4 bad not parse command; if remove youngerterm search term, search call succeeds , returns messages, need reduce results adding youngerterm filter. the youngerterm class depends on imap extension gmail not support, rfc 5032 . way want retrieve internaldate , filter in client. a bit strange javamail let create , send command uses youngerterm; surely ought know server reject it?

javascript - How to get data value from element class? -

html code: <input type="file" name="efile" id="efile" data-cat="electronics" style="width:100%" class="alertme"> <input type="file" name="dfile" id="dfile" data-cat="decoratives" style="width:100%" class="alertme"> <input type="file" name="kfile" id="kfile" data-cat="kitchen" style="width:100%" class=""> <input type="file" name="hdfile" id="hdfile" data-cat="home" style="width:100%" class=""> <input type="file" name="ffile" id="ffile" style="width:100%" data-cat="furnitures" class="alertme"> how can data-cat attribute value class alertme exist? , reading question. weak in english please apologize me if made grammatical or spelling mistakes. you

gradle - Failed to resolve: com.android.support:appcompat-v7:23.0.3 -

Image
i continuously facing problem: failed resolve: com.android.support:appcompat-v7:23.0.3 although have updated packages going sdk manager but still facing same problem. when creating new project same problem persist. kindly guide. the no such version of support libraries. here can find list. i suggest using newest: 25.0.0 . build tools version , support libraries version different thing. buildtoolsversion field in build.gradle configuration file in android closure. support libraries declared in dependencies closure .

angularjs - How to refresh Real time NVD3.js charts with Angular.js? -

i have stocks application display real time line graph charts refresh every second. have live data feed coming tcp/ip application. bind signal-r , angular.js display. the problem: able display chart 1st time nvd3.js, not able bind real-time data , refresh every second. i have tried chart.update , redraw no success can provide code-snippet working nvd3.js line chart refreshing real time data. you can have @ repo https://github.com/zeusjs/viz there d3.js charts created show data updating @ intervals. hope helps.

javascript - NodeJs: executing a mongoshell with a js file of commands -

i wrote nodejs script has set of mongo commands. ran in terminal using following command , worked: mongo --host 127.0.0.1:27017 data.js it worked, performed operations need done. afterwards, created nodejs file, automate script. executed same command using exec dependency. var exec = require("child_process").exec; var execstring = "mongo --host 127.0.0.1:27017 " + config.file; exec(execstring, function(err, res){ if (err) { return cb(err); console.log("here") } else console.log("data import done"); }); config.file contains path js file. error received { error: command failed: mongo --host 127.0.0.1:27017 /opt/soajs/node_modules/soajs.utilities/data/artifact/data.js @ childprocess.exithandler (child_process.js:211:12) @ emittwo (events.js:106:13) @ childprocess.emit (events.js:191:7) @ maybeclose (internal/child_process.js:877:16) @ socket.<anonymous> (internal/child_process.js:334:11

.htaccess - htaccess RewriteRule for www / https not working if both conditions present -

i'm running problem .htaccess rewrite rules , wondered if help. i have set redirects non-www. url www. need introduce https redirect. after looking while found first example below, however, causing redirect loop error in browsers. the 2nd example works fine scenarios except visit www.example.com doesn't direct https. know of way around @ all? # redirect loop rewritecond %{server_port} !=443 [or] rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.website.com/$1 [r,l] # works (without ssl redirect) rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.website.com/$1 [r,l] i've tried following conditions result in same error rewritecond %{https} off rewritecond %{server_port} 80 full htaccess <ifmodule mod_rewrite.c> rewriteengine on options +followsymlinks rewritebase / rewritecond %{http_host} !^www\. [nc,or] rewritecond %{https} off rewritecond %{http_host} ^(?:www\.)?(.+)$ [nc] rewriterule ^ ht

AtmelStudio output on console -

i'm using atmelstudio 6.2 want compile solution console. command looks more or less this c:\program files (x86)\atmel\atmel studio 6.2\atmelstudio.exe" /rebuild release d:\firmware\foo_main\foo_main.atsln when start build ide got nice output info in "output" window. when use switch /out "build.txt" in command line got same info in file. so question how can info written in point 1 , 2 on console? i searching internet long time , cannot find answer. one more thing not want execute make file directly. want call solution file.

Gradle Scala Plugin - how to specify zincClasspath -

i trying use scala plugin gradle build project on ubuntu vm. build.gradle file looks like: apply plugin: 'scala' repositories { mavencentral() } dependencies { compile 'org.scala-lang:scala-library:2.11.8' } when run gradle build command line, following error: failure: build failed exception. * went wrong: problem found configuration of task ':compilescala'. > no value has been specified property 'zincclasspath'. i have looked around specify zincclasspath property, can't find anything. i have tried force zincclasspath use older version of scala library, doesn't seem work. any appreciated edit: one thing add, exact project builds fine on local windows machine, not on ubuntu vm.... fixed myself in end, clue was running on local machine not vm... of course gradle version different. upgrading gradle 3.0 fixed this

javascript - Multiple Sort in List.js -

i'm using list.js display, search, filter, lot of contents in custom order. my row made this <div class="content-row"> <div class="order_id" style="display:none;">{{$item['order']}}</div> <div class="order_category" style="display:none;">99999</div> <div class="order_source" style="display:none;">99999</div> <div class="order_page" style="display:none;">99999</div> <div class="content_date" style="display:none;">2016-11-08 11:00:00</div> <div class="dd-handle row-container"> row </div> </div> i'm trying order list of content multiple order: first order order_category , order_source , content_date , , order_page . in firefox tried order list less important more important order , seems work, didn't work in chrome: // options var o

java - What is difference between name and display name of a network interface? -

i using java 8 on ubuntu 16.04. class java.net.networkinterface has 2 methods interface name. first 1 is: get name of network interface. returns: name of network interface public string [more ...] getname() { return name; } other 1 is: get display name of network interface. display name human readable string describing network device. returns: display name of network interface, or null if no display name available. public string [more ...] getdisplayname() { return displayname; } when ifconfig, output is: enp0s25 link encap:ethernet hwaddr 00:24:1d:6e:03:42 inet addr:10.100.14.40 bcast:10.100.255.255 mask:255.255.0.0 inet6 addr: fe80::fc60:10a7:2f7e:127f/64 scope:link broadcast running multicast mtu:1500 metric:1 rx packets:30338414 errors:0 dropped:31 overruns:0 frame:0 tx packets:446227 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100

php - Laravel delete button throwing out error "page couldn't be found -

this code view <form action="/categories/ {{ $category->id }}" method="post"> {{ csrf_field() }} {{ method_field('delete') }} <button>delete task</button> </form> controller method public function destroycategory($id) { categories::findorfail($id)->delete(); return redirect('/categories'); } route route::post('categories','filescontroller@destroycategory'); form in partial view, can problem you send delete method form catch post instead of delete inside route file & not assign url parameter in route file. <form action="/categories/{{ $category->id }}" method="post"> {{ csrf_field() }} {{ method_field('delete') }} <button type="submit">delete task</button> </form> route.php route::delete('categories/{id}','filescontroller@destroycategory');

Replace \n with '' by using str_replace() in PHP -

i have following code $s = '\n test@gmail.com \n '; $s = str_replace('\n', '', $s); echo $s; i want replace '\n' char '' it's not working above code. have found \n new line char ascii value 10 echo ord(substr($s, 0, 1)); not working. it's not clear me exact reason behind not working above code. please help. you need place \n in double quotes. inside single quotes treated 2 characters '\' followed 'n' try below code: $s = "\n test@gmail.com \n"; $s = str_replace("\n", '', $s); echo $s;

html - large ui select box -

im using semantic-ui, in search form when implement large input fields, select option field doesnt takes effect, still same size, implementing right way? looking documentation looks im doing right guess. html <div class="ui large form"> <div class="four fields"> <div class="field"> <select class="large ui dropdown"> <option value="">all areas</option> <option value="1">chef</option> <option value="0">barman</option> </select> </div> <div class="field"> <select class="large ui dropdown"> <option value="">all resgions</option> <option value="1&quo

PHP - Count total words in a regex pattern -

take following php regular expression: /^(what is|tell me) name$/ i want determine total number of available words within pattern. correct answer 4 seeing following combinations compatible: what name => 4 words tell me name => 4 words a simple count(explode(' ', '/^(what is|tell me) name$/')) not going cut it, seeing explode function return following: ['/^(what', 'is|tell', 'me)', 'your', 'name$/'] ...which defines 5 "words", when really, 4 available within pattern. here's example: /^(my|the) name (\w+)$/ => 4 words is there function available can utilise, or have create tech 1 scratch? kudos if anyone's willing give shot. this extremely ugly , maybe can use of logic? seams work. i basicly split string 2 different strings. $first_string part between parentheses () . explode string on | , count whitespaces in new string +1 . the second part of string $second_strin

php - Symfony 3 - Doctrine 2.5 composite primary key not import -

Image
i trying make mapping:import composite keys. problem table composite key not imported. here sql example: create database composite_key; use composite_key; create table company ( id_company int not null auto_increment, name varchar(200) null, primary key (id_company) ); create table users ( id_user int not null auto_increment, name varchar(200) null, primary key (id_user) ); create table reference ( id_company int not null, id_user int not null, primary key (id_company,id_user), foreign key (id_company) references company(id_company), foreign key (id_user) references users(id_user) ); insert users (`name`) values ('test1'); insert users (`name`) values ('test2'); insert users (`name`) values ('test3'); insert company (`name`) values ('company1'); insert company (`name`) values ('company2'); insert company (`name`) values ('company3'); insert reference (`id_company`,`id_user`) v

github - How to merge conflicted file in your branch only in git? -

i have 2 branches branch-a , integration. when create pull request integration branch see conflicts in 1 file. don't want merge whole branch resolve conflicts, want conflicted file merged branch-a , resolve conflicts. is there way can merge conflicted file branch-a integration branch? i'm not sure if merging 1 file idea, if want that, create patch changes file , apply on branch-a : checkout branch-a : $ git checkout branch-a create patch: $ git format-patch branch-a..integration <file_path> --stdout > changes.patch apply it: $ git --3way < changes.patch applying patch stop because conflict, resolve , resume applying: $ git add <file_path> $ git --continue

enums - Perform addition on bit-fields in C# -

i working on gomoku implementation in c#, , first challenge of project intelligently represent state of board. in order achieve goal, decided turn bit-fields represent value of combination: [flags] public enum combinationvalue : byte { onepawn = 1, twopawns = 2, threepawn = 4, fourpawn = 8, fivepawns = 16 } the problem stumbled on, when want increment combination, want unset previous bit , set new one, binary shift left, not allowed enum. example, let's have combination of 2 pawns, , pawn put next value of enum must become "threepawn" instead of "twopawns". so basically, want twopawns + onepawn == threepawns. what efficient way implement behavior? this isn't how flags should used. flags used designate switches in single byte, given binary 0000 first bit represents element being "on", second different element, etc. so element1 represented by: 1 = 0001 , element2: 2= 0010 , element3: 4 = 0100

android - If I was obfusc. the APK in a prev app version, and I turn off the obf. in new version, and users upgrade, will the obfuscated files still be there? -

if obfuscating apk in previous app version, , turn off obfuscation in new version, , users upgrade, obfuscated files still there? happens when app updated - entire app deleted , new files inserted, or selective process. possible obfuscated files shouldnt obfuscated, remain there?

Error Php shorten text function, need correction -

i'm not sure i'm missing. i've try looking @ syntax , miss spelling function name but seems can't find problems the problem come line 4 coding <?php function shortentext($text, $maxlength=70, $appendix = "..."){ $text = strip_tags($text); if(mb_strlen($text) <= $maxlength){return $text;} $text = mb_substr($text, 0, $maxlength - mb_strlen($appendix)); $text =. $appendix; return $text; } } you closed twice function , have put =. instead of .= use ide, underline errors... function shortentext($text, $maxlength=70, $appendix = "...") { $text = strip_tags($text); if(mb_strlen($text) <= $maxlength){return $text;} $text = mb_substr($text, 0, $maxlength - mb_strlen($appendix)); $text .= $appendix; return $text; }

html - Change button text on submit with velocity engine / java -

so got admin panel website decided try small things not getting there yet. so whenever disable or enable user nice good/bad notification saying happened ofcourse button stay same. way change according function? #parse("/velocity/layout.vm") #@mainlayout() <table id="adminpanel"> <tr> <th>email</th> <th>name</th> <th>reset password</th> <th>isactive</th> <th>delete</th> </tr> #if($resetpassword) <p class="good notification">$msg.get("reset_password")</p> #elseif($blockuser) <p class="bad notification">$msg.get("block_user")</p> #elseif($unblockuser) <p class="good notification">$msg.get("unblock_user")</p> #elseif($deleteuser) <p class="bad notification">$msg.get("delete_us

amazon cloudformation - Automate AMI Update in EC2 -

i using cloudformation template create 4 ec2 instances behind elb. these instances associated launch config , auto scaling group. update our amis every 2 months. if have update amis without down time best strategy. using jenkins orchestration. the plan have in mind template #1- creates asg , launch config tempate #2 creates/updates elb new instances created first execution 1. create cloudformation stack comprising of launch config , autoscaling group. launch 4 ec2 instances , bootstrap application 2. create 2nd template create elb , bind 4 instances created elb. bind elb asg when ami has udated 1. execute first template create new (asg)the idea create new , not update asg since elb has continue sending traffic old asg until instances , running. once servers up, 2nd template update elb new instances , update new auto scaling group new elb. delete old stack. is there better achieve this? cloud formation has support natively. take @ update policy attribute doc

javascript - Google Direction | same API, different result -

Image
i have simple route made on javascript on following link: http://debug.iott.co.il/map/route.v.1.0.html edit here image javascript lazy ones. it's goes b, b c , c d. watch this, when user hit point c need u-turn point d, fine me. i have tried duplicate same thing on android studio, , i'm getting different route following image: so instead of doing u-turn c d, it's makes user goto way again, b , lastly d. i'm trying figure out why i'm using same api (google direction) same configuration (driving mode etc.) , i'm getting different results. ideas ? edit 2: here of code: javascript : //you can calculate directions (using variety of methods of transportation) using directionsservice object. var directionsservice = new google.maps.directionsservice(); //define variable map points. var _mappoints = new array(); //define directionsrenderer variable. var _directionsrenderer = ''; //this give map zoom value. var zoom_option =

Odoo / OpenERP 9 emails invoices without body -

as title says, when email invoice out via odoo sends attachment , default email footer odoo stamps on things body empty. this working on 3 other instances of odoo not one, other emails work fine such password resets. have tried multiple email templates , manually typed in want email send through either html or email writer bit. going through settings tab , emails section, can chose email view , in there blank. there no errors can see in odoo-server.log when debugging enabled through mail settings. interestingly though, sent email still commented on invoice. any appreciated! the environment debian 8.2 , odoo version 8/11/2016 nightly build