Posts

Showing posts from July, 2013

javafx 2 - I need to select or read only .config files via file chooser in java fx can any one help me -

i need file path of .config folder can 1 me you can add extensionfilter filechooser select .config files (or type) via filechooser . e.g. filechooser flc = new filechooser(); flc.settitle("select file"); extensionfilter ext = new extensionfilter("config files", "*.config"); flc.getextensionfilters().add(ext); file tmpfile = flc.showopendialog(stage); you can set extention type filechooser. e.g. extensionfilter ext = new extensionfilter("image files", "*.png", "*.jpg", "*.jpeg"); hope helps.!

How to get the total count of records after union of CTE tables in SQL? -

i applying cte on 3 4 tables , combining results using union.i not storing combined result anywhere. facing challenge total number records resulted after union of these 4 tables. also have select limited number of rows based on flag set if export excel set select 25000 records else select 10000 records. please me on this. code sample looks below: with item_characteristics_cte ( select sequence, item_id item_characteristics_log ), item_required_quantity_log_cte ( select sequence, item_id item_required_quantity_log ) select c1.item_id item_characteristics_cte c1 inner join item_characteristics_cte c2 on c1.sequence = c2.sequence union select c1.item_id item_id item_required_quantity_log_cte c1 inner join item_required_quantity_log_cte c2 on c1.sequence = c2.sequence c2.rn = c1.rn i not sure flag mean in above question. count, use 1 additional cte this: ;with item_charac

javascript - innerHTML in DOM -

i unable change text inside 'p' tag using script <script> var firstitem = document.getelementbytagname('p'); firstitem.innerhtml = 'adding javascript'; </script> you have several coding errors. here's corrected code: <script> var firstitem = document.getelementsbytagname('p')[0]; firstitem.innerhtml = 'adding javascript'; </script> the correct method document.getelementsbytagname('p') . note "s" @ end of "elements". then, because document.getelementsbytagname('p') returns html collection object, have either iterate on collection or reach collection grab specific dom object (which did in example [0] ). and here's working code snippet: // change first <p> tag document.getelementbyid("test1").addeventlistener("click", function(e) { var firstitem = document.getelementsbytagname('p')[0]; firstitem.in

Map Function in Swift -

i working map function in swift. seeing use of "$0" , not know means. "$0" pointer current element of array? stringarray = newstringarray.map({"\($0)new"}) i wouldn't use word pointer, think have right idea. when use map here, you're taking array , applying function every element in array. here, function takes in 1 argument (a string) , outputs string. $0 refers first argument function you're calling which, in case, argument. the anonymous sort of functions pass map called closures. looking @ apple's official documentation on closures might helpful! here's link: https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/closures.html

Javascript - Homing bullet -

i've been working on little project, , while can bullet home in on mouse, has strange behavior. if bullet going left/right/up/down mouse, change direction , forth , continue fly away mouse instead of turning @ it. also, makes loops unnecessary, figure that's because i'm not keeping direction positive or negative (i wrong though). http://codepen.io/evanward/pen/voegdo?editors=001 this code have updating singular bullet. var target = app.mouse.subtract(app.bullet.pos), angle = target.angle(); if(angle < 0) { angle += math.pi * 2; } var delta = angle - app.bullet.dir; if(math.abs(delta) > 180) { if(delta < 0) { delta += 180; delta *= -1; } else { delta -= 180; delta *= -1; } } if(app.bullet.dir > math.pi * 2) { app.bullet.dir -= math.pi * 2; } app.bullet.dir += delta/10; app.bullet.pos.x += math.cos(app.bullet.dir) * app.bullet.vel; app.bullet.pos.y += math.sin(app.bullet.dir) *

python - Django admin change list view disable sorting for some fields -

is there way(s) disable sorting function fields in django admin change list fields, users cannot click column header sort list. i tried on following method, doesn't work. https://djangosnippets.org/snippets/2580/ i tired override changelist_view in modeladmin nothing happen. def changelist_view(self, request, extra_context=none): self.ordering_fields = ['id'] return super(mymodeladmin, self).changelist_view(request, extra_context) in above case, allow user sort list id. anyone has suggestion? thanks. for django 1.7 (or version last use) not support such things. 1 possible dirty work-around defining model class method , using method instead of model field. class testclass(model): some_field = (.....) other_field = (........) def show_other_field(self): return self.other_field class testclassadmin(modeladmin): list_display = ("some_field", "show_other_field") since show_other_field model clas

xslt 1.0 - Transform which produces default namespace convention xmlns="..." -

given following xml: <root xmlns="example.com"> <child /> </root> what xslt (version 1.0) can used produce: <newroot xmlns="stackoverflow.com"> <child /> </newroot> i've tried various combinations of exclude-result-prefixes , namespace-alias. e.g, <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:e="example.com" xmlns:s="stackoverflow.com" exclude-result-prefixes="e"> <xsl:namespace-alias stylesheet-prefix="s" result-prefix="#default" /> <xsl:template match="e:root"> <s:newroot> <xsl:apply-templates /> </s:newroot> </xsl:template> <xsl:template match="e:child"> <s:child /> </xsl:template> </xsl:stylesheet> the closest i've come following incorrect xml <new

javascript - Classic ASP and JQuery reloads default.asp page on redirect -

i have integrated existing classic asp site jquery (they using vbscript before). previous version works fine script's needed updated work on other browsers. when redirect page jquery integrated, system loads default.asp file , second url. address bar shows default url. how can prevent this? when use window.open('url') , opens correct page correct url have 2 tabs open. when use window.open('url', '_self') still redirects problematic page. p.s. response.redirect 'url' , window.open('url', '_self') give same results. edit: here's of code used here's main frame js (submit function) loads within default.asp $("img[name=cmdlog]").click(function(){ $("form[name=frmlogin]").target = "_top"; $("form[name=frmlogin]").get(0).setattribute("action", "validateuser.asp"); $("form[name=frmlogin]").submit(); });

osx - using google web fonts on mac computer -

Image
i'm building web page uses google webfonts (open sans) on pc , works perfectly, when try on mac computer shows question mark within text. why this? the character seeing replacement character , used when font not contain particular unicode character, in case, "ñ" aka u+00f1 aka "latin small letter n tilde". google open sans contain character, seems safari not correctly getting font web. rendering engine reverting font, , 1 missing offending character. able check in dev tools on mac font being grabbed script. i checked script annotation posted in comment question. returning fonts in woff2 format. turns out woff2 not supported in safari of version 9, woff is . therefore recommend changing format woff , serving page locally: download script posted ( http://fonts.googleapis.com/css?family=open+sans:300,400,500,700 ) save css file (e.g. fonts.css) find-and-replace woff2 woff save file add web project (however add other files) replace @sty

how to replace strings in a file by other strings in java -

