Posts

codenameone - How to use variables to refer to Components in codename one? -

i created ui uibuilder. instead of using findxxxx () , love in statemachine : public class statemachine ... { private container c; private tabs t; initvars () { initall(); } .... private initall () { container c = findcontainer(); tabs t = findtabs(); ... } } and use them c.getyyy() . is possible? if yes, how? yes can that, not advisable. the danger of when have 2 components same name on different forms, may reference wrong component , may hard debug. if sure can deal above, can declare , initiate variables inside statemachine class outside of methods private global variable. public class statemachine ... { private container c = findcontainer(); private tabs t = findtabs(); initvars () { } .... }

java - Spring Boot without Model + MySQL -

i need make application without using models, because require make model every tables - isn't needed me. we can go class execute queries directly or rest api. has have idea achieving this? as suggested in other answers, not require models . see spring boot documentation , can download simple working example you need have application.properties file properties below spring.datasource.url=jdbc:mysql://localhost:3306/test spring.datasource.username=dbuser spring.datasource.password=dbpass spring.datasource.driver-class-name=com.mysql.jdbc.driver add spring boot jdbc dependency in pom.xml <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-jdbc</artifactid> </dependency> you want inject jdbctemplate in controller class or other component scanned class, private final jdbctemplate jdbctemplate; @autowired public mycontroller(jdbctemplate jdbctemplate) { this.jd...

Slack integrations -

i building slack app whereby using incoming-webhook scope. while authorising, post channel option comes created channels, don't create new channel , post option. any highly appreciated. thanks. update :- attached screenshots 1) this app 2) some other app. create new channel option missing in mine updated: looks want link create new channel correct? if that's case, slack dev team have add. on end, incoming webhooks not allow automated new channel creation.

Adding Drawable to Android library project -

when place ic_sam.png in drawables of module project main app includes, while getting drawable r.drawable.ic_sam below error java.lang.nosuchfielderror: is cannot add drawables in library projects? if no add ? experts please guide. you have create aar project if want bundle resources library. more in how create aar project can found out here

php - How to handle differnet purched price and quantity in same product -

i'm developing automobile parts inventory system using php , mysql. system have purchase module add/update/increase quantity of parts & sale module decrease/out quantity of parts. query have 2 section a. storing data suppose have parts a1 in our stock quantity 30 , price of parts a1 $20 when purchase it. now want stock parts more example want buy 50 more items of parts a1 new price of parts a1 $24. what best way/logic make these items separate know how parts purchased price $20 , new price $24 on sale page. 1. store same parts more once in database 2. normalize database: parts hasmany parttransctions purchased price , quantity b. retrieving data what decrease method when sale (suppose 60 unit in above example) a1 parts also want calculate the profit of sale how handle of situation. in advance normalize database: parts hasmany parttransctions purchased price , quantity or you can handle issue using batch purchase. need create table called p...

java - Save perspective containing multiple instances of the same view -

my understanding of situation: there 2 ways persist state of views in eclipse: mementos: these saved on workbench close , restored on open idialogsettings: these can saved , restored @ will packageexplorerpart in eclipse uses both (e.g.) linking files in explorer editors. i have multiple instances of same view different state, , want save them in perspective. if save using mementos, closing , opening eclipse restore state correctly. if open new window file | new window, saved perspective does not provide mementos nor secondary ids views, cannot restore. is there way save state of these views perspective can correctly restored? while technically dialogsettings can used persist view state, mementos passed savestate() , init() meant therefore. not sure why package explorer such double-entry book keeping . there reson for, haven't had necessity so. new window creates new view , hence there nothing restore. if restart eclipse 2 windows open, both re...

git - TortoiseGit Repo-browser context menu not visible -

i installed tortoisegit 1.18.16.0 (x64 bit) in windows 8 os. when right click on tortoisegit sub-menu, i'm getting following options : settings help about whereas tortoisesvn -> repo browser menu option visible. i tried enabling settings dialog of tortoisegit enable repo browser context menu option. still i'm not able view menu. however other git menus [like pull , fetch , diff , diff previous version etc..,] visible. only menu remains hidden :( . could 1 please tell me how browse git repository using tortoisegit. suggestions appreciated! git menu not visible helped me fix issue, need install following git bash here , git gui here during installations. once installed these, need press 'shift+ right click menu "git repo-browser" make visible. after performing above things, i'm able view 'git repo-browser' menu option [note : remember context menu not visible normal right click instead need shift + right...