Daily Archives

Articles indexed Wednesday June 16 2010

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

  • Is this the right way to organize my database tables?

    - by Moss
    So I'm making a website that allows users to build contact lists. So their are users, the users have lists, and the lists have contacts. It seems to me that I need 3 tables for this but I just want to make sure. There would be a User table of course, and then a "List of Lists" table that has the username, and listname, as primary key along with whatever other info we want to attach to the lists as a whole. Finally, for lack of a better word, the List table which would again have the username/listname p.k., then the contact ID and notes and such that the user attaches to that contact on that specific list. I hope that is a clear explanation. For some reason I feel unsure about this arrangement. For one thing if the website becomes popular the List table could swell to billions of rows. And it also feels a little weird that everybody's list info is all jumbled up in the same table. I suppose I could create separate tables for each user and even for each list but that seems like a bad idea for other reasons. My db explanation assumes I can use foreign keys on my tables which at the moment isn't actually an option. If I can't get InnoDB tables enabled I will probably use ID's for the lists instead of depending on a compound key. Maybe I should do this anyway?

    Read the article

  • Design patterns and interview question

    - by user160758
    When I was learning to code, I read up on the design patterns like a good boy. Long after this, I started to actually understand them. Design discussions such as those on this site constantly try to make the rules more and more general, which is good. But there is a line, over which it becomes over-analysis starts to feed off itself and as such I think begins to obfuscate the original point - for example the "What's Alternative to Singleton" post and the links contained therein. http://stackoverflow.com/questions/1300655/whats-alternative-to-singleton I say this having been asked in both interviews I’ve had over the last 2 weeks what a singleton is and what criticisms I have of it. I have used it a few times for items such as user data (simple key-value eg. last file opened by this user) and logging (very common i'm sure). I've never ever used it just to have what is essentially global application data, as this is clearly stupid. In the first interview, I reply that I have no criticisms of it. He seemed disappointed by this but as the job wasn’t really for me, I forgot about it. In the next one, I was asked again and, as I wanted this job, I thought about it on the spot and made some objections, similar to those contained in the post linked to above (I suggested use of a factory or dependency injection instead). He seemed happy with this. But my problem is that I have used the singleton without ever using it in this kind of stupid way, which I had to describe on the spot. Using it for global data and the like isn’t something I did then realised was stupid, or read was stupid so didn’t do, it was just something I knew was stupid from the start. Essentially I’m supposed to be able to think of ways of how to misuse a pattern in the interview? Which class of programmers can best answer this question? The best ones? The medium ones? I'm not sure.... And these were both bright guys. I read more than enough to get better at my job but had never actually bothered to seek out criticisms of the most simple of the design patterns like this one. Do people think such questions are valid and that I ought to know the objections off by heart? Or that it is reasonable to be able to work out what other people who are missing the point would do on the fly? Or do you think I’m at least partially right that the question is too unsubtle and that the questions ought to be better thought out in order to make sure only good candidates can answer. PS. Please don’t think I’m saying that I’m just so clever that I know everything automatically - I’ve learnt the hard way like everyone else. But avoiding global data is hardly revolutionary.

    Read the article

  • &amp;#65279;Five Simple Photo Fixes with digiKam

    <b>Linux Magazine: </b>"digiKam is an immensely powerful photo application, so learning all its features requires time and effort. But this capable photo management application also offers a few easy to use features which you can use to instantly improve your shots."

    Read the article

  • IE Tab 2 vs IE Tab Plus

    - by johnthexiii
    I'm wonder what the differences are, especially as it pertains to SharePoint. Why should I pick one over the other or does it matter? Also are there any Linux browser solutions for SharePoint, besides Wine + IE 6.

    Read the article

  • How Can You Get More Productive In Life Sciences Sales?

    - by charles.knapp
    Only half of all doctors will meet with pharmaceutical sales reps, and that percentage continues to decrease. Furthermore, when reps are granted an opportunity to share information, the average interaction is only about a minute and a half. Concurrently, call quotas continue to increase. What does this matter? Sales reps need to spend less time on traditional planning and after-call reporting, more time making calls, and make more productive use of short presentation times. Fortunately for sales reps, Oracle offers the first life sciences CRM that is designed to double sales time and halve reporting time. In particular, our new Life Sciences Edition Offline Client is designed so that you can actually turn the screen around, so that your CRM is useful for presentations and not just reporting, whether you are connected to cloud or working offline such as in restricted clinical environments. Watch Piers Evans, Industry Strategy Director, show what this looks like in the day of a typical pharmaceutical sales representative. By use of this code snippet, I agree to the Brightcove Publisher T and C found at https://accounts.brightcove.com/en/terms-and-conditions/. -- This script tag will cause the Brightcove Players defined above it to be created as soon as the line is read by the browser. If you wish to have the player instantiated only after the rest of the HTML is processed and the page load is complete, remove the line. -- brightcove.createExperiences();

    Read the article

  • What caused the rails application crash?

    - by so1o
    I'm sure someone can explain this. we have an application that has been in production for an year. recently we saw an increase in number of support requests for people having difficulty signing into the system. after scratching our head because we couldn't recreate the problem in development, we decided we'll switch on debug logger in production for a month. that was june 5th. application worked fine with the above change and we were waiting. then yesterday we noticed that the log files were getting huge so we made another change in production config.logger = Logger.new("#{RAILS_ROOT}/log/production.log", 50, 1048576) after this change, the application started crashing while processing a particular file. this particular line of code was RAILS_DEFAULT_LOGGER.info "Payment Information Request: ", request.inspect as you can see there was a comma instead of a plus sign. this piece of code was introduced in Mar. the question is this: why did the application fail now? if changing the debug level caused the application to process this line of code it should have started failing on june 5th! why today. please someone help us. Are we missing the obvious here? if you dont have an answer, at least let us know we aren't the only one that are bonkers.

    Read the article

  • Cannot validate xml doc againest a xsd schema (Cannot find the declaration of element 'replyMessage

    - by Daziplqa
    Hi Guyz, I am using the following code to validate an an XML file against a XSD schema package com.forat.xsd; import java.io.IOException; import java.net.URL; import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; public class XSDValidate { public void validate(String xmlFile, String xsd_url) { try { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new URL(xsd_url)); Validator validator = schema.newValidator(); ValidationHandler handler = new ValidationHandler(); validator.setErrorHandler(handler); validator.validate(getSource(xmlFile)); if (handler.errorsFound == true) { System.err.println("Validation Error : "+ handler.exception.getMessage()); }else { System.out.println("DONE"); } } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } private Source getSource(String resource) { return new StreamSource(XSDValidate.class.getClassLoader().getResourceAsStream(resource)); } private class ValidationHandler implements ErrorHandler { private boolean errorsFound = false; private SAXParseException exception; public void error(SAXParseException exception) throws SAXException { this.errorsFound = true; this.exception = exception; } public void fatalError(SAXParseException exception) throws SAXException { this.errorsFound = true; this.exception = exception; } public void warning(SAXParseException exception) throws SAXException { } } /* * Test */ public static void main(String[] args) { new XSDValidate().validate("com/forat/xsd/reply.xml", "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.53.xsd"); // return error } } As appears, It is a standard code that try to validate the following XML file: <?xml version="1.0" encoding="UTF-8"?> <replyMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <merchantReferenceCode>XXXXXXXXXXXXX</merchantReferenceCode> <requestID>XXXXXXXXXXXXX</requestID> <decision>XXXXXXXXXXXXX</decision> <reasonCode>XXXXXXXXXXXXX</reasonCode> <requestToken>XXXXXXXXXXXXX </requestToken> <purchaseTotals> <currency>XXXXXXXXXXXXX</currency> </purchaseTotals> <ccAuthReply> <reasonCode>XXXXXXXXXXXXX</reasonCode> <amount>XXXXXXXXXXXXX</amount> <authorizationCode>XXXXXXXXXXXXX</authorizationCode> <avsCode>XXXXXXXXXXXXX</avsCode> <avsCodeRaw>XXXXXXXXXXXXX</avsCodeRaw> <authorizedDateTime>XXXXXXXXXXXXX</authorizedDateTime> <processorResponse>0XXXXXXXXXXXXX</processorResponse> <authRecord>XXXXXXXXXXXXX </authRecord> </ccAuthReply> </replyMessage> Against the following XSD : https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.53.xsd The error is : Validation Error : cvc-elt.1: Cannot find the declaration of element 'replyMessage'. Could you please help me!

    Read the article

  • Drawing a rectangle on a video in C#

    - by Haxed
    Hi I want to draw a rectangle on a video stream(web cam video or loaded saved video) that I have streaming on a picture box. This is a C# application and I am using EmguCV 2.1.0.0. I have been successful in displaying the video stream on the picturebox in the form. Can I use Emgucv to draw on the video or should I use something else ? Can I use Dshownet or something like that ? Thanks for taking the time to read this. Many Thanks

    Read the article

  • C#: How to distribute a folder as a reference?

    - by Thx4UrHelp
    Hi everyone, I am making a C# app and I am using GeckoFX to embed Firefox into my app. For anyone interested, I got it here: http://geckofx.org/. The problem is, I want to deploy GeckoFX with my app and I don't know how to do it. The line of code I use to initialize GeckoFX is this: Skybound.Gecko.Xpcom.Initialize("C:\\xulrunner"); This assumes that the xulrunner folder is at C:\xulrunner. So, my questions is this: how do I add the xulrunner folder as a reference in my app so it's copied relative to where my app is (or at least in a place where my app can find it)? Thanks so much everyone!

    Read the article

  • Works using Django development server, but throws import error with Apache using mod_wsgi

    - by Raj
    I have a Django project that works fine with the development server that comes with it. No errors are produced at all when I use "django manage.py runserver" and the app works fine, but when I try to use it with mod_wsgi and Apache the browser displays "Internal Server Error" with a 500 error code and it generates an import error in the Apache error log. Here's the error in the log: ImportError: No module named registration I'm using the Django registration module which is located in a path like this: /opt/raj/photos/registration I know that the registration app is in the path because I can fire up a Python shell, import sys, and get a list of paths using sys.path. Here are some of the paths output from Python shell: sys.path ['', '/opt/raj/pyamf', '/opt/raj', '/opt/raj/pictures', '/opt/raj/pictures /registration', '/usr/lib/python2.6',....] Any thoughts would be appreciated.

    Read the article

  • format dojo DataGrid header row

    - by Alan Seiden
    I want to assign a background color to my programmatically created Dojo DataGrid's header row. I've tried to override the defaults by adding .dojoxGridHeader or .dojoxGrid-Header to my style sheet, but these have no effect. Is there another way, such as with a Dojo event or property? If my style sheet is the only way to go, am I using the wrong class? Thanks! Alan

    Read the article

  • How to use Enum in grails (not in domain class)

    - by bsreekanth
    Hello, i want to use Enum to represent some selection values. In /src/groovy folder, under the package com.test, I created the Enum. package com.test public enum TabSelectorEnum { A(1), B(2) private final int value public int value() {return value} } Now, I am trying to access it from controller like TabSelectorEnum.B.value() It throws an exception Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class com.test.TabSelectorEnum thanks in advance.

    Read the article

  • Which langauge should i use for Artificail intelligence on web projects

    - by Mirage
    I have to do one project for my thesis involving Artificail intelligence , collaborative filtering and machine learning methods. I only know PHP/mysq/JS and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now i have to apply AI techniques on web application. WHich language should i choose java or python. I searhed on internet that i can call java classes inside my php so that can help as as i am very good at php i have also seen that python can also be used with php as well So which way should i go and roughly how much it will take me to learn java i have done java basics but that was 6 years ago

    Read the article

  • Index out of bounds exception while iterating through a List<string>.

    - by Sergio Tapia
    I have a List of the location of images on a folder. I have five pictureBoxes that emulate a coverflow type area for users to skim through the images of a given folder. I know that the error is fired because the first image in the collection is set to the first picturebox, then if I click on cycleLeft(), there is a negative number. How can I account for this? For example, if the first image in the List is already set to the farthest left and someone clicks flip left, have that first image put on the last position of the list. Any guidance? private void leftArrow_Click(object sender, EventArgs e) { cycleImagesLeft(); } private void rightArrow_Click(object sender, EventArgs e) { cycleImagesRight(); } public void cycleImagesLeft() { //imageThree is the center image, that's why I use it as a frame of reference. int currentImage = pictures.IndexOf(imageThree.ImageLocation); imageOne.ImageLocation = pictures[currentImage - 3]; imageTwo.ImageLocation = pictures[currentImage - 2]; imageThree.ImageLocation = pictures[currentImage - 1]; imageFour.ImageLocation = pictures[currentImage]; imageFive.ImageLocation = pictures[currentImage + 1]; } public void cycleImagesRight() { int currentImage = pictures.IndexOf(imageThree.ImageLocation); imageOne.ImageLocation = pictures[currentImage - 1]; imageTwo.ImageLocation = pictures[currentImage]; imageThree.ImageLocation = pictures[currentImage + 1]; imageFour.ImageLocation = pictures[currentImage + 2]; imageFive.ImageLocation = pictures[currentImage + 3]; }

    Read the article

  • Conditionally install feature not working in Wix

    - by Damien
    Hi, I have a setup which I need to support on IIS6 and IIS7. For now Im using the built in IIS extensions for IIS6 like so: <Component Id="C_IISApplication" Guid="{9099909C-B770-4df2-BE08-E069A718B938}" > <iis:WebSite Id='TSIWSWebSite' Description='TSWeb' SiteId='*' Directory='INSTALLDIR'> <iis:WebAddress Id='tcpAddress' Port='8081' /> </iis:WebSite> <iis:WebAppPool Id="BlahWSApplicationPool" Name="Blah" /> <iis:WebVirtualDir Id="VirtualDir" Alias="Blah" Directory="INSTALLDIR" WebSite="BlahWSWebSite" DirProperties="WebVirtualDirProperties"> <iis:WebApplication Id="WebApplication" Name="Blah" WebAppPool="BlahWSApplicationPool"/> </iis:WebVirtualDir> </Component> I have tried a condition in the features like so: <Feature Title="IIS6" Id="IIS6" Description="IIS6" ConfigurableDirectory="INSTALLDIR" Level="1" Absent="disallow" Display="hidden"> <ComponentRef Id="C_IISApplication" /> <Condition Level="0"><![CDATA[IISVERSION <> '#6']]></Condition> </Feature> No matter what the value of my condition, the metabase stuff gets executed and I get an error on IIS7 systems. I have also tried putting the condition in the component and that didnt work either. Is there something wrong with my usage?

    Read the article

  • What causes Apache Environment Variable set using mod_rewrite to have "redirect_" appended to name?

    - by trowel
    I am trying to set Apache environment variables (for use in PHP) with the [E=VAR:VAL] flag on RewriteRule rules in an .htaccess file. I have already discovered the variables are accessed in PHP as server variables $_SERVER rather than $_ENV (which makes a certain amount of sense). However, my problem is for some rules the [E=VAR:VAL] flag works as expected and I end up with a variable $_SERVER['VAR'] but for other rules I end with a variable $_SERVER['REDIRECT_VAR'] or $_SERVER['REDIRECT_REDIRECT_VAR'], etc A. What causes an Environment Variable set in Apache using the [E=VAR:VAL] flag to get renamed by having "REDIRECT_" appended to the front of the variable name? B. What can I do to make sure I end up with an Environment Variable with an unchanged name so I can access it in PHP as $SERVER['VAR'] without having to resort to checking for variations of the variable name having one of more instances of "REDIRECT" appended to the front of it?

    Read the article

  • How to discard time intervals with Time Series / XYPlots using JFreeChart?

    - by Alex Arnon
    Hi All, I am building a set of chart displays, one of which is for a month display of daily trading - that is, one point of data per day (closing). Since there is no trade during weekends and holidays, I need to discard these data points. Not only that, but data points should still appear adjacent to each other, regardless of any gaps in time. This can be seen in any such chart e.g. in the 3 month graph for Nasdaq on Yahoo Finance - see how weekends are skipped. My question is: how should one correctly implement this in JFreeChart? Thanks in advance!

    Read the article

  • jQuery AJAX request (Rails 3) gets redirected and returns empty message body (only with SSL)!

    - by elsurudo
    I'm trying to do a manual jQuery AJAX request the following way: $("#user_plan_id").change(function() { $("#plan_container").load('/plans/' + this.value); }); I have the "rails.js" file included in my header, and a "<%= csrf_meta_tag %". I see from my log that the request IS getting to the server (although without the authenticity token... does rails.js even do this?), but the response is a 302 (Found) rather than 200, and no data actually gets rendered. Any ideas? Edit: I now see that the first request redirects, and the proper partial gets rendered on the redirect. However, the 2nd response's body (on the client-side) is still empty. I'm guessing jQuery uses the first response and doesn't have a listener set up for the redirect. How do I get around this? Also, another note: the page doing the requesting is an HTTPS page. Here is what my log says: Started GET "/plans/221168073" for 127.0.0.1 at Tue Jun 15 01:24:06 -0400 2010 Processing by PlansController#show as HTML Parameters: {"id"=>"221168073"} DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead. (called from ensure_proper_protocol at /Users/ernestsurudo/Sites/vidfolia/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb:57) Redirected to http://vidfolia.com/plans/221168073 Completed 302 Found in 1ms It turns out that if I turn off SSL requirement for that page, it works! I still have no idea why, though. So I suppose my question is: what is the workaround?

    Read the article

  • OpenID on Google not returning anything

    - by PlayKid
    Hi there, For some reason, the following code does not return anything: string alias = response.FriendlyIdentifierForDisplay; var sreg = response.GetExtension<ClaimsResponse>(); if (sreg != null && sreg.MailAddress != null) { alias = sreg.MailAddress.User; } if (sreg != null && !string.IsNullOrEmpty(sreg.Email)) { alias = sreg.Email; } if (sreg != null && !string.IsNullOrEmpty(sreg.FullName)) { alias = sreg.FullName; } I was hoping I can get the Email from Yahoo or Google, but sreg just return null whichever provider I have chosen. I saw some of other posts that this code should return an e-mail at least, but for me, it does not, please assist. Thanks alot

    Read the article

  • Get file size of BufferedImage before writing the data

    - by David
    I'm working on a Java program that needs to send an image (preferably in PNG format, though I could perhaps use another format if necessary) over the network. The logical way to do this is, of course, to first send the length of the PNG image data, then the data itself. Problem: I don't see any method in ImageIO or anywhere else that will give me the length of the image data. Does this exist somewhere in the Java 1.6 standard library? I know I could just write it to a ByteArrayOutputStream and get the length of the resulting array, but before resorting that I wanted to make sure I'm not missing something built in. And besides, that makes an extra copy of the image data, which I'd rather not do if it's not necessary.

    Read the article

  • How to Make my application handle Errors for a few different scenarios?

    - by NightsEVil
    so i have this code to extract a program to the temp directory then run it, the problem is it doesn't work perfectly on every computer (for some reason it hits a error or exception sometimes) string tempFolder = System.IO.Path.Combine(System.IO.Path.GetTempPath(), ""); System.Diagnostics.Process defrag1 = System.Diagnostics.Process.Start(@"Programs\Optimize\AusLogics_Defrag.exe", string.Format(" -o{0} -y", tempFolder)); defrag1.WaitForExit(); string executableDirectoryName = Path.GetDirectoryName(Application.ExecutablePath); System.Diagnostics.Process defrag2 = System.Diagnostics.Process.Start(tempFolder + "\\" + "AusLogics_Defrag" + "\\" + "DiskDefrag.exe", ""); defrag2.WaitForExit(); System.IO.Directory.Delete(tempFolder + "\\" + "AusLogics_Defrag", true); and what i wanna know is there a way that say if it starts to extract but hits a error (no matter what it is) it will automatically change and go to this code, but if it DOESN'T hit a error it continues as it was meant to? string tempFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); System.Diagnostics.Process defrag1 = System.Diagnostics.Process.Start(@"Programs\Optimize\AusLogics_Defrag.exe", string.Format(" -o{0} -y", tempFolder)); defrag1.WaitForExit(); string executableDirectoryName = Path.GetDirectoryName(Application.ExecutablePath); System.Diagnostics.Process defrag2 = System.Diagnostics.Process.Start(tempFolder + "\\" + "AusLogics_Defrag" + "\\" + "DiskDefrag.exe", ""); defrag2.WaitForExit(); System.IO.Directory.Delete(tempFolder + "\\" + "AusLogics_Defrag", true); with the path going to the application data folder? and if THAT hits a error it would change that path to this, but if it DOESN'T hit a error it continues as it was meant to? string tempFolder = System.Environment.GetEnvironmentVariable("HomeDrive");

    Read the article

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