Posts

Showing posts from March, 2011

java - Unable to fill pool: when starting jboss application -

my project jboss project based on spring mvc. when run app following error: unable fill pool datasource configuration <!-- jndi setup --> <bean id="datasource" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jndiname"> <value>java:jboss/datasources/ssdiaryds</value> </property> </bean> mysql mapping in jboss standalone.xml <datasource jndi-name="java:jboss/datasources/ssdiaryds" pool-name="ssdiarydspool"> <connection-url>jdbc:mysql://localhost:3306/schooldairy</connection-url> <driver>com.mysql</driver> <transaction-isolation>transaction_read_committed</transaction-isolation> <pool> <min-pool-size>10</min-pool-size> <max-pool-size...

c# - Close inspector (compose window) inside the ItemSend() method in outlook -

i develop outlook adding using visual studio 2013 , addin express v.7.7.4087. wanting handle itemsend() , save item drafts , close inspector automatically, can apart closing inspector, because not allowed close inspector inside method of itemsend(), have use windows.forms.timer (close mailitem inside timer) ends error says “rcw content has been separated …………” error are there alternative ways of doing this? in redemption (for outlook), there way of doing same thing? private void adxoutlookappevents1_itemsend(object sender, dxolitemsendeventargs e) { outlook.mailitem mailitem = null; outlook.recipients recipients = null; mailitem = e.item outlook.mailitem; try { // code goes here if (editbuttonclicked || swoffline) { e.cancel = true; if (swoffline) { mailitem.save(); timer.start(); } } } ...

ios - Multiple UIPickerView in the one TableViewController Programatically -

i've been trying several days can't find way works. ways i've tried set loads pickerviews keyboards textfields want doesn't show of data i've put them. can me through setps of or give me link , example of it. thank helper. uitoolbar *toolbar = [[uitoolbar alloc] init]; [toolbar setbarstyle:uibarstyleblack]; [toolbar setbartintcolor:[uicolor colorwithred:237.0/255.0 green:30.0/255.0 blue:36.0/255.0 alpha:1.0]]; [toolbar sizetofit]; uibarbuttonitem *flexbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:self action:nil]; uibarbuttonitem *donebutton =[[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action:@selector(resignkeyboard)]; donebutton.tintcolor = [uicolor whitecolor]; nsarray *itemsarray = [nsarray arraywithobjects:flexbutton, donebutton, nil]; [toolbar setitems:itemsarray]; yourtextfield.inputaccessoryview = to...

c# - converting the POCO Model into MongoDB's Bson format -

here information development environment: microsoft visual studio community 2015 .net framework 4.6 asp.net mvc assembly system.web.mvc version=5.2.3.0 mongodb.driver 2.0.1.27 mongodb 3.0.6 within c# application, have following code retrieves mongodb database reference: public class mongodbconnectionmanager { public imongodatabase getmongodb() { var client = new mongoclient("mongodb://localhost:27017"); imongodatabase imgdb = client.getdatabase("foo"); imongocollection<bsondocument> userdetails = imgdb.getcollection<bsondocument>("users"); return imgdb; } // end of public imongodatabase getmongodb() } // end of public class mongodbconnectionmanager here poco class represent user business entity: using mongodb.bson.serialization.attributes; public class usermodel { public object _id { get; set; } //mongodb uses field identity. [bso...

jquery - Issue with nth child height property -

this css code. .filtereddoccontent { display: none; } .filtereddoccontent .photography:nth-child(1), .filtereddoccontent .photography:nth-child(2), .filtereddoccontent .photography:nth-child(3), .filtereddoccontent .photography:nth-child(4), .filtereddoccontent .photography:nth-child(5), .filtereddoccontent .photography:nth-child(6), .filtereddoccontent .photography:nth-child(7), .filtereddoccontent .photography:nth-child(8) { display: block; } what here - total 15 documents or more than(it come according user insert or upload data) there , show 1st 8 documents. take height of documents , button of load more appear. this div when documents display:- <div id="lightbox" class="row filtereddoccontent"> <?php foreach ( $adoc $odoc ) { ?> <div class="col-sm-6 col-md-3 col-lg-3 photography app" id="load_data"> <div class="portfolio-item"...

android - HTML5 Datetime-local input -

the problem arises in google chrome on android phones. there no 24h format. example: - when click on datetime-local input wheel choose date , time. there no option choose full range of 24hours. can't choose 23h or 17h. i dont have option choose or pm. my timezone on phone set gmt+2 , set 24h time. edit: atleast know , there ever , option choose 0-24h, or 12h range? as appears there bug type="datetime-local" https://code.google.com/p/chromium/issues/detail?id=529320

python - Matching codons -

so i'm learning nested pools , don't it. task return matching pairs in following format: [('aag', 'ttc'), ('gat', 'cta'), ('ttg', 'aac'), ('cat', 'gta'), ('ggc', 'ccg'), ('att', 'taa'), ('tct', 'aga')] so code: def matching_codons(complements, poola, poolb): complements = {'a':'t', 'c':'g', 't':'a', 'g':'c'} poola = ['aag', 'tac', 'cgg', 'gat', 'ttg', 'gtg', 'cat', 'ggc', 'att', 'tct'] poolb = ['taa', 'cta', 'aac', 'ttc', 'aga', 'ccc', 'ccg', 'gta'] final = [] in poola: z in poolb: if , z in complements: final.append() return(final) it's not working , don't know why, don't quite it. how can make statement poola , poolb ...

Access to .txt [VB.NET] -

i've developed multi-user application. 1 user saves string text file, other users have read string in background process. my problem is: when users open file read string, user wants save new string can't write file. implement system checks if file opened or not, , in case is, waits few seconds , retries. what function or command if file opened? there quite few patterns can deal with. 2 i'd recommend be: dealing fileaccess , filemode , fileshare sync file access eventwaithandle

javascript - D3.js table not refreshing when data changes -

i'm displaying table in browser using d3.json function. table in browser not refreshing when data changes in json file. it's showing previous data instead of new data in table. if refresh manually in browser works correctly table changes new data. here code use: <!doctype html> <meta charset="utf-8"> <style> td{ padding:7px; border:#4e95f4 1px solid; } /* provide minimal visual accomodation ie8 , below */ th{ background: #dae5f4; border: 1px solid black; padding: 2px 4px; font-weight: bold; } /* define background color odd background rows */ tr:nth-child(odd){ background: #b8d1f3; } /* define background color background rows */ tr:nth-child(even){ background: #dae5f4; } { position: absolute; } </style> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> <div id="container"></div> <a href="http://...

caching - How to place java objects into coherence and read from coherence cache -

i looking coherence cache, need place map object cache. can 1 let me know how keep java objects coherence cache? thanks, naresh. its simple hasmap put operation. import com.tangosol.net.cachefactory; import com.tangosol.net.namedcache; namedcache cache = cachefactory.getcache("virtualcache"); string key = "key"; hashmap value = new hashmap<string,string>(); value.put("key1","val1"); cache.put(key, value); hashmap value = (hashmap) cache.get(key);

Only print the parent category (WordPress) -

i making blog template theme. have 1 problem... if post post on blog, want display parent category of post. so example, if post post category hierarchy: - vacation - france - first day i want vacation displayed on blog. does know how solve problem? sincerely, joren <?php $parentscategory =""; foreach((get_the_category()) $category) { if ($category->category_parent == 0) { $parentscategory .= ' <a href="' . get_category_link($category->cat_id) . '" title="' . $category->name . '">' . $category->name . '</a>, '; } } echo substr($parentscategory,0,-2); ?>

python - PDFMiner - pdf2txt.py parsing text out of order -

i'm new both python , pdfminer, although not programming in general. i'm using python 2.7 on windows 7, , in cygwin. i'm writing script beautifulsoup extract specific info pdfs. that, used pdf2txt create both .txt , .html file of pdf use in testing. usual commands: python pdf2txt.py -o output.txt input.pdf python pdf2txt.py -o output.html input.pdf they both have same problem: lines of text appear out of order. run pdf2txt on pdf , you'll see mean: (edit: found original site.) it's american samoa 1 on page: https://www.iamovers.org/resourcespublications/shipperguides.aspx?navitemnumber=580 for example, correct layout of 1 section of page 1 of pdf: documents required copy of passport (some ports require passports family members listed on 3299) form cf-3299 supplemental declaration (required ports) detailed inventory in english copy of visa (if non-us citizen / permanent resident) / copy of permanent resident card ...

swift2 - fatal error: swapping a location with itself is not supported with Swift 2.0 -

i have extension create new array have group of arrays randomly given array: extension array { var shuffle:[element] { var elements = self index in 0..<elements.count { swap(&elements[index], &elements[ int(arc4random_uniform(uint32(elements.count-index)))+index ]) } return elements } func groupof(n:int)-> [[element]] { var result:[[element]]=[] in 0...(count/n)-1 { var temparray:[element] = [] index in 0...n-1 { temparray.append(self[index+(i*n)]) } result.append(temparray) } return result } } and using this: let mainarr = array(1...60) let suffeldarr = mainarr.shuffle.groupof(10) print(suffeldarr) and print like: [[10 random element between 1 60], [10 random element between 1 60], [10 random element between 1 60], [10 random element between 1 60], [10 random element between 1 60], [10 random element be...

Unable to create Hbase table from hive with Hive version 1.1.0 HBase version 0.94.8 and hadoop version 2.7.0 -

unable create hbase table hive hive version 1.1.0 hbase version 0.94.8 , hadoop version 2.7.0 hive (default)> create table test_hive_hbase(eid int, ename string, esal double) > stored 'org.apache.hadoop.hive.hbase.hbasestoragehandler' > serdeproperties > ("hbase.columns.mapping" = ":key,cfstr:enm,cfsal:esl") > tblproperties ("hbase.table.name" = "test_hive_hbase"); failed: execution error, return code 1 org.apache.hadoop.hive.ql.exec.ddltask. org/apache/hadoop/hbase/hbaseconfiguration i have created auxlib folder under hive , added jars hive, hbase , hadoop. hduser@ubuntu:/usr/lib/hive/auxlib$ ls -latr total 174536 -rw-r--r-- 1 hduser hduser 822524 oct 19 2011 mysql-connector-java-5.1.16.jar drwxr-xr-x 5 hduser hduser 4096 may 22 2013 ruby drwxr-xr-x 3 hduser hduser 4096 may 22 2013 native -rw-r--r-- 1 hduser hduser ...

api - PhP - Withings Authentification Implementation -

Image
i'm sorry bad english, need help. i'm making web-application run under laravel 5, , need incorporate withings user's datas. read api's doc, don't understand well. what authentification steps, , order ? have exemple in aim me ? thank's lot. withings seems use oauth1, can find authentication flow of standard, see global picture, @ https://oauth.net/core/1.0/#anchor9 : their api described @ http://oauth.withings.com/en/api/oauthguide , https://developer.health.nokia.com/api (with request tester), got that. there's libraries (with composer name) might find interesting use (or read comprehension): https://github.com/zn4rk/php-withings/ (paxx/withings) https://github.com/cfournel/withings (huitiemesens/withings)

python - how to Pass variable in link to the django view -

i have html form display data using loop. <tbody id="table"> {% sku, lid, stk, mrp, sp, stts in product_data %} <tr> <td> <a class="btn-link" href="/product/product.html" value="{{sku}}">{{sku}}</a> </td> <td>{{lid}}</td> ..... this code prints data in table using loop link in first colyumn of table. link points new page want data displayed. displayed data dynamically generated mongodb database. want when click on link pass value parametre django view can fetch data contains parametre , show on next page. how that? my views.py: from django.shortcuts import render django.http import httpresponse inventory.models import getproductdata def inventory(request): pd = getproductdata().skudata() sku = pd[0] listing_id = pd[1] stock_count = pd[2] mrp = pd[3] status = pd[5] selling_price = pd[4] product_data = ...

icCube - set serie color for 2 dimensions in the columns in a amCharts combo chart -

Image
i have got following dynamic chart (see attached picture). sake of reproducability have created simple chart based on standard iccube's sales model. the idea have 2 facts on column axes data selected years. distinguish between facts want assign color facts fades on years. when add years, new year color belongs fact, little bit lighter. screenprints below clarify. my question is: there way amcharts/combo in relation mdx/setting of iccube? in attachments see 2 graphs: but when de-select 2008, happens: i have included json can reproduce in sales demo on plain vanilla iccube 5.1.2 installation. { "classid": "ic3.reportguts", "guts_": { "ic3version": 12, "schemaname": "sales", "cubename": "sales", "layout": { "classid": "ic3.fixedlayout", "guts_": { "ic3version...

Installing ggplot2 in R (v3.2.2); says it's installed but is unable to be found/used? -

Image
this question has answer here: how should deal “package 'xxx' not available (for r version x.y.z)” warning? 13 answers i'm having trouble installing ggplot2 package in r. according r-studio, have latest version installed; says when r studio first loads: r version 3.2.2 (2015-08-14) -- "fire safety" copyright (c) 2015 r foundation statistical computing platform: x86_64-w64-mingw32/x64 (64-bit) i'm assuming means i'm using correct version. then, when try install ggplot2 package using install.packages("ggplot2") command, following error (had post in pastebin because contained links): http://pastebin.com/deqn0vfw it appears kind of error internet connection (not sure how fix it, googling didn't seem give concrete answer). after got error, went ahead , tried downloading .zip file ggplot2 official cran website. then, in ...

c++ - JPG images correctly loads but not showing on SDL -

i have load , show 20 random images 6750 jpg images. images in jpg format , shows not , not always. part loads images using img_load (sorry, english bad). i have image lib correctly installed. code fine because png images works, problem jpg images , have use 6570 of them. int i=0,ra; srand(time(null)); char name[18]; while(i<10){ ra=rand()%675+1; sprintf(name, "icons/icono (%d).jpg",ra); strcpy(imgs[i], name); imas[i] = img_load(imgs[i]); printf("icono %s charged\n",imgs[i]); i++;} with printf can check if imgs correctly loaded, know no errors code, when run program, 2 or 4 images shows , no more. this entire code (ignore comments if dont speak spanish): #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <sdl/sdl.h> #include <sdl/sdl_image.h> #include <sdl/sdl_mixer.h> void limpiar (sdl...

android - Avoid user dialog when bonding with BLE device using PIN on latest API (Lollipop) -

i bonding/pairing bluetooth low energy device android app. when bonding initiated, "enter pin"-dialog shown. automatically disappears when set pin code. dialog appears , disappears slow enough confuse , annoy user. how can avoid dialog? i found nothing on bonding in android ble guide https://developer.android.com/guide/topics/connectivity/bluetooth-le.html i helped other question, solution not remove dialog. how can avoid or dismiss android's bluetooth pairing notification when doing programmatic pairing? this question suggests removing reciever in sdk. android prevent bluetooth pairing dialog is there no way solve within api? question on subject few years old , there has been lot of changes in android bluetooth api recently. using api 19 (4.4 kitkat) use api 22 (5.1 lollipop) if help. this how bonding: mybluetoothdevice.createbond(); i listen pairing intent able provide pin @ right moment. listen bonding intent. //register before calling createbond c...

android - Google Play Services change my style (more precisely remove) -

after added google play service build.gradle file, checkbox lost customized style , icon on actionbar has been changed (now have arrow). <checkbox android:id="@+id/login_cb_remember" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="10dp" android:text="remember me" android:checked="false" /> manifest: <application android:allowbackup="true" android:label="@string/app_name" android:theme="@style/apptheme" android:icon="@mipmap/ic_launcher"> style.xml: <resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="android:textcolor">#232323</item> ...

r - Addining row number of sub dataframe -

i have following dataframe: > df1 var1 var2 var3 1 ac bc bc 2 bc bc cc 3 dc ec dc 4 gc gc gc i have sub dataframe above df1 (only 2 rows remained of 4): > df2 var1 var2 var3 2 bc bc cc 3 dc ec dc i numbers of df2 r ( r = 2,3 ). in addition add df1 new column indicate 1 row exists in df2. in final df1 following: > df1 var1 var2 var3 df2 1 ac bc bc 0 2 bc bc cc 1 3 dc ec dc 1 4 gc gc gc 0 how can it? we can use %in% to compare rownames of 'df1' , 'df2'. logical vector can coerced binary format wrapping + . df1$newcol <- +(rownames(df1) %in% rownames(df2)) df1 # var1 var2 var3 newcol #1 ac bc bc 0 #2 bc bc cc 1 #3 dc ec dc 1 #4 gc gc gc 0 if need row names common, use intersect intersect(rownames(df1), rownames(df2)) #[1] "2" "3"

android - Gridlayout background adjustment -

how adjust background accurately gridlayout? have gridlayout of 6x6 , background should on exact locations. appears differently on different devices. for better user experience , effective output, suggest go recyclerview . can not adjust view sizes block sizes,but can have access many other advanced features.it works gridview anyway in more better way.

objective c - How to run ios 8.4.1 device into xcode 6.0.1? -

i can't access device device version is->8.4.1 my xcode deployment version ->8.0(maximum version),when try run give me error message [may running version of ios not supported version of xcode] . is there possibility run device. if you're running ios 8.4.1 on phone/simulator, you'll need upgrade xcode 6.4 , contains ios 8.4 sdk.

php - OpenCart URL redirect with query string not working -

hoping might able give me hand one. i'm working on customer account area on opencart site , there's section people can delete pets have added inventory. delete functionality works , redirect, message shows in box confirm pet removed, when 1 added. achieve i've added query parameter of "remove=1" url redirect per opencart documentation not seem work. here code in controller: $this->load->model('account/pet'); $pet_info = $this->model_account_pet->removepet($this->request->get['pet_id']); if (!isset($pet_info['pet_id'])) { $this->redirect($this->url->link('account/pets', '', 'ssl')); } $this->redirect($this->url->link('account/pets', 'remove=1', 'ssl')); but when redirects, query string doesn't appear , therefore message not show. any appreciated, michael

Querying for a user relative leaderboard with MongoDB -

i have collection of users, each user has points attribute (see schema below). my end goal return sorted array of limited documents according specific user location, or in other words, small part of leaderboard relative specific user location. currently query , sort users, find user want in returned array , slice array according that. wondering if there query save me returning users. sample user schema: /* 1 */ { "_id" : objectid("..."), "points" : 5852 , "key" : "user1" } /* 2 */ { "_id" : objectid("..."), "points" : 3835, "key" : "user2" } /* 3 */ { "_id" : objectid("..."), "points" : 1984, "key" : "user3" } /* 4 */ { "_id" : objectid("...."), "points" : 2437, "key" : "user4" } lets assume want query return 3 documents sort...

brooklyn - Create a Hadoop Cluster connection in Talend without open the IDE -

i trying create "one click solution" hadoop cluster, ambari server , talend via apache brooklyn in cloud. i can create of things, have connect them. i able create "the project/connection" between ambari server , talend manually. have url of ambari server, can open talend , create connection hadoop cluster using wizard of talend. the question is, there way without opening talend. mean, creating manually files needed , leave them corresponding folders. in case of yes, files need create , content of files? i'm not familiar talend few google searches, this anwser suggest talend open studio not come rest api. as configuration file, not find results. conclusion it not possible automatised . when think it, makes sense talend open studio mean graphical , visualisation tool build complex jobs.

javascript - Custom search box using your own <input type="text"> -

as can see in this example jquery datatables has search box function. i want create customized search box design. possible create own using code below outside datatables? <input type="text" id="search" name="search"> please see search api example , how global search implemented. for example, can use code below search id of search box: $(document).ready(function() { $('#example').datatable(); $('#search').on( 'keyup click', function () { $('#example').datatable().search( $('#search').val() ).draw(); } ); } );

arrays - get fieldname of a data struct matlab -

i have following nested struct: hole 1x200 struct, diam 1x12 struct, has following fields: pos, freq1, fre12 that is: hole(1 200).diam(1 12).pos .freq1 .freq2 from value ( freq1 , freq2 ), obtain field name of struct. need find value matches freq1 , freq2 , show fieldname. i tried use structfun in order apply function each field. [struct.field]=structfun(@(x) find(x.freq1==27.059783995484867 & freq2==76.468355874897000)) but guess writing wrong on code. also create anonymous fuction have following error: 'error using structfun / inputs structfun must scalar structures' . how ever when verified if specific value of struct scalar, have positive answerd: isscalar(hole(130).diam(10)) i belive more near solution using script: myfun=@(yourarray,desiredvalue) yourarray==desiredvalue; %//apply function each field of scalar structure, scalar?? desiredfieldindex=myfun(structfun(@(x) x,hole),26...