Posts

Showing posts from April, 2010

html - php, phpMyAdmin - dropdown values not inserting into database -

i'm trying add values, pick dropdown menus (see html), database table. yet not working out planned. i'm doing wrong? @ moment columns dropdown values set int in table of database. code below: html: <head> <meta charset ="utf-8"> <title>el gusto - sigaren toevoegen</title> </head> <body> <form action="handler.php" method="post"> <span class="tab"><b>sensatie in de mond:</b><br> <span class="tab"><span class="tab">lip: <select> <option value="1" name="sensatie_lip_1">1</option> <option value="2" name="sensatie_lip_2">2</option> <option value="3" name="sensatie_lip_3">3</option> ...

c# - Auto add character when read text from table in Word -

i don't know why when read text cell of table (in word) -> result unexpected output. particularly, string s = tbl.cell(1, 1).range.text; when debug, tbl.cell(1, 1).range.text equals "123\r\a" . when assign s , s equals "123\r\r\a" !!! could me figure out situation?

delphi - Database master-detail relationship - How to prevent entering non existent value to master table? -

in master detail relationship procedure tdatamodule.table1afterscroll(dataset: tdataset); begin if table1.fieldbyname('unit_id').asstring <> '' begin query1.close; query1.sql.clear; query1.sql.text:= 'select * table2 unit_id = ' + table1.fieldbyname('unit_id').asstring; query1.open; end; how can make sure when editing (and saving) query1 results not enter nonexistent unit_id ? i want unit_id able changed, want make sure not enter unit_id not exist. afterscroll not right event use beforepost instead in way: procedure tdatamodule.table1beforepost(dataset: tdataset); begin if table1.fieldbyname('unit_id').asstring <> '' begin query1.close; query1.sql.text:= 'select unit_id table2 unit_id = ' + table1.fieldbyname('unit_id').asstring; query1.open; if query1.recordcount=0 abort; //so if th...

How to make multilanguage realurl in TYPO3? -

i have 1 problem multilingual realurl. want key of url parameter multi language. for example: have below url default (english) language. http://www.example.com/xyz-page/company-detail/company-name.html here "company-detail" key parameter of url parameter "&tx_company[company]=1" tx_company[company] converted "company-detail" through postvarsets. now in german want above url below http://www.example.com/xyz-page/firma-detail/company-name.html and in french want above url below http://www.example.com/xyz-page/entreprises-detail/company-name.html how can achieve this?

android - Activity Listener Implementation? -

i android/java novice , have question based on following scenario: i have baseactivity extended number of other activities, a1, a2, , a3 activities a1 , , a2 may request user enter part#s. activity a3 doesn't have functionality never ask part#. part# entered user in partdialogfragment . since user may prompted part# a1 , a2 activities, thinking put code instantiates , shows partdialogfragment in baseactivity don't have duplicate same call in activities a1 , a2 . partdialogfragment has interface defines onpartentered() question: should implement interface partdialogfragment in baseactivity or in activities a1 , a2 ? basically, thinking this: class partdialogfragment extends dialogfragment{ private partlistener mpartlistener; public interface partnumberlistener{ void onpartentered(string part#); } ... ... @override public void onattach(activity activity){ super.onattach(activity); try{ mpartlistener ...

jasmine - How to get url of next page of clicking submit button in Protractor? -

i able run test code , able submit form. need url of next page when submit button click. need url of next page when submit button clicked. getting curenturl of first page. code: describe('pmts app 5.0',function(){ var loginpage = require("./loginpo"); it('login test', function(){ loginpage.setusername('xyz@test.com'); loginpage.setpassword('test'); loginpage.clickbutton(); expect(browser.getcurrenturl()).toequal('https://localhost:1234/#/timesheet'); }); }); after submit button clicked browser closed , not waiting next page load. once button submitted should wait until next page load , need url of next page... put in following way- loginpage.clickbutton().then(function(){ expect(browser.getcurrenturl()).toequal('https://localhost:1234/#/timesheet'); }) or can put explicit hard sleep- browser.sleep(time in ms) or can put browser.wait() wait element appears on next page- browser.wait(function(){ ret...

javascript - Meteor, how to set context data in template event function -

i set context data in event handler inserts new uploaded photos image fscollection. want set newly generate id of photo file. need pass id child template further processing. below code working with: how should define data want use later in event handler? images.js template.profile.events({ 'change #uploadbtn': function(event, template) { var name = $("#uploadbtn").val(); $("#uploadfile").val(name); fs.utility.eachfile(event, function(file) { images.insert(file, function (err, fileobj) { if (err){ // handle error } else { //here want set fileobj._id data further usage. } }); }); } }); template.imageview.helpers({ images: function () { return images.findone({_id: this.imageid}); } }); ...

javascript - Is it possible to produce a final SHA-256 value from a series of intermediate values? -

Image
is possible produce multiple intermediate sha-256 values somehow combined @ later time produce same sha-256 produced single hashing computation? in other words, if hash 4gb .iso image file sha-256 value 1 day, produce same single sha-256 splitting file into, lets 10 sections, producing intermediate sha-256 each section, , @ later time, produce final sha-256 using "only" intermediate sha-256 values? i realise there no way produce 10 intermediate sha-256 values 1 final sha-256 value thought might possible hash file in chunks , combine 10 intermediate sha-256 values @ later time without needing actual data @ same time. if possible, how produce final sha-256 intermediate sha-256 values in c# and/or javascript? edit: want take away requirement of intermediate values being sha-256 values. i don't care long can produce final sha-256 @ later time using "only" multiple intermediate values , no data. , have exact same sha-256 have gotten doing @ once on 4gb...

matlab - How do I efficiently created a BW mask for this microscopic image? -

Image
so background. tasked write matlab program count number yeast cells inside visible-light microscopic images. think first step cell segmentation. before got real experiment image set, developed algorithm use test image set utilizing watershed . looks this: the first step of watershed generating bw mask cells. generate bwdist image imposed local minimums generated bw mask. can generate watershed easily. as can see algorithm rely on successful generation of bw mask. because need generate bwdist image , markers it. originally, generate bw mask following following steps: generate local standard deviation of image sdimage = stdfilt(grayimage, ones(9)) use bw thresholding generate initial bw mask binaryimage = sdimage < 8; use imclearborder clear background. use other code add cells on border back. background finished. here problem but today received new real data sets. image resolution smaller , light condition different test image set. color dep...

python - How can I start matlab with a daemon when I'm not active on the computer? -

i need execute several matlab functions on daily basis. of these functions download data internet. fail if data not ready yet example , want them try again after time. in order implement have python script calling matlab functions several times until success or send me e-mail if fail repeatedly. not "state of art" implementation don't know better. python script called each day daemon. now, works if i'm logged computer fails return value 1 , following message (daemon error log) when computer (imac) rests while (i forbid sleep though in energy saver preferences. @ least think did ticking "prevent computer sleeping automatically when display off". however, "enable power nap" on.) traceback (most recent call last): file "/users/<username>/documents/daemontest/matlab_batcher.py", line 108, in <module> eng = matlab.engine.start_matlab() file "/library/python/2.7/site-packages/matlab/engine/__init__.py", line ...

Gridster add_widget with Meteor -

i have troubles wihth gridster & meteor. @ first, loaded whole widgets template , recalculate grid method below. i have template named dashboard, in template loop through widgets , call second template called widgettmpl contains formatted html <template name="dashboard"> <div id="dashboardbody"> <button id="configmode" class="btn btn-primary"> <i class="fa fa-pencil"></i>configuration </button> <div class="gridster"> <ul id="widgetitemlist" class="widget_item"> {{#each activewidgets}} {{> widgettmpl}} {{/each}} </ul> </div> </div> </template> i execute code callback onrendered template.dashboard.onrendered(function(){ var gridsterul = jquery(".gridster ul"); gridsterul.gridster({ widget_margins: [5, 5], widget_base_di...

html - python dict object has not attribute read -

i want image file web,and send api_search_handler can not change code of. remove uploadimagehandler can that,but want use middle handler receive call api_handler image , show in web.can without uploadimagehandler? or how should fix error , send correct data type api_handler? limit of code of api_handler fixed.. index.html <form action="/uploadimage" enctype="multipart/form-data" method="post"> <p><input type='file' multiple="true" name="file" id="file"/></p> <p><span>:</span><input type="int" size="3" value="120" name="dist"/> &nbsp<span>:</span><input type="int" size="3" value="50" name="max_num" id="max_num" /></p> <p><span>:</span></p> <p>all:<input type...

tkinter - Is it bad to use instance methods to organize code in a large python class -

below have dummie code, instance methods definied code organization. init function sets chain of calls various instance methods in specific order, , starting feel bad practice have code organized in such way. if there references on organizing large classes (such found in gui apps) improve readability? dummie code: class app: def __init__(self): def do_things() def do_things(self): self.do_a_thing() self.do_another_thing() def do_a_thing(self): self.thing1 = 1 def do_another_thing(self): self.thing2 = self.thing1 + 1 these functions execute once when class called, suggest should not functions (or instance methods)? a working example have chosen potentially bad method of organization below, fill() method akin do_things() , , e.g. init_scroll() , init_lb() akin do_a_thing() , do_another_thing() , etc. import tkinter tk import tkfont class editorapp: def __init__( self, master) : self.root = ...

unix console: how to delete lines that contained in other lines -

i have text file contains sorted paths e.g. /abc /abc/def /abc/jkl /def /def/jkl /def/jkl/yui /def/xsd /zde now i'd delete lines contained in other lines in case following lines should stay: /abc/def /abc/jkl /def/jkl/yui /def/xsd /zde using awk , tac (concatenate , print files in reverse): $ tac test.txt | awk '{ if (substr(prev, 1, length($0)) != $0) print $0; prev = $0}' | tac /abc/def /abc/jkl /def/jkl/yui /def/xsd /zde here's more readable version of awk: { if (substr(prev, 1, length($0)) != $0) # compare last line (substring?) print $0; prev = $0 # remember last line }

javascript - Angular-Charts - Pie Chart,show labels inside each slice of data -

Image
i learning stage of angular-chart-js. trying use angular-chart.js plot pie chart. unable find way showing labels (not tooltips) on pie chart, describe each slice of data. here how did it: angular.module('app').controller('controller', ['$scope', '$http', '$location', '$window', '$routeparams', function($scope, $http, $location, $window) { var diskdatajson = { "data": [80, 12], "labels": [used space, free space], "colours": ['#9ab6f0', '#c2d3f6'] }; $scope.piediskdata = json; } ]); <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <table border="0" width="100%"> <tr> <td style="border-left: 1px solid #0099cc" width="25%"> <center><span><labe...

javascript - How to get response from other user after joining room using socket.io -

i have 1 doubt regarding socket.io.i have 2 type of user i.e-admin,client .first admin create userid , join room.i need when user join room admin should response , need regarding this. my working codes given below. server.js: var port=8888; var express=require('express'); var morgan = require('morgan'); var http=require('http'); var bodyparser= require('body-parser'); var methodoverride = require('method-override'); var mongo = require('mongojs'); var database='oditek'; var collections=['video']; var app= express(); var server=http.server(app); var io=require('socket.io')(server); var db = mongo.connect("127.0.0.1:27017/"+database, collections); app.use(express.static(__dirname + '/public')); // set static files location /public/img /img users app.use(morgan('dev')); // log every request console app.use(bodyparser.urlencoded({ extended: false })) ...

sql - Using LIMIT within GROUP BY to get N results per group? -

the following query: select year, id, rate h year between 2000 , 2009 , id in (select rid table2) group id, year order id, rate desc yields: year id rate 2006 p01 8 2003 p01 7.4 2008 p01 6.8 2001 p01 5.9 2007 p01 5.3 2009 p01 4.4 2002 p01 3.9 2004 p01 3.5 2005 p01 2.1 2000 p01 0.8 2001 p02 12.5 2004 p02 12.4 2002 p02 12.2 2003 p02 10.3 2000 p02 8.7 2006 p02 4.6 2007 p02 3.3 what i'd top 5 results each id: 2006 p01 8 2003 p01 7.4 2008 p01 6.8 2001 p01 5.9 2007 p01 5.3 2001 p02 12.5 2004 p02 12.4 2002 p02 12.2 2003 p02 10.3 2000 p02 8.7 is there way using kind of limit modifier works within group by? you use group_concat aggregated function years single column, grouped id , ordered rate : select id, group_concat(year order rate desc) grouped_year yourtable group id result: ----------------------------------------------------------- | id | grouped_year ...

How to set cell properties from rowselected in gridview Devexpress? -

i'm newbie devexpress. when work gridview in have problem : private void grditem_selectionchanged(object sender, devexpress.data.selectionchangedeventargs e) { receivecontroller _rc = new receivecontroller(); datarow r = null; int[] selectedrows = grditem.getselectedrows(); if (selectedrows.length != 0) { (int = 0; < selectedrows.length; i++) { grditem.getdatarow(selectedrows[i]); // set cell properties here } } } in event selectionchanged row, need set few cells properties in it, may : bordercolor, allowedit = false, or disable..... don't know how can ? you cannot set appearance properties specific cell that. gridcontrol not maintain internal collection of rows/columns, it's not easy saying grid.rows[3].cells[2].backcolor = color.blue;. instead, need handle 1 of gridview's drawing events; in case, seem rowcell...

html - Bootstrap 3 Autosizing Inline Inputs with Small Column -

Image
i attempting create inline form within small container (.col-sm-4). using default inline form @ size automatically wraps multiple lines, avoid. aiming here: at point have gotten inputs throw out min-width , instead adhere bounding columns, cannot button in spot want (and autosizing overarching container). jsfiddle here html: <div class="col-xs-4 well"> <div class="col-xs-7 form-col" id="input-dynamic"> <input type="text"></input> </div> <div class="col-xs-4 form-col" id="input-dynamic"> <div class="input-group-addon">$</div> <input type="number"></input> </div> <div class="col-xs-1 form-col" id="input-dynamic"> <button class="btn btn-danger">-</button> </div> </div> css: #input-dynamic input[type=text] { wi...

.htaccess - Redirecting http urls to https -

there many example of making http redirects https . options +followsymlinks rewriteengine on rewritebase / rewritecond %{server_port} !^443$ rewritecond %{https} off rewriterule ^(.*)$ https://www.example.com/$1 [r=301,l] however, redirect urls coming web browsers. many functions being used in api calls mobile applications, hence can't use above code redirects urls https , apis calls make mobile apps crash. how can modify above code, redirect urls thast coming web browser? to detect web browser again mobile browser need check against http_accept variable. options +followsymlinks rewriteengine on rewritebase / rewritecond %{http_accept} !(text/vnd\.wap\.wml|application/vnd\.wap\.xhtml\+xml) [nc] rewritecond %{server_port} !^443$ rewritecond %{https} off rewriterule ^ https://%{http_host}%{request_uri} [r=301,l,ne]

Google Directory API with PHP Client Library gives 403 -

i have gone on several questions in regards directory api , php client lib none helped. closest 1 one: google apps admin sdk directory api 403 in php problem still persists. i cannot access directory api (admin sdk) using php client library. i can access email settings api. they both related admin sdk, not understand why when access email settings api token, when try access directory api 403 "requested client not authorized." the code is $scopes = array('https://www.googleapis.com/auth/admin.directory.user', 'https://apps-apis.google.com/a/feeds/emailsettings/2.0/'); $auth = new google_auth_assertioncredentials(g_client_email, $scopes,file_get_contents (g_client_key_path), 'notasecret', 'http://oauth.net/grant_type/jwt/1.0/bearer', 'my.superadmin@account.com', false ); what missing? also: how heck use logging/debugging class in php client lib?...

winapi - Compiling CImage::StretchBlt() always always shows Internal compiler error in x64 -

environment : vs2008 sp1 professional i have function uses method cimage::stretchblt(). code compiles correctly in 32 bit environment, in 64bit, show error c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlimage.h(398) : fatal error c1001: internal error has occurred in compiler. void cmylistview::drawhistorythumbnail( int nindex ) { crect rctthumbnail; getthumbnailrect( rctthumbnail ); cimage imghistory; imghistory.loadfromresource( afxgetresourcehandle(), idb_bitmap_history_thumbnail ); cdc* pdc = getdc(); cdc dcmemory; dcmemory.createcompatibledc( pdc ); cbitmap bmphistory; bmphistory.createcompatiblebitmap( pdc, rctthumbnail.width(), rctthumbnail.height() ); cbitmap* poldbmp = dcmemory.selectobject( &bmphistory ); // if comment below issue goes away imghistory.stretchblt( dcmemory.getsafehdc(), rctthumbnail, srccopy ); cbrush brushframe; brushframe.createsolidbrush( rgb(0, 0, 25...

How to change the format of abbreviated month with a ending dot in my software R? -

i peruvian , i'm learning program in r when convert character date using function as.date na. because abbreviated month not have point (jul. sep.) fecha<-c("06-jul-2015","06-sep-2012") as.date(fecha, format="%d-%b-%y") [1] na na please. how can r consider abbreviated month without point? thank much i had same problem yesterday. added following line sys.setlocale("lc_time", "c") fecha<-c("06-jul-2015","06-sep-2012") as.date(fecha, format="%d-%b-%y") and works: "2015-07-06" "2012-09-06" edit: spanish , dot in comment: sys.setlocale("lc_time","spanish") fecha<-c("06-ene.-2015","06-dic.-2012") as.date(fecha, format="%d-%b.-%y")

android - Online Pdf to Image convertor -

i using application on android read online pdf. take thumbnail images of pages in online pdf application. suggestion on or other api? the easy way take bunch of screenshots. on android devices, press down volume button , power button @ same time. afterwards, can either upload pictures onto evernote, or plug in usb computer , can covert images using photoshop or other related software. hope helps. cheers!

sockets - QT QTcpServer::incomingConnection(qintptr handle) not firing? -

i'm trying create multithreaded server using qt first time. 1 use socket pointer returned qtcpserver::nextpendingconnection() socket handle baked in - since i'm interfacing connecting client on separate thread, need create socket separately using qintptr handle qtcpserver::incomingconnection(qintptr handle). after dreary, error-packed debugging session managed track down problem qtcpserver::incomingconnection() never being fired? has had similar problem - has changed on recent versions qt? these ones i've tried: qtcpserver::incomingconnection(qintptr handle) qtcpserver::incomingconnection(qintptr socketdescriptor) qtcpserver::incomingconnection(int handle) edit: creating instance of server: testserver *myserver = new testserver(); myserver->initializeserver(1234); which calls: void testserver::initializeserver(quint16 port) { mainserver = new qtcpserver(this); mainserver->listen(qhostaddress::any, port); qdebug() << "listening ...

eclipse - container 'Android Dependencies' references non existing library android-support-v7 -

i know question has been asked before, i've done find on issue , still doesn't help. it started when accidentally deleted project folder git workspace. fortunately had project on folder on computer. imported keep on getting error. thanks.

javascript - iOS keyboard scrolling issue with webview -

my problem website has iframe pops up. when click on input box, ios keyboard pushes iframe way up. see demo gif. http://cl.ly/image/1t2u2i3i0l0f i want keyboard shift page user can see input box while typing. web view , have no idea how control keyboard unless native app. any appreciated! cheers.

ios - how to change collection view cell background colour when it is selected? -

this code used if cell selected background colour have change in image view placed inside collection view cell. not working -(void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { if (cell.selected) { cell.img_cell.backgroundcolor = [uicolor colorfromhexstring:@"#ffc400"]; // highlight selection } else { cell.backgroundcolor = [uicolor clearcolor]; // default color } nslog(@"selected section>> %@",[arr_images objectatindex:indexpath.row]); // cell.backgroundcolor=[uicolor colorfromhexstring:@"#ffc400"]; } now working removed if condition , tried using cellforitematindexpath . cell = [collectionview cellforitematindexpath:indexpath]; cell.img_cell.backgroundcolor = [uicolor colorfromhexstring:@"#ffc400"]; // high

php - How to replace double/more letters to a single letter? -

i need convert letter occur twice or more within word single letter of itself. for example: school -> schol google -> gogle gooooogle -> gogle voodoo -> vodo i tried following, stuck @ second parameter in eregi_replace. $word = 'goooogle'; $word2 = eregi_replace("([a-z]{2,})", "?", $word); if use \\\1 replace ?, display exact match. how make single letter? can help? thanks see regular expression replace 2 (or more) consecutive characters one? by way: should use preg_* (pcre) functions instead of deprecated ereg_* functions (posix). richard szalay 's answer leads right way: $word = 'goooogle'; $word2 = preg_replace('/(\w)\1+/', '$1', $word);

c - What is the resolution of xnu's clock_get_time for CALENDAR_CLOCK? -

what resolution of xnu kernel function clock_get_time calendar_clock? as far i'm aware, os x uses tsc on x86. makes precise granularity processor-specific, "good enough" pretty purposes. definitive answer, check source code though…

Windows 10 Powershell Invoke-WebRequest "Windows Security Warning " -

alright 1 big problem in opinion microsoft needs address immediately. steps reproduce this: powershell> invoke-webrequest "anywebsitewithcookies.com" (let's microsoft.com example) what happens following warning: http://i.stack.imgur.com/tr023.jpg now horrible . why microsoft thinks acceptable beyond me, in windows 8.1 there workaround . if went into: control panel > internet options > privacy http://i.stack.imgur.com/osls3.jpg you set cookies accepted time. way rid of message , still retain dom parsing functionality. -usebasicparsing isn't solution me, because want use functionality of invoke-webrequest returns without basic parsing. however in windows 10 microsoft decided rid of slider whatever reason: i.stack.imgur.com/jenm3.jpg this problem can reproduced on every windows 10 machine , destroys how invoke-webrequest can used in silent scripting environment, because script hangs , waits dialog answered . there way still set cookies accepted...

php - If a key dont exist in array how can I ignore the error -

i need array. run web based game need give values short description. works no problem long key exists in array, if theres key user has not in array outputs undefined offset errors. there keys wont in array, how can ignore them , not print errors? $storage_values = array(35000 => "använde sin list och besegrade ahmaroth", 71503 => "avslutade uppgiften att dräpa 250 vargar", 56431 => "avslutade uppgiften att dräpa 300 drakar", , alot more); $storage = $db->query("select `key` user_storage userid = 69")->fetch(); <? if (array_key_exists($storage['key'], $storages)): ?> <? foreach($db->query("select `key`, `date` user_storage user_id = 69") $row): ?> <tr> <td>date</td> <td><?=$storages[$row['key']]?></td> </tr> <? endforeach ?> <? endif ?> now if theres ...

jquery - Bootstrap - div over div slideup -

i can't head around one: i'm creating mobile webapp bootstrap. have container navbar, divs , again pill-nav below: <div class="container"> <!-- top navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <!-- ... --> </nav> <div class="tab-content"> <div role="tabpanel" class="tab-pane active fade in" id="map-panel"> <div id="map"></div> <div class="container-fluid" id="teaser-container"> <div class="row" id="teaser-slideup-button"> <div class="col-xs-12"> <a role="button" href="#teaser-content"> <i class="fa fa-chevron-up"></i> </a> </div...

mysql - NullPointerExceptions while executing LoadTest on WSO2BPS -

while performing loadtests on wso2 bps 3.2.0 we`ve ran onto problem. let me tell more out project , our actions. our bps process designed manage interactions 3 systems. "spread" on 2 parts - first 1 create instance in 1 of systems, waiting bit, , select offer in instance context. in real life looks like: user wants product, application asks system offers , user selects offer available ones. in bps first part straight-forward process, second part spread on 2 flows - 1 refresh information new offers, , wait if user chooses 1 of them. our aim stand 1000-1500 simulatious threads on load-test. external systems simulated mockups executed loadui. we can achieve our goal if disable "process-level monitoring events" in deployment descriptor (set "none") of our process. goes , smooth hours. but if enable feature (and need to), falls error (on 100-200 run): [2015-07-28 17:47:02,573] error {org.wso2.carbon.bpel.core.ode.integration.bpelprocessproxy} - er...

oracle - Spring / DbUnit closes connection after one test -

so, need write integration tests our java-configurated spring application (3.2.3) oracle data base . there's separate schema gets populated spring-test-dbunit , first test runs without problems. other following tests, no matter if they're in same class or not, fail due closed connection: java.sql.sqlrecoverableexception: closed connection @ oracle.jdbc.driver.physicalconnection.createstatement(physicalconnection.java:3423) @ oracle.jdbc.driver.physicalconnection.createstatement(physicalconnection.java:3398) @ org.dbunit.database.statement.abstractbatchstatement.<init>(abstractbatchstatement.java:50) @ org.dbunit.database.statement.simplestatement.<init>(simplestatement.java:49) @ org.dbunit.database.statement.preparedstatementfactory.createbatchstatement(preparedstatementfactory.java:57) @ org.dbunit.operation.deletealloperation.execute(deletealloperation.java:85) @ org.dbunit.operation.compositeoperation.execute(compositeoperation...

How to add maven dependencies as classpath libraries to Eclipse plugin Runtime? -

i'm developing eclipse plugin , i'm in process of converting maven project. used "configure->convert maven project" option , wrote pom.xml file appropriate dependencies , reference tycho , maven plugin. <properties> <tycho.version>0.23.0</tycho.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <build> <sourcedirectory>src</sourcedirectory> <pluginmanagement> <plugins> <plugin> <groupid>org.eclipse.tycho</groupid> <artifactid>tycho-p2-repository-plugin</artifactid> <version>${tycho.version}</version> <configuration> <includealldependencies>true</includealldependencies> </configuration> </plugin> </plugins> </plugin...

algorithm - Find kth largest element in an array, two different priority_queue solutions time complexity -

i'm interested in 2 solutions using priority_queue specifically. although both use priority_queue, think have different time complexity. solution 1: int findkthlargest(vector<int>& nums, int k) { priority_queue<int> pq(nums.begin(), nums.end()); //o(n) (int = 0; < k - 1; i++) //o(k*log(k)) pq.pop(); return pq.top(); } time complexity: o(n) + o(k*log(k)) edit: sorry, should o(n) + o(k*log(n)) pointing out! solution 2: int findkthlargest(vector<int>& nums, int k) { priority_queue<int, vector<int>, greater<int>> p; int = 0; while(p.size()<k) { p.push(nums[i++]); } for(; i<nums.size(); i++) { if(p.top()<nums[i]){ p.pop(); p.push(nums[i]); } } return p.top(); } time complexity: o(n*log(k)) so in cases 1st solution better 2nd? in first case complexity o(n)+klog(n) not o(n)+klog(k) there n...