Daily Archives

Articles indexed Monday April 12 2010

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

  • More advanced usage of interfaces

    - by owca
    To be honest I'm not quite sure if I understand the task myself :) I was told to create class MySimpleIt, that implements Iterator and Iterable and will allow to run the provided test code. Arguments and variables of objects cannot be either Collections or arrays. The code : MySimpleIt msi=new MySimple(10,100, MySimpleIt.PRIME_NUMBERS); for(int el: msi) System.out.print(el+" "); System.out.println(); msi.setType(MySimpleIterator.ODD_NUMBERS); msi.setLimits(15,30); for(int el: msi) System.out.print(el+" "); System.out.println(); msi.setType(MySimpleIterator.EVEN_NUMBERS); for(int el: msi) System.out.print(el+" "); System.out.println(); The result I should obtain : 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 15 17 19 21 23 25 27 29 16 18 20 22 24 26 28 30 And here's my code : import java.util.Iterator; interface MySimpleIterator{ static int ODD_NUMBERS=0; static int EVEN_NUMBERS = 1; static int PRIME_NUMBERS = 2; int setType(int i); } public class MySimpleIt implements Iterable, Iterator, MySimpleIterator { public MySimple my; public MySimpleIt(MySimple m){ my = m; } public int setType(int i){ my.numbers = i; return my.numbers; } public void setLimits(int d, int u){ my.down = d; my.up = u; } public Iterator iterator(){ Iterator it = this.iterator(); return it; } public void remove(){ } public Object next(){ Object o = new Object(); return o; } public boolean hasNext(){ return true; } } class MySimple { public int down; public int up; public int numbers; public MySimple(int d, int u, int n){ down = d; up = u; numbers = n; } } In the test code I have error in line when creating MySimpleIt msi object, as it finds MySimple instead of MySimpleIt. Also I have errors in for-each loops, because compiler wants 'ints' there instead of Object. Anyone has any idea on how to solve it ?

    Read the article

  • Setup SSL (self signed cert) with tomcat

    - by Danny
    I am mostly following this page: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html I used this command to create the keystore keytool -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat6/keystore and answered the prompts Then i edited my server.xml file and uncommented/edited this line <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/etc/tomcat6/keystore" keystorePass="tomcat" /> then I go to the web.xml file for my project and add this into the file <security-constraint> <web-resource-collection> <web-resource-name>Security</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> When I try to run my webapp I am met with this: Unable to connect Firefox can't establish a connection to the server at localhost:8443. * The site could be temporarily unavailable or too busy. Try again in a few moments. * If you are unable to load any pages, check your computer's network connection. If I comment out the lines I've added to my web.xml file, the webapp works fine. My log file in /var/lib/tomcat6/logs says nothing. I can't figure out if this is a problem with my keystore file, my server.xml file or my web.xml file.... Any assistance is appreciated I am using tomcat 6 on ubuntu.

    Read the article

  • SharePoint 2010 Web Parts in Action

    This article is taken from the book SharePoint 2010 Web Parts in Action. The author discusses export and import features of Web Parts and how to disable the export of Web Parts when confidentiality is a concern.

    Read the article

  • Remote Desktop Printing With Color

    - by philibertperusse
    Our ACCPACC administration software runs on an off-site dedicated hosted computer, running Windows 2003 Server with a completely different NT DOMAIN. We have many users connecting to that computer remotely to perform administrative tasks such as printing cheques, printing invoices, printing POs, packing slips and so on. Basically the setup is that we are all connecting using Remote Desktop Protocol (local computers are Mac OS.X, XP SP3, Vista and Windows 7). At our office we have a DOCUCOLOR 242 printer. When printing from the ACCPACC software, it prints to the local printer in our office. This is because we are using RDP features to connect printer ressources to the remote computer. This almost works now. I had to install the printer driver software on the remote 2003 Server for the printer sharing to work. Now, everyone is able to print black and white but color is out. NOTES: Normal users on that Windows 2003 server are running as part of a Group Policy Object to restrict what can be done. I took one of these normal users and gave him all domain administrator rights, no effect still B&W only. I took this account and moved it OUT of GPO policies, as a normal account instead, no effect still B&W only. It seems only MY account (which is domain administrator AND a normal account not part of the GPO objects) can actually print with color. This is the account that was used for installing the printer driver software. How can I manage to get everyone to print in color? Any suggestions as to what to try next?

    Read the article

  • Best practices for settings for Oracle database creation

    - by Gary
    When installing an Oracle Database, what non-default settings would you normally apply (or consider applying) ? I'm not after hardware dependent setting (eg memory allocation) or file locations, but more general items. Similarly anything that is a particular requirement for a specific application rather than generally applicable isn't really useful. Do you separate out code/API schemas (PL/SQL owners) from data schemes (table owners) ? Do you use default or non-default roles, and if the latter, do you password protect the role ? I'm also interested in whether there's any places where you do a REVOKE of a GRANT that is installed by default. That may be version dependent as 11g seems more locked down for its default install. These are ones I used in a recent setup. I'd like to know whether I missed anything or where you disagree (and why). Database Parameters Auditing (AUDIT_TRAIL to DB and AUDIT_SYS_OPERATIONS to YES) DB_BLOCK_CHECKSUM and DB_BLOCK_CHECKING (both to FULL) GLOBAL_NAMES to true OPEN_LINKS to 0 (did not expect them to be used in this environment) Character set - AL32UTF8 Profiles I created an amended password verify function that used the apex dictionary table (FLOWS_030000.wwv_flow_dictionary$) as an extra check to prevent simple passwords. Developer logins CREATE PROFILE profile_dev LIMIT FAILED_LOGIN_ATTEMPTS 8 PASSWORD_LIFE_TIME 32 PASSWORD_REUSE_TIME 366 PASSWORD_REUSE_MAX 12 PASSWORD_LOCK_TIME 6 PASSWORD_GRACE_TIME 8 PASSWORD_VERIFY_FUNCTION verify_function_11g SESSIONS_PER_USER unlimited CPU_PER_SESSION unlimited CPU_PER_CALL unlimited PRIVATE_SGA unlimited CONNECT_TIME 1080 IDLE_TIME 180 LOGICAL_READS_PER_SESSION unlimited LOGICAL_READS_PER_CALL unlimited; Application login CREATE PROFILE profile_app LIMIT FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LIFE_TIME 999 PASSWORD_REUSE_TIME 999 PASSWORD_REUSE_MAX 1 PASSWORD_LOCK_TIME 999 PASSWORD_GRACE_TIME 999 PASSWORD_VERIFY_FUNCTION verify_function_11g SESSIONS_PER_USER unlimited CPU_PER_SESSION unlimited CPU_PER_CALL unlimited PRIVATE_SGA unlimited CONNECT_TIME unlimited IDLE_TIME unlimited LOGICAL_READS_PER_SESSION unlimited LOGICAL_READS_PER_CALL unlimited; Privileges for a standard schema owner account CREATE CLUSTER CREATE TYPE CREATE TABLE CREATE VIEW CREATE PROCEDURE CREATE JOB CREATE MATERIALIZED VIEW CREATE SEQUENCE CREATE SYNONYM CREATE TRIGGER

    Read the article

  • How to Convert Your Nice Designs to Wordpress

    If you already spent ample time on the net, you have probably heard about WordPress before. It is an easy to use blog platform that also seconds as a fully competent content management system all ove... [Author: Kewin Alexander - Web Design and Development - April 12, 2010]

    Read the article

  • Kohana -- Command Line

    - by swt83
    I'm trying to "faux-fork" a process (an email being sent via SMTP) in my web application, and the application is built on Kohana. $command = 'test/email'; exec('php index.php '.$command.' > /dev/null/ &', $errors, $response); I'm getting an error -- Notice: Undefined index: SERVER_NAME When I look into Kohana's index.php file, I see that it is looking for a variable named SERVER_NAME, but I guess it is coming up NULL because Kohana couldn't detect this value and set it prior to run. Any ideas how to get Kohana to run via command line?

    Read the article

  • Transmitting complex objects using TCP in C#

    - by Rakesh K
    Hi, I have a client server application in which I need to transmit a user defined object from Client to Server using TCP connection. My object is of the following structure: class Conversation { private string convName, convOwner; public ArrayList convUsers; public string getConvName() { return this.convName; } public string getConvOwner() { return this.convOwner; } } Please help me how to trnasmit this object at from client and again de-serialize it into appropriate object at server side. Thanks, Rakesh K.

    Read the article

  • What is a SMS gateway

    - by user311107
    What exactly is and SMS gateway, are "OZEKI" and "KANNEL" the same. Also are they the only thing to send and receive sms from and through your application or you also need additional hardware - "GSM MODEM"??... Finally to you need a service provider to suscribe to?..., and per per sms??....

    Read the article

  • Wicket: Relative to absolute URL or get base URL

    - by Gilean
    If I have a relative path to a static asset (flash/blah.swf), what is the best way to convert this to an absolute URL (http://localhost/app/flash/blah.swf)? Or what is the best way to get the base URL of the Wicket application? I've tried using RequestUtils.toAbsolutePath but it doesn't seem to work reliably and is frequently throwing exceptions.

    Read the article

  • Why did this work with Visual C++, but not with gcc?

    - by Carlos Nunez
    I've been working on a senior project for the last several months now, and a major sticking point in our team's development process has been dealing wtih rifts between Visual-C++ and gcc. (Yes, I know we all should have had the same development environment.) Things are about finished up at this point, but I ran into a moderate bug just today that had me wondering whether Visual-C++ is easier on newbies (like me) by design. In one of my headers, there is a function that relies on strtok to chop up a string, do some comparisons and return a string with a similar format. It works a little something like the following: int main() { string a, b, c; //Do stuff with a and b. c = get_string(a,b); } string get_string(string a, string b) { const char * a_ch, b_ch; a_ch = strtok(a.c_str(),","); b_ch = strtok(b.c_str(),","); } strtok is infamous for being great at tokenizing, but equally great at destroying the original string to be tokenized. Thus, when I compiled this with gcc and tried to do anything with a or b, I got unexpected behavior, since the separator used was completely removed in the string. Here's an example in case I'm unclear; if I set a = "Jim,Bob,Mary" and b="Grace,Soo,Hyun", they would be defined as a="JimBobMary" and b="GraceSooHyun" instead of staying the same like I wanted. However, when I compiled this under Visual C++, I got back the original strings and the program executed fine. I tried dynamically allocating memory to the strings and copying them the "standard" way, but the only way that worked was using malloc() and free(), which I hear is discouraged in C++. While I'm curious about that, the real question I have is this: Why did the program work when compiled in VC++, but not with gcc? (This is one of many conflicts that I experienced while trying to make the code cross-platform.) Thanks in advance! -Carlos Nunez

    Read the article

  • Facing problem in configuring Reporting Server

    - by idrees99
    Hi all, I am using Sql server 2005 express edition and i want to Install and configure Reporting server on my local machine.Now i have installed the reporting server but the issue is that i am unable to configure it properly.when ever i go to start the reporting services it gives me the following message: THE SQL SERVER REPORTING SERVICE(SQLEXPRESS)service on Local computer started and then stopped. Some services stop automatically if they have no work to do, for example, the performance Logs and Alerts service. I am using WindowsXp Professional. plz help me out as i have just started using sql server and i dont have any idea.

    Read the article

  • algorithm optimization: returning object and sub-objects from single SQL statement in PHP

    - by pocketfullofcheese
    I have an object oriented PHP application. I have a simple hierarchy stored in an SQL table (Chapters and Authors that can be assigned to a chapter). I wrote the following method to fetch the chapters and the authors in a single query and then loop through the result, figuring out which rows belong to the same chapter and creating both Chapter objects and arrays of Author objects. However, I feel like this can be made a lot neater. Can someone help? function getChaptersWithAuthors($monographId, $rangeInfo = null) { $result =& $this->retrieveRange( 'SELECT mc.chapter_id, mc.monograph_id, mc.chapter_seq, ma.author_id, ma.monograph_id, mca.primary_contact, mca.seq, ma.first_name, ma.middle_name, ma.last_name, ma.affiliation, ma.country, ma.email, ma.url FROM monograph_chapters mc LEFT JOIN monograph_chapter_authors mca ON mc.chapter_id = mca.chapter_id LEFT JOIN monograph_authors ma ON ma.author_id = mca.author_id WHERE mc.monograph_id = ? ORDER BY mc.chapter_seq, mca.seq', $monographId, $rangeInfo ); $chapterAuthorDao =& DAORegistry::getDAO('ChapterAuthorDAO'); $chapters = array(); $authors = array(); while (!$result->EOF) { $row = $result->GetRowAssoc(false); // initialize $currentChapterId for the first row if ( !isset($currentChapterId) ) $currentChapterId = $row['chapter_id']; if ( $row['chapter_id'] != $currentChapterId) { // we're on a new row. create a chapter from the previous one $chapter =& $this->_returnFromRow($prevRow); // set the authors with all the authors found so far $chapter->setAuthors($authors); // clear the authors array unset($authors); $authors = array(); // add the chapters to the returner $chapters[$currentChapterId] =& $chapter; // set the current id for this row $currentChapterId = $row['chapter_id']; } // add every author to the authors array if ( $row['author_id'] ) $authors[$row['author_id']] =& $chapterAuthorDao->_returnFromRow($row); // keep a copy of the previous row for creating the chapter once we're on a new chapter row $prevRow = $row; $result->MoveNext(); if ( $result->EOF ) { // The result set is at the end $chapter =& $this->_returnFromRow($row); // set the authors with all the authors found so far $chapter->setAuthors($authors); unset($authors); // add the chapters to the returner $chapters[$currentChapterId] =& $chapter; } } $result->Close(); unset($result); return $chapters; } PS: the _returnFromRow methods simply construct an Chapter or Author object given the SQL row. If needed, I can post those methods here.

    Read the article

  • Using jQuery.getJSON in Chrome Extension

    - by Paul Tarjan
    I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I'd rather stick to just jQuery idioms (so my javascript can also work as a <script src="">). I do the normal: $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", callback(function(data) { alert(data); }); but in the error console I see: Uncaught ReferenceError: jsonp1271044791817 is not defined Is jQuery not inserting the callback function correctly into the document? What can I do to make this work?

    Read the article

  • Load XML file into object. Best method?

    - by Cypher
    Hello, We are receiving an XML file from our client. I want to load the data from this file into a class, but am unsure about which way to go about it. I have an XSD to defining what is expected in the XML file, so therefore i can easily validate the XML file. Can i use the XSD file to load the data into a POCO, using some sort of serialization? The other way i was thinking was to load the xml into a XMLDocument and use XPath to populate each property in my class. Cheers for any advice

    Read the article

  • Open Visual Web Developer Express file in Visual Studio Professional

    - by a_m0d
    I started working on an Asp.net MVC website using Visual Web Developer Express 2008 a while ago. Just recently, I managed to get my hands on a copy of Visual Studio 2008 Professional (through DreamSpark). I installed the Service Pack, and also the MVC2 files for Visual Studio. However, now I can't open my project anymore. When I try to open the solution in Visual Studio, it tells me that the project type is not supported. Does this mean that I have to resort to using VWD Express again? Note: I installed MVC2 through the Web Platform Installer, and it says that it installed successfully, but yet when I restart the WPI, the box next to MVC2 isn't checked; if I check it and click "Install", it finishes the install process instantly and tells me that it was successful.

    Read the article

  • render_to_string from a rake task

    - by Horace Loeb
    I want to use a Rake task to cache my sitemap so that requests for sitemap.xml won't take forever. Here's what I have so far: @posts = Post.all sitemap = render_to_string :template => 'sitemap/sitemap', :locals => {:posts => @posts}, :layout => false Rails.cache.write('sitemap', sitemap) But when I try to run this, I get an error: undefined local variable or method `headers' for #<Object:0x100177298> How can I render a template to a string from within Rake?

    Read the article

  • Make PasswordRecovery control work with locked out users ?

    - by Moe Sisko
    Example scenario in an ASP.NET application using SQL Server membership provider : 1) a user can't remember their exact password, and tries many times in a short space of time to login with an invalid password (say 5 times in a 10 minute window). This locks out the user (i.e. sets the IsLockedOut flag of the aspnet_Membership table to 1). 2) user goes to the "forgot my password" screen to try to get a new password emailed to them. This screen uses the PasswordRecovery control. User enters their correct user id, but then cannot go further in the password recovery process, since the IsLockedOut flag is 1. (They don't even get to see their security question). 3) The user would then have to phone tech support to get themselves unlocked etc. To reduce the burden on support staff, we are trying to eliminate step 3) if possible, by making the PasswordRecovery control (if possible), work with locked out users. i.e. when they enter their login ID, the security question comes up, and IF they enter the correct answer, the system will unlock the user, then send the new email to them. I'm wondering if it is possible to tweak the PasswordRecovery control to do this. Or maybe I'm approaching this the wrong way ?

    Read the article

  • What's going to replace HTML & CSS & JS?

    - by Nigel Thorne
    HTML and CSS are showing their age. SASS generates CSS (because CSS isn't clean enough). Graphic Designers don't work in HTML, they work in graphics tools then have to translate it to HTML/CSS. JavaScript has to have abstractions like jQuery, and CSS has a bunch of hacks to even start approaching consistent predictable user experience. It feels like people are doing some wonderful things despite the technologies, not because of them. Surely there is a better way?!? Something more closely aligned with the task at hand.. of providing a fluid intuitive (consistent) user experience to let users achieve their goals. Thoughts?

    Read the article

  • How To Choose Right Internet Fax Service?

    To choose the right Internet fax service, you will have to necessarily do some pre-study. You must review the different service provider companies, their reliability and track record, pricing etc. Yo... [Author: James Allen - Computers and Internet - April 12, 2010]

    Read the article

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