i have file every line contains strings : usual,proper,complete,1,convenient,convenient,nonprob,recommended,recommend i want replace every word such code : 1000, 100, 110, 110, 111, 001, 111, 111, 1000 here code used still incomplete : public class codage { bufferedreader in; public codage() { try { in = new bufferedreader(new filereader("nursery.txt")); fileoutputstream fos2 = new fileoutputstream("nursery.txt"); dataoutputstream output = new dataoutputstream(fos2); string str; while (null != ((str = in.readline()))) { string delims = ","; string[] tokens = str.split(delims); int tokencount = tokens.length; (int j = 0; j < tokencount; j++) { if (tokens[j].equals("usual")) { tokens[j] = "1000"; output.writechars(

creating single array as a data source from different scene in iOS using Objective C -

i trying develop ios app has different scene of them sharing single data source nsmutablearray (dataarray). possible modify ie add / delete items array of different scenes. note: i know how modify/add/delete array single scene (viewcontroller ui). simply create singleton class similar this... i.e if using arc. myglobaldata.h @interface myglobaldata : nsobject { nsmutablearray *mydata; } @property (nonatomic, retain) nsmutablearray *mydata; + (id)sharedmanager; @end myglobaldata.m @implementation myglobaldata @synthesize mydata; + (id)sharedmanager { static myglobaldata *shareddata = nil; @synchronized(self) { if (shareddata == nil) shareddata = [[self alloc] init]; } return shareddata; } - (id)init { if (self = [super init]) { mydata = [[nsmutablearray alloc] init]; } return self; } - (void)dealloc {} @end your scene controller -somemethod() { myglobaldata *sharedobject = [myglob

javascript - Merge many-to-one list of objects -

i have 2 database tables currently, representing many-to-one relationship. activities, have id (integer, autoincrement, primary key) , name (varchar(255), not null); , activityslugs, have id (same above), slugname (not null varchar), , activity_id (foreign key activities.id). currently i'm supposed list of activities , of slugs (as 1 list), looks this: [ {id: 1, name: "long name", slugs: ["nick", "names"]}, {id: 2, name: "foobar", slugs: ["foo", "bar"]} ] the naive solution (and 1 can think of) "select *" on each table, , merge them, data looks this: activities = [ {id: 1, name: "long name"}, {id: 2, name: "foobar"} ] slugs = [ {id: 1, slugname: "nick", activity_id: 1}, {id: 2, slugname: "names", activity_id: 1}, {id: 3, slugname: "foo", activity_id: 2}, {id: 4, slugname: "bar", activity_id: 2} ] so can itera

mysql - SQL sort column A & update column B -

i have table data similar to: inven descript printorder --------------------------------- 1 d 9 2 b 0 3 5 4 z 0 5 x 1 . . . . . . . . . i sort table on column descript descending alpha (a - z) , update column printorder when done, record printorder = 1 the highest alpha (a) , record highest value printorder lowest in alpha (z). is possible without using temporary columns? not deal breaker if not, preference. desired result: to update printorder values based on sorting result inven descript printorder --------------------------------- 1 d 3 2 b 2 3 1 4 z 5 5 x 4 i unclear whether want modify table or create result set. here solution latter using standard sql: select inven, descript, row_number() on (o

swift - NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) -

i getting error: nsurlsession/nsurlconnection http load failed (kcfstreamerrordomainssl, -9802), , suspect because of querying images parse. here method querying: func fetchimageforemployee(employee: pfemployee, completion: (error: string?, image: uiimage?) -> void) { if (employee.profilepicture == nil) { completion(error: "no image file", image: nil) } else { employee.profilepicture!.getdatainbackgroundwithblock({ (data, error) -> void in if let error = error { let errorstring = error.userinfo["error"] as? string completion(error: errorstring, image: nil) } else if (data != nil) { let image = uiimage(data: data!) completion(error: nil, image: image) } else { completion(error: nil, image: nil) } }) } } i printed error, , appeared in debugger: attempting load view of view controller while de

javascript - How to upload an object into S3 in Lambda? -

can't seem upload object s3 in lambda. works fine locally. no errors in logs show what's going wrong... code below: console.log('loading function'); var aws = require('aws-sdk'); var s3 = new aws.s3(); exports.handler = function(event, context) { //console.log(json.stringify(event, null, 2)); var s3 = new aws.s3(); var param = {bucket: 'flow-logs', key: 'test-lambda-x', body: 'me me me'}; console.log("s3"); s3.upload(param, function(err, data) { if (err) console.log(err, err.stack); // error occurred else console.log(data); // successful response }); console.log('done'); context.done(); }; runs w/o error, callback in s3.upload doesn't seem called. no object in bucket created. verified iam role permissions weren't problem granting full access, testing out locally. output start requestid: d4847fdb-160c-11e5-8a8c-b555b123e14d 2015-06-18t22:53

php - All records are displaying on a single row when exporting array to a csv file -

Image
i pulling data api exporting excel file. here's code: // api code request here $jsondecode = json_decode($content); // echo '<pre>'; // var_dump($jsondecode); foreach( $jsondecode $value ) { //if null, create blank field if ( ( !isset( $value ) ) || ( $value == "" ) ){ $value = "\t"; } //else, assign field value our data else { $value = str_replace( '"' , '""' , $value ); $value = '"' . $value . '"' . "\t"; } //add field value our row $line .= $value; } //trim whitespace each row $data .= trim( $line ) . "\n"; //remove carriage returns data $data = str_replace( "\r" , "" , $data ); $file_name = 'excel_data'; //create file , send browser user download header("content-type: application/vnd.ms-excel"); header( "content-disposition: filename=".$file_name.".xl

python - Using raw_input causes problems with PyQt page loading -

i'm using pyqt4 enter credentials domain login page , pull data several additional pages in domain. works expected when supplying login or search credentials within code. when open raw_input allow user enter information, causes hang-ups trying download 1 of web-pages. can't provide information on page because on corporate network, doesn't make sense using raw_input cause problems qwebpage loads. the qnetworkmanager throws 1 of expected 3 or 4 .finished signals , qwebpage frame never throws .loadfinished signal hangs. (i've tried flushing stdin seek(0) gives me bad file descriptor error). has run such problem before? raw_input uses synchronous/blocking io without giving qt chance continue processing events in background. qt isn't prepared it's processing halted in way. in theory should resume when raw_input finished. maybe in meantime timeout occurred or that. should use signal/event based input when using qt. if gui interaction ok should try

php - How to remove the quantity field from cart page for specific product attribute WooCommerce -

Image
i need hide "quantity" field specific product in cart.php here cart.php . attribute color quantity field should hide. have try $attributes = $product->get_attributes(); failed or missing . have share cart image , cart.php code. please me. <?php if ( ! defined( 'abspath' ) ) { exit; // exit if accessed directly } wc_print_notices(); do_action( 'woocommerce_before_cart' ); ?> <form id="cart-table" action="<?php echo esc_url( wc()->cart->get_cart_url() ); ?>" method="post"> <?php do_action( 'woocommerce_before_cart_table' ); ?> <table class="shop_table cart" cellspacing="0"> <thead> <tr> <th class="product-remove">&nbsp;</th> <th class="product-thumbnail">&nbsp;</th> <th class="product-name"><?php _e('product', &

excel - Need Help Making a Dynamic Chart -

good afternoon! college student co-oping chemical company on summer. have completed 1 basic course in excel vba programming, lack solid foundation of how language works. recently, given task of building upon code 1 of predecessors wrote, intent generate dynamic graphs. the objective this: write code display company's 17 different products on 2 year period on 4 different graphs (one per reactor). workbook has 6 different sheets of data, 1 of has button user press initiate necessary data calculations, cell population, , graph generation. there no way know how many batches of each of our 17 products make on course of 2 years since dependent on customer demand. code needs dynamically account this. i have reviewed class material 2 years ago , purchased john walkenbach's 2015 vba power programming book. teaching myself vba code, still not understand how of works. hope here may able explain why code not working , should fix it. i started intent graph single product's

qt - Crop an animated gif and center in QMovie -

is there way crop animated gif set inside qmovie widget? i'm running issue animated gif big qmovie widget i'm seeing top left portion of gif. animated gif stored inside qbytearray. i've tried opening pillow's image.open , cropping img.crop(...) , saving qbytearray ends cropping , saving first frame of animated gif. if cropping gif not possible, there way center gif inside qmovie widget see center section of animated gif? i'm working python 2.7 , pyside. thank you!

c# - Tiny stub of bogus code purely for the purpose of setting a breakpoint (that doesn't create a compiler warning) -

this trivial question find myself thinking time - when debugging, want break right after line of code executes, , rather putting breakpoint on next line of code (which may ways down due large comment blocks, or putting on last line of code , hitting f10 go on after breaks, have urge put short stub line on set breakpoint. in vba i'd use doevents this, shortest thing in c# i've found doesn't create annoying compiler warning (the variable 'x' declared never used) is: int x = 1; x++; is can get, or there other obvious approach i'm not aware of? note: aware of suppressing warnings via: #pragma warning disable 0168 // rid of 'variable never used warning' ...but find sporadically doesn't work. for debugging purposes, use system.diagnostics.debugger.break() . in practice, it's inserting break point on statement easier determine function after fact, , maintained through source control between users , systems. doesn't clutte

Rails 4 - NO manifest.json after assets precompile on production server -

Image
here app/assets/ rails 4.2 app. there 3 bootstraps js , css files. after deploying production (ubuntu 12.1), assets precompile done on server (deployed under suburi): rails_env=production bundle exec rake assets:precompile rails_relative_url_root=/mysuburi here production.rb : config.cache_classes = true config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.serve_static_files = false #env['rails_serve_static_files'].present? config.assets.compress = true config.assets.js_compressor = :uglifier config.assets.compile = false config.assets.digest = true config.log_level = :debug config.i18n.fallbacks = true config.active_support.deprecation = :notify config.log_formatter = ::logger::formatter.new config.active_record.dump_schema_after_migration = false here head of application.css.scss : @import "bootstrap.min.css"; @import "bootstrap-theme.min.cs

xcode6 - Xcode duplicated devices bug -

Image
i opened xcode , found simulator devices duplicated. found similar question 1 that's not case, i'm using latest sdk , clean xcode installation. screenshot in link bellow. ideas? 1 ios simulator devices listed twice in xcode run destinations list you can delete duplicates don't want xcode's devices window (window -> devices) or command line using 'xcrun simctl delete [udid]'

javascript - ReactJS data flow with deep hierarchical data -

i'm exploring reactjs , trying grasp of core concepts. started piecing prototype of application working on has following hierarchy of customer locations addresses contacts the page working on input form customer , of related children. each of these sections have text inputs house data, seemed natural place house hierarchy of components. from have read reactjs, if going manage state, should in common ancestor of controls. means changes in child should bubble event keeper of state handle changes. should update state , changes re-rendered. makes sense in simple scenarios, brings me more complicated hierarchy. if change happens down in 1 of many addresses, supposed bubble event location customer? if so, best way tell state specific address changed? if have call through each level of hierarchy, wouldn't make lot of boilerplate propagate simple change? should attaching onchange event on each text box, or should wait until submit form gather data? react talks

sql - Group by statement to do average of time -

my existing database has data coming id, value , time. there 1 record coming every 3 seconds. want select statement use these data , group them based on id , hrly basis show average of values in hr. how can use group by achieve ? this sample data: id value date time 5 5/18/2015 10:27:22 9 5/18/2015 10:27:25 b 7 5/18/2015 10:27:22 b 8 5/18/2015 10:27:22 i have data coming in every 3 seconds. want aggregated based on every hr of day reflect avg values of id in hr. want output like id -a , gives avg of 7 , @ 10 on 5/18/2015 this relatively simple group have 2 types of columns generally. grouped columns , aggregates. in case grouped columns have id,date, , hr(calculated [time]). have 1 aggregated column in case: average of value. check out code: select id, [date], datepart(hour,[time]) hr, avg(value) avg_val yourtable group id,[date],datepart(hour,[time])

c++ - Recursively return if statement calls -

i'm trying design program takes integer array input, , returns combinations of values add predetermined sum. sake of clarity, recursive function return true when total adds 10. however, want return values array comprise of total, definition follows; if suminarray returns true, print each number array. my hope was, once base clause reached, recursion unwind, , if statements evaluated, , each value printed if statement. however, printed last value array made target total, not values preceded it. i've misunderstood recursive behaviour of c++. know how work recursive return calls, logically, if if statement can't evaluated until recursive function returns true or false , shouldn't unwind, also? #include <iostream> bool suminarray(int *numbers, const int &size, int startpos, int total); using namespace std; int main() { int numbers[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; int startpos = 0; int total = 0; suminarray(numbers, 10, 0, t

c++ - Is dynamic_casting through inheritance hierarchy bad practice? -

i have got following data structure: class element { std::string gettype(); std::string getid(); virtual std::vector<element*> getchildren(); } class : public element { void adda(const *a); void addb(const b *b); void addc(const c *c); std::vector<element*> getchildren(); } class b : public element { void addb(const b *b); void addc(const c *c); std::vector<element*> getchildren(); } class c : public element { int someactualvalue; } /* classes have kind of container store pointers , * child elements. let's keep code short. */ the data structure used pruduce acyclic directed graph. c class acts "leaf" containing actual data algebra-tasks. , b hold other information, names, types, rules, favourite color , weather forecast. i want program feature, window pops , can navigate through existing structure. on way want show path user took pretty flow chart, clickable go in hierarchy. based on visited graph-node (which either a

java - isConsecutive with PriorityQueue. How to +1 to Objects when comparing? -

so here original problem im working on practice it. write method called isconsecutive accepts priorityqueue of integers parameter , returns true if queue contains sequence of consecutive integers starting front of queue. far have following main problem have how "add 1" objects see if consecutive. > public static boolean isconsecutive(priorityqueue o){ > if(o.isempty()){ > return true; > } > while(!(o.isempty())){ > > if(o.poll() ==o.peek()){ > return true; > } > } > return false; > } your function should take priorityqueue<integer> object rather plain priorityqueue . o.poll() o.peek() return integer s rather plain object s. once have integer s work with, can use regular + operator.

image - Send a picture using cordova on android -

i having problems apache cordova , android. have code send 1 picture server, android cellphone, doesn't work. have tested ajax , php code on server, , works, when try cellphone not. app.js: var picturesource; // picture source var destinationtype; // sets format of returned value var image = ""; document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { picturesource = navigator.camera.picturesourcetype; destinationtype = navigator.camera.destinationtype; } function capturephoto() { navigator.camera.getpicture(onphotodatasuccess, onfail, { quality: 50, destinationtype: destinationtype.data_url }); } function onphotodatasuccess(imagedata) { var smallimage = document.getelementbyid('smallimage'); smallimage.style.display = 'block'; smallimage.src = "data:image/jpeg;base64," + imagedata; image = "data:image/jpeg;base64,

How to use PHP mkdir function recursively to skip existing directory and to create new one? -

how use php mkdir function recursively skip existing directory , create new 1 string $pathname // works fine if directories don't exist mkdir($root_dir . '/demo/test/one', 0775, true); // throw error - message: mkdir(): file exists mkdir($root_dir . '/demo/test/two', 0775, true); what solution? your code should work is, problem happens when/if run second time per @chris85's suggestion can check if exists beforehand. <?php // given $root_dir = __dir__; // , want have these $dirs = [ $root_dir . '/demo/test/one', $root_dir . '/demo/test/tow', $root_dir . '/demo/test/three', $root_dir . '/demo/test/four', $root_dir . '/demo/test/and/so/on', ]; // check if they're not exists , create them foreach ($dirs $dir) { if (!is_dir($dir)) { mkdir($dir, 0775, true); } }

SQL style query in MATLAB -

can sql-style query on in-memory dataset (or cellarray, or structure, etc) in matlab? why ask is, sometimes, don't want talk database 1000 times when want different operations on each of 1000 rows of data. instead, i'd rather read 1000 database , operate on them in matlab. for example, have read following out of database: age first_name last_name income 30 mike smith 45 17 david oxgon 17 22 osama lumbermaster 3 now want find out full names of people under age of 25. know how it, there syntax clean , intuitive sql this? select first_name + ' ' + last_name name people age < income in docs page access data in table (see example index using logical expression ) shows examples achieved follows: mytable({'first_name','last_name'}, mytable.age < mytable.income) these docs don't explain how merge name , surname 1 variable i'm sure it's easy. give try , let know if it

How can I test a Windows DLL file to determine if it is 32 bit or 64 bit? -

this question has answer here: how can determine platform executable compiled? 7 answers i'd write test script or program asserts dll files in given directory of particular build type. i use sanity check @ end of build process on sdk make sure 64-bit version hasn't somehow got 32-bit dll files in , vice versa. is there easy way @ dll file , determine type? the solution should work on both xp32 , xp64. gory details a dll uses pe executable format, , it's not tricky read information out of file. see msdn article on pe file format overview. need read ms-dos header, read image_nt_headers structure. contains image_file_header structure contains info need in machine member contains 1 of following values image_file_machine_i386 (0x014c) image_file_machine_ia64 (0x0200) image_file_machine_amd64 (0x8664) this information should @ fixe

XSLT Rules that brake and symbols that change meaning -

these observations born out of frustration while learning xslt. meaning of symbols changes depending on position , context following 3 lines show usage of '/' character , in each line character symbolizes different. in first line represents root node, in second child-parent relationship , in third descendants of people element. in other words meaning of same character has been overridden 3 times , changes meaning depending on position , surrounding context. <xsl:template match="/"> <xsl:template match="people/person"> <xsl:template match="people//name"> rules brake when combined in following expression '/' means root node. <xsl:template match="/"> . in following expression '/' means person child of people. <xsl:template match="people/person"> . now if try combine these 2 rules reference people should child of root node write <xsl:template match="

Android Glide library not working with shared element transitions -

i'm looking adopt glide library in place of universal image loader i'm running problem regards shared element transitions. in simple sandbox i've created following transition using uil: https://dl.dropboxusercontent.com/u/97787025/device-2015-06-18-113333.mp4 pretty simple, , works fine. when used glide, doesn't nice: https://dl.dropboxusercontent.com/u/97787025/device-2015-06-18-114508.mp4 here code i'm using the first activity: public class mainactivity extends baseactivity { @override public void oncreate(bundle bundle) { super.oncreate(bundle); setcontentview(r.layout.main); final imageview iv = (imageview) findviewbyid(r.id.main_image); displayimageglide(baseactivity.image_url, iv, true); button button = (button) findviewbyid(r.id.main_button); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent i

spring mvc - title not populating from content page -

i using thymeleaf spring-mvc create template in application. have created 3 files (head, layout , content) below; head.html <title>layout<title> layout.html <html xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> <head th:include="head"></head> </html> content.html <html layout:decorator="layout" xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> <head> <title>content</title> </head> </html> setup, when run application , open content.html page see title "layout" instead of "content". am doing wrong in configuration? specific answer in layout files title, make title content <title layout:title-pattern="$content_title"></title> further description lets assume application main

javascript - $routeProvider not passing search parameter route -

i'm trying create toggle switches between 2 tables on 1 page. have both tables defined in index.html within <body ng-app="main"> tag as <script type="text/ng-template" id="table1.html"> code </script> and <script type="text/ng-template" id="table2.html"> code </script> my $routeprovider defined in .js as app.config(['$routeprovider', function ($routeprovider){ $routeprovider.when('/?table=table1', { controller:'postsctrl', templateurl: 'table1.html' }) $routeprovider.when('/?table=table2', { controller: 'postsctrl', templateurl: 'table2.html' }) $routeprovider.otherwise({redirectto: '/?table=table1'}); }]); app.config(['$locationprovider', function($locationprovider){ $locationprovider.html5mode(true).hashprefix('!'); }]); ngroute been added dependency,

xcode - ld: warning: directory not found for option '-F-' -

i know has been asked thousands of times, can't rid of error upon building. think started show after upgraded xcode latest version available (6.3.2). ld: warning: directory not found option '-f-' ld: library not found -lpods-acknowledgementsbundle clang: error: linker command failed exit code 1 (use -v see invocation) my library search path (target) has: $(inherited) non-recursive $(project_dir) non-recursive i uninstalled , installed pod, clean , build.. nothing. does have suggestion? thanks!

Unwanted dashed black border when rotating image in php -

i getting unwanted dashed black border when rotate image. have tried remove not finding success. using following function image rotation. try preserve transparency. have provided image well. here image url: http://s23.postimg.org/hep2pkol7/border.png function imagerotation ($source, $rotang) { imagealphablending($source, false); imagesavealpha($source, true); $rotation = imagerotate($source, $rotang, imagecolorallocatealpha($source, 0, 0, 0, 127)); imagealphablending($rotation, false); imagesavealpha($rotation, true); return $rotation; } i call function that: $rotatedimage = imagerotation($image, 10); here full code <?php // settings $text = "previously blogging"; $fontface = 'days.ttf'; $fontsize = 90; $angle = 0; $bbox = calculatetextbox($text, $fontface, $fontsize, $angle); $image = imagecreatetruecolor($bbox['width'], $bbox['height']); // define colors $black = ima

python - How to return alphabetical substrings? -

i'm trying write function takes string s input , returns list of substrings within s alphabetical. example, s = 'acegibdh' should return ['acegi', 'bdh'] . here's code i've come with: s = 'acegibdh' ans = [] subs = [] = 0 while != len(s) - 1: while s[i] < s[i+1]: subs.append(s[i]) += 1 if s[i] > s[i-1]: subs.append(s[i]) += 1 subs = ''.join(subs) ans.append(subs) subs = [] print ans it keeps having trouble last letter of string, because of i+1 test going beyond index range. i've spent long time tinkering try , come way avoid problem. know how this? why not hard-code first letter ans , , work rest of string? can iterate on string instead of using indices. >>> s = 'acegibdh' >>> ans = [] >>> ans.append(s[0]) >>> letter in s[1:]: ... if letter >= ans[-1][-1]: ... ans[-1] += letter ... e

Reading and Write specific lines to text file C# -

i have master file called filename ids of people. in sorted order. want divide ids 27 chunks , copy each chunk different text file. using (filestream fs = file.open(filename, filemode.open, fileaccess.read, fileshare.readwrite)) { string line; int numoflines = file.readalllines(filename).length; -- have 73467 int eachsubset = (numoflines / 27); var lines = file.readalllines(datafilename).take(eachsubset); file.writealllines(filename1,lines); } i have 27 different text files. want 73467 of ids divided equally , copied on 27 different files. so, 1st file have id#1 id#2721 2nd dile have id#2722 id#(2722+2721) , on. not know how automate , run quickly. thanks hr the simplest way run file.readline , writeline inside loop , decide file receive line. i wouldn't recommend parallelize routine since it's io operation, copy of lines pretty fast.