Daily Archives

Articles indexed Thursday March 11 2010

Page 18/97 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Problems using LightBox 2 with IE7

    - by Ebircsa
    I'm having a problem with IE7 when clicking on images that open up using the Lightbox 2 javascript image viewer. Instead of overlaying the image on the current page it opens the image into a separate page. Not sure if this is an AJAX problem possibly ? Works fine in Firefox. Anybody else come across this before ?

    Read the article

  • Alright, I'm still stuck on this homework problem. C++

    - by Josh
    Okay, the past few days I have been trying to get some input on my programs. Well I decided to scrap them for the most part and try again. So once again, I'm in need of help. For the first program I'm trying to fix, it needs to show the sum of SEVEN numbers. Well, I'm trying to change is so that I don't need the mem[##] = ####. I just want the user to be able to input the numbers and the program run from there and go through my switch loop. And have some kind of display..saying like the sum is?.. Here's my code so far. #include <iostream> #include <iomanip> #include <ios> using namespace std; int main() { const int READ = 10; const int WRITE = 11; const int LOAD = 20; const int STORE = 21; const int ADD = 30; const int SUBTRACT = 31; const int DIVIDE = 32; const int MULTIPLY = 33; const int BRANCH = 40; const int BRANCHNEG = 41; const int BRANCHZERO = 42; const int HALT = 43; int mem[100] = {0}; //Making it 100, since simpletron contains a 100 word mem. int operation; //taking the rest of these variables straight out of the book seeing as how they were italisized. int operand; int accum = 0; // the special register is starting at 0 int counter; for ( counter=0; counter < 100; counter++) mem[counter] = 0; // This is for part a, it will take in positive variables in //a sent-controlled loop and compute + print their sum. Variables from example in text. mem[0] = 1009; mem[1] = 1109; mem[2] = 2010; mem[3] = 2111; mem[4] = 2011; mem[5] = 3100; mem[6] = 2113; mem[7] = 1113; mem[8] = 4300; counter = 0; //Makes the variable counter start at 0. while(true) { operand = mem[ counter ]%100; // Finds the op codes from the limit on the mem (100) operation = mem[ counter ]/100; //using a switch loop to set up the loops for the cases switch ( operation ){ case READ: //reads a variable into a word from loc. Enter in -1 to exit cout <<"\n Input a positive variable: "; cin >> mem[ operand ]; counter++; break; case WRITE: // takes a word from location cout << "\n\nThe content at location " << operand << " is " << mem[operand]; counter++; break; case LOAD:// loads accum = mem[ operand ];counter++; break; case STORE: //stores mem[ operand ] = accum;counter++; break; case ADD: //adds accum += mem[operand];counter++; break; case SUBTRACT: // subtracts accum-= mem[ operand ];counter++; break; case DIVIDE: //divides accum /=(mem[ operand ]);counter++; break; case MULTIPLY: // multiplies accum*= mem [ operand ];counter++; break; case BRANCH: // Branches to location counter = operand; break; case BRANCHNEG: //branches if acc. is < 0 if (accum < 0) counter = operand; else counter++; break; case BRANCHZERO: //branches if acc = 0 if (accum == 0) counter = operand; else counter++; break; case HALT: // Program ends break; } } return 0; } part B int main() { const int READ = 10; const int WRITE = 11; const int LOAD = 20; const int STORE = 21; const int ADD = 30; const int SUBTRACT = 31; const int DIVIDE = 32; const int MULTIPLY = 33; const int BRANCH = 40; const int BRANCHNEG = 41; const int BRANCHZERO = 41; const int HALT = 43; int mem[100] = {0}; int operation; int operand; int accum = 0; int pos = 0; int j; mem[22] = 7; // loop 7 times mem[25] = 1; // increment by 1 mem[00] = 4306; mem[01] = 2303; mem[02] = 3402; mem[03] = 6410; mem[04] = 3412; mem[05] = 2111; mem[06] = 2002; mem[07] = 2312; mem[08] = 4210; mem[09] = 2109; mem[10] = 4001; mem[11] = 2015; mem[12] = 3212; mem[13] = 2116; mem[14] = 1101; mem[15] = 1116; mem[16] = 4300; j = 0; while ( true ) { operand = memory[ j ]%100; // Finds the op codes from the limit on the memory (100) operation = memory[ j ]/100; //using a switch loop to set up the loops for the cases switch ( operation ){ case 1: //reads a variable into a word from loc. Enter in -1 to exit cout <<"\n enter #: "; cin >> memory[ operand ]; break; case 2: // takes a word from location cout << "\n\nThe content at location " << operand << "is " << memory[operand]; break; case 3:// loads accum = memory[ operand ]; break; case 4: //stores memory[ operand ] = accum; break; case 5: //adds accum += mem[operand];; break; case 6: // subtracts accum-= memory[ operand ]; break; case 7: //divides accum /=(memory[ operand ]); break; case 8: // multiplies accum*= memory [ operand ]; break; case 9: // Branches to location j = operand; break; case 10: //branches if acc. is < 0 break; case 11: //branches if acc = 0 if (accum == 0) j = operand; break; case 12: // Program ends exit(0); break; } j++; } return 0; }

    Read the article

  • Automatically adjustment of wxPython Frame Size

    - by MA1
    Hi All How to adjust the wxPython Frame Size automatically when screen resolution change? Actually, i have just written a wxPython application, currently Frame size is fixed. Due to this application/frame size is very large on some screen resolutions. So, how to resize/adjust automatically depending on the screen resolution size? Regards,

    Read the article

  • Headers to set for AJAX calls in a custom webserver

    - by ErJab
    I'm writing a custom web server. When I enter the URL of my server in the browser, I get the sample text I write out to the socket in my browser correctly. This is the HTTP response that I write: HTTP/1.1 200 OK\r\n Server: My Server\r\n Date: Blah\r\n \r\n This is some sample text. This appears in my browser correctly when I connect directly to the server entering the URL. However, if I use Ajax (jQuery) to access the same URL and then set the innerHTML of an element on the HTML page, I do not get any data printed. Is there any other header I need to set on my web server so that the browser's XMLHttpRequest object detects the response?

    Read the article

  • Macs don't connect to wifi access point but PCs will

    - by Josh
    So, as a side project I'm going to try and figure out why the wifi APs in my building exhibit the following behavior: - They typically allow all types of computers to connect without issues - Sometimes Apples can't get an IP address but will still connect to the AP's signal - Less often, PCs can't connect to the wifi (same as above - yes signal, no IP addy) - Don't let Raiders fans on no matter the time of day! My first thought was that the DHCP leases were all taken up when the Apples would try to connect, and it was just their unlucky timing, but I would then try to log on with a PC that had a new, unleased MAC address and it would work... Could this be something to do with interoperability between an apple wifi card, and the APs? Different parts of the DHCP lease being taken up first? The fact that the Seattle Mariners might actually be good this year?? If this hasn't used up everyone's patience (with my crappy sports jokes), something else I could use some help with: - We don't have the model or type of AP - This is because there is no documentation available for them, and they literally look like small white boxes with no writing on them. Also, the company that installed them is out of business, so the situation might be that no docs will ever be on the way. -- Do you guys have any ideas on how to figure out what we have? Thanks as always for all the help, and I'm looking forward to the day when I know enough to start contributing back to the site, Josh

    Read the article

  • C#: How to parse a hexadecimal digit

    - by Biosci3c
    Okay, I am working on a card playing program, and I am storing card values as hexadecimal digits. Here is the array: public int[] originalCards = new int[54] { 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x50, 0x51 }; The first digit refers to the suit (1 = spades; 2 = clubs; .... 5 = Jokers) The second digit is the number of the card (1 = ace, 5 = 5; 13 = K, etc). I would like to do something like the following: Pseudocode: public int ReturnCard(int num) { int card = currentDeck[num]; int suit = card.firsthexdigit; int value = card.secondhexdigit; return 0; } I don't need a new method to work on ints, I just included it for clarity's sake. Anybody know how to do this in C#?

    Read the article

  • as3 tracking number value of variables

    - by Wade D Ouellet
    Hi, I have a bunch an as3 game going. In my game when newCrag hits egg_mc the score gets added. // Add the score var newScore:score_mc; newScore = new score_mc(); addChild(newScore); newScore.x = 20; newScore.y = 20; newScore.score_txt.text='0/15'; var score:Number=0; function getEggs(event:Event):void { if(event.target.hitTestObject(MovieClip(root).newCrag) && event.target is egg_mc) { sndEgg.play(); if(event.target.stage) { event.target.parent.removeChild(event.target); } // Increase score score++; newScore.score_txt.text = "" + score + '/15'; } } I am trying to refer to the number value of the score using if statements. I need to change the speed variables based off the number that is inside the score box. var speed:Number if(score > 10 || score == 10) { speed=20; trace("speed3"); } else if(score > 5 || score == 5 && score < 10) { speed=18; trace("speed2"); } else { speed=14; trace("speed1"); } However, this part of the code is not working. Any help would be much appreciated. Thanks, Wade

    Read the article

  • Struts2 + Sitemesh + Freemarker doesn't work

    - by jdoklovic
    I've tried following every example i ccould find and i can't get struts2 + sitemesh + freemarker to work on a simple jsp. I have a very simple web.xml, a single action that just goes to index.jsp, and a simple .ftl decorator that just adds some text to the result. When i hit index.action, the page "seems" to be decorated, but I get the literal ${body} instead of the actual contents. here's my setup: web.xml <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <description>struts2 test</description> <display-name>struts 2 test</display-name> <filter> <filter-name>struts-prepare</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class> </filter> <filter> <filter-name>sitemesh</filter-name> <filter-class>org.apache.struts2.sitemesh.FreeMarkerPageFilter</filter-class> </filter> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts-prepare</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <welcome-file-list> <welcome-file>index.action</welcome-file> </welcome-file-list> </web-app> struts.xml <struts> <constant name="struts.devMode" value="true"/> <package name="basicstruts2" extends="struts-default"> <action name="index"> <result>/index.jsp</result> </action> </package> </struts> sitemesh.xml <sitemesh> <property name="decorators-file" value="/WEB-INF/decorators.xml" /> <excludes file="${decorators-file}" /> <page-parsers> <parser default="true" class="com.opensymphony.module.sitemesh.parser.DefaultPageParser"/> <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/> </page-parsers> <decorator-mappers> <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper"> <param name="config" value="${decorators-file}" /> </mapper> </decorator-mappers> </sitemesh> decorators.xml <decorators defaultdir="/decorators"> <decorator name="main" page="main.ftl"> <pattern>/*</pattern> </decorator> </decorators> main.ftl <html> <head> <title>${title}</title> ${head} </head> <body> I'm Fancy!<br> ${body}<br /> </body> </html> index.jsp <html> <head> <title>my title</title> </head> <body> my body </body> </html> Any ideas???

    Read the article

  • Creating a Facebook session for getting page info

    - by Marty Haught
    I am trying to get info on a page that my user is admin for. This user has granted my fb_connect app offline access. I have saved the session_key that allows offline access (it has the user's id in it). I am able to publish to this fan page with this session key. But when I try to access the page's info I get an SessionExpired error. This doesn't make sense. Look at the code and output below: p is is a 'profile' object that holds the three pieces of relevant fb data (user_id, session_key and page id) fb_session = Facebooker::Session.create = # fb_session.secure_with!(p.fb_session_key, p.fb_user_id, 0) = nil fb_session.user.has_permission?("offline_access") = true fb_session.user.has_permission?("publish_stream") = true fb_session.user.has_permission?("read_stream") = true pages = fb_session.fql_query("select fan_count from page where page_id = #{p.fb_page_id}") Facebooker::Session::SessionExpired: Session key invalid or no longer valid ... pages = fb_session.pages(:fields = {:page_ids = p.fb_page_id}) Facebooker::Session::SessionExpired: Session key invalid or no longer valid ... pages = Facebooker::Session.create.fql_query("select fan_count from page where page_id = #{p.fb_page_id}") = [#] Perhaps I'm not creating the session right or maybe offline access doesn't give me access to the user's page even though I have permissions to push to it. As you can see when I just use an anon session I'm able to get the fan count, which I'm guessing is publicly available. Does anyone have an idea on this?

    Read the article

  • How can I force Doxygen to show full include path?

    - by Artyom
    How can I force Doxygen to show full include path? What do I mean: I have a class foo::bar::bee defined in bee.hpp in following directory structure: foo foo/bar foo/bar/bee.hpp Doxygen, when it documents foo::bar::bee class tells that you need to include <bee.hpp>, but for my software I need <foo/bar/bee.hpp> How can I cause Doxygen to do this? Notes: FULL_PATH_NAMES is already set to default YES I do not want to provide include header explicitly for each class, because there too many of them. I want Doxygen to do this automatically. Thanks.

    Read the article

  • Using a dictionary file with sed

    - by Winston
    I have a blacklist.txt file that contains keywords I want to remove using sed. Here's what the blacklist.txt file contain winston@linux ] $ cat blacklist.txt obscure keywords here ... And here's what I have so far, but currently doesn't work. blacklist=$(cat blacklist.txt); output="filtered_file.txt" for i in $blacklist; do cat $input | sed 's/$i//g' >> $output done

    Read the article

  • jQuery closing pop-up after successful form submit

    - by RyanP13
    Hi, I have a pop up form that i wish to close on successfull submit of the form. Currently we are only validating on the server side which will create an unordered list of validation errors with the class .error_message. Once the form has been successfully submitted i want to close the window. Currently the jQuery i am using for this is as follows but does not work because the first time the form has been submitted the number of error messages will always be zero. $(document).ready(function() { $('form#emailQuote').submit(function() { var $emailErrors = $('form#emailQuote ul.error_message').length; alert($emailErrors); if ($emailErrors == 0) { //window.close(); alert('no errors'); } else { //alert('errors'); alert('errors'); } }); });

    Read the article

  • Axis2 attachments are vanishing in the response

    - by Shamik
    I am using axis2 to come up with a basic web service which will get the file name as parameter and produces a response SOAP packet which will have the file attached along with the SOAP. Here is the way I am creating the service code (its simple and inspired by Axis2 sample code) public String getFile(String name) throws IOException { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); File file = new File (name); System.out.println("File = " + name); System.out.println("File exists = " + file.exists()); FileDataSource fileDataSource = new FileDataSource(file); System.out.println("fileDataSource = " + fileDataSource); DataHandler dataHandler = new DataHandler(fileDataSource); System.out.println("DataHandler = " + dataHandler); String attachmentID = msgCtx.addAttachment(dataHandler); System.out.println("attachment ID = " + attachmentID); return attachmentID; } Now The client side code - MessageContext response = mepClient .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); SOAPBody body = response.getEnvelope().getBody(); OMElement element = body.getFirstElement().getFirstChildWithName( new QName("http://service.soapwithattachments.sample","return")); String attachementId = element.getText(); System.out.println("attachment id is " + attachementId); Attachments attachment = response.getAttachmentMap(); DataHandler dataHandler = attachment.getDataHandler(attachementId); Problem is that dataHandler is always null. Though I think at the server side, the file was read and attached along with the SOAP packet. Am I doing something wrong ? EDIT : I have put <parameter name="enableSwA" locked="false">true</parameter> in the axis2.xml file.

    Read the article

  • What is a good programming language/environment for Linux database applications?

    - by Dkellygb
    I could use some advice on my move from the Windows world to Linux. For my business, I have used VB6 and Microsoft Access with both Access databases and SQL server in the past. The easy to use forms, report writers and programming language were perfect for CRUD apps and analysis for our small hotel/restaurant business. After using Linux at home for some time I would like to convert our small business. Our server is already a Linux box using Samba. I am happy with the OpenOffice.org applications instead of Microsoft Office. The only thing which is holding me back is a desktop database application where I can develop the forms and reports we require. Base does not seem to be up to the job yet from my experience. I would like something like VB.Net with visual studio (express) but I would like to avoid Mono – I just don’t see the point of it. (You can correct me if I’m wrong.) But a good collection of forms, controls and a good report writer would be ideal. I have looked at web based stuff like Ruby on Rails, but I think a webserver for our 5 pc network is overkill. I don’t mind running a proper database on our Ubuntu 9.10 server. I may have exposed a few prejudices above but my mind is open. Any thoughts?

    Read the article

  • Creating Pages with unique PageMaps

    - by Michael Krauklis
    I have a wicket Application that has long lived Pages. I would like each instance of this Page to be created with a unique PageMap for reasons I won't get into here, but when I try to specify a PageMap on the constructor of my Page I end up getting OOM and StackOverflow errors. Here is the code: public <CTOR>() { super(Session.get().newPageMap("" + System.currentTimeMillis())); ... I'm using a custom BookmarkablePageLink (custom in that it does not pass on the current PageMap name to the new Page) to effectively abandon the old Page/PageMap and create a new one with a new PageMap. The errors seem to be coming from page serialization after only two or three pages have been created. Can anyone find issue with this approach?

    Read the article

  • Dependency Injection Constructor Madness

    - by JP
    I find that my constructors are starting to look like this: public MyClass(Container con, SomeClass1 obj1, SomeClass2, obj2.... ) with ever increasing parameter list. Since "Container" is my dependency injection container, why can't I just do this: public MyClass(Container con) for every class? What are the downsides? If I do this, it feels like I'm using a glorified static. Please share your thoughts on IoC and Dependency Injection madness. Thanks in advance. -JP

    Read the article

  • Filter string in C

    - by Paul Tarjan
    How can I filter a string in c? I want to remove anything that isn't [a-z0-9_]. int main(int argc, char ** argv) { char* name = argv[1]; // remove anything that isn't [a-z0-9_] printf("%s", name); }

    Read the article

  • How does browser search tool work on web page?

    - by GTM
    I am trying to figure out how the search tool in a web browser is being able to parse through the entire web page(assuming huge content on a page) and highlight the result as we type. Does it pre-cache the page while loading in a map or use regex to get a quick result on the fly?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >