Posts

Showing posts from July, 2013

hadoop - Mapper not invoked while using multipleInputFormat -

i have driver class using multipleinputformat class invoke different mappers @ runtime. when use multipleinputs.addinputpath(job, fstatus.getpath(), textinputformat.class,createpuredeltamapperone.class) in first loop, first mapper(createpuredeltamapperone) not getting invoked. when comment block of code invokes multiple input format first loop, , call outside, mapper class invoked. please me find issue. import java.io.ioexception; import java.io.inputstreamreader; import java.net.urisyntaxexception; import java.util.properties; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.filestatus; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.job; import org.apache.hadoop.mapreduce.lib.input.fileinputformat; import org.apache.hadoop.mapreduce.lib.input.multipleinputs; import org.apache.hadoop.mapreduce.lib.input.textinputformat; import org.apache.hadoop.mapreduce.lib.o

asp.net - Can I split a SQL table into three classes using EF 6.1 and SQL Server 2012? -

i have following class simplified example. class has id , properties related house , related room. data stored in 1 row of sql table. namespace classlibrary1.models { public partial class aspnetuser { public string id { get; set; } public nullable<int> adminhousenumber { get; set; } public string adminhousecity { get; set; } public nullable<int> adminroomnumber { get; set; } public string adminroomfloor { get; set; } } } sql: create table [dbo].[aspnetusers] ( [id] nvarchar (128) not null, [adminhousenumber] int null, [adminhousecity] nchar (10) null, [adminroomnumber] int null, [adminroomfloor] nchar (10) null, constraint [pk_dbo.aspnetusers] primary key clustered ([id] asc) ); this maps database this: namespace classlibrary1.models.mapping { public class aspnetusermap : entitytypeconfiguration<aspnetuser>

javascript - Trying to append the textfield value to another textfield -

i doing basic javascript choosing value popup , value appearing in textfield. there button on side of textfieldfield, when clicked transfer value textfield comma separated. i mean new textfield have values comma separated , not replaced. i doing code <input type="text" class="inputs" style="width:70px;" name="color1" id="color1" value="" maxlength="7" size="7"> <a href="javascript:addtotextfield('color1')"><img src="icon_add.gif" alt="add text box above" title="add text box above" border="0"></a> function addtotextfield(cfieldname) { var objtxt = document.getelementbyid('sta'); objtxt.appendchild(cfieldname); } another text field need pass value <input type="text" name="sta" id="sta" class="inputs" />

Sending mail through smtp adds new lines to the email's content -

we used use our own smtp servers sending emails, started migrating of our emails sent through sendgrid , working smoothly except email's content gets breaked new lines after extent please check email breaked content --bayt_2660.59000399_bayt content-type: application/octet-stream content-disposition:attachment; filename="cv_report.xls" date created,cv id,first name,middle name,last name,user name,,home phone,work phone,mobile phone,email address,nationality,country,city,p. o. box,address (line 1),address (line 2),gender,residence location,notice period,last monthly salary,education degree,education location,educational institution,completion date of education,education description,work experience date,work experience date,work experience job title,work experience company name,work experience description,work experience location,work experience job role,work experience company industry,skill name,skill level,skills years of experience,skills last used,lan

ruby - Some misunderstanding using Array#map method -

let's have following block of code: arr = ['a','b','c'] arr.map {|item| item <<'1'} #=> ['a1','b1','c1'] arr #=> ['a1','b1','c1'] why array#map change array? should create new one. when i'm using + in block instead of << , works expected. array#each change array itself, or iterate on , return itself? my question is: why map change array? should create new. map doesn't change array . << changes string s in array . see the documentation string#<< : str << obj → str append—concatenates given object str . although isn't mentioned explicitly, code example shows << mutates receiver: a = "hello " << "world" #=> "hello world" a.concat(33) #=> "hello world!" it's strange, because when i'm using + operator in block insted of << works expec

c++ - Why does the size of an int vary in some compilers? -

this question has answer here: what c++ standard state size of int, long type be? 24 answers reading following resource says size of int/pointer can vary depending on compiler: http://www.c4learn.com/c-programming/c-size-of-pointer-variable/ why this? i understand c defines min , max number of type should hold, why 1 compiler choose set example int 2 bytes , @ 4? advantage of 1 on another? whilst "why" can answered "because standard says so", 1 make argument standard written differently, guarantee particular size. however, purpose of c , c++ produce fast code on machines. if compiler had make sure int "unnatural size" machine, require instructions. circumstances, not required, you'd care it's "big enough want do". so, give compiler chance generate "good code", standard specifies minimum sizes

A new expression requires () or [] after type c# -

i'm using codedom compile following code , save exe using system; using system.windows.forms; using microsoft.win32.taskscheduler; class program { static void main(string[] args) { using (taskservice ts = new taskservice()) { taskdefinition td = ts.newtask(); td.registrationinfo.description = "does something"; // create trigger fire task @ time every other day td.triggers.add(new dailytrigger { daysinterval = 1 }); // create action launch notepad whenever trigger fires td.actions.add(new execaction("notepad.exe", "c:\\test.log", null)); // register task in root folder ts.rootfolder.registertaskdefinition(@"test", td); // remove task created ts.rootfolder.deletetask("test"); } } } the problem when select save location , compile errro "a new expression requires () or [] after type". can't see i'm missing here, appreciated. codedom uses c#2

c# - entity framework sum and average without grouping -

is there way in entity framework following simple query sql query select avg(totalsalary), avg(totalhours) context.employeedetails company = 1234 in entity framework doing group in employeedetails.where(c => c.company = 1234).groupby(c => c.company).select(x => new { avgsalary = x.average(c => c.totalsalary), = x.average(c => c.totalhours) }) is there correct way re-write above query avoid unnecessary group is there issue using group? (which incidentally done groupby(c => c) ) given you've used clause filter. that said, cannot (as far know) written in linq (without generating 2 queries instead of one). if happy 2 queries, naturally like: var query = context.mytable.where(x => x.myval == 1); var queryselect = new { avevalue1 = query.average(x => x.property1), avevalue2 = query.average(x => x.property2) }; ... expect, performs slower. i therefore recommend use

database - R-studio/Oracle DB connection -

i created new dsn on local machine. after doing that, following error message. can advice on how fix this? connection<- odbcconnect(dsn="oradb1",uid="username",pwd="password") warning messages: 1: in odbcdriverconnect("dsn=oradb1;uid=username;pwd=password") : [rodbc] error: state na000, code 12504, message [microsoft][odbc driver oracle][oracle]ora-12504: tns:listener not given service_name in connect_data 2: in odbcdriverconnect("dsn=oradb1;uid=username;pwd="password") : [rodbc] error: state 01000, code 0, message [microsoft][odbc driver manager] driver doesn't support version of odbc behavior application requested (see sqlsetenvattr). 3: in odbcdriverconnect("dsn=oradb1;uid=username;pwd=password") : odbc connection failed you need make sure if works basic r command line first. based on error msg, system(or r studio) not recognize new dsn , driver. did put user dsn

Python TkinterTreectrl drag items -

i writing program in python allow me browse through experimental data have taken, , view metadata associated experimental conditions each dataset. at heart of program tkintertreectrl widget, wrapper tk treectrl despite being rather novice programmer, far working - can add items, remove items, select them etc etc. however, cannot work out how allow dragging of items new locations in tree. have found in documentation many references drag images, , @ moment can drag tantalizing dotted outline around. cannot find events generated on drag , drop. closest find in manual following set of events: <drag-begin> <drag-receive> <drag-end>: generated whenever user drag-and-drops file directory. event generated filelist-bindings.tcl library code, not used default. i not know how use " filelist-bindings.tcl library code", not sure correct approach anyway. in related query - thought 1 way solve , similar problems send every event g

java - UDP networking 3 sec delay -

so, started working on multiplayer game today , run serious problem delay in networking. when test things on 1 machine using localhost, theres no noticable delay. when tried running client on laptop , server on pc im experiencing 2-3 sec delay. basically im doing is: server: is running 2 threads, 1 listens packets on port , when recieves packet input, updates gamestate accordingly. second thread takes gamestate first , every 10ms sends client. client: also 2 threads, 1 recieves gamestate , second sends packets keyboard input every 10ms. im seding datagrampackets bytearray came serialized class (both have size 100 bytes) send code: serverpacket testpacket = new serverpacket(player.getx(),player.gety()); bytearrayoutputstream bos = new bytearrayoutputstream(); objectoutput out = null; try { out = new objectoutputstream(bos); out.writeobject(testpacket); byte[] bytes = bos.tobytearray(); datagrampacket packet = new data

string - C# : IndexOf storing 2 values at a time -

i trying break single string 3 strings having problem using indexof when input string e.g 15,m,true i-e use 2 commas in input console.write("enter pyrimid slot number ; block number ; whether or not block should lit or not ?"); string pyrimidslot = console.readline(); int commanumber = pyrimidslot.indexof(","); string pyrimidslotnumber = pyrimidslot.substring(0, commanumber); console.writeline("your block number : " + pyrimidslotnumber); the code works fine till here string blocknumber = pyrimidslot.substring(commanumber + 1, commanumber +1 ); console.writeline("your block number : " + blocknumber); but when try separate "block number" input string using above code output your block number : m,t works fine when change code string blocknumber = pyrimidslot.substring(commanumber + 1, commanumber -1 ); why not storing value of first index ? commanumber + 1 starting index , commanumber - 1 ending index does noy make se

Open file from user setup folder on setup project - C# -

Image
i want create setup project loads file specific path (the same place of setup.exe file folder). i know how create setup project , how load file static folder (like debug folder). how can change dynamic folder / path? i hope explaining enough? this example of want @ end: now, .msi , .exe files, want add .hex file when click on setup.exe, finds file same folder. thanks help! i did little research you. this answer show excellent way application's base directory. there can append final folders , plug in file name. edit: comment, believe looking this: string path = @"c:\c# projects\sqa-v flash..."; from there can append rest of info. oh, put ... in there because snapshot doesn't include entire folder name.

jquery - My Second search is not working using javascript -

Image
i using 2 apis tmdb , omdb the tmdb search runs , returns titles given search want run second search using 1 of titles clicking more info button beside it. that search using omdb not running when click button nothing happens i have include code u can run yourselfs better understand , me problem here screenshot of search far easyier understand mean code below <html> <head> <title>sample seach</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var url = 'http://api.themoviedb.org/3/', mode = 'search/movie', input, moviename, key = '?api_key=api key'; $('#search').click(function() { var input = $('#movie').val(), moviename = encodeuri(input); $.ajax({ url: url + mode + key + '&query='+movi

Haskell: Is it possible to create a list of Show types? List[Show]? -

is possible create list holds values belong show type ? this similar list[showable] in scala, showable trait. in way 1 put, example, int , string same list. is possible? if yes, how ? you can using existential types data showbox = forall s. show s => sb s heterolist :: [showbox] heterolist = [sb "hello world", sb 5, sb 1] the thing can items in list show them: let strings = fmap (\(sb b) -> show b) heterolist

security - How to restrict Chrome Apps to only work on specific computers? -

i'm developing pos client using chrome (packaged) apps. run locally on installed computers , interact server via web service. app should run on specific computers @ stores. i know can go each store , install .crx file in case don't have publish app chrome web store. however, want published chrome web store can take advantage of auto-updating feature. what should make sure app can run @ stores' computers? (i can go the stores , setup needed @ first installation). options have thought of: create secret key , enter app @ first time of running. build small tool (winforms application) generate time-based tokens , install on computers. staff need enter token each time opening app. any better idea how accomplish this? you said app needs talk web service work. that's key simple approach. (assume don't care whether staff acquires nonfunctional copy of client app.) at startup, app checks existence of validation of kind stored in chrome.storage.loc

php - Is there a set filter option in MySQL -

i have database 2 tables - users , messages. 2 tables have records multiple companies. have add companyno=$companyno queries e.g. select * users companyno=$_session['companyno'] and select * messages companyno=$_session['companyno'] is there way can set 'filter' in mysql companyno=$_session['companyno'] can ignore companyname=$_session['companyno'] sql queries and mysql automatically return records $_session['companyno'] you can create views in mysql each value of $_session['companyno'] company , query them according companyno=$_session['companyno'] . it's hack, not recommend :)

php - CodeIgniter how to sort joined record -

i have following query in codeigniter: $user = $this->db ->select('users.*, login_logs.ip_address, login_logs.date, login_logs.userid') ->from('db.users') ->join('db.login_logs', 'users.userid = login_logs.userid') ->group_by('users.userid') ->get() ->result_array(); it works have select last record each user( in login_logs table) i'm getting first record. have tried : ->order_by('login_logs.idlogin_logs', 'desc') but didn't work. i have no idea how it. there easy way reach it? @edit i have triend asc/desc. no changes. present query: select `users`.*, `login_logs`.`ip_address`, `login_logs`.`date`, `login_logs`.`userid` `db`.`users` join `db`.`login_logs` on `users`.`userid` = `login_logs`.`userid` group `users`.`userid`

C++ Class and virtual method -

i having 2 problem virtual methods. first: class parent { public: virtual void show(int x = 5) { cout << "parent " << x << endl; } }; class child : public parent { public: virtual void show(int y = 10) { cout << "child " << y << endl; } }; int main() { child y; parent* p = &y; p->show(); getch(); return 0; } i think tt should child 10 result child 5 and another: class parent { public: virtual void show() { cout << "parent" << endl; } }; class child : public parent { private: virtual void show() { cout << "child" << endl; } }; int main() { child y; parent* p = &y; p->show(); getch(); return 0; } it'll show child on screen. don't know how private method called outside? thank you. i'm learning english so.. :) 1) c++ standard says a virtual function call (1

javascript - Replacing original EventEmitter with custom one -

consider want use eventemitter2 , or implementation of eventemitter of own. however, if eventemitter = myeventemitter , helps explicit inheritance happens after declaration, won't change existing objects inheriting builtin eventemitter , , limited scope of module. can take advantage of alternative eventemitter s when using builtin objects? can think of descending prototype chain of particular object, , if prototype appears instance of eventemitter , replace own, isn't there more elegant way?

sql server - SQL: Referencing calculated columns in other parts of the query -

i following in sql server 2012: select unitprice * quantity subtotal, subtotal * (1-0.13) tax, tax + subtotal total invoice as far know, not possible written above, wondering if there special way of identifying column on fly referenced elsewhere in query such "field list" (part of select clause), part of clause or in order clause. any appreciated. you can calculations in cross apply . select t1.subtotal, t2.tax, t2.tax + t1.subtotal total invoice cross apply (select i.unitprice * i.quantity) t1(subtotal) cross apply (select t1.subtotal * (1 - 0.13)) t2(tax) sql fiddle

regex - change words for others in a list of equivalents without losing format -

having input folder, , output folder , list of equivalents folder. where can start research, in order if have word in list document inside input folder, it's equivalent list of equivalents, , make replacement , produce txt output, using utf8 in documents. if have list of equivalents: bovine = cattle cancrine = crab canine = dog cervine = deer corvine = crow equine = horse elapine = snake and have input document this: bovine cancrine canine cervine equine text1 text2 elapine. i want in output file: cattle crab dog deer [text1] [text2] snake text1 , text2 in square brackets since not in list of equivalents. but able of changing word if followed coma or other punctuation marks. example , input this: bovine! cancrine, ,canine# cervine% $equine text1, text2,,, elapine...... should return: cattle! crab, ,dog# deer% $horse [text1], [text2[,,, snake...... using perl script, please. should not programmer, 1 friend of mine made program me years ago, couple of

wordpress - jQuery Expandable Collapsible Div Not Working -

i'm trying create expandible div @ bottom of page of test site http://witthotel.perfectlysimple.org/about/ . line should expand "click here display content" the html code of div follows: <div id="footer-bottom"> <p class="expand-one"> <a href="#">click here display content</a> <img src="images/arrow.png" width="5" height="7" /> </p> <div class="content-one"> <p>this content</p> <p> hidden before, is... well, visible!"</p> </div> </div> i have following script in header running: <script> $(document).ready(function(){ $('.expand-one').click(function(){ $('.content-one').slidetoggle('slow'); }); }); </script> as can see, it's wordpress site, should load jquery, left reference out. <script src="http://ajax.googleapis.co

wordpress if statement error not inserting php code required -

i "trying" work on wordpress site coming against issue if/else statement. below code: <?php if(is_page(9)): 'get_new_royalslider(1)'; else: echo '<p>other content</p>'; endif; ?> i trying insert php code given royalslide . doing part right ? can else content load in other pages part working. thanks changing code to <?php if(is_page(9)): echo get_new_royalslider(1); else: echo '<p>other content</p>'; endif; ?> or <?php if(is_page(9)): echo do_shortcode('[new_royalslider id="1"]'); else: echo '<p>other content</p>'; endif; ?> should fix problem. either way should work you.

matlab - Reindexing some values in a vector -

i have vector of size 40000 values like 12312345 4564 122356 3455 34566 there 200 unique values in vector. want replace these big values numbers 1:200 such smallest vector value replaced 1, next smallest 2 , on 200. how can in matlab? the third output of unique you! [~,~,newvector]=unique(vector)

c - Searching for \n\n in a returned message -

i'm writing program emulating linux command, return msg contains file , header separated \n\n inside message. thing i'm not sure how search returned string , find message, because \n signifies string has ended. if can lead me on correct path awesome. in c, assuming talking 0 terminated strings (the norm), \0 (i.e. nul character, i.e. zero) indicates string has ended, not \n . you can search 2 \n using strstr function. man page: #include <string.h> char *strstr(const char *haystack, const char *needle); so like: char *found; found = strstr (string_to_search, "\n\n");

javascript - Determine Condition Using JScript -

guys how can have maximum of 3 checkbox page? currently,i have 6 checkbox..if tick 6 boxes...3 tables displayed on top , 3 displayed bottom.however want have 3 maximum tables appeared. therefore,i thinking have check condition (1)if 1 check box ticked only.it notify user minimum of 2 tables must checked make comparison.-done (2)if more 3 tables selected.it notify user not proceed , not bring tables.-need here <!doc html> <html> <title></title> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('input[type="submit"]').click(function () { if($('input[name=option]:checked').length >1) { $('.frame-wrapper').fadeout(); $('input[name=option]').each(function() { if ($(this).pro

Warning: mkdir() [function.mkdir]: No such file or directory PHP? -

i getting error when trying use mkdir() function in php. basically creating sundomain on server based on input field in html form named ( input ). now trying create directory in subdomain after has been created. so use following code : $subdomain= $_post['input']; mkdir("$subdomain.mydoamin.com/newdirectory", 0755); but following error: warning: mkdir() [function.mkdir]: no such file or directory in line 99. and on line 99 this: mkdir("$subdomain.mydoamin.com/newdirectory", 0755); as note: subdomain gets created successfully. know subdomain 100% exist on server. don't know why error! could please advise on issue? thanks in advance. try put third parameter. method signature is: bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] ) so code be: mkdir(__dir__ . "/$subdomain.mydoamin.com/newdirectory", 0755, true);

Google Relatime API stops responding after computer wakes up from sleep mode -

easy reproduce: go https://realtime-cube.appspot.com start new game open second tab same game make sure both tabs realtime connected upon change. now, put computer (in case mac osx) in sleep mode 4 seconds (in case close , re-open it). go game tabs , make change the tabs not sync each other. changes not saved in document. errors not thrown during save operation. any explanation? should reload document @ point? how should catch situation?

jQuery click event just for touch, for all others hover -

i tried modify jquery code, use "hover" event on default desktop devices , take "click" function on touch devices. reason, there better usability separating them. i posted whole code in fiddle: http://jsfiddle.net/syzc6/ $(document).ready(function(e){ $("header").hover(function() { if ($('#expandmenu').is(':visible')) { $('#menubar').removeclass('menu-active'); $('#switcher').removeclasse'switcheropen'); } else { $('#menubar').addclass('menu-active'); $('#switcher').addclass('switcheropen'); } $('#expandmenu').slidetoggle( "fast"); }); }); maybe there solution, have done before:

performance - Detecting cause of java app freezing -

we have problem our java application. (once per several month) app pauses 2-5 seconds. notice loss of heartbeats set of our network clients. , app log don't have records during freeze time span. gc logs don't show cause of application freeze 5! seconds. brief application profile: solaris solaris zones java 1.6 about 50 incoming , outgoing network connections (lbm on tcp/ip , udp, jms , jmx/rmi on tcp/ip), 3gb memory, about 100+ threads could suggest tools/approaches allow identify root cause.

algorithm - heuristic function for shortest path -

Image
i want find shortest path (between 2 red circles) lowest cost (numbers in squares cost in each step). in following picture a* method can solve problem don't have idea promising heuristic function. can gives me heuristic function? since there's 0, , didn't state restrictions on distribution, presumably there can number of 0s, potentially cost reach target given point can 0, thus, admissible heuristic , without looking around, can use h(x) = 0 , dijkstra's algorithm . a slightly better, still not good, heuristic take minimum of surrounding cells. anything else can think of either take long useful, or not guarantee getting target. you can consider running dijkstra's algorithm both points @ same time, you'll have clever when stop. if you're going run multiple shortest path calculations on same grid, consider preprocessing grid determine lowest cost path consisting of n nodes, use in heuristic, based on manhattan distance . for

SSL WebServer Qt -

i've modified code in incomingconnection, when connect browser on _https://localhost:8080, server not connect...shows error message: qsslsocket::startserverencryption: cannot start handshake on non-plain connection i create certificate console these commands: $openssl genrsa -des3 -out server.key 4096 $openssl req -new -key server.key -out server.csr $openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt $openssl rsa -in server.key -out server.key.insecure server.cpp #include <qtnetwork> #include <qmessagebox> #include "server.h" server::server(qobject *parent) : qtcpserver(parent) { server_socket.setprotocol(qssl::sslv3); qbytearray key; qbytearray cert; qfile file_key("server.key"); if(file_key.open(qiodevice::readonly)) { key = file_key.readall(); file_key.close(); } else { qdebug() << file_key.errorstring(); } qfile file

JavaScript + JSON -

i got json format dataset in file data.json : { "timestamp": "wed apr 02 2014, 19:03:19", "test": [ 441.02, null, null, 460.99, 485.91, 501.0, null, null, null, null ], "test1": [ 437.0, null, null, 464.989, 488.52, 499.996, null, null, null, null ] } and need push values array[] in javascript like: var test = [441.02, null, null, 460.99, 485.91, 501.0, null, null, null, null] var test1 = [437.0, null, null, 464.989, 488.52, 499.996, null, null, null, null] can point me in right direction? i'm javascript newbie. first, must load json , parse using json.parse() : var xmlhttp = new xmlhttprequest(), me = this, test = null, test1 = null; // note: change data.json json file xmlhttp.open('get', 'data.json', tr

Joomla 2.5 displaying data /multiple rows in view -

i'm new joomla development. after having managed directly list database multiple rows directly conttroller, i'm trying display using views, have error message : controller : function display($cachable = false, $urlparams = false) { // affichage de la liste des tournois $db=jfactory::getdbo(); $sql="select * #__tournois_tournois"; //echo $sql; $db->setquery($sql); $db->query(); $items=$db->loadobjectlist(); // set default view if not set $input = jfactory::getapplication()->input; $input->set('view', $input->getcmd('view', 'tournois')); // call parent behavior parent::display($cachable); in view : function display($tpl = null) { // data model $items = $this->get('items'); // check errors. if (count($errors = $this->get('errors'))) { jerror::raiseerror(500, implode('<br />

php - How grab filename from url? -

i write simple script vip user php. need change many (+4000) links format compilable script. i need grab file name url's. url e.x dw.example.com/download.php?d=blabla/blabla/2014/test.zip url e.x dw.example.com/download.php?d=blabla/blabla/test.zip the big problem files not in same path (directory), try use .htaccess rewrite url's dw.example.com/download.php?d=blabla/blabla&f=test.zip it's not work. is there way resolve problem .htaccsess? if not, how can file name url type: url e.x dw.example.com/download.php?d=blabla/blabla/2014/test.zip thanks bor691 array_pop(explode('/',$url)) can grab file name.

java - JPA and Derby Performance -

Image
i wrote application using jpa. application makes around 5 or 6 inserts per second on 1 table. insert done simple transaction begin, persist , transaction commit. with approach application has heavy cpu load (around 80%). using jvisualvm profiled application , came result: this shows around 30% percent of time spent in writing , flushing log files. setexclusive method has load of 14% of time. is there way optimize this? maybe disabling logging? enterbios right. disable logging , don’t have database anymore, sql writing files (bye bye acid). databases do, derby uses group commit, i.e. log multiple transactions grouped in single disk write. if single update, commit, wait , insert the group commit have little effect there log single insert write. the setexclusive time points contention same data (multiple threads accessing same database page).

How to convert image file to svg format with path attributes? -

i want convert image files .svg format. used bunch of tools out there gave format <svg ... > <image xlink:href="data:image/png;base64,ivborw0kggoaaaansuheugaaat .... but want have svg file path attributes. recommendation great help. not programming question, quick answer inkscape, has function called 'trace bitmap' turn raster image such png mention paths.

python 2.7 - Why Does it say "Bad Input"? -

this question exact duplicate of: bad imput needed badly [closed] print "this find area or perimeter of rectangle or triangle?" print "do want find area or perimeter of rectangle(r) or triangle(t)?" l= raw_input("i want find area or perimeter of ") if l=='r': print "do want find area(a) or perimeter(p) of rectangle?" a= raw_input(" want find ") if a=='p': print "what length of rectangle?" b = int(raw_input("the length of rectangle ")) print "what width of rectangle?" c = int(raw_input("the width of rectangle ")) d = (2 * b) + (2 * c) print d elif a=='a': print "got it. length of rectangle?" x = int(raw_input("the length of rectangle ")) print "what width of rectangle?" y = int(raw_input

linux - Jenkins build tar error -

i'm having build problem jenkins, has been working several months without problems, says: tar: error exit delayed previous errors build step 'execute shell' marked build failure checking console output finished: failure i tried put more verbose build, still same error occurs. have looked shell logs , found same error in there, matched old build logs 1 , cannot find several errors this. there's plenty of disk space left, raised open files, problem stays same. could newly added class files kind of problem? --bp

c# - MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3243,9): error MSB4094 -

after open vs ultimate 2012 c# solution in vs ultimate 2013 12.0.21005.1rel following warning: warning 1 found conflicts between different versions of same dependent assembly. please set "autogeneratebindingredirects" property true in project file. more information, see http://go.microsoft.com/fwlink/?linkid=294190 . energyms i follow microsoft link instructions. edited csproj file, adding following line: <autogeneratebindingredirects>true</autogeneratebindingredirects> when build solution again, following error: error list "app.config;obj\x86\debug\energyms.csproj.energyms.exe.config" invalid value "configfile" parameter of "generateapplicationmanifest" task. multiple items cannot passed parameter of type "microsoft.build.framework.itaskitem". energyms output window: c:\program files (x86)\msbuild\12.0\bin\microsoft.common.currentversion.targets(3243,9): error msb4094: &qu

virtualbox - Connect to Vagrant machine with SSH and custom user -

here problem. after vagrant up in ubuntu 12.04 box, create custom user: sudo useradd -m user_name and add same groups vagrant user. after that, try login ssh can't find way. generate ssh key pair ssh-keygen , , set following option in vagrantfile : config.ssh.username = "user_name" so doing vagrant ssh allows me enter user password , log in user, not directly ssh key pair. think have set config variable: config.ssh.private_key_path = "" but don't know how... path set , place public , private keys. more conceptual problem ssh vagrant, i've been hours, hint? thanks please refer answer here: ssh onto vagrant box different username to troubleshoot: make sure user has login shell grep user_name /etc/passwd | cut -d : -f 7 i haven't tried config.ssh parameters should able test ssh login using ssh -p 2222 user_name@localhost or (on linux) ssh -p 2222 -i /opt/vagrant/embedded/gems/gems/vagrant-1.5.2/keys/vagrant.pub

How do I return a modified vector in c++? -

why (return a;) not work? error "no user-defined-conversion operator available can perform conversion, or operator cannot called." how return newly sorted vector? int sort(vector <int> a, int n) { if( n >= 2 && n <= 43) { //sort vector for(int j=2; j<=n; j++) { int tmp = a[j]; int = j-1; while (-1<i && tmp < a[i]) { a[i+1] = a[i]; i--; } a[i+1] = tmp; } } return a; } you can go 1 of following 2 ways solve problem: 1) change return type of function vector vector<int> sort(vector <int> a, int n){ // body of function } 2) pass reference vector parameter. affect function prototype follows int sort(vector <int> &a, int n){ // body of function }

why java compiles but not run? -

so made program creates list of ships , creates menu can insert details of ships (such name, length, etc.). class testvessel { public static void main(string args[]) { string name,idioktname,skafos,temp1; double length,width,ektopisma,maxspeed,max,ektop; int etos,epilogh,size=0,thesi,i=0,o,a,year; boolean shmaia=false,flag; vessel[] skafoi=new vessel[10]; for(;shmaia;) { system.out.println("lista epilogwn"); system.out.println("1.eisagwgh stoixeiwn skafous"); system.out.println("2.emfanish stoixeiwn skafous"); system.out.println("3.emfanish oloklhrou tou pinaka"); system.out.println("4.telos"); system.out.println("dwste epilogh(1-4):"); epilogh=userinput.getinteger(); if(epilogh==4)shmaia=true; switch(epilogh)

python - Passing arguments in {% url %} in Django -

i've template: <ul> {% url1 in urls %} <li><a href="{% url 'disp' url1.url_name %}">{{ url1.url_title }}</a></li> {% endfor %} </ul> i'm trying pass url (i.e. url1.url_name) view ('disp') it's not taking it. it's giving following error: reverse 'disp' arguments '(u'file:///e:/beproject/websites_collection/katewinslet.html',)' , keyword arguments '{}' not found. 1 pattern(s) tried: ['display/(?p<webpage>[^/]+)/$'] where 'file:///e:/beproject/websites_collection/katewinslet.html' instance of url1. i've no idea doing wrong. problem seems present in regex part of code (i think) don't know how solve it. please help. as error says, 'url1.url_name' contains nothing (i.e. keyword arguments '{}'). check , see why it's empty.

android - Captured Image is not stored in a specified path? -

i making 1 app click images , save them in specified folder in external storage. please follow code below. capturesignature.java package com.capturesignatureactivity; import java.io.file; import java.io.fileoutputstream; import java.util.calendar; import android.app.activity; import android.content.context; import android.content.contextwrapper; import android.content.intent; import android.graphics.bitmap; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.path; import android.graphics.rectf; import android.os.bundle; import android.os.environment; import android.provider.mediastore.images; import android.util.attributeset; import android.util.log; import android.view.gravity; import android.view.motionevent; import android.view.view; import android.view.view.onclicklistener; import android.view.viewgroup.layoutparams; import android.view.window; imp