Search Results

Search found 20065 results on 803 pages for 'practice problems'.

Page 87/803 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Dynamically added script causes problems

    - by Derk
    I'm loading an html snippet via ajax to append to a div (I use jquery). A part of the html loaded with ajax looks like this: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var options = { mapTypeId : google.maps.MapTypeId.TERRAIN } alert('test'); var map = new google.maps.Map(document.getElementById('map-canvas'), options); </script> Then this is appended with contentBox.append(data); The problem is that this causes a black page in Firefox which keeps loading. In other browsers it seems that the code is not executed at all. Is there a solution for this?

    Read the article

  • problems with retrieving data that was saved outside of a grails webflow

    - by callie16
    Hi, this is actually connected to an earlier question of mine here. Anyway, I have 3 domains that look like this: class A { ... static hasMany = [ b : B ] ... } class B { ... static belongsTo = [ a : A ] static hasMany = [ c : C ] ... } class C { ... static belongsTo = [ b : B ] ... } In my GSP page, I call an action in the Controller via a remote function in a javascript block (I'm using Dojo so I'm passing data to be saved this way... it's not a form per se so I use JSON for now to pass the data to the Controller). Let's say, I'm calling something like this: def someAction = { def jsonArr = [parse the JSON here] def tmpA = A.get(params.id) ... def tmpB = new B() b.someParam = jsonArr.someParam ... def tmpC = new C() tmpC.cParam = jsonArr.cParam tmpB.addToC(tmpC) tmpB.save(flush: true) //this may or may not be here but I'm adding it for the sake of completeness tmpA.addToB(tmpB) tmpA.save(flush: true) // NOTE: If I check here via println or whatnot, tmpA has a tmpB which has a tmpC... in other words, the data got saved. It's also in the DB. redirect(action: 'order' ...) } Then comes the fun part. Here's the webflow sample: def orderFlow = { ... someStateIShouldEndUpIn { on("next") { // or on previous... doesn't matter def anId = params.id def currA = A.get(anId) // this does NOT return a null value def testB = currA.b // this DOES return a null value }.to("somePage") ... } ... } Any ideas on why this happens? Moreover, when I dump the data of currA, b=null... instead of b=[] or b=[contents of tmpB]. Any help would be seriously appreciated... been at this for a couple of days now... Thanks!

    Read the article

  • Problems Enforcing Referential Integrity on SQL Server Tables

    - by SidC
    Hello All, I have a SQL Server 2005 database comprised of Customer, Quote, QuoteDetail tables. I want/need to enforce referential integrity such that when an insert is made on quotedetail, the quote and customer tables are also affected. I have tried my best to set up primary/foreign keys on my tables but need some help. Here's the scripts for my tables as they stand now (please don't laugh): Customers: USE [Diel_inventory] GO /****** Object: Table [dbo].[Customers] Script Date: 05/08/2010 03:39:04 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Customers]( [pkCustID] [int] IDENTITY(1,1) NOT NULL, [CompanyName] [nvarchar](50) NULL, [Address] [nvarchar](50) NULL, [City] [nvarchar](50) NULL, [State] [nvarchar](2) NULL, [ZipCode] [nvarchar](5) NULL, [OfficePhone] [nvarchar](12) NULL, [OfficeFAX] [nvarchar](12) NULL, [Email] [nvarchar](50) NULL, [PrimaryContactName] [nvarchar](50) NULL, CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED ([pkCustID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] Quotes: USE [Diel_inventory] GO /****** Object: Table [dbo].[Quotes] Script Date: 05/08/2010 03:30:46 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Quotes]( [pkQuoteID] [int] IDENTITY(1,1) NOT NULL, [fkCustomerID] [int] NOT NULL, [QuoteDate] [timestamp] NOT NULL, [NeedbyDate] [datetime] NULL, [QuoteAmt] [decimal](6, 2) NOT NULL, [QuoteApproved] [bit] NOT NULL, [fkOrderID] [int] NOT NULL, CONSTRAINT [PK_Bids] PRIMARY KEY CLUSTERED ( [pkQuoteID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Quotes] WITH CHECK ADD CONSTRAINT [fkCustomerID] FOREIGN KEY([fkCustomerID]) REFERENCES [dbo].[Customers] ([pkCustID]) GO ALTER TABLE [dbo].[Quotes] CHECK CONSTRAINT [fkCustomerID] QuoteDetail: USE [Diel_inventory] GO /****** Object: Table [dbo].[QuoteDetail] Script Date: 05/08/2010 03:31:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[QuoteDetail]( [ID] [int] IDENTITY(1,1) NOT NULL, [fkQuoteID] [int] NOT NULL, [fkCustomerID] [int] NOT NULL, [fkPartID] [int] NULL, [PartNumber1] [float] NOT NULL, [Qty1] [int] NOT NULL, [PartNumber2] [float] NULL, [Qty2] [int] NULL, [PartNumber3] [float] NULL, [Qty3] [int] NULL, [PartNumber4] [float] NULL, [Qty4] [int] NULL, [PartNumber5] [float] NULL, [Qty5] [int] NULL, [PartNumber6] [float] NULL, [Qty6] [int] NULL, [PartNumber7] [float] NULL, [Qty7] [int] NULL, [PartNumber8] [float] NULL, [Qty8] [int] NULL, [PartNumber9] [float] NULL, [Qty9] [int] NULL, [PartNumber10] [float] NULL, [Qty10] [int] NULL, [PartNumber11] [float] NULL, [Qty11] [int] NULL, [PartNumber12] [float] NULL, [Qty12] [int] NULL, [PartNumber13] [float] NULL, [Qty13] [int] NULL, [PartNumber14] [float] NULL, [Qty14] [int] NULL, [PartNumber15] [float] NULL, [Qty15] [int] NULL, [PartNumber16] [float] NULL, [Qty16] [int] NULL, [PartNumber17] [float] NULL, [Qty17] [int] NULL, [PartNumber18] [float] NULL, [Qty18] [int] NULL, [PartNumber19] [float] NULL, [Qty19] [int] NULL, [PartNumber20] [float] NULL, [Qty20] [int] NULL, CONSTRAINT [PK_QuoteDetail] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_Customers] FOREIGN KEY ([fkCustomerID]) REFERENCES [dbo].[Customers] ([pkCustID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_Customers] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_PartList] FOREIGN KEY ([fkPartID]) REFERENCES [dbo].[PartList] ([RecID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_PartList] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_Quotes] FOREIGN KEY([fkQuoteID]) REFERENCES [dbo].[Quotes] ([pkQuoteID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_Quotes] Your advice/guidance on how to set these up so that customer ID in Customers is the same as in Quotes (referential integrity) and that CustomerID is inserted on Quotes and Customers when an insert is made to QuoteDetial would be much appreciated. Thanks, Sid

    Read the article

  • HTTP Compression problems on IIS7

    - by Jonathan Wood
    I've spent quite a bit of time on this but seem to be going nowhere. I have a large page that I really want to speed up. The obvious place to start seems to be HTTP compression, but I just can't seem to get it to work for me. After considerable searching, I've tried several variations of the code below. It kind of works, but after refreshing the browser, the results seem to fall apart. They were turning to garbage when the page used caching. If I turn off caching, then the page seems right but I lose my CSS formatting (stored in a separate file) and get an error that an included JS file contains invalid characters. Most of the resources I've found on the Web were either very old or focused on accessing IIS directly. My page is running on a shared hosting account and I do not have direct access to IIS7, which it's running on. protected void Application_BeginRequest(object sender, EventArgs e) { // Implement HTTP compression if (Request["HTTP_X_MICROSOFTAJAX"] == null) // Avoid compressing AJAX calls { // Retrieve accepted encodings string encodings = Request.Headers.Get("Accept-Encoding"); if (encodings != null) { // Verify support for or gzip (deflate takes preference) encodings = encodings.ToLower(); if (encodings.Contains("gzip") || encodings == "*") { Response.Filter = new GZipStream(Response.Filter, CompressionMode.Compress); Response.AppendHeader("Content-Encoding", "gzip"); Response.Cache.VaryByHeaders["Accept-encoding"] = true; } else if (encodings.Contains("deflate")) { Response.Filter = new DeflateStream(Response.Filter, CompressionMode.Compress); Response.AppendHeader("Content-Encoding", "deflate"); Response.Cache.VaryByHeaders["Accept-encoding"] = true; } } } } Is anyone having better success with this?

    Read the article

  • Can't inherit from auto_str without problems

    - by fret
    What I want to do is this: #include <memory> class autostr : public std::auto_ptr<char> { public: autostr(char *a) : std::auto_ptr<char>(a) {} autostr(autostr &a) : std::auto_ptr<char>(a) {} // define a bunch of string utils here... }; autostr test(char a) { return autostr(new char(a)); } void main(int args, char **arg) { autostr asd = test('b'); return 0; } (I actually have a copy of the auto_ptr class that handles arrays as well, but the same error applies to the stl one) The compile error using GCC 4.3.0 is: main.cpp:152: error: no matching function for call to `autostr::autostr(autostr)' main.cpp:147: note: candidates are: autostr::autostr(autostr&) main.cpp:146: note: autostr::autostr(char*) I don't understand why it's not matching the autostr argument as a valid parameter to autostr(autostr&).

    Read the article

  • Can't inherit from auto_ptr without problems

    - by fret
    What I want to do is this: #include <memory> class autostr : public std::auto_ptr<char> { public: autostr(char *a) : std::auto_ptr<char>(a) {} autostr(autostr &a) : std::auto_ptr<char>(a) {} // define a bunch of string utils here... }; autostr test(char a) { return autostr(new char(a)); } void main(int args, char **arg) { autostr asd = test('b'); return 0; } (I actually have a copy of the auto_ptr class that handles arrays as well, but the same error applies to the stl one) The compile error using GCC 4.3.0 is: main.cpp:152: error: no matching function for call to `autostr::autostr(autostr)' main.cpp:147: note: candidates are: autostr::autostr(autostr&) main.cpp:146: note: autostr::autostr(char*) I don't understand why it's not matching the autostr argument as a valid parameter to autostr(autostr&).

    Read the article

  • lists:keyfind problems

    - by dagda1
    Hi, I cannot for the life of me get lists:keyfind to work as I expect in Erlang. I have the following eunit test: should_find_key_test() -> NewList = lists:keystore("key", 1, [], {"key", "value"}), Value = case lists:keyfind("key", 1, NewList) of false -> notfound; {_key, _value} -> _value end, ?debugVal(Value). Whenever I run this test I get the following error message: indextests:should_find_key_test (module 'indextests')...failed ::error:undef in function lists:keyfind/3 called as keyfind("key",1,[{"key","value"}]) in call from indextests:should_find_key_test/0 Can anyone see what I am doing wrong? Is it saying that lists:keyfind no longer exists? Cheers Paul

    Read the article

  • Problems installing PIL after OSX 10.9

    - by user2632417
    I installed Mac OSX 10.9 the day it came out. Afterwards I decided I needed to install PIL. I'd installed it before, but it appeared the update had broken that. When I try to use pip to install PIL, it fails when building _imaging. It appears the root cause is this. /usr/include/sys/cdefs.h:655:2: error: Unsupported architecture Theres also a similar error here: /usr/include/machine/limits.h:8:2: error: architecture not supported and here: /usr/include/machine/_types.h:34:2: error: architecture not supported Then there's a whole list of missing types. /usr/include/sys/_types.h:94:9: error: unknown type name '__int64_t' typedef __int64_t __darwin_blkcnt_t; /* total blocks */ ^ /usr/include/sys/_types.h:95:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_blksize_t; /* preferred block size */ ^ /usr/include/sys/_types.h:96:9: error: unknown type name '__int32_t' typedef __int32_t __darwin_dev_t; /* dev_t */ ^ /usr/include/sys/_types.h:99:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */ ^ /usr/include/sys/_types.h:100:9: error: unknown type name '__uint32_t' typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/ ^ /usr/include/sys/_types.h:101:9: error: unknown type name '__uint64_t' typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */ Needless to say I don't know where to go from here. I've got a couple of guesses, but I don't even know how to check. Wrong include probably as a result of a badly configured environment variable Problem with Xcode's installation/ missing command line tools Messed up header files If anyone has any suggestions either to check one of those possibilities or for one of their own I'm all ears.

    Read the article

  • Problems using User model in django unit tests

    - by theycallmemorty
    I have the following django test case that is giving me errors: class MyTesting(unittest.TestCase): def setUp(self): self.u1 = User.objects.create(username='user1') self.up1 = UserProfile.objects.create(user=self.u1) def testA(self): ... def testB(self): ... When I run my tests, testA will pass sucessfully but before testB starts, I get the following error: IntegrityError: column username is not unique It's clear that it is trying to create self.u1 before each test case and finding that it already exists in the Database. How do I get it to properly clean up after each test case so that subsequent cases run correctly?

    Read the article

  • XAMPP - local host problems

    - by jennym
    I have picked up some possible answers to my problem here, but none have so far worked. I have installed XAMPP but get the dreaded HTTP 404 error on both IE and Firefox when asking for 'http://localhost/'. I work with Dreamweaver but cannot get the testing server (XAMPP) to work, although I can connect to the linux/apache remote server. Skype has been uninstalled. Therefore XAMPP is running on port 80 by itself. XAMPP says Apache and Mysql have 'started'. Is there someone that could please help me?

    Read the article

  • Problems with UK.Elect() method

    - by codeulike
    I'm calling UK.Elect() but getting a weird result back. I was expecting a value of Enum.ElectoralReform but it seems to be throwing an InfufficientSeatsException I think I probably need to re-factor the whole PoliticalClass Any suggestions?

    Read the article

  • ASP.NET MVC 2 user input to SQL 2008 Database problems

    - by Rob
    After my publish in VS2010 the entire website loads and pulls data from the database perfectly. I can even create new users through the site with the correct key code, given out to who needs access. I have two connection strings in my web.config file The first: <add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="EveModelContainer" connectionString="metadata=res://*/Models.EdmModel.EveModel.csdl|res://*/Models.EdmModel.EveModel.ssdl|res://*/Models.EdmModel.EveModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=fleet;Persist Security Info=True;User ID=fleet;Password=****&quot;" providerName="System.Data.EntityClient" /> The second: <add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="ApplicationServices" connectionString="Data Source=localhost;Initial Catalog=fleet;Persist Security Info=True;User ID=fleet;Password=****;MultipleActiveResultSets=True" /> The first one is the one that is needed to post data with the main application, EveModelContainer. Everything else is pulled using the standard ApplicationServices connection. Do you see anything wrong with my connectionstring? I'm at a complete loss here. The site works perfectly on my friends server and not on mine... Could it be a provider issue? And if I go to iis 7's manager console, and click .net users I get a pop up message saying the custom provider isn't a trusted provider do I want to allow it to run at a higher trust level. I'm at the point where I think its either my string or this trusted provider error... but I have no clue how to add to the trusted provider list... Thank you in advance!!!

    Read the article

  • Hide/Show problems on a questionerre application

    - by T. Todd
    I am doing an assignment involving the creation of a simple Quiz type form application. However, whenever I run the program, only the first answer shows for a multiple question and I cannot for the life of me figure out why. This is the contstructor: MultipleChoice dlg = new MultipleChoice( new Question("What is the capital of Zimbabwe?", new Answer("Paris", false), new Answer("Washington D.C.", false), new Answer("Harare", true), new Answer("Cairo", false), new Answer("N'Djamena", false))); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.Correct) MessageBox.Show("You got something right!"); else MessageBox.Show("You couldn't be more wrong"); } And this is the Question Form Code: private Question Q; public MultipleChoice (Question q) { Q = q; InitializeComponent(); textPrompt.Text = Q.Prompt; if (Q.A != null) { radioA.Text = Q.A.Prompt; } else radioA.Hide(); if (Q.B != null) { radioB.Text = Q.B.Prompt; } radioB.Hide(); if (Q.C != null) { radioC.Text = Q.C.Prompt; } radioC.Hide(); if (Q.D != null) { radioD.Text = Q.D.Prompt; } radioD.Hide(); if (Q.E != null) { radioE.Text = Q.E.Prompt; } radioE.Hide(); } public bool Correct { get { if (Q == null) return false; if (Q.A != null && Q.A.Correct && radioA.Checked) return true; if (Q.B != null && Q.B.Correct && radioB.Checked) return true; if (Q.C != null && Q.C.Correct && radioC.Checked) return true; if (Q.D != null && Q.D.Correct && radioD.Checked) return true; if (Q.E != null && Q.E.Correct && radioE.Checked) return true; return false; } Where have I gone wrong? Thank you, Travis

    Read the article

  • Ladder word-like game GUI problems

    - by sasquatch90
    Ok so I've written my own version of game which should look like this : http://img199.imageshack.us/img199/6859/lab9a.jpg but mine looks like that : http://img444.imageshack.us/img444/7671/98921674.jpg How can I fix this ? Is there a way to do the layout completely differently ? Here's the code : Main.java : import java.util.Scanner; import javax.swing.*; import java.awt.*; public class Main { public static void main(String[] args){ final JFrame f = new JFrame("Ladder Game"); Scanner sc = new Scanner(System.in); System.out.println("Creating game data..."); System.out.println("Height: "); while (!sc.hasNextInt()) { System.out.println("int, please!"); sc.next(); } final int height = sc.nextInt(); Grid[]game = new Grid[height]; for(int L = 0; L < height; L++){ Grid row = null; int i = L+1; String s; do { System.out.println("Length "+i+", please!"); s = sc.next(); } while (s.length() != i); Element[] line = new Element[s.length()]; Element single = null; String[] temp = null; String[] temp2 = new String[s.length()]; temp = s.split(""); for( int j = temp2.length; j>0; j--){ temp2[j-1] = temp[j]; } for (int k = 0 ; k < temp2.length ; k++) { if( k == 0 ){ single = new Element(temp2[k], 2); } else{ single = new Element(temp2[k], 1); } line[k] = single; } row = new Grid(line); game[L] = row; } //############################################ //THE GAME STARTS HERE //############################################ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBackground(Color.ORANGE); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); for(int i = 0; i < game.length; i++){ panel.add(game[i].create()); } f.setContentPane(panel); f.pack(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); boolean end = false; boolean word = false; String tekst; while( !end ){ while( !word ){ tekst = JOptionPane.showInputDialog("Input word: "); for(int i = 0; i< game.length; i++){ if(game[i].equalLength(tekst)){ if(game[i].equalValue(tekst)){ word = true; for(int j = 0; j< game.length; j++){ game[i].repaint(); } } } } } word = false; for(int i = 0; i < game.length; i++){ if(game[i].solved()){ end = true; } else { end = false; } } } } } Grid.java import javax.swing.*; import java.awt.*; public class Grid extends JPanel{ private Element[]e; private Grid[]g; public Grid(){} public Grid( Element[]elements ){ e = new Element[elements.length]; for(int i=0; i< e.length; i++){ e[i] = elements[i]; } } public Grid(Grid[]grid){ g = new Grid[grid.length]; for(int i=0; i<g.length; i++){ g[i] = grid[i]; } Dimension d = new Dimension(600, 600); setMinimumSize(d); setPreferredSize(new Dimension(d)); setMaximumSize(d); } public JPanel create(){ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); for(int j = 0; j < e.length; j++){ panel.add(e[j].paint()); } return panel; } @Override public void repaint(){ } public boolean equalLength(String s){ int len = s.length(); boolean equal = false; for(int j = 0; j < e.length; j++){ if(e.length == len){ equal = true; } } return equal; } public boolean equalValue(String s){ int len = s.length(); boolean equal = false; String[] temp = null; String[] temp2 = new String[len]; temp = s.split(""); for( int j = len; j>0; j--){ temp2[j-1] = temp[j]; } for(int j = 0; j < e.length; j++){ if( e[j].letter().equals(temp2[j]) ){ equal = true; } else { equal = false; } } if(equal){ for(int i = 0; i < e.length; i++){ e[i].changeState(3); } } return equal; } public boolean solved(){ boolean solved = false; for(int j = 0; j < e.length; j++){ if(e[j].getState() == 3){ solved = true; } else { solved = false; } } return solved; } @Override public String toString(){ return ""; } } Element.java import javax.swing.*; import java.awt.*; public class Element { final int INVISIBLE = 0; final int EMPTY = 1; final int FIRST_LETTER = 2; final int OTHER_LETTER = 3; private int state; private String letter; public Element(){ } //empty block public Element(int state){ this("", 0); } //filled block public Element(String s, int state){ this.state = state; this.letter = s; } public JButton paint(){ JButton button = null; if( state == EMPTY ){ button = new JButton(""); button.setBackground(Color.WHITE); } else if ( state == FIRST_LETTER ){ button = new JButton(letter); button.setBackground(Color.red); } else { button = new JButton(letter); button.setBackground(Color.yellow); } button.setSize(20,20); return button; } public void changeState(int s){ state = s; } public String letter(){ return letter; } public int getState(){ return state; } @Override public String toString(){ return "["+letter+"]"; } }

    Read the article

  • Potential problems porting to different architectures

    - by Brendan Long
    I'm writing a Linux program that currently compiles and works fine on x86 and x86_64, and now I'm wondering if there's anything special I'll need to do to make it work on other architectures. What I've heard is that for cross platform code I should: Don't assume anything about the size of a pointer, int or size_t Don't make assumptions about byte order (I don't do any bit shifting -- I assume gcc will optimize my power of two multiplication/division for me) Don't use assembly blocks (obvious) Make sure your libraries work (I'm using SQLite, libcurl and Boost, which all seem pretty cross-platform) Is there anything else I need to worry about? I'm not currently targeting any other architectures, but I expect to support ARM at some point, and I figure I might as well make it work on any architecture if I can. Also, regarding my second point about byte order, do I need to do anything special with text input? I read files with getline(), so it seems like that should be done automatically as well.

    Read the article

  • Problems with MYSQL database

    - by shinjuo
    I have a database that worked fine until I decided to add a log onto the page. here is what I have now: <body> <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { require("serverInfo.php"); mysql_query("UPDATE `cardLists` SET `AmountLeft` = `AmountLeft` + ".mysql_real_escape_string($_POST['Add'])." WHERE `cardID` = '".mysql_real_escape_string($_POST['Cards'])."'"); echo "\"" .$_POST['Add'] ."\" has been added to the inventory amount for the card \"". $_POST['Cards']. "\""; mysql_query("INSERT INTO `log` (`changes`, `amount`, `cardID`, `person`, Date)VALUES('ADDED','$_POST['Add']','$_POST['Cards']', '$_POST['Person']', NOW())"); mysql_close($link); } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <?php require("serverInfo.php"); ?> <?php $res = mysql_query("SELECT * FROM cardLists order by cardID") or die(mysql_error()); echo "<select name = 'Cards'>"; while($row=mysql_fetch_assoc($res)) { echo "<option value=\"$row[cardID]\">$row[cardID]</option>"; } echo "</select>"; ?> Amount to Add: <input type="text" name="Add" maxlength="8" /> Changes Made By: <select name="Person"> <option value="justin">Justin</option> <option value="chris">Chris</option> <option value="matt">Matt</option> <option value="dan">Dan</option> <option value="tim">Tim</option> <option value="amanda">Amanda</option> </select> <input type="submit" name ="submit" onClick= "return confirm( 'Are you sure you want to add this amount?');"> </form> <br /> <input type="button" name="main" value="Return To Main" onclick="window.location.href='index.php';" /> </body> </html> it works fine until I added the: mysql_query("INSERT INTO `log` (`changes`, `amount`, `cardID`, `person`, Date)VALUES('ADDED','$_POST['Add']','$_POST['Cards']', '$_POST['Person']', NOW())"); mysql_close($link); Can anyone see what is going on?

    Read the article

  • JSF2 - Problems with Composite Components and Validatiors

    - by Shadowman
    I've created some Facelets to make developing our pages easier. Particularly, I've created a series of Facelets for input components. I have 1 Facelet, <xxx:input /> that displays a label around the input field. Beyond that, I have Facelets like <xxx:inputText /> and <xxx:inputSecret /> that render the actual input field. Each of these makes use of <xxx:input /> to display the label. The Facelet looks something like this: <html ...> <composite:interface> ... </composite:interface> <composite:implementation> <label><h:outputText value="#{cc.attrs.labelText}" /></label> <composite:insertChildren /> </composite:implementation> </html> The <xxx:inputText /> Facelet would then look like this... <html ...> <composite:interface> ... </composite:interface> <composite:implementation> <xxx:input labelText=...> <h:inputText id="myinput" ... /> </xxx:input> </composite:implementation> </html> Everything renders just fine, but I am having troubles when trying to add <f:validator /> or other validation tags. From what I've read, I have to add a tag to my Facelet. So, I added <composite:editableValueHolder name="myinput" targets="myinput" /> line in the interface section. However, I still do not see my validator being fired. I have something like this in my .xhtml file... ... <xxx:inputText value="..."> <f:validateLength minimum="10" /> </xxx:inputText> ... Regardless of the input I enter, the validator never seems to fire and I never get an error message. A coworker suggested that it is due to the target ID I am using and the fact that it is wrapped by the <xxx:input /> Facelet. Do I need to incorporate the parent component ID in my target definition? Is there something else that I'm missing? It works just fine if I exclude the <xxx:input /> Facelet, so I'm assuming it's something related to that, but don't know how to solve it. Any help you can provide is GREATLY appreciated.

    Read the article

  • preg_match_all problems

    - by NeoNmaN
    i use preg_match_all and need to grab all a href="" tags in my code, but i not relly understand how to its work. i have this reg. exp. ( /(<([\w]+)[^])(.?)(<\/\2)/ ) its take all html codes, i need only all a href tags. i hobe i can get help :)

    Read the article

  • Problems with IRQs when connecting two digium card in and asterisk box

    - by JorgeO
    I have two Digium Wildcard TDM800P with 8 FXO ports each. When I connect both at the same time IRQ misses start showing up making my computer unresponsive and unusable. One card works fine but I need all 16 FXO ports to work to receive calls from my Telco. Is there a way for the cards to communicate with each other so they don't generate as many interrupts. Or a way to tweak Linux to dedicate separate IRQ's for each card. I have tried disabling Audio, ACPI and USB ports. Still too many IRQ misses.

    Read the article

  • GWT - problems with constants in css

    - by hba
    Hi, I'm new to GWT; I'm building a small sample app. I have several CSS files. I'm able to successfully use the ClientBundle and CssResource to assign styles to the elements defined in my UiBinder script. Now I'd like to take it one step further and introduce CSS constants using @def css-rule. The @def works great when I define a constant and use it in the same CSS file. However I cannot use it in another CSS file. When I try to use the @eval rule to evaluate an existing constant the compiler throws an execption: "cannot make a static reference to the non-static method ". Here is an example of what I'm trying to do: ConstantStyle.css @def BACKGROUND red; ConstantStyle.java package abc; import ...; interface ConstantStyle extends cssResource { String BACKGROUND(); } MyStyle.css @eval BACKGROUND abc.ConstantStyle.BACKGROUND(); .myClass {background-color: BACKGROUND;} MyStyle.java package abc; import ...; interface ConstantStyle extends cssResource { String myClass; } MyResources.java package abc; import ...; interface MyResources extends ClientBundle { @Source("ConstantStyle.css") ConstantStyle constantStyle(); @Source("MyStyle.css") MyStyle myStyle(); } Thanks in advance!

    Read the article

  • Problems after adding Control dynamically on Panel

    - by Thomas
    Hello, I have added an View List onto a Panel like that: panelComponent.Controls.Add(viewListComponent); Everthing works just fine. Mouse Events are handled, Repaint works. But one: I cant dynamically move it around. If i change the control.Top Variablen it just sit there and nothing. Its clued to the top left corner. Resizing the right and bottom line works just fine! I did it without dynamically adding and than no Problem. Hope you can help. Thomas

    Read the article

  • Kerning problems when drawing text character by character

    - by shekel
    I'm trying to draw strings character by character to add lighting effects to shapes composed of text. while (i != line.length()) { c = line.substring(i, i + 1); cWidth = g.getFontMetrics().stringWidth(c); g.drawString(c, xx += cWidth, yy); i++; } The problem is, the width of a character isn't the actual distance it's drawn from another character when those two characters are printed as a string. Is there any way to get the correct distance in graphics2d?

    Read the article

  • Problems with textarea focus

    - by c0mrade
    My textarea is behaving very strange, when I click inside it .. the cursor appears there when I click, if I click on the middle of the textarea it appears there, and I'd like it to appear on the beginning wherever I click inside, like here on SO when asking question, wherever you click inside textarea it takes your cursor to the topmost left. What can I do to fix this?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >