Posts

java - Swing: How do i create an east hugging component that will not move over western components -

i've tried several ways render correctly. want logo area hug east window resized, not overlap western components. following code not hug east, think makes sense because the logoarea box not know should take rest of horizontal space. if add logoarea directly 'area' hugs east, overlap western components if window shrinks much. ideas? box box = box.createhorizontalbox(); box.add( main ); for( jcomponent item : items ) //western stuff { box.add( box.createhorizontalstrut( 8 ) ); box.add( item ); } //eastern stuff box logoarea= box.createhorizontalbox(); logoarea.add( new jlabel( laf.icon.png( "companylogo" ) ), borderlayout.east ); box.add( box.createhorizontalstrut( 8 ) ); box.add( logoarea, borderlayout.east ); jpanel area = new jpanel( new borderlayout() ); area.setborder( borderfactory.createemptyborder( 2, 2, 2, 2 ) ); area.add( box, borderlayout.west ); return area; //dashboard built edit to answer @nitin i'd move lef...

eclipse - Setting up Aspectj tools -

the problem must have simple answer cannot it. i need use org.eclipse.core.resources , org.eclipse.core.runtime libraries iresources,iproject,iworkspace,... classes. have downloaded aspectjtools.jar contains them. have added aspectjtools.jar project classpath in eclipse project. the project consists on simple jsp page imports org.eclipse.core.resources , org.eclipse.core.runtime libraries, when try use example iworkspace class exception (iworkspace cannot resolved type) class iworkspace not exist. i have read step needed. editing aspectjtools.jar/meta-inf/manifest.mf, don't know write in it. ask more details if needed. i have resolved problem problem viktor stolbin answer. put .jar files project subdirectory. add .jar files classpath: project>properties>java build path>add jar>project subdirectory of jar files follow instructions in: adding 3rd party jars web-inf/lib automatically using eclipse/tomcat

python - Parachute Segmentation Fault Error - pygame to py2exe -

i using gui2exe compile python/pygame, game .exe i have problem font module. using python 2.7 , py2exe option in gui2exe have updated python, pygame , py2exe 2.7 versions. program runs fine after compile py2exe this. here error get: fatal python error: (pygame parachute) segmentation fault application has requested runtime terminate in unusual way. please contact application's support team more information. my game starts off console , part runs. display starts crash. thanks had similar problems , 1 too. found way solve them: after few weeks (had problem before) i'm happy solved problem! :) 1st part of problem ( http://i.stack.imgur.com/wpkjr.png ): solved editing setup.py script adding "excludes" part in it. resulted in successful making of executable file! modified setup.py script: from distutils.core import setup import py2exe setup(windows=['source_static.py'], options={ "py2exe": { ...

Indexing composite types with Lucene -

currently i'm building search tool project index objects created multiple database tables (i.e. people , things do). wondering if there better way of going other creating objects corresponding each of combination of people/things (there thousands of each). e.g. creating object corresponds person 1 - thing 1, , person 1 - thing 2 n things person 1 does. then, indexing collection of objects. doing same thing person 2. you might use join functionality if dont want denormalize records. @ this article starters. performance worse denormalizing enough.

php - Mapping groups of constant values -

i have lists strings correspond values. example, in company list have microsoft correspond letters ms. obviously, transposed table in mysql make list extensible but, curiosity, how express in constant form in php ? p.s: there class-with-constants approach (see accepted answer here: php , enumerations ) act enumeration of use seeing enumerations map integer values ? how using define define("ms","microsoft"); echo ms; this echo microsoft. http://php.net/manual/en/function.define.php also link gave possible solution used strings instead. reason acts enum other languages because define values 0 n, instead of doing use string instead. class companies { const ms = 'microsoft'; const ibm = 'international business machines'; } echo companies::ms; i think work.

email - Attaching an uploaded image in PHP mail -

hi ladies , gentlemen hoping able me this. i have created web form people can enter registration information , upload image our server photo contest. uploader works great , email gets sent registration information having hard time getting uploaded image attach email. hoping able me figure out. form , processor page located in same directory , image placed in subfolder called upload. here have far not work attaching image. give me error: <?php if ((($_files["file"]["type"] == "image/jpeg") || ($_files["file"]["type"] == "image/pjpeg")) && ($_files["file"]["size"] < 2000000)) { if ($_files["file"]["error"] > 0) { echo "error: " . $_files["file"]["error"] . "<br />"; } else { echo "upload: " . $_files["file"]["name"] . "<br />"; echo "type: " . $_files[...

repository pattern - Can't help but see Domain entities as wasteful. Why? -

i've got question on mind has been stirring months i've read ddd, patterns , many other topics of application architecture. i'm going frame in terms of mvc web application question is, i'm sure, broader. , this:  does adherence domain entities  create rigidity , inefficiency in application?  the ddd approach makes complete sense managing business logic of application , way of working stakeholders. me falls apart in context of multi-tiered application. namely there few scenarios when view needs data of entity or when 2 repositories have all. in , of that's not bad means make multiple queries returning bunch of properties don't need few do. , once done extraneous information either gets passed view or there overhead of discarding, merging , mapping data dto or view model. have need generate lot of reports , problem seems magnified there. each requires unique slicing or aggregating of information sql can repositories can't they're expected return full...