Posts

java - Postgis and Oracle spatial queries with GeometryUserType parameters -

following configuration of postgis , oracle spatial different hibernate persistence units , have instances of myclass persisted either postgis or oracle database configured in persistence.xml , mapping file. i have geom attribute annotated : public abstract class myclass (...) @type(type = "org.hibernatespatial.geometryusertype") @column(name = "geom", columndefinition="geometry", nullable = true) protected geometry geom; (...) persistence.xml configured : <persistence-unit name="pers_unit_name" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>jta_data_source_name</jta-data-source> <mapping-file>oracle.hbm.xml</mapping-file> and in oracle.hbm.xml : <hibernate-mapping> <typedef name="org.hibernatespatial.geometryusertype" class="org.hibernatespatial.geometryusertype" > ...

Netezza: While creating external table, column name is duped with same data type, need to know the reason -

i creating external table in netezza. after table creation when describing it, can see column duped 4 times. looks strange me happening. example: create external table test '/nzscratch/kapish/69314.082.000/tv_daily_audit_results.txt' using(delim '|' format 'text' ) select b.card_acceptor_id mid, a.div_no card_div_no, c.div_name acct_type, a.acct_id, a.tran_text, substr(a.tran_text, 24, 13) merchant_city, substr(a.tran_text, 37, 2) merchant_state, b.merchant_zip_cd, a.post_date, a.tran_cd, a.gl_origin_cd, a.tran_amt, a.merchant_cat_cd pstdtr_pstd_trans a, pstdrt_rtain_rtns b, divdef_div_def_v c a.acct_id = b.acct_id , a.reference_no = b.reference_no , a.tran_date = b.tran_date , a.div_no = c.div_no , a.div_no in (232, 234, 235, 237, 273, 275, 276, 278)...

sql - MySQL - sort by certain last string character -

i'm trying sort character on string, example, before: +----+---------+ | id | name | +----+---------+ | 1 | red | | 2 | red-a | | 3 | red-xy | | 4 | blue | | 5 | blue-a | | 6 | blue-xy | +----+---------+ after: +----+---------+ | id | name | +----+---------+ | 4 | blue | | 1 | red | | 5 | blue-a | | 2 | red-a | | 6 | blue-xy | | 3 | red-xy | +----+---------+ are there ways categorize based on -a or -xy using order by thank in advance. select case when right(`name`,length(`name`)-instr(`name`,'-')) = `name` '' else right(`name`,length(`name`)-instr(`name`,'-')) end `suffix`, `name` `table1` order `suffix`, `name` if no suffix found, put record in first row set. caveat: first dash used separate word prefix.

compiler errors - Python 3: "Expected an indent Block" in a comment -

i new here , german (so english not good). i have written function in python , @ top want have comment. problem is, python says "expected indent block" error in comment. def makeonefeedscript(): z = 1 cfeedlist = [str("null")]*3 #liste mit länge der feeds erstellen #listen für 1. 2. 3. post, usw, ifeedlist = [] #liste für posttime des 1. posts pro feed iifeedlist = [] #liste für posttime des 2. posts pro feed iiifeedlist = [] #liste für posttime des 3. posts pro feed ivfeedlist = [] #liste für posttime des 4. posts pro feed vfeedlist = [] #liste für posttime des 5. posts pro feed vifeedlist = [] #liste für posttime des 6. posts pro feed in range(z): #alle daten aus dateien lesen s = "/usr/lib/advanced-feed/tmp/" + str(i) #speicherortspeichern f = open(s, "rb") #Öffnen all dependent lines must indented: def makeonefeedscript(): z = 1 cfeedlist = [str("null...

Polymer iron-list dynamically adding items? -

i'm trying migrate code polymer 0.5 1.x, means moving core-list iron-list. however, can not figure out iron equivalent how adding items core-list. <core-list height="85"> <template> <div class="{{ {selected: selected} | tokenlist }}" style="padding:5px;"><paper-fab mini icon="arrow-forward" title="arrow-forward"></paper-fab> <!--{{index}}-->{{model.name}}</div> </template> </core-list> which called updated via... document.queryselector('core-list').data = $.parsejson('[{"name":"one"},{"name":"two"}]'); anyone have suggestions? update : jul-23-2015 12:20pm pst @zikes following suggestion posted, have following. <dom-module id="my-element"> <template> <iron-list items="[[myitems]]" as="item"> <template> <div>[[item.name]]</di...

Parse a HTML document and get a specific element in PHP and save its HTML -

all want save first div attribute role="main" string external url using php. so far have this: $doc = new domdocument(); @$doc->loadhtmlfile("http://example.com/"); $xpath = new domxpath($doc); $elements = $xpath->query('//div[@role="main"]'); $str = ""; if ($elements->length > 0) { $str = $elements->item(0)->textcontent; } echo htmlentities($str); but unfortunately $str not seem displaying html tags. text. you can html via savehtml() method. $str = $doc->savehtml($elements->item(0));

decompression - Decompress LZString in PHP -

Image
i used lzstring in javascript compress json data , post php program. ( http://pieroxy.net/blog/pages/lz-string/index.html ) i have binary code want decompress in php, use lzstring.php repository : https://github.com/nullpunkt/lz-string-php/blob/master/src/lzstring.php when use compress() method error, when use decompressfrombase64() method there no error funstion return empty string ! how can decompress lzstring in php ? my data same picture: