Posts

Showing posts from February, 2012

java - Springsource Tool Suite unable to find sites -

Image
i'm trying configure springsource tool suite 2.7.1.release if try install plugin, help -> install new software... following error, though urls correct. here error log: on suspicion related proxy, have put in following proxy settings: but none of variations i've tried here have made difference. ideas? workarounds? if there forum more appropriate sts question, i'd appreciate info. please ask question on sts forum: http://forum.springsource.org/forumdisplay.php?32-springsource-tool-suite

swing - Java inheritance or GUI gone wrong -

despite tips, i'm still getting 1 wrong. end 1 basic window , 1 features, without basic ones previous window. instead, 1 new window combining basic , new features. here code i've got: (also approach advise?) package windows; import java.awt.*; import javax.swing.*; public abstract class windowtemplate extends jframe { /** * create gui , show it. thread safety, method should * invoked event-dispatching thread. */ public windowtemplate () { jframe myframe = new jframe("my first window"); myframe.setdefaultcloseoperation(jframe.exit_on_close); myframe.setvisible(true); myframe.setsize(550, 450); myframe.setlocationrelativeto(null); // jlabel emptylabel = new jlabel(""); // emptylabel.setpreferredsize(new dimension(550, 450)); // myframe.getcontentpane().setlayout(new cardlayout()); // myframe.getcontentpane().add(emptylabel, borderlayout.center); // myframe.pack(); } } now 1 meant "extended": package windows; import java.awt.*;

html - Prevent valign='middle' from being overridden by stylesheet declaration? -

i have table this: <table> <tr><td valign='middle'><a href='#'>link</a></td><td><img src='img.png'></td></tr> </table> and stylesheet this: a { vertical-align: baseline; } td { vertical-align: default; } i'm trying link veritcally aligned, because of initial vertical-align: baseline declaration (which cannot change) valign attribute ignored. i'd fix in stylesheet under td a selector. how can fix this? (i testing in chrome 12) remove valign="middle" , in stylesheet do: td { vertical-align: middle; } since asking how "erase" declaration. can't erase can override it: a { vertical-align: middle; } would replace previous declaration in stylesheet.

iphone - Help with logic on NSUserDefaults -

hey guys need logic in app. have app checklist lets u add or delete cells. want store cells in nsuserdefaults way, when open checklist page again, checklist when page closed! appreciated! lot everybody!! nsuserdefaults there store things more settings. task you'd better use core data or store data in separate file. here official tutorial pretty good. can (actually, intended to) integrated table views. there lots of tutorials out there. you should check thread .

yaml scientific notation syntax -

while working yaml document, found 1 of values getting parsed string snakeyaml: -8e-05 i found ros, uses yaml-cpp write yamls using following code write array out << yaml::beginseq; (int = 0; < m.rows*m.cols; ++i) out << m.data[i]; out << yaml::endseq; but c++ code above (copied ros "parse_yml.cpp" in camera_calibration package) creates -8e-05 while snakeyaml parses string. so who's right, should there bug report? if who? 1.2 yaml specification seems allow optional decimal, couldn't figure out if 1.1 yaml spec allows snakeyaml implements. the output should parsed !!float according yaml 1.2, !!str in yaml 1.1; @psr says, match json spec. the yaml 1.2 spec gives json schema , extension, "core schema" . in both cases, !!float regular expression is: [-+]? ( \. [0-9]+ | [0-9]+ ( \. [0-9]* )? ) ( [ee] [-+]? [0-9]+ )? which allows optional decimal. (the core schema adds support infinity , not-a-number.) the

sql server - SQL optimization question -

let's start scenario defined in my previous question . now want create query generates list of foo s f1 , count of foo s f2 distinct f1 nevertheless associated same bar or baz f1 associated to: select f1.*, case when f1.bar_id not null isnull(bar.lotnumber + '-', '') + bar.itemnumber when f2.baz_id not null isnull(baz.color + ' ', '') + baz.type end 'ba?description', (select count(*) foo f2 f2.bar_id = f1.bar_id or f2.baz_id = f1.baz_id) - 1 foocount foo f1 left join bar on bar.bar_id = f1.bar_id left join baz on baz.baz_id = f1.baz_id what worries me efficiency. must admit know nothing regarding how sql server generates execution plans sql sentences, common sense tells me subquery executed once each row in main query, i.e., once each value of f1.foo_id . not efficient. an alternative not run prob

email - How to configure php.ini to work with smtp4dev? -

so, downloaded , installed smtp4dev. when try sending mail in php file: mail('localhost', "hey there", "no"); i error php.ini, complaining sendmail_from isnt declared. i tried declaring it: sendmail_from = postmaster@localhost that made php silent, still doesnt work - tries load page 30 seconds , error. fatal error: maximum execution time of 30 seconds exceeded. how must configure php.ini work? php.ini [mail function] ; win32 only. ; http://php.net/smtp smtp = localhost ; http://php.net/smtp-port smtp_port = 25 ; win32 only. ; http://php.net/sendmail-from ;sendmail_from = postmaster@localhost ; unix only. may supply arguments (default: "sendmail -t -i"). ; http://php.net/sendmail-path ;sendmail_path = "\"c:\xampp\sendmail\sendmail.exe\" -t" ; force addition of specified parameters passed parameters ; sendmail binary. these parameters replace value of ; 5th parameter mail(), in safe mode. ;mail.force_ext

cocoa - OS X Lion scroll direction and NSSlider -

my application has horizontal nsslider acting volume control , lion's new "natural" (inverted) scroll direction behaves wrong. when slide left moves right , vice versa. according can see in lion's itunes apple planned should work same regardless of setting, when slide left should move slider left , vice versa. question how can find out mouse scroll inverted or not? or maybe can somehow raw deltax/deltay values, without invention applied? ask event if isdirectioninvertedfromdevice , , multiply delta -1 if so.

wpf - TemplateBinding from a Style DataTrigger In ControlTemplate -

in following xaml i'm using rectangle border template togglebutton. want borderbrush different colour reflect changing value of togglebutton.ischecked. unfortunately attempt here of using templatebinding in datatrigger doesn't work. need instead? <stackpanel orientation="horizontal"> <stackpanel.resources> <controltemplate x:key="buttonasswatchtemplate"> <border borderthickness="1"> <border.style> <style> <setter property="borderbrush" value="gainsboro" /> <style.triggers> <!-- templatebinding doesn't work.--> <datatrigger binding={templatebinding property=ischecked} value="true">

java - Design Pattern to correctly exit a running program from multiple locations -

i have system written in java have multiple distinct objects each different resources in use. have connections activemq queues, have network connections , others have open files. contain running threads. when fatal error occurs anywhere in system, need shut down , correctly close resources , stop running threads. my problem arises when object caused error needs start shutdown process. object not know other objects have open files , on. can release resources , it. i looking clean way achieve without getting messy , passing multiple object references around system. any insight appreciated. thank you. create central lifecycle object of these other objects in application have reference to, , in turn has reference of these other objects. in addition, each of these objects should implement common interface such public interface shutdownlistener { void onshutdown(); } when 1 of objects needs start orderly shutdown, can call lifecycle.shutdown() can in turn call o

gdb - Missing line numbers from debug symbols for library in whole program, but not on its own -

i'm seeing odd issue when trying use gdb debug test program package built libtool. if run libtool --mode=execute gdb .libs/libfoo.so , ask list source of function list bar::baz , source code expected. if run libtool --mode=execute gdb binary , can break in bar::baz() , , see arguments in stack trace, no source file or line numbers, so: #7 0x018348e5 in bar::baz(qux*, quux*) () /path/to/libfoo.so ^^^^^^^^^^^ <--- debug symbols present! similarly, if try list bar::baz when debugging executable, no line number known 'bar::baz'. i have confirmed binary linked -g , , can list main function, know of debug information present present. when info sources , full listing of files library built, correct absolute paths. when info shared , correct path listed object file, yes in syms column. any further ideas going wrong, , how fix it? edit 1: accident, ran objdump -g on offending library, , got following output: /path/to/foo.so.

java - Using multiple WSDLs with Axis2 wsdl2code Maven plugin -

i'm creating client maven2 uses several web services. i'm restricted using axis2 or other framework supporting apache httpclient http conduit because these services require integration managed certificate solution based on httpclient . i'm familiar cxf's code-gen maven plugin allows multiple wsdls input during code generation. however, axis2 code-gen plugin can process 1 wsdl @ time. how can make maven run wsdl2code each wsdl during code-gen phase? need multiple profiles this? the build section of pom looks this: <build> <plugins> <plugin> <groupid>org.apache.axis2</groupid> <artifactid>axis2-wsdl2code-maven-plugin</artifactid> <version>1.6.0</version> <executions> <execution> <goals> <goal>wsdl2code</goal> </goals>

sql server 2008 - SQL Import from Excel Spreadsheet -

i have spreadsheet importing contains test data application building. using sql server 2008 , amd doing sql server import , export wizard. when try import data following message(s): messages error 0xc02020c5: data flow task 1: data conversion failed while converting column "eventdate3" (78) column "eventdate3" (219). conversion returned status value 2 , status text "the value not converted because of potential loss of data.". (sql server import , export wizard) error 0xc0209029: data flow task 1: ssis error code dts_e_inducedtransformfailureonerror. "output column "eventdate3" (219)" failed because error code 0xc020907f occurred, , error row disposition on "output column "eventdate3" (219)" specifies failure on error. error occurred on specified object of specified component. there may error messages posted before more information failure. (sql server import , export wizard) error 0xc0047022: data fl

javascript - Jquery text change event -

i need fire event anytime content of textbox has changed. i cant use keyup nor can use keypress . keyup , keydown doesn't work if hold down on key. keypress triggers before text has changed. doesn't recognize backspace or delete either. so i'm assuming i'm going have build custom logic or download plugin. there plugins out there? or if should build one, constraints should out for? for eg. facebook search @ top. can press , hold. another example writing stackoverflow question. right below editor, contents copied in real time, backspace , everythng works. how it? i took @ so's source. looks lot this : function updatepreview(){ $('div').text($('textarea').val()); } $('textarea').bind('keypress', function(){ settimeout(updatepreview, 1); } );​ they stuff make html tags bold , italics , links , such , time it. increase delay 1 longer if takes long generate html.

oop - Clarification of the term "Namespace" -

my understanding of term "namespace" of class; container of methods , variables. although seems doubling on consider definition of class. can confirm or clarify belief? a namespace used have different programming rules in same program module. let's want define function 'string_addition' mean 'string1' + 'string2' = 'string1string2', later in same program want define 'string_addition' mean 'string1' + 'string2' = 'string3'. can use namespaces, in same file can call on different namespaces , both kinds of rules. namespace h:stringadd(string1, string2) = string1string2 namespace f:stringadd(string1, string2) = string3

configuration - How to upgrade HornetQ version in JBoss 6? -

i using jboss-6.0.0 default comes hornetq-2.1.2 version version of hornetq has many iteration related bugs resolved in hornetq-2.2.5 version default comes jboss 7 as. i can't switch jboss 7 because using many other services specific jboss 6 , risky switch jboss 7 as of now. is there anyway can upgrade hornetq version in jboss 6 ? tried standalone hornetq-2.2.5 running different process, jboss jmx console not available. any suggestion appreciated this. please let me know if missing here. thanks. but jboss jmx console not available. use jconsole jdk distribution. you can either nightly build @ http://hudson.jboss.org/hudson/view/jboss%20as/job/jboss-as-6.1.x/lastsuccessfulbuild/artifact/jbossas_6_1/build/target/jboss-6.1.x.zip or same question has been asked on hornetq user's forum: http://community.jboss.org/message/616616?tstart=0#616616 delete message journal since file format 2.2.5 not backwards compatible ($jboss_home/server//data/hornetq)

emacs - Disable ido-mode for specific commands? -

i've been using ido-mode few months, ido-everywhere turned on, , pretty happy it. there's 1 thing wish change, though. when type c-u m-x shell create new shell buffer specific name, ido offers me completion list of of open buffers. if choose one, new shell launched in buffer , it's put shell-mode, no matter contains. it's hard imagine useful use case this. is there way deactivate ido-mode shell command only? (as other similar commands may stumble across in future, of course.) heh, turns out you'll same completion choices whether or not have ido-everywhere enabled. there's no built-in way want. ido-mode provides hooks able override whether or not find-file behavior taken on ido or not. read-buffer always overridden ido-everywhere . luckily, little emacs lisp can want: (put 'shell 'ido 'ignore) (defadvice ido-read-buffer (around ido-read-buffer-possibly-ignore activate) "check see if use wanted avoid using ido&

How to drag and drop files into web browser? -

Image
i want select few files , able drag , drop them web browser website. reliable way drag , drop files/photos across major browsers firefox , chrome google provide libraries this? i hope want feature same gmail attachment feature (we can drag , drop files). for need use flash. hope, in gmail using flash check posts, ideas (using native dnd) 1) drag-and-drop file upload in google chrome/chromium , safari? 2) native drag + drop file upload in firefox 3.6

std - C++ default allocator - what should happen if the size doesn't equal the size passed to the invocation of allocate? -

20.6.9: void deallocate(pointer p, size_type n); requires: p shall pointer value obtained allocate(). n shall equal value passed first argument invocation of allocate returned p. effects: deallocates storage referenced p. remarks: uses ::operator delete(void*) (18.6.1), unspecified when function called. what should happen if n doesn't equal value passed first agrgument invocation of allocate returned p ? not deallocate? throw std::bad_alloc ? ... edit: meant "what should happen" was: okay throw or assert in custom implementation? as usual in c++ standard, when nothing stated explicitly, violating requirements leads undefined behavior. shall means at times must , it's requirement, not option in c++ standard. for example here's msdn says : the pointer _ptr must have been returned earlier call allocate allocator object compares equal *this, allocating array object of same size , type. which means size must match precisely, otherwi

QTP with JQuery Tree -

we using application make use of jquery tree , trying automate application. find following issues while automating application, great if following queries: to add group in tree, right click on parent node , select option "add group" create, qtp doesn't recognize action. -> found out temporary solutions adding 1 line of code right click event initiated. (it great if provide permanent solutions). after providing new name group, need hit enter button in order hit database, enter key pressed during our recording session , when same re-played, qtp didn't recognize enter key pressed. hope queries clear. appreciated if provide solution above 2 queries. to trigger enter can use below code, set keyboard = createobject("wscript.shell") keyboard.sendkeys "{enter}"

How to define "global" find conditions for model in CakePHP? -

is possible define find conditions effective in controllers , functions use specific model? for example if want return products in stock no matter what. maybe somewhere in model: conditions => array('instock >' => 0) i think try function on model, , call in controller simple line. controller: $productsinstock = $this->product->getproductsinstock(); model: function getproductsinstock() { $produtcsinstock = $this->find('all', array('conditions' => array('instock >' => 0))); return $productsinstock; } or try link, think help. don't know nothing callbacks: http://book.cakephp.org/view/1049/beforefind

ios - is there any method to know if the app run for the first time -

i need know if app run first time setup default settings music on/off fx volume equal 0.5 ... so there predefined way or need make manually? you can put in - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions : if (![[nsuserdefaults standarduserdefaults] boolforkey:@"applicationrunbefore"]) { [[nsuserdefaults standarduserdefaults] setbool:yes forkey:@"applicationrunbefore"]; [[nsuserdefaults standarduserdefaults] synchronize]; // application running first time - ... } hope helps...

sql - Getting a bad grammar error in a call to a Spring Stored Procedure with Java -

i'm having debug code written else , i've run problem in 1 of dao implementations. we're using java 1.6 , spring (i think there's hibernate in portions of application don't think come play here.) code when runs erroring on "outmap = super.execute(inmap);" line of code. error throws is systemerr r callhistorysp() org.springframework.jdbc.badsqlgrammarexception: callablestatementcallback; bad sql grammar [{call db2admin/quoteaccessorials(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; nested exception java.sql.sqlexception: number of parameter values set or registered not match number of parameters. here's object (at least relevant parts). private class ratequotehistorystoredproc extends storedprocedure { private final string sql = getstoredprocname(); private final string quote_num = "ratequote

objective c - SIGABRT error puzzling me -

i new objective-c. previous programming experience visual basic. yes, noob. intuitive , these sorts of things, determined learn. decided after learning basic create calculator program scratch without looking @ how it, , learn experience. got addition, , worked beautifully. however, after added subtraction , multiplication. it, blunt, took shit. after running, crashes , brings me untouched main.m file sigabrt error. have no idea went wrong. code looks should work me, despite organizational errors. tried commenting out added, no avail. still gives me error. appreciated thank you. below pictures of code: .h file: http://i73.photobucket.com/albums/i206/strbarrytree/screenshot2011-07-21at42338am.png .m file: http://i73.photobucket.com/albums/i206/strbarrytree/mycode.jpg you have connected outlet or action in ib , deleted outlet/action in header file. check in ib if have connection "!" next , delete it.

android - How to run AsyncTasks Sequentially -

i have 3 asynctasks on insert data activity. the first 1 saves data database. second 1 uploads item's picture. third 1 uploads user's picture when user clicks submit button, first asynctask run, , when done, second asynctask run, , when done third asynctask run. when they're finished, toast appear says "your data has been submitted" how make asynctasks run sequentially that? the onpostexecute callback in asynctask called ui thread, can start new asynctask there next step.

C# library to automatically generate values for unit tests -

i've read library generates auto values usage in unit test not find it. basically, want instead of: [test] public void test() { int x = 2; int y = 5; assert.areequal(7, objectundertest.add(x, y)); } i want write: [test] public void test() { int x = lib.int(); int y = lib.int(); assert.areequal(x + y, objectundertest.add(x, y)); } update: autofixture 1 i'm looking for. autofixture, test be: [test] public void test() { var fixture = new fixture(); int x = fixture.createanonymous<int>(); int y = fixture.createanonymous<int>(); assert.areequal(x + y, objectundertest.add(x, y)); } i haven't used of these yet interested in topic. here's round of of them done author of tool looks worth checking out called quickgenerate.

java - Problems with (PreparedStatement prest) in retrieving data from the database -

query="select friend_uname myfriends";//select friends of user system.out.println(query); rs=stmt.executequery(query); query="select * service_provider source=\""+source+"\" , dest=\""+dest+"\" , resources>0 , provider_name in(?);"; system.out.println(query); prest=conn.preparestatement(query); while(rs.next()) { x=rs.getstring("friend_uname");//select friend names of user 1 one... system.out.println("the friend_uname is"+ x); prest.setstring(1,x);//set ith position of string friend name } try query query="select * service_provider source=\""+source+"\" , dest=\""+dest+"\" , resources>0 , provider_name in(select friend_uname myfriends)"; or try join query query="select sp.* service_provider sp, myfriends myfrnd sp.source=\&

No Theme menu is available in Visual Studio 2010 -

i installed version of visual studio 2010, has no theme menu. installed on other machines none of them has theme menu. i can use default theme. how can add themes menu copy of visual studio? the "theme" menu not part of visual studio 2010, won't there standard installation. it provided extension called "visual studio color theme editor", must install on computer first before can change themes. you can download here microsoft's visual studio gallery website.

java - JRadioButton: how to replace text by IconImage? -

Image
i want replace text in radio button list icon. i've tried this: rotatebutton = new jradiobutton(rotateicon.getimage()); but replaces radio button , text icon. keep radio button , display image. what should do? what i'm getting is: but want end this: public jradiobutton(string text, icon icon) , simple example here

multithreading - Texture Buffer for OpenGL Video Player -

i using opengl, ffmpeg , sdl play videos , optimizing process of getting frames, decoding them, converting them yuv rgb, uploading them texture , displaying texture on quad. each of these stages performed seperate thread , written shared buffers controlled sdl mutexes , conditions (except upload , display of textures need in same context). i have player working fine decode, convert , opengl context on seperate threads realised because video 25 frames per second, converted frame buffer, upload opengl , bind it/display every 40 milliseconds in opengl thread. render loop goes round 6-10 times not showing next frame every frame shows, due 40ms gap. therefore decided might idea have buffer textures , set array of textures created , initialised glgentextures() , glparameters needed etc. when hasn't been 40ms since last frame refresh, method ran grabs next converted frame convert buffer , uploads next free texture in texture buffer binding calling gltexsubimage2d(). when has bee

Android Location Providers - GPS or Network Provider? -

Image
in application determine user's current location. have couple of questions in regard: there different location providers, 1 accurate? gps provider or network provider ? in how far available provider differ? how function? could please provide me code-snippets or tutorials on how started implementing gps functionality in application? there 3 location providers in android. they are: gps –> (gps, agps): name of gps location provider. provider determines location using satellites. depending on conditions, provider may take while return location fix. requires permission android.permission.access_fine_location. network –> (agps, cellid, wifi macid): name of network location provider. provider determines location based on availability of cell tower , wifi access points. results retrieved means of network lookup. requires either of permissions android.permission.access_coarse_location or android.permission.access_fine_locatio

php - How to access elements of the return value of mysql_fetch_array? -

$con = mysql_connect("servername","username","password"); if (!$con){die('could not connect: ' . mysql_error());} mysql_select_db("appiness", $con); $result= mysql_query("select * country"); while($answer= mysql_fetch_array($result)) { echo $answer; } when write gives me array of 194 elements when echo them writes arrayarrayarray....... 194 times idea why not giving names of countries? you have specify column want out of $answer -array. if column name name: echo $answer["name"]

android - Thread and battery -

i have 1 problem , 2 options implementation , know 1 best in android environment (basicly best practice , 1 using less battery). my problem: have 4 runnable implementations, runnable has list of tasks need executed in separate threads. runnable have no task long period of time , lot of tasks execute (each runnable executes tasks in sequential order), nothing long time , and on... 1st implementation my fist implementation create 4 thread. each threads in charged of 1 runnable. each thread runs tasks, when list empty runnable pause thread (with wait()), when tasks added list thread waken (with notify()). here code of run method runnable: public void run() { while (!terminated) { while ( tasklist.size()> 0 ) { task task = tasklist.get(0); tasklist.remove(task); handletask(task); } synchronized(tasklist) { if (tasklist.size()==0) tasklist.wait(); } } } first question: thread in pause state usi

TinyMCE Popup displaying blank page -

i'm installing tinymce on site of ours. seems of installed fine apart problem having popup windows image, html etc etc. popup's appear empty when view source, code there there inline styling on body display: none. know why happening? thanks

c++ - boost asio asynchronously waiting on a condition variable -

is possible perform asynchronous wait (read : non-blocking) on conditional variable in boost::asio ? if isn't directly supported hints on implementing appreciated. i implement timer , fire wakeup every few ms, approach vastly inferior, find hard believe condition variable synchronization not implemented / documented. if understand intent correctly, want launch event handler, when condition variable signaled, in context of asio thread pool? think sufficient wait on condition variable in beginning of handler, , io_service::post() in pool in end, of sort: #include <iostream> #include <boost/asio.hpp> #include <boost/thread.hpp> boost::asio::io_service io; boost::mutex mx; boost::condition_variable cv; void handler() { boost::unique_lock<boost::mutex> lk(mx); cv.wait(lk); std::cout << "handler awakened\n"; io.post(handler); } void buzzer() { for(;;) { boost::this_thread::sleep(boost::posix_ti

ios - Setting UISwitch state in UIPopoverController -

i reset state of uiswitch in uipopovercontroller mainviewcontroller. assume simple popoverview.switchname.on = no; wont job (as doesnt seem working). whats best way this? thank you. the uipopovercontroller container content view controller shown inside frame. assume @ point calling initwithcontentviewcontroller view controller presents content , view controller has switchname property. to access view controller can use contentviewcontroller property of uipopovercontroller. imagine like: // assuming popoverview uipopovercontroller , type of // view contorller pass initwithcontentviewcontroller yourviewcontroller yourviewcontroller * mycontroller = (yourviewcontroller*)popoverview.contentviewcontroller; mycontroller.switchname.on = no;

architecture - How to design discussion for multiple entities -

Image
i've got entities project, client, task, , every 1 of them should have list of posts(aka discussion). problem since every entity(project, client,..) mapped it's own table, can't refer entity discussion "owner_id" because it'd ambigious having client id=1 , project id=1 , discussion wouldn't know if belongs project or client. i'd avoid having independent discussion entity client , independend discussion entity project .. (cause later on might want add discussion entity it's not "scalable"). know can add discriminator attribute(column) discussion distinguish between clientdiscussion , projectdiscussion. i'm wondering if that's right way such thing or not. tink? personally sounds need create abstract entity. entitytype<-entity<-entitydiscussion->discussion how different fields in project/client/task?

java - Retrieving values of a specific field in Hibernate -

consider class: class employee{ integer empid, //many other fields } i need dao method shown below list<integer> getallemployeeids(){ //?? } dont want list<employee> , (new edit) set<intger> how can in hibernate?am using hbm files mapping like this. also, recommend use querydsl make type-safe. list<integer> getallemployeeids(){ return (list<integer>)createquery("select e.empid employee e").list(); }

javascript - cakephp link on image escape is not working -

image link in cakephp not working $this->html->link( $this->html->image('image',array('class' => $class, 'id' =>'img_id' )), somelink, array('onclick' =>'jquery(this).modal({width:600,height:400,left:120,top:100}).open(); return false;'), array(), array('escape'=>false)); it output <a href='link' onclick='jquery(this).modal({width:600,height:400}).open(); return false;'> &lt; img src='image_path' &gt; it not escaping &lt , > if mention escape=>false, not getting missing? you have many arguements. try this: echo $this->html->link( $this->html->image('image',array('class' => $class, 'id' =>'img_id' )), 'foo', array('escape'=>false, 'onclick

Forgiving Format design pattern - JQuery or C# library? -

i have been looking @ 'forgiving format' design pattern (e.g. http://ui-patterns.com/patterns/forgivingformat ), surprised can't find libraries implementing (specifically simple date/times). know of (perferably open source) libraries this? thanks i don't think design pattern, rather ui pattern... ( edit : noticed name of website linked :) ) as matter of fact, functionality exists in libraries. first 1 spring mind datejs , javascript parsing library allows fuzzy date input. since last heard of it, there hasn't been activity in project. apart dates, countries, etc... , think project of kind business-specific; first you've got learn how users express , how translate in business terms. working on generic translator doesn't it's feasible, @ least not without lot of configuration.

c++ - Parameters File to Store All Variables -

background: i've created application large preference dialog user can configure number of pages, each bunch of different settings. these settings in form of dropdowns , text boxes. want store of variables 1 massive "parameters.h" file can access them anywhere in application. each sub-page has it's own source , header file. i'm having trouble pointers though. i'm not sure how reference parameters class. basically, application has 2 main components: main dialog , bunch of sub, child pages. main dialog sub-pages shown , hidden, based on page user chooses in listbox on left of main dialog. i'm working 1 sub-page right now, , have following, when debug, i'm getting <badptr> on place. have simplified code, should enough figure out i'm doing wrong. question: how point parameters class in each sub-dialog can store , use of these variables? saprefsdialog.cpp: main dialog houses sub-pages bool csaprefsdialog::oninitdialog() { cdi

yii - CKEDITOR 3.x : customize <ol> to insert <p> tags inside <li> -

has dealt such thing before? want customize display of posts in little application , need <p> tags inside <li> tags added automatically when writing under ckeditor. don't know config item should for. please me if can. maybe should when saving datas. it's easy grep & replace php. check out function : http://php.net/manual/fr/function.preg-replace.php

sql - Which IDs from a database to use? -

i have 2 sql tables, , b. each table has primary key id. table b has field x (which may null) refers id of (if not null). then need list (stored in file) of identifiers of objects stored in table a. which ids suggest use, a.id or b.id in list? (it clear having id of row in b can infer id of row in a, provided row in b has non-null x.) [added] clear: object partially stored in , partially in b. [added] structure of tables (z_users b, z_clients a, z_users.client field x): create table `z_users` ( `id` int(10) unsigned not null auto_increment, `password` varchar(255) collate utf8_bin not null, `fullname` varchar(255) collate utf8_bin not null, `phone` varchar(255) collate utf8_bin not null, `address` text collate utf8_bin not null, `email` varchar(255) collate utf8_bin default null, `admin` enum('false','true') collate utf8_bin not null default 'false', `worker` int(10) unsigned default null, `client` int(10) unsigned default null,

perl - Mojolicious : syntax-highlighting for inlined templates -

would in principle possible ( additionally ) create template section inlining templates make easier create suitable syntax-highlighting template, since data section has own syntax-highlighting? you didn't mention text editor using, vim there mojo templates syntax file can highlight .ep , .epl mojolicious templates in __data__ sections.

sql - How to automatically reflect table relationships in SQLAlchemy or SqlSoup ORM? -

how tell sqlalchemy automatically reflect basic foreign key references references other orm objects , not integer fields? in both sqlalchemy , it's sqlsoup , table columns reflected automatically , relations can defined manually: class user(base): __table__ = metadata.tables['users'] loan = relation(loans) ... you can define relationships on sqlsoup classes: >>> db.users.relate('loans', db.loans) try magic ) works simple fk relations, , without db schemes from sqlalchemy import create_engine, metadata sqlalchemy.orm import mapper, relation engine = create_engine("sqlite://", echo=true) engine.execute(''' create table foo ( id integer not null primary key, x integer )''') engine.execute(''' create table bar ( id integer not null primary key, foo_id integer, foreign key(foo_id) references foo(id) )''') metadata

How to update a field of a class when a list of the class gets modified in C#? -

i understand things in here value types , not referenced field _num won't modified when update list. question how update field _num when modify list contains gets modified? class foo { public list<object> mylist; private int _num; public int num { { return _num; } set { this._num = value; mylist[0] = value; } } public foo() { mylist = new list<object>(); mylist.add(_num); } } class program { static void main(string[] args) { foo = new foo(); my.num = 12; my.mylist[0] = 5; console.writeline("" + my.mylist[0] + " " + my.num); ==> output "5 12" console.readline(); } } what changes done list , field synced? output should "5 5" help! this may or may not want... , i'm still not sure see need modifying fields index, if want

configuration - Creating AD user with powershell -

i've been looking around web whole day, didn't found clue. my problem want create active directory users via powershell. i've been doing far, must set in property dial-in tab, remote access permission option "allow access", don't know how. do have clue or trick so? thanks in advance. this attribute : msnpallowdialin true : allowed false : denied not-defined : control policy

iphone - How can i scroll in a UIScrollView to a certain point? -

how can scroll point (x,y) in scroll view in animated way (i.e. (x,y) in 1 second ) ? you use scrollrecttovisible:animated: method, passing rectangle want visible after scrolling has been completed. you can read more on in official documentation .

java - How to fetch path of a file from preference page and print the Output on console via Button on Workbench? -

i have made 1 preference page programming is: public class saml extends fieldeditorpreferencepage implements iworkbenchpreferencepage { public saml() { super(grid); setpreferencestore(rmpplugin.getdefault().getpreferencestore()); setdescription("browse appropriate files"); } public filefieldeditor f; public filefieldeditor f1; public void createfieldeditors() { f=new filefieldeditor(preferenceconstants.p_path, "&prism.bat file:", getfieldeditorparent()); addfield(f); f1=new filefieldeditor(preferenceconstants.p_path1, "&nusmv application file:", getfieldeditorparent()); addfield(f1); } i want path of filefieldeditor f , want path run on button embedded on workbench (but programming of button in different project on same workspace). button programming has hard coded path of "prism.bat" file is: try { //to clear console on every click of button iviewpart vi

utf 16 - utf-16 file seeking in python. how? -

for reason can not seek utf16 file. produces 'unicodeexception: utf-16 stream not start bom'. code: f = codecs.open(ai_file, 'r', 'utf-16') seek = self.ai_map[self._cbclass.text] #seek valid int f.seek(seek) while true: ln = f.readline().strip() i tried random stuff first reading stream, didnt help. checked offset seeked using hex editor - string starts @ character, not null byte (i guess sign, right?) how seek utf-16 in python? well, error message telling why: it's not reading byte order mark. byte order mark @ beginning of file. without having read byte order mark, utf-16 decoder can't know order bytes in. apparently lazily, first time read, instead of when open file -- or else assuming seek() starting new utf-16 stream. if file doesn't have bom, that's problem , should specify byte order when opening file (see #2 below). otherwise, see 2 potential solutions: read first 2 bytes of file bom before seek. seem didn'

perl - print result from all devices on array -

i write script script print 1 result not results devices. belive error on print section couldn't figure out. note :- host file has 30 devices list script print result of last device only. #!/usr/bin/perl $host_file = "/usr/local/bin/test/host2"; open (packetloss,"$host_file") or die "cannot open extracted host file"; # put extracted data array @extracted_array=<packetloss>; chomp(@extracted_array); foreach(@extracted_array) { @words = split; $host = $words[0]; } $extracted_array[$ping_idx] = `/usr/sbin/ping -s -t 10 $host 56 2 2>&1`; $ping_idx++; ($packet_loss) = ($ping =~ m/packets received, (\d+)% packet loss/); ($round_trip) = ($ping =~ m/round-trip.*\(ms\).*min\/avg\/max\/stddev = \d+\.\d+\/(\d+\.\d+)\/.*/); print " $host $round_trip ms average latency , $packet_loss packet loss\n"; cause closing foreach , performing operation. should be foreach(@extracted_array) { @words = split;

python - Is there a statics finder for django that will find statics in eggs? -

i know there no finder built django (at least not in 1.3) wondering if out there has made 1 yet before make attempt @ it. basically looking statics finder in apps installed egg file contains static dir in egg. i have looked @ code django.contrib.staticfiles.finders.appdirectoriesfinder , unfortunately in django 1.3 version of thing checked subdirectories of installed app location, not subdirectories in eggs. update: since there no replies yet take "no". :) if time may put 1 myself doesn't there interest. don't know if appropriate or not if happen interested in statics finder eggs, maybe leave comment. it's little hackish let me use staticfiles_dirs , filesystemfinder. def inplaceeditform_path(): import inplaceeditform return os.path.abspath(os.path.join(os.path.dirname(inplaceeditform.__file__),'media')) staticfiles_dirs = ( ('site/inplaceeditform' ,inplaceeditform_path()), )

jquery - Disable javascript in a site that you are framing -

would possible disable javascript in website trying frame? if website trying bust framing attempts, disarm of javascript completely, if means user have interact site without javascript? nope. if loading in frame or iframe there no way specify "load website don't enable javascript in frame". you might able proxy , strip js out: bad choice best option.

c# - MSSQL Simple Update Query: UPDATE TABLE SET FIELD = 1 WHERE FIELD = 2 -

i trying perform simple update query in ms sql. in mysql issue this: update table set field = 1 field = 2 i getting error when try in ms visual studio. please this. the error: subquery returned more 1 value. not permitted when subquery follows =, !=, <, <=, >, >= or when subquery used expression. statement has been terminated. thanks. on limited information hand, suspect have update trigger on table coded expect single row being in inserted or deleted tables.

c# - Filehelpers Publish Release file without need for DLL -

this might bit of noob question.. i've coded simple file conversion app in c sharp (.net 4, vs2010) uses filehelpers library. i've got reference library in project references. when publish project in release mode, outputs filehelpers.dll file executable together, , executable won't work unless it's in same folder dll. i tried setting copy local false, still doesn't work. there way package library part of exe file?? simple app meant distributed , having required dll floating around huge downside. thanks t got working after fiddling ilmerge not running on .net v4. here command future thread visitors: ilmerge /targetplatform:v4,c:\windows\microsoft.net\framework\v4.0.30319 /out:merged.exe /log original.exe filehelepers.dll you may want in project property settings can custom copy files ever want post build if looking move files around after build. if looking include .dll in .exe here

Sharepoint 2010 Foundation - Provisioning a page based on a different master page -

i able add new master page sharepoint 2010 foundation. i can see page in master page library. however, when try provision new page, don't have option pick master page. there step mission? this step isn't available in sharepoint foundation. able set custom masterpage object model , guess sharepoint designer.