Posts

android - Sort alphabetically from A to Z table (database) -

i'm working on update of android application. have hundred recipes entered in data table. want sort them alphabetically (asc). tried code applied in case on sqllitemanager on firefox , executed manipulation , indeed, classified them, not on eclipse, set: select * tbl_recipes<br /> order recipe_name asc; please, can put code in android project?

Batch File - Delete a File only if another file exists -

i wish create batch file can following: if "file 1abc (x).bin" exists delete "file 1abc (y).bin", if not, keep "file 1abc (y).bin" , move on. basically there multiple versions of file 1 kind (marked single variable in filename stays same) superior other. if superior version not exist, wish inferior version remain. is possible? you use if statement ( http://www.computerhope.com/if.htm ): if exist file1.ext del file2.ext update - address specific problem mentioned in question: set filenames="file 1abc (*).bin" set lastversion="" :: find last version %%f in (%filenames%) ( if "%%f" gtr %lastversion% set lastversion="%%f" ) :: delete old versions %%f in (%filenames%) ( if "%%f" lss %lastversion% del "%%f" ) there 1 catch: if version (x or y in example) number, should specified fixed number of digits (e.g. (009), (010), ...), because (9) considered greater (10). ...

html - Image Reading from base64 data in javascript produces image of different size -

Image
i trying screenshot of page using chrome extension , trying crop image. upon taking screenshot, base64 dataurl of image. when try render image using dataurl, image renders larger(appears zoomed in) original image. when manually give <img> object original size renders fine. when draw image canvas, canvas takes enlarged size. i have been banging head against wall solution problem no avail. appreciated. //here js code: var image = document.getelementbyid("image"); var canvas = document.getelementbyid('mycanvas'); var context = canvas.getcontext('2d'); image.onload = function() { var sourcex = 0; var sourcey = 0; var sourcewidth = 150; var sourceheight = 80; var destwidth = sourcewidth; var destheight = sourceheight; var destx = 0; var desty = 0; context.drawimage(image, sourcex, sourcey, sourcewidth, sourceheight, destx, desty, destwidth, destheight); }; and here html code, removing dataurl takes space, , p...

nested - Child URL Query params shown with ; instead of & -

i creating nested route , when trying access link params , query child routes shown http://localhost:3000/test/test/testingid;param1=value1 instead of http://localhost:3000/test/test/testingid?param1=value1 here parent route definitions: @routeconfig([ {path: '/', component: rootcomponent, name: 'rootcmp' }, {path: '/test/...', component: nestedcomponent, name: 'nestcmp', data: {isadmin: true} } ]) @component({ selector: 'main-app', template:` <h1>using router , router config</h1> <a [routerlink]="['rootcmp']">home</a> | <a [routerlink]="['nestcmp']">nested route test</a> <router-outlet></router-outlet> `, directives: [router_directives, routerlink] }) my child route definitions this: @routeconfig([ {path: '/', component: seccomponent, name: 'nestcmp', useasdefault:true }, {path: '/test/:id...

mapkit - Creating a dynamic MKAnnotationView in Swift -

currently, know how create mkannotationview static pin, image that's added. does know, or have resources, on how create pin change colors or have number displayed inside of change depending on information business? for instance, have pin red when business closed, , green when business open. maybe dollar signs inside of pin tell user how expensive is. edit i have created class called custompin adopts mkannotation protocol. additionally, i'm not looking have custom mkannotationview image can change. mean i'll have add multiple images mkannotationview in array , have change image everytime details business change? thank in advance! you can create custom mkannotationview inheritance. can use class create annotation view delegate method. here 1 example. class kdannotationview: mkannotationview { let titlelabel = uilabel() convenience init(annotation: mkannotation?) { self.init(annotation: annotation, reuseidentifier: "indet...

How can I check if a view is really visible on screen in Android? -

many examples scrollview, don't have idea relativelayout in relativelayout, views cover view. can check in xml, how can check java code? use isshown(), willnotdraw(), haswindowfocus(), getlocalvisiblerect(), not working. case1: container layout on screen <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <!--container layout on screen--> <fragment android:id="@+id/map_fragment" android:layout_width="match_parent" android:layout_height="match_parent" /> <linearlayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <imageview android:id="@+id/icon" android:layout_width="50dp" andro...

perl - the server is overloaded or there was an error in a CGI script -

when run folder,this error occurs.i want run localhost/perl/folder name/eample.pl.how solve it?.sorry easy question.please me. it means server timing out reason. :) answer here, need more specific , limit question shot bit of code, in doubt about. check server's log file more information. path may wrong or pathname misspelled. luck!