Posts

ios - Customize UIImagePickerController to have a white border -

Image
i'm trying reach controller looks similar this: notice customize size of capture screen, , white border around it. know, it's impossible change background color of uiimagepickerviewcontroller, im trying implement overlayview go above it. the main issue need make mask view show camera in middle of overlay view, , far came short. any ideas on how implement this? how can make mask view cuts "hole" in overlay view see camera underneath it? thanks! i suggest creating custom camera. let put sorts of overlays etc. check out avcapturesession there bunch of tutorials online describing how easily. first result google search: https://dannygtech.wordpress.com/2014/03/04/custom-camera-on-ios-avcapturesession-avcapturevideopreviewlayer-tutorial/

timestamp - Convert unix epoch time to a date in Apache Derby -

is there function in apache derby can convert unix epoch time value (eg. 1453974057 ) date? if have seconds since unix epoch, use: select {fn timestampadd(sql_tsi_second, 1453974057, timestamp('1970-01-01-00.00.00.000000')) } dt sysibm.sysdummy1 just replace "sysibm.sysdummy1" original table, , replace 1453974057 value. when dealing milliseconds gets bit more complicated because can't use timestampadd directly (you sql state 22003: resulting value outside range data type integer.) if have milliseconds since unix epoch, use: select --the following block converts milliseconds since linux epoch timestamp { fn timestampadd( sql_tsi_frac_second, ( --add millisecond component 1453974057235 - { fn timestampdiff( sql_tsi_second, timestamp('1970-01-01-00.00.00.000000'), { fn timestampadd(sql_tsi_second, 1453974057235/1000, timestamp('1970...

sql - Error converting Nvarchar data type to datetime from VB.NET -

i have problem regarding dates program stored procedure in sql. my program takes date excel spreadsheet , parses such: tempdate = date.fromoadate(exws.cells(exrow, mymatchedcolumns(2)).value) dim format() = {"dd/mm/yyyy", "dd-mm-yyyy", "yyyy-mm-dd"} duedate = date.parseexact(tempdate, format, system.globalization.datetimeformatinfo.invariantinfo, globalization.datetimestyles.none) duedate 'date' variable i'm assuming @ point 'duedate' universal date object. think best way parse both english regional date , polish dates, since used on polish machine. however, when sending values stored procedure: mysqlstring = "exec bsp.partprice_sp " & _ "'" & duedate & "', " & _ "'" & mypartid & "', " & _ "'" & currency &...

java - Access HTTP response when using Jersey client proxy -

i'm using jersey 2.22 consume rest api. approach contract-first, service interface , wrappers used call rest api (using org.glassfish.jersey.client.proxy package). webclient webclient = clientbuilder.newclient(); webtarget webtarget = webclient.getwebtarget(endpoint); serviceclass proxy = webresourcefactory.newresource(serviceclass.class, webtarget); object returnedobject = proxy.servicemethod("id1"); the question is: how underlying http response (http status + body)? when returnedobject null, need analyze response error message returned example. there way it? saw can plug filters , interceptors catch response, that's not need. you should return response result of interface method instead of plain dto. i'm not sure level of control you're expecting (considering reply @peeskillet comment), response object give opportunity fine tune server's response (headers, cookies, status etc.) , read of them @ client side - might see t...

php - Codeigniter, testing if file uploader has file -

i have following code in view: if (isset($stockists)) { $id = $stockists->id; echo form_open_multipart($system_settings['admin_folder'].'/stockists/form/'.$id); } else { echo form_open_multipart($system_settings['admin_folder'].'/stockists/form/'); } <?php echo "<input type='file' name='userfile' size='20' />"; ?> there's lots of other text input fields in there sent database on submit. file loader i'm interested in though. in controller function, how can check if file exists in up-loader after submit? the following retruns false: $image = ($_files['userfile']); i need check in conditional statement if file exists in uploader. example: if ($_files['userfile']) { //do } but method not work. the super global $_files $_files['userfile'] isn't boolean. if (strlen($_files['userfile']['tmp_name']) > 0) { ...

jsf - <p:selectOneButton> with images -

i'm using jsf primefaces, want use buttonset of radiobutton images can't make work. here's code: <p:selectonebutton value="#{loginbean.user}" > <f:selectitem itemlabel="&lt;img src=&quot;/myapp/faces/javax.faces.resource/myimg1.png?ln=img&quot;/&gt;" itemvalue="1"/> <f:selectitem itemlabel="&lt;img src=&quot;/myapp/faces/javax.faces.resource/myimg2.png?ln=img&quot;/&gt;" itemvalue="2"/> </p:selectonebutton> i tried escaping characters "escape", "escapeitem" , "itemescaped" attributes. read last 1 in other question . solution in question uses <h:selectoneradio> , not <p:selectonebutton> . note: know works using jqueryui buttonset() method (primefaces uses on background) it's not script problem.. so, posible <p:selectonebutton> ? thanks! indeed, renderer of <p:selec...

Which Event to be called when adding the products to order creation in magento admin? -

i have scenario want create order backend . want call api when selecting products order . want know api need call when add item order may call api ? i appreciate . regards surjan sales_quote_add_item event occured when add product order admin. follow steps. your config.xml like. <adminhtml> <events> <sales_quote_add_item> <observers> <unique_event_name> <class>module/observer</class> <method>productlevelchanges</method> </unique_event_name> </observers> </sales_quote_add_item> </events> </adminhtml> observer.php <?php class company_module_model_observer extends mage_core_model_abstract { public function productlevelchanges(varien_event_observer $observer){ $item = $observer->getquoteitem(); $productobject=mage::getmodel('ca...