Posts

Showing posts from September, 2014

swing - Java- TitledBorder in gridbag layout expanding as the window expands -

Image
i making form using gridbag layout has titled border. first titledborder panel customer details works fine except know how add spacing between first title , textfield (eg first name) , following title , textfield (eg last name) below it. the problem second panel room details expands enlarge/expand window , happens, components inside shift. remain fixed components in first panel . this form.java class: public class form extends jframe{ jpanel pnl= new jpanel(); jpanel pnl1= new jpanel(); jlabel fname= new jlabel("first name: "); jlabel lname= new jlabel("last name: "); jlabel contact= new jlabel("contact number: "); jlabel email= new jlabel("email address: "); jlabel address= new jlabel("address: "); jlabel numpsns= new jlabel("number of persons: "); jtextfield fnamefield= new jtextfield(25); jtextfield lnamefield= new jtextfield(25); jtextfield contactfield= new jtextfield(25); jtextfield emailfield= new jtextf

java - My conversion from decimal to binary can't deal with negative numbers -

i converting decimal binary , code works on positive numbers crashes when try convert negative numbers. when crashes error exception in thread "main" java.lang.stackoverflowerror my code being called loop in main runs -8 +7. code conversion public char[] decimaltobinary(int value) { int remainder; char[] result = new char[10]; if (value <= 0) { return result; } remainder = value %2; decimaltobinary(value >> 1); system.out.print(remainder); return result; } this loop in main calls above method int min = -8; int max = +7; (int = min; <= max; ++i) { char[] binarystr = s.decimaltobinary(i); } the example below working code based on logic: public static void decimaltobinary(int value) { int remainder; if (value == 0) { return; } remainder = value % 2; decimaltobinary(value >>> 1); system.out.print(remainder); } you should take

Difference between IMessage, ICommand in NServiceBus? -

in nservicebus have different message type imessage, icommand, ievent communicate between system. difference between imessage, icommand,ievent? business scenario should use these types? thanks as explained in documentation : message unit of communication nservicebus, there 2 types of messages: command used 1 or more senders ask specific action specific receiver. no broadcasting supported. event used single sender notify many receivers action has taken place.

aix - ld: Csects with symbol numbers 337 and 321 overlap -

i getting following error ld: ld -o /tmp/cobpmh7ma/a.out -brtl -g -e -be:/tmp/cobpmh7ma/preservefile myprog.o -lcfg -lodm -lg -be:/usr/lib/libg.exp -lc ld: 0711-552 severe error: object myprog.o: csects symbol numbers 337 , 321 overlap. i know how symbol names symbol numbers can @ source identify why these symbols overlapping. i going chop program down minimum causes link issue, rather identify symbols , go straight problem. i have tried looking @ output of nm , nm options , have not found useful. this aix 6.1.

c++ - QT5/QSql bindValue query doesn't work -

i have query made qsql query.prepare("select id,title,content posts order :field :order limit :limit offset :offset"); query.bindvalue(":field",qvariant(field)); query.bindvalue(":order",order); query.bindvalue(":limit",limit); query.bindvalue(":offset",offset); i use order value "desc" doesn't work properly. , when query.prepare("select id,title,content posts order "+field+" "+order+" limit :limit offset :offset"); query.bindvalue(":limit",limit); query.bindvalue(":offset",offset); it works fine , don't know why. values of same type ( qstring , int ). suggestions ? thanks.

sql command for modify a column to have 2 digits after decimal point -

what sql command modify column have 2 digits after decimal point? not casting when display. you want decimal data type. each database has own documentation this. the declaration decimal(8, 2) , instance. need specify both scale , precision.

python - How to do the last three steps in a Django allauth post-installation? -

i saw else had issue @ same part on year ago, no answer found. i don't know these last 3 steps need of me. add site domain, matching settings.site_id (django.contrib.sites app). for each oauth based provider, add social app (socialaccount app). fill in site , oauth app credentials obtained provider. here questions: what site need add? i'm in development, , have no domain name, use local http://127.0.0.1:8000/ second part asks for: (i don't know enter of these) user provider uid third part asks for: provider, drop down ones added installed apps (that shows up) client id (where google / facebook) secret key (where google / facebook) asks me add site (the 1 don't know info add in first step) i looked other instructions, or guides, didn't find useful. i using django 1.9 , python 3.5. if memory serves, django-allauth , python social auth similar enough should still useful for hostname, can 1 of 2 things: use

c# - DateTimePicker value from DataGridView -

i have textboxes , datetimepicker. there datagridview on it. upload data mysql table. want modify data via textboxes , datetimepicker, error: system.argumentoutofrangeexception on datetimepicker.value row: private void datagridview1_selectionchanged(object sender, eventargs e) { datetimepicker1.value = convert.todatetime(datagridview1.selectedrows[0].cells[1].value); idotextbox.text = datagridview1.selectedrows[0].cells[2].value.tostring(); pkcombobox.text = datagridview1.selectedrows[0].cells[3].value.tostring(); minositesbox.text = datagridview1.selectedrows[0].cells[4].value.tostring(); esetextbox.text = datagridview1.selectedrows[0].cells[5].value.tostring(); fotextbox.text = datagridview1.selectedrows[0].cells[6].value.tostring(); megjegyzestextbox.text = datagridview1.selectedrows[0].cells[7].value.tostring(); } what did wrong? you don't have row selected, cell. make sure have correct selectionmode property set: datagridview1.selec

parse.com - Swift - How to download & display comments under post? -

Image
i have managed setup commenting system app (using parse). , far have button click, redirects me new tvc when displays comments , have option write new one. what achieve now, i'm getting slighty confused, display latest 3 comments below image (instagram or more social networks nowadays)...i'm not sure how approach , how have them repeating or displaying 3 below post?! i have set in storyboard (image below), playing around hoping figure out! buttons username, , label comment. if can me or put me in correct direction (or link previous question, haven't managed find any) great! possibly little explanation of how maybe instagram it?! best regards. you can create view controller, similar logic tvc (it same controller in designed system, open door sweet comment animations), each cell in table view has instance of controller subview add. each of view controller instances added main controller child view controller. so, main vc has array of 'tvc' ins

Sorting between signed and unsigned zeros c++ -

i have able sort negative zeros , zeros assignment doing @ university using c++, tell me why following code produce negative zero? i'm stuck , not sure why works... cout << "enter number of elements want add vector:\n"; cin >> x; cout << "enter integers: \n" << endl; (int = 0; < x; i++) { cin >> y; y = y - 0.0; cout << y; array.push_back(y); } if there better way of producing negative 0 when sorting above vector please advise. many thanks! first of all, there need not negative zeroes in standard c++, assume talking negative 0 ieee-754, (i never encountered exception) c++ implementations base floating point math on. in case, expression y = y - 0.0; will yield -0.0 if either y == -0.0 before assignment or if set rounding mode "round towards -infinity" , won't. to produce double value -0.0 , can assign desired value: dou

security - How to edit user permissions for AWS RDS -

my previous post here ( mysqli_query() returns "table doesn't exist" known table - permissions issue? ) explains details of how arrived @ issue. i convinced username , password set while creating db instance have not been given appropriate permissions allow me edit contents of own database. this extremely frustrating, if has tips or tricks on how modify these permissions appreciate it. to clarify, permissions set via ec2 security groups, , result cannot see username , password created when made database, doesn't appear can set permissions differently, or edit policies. thanks bunch. alex so went previous question see doing. database named mysql system database. not place create tables. in fact permissions database restricted can break mysql and/or rds automation. you need create new database tables. while not super user access within rds, full access databases set up. system databases going restricted. security groups manage connectivity rds

angularjs - Angular GET Request Stuck in Cycle -

i trying use angular make request api made retrieves , manipulates data in postgres database. have 2 running copies of website, 1 uses mongo. problem code below runs fine on server using mongo reason postgres 1 experiencing trouble. when use rest client test api, both versions work (mongo , postgres), leading me believe api not problem. however, main page contains angular controller makes , post requests api. said, time loop happens on server postgres. here controller in question: (function() { var postctrl = function ($http, $scope, $log, $location) { $scope.getposts = function() { $http.get("api/posts") .then(function(response) { $scope.posts = response.data; }); } $scope.addpost = function(title, content, image) { $http.post("api/posts", {title: title, content: content, image: image}) .error(function(data) { consol

java - How to fill in [x]% of a 2d array with the values of another array -

i have 2 two-dimensional arrays, 1 filled , 1 filled, both of same size (n x m). need fill in [some random]% of second array exact same values first array. let's say int[][] arr1 = new int[][] {{0, 1, 0, 1}, {1, 0, 1, 0}, {0, 0, 1, 1}, {1, 1, 0, 0}}; i want arr2 filled 25% of arr1's values in same spot other spots remaining null.. int[][] arr2 = new int[4][4]; // arr2 = {{0,1,0,1}, // { , , , }, // { , , , }, // { , , , }} eventually, program call on user fill in missing values, can do, reason part seems not want work me. school assignment , teacher isn't being helpful answering questions. here's code: noting (variable names in french..) nbcases = total number of elements in 2d array nbaremplir = number of elements in 2nd array have values assigned them (based on nbcases * nbpourc nbp

php - $zip->addFile on my Server doesn't create folders but only file path -

usually following script create , fill zip archive works properly, both on localhost , on other servers: $zip = new ziparchive(); $zip->open($filename, ziparchive::create); foreach( $pathtoassets $npath ) { $files = new recursiveiteratoriterator( new recursivedirectoryiterator( $npath ), recursiveiteratoriterator::leaves_only ); foreach ($files $name => $file) { if( $file->getfilename() != '.' && $file->getfilename() != '..' ) { $filepath = $file->getrealpath(); $temp = explode("/", $name); array_shift( $temp ); $nname = implode("/", $temp); $zip->addfile($filepath, $nname); } } } $zip->close() but in new server script instead of creating folders, subfolders , files, creates files name "folder\subfolder\file.extension" for example: instead of creating css folder bootstrap subfolder contains

typoscript - Create a new link stye in Typo3? -

is there way add new style insert link dialog in typo3? "internal-link", "internal-link-new-window", or no style. i have tried putting various things in page tsconfig no results @ all... i found on site looks want can't anything: rte.classesanchor { tollerlink1 { class = button type = page titletext = button } } rte.default { classesanchor:=addtolist(button) } in tsconfig (home page properties - resources - page tsconfig) rte.default.buttons { link.properties.class.allowedclasses := addtolist(internal-link-new-window) }

sql - how would i get it to show me records in one table that arent present in another table using an EQUI JOIN? -

select c.customerno, name, telephone, address, postcode customer c, carforsale s not (c.customerno=s.customerno); so i'm meant produce output shows customers not have record in car sale table. thought of putting in not in clause essentialy bring ones arent there it's bringing whole table back. a simple rule: never use commas in from clause. actually, there slight modification ms access, because not support cross join . so, use commas when intend cross join . you cannot want inner join . can use left join , still equi-join: select c.customerno, name, telephone, address, postcode customer c left join carforsale s on c.customerno = s.customerno s.customerno null; a left join keeps rows in first table, when on clause not true. where clause chooses rows have no match.

java - Maze---> return the maximum sum -

i need find path in stings maze. in maze there numbers can get, , x represents closed position. output must path maximum sum. i can find path, problem doesn't return maximum sum path. right i'm using 4 recursive calls: 1 left, 1 right, 1 , 1 down. i'm not using backtracking nor considering positions of numbers. this code got far: public static boolean verifica(char [][] t, int lin, int col){ try{ if(t[lin][col] == livre){ return true; }else if(t[lin][col]=='1'){ return true; }else if(t[lin][col]=='2'){ return true; }else if(t[lin][col]=='3'){ return true; }else if(t[lin][col]=='4'){ return true; }else if(t[lin][col]=='5'){ return true; }else if(t[lin][col]=='6'){ return true; }else if(t[lin][col]=='7'){ return true; }else if(t[lin][col]==&#

applescript - Mac Copy directory to any directory created in another directory -

so have directory users copy folders into. i'd setup automated way of copying predefined directory folder added original root folder. to explain mean: i have root folder /root . users can copy folder /root . when do, i'd copy /addins/images folder /root/<user created folder>/ directory automatically. result should /root/<user created folder>/images - including sub directories , files in /addins/images folder. i've heard automator might able such thing have no idea how use it. any/all appreciated. you can automator or applescript, using action folder. the applescript bellow copy folder images (located in addins) new folder added myroot folder. on adding folder items myroot after receiving filelist set addins posix path of "users:your_path:addins:images" set folderkind "folder" -- value depends of system language tell application "finder" -- loop on each item aded folder repeat one_item in filelist if (k

PHP for loop within for loop with different incrimenting values -

i new php , loops apologize if simple solution having trouble racking brain around math this. trying write loop create array 49 items. items have 2 incrimenting values within them. 49 items below: m1s1t1url m1s1t2url m1s1t3url m1s1t4url m1s1t5url m1s1t6url m1s1t7url m1s2t1url m1s2t2url m1s2t3url m1s2t4url m1s2t5url m1s2t6url m1s2t7url m1s3t1url m1s3t2url m1s3t3url m1s3t4url m1s3t5url m1s3t6url m1s3t7url m1s4t1url m1s4t2url m1s4t3url m1s4t4url m1s4t5url m1s4t6url m1s4t7url m1s5t1url m1s5t2url m1s5t3url m1s5t4url m1s5t5url m1s5t6url m1s5t7url m1s6t1url m1s6t2url m1s6t3url m1s6t4url m1s6t5url m1s6t6url m1s6t7url m1s7t1url m1s7t2url m1s7t3url m1s7t4url m1s7t5url m1s7t6url m1s7t7url as can see there 3 numbers in each item. first number constant. second number counts 7 resets 1. third number adds 1 every time second number resets 1. here have below know off on calculations. appreciated. ($i = 1; $i < 8; $i = $i + 1) { ($u = 1; $u < 8; $u = $u + 1) {

chart.js - I'm new to node.js, and I'm working on getting a pie chart working -

i'm trying pie chart. however, isn't working well. page blank. i'm using node.js. have chart.js installed though npm. run html on ejs file, , blank page. <code> <html> <head> <script src="../node_modules/chart.js/chart.min.js"></script> </head> <body> <canvas id="mychart" width="600" height="400"></canvas> <script> var data = [ { value: 300, color:"#f7464a", highlight: "#ff5a5e", label: "red" }, { value: 50, color: "#46bfbd", highlight: "#5ad3d1", label: "green" }, { value: 100, color: "#fdb45

java - Main seems to skip over one of my methods -

apologies posting bit of foolish question, cant seem understand why method startendcoords not seem run through main method here: import java.util.scanner; import java.io.file; import java.io.filenotfoundexception; public class mazesolver { // name of file describing maze static string mazefile; // set global variables static int arrayheight; static int arraywidth; static int startrow; static int startcolumn; static int endrow; static int endcolumn; static int cellsize; static int borderwidth; static int sleeptime; static char [][] maze; public static void main(string[] args) throws filenotfoundexception { if (handlearguments(args)) { maze = readmazefile(args[0]); startendcoords(maze); if (solvemaze(startrow, startcolumn)) system.out.println("solved!"); else system.out.println("maze has no solution."); } } // starting & ending points static boolean startendcoords(char[][] mazeasarray){

c - Understanding fork() in linux -

i have following code void main() { pid_t pid,pid1; pid = fork(); if(pid==0) { pid1= getpid(); printf("\n child %d" ,pid); printf("\n child b %d",pid1); } else { pid1 = getpid(); printf("\n parent c %d:",pid); printf("\nparent d %d:",pid1); } } i not understanding why getting same process id b , c. can me here? pid1 = getpid(); that run in child process , hence gives child process id. pid = fork(); that initiated parent process return value available both parent , child. however, returns different value parent , child processes. straight fork man page : the pid of child process returned in parent, , 0 returned in child so in both cases (b , c), pid of child process.

powershell - Transform a NoteProperty and computed column object into a string -

Image
i want import file infos , md5 hash in sql server table using write-objecttosql module. i'm trying in 1 line if possible. here's have: gci -file|select directory,name,extension,length,creationtime,lastaccesstime,lastwritetime,@{name='md5'; expression={get-filehash $_ -algorithm md5|select hash}}|write-objecttosql -server abc -database pdoc -tablename files and here's in sql server: i don't md5 column nor directory column. here's th get-member info: ps c:\users\pollusb> gci -file|select directory,name,extension,length,@{name='md5'; expression={get-filehash $_ -algorithm md5|select hash}}|gm typename: selected.system.io.fileinfo name membertype definition ---- ---------- ---------- equals method bool equals(system.object obj) gethashcode method int gethashcode() gettype method type gettype() tostring method string tostring() directory noteproperty directoryinfo directory=c:\use

logic - coq how to use apply to "extract" a implication -

sorry weird title, not know how put in words. i'll illustrate using example. h : r -> p -> q h0 : r subgoal: (q -> p) \ / (p -> q) so question how extract out (p->q). have r already, when 'apply h in h0', evaluates , gives me q. any appreciated since started using coq. you can of: specialize (h h0). to replace h h: p -> q , or: pose proof (h h0) h1 to introduce h1: p -> q you can go forward: right. exact (h h0).

php - MySQL rollup with Pearson's R -

i'm using mysql & php calculate pearson's r measuring relationship on number of years between political donations , tenders received particular business. i've run trouble mysql query feeding values algorithm. algorithm fine , evaluates correctly. problem in query used data. the formula i'm using pearson's r @ http://www.statisticshowto.com/how-to-compute-pearsons-correlation-coefficients/ here basic mysql query spits out values each year: select count( distinct year) count,name,sum(donations), sum(tenders), sum(donations * tenders) xy,(sum(donations)*sum(donations)) x2, (sum(tenders)*sum(tenders)) y2 money_by_year name='$name' group name,year here query rollup final values: select count( distinct year) count,name,sum(donations), sum(tenders), sum(donations * tenders) xy,(sum(donations)*sum(donations)) x2, (sum(tenders)*sum(tenders)) y2 money_by_year name='$name' group name rollup limit 1 the problem totals second query wrong i

c++ - Command Line Argument Truncated by CreateprocessW -

vs10, mbcs, unicode preprocessor defs. having gone through dr google's casebook, best here , doesn't quite address particular problem. consider code thisexepath path executable: cmdlinearg = (wchar_t *)calloc(biggerthanmaxpath, sizeof(wchar_t)); wcscpy_s (cmdlinearg, maxpathfolder, l"\\\\??\\c:\\my directory\\my directory\\"); createprocessw (thisexepath, cmdlinearg, null, null, false, null, null, null, &lpstartupinfo, &lpprocessinfo) when program called int winapi wwinmain(hinstance hinstance, hinstance hprevinstance, lpwstr lpcmdline, int ncmdshow) { wchar_t hrtext[256]; swprintf_s(hrtext, sizeof(hrtext), l"%ls", lpcmdline); //deal possible buffer overflow later messageboxw(null, hrtext, l"display", mb_iconinformation); } hrtext displays "my directory\my directory\" obvious missed here? this not correct: wchar_t hrtext[256]; swprintf_s(hrtext, sizeof(hrtext), l"%ls", lpcmdline); the second para

mule - Exception Logging in Batch in Mulesoft -

Image
i have case, have log exception error in object in salesforce, have take payload (the record) error there. error here record level error , using batch process this. in screenshot there how processing exception. following xml <batch:step name="handlefailedrecords_accountsf-360" accept-policy="only_failures"> <set-payload value="#[getstepexceptions()]" doc:name="set payload"/> <foreach doc:name="for each" collection="#[payload.values()]"> <set-variable variablename="record_level_error" value="#[payload]" doc:name="record_level_error"/> <dw:transform-message doc:name="transform message" metadata:id="9c2e408a-f530-4ffd-a205-a787c8bc94b2"> <dw:set-payload><![cdata[%dw 1.0 %output application/java --- payload map { sf_object_type__c:

C#: Trying to invoke a method in a class -

i programming game. each level has class (level1, level2, etc) tells game objects set plus other stuff. each level shares interface ilevel. all objects in scene have access in ilevel, want call method exists in specific level class. for example: public class level1, ilevel { public int getanumber() { return 5; } } the calling class needs this: public class someobject { ilevel mylevel = new ilevel(); int x = ... // need call getanumber() without knowing object level1, level2, etc. } i believe need use invoke somehow, wasn't able work. read documentation on msdn still wasn't able work. thank help! here either u can use if condition is , as operators or make ilevel abstract class getnumber returning negative values default. public class someobject { ilevel mylevel = new ilevel(); int x = -1; if(mylevel level1) { x = (mylevel level1).getanumber(); } } or public abstract class ilevel { public virt

java - Traversing through a map with nested lists as values -

here map , string key (textfile) , value ( list of integers): aaa.txt : {(the=[11], put=[8], i'm=[1], by=[5], you,=[3, 7], the=[4, 10], key=[6, 9]} bbb.txt : {do.=[12], to=[6], i'm=[1], what=[9], you=[4, 10], want=[11], sure=[2]} ccc.txt : {just=[10], need=[7], you,=[6], it=[5], than=[3], it's=[1], the=[11]} i want print out in format: you, 3:7, , 6 as can see, want print above format "you," located in aaa.txt , ccc.txt not bbb.txt should printed out word you, 3:7, ,6 . if you not found in bbb.txt, isn't, should have you, 3:7, "space", 6 . space show word not present in second text file. just want print every word in map's value , keep. here map structure of what's above hashmap<string, hashmap<string, list<integer>>> coolmap = new hashmap<string,hashmap<string, list<integer>>>(); expected/wanted output 20, 4:20 ,15 , , 16:17 , 16 , you try iterating through each m

python - Plone : unbound prefix in configure.zcml -

i developing new add-on plone site result showing error in configure.zcml : unbound prefix. here writing zcml code : <configure xmlns="http://namespaces.zope.org/zope" xmlns:five="http://namespaces.zope.org/five" xmlns:i18n="http://namespaces.zope.org/i18n" i18n_domain="customer.reports"> <five:registerpackage package="." initialize=".initialize" /> <include package="plone.resource" file="meta.zcml"/> <plone:static directory="templates" type="reports" name="customer" /> </configure> unbound prefix error mentioned below. file "/plone/python-2.7/lib/python2.7/xml/sax/handler.py", line 38, in fatalerror raise exception zope.configuration.xmlconfig.zopexmlconfigurationerror: file "/plone/zinstance/parts/instance/etc/site.zcml", line 16.2-16.23 zopexmlconfigura

onclick - JQuery: Restore element content when clicked outside it -

there tons of questions on address issue of detecting clicks outside designated element. however, none of them seem serve purpose in scenario. here's function: function rateit(){ var cell = $('td.ratingcell'); cell.dblclick(function(e){ e.preventdefault(); var oldhtml = $(this).html();// restore when clicked outside cell var oldratingval = parsefloat($(this).find('span.ratingval:first').text(), 10); var oldratingcount = parsefloat($(this).find('span.ratingcount:first').text(), 10); var blanks = '<span id="5">☆</span><span id="4">☆</span><span id="3">☆</span><span id="2">☆</span><span id="1">☆</span>'; $(this).addclass('editablerating'); $(this).html("<span id='editrating'>" + blanks + "</span>"); var clickedstar = $(&#

How to update values of an entire column in a table with respect to values of a column in another table with foreign key : MYSQL -

i have table named hours_worked has 2 columns, employeeid(primary key) , worked_hours_for_a_month. have table salary, has 2 columns attributes employeeid(foreign key of hours_worked), salary. want update salary attribute column values hours_worked(worked_hours_of_a_month) * 150 matching employeeid hours_worked , salary tables. want update entire column in 1 strike. possible? update salary s left join hours_worked hw on hw.employeeid = s.employeeid set s.salary = hw.worked_hours_for_a_month*150 cheers :)

php - Alternative of using <br> in several lines -

this question has answer here: what alternative <br /> if want control height between lines? 6 answers i required copy , paste several codes in websites , can't it. way doing takes bit more time. there alternative in simpler way? need alternative inserting <br> in every lines. doing this: inserting <br> in every line. <br>$db = new mysqli("localhost", "root","","learndb"); <br>$stmt = $db->prepare("select * admin username = ?"); <br>$stmt->bind_param("s",$first); <br>$stmt->execute(); <br>$result=$stmt->get_result(); <br>$myrow=$result->fetch_assoc(); you can use \r\n in php echo. see post: php - how create newline character?

Creation of custom comparator for map in groovy -

i have class in groovy class whsdbfile { string name string path string svnurl string lastrevision string lastmessage string lastauthor } and map object def installfiles = [:] that filled in loop by whsdbfile dbfile = new whsdbfile() installfiles[svndiffstatus.getpath()] = dbfile now try sort custom comparator comparator<whsdbfile> whsdbfilecomparator = new comparator<whsdbfile>() { @override int compare(whsdbfile o1, whsdbfile o2) { if (filenameutils.getbasename(o1.name) > filenameutils.getbasename(o2.name)) { return 1 } else if (filenameutils.getbasename(o1.name) > filenameutils.getbasename(o2.name)) { return -1 } return 0 } } installfiles.sort(whsdbfilecomparator); but error java.lang.string cannot cast whsdbfile any idea how fix this? need use custom compara

informix - I have a query in java -

what parseint exactly? because second argument roll no. not parsed third argument marks , parsed . why so? a string cannot used int. parseint can convert string int. public class program { public static void main(string[] args) { string value = "1000"; // parse parseint: string can negative. int result = integer.parseint(value); system.out.println(result); system.out.println(result + 1);

c# - Response.end doesn't work -

i try download .xlsx documnent using response.end() , openxml. nothing happens. it's stuck in response.end() public void downloadstudents(int instituteid, int departmentid) { var memorystream = new memorystream(); using (var spreadsheetdocument = spreadsheetdocument.create(memorystream, spreadsheetdocumenttype.workbook)) { //some code foreach (var line in users) { // fill } spreadsheetdocument.workbookpart.workbook.save(); } var excelname = "title.xlsx"; response.clear(); response.cachecontrol = "private"; response.contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; response.addheader("content-type", "application/octet-stream"); response.appendheader("content-disposition",string.format("attachment; filename={0}; size={1}", excelname, memorystream.length)); response.b

symfony - How to upload an image using Sonata Media Bundle -

i working on project using symfony.i want use sonata media bundle,in order upload image. unfortunately don't knwo how use or how start. i havethis form : <form action="" method="post" class="filephotoform form-inline" role="form"> <div class="form-group"> <input type="button" class="btn btn-start-order browse" value="browse"> <input type="text" class="form-control file-name" readonly="readonly" placeholder="no file selected"> <input type="file" name="filephoto" id="filephoto" class="hidden file-upload"> </div><br/><br/> <button type="submit" class="btn btn-primary">s

wpf - Change BackGround Image of button for a few seconds only -

i have wpf app uses buttons (surprise) i have styled when user clicks on button background image changed red color. what want happen after few seconds background reverts original background. i not sure how this. this code far: <style x:key="roundbuttontemplate" targettype="button"> <setter property="template"> <setter.value> <controltemplate targettype="button"> <border cornerradius="5" background="{templatebinding background}" borderthickness="1"> <contentpresenter horizontalalignment="center" verticalalignment="center"> </contentpresenter> </border> <controltemplate.triggers> <trigger property="isfocused"