Search Results

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

Page 81/803 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • problems with chili source code highlighter (mysql)

    - by jason
    I am using Chili source code highlighter it works fine with php source using php as the class. But when i change it to mysql it doesnt highlight any SQL code i also tried sql as the classname, i double checked the recipes' and there is a mysql recipes in there. ... What could i be doing wrong? <pre><code id="code" class="php"></code></pre>

    Read the article

  • CSS/JS Problems IE7 Suggestions

    - by wuntee
    I have been having some serious issues trying to get this web page I have been working on working correctly with IE7 (ff/chrome/safari/ie8 all work fine). I have corrected all HTML and CSS issues, but it still does not render the same in IE7. I have been working on this for months, and was wondering if the community could give me some help: http://victoriakwasinski.com/ Thanks.

    Read the article

  • Table View Controller Problems

    - by happyCoding25
    Hello, I added a table view into a view in interface builder and now I need to wire it up to some pre-made classes that you can generate in xcode. I set the tableview controller's class to the class in xcode and wired the dataSource and delegate to my table view but the app just crashes. Im not sure how to get data to properly load into my table view when using a tableview in a different view. If anyone knows how to do this any help is appreciated. Thanks

    Read the article

  • Android multiple screen sizes and density problems

    - by Ben Mc
    I'm having a real problem with my drawables that I just can't seem to figure out. The problem is this: There are screen sizes at approximately 320x480, 480x800, 480x854 Then there are most commonly densities at 1.0 (160) and 1.5 (240) Now, on a Droid, the screen size is 480x800 and the density is reporting using DisplayMetrics as 1.5 On the G1, it's 320x480 and reporting back at a density of 1.0 BUT tablet devices are reporting back at 480x800 with a density of 1.0 (160) So, I'm going mad because I can put 320x480 images in the drawables-mdpi folder and 480x800 images in the drawables-hdpi folder, but on Tablet computers, no matter what it's not resizing up anything to a full screen. Any help would be greatly appreciated. I just want all of my 320x480 images to scale up regardless of the device.

    Read the article

  • Problems installing rdoc, irb, bluecloth, chronic on fedora 12

    - by Vineeth
    Hello, What do these errors mean? [root@localhost config]# gem install bluecloth Building native extensions. This could take a while... ERROR: Error installing bluecloth: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb can't find header files for ruby. Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/bluecloth-2.0.7 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/bluecloth-2.0.7/ext/gem_make.out [root@localhost config]# And this [root@localhost config]# gem install chronic Successfully installed json_pure-1.4.3 Successfully installed rubyforge-2.0.4 Successfully installed hoe-2.6.0 Successfully installed chronic-0.2.3 4 gems installed /usr/lib64/ruby/gems/1.8/gems/rdoc-2.5.8/lib/rdoc/ruby_lex.rb:67: warning: parenthesize argument(s) for future version ERROR: While executing gem ... (Gem::DocumentError) ERROR: RDoc documentation generator not installed: no such file to load -- irb/slex [root@localhost config]# I have installed rdocs using "yum install ruby-rdocs". But I don't understand what this error means

    Read the article

  • Problems with asp:Button OnClick event...

    - by Matt
    Hi, Here is my button <asp:Button ID="myButton" Text="Click Me" OnClick="doSomething(10)" runat="server" /> Here is the server function public void doSomething(int num) { int someOtherNum = 10 + num; } When I try to compile the code I get the error "Method Name Expected" for the line: <asp:Button ID="myButton" Text="Click Me" OnClick="doSomething(10)" runat="server" /> What am I doing wrong? Am I not allowed to pass values to the server from an OnClick event?

    Read the article

  • Problems importing WAR files in Eclipse?

    - by CitadelCSAlum
    I was unfortunately forced to result to uploading a WAR file as my backup for a web application I am working on. Luckily I have the most recent WAR file available. I am using Eclipse IDE and am using the Web Tools plugin for all the J2EE work that I am doing with the Dynamic Web Application Project. When I imported my WAR file, and ran it on a local server, everything works fine. The problem I a ran into is that in the Java Resources/src folder that all my packages and .java files were now only consists of all the same packages, but they are empty. I checked to see if I could find the files and I found the .class files in an "Imported files" folder that is not accessible in the Eclipse Project Explorer. I believe that I need to do some type of build or something so that my .java files are available for me, but unfortunately this is one area where I lack. One thing I would also like to know is, one way or the other, am I able to obtain the .java source code files if I have access to the .class files? Also, I would like to configure this environment as it was before where my Java Resources:src folder contaiend the packages and .java files.

    Read the article

  • Objective-C: Scope problems cellForRowAtIndexPath

    - by Mr. McPepperNuts
    How would I set each individual row in cellForRowAtIndexPath to the results of an array populated by a Fetch Request? (Fetch Request made when button is pressed.) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // ... set up cell code here ... cell.textLabel.text = [results objectAtIndex:indexPath valueForKey:@"name"]; } warning: 'NSArray' may not respond to '-objectAtIndexPath:' Edit: - (NSArray *)SearchDatabaseForText:(NSString *)passdTextToSearchFor{ NSManagedObject *searchObj; XYZAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; NSManagedObjectContext *managedObjectContext = appDelegate.managedObjectContext; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name contains [cd] %@", passdTextToSearchFor]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Entry" inManagedObjectContext:managedObjectContext]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [request setEntity: entity]; [request setPredicate: predicate]; NSError *error; results = [managedObjectContext executeFetchRequest:request error:&error]; // NSLog(@"results %@", results); if([results count] == 0){ NSLog(@"No results found"); searchObj = nil; self.tempString = @"No results found."; }else{ if ([[[results objectAtIndex:0] name] caseInsensitiveCompare:passdTextToSearchFor] == 0) { NSLog(@"results %@", [[results objectAtIndex:0] name]); searchObj = [results objectAtIndex:0]; }else{ NSLog(@"No results found"); self.tempString = @"No results found."; searchObj = nil; } } [tableView reloadData]; [request release]; [sortDescriptors release]; return results; } - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{ textToSearchFor = mySearchBar.text; results = [self SearchDatabaseForText:textToSearchFor]; self.tempString = [myGlobalSearchObject valueForKey:@"name"]; NSLog(@"results count: %d", [results count]); NSLog(@"results 0: %@", [[results objectAtIndex:0] name]); NSLog(@"results 1: %@", [[results objectAtIndex:1] name]); } @end Console prints: 2010-06-10 16:11:18.581 XYZApp[10140:207] results count: 2 2010-06-10 16:11:18.581 XYZApp[10140:207] results 0: BB Bugs 2010-06-10 16:11:18.582 XYZApp[10140:207] results 1: BB Annie Program received signal: “EXC_BAD_ACCESS”. (gdb) Edit 2: BT: #0 0x95a91edb in objc_msgSend () #1 0x03b1fe20 in ?? () #2 0x0043cd2a in -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] () #3 0x0043ca9e in -[UITableViewRowData invalidateAllSections] () #4 0x002fc82f in -[UITableView(_UITableViewPrivate) _updateRowData] () #5 0x002f7313 in -[UITableView noteNumberOfRowsChanged] () #6 0x00301500 in -[UITableView reloadData] () #7 0x00008623 in -[SearchViewController SearchDatabaseForText:] (self=0x3d16190, _cmd=0xf02b, passdTextToSearchFor=0x3b29630) #8 0x000086ad in -[SearchViewController searchBarSearchButtonClicked:] (self=0x3d16190, _cmd=0x16492cc, searchBar=0x3d2dc50) #9 0x0047ac13 in -[UISearchBar(UISearchBarStatic) _searchFieldReturnPressed] () #10 0x0031094e in -[UIControl(Deprecated) sendAction:toTarget:forEvent:] () #11 0x00312f76 in -[UIControl(Internal) _sendActionsForEventMask:withEvent:] () #12 0x0032613b in -[UIFieldEditor webView:shouldInsertText:replacingDOMRange:givenAction:] () #13 0x01d5a72d in __invoking___ () #14 0x01d5a618 in -[NSInvocation invoke] () #15 0x0273fc0a in SendDelegateMessage () #16 0x033168bf in -[_WebSafeForwarder forwardInvocation:] () #17 0x01d7e6f4 in ___forwarding___ () #18 0x01d5a6c2 in __forwarding_prep_0___ () #19 0x03320fd4 in WebEditorClient::shouldInsertText () #20 0x0279dfed in WebCore::Editor::shouldInsertText () #21 0x027b67a5 in WebCore::Editor::insertParagraphSeparator () #22 0x0279d662 in WebCore::EventHandler::defaultTextInputEventHandler () #23 0x0276cee6 in WebCore::EventTargetNode::defaultEventHandler () #24 0x0276cb70 in WebCore::EventTargetNode::dispatchGenericEvent () #25 0x0276c611 in WebCore::EventTargetNode::dispatchEvent () #26 0x0279d327 in WebCore::EventHandler::handleTextInputEvent () #27 0x0279d229 in WebCore::Editor::insertText () #28 0x03320f4d in -[WebHTMLView(WebNSTextInputSupport) insertText:] () #29 0x0279d0b4 in -[WAKResponder tryToPerform:with:] () #30 0x03320a33 in -[WebView(WebViewEditingActions) _performResponderOperation:with:] () #31 0x03320990 in -[WebView(WebViewEditingActions) insertText:] () #32 0x00408231 in -[UIWebDocumentView insertText:] () #33 0x003ccd31 in -[UIKeyboardImpl acceptWord:firstDelete:addString:] () #34 0x003d2c8c in -[UIKeyboardImpl addInputString:fromVariantKey:] () #35 0x004d1a00 in -[UIKeyboardLayoutStar sendStringAction:forKey:] () #36 0x004d0285 in -[UIKeyboardLayoutStar handleHardwareKeyDownFromSimulator:] () #37 0x002b5bcb in -[UIApplication handleEvent:withNewEvent:] () #38 0x002b067f in -[UIApplication sendEvent:] () #39 0x002b7061 in _UIApplicationHandleEvent () #40 0x02542d59 in PurpleEventCallback () #41 0x01d55b80 in CFRunLoopRunSpecific () #42 0x01d54c48 in CFRunLoopRunInMode () #43 0x02541615 in GSEventRunModal () #44 0x025416da in GSEventRun () #45 0x002b7faf in UIApplicationMain () #46 0x00002578 in main (argc=1, argv=0xbfffef5c) at /Users/default/Documents/iPhone Projects/XYZApp/main.m:14

    Read the article

  • Problems compiling an external library on linux...

    - by Kris
    So I am trying to compile the libssh2 library on linux, but when I try to compile the example it comes up with a lot of errors, and even though I include the headerfile it asks for, it still asks for it. Here are the error messages and the resulting messages: ~/ gcc -include /home/Roosevelt/libssh2-1.2.5/src/libssh2_config.h -o lolbaise /home/Roosevelt/libssh2-1.2.5/example/scp.c /home/Roosevelt/libssh2-1.2.5/example/scp.c:7:28: error: libssh2_config.h: No such file or directory /home/Roosevelt/libssh2-1.2.5/example/scp.c: In function 'main': /home/Roosevelt/libssh2-1.2.5/example/scp.c:39: error: storage size of 'sin' isn't known /home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: 'AF_INET' undeclared (first use in this function) /home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: (Each undeclared identifier is reported only once /home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: for each function it appears in.) /home/Roosevelt/libssh2-1.2.5/example/scp.c:81: error: 'SOCK_STREAM' undeclared (first use in this function) /home/Roosevelt/libssh2-1.2.5/example/scp.c:87: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'

    Read the article

  • Problems when I try to see databases in SQLite

    - by Sabau Andreea
    I created in code a database and two tables: static final String dbName="graficeCirculatie"; static final String ruteTable="Rute"; static final String colRuteId="RutaID"; static final String colRuta="Ruta"; static final String statiaTable="Statia"; static final String colStatiaID="StatiaID"; static final String colIdRuta="IdRuta"; static final String colStatia="Statia"; public DatabaseHelper(Context context) { super(context, dbName, null,33); } public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL("CREATE TABLE " + statiaTable + " (" + colStatiaID + " INTEGER PRIMARY KEY , " + colIdRuta + " INTEGER, " + colStatia + " TEXT)"); db.execSQL("CREATE TABLE " + ruteTable + "(" + colRuteId + " INTEGER PRIMARY KEY AUTOINCREMENT, " + colRuta + " TEXT);"); InsertDepts(db); } void InsertDepts(SQLiteDatabase db) { ContentValues cv = new ContentValues(); cv.put(colRuteId, 1); cv.put(colRuta, "Expres8"); db.insert(ruteTable, colRuteId, cv); cv.put(colRuteId, 2); cv.put(colRuta, "Expres2"); db.insert(ruteTable, colRuteId, cv); cv.put(colRuteId, 3); cv.put(colRuta, "Expres3"); db.insert(ruteTable, colRuteId, cv); } Now I want to see tables inputs from command line. I try in this way: C:\Program Files\Android\android-sdk\tools sqlite3 SQLite version 3.7.4 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite sqlite3 graficeCirculatie ... select * from ruteTable; And I got an error: Error: near "squlite3": syntax error. Can someone help me?

    Read the article

  • Switching from form_for to remote_form_for problems with submit changes in Rails

    - by Matthias Günther
    Hi there, another day with Rails and today I want to use Ajax. linkt_remote_link for changing a text was pretty easy so I thought it would also be easy to switch my form_for loop just to an ajax request form with remote_form_for, but the problem with the remote_form_for is that it doesn't save my changes? Here the code that worked: <% form_for bill, :url => {:action => 'update', :id => bill.id} do |f| %> # make the processing e.g. displaying texfields and so on <%= submit_tag 'speichern'%> It produces the following html code: <form action="/adminbill/update/58" class="edit_bill" id="edit_bill_58" method="post"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" /></div> <!-- here the html things for the forms --> <input class="button" name="commit" type="submit" value="speichern" /> Here the code which don't save me the changes and submit them: <% remote_form_for bill, :url => {:action => 'update', :id => bill.id} do |f| %> # make the processing e.g. displaying texfields and so on <%= submit_tag 'speichern'%> It produces the following html code: <form action="/adminbill/update/58" class="edit_bill" id="edit_bill_58" method="post" onsubmit="$.ajax({data:$.param($(this).serializeArray()), dataType:'script', type:'post', url:'/adminbill/update/58'}); return false;"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" /></div> <!-- here the html things for the forms --> <input class="button" name="commit" type="submit" value="speichern" /> I don't know if I have to consider something special when using remote_form_for (see remote_form_for)

    Read the article

  • Problems Using memset and memcpy

    - by user306557
    So I am trying to create a Memory Management System. In order to do this I have a set amount of space (allocated by malloc) and then I have a function myMalloc which will essentially return a pointer to the space allocated. Since we will then try and free it, we are trying to set a header of the allocated space to be the size of the allocated space, using memset. memset(memPtr,sizeBytes,sizeof(int)); We then need to be able to read this so we can see the size of it. We are attempting to do this by using memcpy and getting the first sizeof(int) bytes into a variable. For testing purposes we are just trying to do memset and then immediately get the size back. I've included the entire method below so that you can see all declarations. Any help would be greatly appreciated! Thanks! void* FirstFit::memMalloc(int sizeBytes){ node* listPtr = freelist; void* memPtr; // Cycle through each node in freelist while(listPtr != NULL) { if(listPtr->size >= sizeBytes) { // We found our space // This is where the new memory allocation begins memPtr = listPtr->head; memset(memPtr,sizeBytes,sizeof(int)); void *size; memcpy(size, memPtr, sizeof(memPtr)); // Now let's shrink freelist listPtr->size = listPtr->size - sizeBytes; int *temp = (int*)listPtr->head + (sizeBytes*sizeof(int)); listPtr->head = (int*) temp; return memPtr; } listPtr = listPtr->next; }

    Read the article

  • HTML character reference display problems.

    - by Bren
    Hey folks, I'm currently developing a site in Joomla, and one of the components I'm using makes use of a PHP file to administer the language. (english.php, spanish.php) The problem I'm having is that if I use the plain text version of eg. "á", it will show up in the browser tab title ok, but as a ? in the body of the page. But if I use a character reference (&#225;), the reverse happens! Any ideas? Thanks bren

    Read the article

  • problems with unpickling a 80 megabyte file in python

    - by tipu
    I am using the pickle module to read and write large amounts of data to a file. After writing to the file a 80 megabyte pickled file, I load it in a SocketServer using class MyTCPHandler(SocketServer.BaseRequestHandler): def handle(self): print("in handle") words_file_handler = open('/home/tipu/Dropbox/dev/workspace/search/words.db', 'rb') words = pickle.load(words_file_handler) tweets = shelve.open('/home/tipu/Dropbox/dev/workspace/search/tweets.db', 'r'); results_per_page = 25 query_details = self.request.recv(1024).strip() query_details = eval(query_details) query = query_details["query"] page = int(query_details["page"]) - 1 return_ = [] booleanquery = BooleanQuery(MyTCPHandler.words) if query.find("(") > -1: result = booleanquery.processAdvancedQuery(query) else: result = booleanquery.processQuery(query) result = list(result) i = 0 for tweet_id in result and i < 25: #return_.append(MyTCPHandler.tweets[str(tweet_id)]) return_.append(tweet_id) i += 1 self.request.send(str(return_)) However the file never seems to load after the pickle.load line and it eventually halts the connection attempt. Is there anything I can do to speed this up?

    Read the article

  • (static initialization order?!) problems with factory pattern

    - by smerlin
    Why does following code raise an exception (in createObjects call to map::at) alternativly the code (and its output) can be viewed here intererestingly the code works as expected if the commented lines are uncommented with both microsoft and gcc compiler (see here), this even works with initMap as ordinary static variable instead of static getter. The only reason for this i can think of is that the order of initialization of the static registerHelper_ object (factory_helper_)and the std::map object (initMap) are wrong, however i cant see how that could happen, because the map object is constructed on first usage and thats in factory_helper_ constructor, so everything should be alright shouldnt it ? I am even more suprised that those doNothing() lines fix the issue, because that call to doNothing() would happen after the critical section (which currently fails) is passed anyway. EDIT: debugging showed, that without the call to factory_helper_.doNothing(), the constructor of factory_helper_ is never called. #include <iostream> #include <string> #include <map> #define FACTORY_CLASS(classtype) \ extern const char classtype##_name_[] = #classtype; \ class classtype : FactoryBase<classtype,classtype##_name_> namespace detail_ { class registerHelperBase { public: registerHelperBase(){} protected: static std::map<std::string, void * (*)(void)>& getInitMap() { static std::map<std::string, void * (*)(void)>* initMap = 0; if(!initMap) initMap= new std::map<std::string, void * (*)(void)>(); return *initMap; } }; template<class TParent, const char* ClassName> class registerHelper_ : registerHelperBase { static registerHelper_ help_; public: //void doNothing(){} registerHelper_(){ getInitMap()[std::string(ClassName)]=&TParent::factory_init_; } }; template<class TParent, const char* ClassName> registerHelper_<TParent,ClassName> registerHelper_<TParent,ClassName>::help_; } class Factory : detail_::registerHelperBase { private: Factory(); public: static void* createObject(const std::string& objclassname) { return getInitMap().at(objclassname)(); } }; template <class TClass, const char* ClassName> class FactoryBase { private: static detail_::registerHelper_<FactoryBase<TClass,ClassName>,ClassName> factory_helper_; static void* factory_init_(){ return new TClass();} public: friend class detail_::registerHelper_<FactoryBase<TClass,ClassName>,ClassName>; FactoryBase(){ //factory_helper_.doNothing(); } virtual ~FactoryBase(){}; }; template <class TClass, const char* ClassName> detail_::registerHelper_<FactoryBase<TClass,ClassName>,ClassName> FactoryBase<TClass,ClassName>::factory_helper_; FACTORY_CLASS(Test) { public: Test(){} }; int main(int argc, char** argv) { try { Test* test = (Test*) Factory::createObject("Test"); } catch(const std::exception& ex) { std::cerr << "caught std::exception: "<< ex.what() << std::endl; } #ifdef _MSC_VER system("pause"); #endif return 0; }

    Read the article

  • What are the best workarounds for known problems with Hibernate's schema validation of floating poin

    - by Jason Novak
    I have several Java classes with double fields that I am persisting via Hibernate. For example, I have @Entity public class Node ... private double value; When Hibernate's org.hibernate.dialect.Oracle10gDialect creates the DDL for the Node table, it maps the value field to a "double precision" type. create table MDB.Node (... value double precision not null, ... It would appear that in Oracle, "double precision" is an alias for "float". So, when I try to verify the database schema using the org.hibernate.cfg.AnnotationConfiguration.validateSchema() method, Oracle appears to describe the value column as a "float". This causes Hibernate to throw the following Exception org.hibernate.HibernateException: Wrong column type in DBO.ACL_RULE for column value. Found: float, expected: double precision A very similar problem is listed in Hibernate's JIRA database as HHH-1961 (http://opensource.atlassian.com/projects/hibernate/browse/HHH-1961). I'd like to avoid doing anything that will break MySql, Postgres, and Sql Server support so extending the Oracle10gDialect appears to be the most promising of the workarounds mentioned in HHH-1961. But extending a Dialect is something I've never done before and I'm afraid there may be some nasty gotchas. What is the best workaround for this problem that won't break our compatibility with MySql, Postgres, and Sql Server? Thanks for taking the time to look at this!

    Read the article

  • Seam on Linux Problems

    - by Anand
    Hi, When a seam application on JBOSS using java 1,5 is deployed in Unix platform, I am getting this error. errorjava.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi ronment.java:62) It runs fine on windows platform. On my local linux machine it runs fine. but on another linux machine it works some times and sometimes it throws up the above error

    Read the article

  • problems with Console.SetOut in Release Mode?

    - by Matt Jacobsen
    i have a bunch of Console.WriteLines in my code that I can observe at runtime. I communicate with a native library that I also wrote. I'd like to stick some printf's in the native library and observe them too. I don't see them at runtime however. I've created a convoluted hello world app to demonstrate my problem. When the app runs, I can debug into the native library and see that the hello world is called. The output never lands in the textwriter though. Note that if the same code is run as a console app then everything works fine. C#: [DllImport("native.dll")] static extern void Test(); StreamWriter writer; public Form1() { InitializeComponent(); writer = new StreamWriter(@"c:\output.txt"); writer.AutoFlush = true; System.Console.SetOut(writer); } private void button1_Click(object sender, EventArgs e) { Test(); } and the native part: __declspec(dllexport) void Test() { printf("Hello World"); } Update: hamishmcn below started talking about debug/release builds. I removed the native call in the above button1_click method and just replaced it with a standard Console.WriteLine .net call. When I compiled and ran this in debug mode the messages were redirected to the output file. When I switched to release mode however the calls weren't redirected. Console redirection only seems to work in debug mode. How do I get around this?

    Read the article

  • Defining functions and if statement problems

    - by David Fairbairn
    I'm having a problem with two functions and an if statement. I'm being told the functions go and postcodeChange are not defined. I'm also being told flag is an unexpected identifier at if flag == 1. Any idea where I am going wrong? Thank you. function postcodeChange(){ document.getElementById("goButton").onclick = distanceCheck; } function distanceCheck(){ var distance = document.getElementById("distance").value var patt1=new RegExp("^[0-9]+(\.[0-9]{1})?$"); var out = patt1.exec(distance); if (out == null) { //distance is not a valid number document.getElementById("distanceFlag").value = 1 } else { //distance is valid number document.getElementById("distanceFlag").value = 0 } function go(){ var flag = document.getElementById("distanceFlag").value if flag == 1 { alert("Distance is not valid- enter a number with no more than one decimal point"); } else{ popSubmit('#fa Care Provider Search Go','','0'); } }

    Read the article

  • C - struct problems - writing

    - by Catarrunas
    Hello, I'm making a program in C, and I'mm having some troubles with memory, I think. So my problem is: I have 2 functions that return a struct. When I run only one function at a time I have no problem whatsoever. But when I run one after the other I always get an error when writting to the second struct. Function struct item* ReadFileBIN(char *name) -- reads a binary file. struct tables* getMesasInfo(char* Filename) -- reads a text file. My code is this: #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int numberOfTables=0; int numberOfItems=0; //struct tables* mesas; //struct item* Menu; typedef struct item{ char nome[100]; int id; float preco; }; typedef struct tables{ int id; int capacity; bool inUse; }; struct tables* getMesasInfo(char* Filename){ struct tables* mesas; char *c; int counter,numberOflines=0,temp=0; char *filename=Filename; FILE * G; G = fopen(filename,"r"); if (G==NULL){ printf("Cannot open file.\n"); } else{ while (!feof(G)){ fscanf(G, "%s", &c); numberOflines++; } fclose(G); } /* Memory allocate for input array */ mesas = (struct tables *)malloc(numberOflines* sizeof(struct tables*)); counter=0; G=fopen(filename,"r"); while (!feof(G)){ mesas[counter].id=counter; fscanf(G, "%d", &mesas[counter].capacity); mesas[counter].inUse= false; counter++; } fclose(G); numberOfTables = counter; return mesas; } struct item* ReadFileBIN(char *name) { int total=0; int counter; FILE *ptr_myfile; struct item my_record; struct item* Menu; ptr_myfile=fopen(name,"r"); if (!ptr_myfile) { printf("Unable to open file!"); } while (!feof(ptr_myfile)){ fread(&my_record,sizeof(struct item),1,ptr_myfile); total=total+1; } numberOfItems=total-1; Menu = (struct item *)calloc(numberOfItems , sizeof(struct item)); fseek(ptr_myfile, sizeof(struct item), SEEK_END); rewind(ptr_myfile); for ( counter=1; counter < total ; counter++) { fread(&my_record,sizeof(struct item),1,ptr_myfile); Menu[counter] = my_record; printf("Nome: %s\n",Menu[counter].nome); printf("ID: %d\n",Menu[counter].id); printf("Preco: %f\n",Menu[counter].preco); } fclose(ptr_myfile); return Menu; } int _tmain(int argc, _TCHAR* argv[]) { struct item* tt = ReadFileBIN("menu.dat"); struct tables* t = getMesasInfo("Capacity.txt"); getchar(); }** Thanks in advance.

    Read the article

  • Deployment problems of asp.net 3.5 in iis 5.1

    - by peter
    i have microsoft.net 3.5 application and have IIS5.1,,for deploying website do i need to do any thing aother than this 1.In IIS i created virtual directory named SPA and i browsed in to the location where my project is lacated and i added entire project file there( Do i need to add only bin file and login page or i need to add all pages???) 2.In asp.net folder i selected tab version 2.0,, 3.when i browsed i can see all pages when i click login.aspx i am getting this error [SqlException (0x80131904): User does not have permission to perform this action.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +821651 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 ChatTool.LoginForm.Page_Load(Object sender, EventArgs e) in D:\Chat tool_Ameya\ProjectCode\Unisys Project Testing\Unisys Project\Login.aspx.cs:25 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

    Read the article

  • UTF8 charset, diacritical elements, conversion problems - and Zend Framework form escaping

    - by imanc
    Hey, I am writing a webapp in ZF and am having serious issues with UTF8. It's using multi lingual content through Zend Form and it seems that ZF heavily escapes all of these characters and basically just won't show a field if there's diacritical elements 'é' and if I use the HTML entity equivalent e.g. é it gets escaped so that the user will see 'é'. Zend Form allows for having non escaped data, but trying to use this is confusing, and it seems it'd need to be used all over the place. So, I have been told that if the page and the text is in UTF8, no conversion to htmlentities is required. Is this true? And if the last question is true, then how do I convert the source text to UTF8? I am comfortable setting up apache so that it sends a default UTF8 charset heading, and also adding the charset meta tag to the html, but doing this I am still getting messed up encoding. I have also tried opening the translation csv file in TextWrangler on OSX as UTF8, but it has done nothing. Thanks! L

    Read the article

  • PHP & cUrl - POST problems in while loop.

    - by Max Hoff
    I have a while loop, with cUrl inside. (I can't use curl_multi for various reasons.) The problem is that cUrl seems to save the data it POSTS after each loop traversal. For instance, if parameter X is One the first loop through, and if it's Two the second loop through, cUrl posts: "One,Two". It should just POST "Two".(This is despite closing and unsetting the curl handle.) Here's a simplified version of the code (with unecessary info stripped out): while(true){ // code to form the $url. this code is local to the loop. so the variables should be "erased" and made new for each loop through. $ch = curl_init(); $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; curl_setopt($ch,CURLOPT_USERAGENT, $userAgent); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $html = curl_exec($ch); curl_close($ch); unset($ch); $dom = new DOMDocument(); @$dom->loadHTML($html); $xpath = new DOMXPath($dom); $resultTable = $xpath->evaluate("/html/body//table"); // $resultTable is 20 the first time through the loop, and 0 everytime thereafter becauset he POSTing doesn't work right with the "saved" parameters. What am I doing wrong here?

    Read the article

  • Problems with ASP.NET, machine-level web.config, and the location element

    - by Daniel Schaffer
    I've got a server running Windows Web Server 2008 R2. The machine-level web.config has the following entries: <location path="Preview"> <appSettings> <add key="Environment" value="Preview" /> </appSettings> </location> <location path="Staging"> <appSettings> <add key="Environment" value="Staging" /> </appSettings> </location> <location path="Production"> <appSettings> <add key="Environment" value="Production" /> </appSettings> </location> I have a website that I'd set up in the direction D:\Sites\Preview\, so the full path would be D:\Sites\Preview\WebSite1. If I put a simple aspx file that just outputs the value of ConfigurationManager.AppSettings["Environment"], it displays the value Preview. I'm not clear on exactly how that works, but it does. I'd set this up several weeks ago, and just now tried to duplicate this - I put a second site in the D:\Sites\Preview\ directory, expecting that it would automatically pick up the appropriate appSettings entries, but for some reason it hasn't - the same aspx page doesn't show anything. Additionally, when I go into the IIS manager and open the Configuration Editor, there are no settings in there, whereas there are settings listed for the first site. Any ideas as to what I could be missing? Is the location element intended to work like this, or did I just find some magical fluke with my first site?

    Read the article

  • Site hosted with Blogger has some display problems in IE

    - by dafactopedia
    Hello guys..My site url is : Da Factopedia It opens up perfectly in all browsers Firefox, Opera, Safari, Chrome. Even in IE 8 the Home page is perfectly displayed . But if you click on any post page like this one : http://www.dafactopedia.com/2010/03/7-surprising-facts-about-sleep.html the right sidebar starts acting up. It starts floating within the main post area and I have no clue why this happens. Here is the template xml code in a txt file : http://www.opendrive.com/files/6244724_nPpSE_bf53/template.txt in xml format : http://www.opendrive.com/files/6244723_40eAI_3e95/template-6257961483006208180(4).xml

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >