Daily Archives

Articles indexed Monday April 12 2010

Page 13/116 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • disable log4j if log4j.properties file is not found.

    - by zeroin23
    log4j:WARN No appenders could be found for logger ().<br/> log4j:WARN Please initialize the log4j system properly. The above message is shown and i would like to disable the logger if the log4j.properties cannot be found. How do i go about it? BasicConfigurator.configure(); will output to console which is not what i want.

    Read the article

  • Move a sequential set of commits from one (local) branch to another

    - by jpswain09
    Is there a way to move a sequential set of commits from one (local) branch to another? I have searched quite a bit and still haven't found a clear answer for what I want to do. For example, say I have this: master A---B---C \ feature-1 M---N---O---P---R---Q And I have decided that the last 3 commits would be better off like this: master A---B---C \ feature-1 M---N---O \ f1-crazy-idea P---R---Q I know I can do this, and it does work: $ git log --graph --pretty=oneline (copying down sha-1 ID's of P, R, Q) $ git checkout feature-1 $ git reset --hard HEAD^^^ $ git checkout -b f1-crazy-idea $ git cherry-pick <P sha1> $ git cherry-pick <R sha1> $ git cherry-pick <Q sha1> I was hoping that instead there would be a more concise way to do this, possibly with git rebase, although I haven't had much luck. Any insight would be greatly appreciated. Thanks, Jamie

    Read the article

  • gdb - thread log

    - by sthustfo
    Hi all, While I trying to debug a 'C' program with gdb, I always get the following continuously on the gdb console. [Thread 0xb7fe4b70 (LWP 30576) exited] [New Thread 0xb7fe4b70 (LWP 30577)] [Thread 0xb7fe4b70 (LWP 30577) exited] [New Thread 0xb7fe4b70 (LWP 30578)] [Thread 0xb7fe4b70 (LWP 30578) exited] Is there any reason why this is printed? And anyway to block this? note: the program makes use of timers. Is that a possible cause?

    Read the article

  • Need Help with Consolidating RoR Google Map Results

    - by Kevin
    I have a project that returns geocoded results within 20 miles of the user. I want these results grouped on the map by zip code, then within the info window show the individual results. The code posted below works, but for some reason it only displays the 1.png rather than looking at the results and using the correct .png icon associated with the number. When I look at the infowindows, it displays the correct png like "/images/2.png" or "/images/5.png" but the actual image is always 1. @ziptickets = Ticket.find(:all, :origin => coords, :select => 'DISTINCT zip, lat, lng', :within => @user.distance_to_travel, :conditions => "status_id = 1") for t in @ziptickets zips = Ticket.find(:all, :conditions => ["zip = ?", t.zip]) currentzip = t.zip.to_s tixinzip = zips.size.to_s imagelocation = "/images/" + tixinzip + ".png" shadowlocation = "/images/" + tixinzip + "s.png" @map.icon_global_init(GIcon.new(:image => imagelocation, :shadow => shadowlocation, :shadow_size => GSize.new(60,40), :icon_anchor => GPoint.new(20,20), :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") new_marker = GMarker.new([t.lat, t.lng], :icon => newicon, :title => imagelocation, :info_window => currentzip) @map.overlay_init(new_marker) end I tried changing the last part of the mapicon from: :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") to: :info_window_anchor => GPoint.new(9,2)), currentzip) newicon = Variable.new(currentzip) but the strangest thing is that any string that has numbers in it causes the map to fail to render in the view and just show a blank screen... same if I replace it with :info_window_anchor => GPoint.new(9,2)), "123") newicon = Variable.new("123") Any advice would be helpful... also it runs a bit slower than my previous code which just set up 4 standard icons and used them outside of the loop so any hints as to speed up execution would be appreciated greatly. Thanks!

    Read the article

  • Customize ToolStripMenuItem

    - by Lu Lu
    Hello everyone, I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public class MyToolStripMenuItem : ToolStripMenuItem { public MyToolStripMenuItem() :base() { } public MyToolStripMenuItem(string t) :base(t) { } protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = this.Bounds; g.FillRectangle(Brushes.Blue, r); g.DrawString(this.Text, this.Font, Brushes.Red, r); } } In my code, I will fill a blue color in item's bound. Now, I will create a list of items on menustrip: MyToolStripMenuItem1 |___MyToolStripMenuItem2 |___MyToolStripMenuItem3 I don't know why MyToolStripMenuItem3 don't have a blue background. This is my source code: http://www.mediafire.com/?2qhmjzzfzzn Please help me. Thanks.

    Read the article

  • how to access vista system remotely using vb.net ?

    - by meenakshi
    I tried to access xp to vista system manually, its working,but programatically how to do it ? like,by selecting view workgroup computers in network tasks and click one computer in workgroup computers.it shows connect to "system name" window, contains username and password if i enter username and password.the seleted computer will able to access in registry otherwise i can't able to access that selected system. how to do this manual process in vb.net coding? is it possible or not? please help me

    Read the article

  • Constant NSDictionary/NSArray for class methods.

    - by Jeff B
    I am trying to code a global lookup table of sorts. I have game data that is stored in character/string format in a plist, but which needs to be in integer/id format when it is loaded. For instance, in the level data file, a "p" means player. In the game code a player is represented as the integer 1. This let's me do some bitwise operations, etc. I am simplifying greatly here, but trying to get the point across. Also, there is a conversion to coordinates for the sprite on a sprite sheet. Right now this string-integer, integer-string, integer-coordinate, etc. conversion is taking place in several places in code using a case statement. This stinks, of course, and I would rather do it with a dictionary lookup. I created a class called levelInfo, and want to define the dictionary for this conversion, and then class methods to call when I need to do a conversion, or otherwise deal with level data. NSString *levelObjects = @"empty,player,object,thing,doohickey"; int levelIDs[] = [0,1,2,4,8]; // etc etc @implementation LevelInfo +(int) crateIDfromChar: (char) crateChar { int idx = [[crateTypes componentsSeparatedByString:@","] indexOfObject: crateChar]; return levelIDs[idx]; } +(NSString *) crateStringFromID: (int) crateID { return [[crateTypes componentsSeparatedByString:@","] objectAtIndex: crateID]; } @end Is there a better way to do this? It feels wrong to basically build these temporary arrays, or dictionaries, or whatever for each call to do this translation. And I don't know of a way to declare a constant NSArray or NSDictionary. Please, tell me a better way....

    Read the article

  • Why does ANT tell me that JAVA_HOME is wrong when it is not?

    - by Ankur
    I get the error: C:\dev\ws\springapp\build.xml:81: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre6" But I have clearly set my JAVA_HOME to be C:\Program Files\Java\jdk1.6.0_14 Where is ANT getting this value?

    Read the article

  • Java IO (javase 6)- Help me understand the effects of my sample use of Streams and Writers...

    - by Daddy Warbox
    BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new BufferedOutputStream( new FileOutputStream("out.txt") ) ) ); So let me see if I understand this: A byte output stream is opened for file "out.txt". It is then fed to a buffered output stream to make file operations faster. The buffered stream is fed to an output stream writer to bridge from bytes to characters. Finally, this writer is fed to a buffered writer... which adds another layer of buffering? Hmm...

    Read the article

  • What does the -P option do to mount?

    - by Simon
    I'm migrating from an archaic version of Red Hat to Ubuntu 9. When going through my old nfs mount script, I found that it contained the -P option. So my script looks like: sudo mount -t nfs -o -P ... It looks like the -P is one of the -o options. My question is: what does the -P option do? I've searched every man page I can find, with no luck. Could it have to do with privileged ports?

    Read the article

  • Looking for .NET library to create PDF

    - by aximili
    We are looking for a .NET PDF creator. It needs to be .NET, so we can just copy the file(s) onto the server, not having to install anything. We only need to create a PDF with some text and images and a heading, that's all. Anyone know a good one? We are happy to buy if there is a good one that is easy to use. Thanks in advance.

    Read the article

  • sqrt(int_value + 0.0) ? The point?

    - by Earlz
    Hello, while doing some homework in my very strange C++ book, which I've been told before to throw away, had a very peculiar code segment. I know homework stuff always throws in extra "mystery" to try to confuse you like indenting 2 lines after a single-statement for-loop. But this one I'm confused on because it seems to serve some real-purpose. basically it is like this: int counter=10; ... if(pow(floor(sqrt(counter+0.0)),2) == counter) ... I'm interested in this part especially: sqrt(counter+0.0) Is there some purpose to the +0.0? Is this the poormans way of doing a static cast to a double? Does this avoid some compiler warning on some compiler I do not use? The entire program printed the exact same thing and compiled without warnings on g++ whenever I left out the +0.0 part. Maybe I'm not using a weird enough compiler?

    Read the article

  • Deleting a non-owned dynamic array through a pointer

    - by ayanzo
    Hello all, I'm relatively novice when it comes to C++ as I was weened on Java for much of my undergraduate curriculum (tis a shame). Memory management has been a hassle, but I've purchased a number books on ansi C and C++. I've poked around the related questions, but couldn't find one that matched this particular criteria. Maybe it's so obvious nobody mentions it? This question has been bugging me, but I feel as if there's a conceptual point i'm not utilizing. Suppose: char original[56]; cstr[0] = 'a'; cstr[1] = 'b'; cstr[2] = 'c'; cstr[3] = 'd'; cstr[4] = 'e'; cstr[5] = '\0'; char *shaved = shavecstr(cstr); delete[] cstrn; where char* shavecstr(char* cstr) { size_t len = strlen(cstr); char* ncstr = new char[len]; strcpy(ncstr,cstr); return ncstr; } In that the whole point is to have 'original' be a buffer that fills with characters and routinely has its copy shaved and used elsewhere. To prevent leaks, I want to free up the memory held by 'shaved' to be used again after it passes through some arguments. There is probably a good reason for why this is restricted, but there should be some way to free the memory as by this configuration, there is no way to access the original owner (pointer) of the data.

    Read the article

  • jQuery Equal Height Divs

    - by griegs
    If i have the following harkup; <div> <div> <div id='sameHeight'>One<br>two<br>three</div> <div id='sameHeight'>four</div> <div id='sameHeight'>five</div> <div> <div> <div id='sameHeight'>four</div> <div id='sameHeight'>six</div> <div id='sameHeight'>seven<br>eight</div> <div> </div> How can I ensure that all divs marked as "sameHeight" are the same height as their counterparts in the other div? I had a look at equalHeights plugin but that assumes all divs side by side are in the same parent. I need one that can either traverse parents or allow me to specify parents. Is there such a thing or do I need to write it?

    Read the article

  • SharePoint Custom Web Service not working for SSL configuration

    - by Carol
    Hi all, I did developed a custom SharePoint Web Service . It is working fine when using http. But when we configure SSL(https) , it is not working and throwing the below error. Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bcee11233hj' failed. Does anyone came accross a similar situation or any ideas on why this is happening? Thanks Carol

    Read the article

  • visual studio 2008 linker error

    - by ravi
    In visual studio 2008, I have created a static dll called test_static.dll. I am trying to call this from one application. I have included this dll in source files folder and the header file related to it in headers folder. When i am running the application I am getting following liking error. Please give me a solution. error LNK2019: unresolved external symbol "struct morph_output * __cdecl morpho_data(struct morph_input *)" (?morpho_data@@YAPAUmorph_output@@PAUmorph_input@@@Z) referenced in function _wmain 1D:\test_app\Debug\test_app.exe : fatal error LNK1120: 1 unresolved externals 1Build log was saved at "file://d:\test_app\test_app\Debug\BuildLog.htm" Here test_app is application that is using static dll. and morpho_data is the dll function which is taking input as structure and returning another structure.

    Read the article

  • selecting a row by means of a button ... using didSelectRowAtIndexPath

    - by John Smith
    hey people , I have a question concerning a button I would like to create which selects my previous selected row. This is what I came up so far but since I'm new with the functionality and such I could definately use some pointers I created a toolbar with a button and behind this button is the following action. -(void)clickRow { selectedRow = [self.tableView indexPathForSelectedRow]; [self.tableView:[self tableView] didSelectRowAtIndexPath:selectedRow]; } in my didSelectRowAtIndexPath there is a rootViewController being pushed rvController = [RootViewController alloc] ...etc So what I would like is my function clickRow to select the row and push the new rootviewcontroller (which has the right info since I'm using a tree ). I tried something like this as well -(void)clickRow { NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; NSArray *Children = [dictionary objectForKey:@"Children"]; rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]]; rvController.CurrentLevel += 1; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } The last function works a little but a little is not enough;) For instance if I press the middle row or any other it constantly selects the toprow. thnx all for those of you reading and trying to help

    Read the article

  • Hibernate Exception, what wrong ? [[Exception in thread "main" org.hibernate.InvalidMappingException

    - by user195970
    I use netbean 6.7.1 to write "hello world" witch hibernate, but I get some errors, plz help me, thank you very much. my exception init: deps-module-jar: deps-ear-jar: deps-jar: Copying 1 file to F:\Documents and Settings\My Dropbox\DropboxNetBeanProjects\loginspring\build\web\WEB-INF\classes compile-single: run-main: Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.2.5 Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Environment buildBytecodeProvider INFO: Bytecode provider name : cglib Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Configuration configure INFO: configuring from resource: /hibernate.cfg.xml Oct 25, 2009 2:44:05 AM org.hibernate.cfg.Configuration getConfigurationInputStream INFO: Configuration resource: /hibernate.cfg.xml Oct 25, 2009 2:44:06 AM org.hibernate.cfg.Configuration addResource INFO: Reading mappings from resource : hibernate/Tbluser.hbm.xml Oct 25, 2009 2:44:06 AM org.hibernate.util.XMLHelper$ErrorLogger error SEVERE: Error parsing XML: XML InputStream(1) Document is invalid: no grammar found. Oct 25, 2009 2:44:06 AM org.hibernate.util.XMLHelper$ErrorLogger error SEVERE: Error parsing XML: XML InputStream(1) Document root element "hibernate-mapping", must match DOCTYPE root "null". Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource hibernate/Tbluser.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:569) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508) at org.hibernate.cfg.Configuration.configure(Configuration.java:1428) at org.hibernate.cfg.Configuration.configure(Configuration.java:1414) at hibernate.CreateTest.main(CreateTest.java:22) Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:502) at org.hibernate.cfg.Configuration.addResource(Configuration.java:566) ... 7 more Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar found. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:250) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499) ... 8 more Java Result: 1 BUILD SUCCESSFUL (total time: 1 second) hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate</property> <property name="hibernate.connection.username">root</property> </session-factory> </hibernate-configuration> Tbluser.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated Oct 25, 2009 2:37:30 AM by Hibernate Tools 3.2.1.GA --> <hibernate-mapping> <class name="hibernate.Tbluser" table="tbluser" catalog="hibernate"> <id name="userId" type="java.lang.Integer"> <column name="userID" /> <generator class="identity" /> </id> <property name="username" type="string"> <column name="username" length="50" /> </property> <property name="password" type="string"> <column name="password" length="50" /> </property> <property name="email" type="string"> <column name="email" length="50" /> </property> <property name="phone" type="string"> <column name="phone" length="50" /> </property> <property name="groupId" type="java.lang.Integer"> <column name="groupID" /> </property> </class> </hibernate-mapping> Tbluser.java package hibernate; // Generated Oct 25, 2009 2:37:30 AM by Hibernate Tools 3.2.1.GA /** * Tbluser generated by hbm2java */ public class Tbluser implements java.io.Serializable { private Integer userId; private String username; private String password; private String email; private String phone; private Integer groupId; public Tbluser() { } public Tbluser(String username, String password, String email, String phone, Integer groupId) { this.username = username; this.password = password; this.email = email; this.phone = phone; this.groupId = groupId; } public Integer getUserId() { return this.userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return this.phone; } public void setPhone(String phone) { this.phone = phone; } public Integer getGroupId() { return this.groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } }

    Read the article

  • SqlCommandBuilder.DeriveParameters(command) and IsNullable

    - by Andrey
    I have written an O/R database wrapper that generates some wrapper methods for stored procs it reads from the database. Now I need to produce some custom wrapper code if an input parameter of a stored proc is defaulted to NULL. The problem is - I get stored proc parameters using: SqlCommandBuilder.DeriveParameters(command) and it doesn't bring parameter defaults. Is there any way to look up those defaults? Are they stored anywhere in the database? BTW, I'm using SQL Server 2008

    Read the article

  • string combinations

    - by vbNewbie
    I would like to generate a combination of words. For example if I had the following list: {cat, dog, horse, ape, hen, mouse} then the result would be n(n-1)/2 cat dog horse ape hen mouse (cat dog) (dog horse) (horse ape) (ape hen) (hen mouse) (cat dog horse) (dog horse ape) (horse ape hen) etc Hope this makes sense...everything I found involves permutations The list I have would be a 500 long

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >