Search Results

Search found 657 results on 27 pages for 'kyle'.

Page 22/27 | < Previous Page | 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • script validation error

    - by Kyle Sevenoaks
    Hi, there is a script in my html tag <script type="text/javascript"> function setTaxDisplay(display) { window.location.href += (window.location.href.indexOf('?') > -1 ? '&' : '?') + 'taxInclude=' + display; } </script> When passed to validation It returns that the ampersand there isn't valid, but it's absolutely vital to the function of the page, is there a way I can make the validator ignore this? I don't need to validate the page, I'm no JS expert at all I'm not sure if I can replace it with &amp;. Thanks.

    Read the article

  • How can I build a voting system to support multiple types of objects to vote on?

    - by Kyle Hayes
    I'm really looking for something very similar to the way SO is setup where a few different kinds of things can be voted on (questions AND answers). What kind of DB schema, generally, could I use to support voting on many different kinds of objects? Would I have a single Vote table that would have references to other objects in the database? Or do I have to have or should have a separate vote table for each of the objects I would like to vote on.

    Read the article

  • How would you show a file with CURL? [PHP]

    - by Kyle
    There is an epic lack of php CURL love on the internet for beginners like me. I was wondering how to use CURL to download & display an ICS file (They're plain text to me...) in my php code. Unless Fopen is 1,000 times easier, I'd like to stick with CURL for this one.

    Read the article

  • Faster Insertion of Records into a Table with SQLAlchemy

    - by Kyle Brandt
    I am parsing a log and inserting it into either MySQL or SQLite using SQLAlchemy and Python. Right now I open a connection to the DB, and as I loop over each line, I insert it after it is parsed (This is just one big table right now, not very experienced with SQL). I then close the connection when the loop is done. The summarized code is: log_table = schema.Table('log_table', metadata, schema.Column('id', types.Integer, primary_key=True), schema.Column('time', types.DateTime), schema.Column('ip', types.String(length=15)) .... engine = create_engine(...) metadata.bind = engine connection = engine.connect() .... for line in file_to_parse: m = line_regex.match(line) if m: fields = m.groupdict() pythonified = pythoninfy_log(fields) #Turn them into ints, datatimes, etc if use_sql: ins = log_table.insert(values=pythonified) connection.execute(ins) parsed += 1 My two questions are: Is there a way to speed up the inserts within this basic framework? Maybe have a Queue of inserts and some insertion threads, some sort of bulk inserts, etc? When I used MySQL, for about ~1.2 million records the insert time was 15 minutes. With SQLite, the insert time was a little over an hour. Does that time difference between the db engines seem about right, or does it mean I am doing something very wrong?

    Read the article

  • passing LIMIT as parameters to MySQL sproc

    - by Kyle
    I'm creating a paging class and need to pass in two parameters to my MySQL stored procedure for the LIMIT clause. I'm passing them in as INTs and trying something like this SELECT * FROM `MyTable` LIMIT MyFirstParamInt, MySecondParamInt it gives me an error when I try and save the sproc though. Is there a way to do this that I'm just missing? Or am I going to have to EVAL the whole query and EXECUTE it?

    Read the article

  • {textarea} smarty php

    - by Kyle Sevenoaks
    Hi, further to a previous question, I have this code: {textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"} And I want the output to be <textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea> I tried [/textarea} but it didn't work in my template file. Is it possible to make this in smarty/php? Thanks :)

    Read the article

  • iPhone keeps going into dim/sleep mode even with the proper API calls.

    - by Kyle
    I call: [[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ] on the applicationDidFinishLaunching event.. I set a breakpoint on it, which fires so I know it's getting called.. I've also called this function in other places as well.. Basically, a 3G iPhone will still go into sleep mode, but my 3GS won't. Has anyone seen this behavior before? Both are running the latest OS versions. Thanks for reading!

    Read the article

  • "Ghost" values in PHP/Smarty.

    - by Kyle Sevenoaks
    I've been working on a site for a while changing the layout and skin of a webshop checkout process. I've noticed that if you go all the way through the process until the last page, then click the link to go back to the view products page, the delivery method price displays underneath the navigation buttons, until you refresh and it goes away again. I've downloaded both sourced from the browser (Chrome, but this bug applies to all browsers) and used a file difference tool to display the differences, the result being only: < error.html vs > normal.html 34c34 < <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272181" rel="Stylesheet" type="text/css"/> --- > <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272348" rel="Stylesheet" type="text/css"/> Which is just the way it zips up the CSS stylesheets. (afaik) Has anyone ever encountered such a problem, or anything similar? Normal: Error: I can't even hazard a guess as to what is causing this, at all. I've searched over Google for anything and come up with nothing. What could be causing this? The site in question is Euroworker.no. HTML @ Pastebin. Smarty snippet: {if !$CANONICAL} {canonical}{self}{/canonical} {/if} <link rel="canonical" href="{$CANONICAL}" /> <!-- Css includes --> {includeCss file="frontend/Frontend.css"} {includeCss file="backend/stat.css"} {if {isRTL}} {includeCss file="frontend/FrontendRTL.css"} {/if} {compiledCss glue=true nameMethod=hash} <!--[if lt IE 8]> <link href="stylesheet/frontend/FrontendIE.css" rel="Stylesheet" type="text/css"/> {if $ieCss} <link href="{$ieCss}" rel="Stylesheet" type="text/css"/> {/if} <![endif]--> Thanks.

    Read the article

  • How do I prevent ImageMagick convert from scaling images *up*?

    - by Kyle
    I'm using ImageMagick's convert tool to generate image thumbnails for a web application. I'm using notation like so: 600x600> The images are indeed scaled to 600px wide/tall (depending on the longer side) and proportions are properly maintained, however images less than 600px in either direction are scaled up — this behavior is not desired. Is there a way to prevent convert from scaling images up if the destination dimensions both exceed the original image size?

    Read the article

  • How to efficiently implement a blocking call with Rails, while letting the client wait for the reply

    - by Kyle Heironimus
    We have a web service written in Rails. The API is published and we cannot change it. Our app communicates with a remote web service that sometimes hangs or takes several seconds to reply. Client -> Our Web Service -> Remote Web Service Currently, if the remote web service hangs for 5 seconds, one of our rails processes on our web service also hangs with it, which is what we need to avoid. I've seen things such as mod-x-sendfile, modporter, and delayed jobs, but the best I can tell, they all assume the client is not waiting for an answer. Since the API is already established, we cannot tell the client "I'm attempting to do what you want, check back later for the answer." The best option we have come up with so far is to add a second, non-rails web server running eventmachine to process these particular calls. Is there a better way?

    Read the article

  • Div behind another div problem.

    - by Kyle Sevenoaks
    Here is a (big) example of the massive problem I am having, when this page is live at euroworker.no/order, it is dynamically generated, I have supplied a static version for people to mess with. All I need is where it says "Endre Valg" to push the div wrapper under it down.. Sounds easy huh? I have tried many many things, I hope that some discussion and even trial and error can help us here. Sorry for the huge amount of code and stuff but this has taken me all day and I am out of ideas. Thanks.

    Read the article

  • C++ vector of strings, pointers to functions, and the resulting frustration.

    - by Kyle
    So I am a first year computer science student, for on of my final projects, I need to write a program that takes a vector of strings, and applies various functions to these. Unfortunately, I am really confused on how to use pointer to pass the vector from function to function. Below is some sample code to give an idea of what I am talking about. I also get an error message when I try to deference any pointer. thanks. #include <iostream> #include <cstdlib> #include <vector> #include <string> using namespace std; vector<string>::pointer function_1(vector<string>::pointer ptr); void function_2(vector<string>::pointer ptr); int main() { vector<string>::pointer ptr; vector<string> svector; ptr = &svector[0]; function_1(ptr); function_2(ptr); } vector<string>::pointer function_1(vector<string>::pointer ptr) { string line; for(int i = 0; i < 10; i++) { cout << "enter some input ! \n"; // i need to be able to pass a reference of the vector getline(cin, line); // through various functions, and have the results *ptr.pushback(line); // reflectedin main(). But I cannot use member functions } // of vector with a deferenced pointer. return(ptr); } void function_2(vector<string>::pointer ptr) { for(int i = 0; i < 10; i++) { cout << *ptr[i] << endl; } }

    Read the article

  • iOS get user contacts excluding businesses

    - by Kyle Begeman
    I have an app that is loading all of a users contacts. I would like to exclude any business, but I can't seem to find a way to determine if a contact is a business. I initially considered check if the "company" field contains a value when the first and last name do not, but I can't find this property from the ABRecord. Here is how I am grabbing the first and last name: NSString *firstName = (__bridge_transfer NSString *)ABRecordCopyValue(contactPerson, kABPersonFirstNameProperty); NSString *lastName = (__bridge_transfer NSString *)ABRecordCopyValue(contactPerson, kABPersonLastNameProperty); Any ideas? Thanks!

    Read the article

  • [c++] accessing the hidden 'this' pointer

    - by Kyle
    I have a GUI architecture wherein elements fire events like so: guiManager->fireEvent(BUTTON_CLICKED, this); Every single event fired passes 'this' as the caller of the event. There is never a time I dont want to pass 'this', and further, no pointer except for 'this' should ever be passed. This brings me to a problem: How can I assert that fireEvent is never given a pointer other than 'this', and how can I simplify (and homogenize) calls to fireEvent to just: guiManager->fireEvent(BUTTON_CLICKED); At this point, I'm reminded of a fairly common compiler error when you write something like this: class A { public: void foo() {} }; class B { void oops() { const A* a = new A; a->foo(); } }; int main() { return 0; } Compiling this will give you ../src/sandbox.cpp: In member function ‘void B::oops()’: ../src/sandbox.cpp:7: error: passing ‘const A’ as ‘this’ argument of ‘void A::foo()’ discards qualifiers because member functions pass 'this' as a hidden parameter. "Aha!" I say. This (no pun intended) is exactly what I want. If I could somehow access the hidden 'this' pointer, it would solve both issues I mentioned earlier. The problem is, as far as I know you can't (can you?) and if you could, there would be outcries of "but it would break encapsulation!" Except I'm already passing 'this' every time, so what more could it break. So, is there a way to access the hidden 'this', and if not are there any idioms or alternative approaches that are more elegant than passing 'this' every time?

    Read the article

  • [c++] Resolving namespace conflicts

    - by Kyle
    I've got a namespace with a ton of symbols I use, but I want to overwrite one of them: external_library.h namespace lottaStuff { class LotsOfClasses {}; class OneMoreClass {}; }; my_file.h using namespace lottaStuff; namespace myCustomizations { class OneMoreClass {}; }; my_file.cpp using myCustomizations::OneMoreClass; int main() { OneMoreClass foo; // error: reference to 'OneMoreClass' is ambiguous return 0; } How do I get resolve the 'ambiguous' error without resorting to replacing 'using namespace lottaStuff' with a thousand individual "using xxx;" statements?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27  | Next Page >