Daily Archives

Articles indexed Wednesday June 9 2010

Page 5/126 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Android Proxy Cursor

    - by Alxandr
    I have a database with which I wish to expose data with a ContentProvider. However, it is important that all the colums are not exposed, and also they should be renamed. Is there any good way of doing this? I was thinking maybe some kind of proxy-cursor which takes a cursor and translates its columns to the desired ones, and calls to close and the like would just be replayed to the original cursor. Does something like this exist, or would it be hard to make?

    Read the article

  • Quit foreground programs at RDP logoff

    - by Haoest
    I have some running foreground programs that I wish to finish even if I log off my RDP session. For some reason if I log off for too long and come back, everything is gone, including open folders and text files. This doesn't happen if I log back on immediately. Is there a group policy or other setting that's telling Windows to close all my programs after I log off?

    Read the article

  • what makes a Tomcat5.5 cannot be "aware" of new Java Web Applications?

    - by Michael Mao
    This is for uni homework, but I reckon it is more a generic problem to the Tomcat Server(version 5.5.27) on my uni. The problem is, I first did a skeleton Java Web Application (Just a simple Servlet and a welcome-file, nothing complicated, no lib included) using NetBeans 6.8 with the bundled Tomcat 6.0.20 (localhost:8084/WSD) Then, to test and prove it is "portable" and "auto-deploy-able", I cleaned and built a WSD.war file and dropped it onto my Xampp Tomcat (localhost:8080/WSD). The war extracted everything accordingly and I can see identical output from this Tomcat. So far, so good. However, after I tried to drop to war onto uni server, funny thing happens: uni server Even though I've changed the war permission to 755, it is simply not "responding". I then copied the extracted files to uni server, the MainServlet cannot be recognized from within its Context Path "/WSD", basically nothing works, expect the static index.jsp. I tried several times to stop and restart uni Tomcat, it doesn't help? I wonder what makes this happen? Is there anything I did wrong with my approach? To be frank I paid no attention to a server not under my control, and I am unfortunately not a real active day-to-day Java Programmer now. I understand the fundamentals of MVC, Servelets, JSPs, JavaBeans, but I really feel frustrated by this, as I cannot see why... Or, should I ask, a Java Web Application, after cleaned and built by NetBeans6.8, is self-contained and self-configured so ready to be deployed to any Java Web Container? I know, I can certainly program everything in plain old JSP, but this is soooo... unacceptable to myself... Update : I am now wondering if there is any free Tomcat Hosting so that I would like to see if my war file and/or my web app can go with them without any configuration at all?

    Read the article

  • objective-c description method

    - by rocity
    Maybe I'm stupid...and this is my first question so forgive me...but when I run this code, I get the following output: (FROG idle:0 animating:0 rect:(null) position:{{1,2}{3,4}} tongue:{5,6}) This is wrong because it seems to be skipping the rect format string and placing everything displaced by one. So idle and animating are what i expect, then rect is skipped, but the result from NSStringFromCGRect(self.rect) is placed into position, then the result for position is pushed to tongue, then tongue is not displayed at all. I'm at a loss. - (NSString *)description{ return [NSString stringWithFormat:@"(FROG idle:%i animating:%i rect:%@ position:%@ tongue:%@)", self.idleTime, self.animating, NSStringFromCGRect(self.rect), NSStringFromCGPoint(self.position), tongue ]; }

    Read the article

  • Comparing text files w/ Junit

    - by jon077
    I am comparing text files in junit using: public static void assertReaders(BufferedReader expected, BufferedReader actual) throws IOException { String line; while ((line = expected.readLine()) != null) { assertEquals(line, actual.readLine()); } assertNull("Actual had more lines then the expected.", actual.readLine()); assertNull("Expected had more lines then the actual.", expected.readLine()); } Is this a good way to compare text files? What is preferred?

    Read the article

  • linq "let" translation

    - by luke
    I understand that when the C# compiler sees a linq query comprehension, it basically does a straight translation to the corresponding Linq Extension methods and lambdas. i.e. from x in list select x.property gets translated to: list.Select(x => x.property) my question is what do let clauses get translated to. for example how would this get translated by the compiler. from x in list let v = SomeComplexExpressionDependingOnx select v (p.s. i know this could be reduced to just select SomeComplexExpressionDependingOnx but i want to know how this is done in general) Thanks!

    Read the article

  • What can I do to improve a project if there is a no-listening situation. Developers vs Management

    - by NazGul
    Hi all, I hope that I'm not the only one and I can get a answer from someone with more experience than me, so I can think cleaner and I don't get depressed with this developer's life. I'm working as developer for a small company three years now. In that three years I'm working in the same project and sincerely, I think this project could be used as a CASE STUDY because it has all the situations that cannot happen in a project and that makes a project fails. To begin with, and I believe you've already noticed, the project has 3 years already (develoment only) and is still unfinished, because in every meeting there is a "new priority" ,or a "new problem" to be solve or a "new feature" to be add. So, first problem is no target set. How can you know when something is finished if you don't know what you want? I understand Management, because they see an oportunity and try to get that, but I don't understand how can they not see (or hear us) that they'll lose all they already have and what they'll eventually get. Second, there is no team group. My team consists of three people, a Senior Developer, a DBA and, finally, I for all the work (support, testing, new features, bug fixing, meeting, projet management of clients, etc) aka Junior Developer. The first (senior developer), does not perform any tests on his changes, so, most of the time, his changes give us problems (us = me, since I'm the one who will fix it). The second (DBA) is an uncompromising person and you can not talk to him, believe me, I tried! In his view, everything he does is fantastic... even if it is the most complicated to make it... And he does everything he wants, even if we need that only for 5 months later and would help some extra-hand to do the things we have to do for now. As you can see, there is very hard to work with no help... Third, there is no testings. Every... I repeat, Every release of the project, the customers wants to kill us, because there is a lot of bugs. Management? They say that they want tests before the release. Us? We say the same. Time? No time. Management? There is always some time to open the application and click in some buttons. Us? Try to explain that it is not so simple. Management doesn't care... end of story. Actually, must of the bugs could be avoid with a rigorous work... Some people just want to do the show to the Management. "Did you ask for this? Cool, it's done. Bugs? The Do-all-the-work guy will solve." Unfortunally for me, sometimes the Do-all-the-work also has to finish it. And to makes this all better, I'm the person who will listen the complaints from the customers. Cool, huh? I know, everyone makes mistakes. But there is mistakes and mistakes... To complete, in the Management view, "the problem is the lack of an individual project management", because we cannot do all the stuff they ask, even if there is no PM for the project itself. And ask us to work overtime without any reward... I do say all this stuff to the management and others members, but by telling this, the I'm the bad guy, the guy who is complain when everything is going well... but we need to work overtime... sigh What can I do to make it works? Anyone has a situation like this, what did you do? I hope you could understand my problem, my English is a little rusty. Thanks.

    Read the article

  • pass ...rest to a NetConnection call

    - by dome
    I want to pass a rest in a netconnection call, something like this: public function requestData(service : String, ...params) : void { nc.call(service, params); } this doesn't work since the call is expecting each parameter to be separated by commas, like: nc.call(service, params[0], params[1], params[2]); I've read some posts about apply, but I can't find a solution for this specific case.

    Read the article

  • The use of Javascript - stats?

    - by Luke
    I am looking at redesigning my website and was wondering if I could get some opinions. I know that the rule is usually to design with users without JS first and foremost, but having looked at the stats, it appears 95% of the users online have JS enabled. Would you recommend designing the website using JS and not bothering about people without it?

    Read the article

  • Can I to remove the labels from the bibliography and keeping it in the reference?

    - by Tae
    I'm writing the bibliography of my report with thebibliography environment because I don't need a BibTeX database (or I don't have the time for learn how to customize or write a style). Well, using the optional argument [label] I can specify as I want the cite references are show, for example: \bibitem[PNUD1996]{PNUD1996} PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. So, if I write: in \cite{PNUD1996}. it produces: in [PNUD1996]. But the label also appear in the bibliography: [PNUD1996] PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. Can I to remove the label from the bibliography and keeping it in the reference? I mean, to get: in [PNUD1996]. and PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. Thanks, and sorry for my English :(

    Read the article

  • How can I detect if a file is binary (non-text) in python?

    - by grieve
    How can I tell if a file is binary (non-text) in python? I am searching through a large set of files in python, and keep getting matches in binary files. This makes the output look incredibly messy. I know I could use grep -I, but I am doing more with the data than what grep allows for. In the past I would have just searched for characters greater than 0x7f, but utf8 and the like make that impossible on modern systems. Ideally the solution would be fast, but any solution will do.

    Read the article

  • PostgreSQL Crosstab Query

    - by schone
    Hi all, Does any one know how to create crosstab queries in PostgreSQL? For example I have the following table: Section Status Count A Active 1 A Inactive 2 B Active 4 B Inactive 5 I would like the query to return the following crosstab: Section Active Inactive A 1 2 B 4 5 Is this possible? Thanks!

    Read the article

  • CentOS, YUM Errors?

    - by mike
    Hi, I am using a Media Temple DV server with CentOS upon trying to install ImageMagick via yum, I get the following error: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib/python2.4/site-packages/rpm/_rpmmodule.so: undefined symbol: rpmdbCheckTerminate Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.4.3 (#1, May 24 2008, 13:47:28) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] Can anyone shed some light on what I might be able to do to fix this? Thanks!

    Read the article

  • Need help to figure out iptables rule

    - by Master
    I have this iptable rule listing Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- 127.0.0.1 0.0.0.0/0 tcp dpt:3306 acctboth all -- 0.0.0.0/0 0.0.0.0/0 VZ_INPUT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306 ACCEPT tcp -- 94.101.25.40 0.0.0.0/0 state NEW tcp dpt:3306 Chain FORWARD (policy DROP) target prot opt source destination VZ_FORWARD all -- 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy DROP) target prot opt source destination acctboth all -- 0.0.0.0/0 0.0.0.0/0 VZ_OUTPUT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 94.101.25.40 0.0.0.0/0 state NEW tcp dpt:3306 I want only localhost and my ip to access tcp 3306. Can i deleted all other rules as shown above. I don't know if i nned to keep any of them or not

    Read the article

  • How does Deep Zoom (Microsoft Seadragon) work?

    - by Norman Ramsey
    I saw an incredible on Photosynth and Seadragon, some "deep zoom" technology recently acquired by Microsoft. There's also a less responsive version on the web. I'd really like to know how the technology works. Blog entries and web pages welcome, but the ideal answer will include one or more references to published papers in the professional literature.

    Read the article

  • Vim: Use different ~/.vim/plugin/ directories for different versions of vim?

    - by Stefan Lasiewski
    Like many of you, my custom Vim configuration is stored in my ~/.vimrc, with the plugins, colors, etc. stored under ~/.vim/plugins, ~/.vim/colors, etc. I want to share a single Vim configuration among many servers. Some of these servers run Vim 7, some run the older Vim 6. Most Vim plugins are intended for Vim 7, but older versions still exist for those of us on older systems. See DirDiff for an example. If I am on a system which runs Vim 6, how can I configure Vim to only use Vim 6-compatible plugins? I was thinking about storing older plugins in a subdirectory like ~/.vim/plugins6/ and keep the Vim plugins in ~/.vim/plugins, but then how can I tell Vim6 to ignore ~/.vim/plugins and use ~/.vim/plugins6 instead?

    Read the article

  • struts2: problem in assigning a variable value to checkbox

    - by vivmal
    Hi All, I am working on struts2. In my jsp page I want to assign the value of a string variable to a checkbox (when it is checked by user). I tried it many times like - <% String code = "decompose"; %> 1) <tr><td> <s:checkbox name="codeCkBox" fieldValue="%{‘code’}" onclick="submit()"/> </td></tr> 2) <tr><td> <s:checkbox name="codeCkBox" value="%{‘code’}" onclick="submit()"/> </td></tr> 3) <tr><td> <s:set name="setCkBoxValue" value="%{‘code’}"/> <s:checkbox name="codeCkBox" fieldValue="# setCkBoxValue" onclick="submit()"/> </td></tr> But everytime when I tried to get this value by checkbox name it returns variable name i.e “code”. Looking for a solution. Thanks in advance.

    Read the article

  • Help on using paperclip plugin

    - by Brian Roisentul
    I've just installed this plugin, created the migrations, added everything I needed to make it work(I didn't install ImageMagick yet). The problem is when I get the upload control parameter to save it in my controller, I get something like this: #<File:C:\Users\Brian\AppData\Local\Temp\RackMultipart.2560.6677> instead of a simple string, like C:\Users\Brian\AppData\Local\Temp\RackMultipart.2560.6677 And if I try to read it I get the following exception: TypeError backtrace must be Array of String What am I doing wrong? How do I read it or simply get rid of the # and < symbols?

    Read the article

  • Objective-C stringWithFormat misses an argument?

    - by rocity
    When I run this code: - (NSString *)description{ return [NSString stringWithFormat:@"(FROG idle:%i animating:%i rect:%@ position:%@ tongue:%@)", self.idleTime, self.animating, NSStringFromCGRect(self.rect), NSStringFromCGPoint(self.position), tongue ]; } I get the following output: (FROG idle:0 animating:0 rect:(null) position:{{1,2}{3,4}} tongue:{5,6}) This is wrong because it seems to be skipping the rect format string and placing everything displaced by one. So idle and animating are what I expect, then rect is skipped, but the result from NSStringFromCGRect(self.rect) is placed into position, then the result for position is pushed to tongue, then tongue is not displayed at all. I'm at a loss.

    Read the article

  • Avoiding a fork()/SIGCHLD race condition

    - by larry
    Please consider the following fork()/SIGCHLD pseudo-code. // main program excerpt for (;;) { if ( is_time_to_make_babies ) { pid = fork(); if (pid == -1) { /* fail */ } else if (pid == 0) { /* child stuff */ print "child started" exit } else { /* parent stuff */ print "parent forked new child ", pid children.add(pid); } } } // SIGCHLD handler sigchld_handler(signo) { while ( (pid = wait(status, WNOHANG)) > 0 ) { print "parent caught SIGCHLD from ", pid children.remove(pid); } } In the above example there's a race-condition. It's possible for "/* child stuff */" to finish before "/* parent stuff */" starts which can result in a child's pid being added to the list of children after it's exited, and never being removed. When the time comes for the app to close down, the parent will wait endlessly for the already-finished child to finish. One solution I can think of to counter this is to have two lists: started_children and finished_children. I'd add to started_children in the same place I'm adding to children now. But in the signal handler, instead of removing from children I'd add to finished_children. When the app closes down, the parent can simply wait until the difference between started_children and finished_children is zero. Another possible solution I can think of is using shared-memory, e.g. share the parent's list of children and let the children .add and .remove themselves? But I don't know too much about this. EDIT: Another possible solution, which was the first thing that came to mind, is to simply add a sleep(1) at the start of /* child stuff */ but that smells funny to me, which is why I left it out. I'm also not even sure it's a 100% fix. So, how would you correct this race-condition? And if there's a well-established recommended pattern for this, please let me know! Thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >