Daily Archives

Articles indexed Friday May 28 2010

Page 5/107 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Best way to structure AJAX for a Zend Framework application

    - by John Nall
    Sorry, but there's a lot of outdated and just plain bad information for Zend Framework, since it has changed so much over the years and is so flexible. I thought of having an AJAX module service layer, with controllers and actions that interact with my model. Easy, but not very extensible and would violate DRY. If I change the logistics of some process I'll have to edit the AJAX controllers and the normal controllers. So ideally I would load the exact same actions for both javascript and non-javascript users. I have thought about maybe checking for $_POST['ajax'], if it is set I would load a different (json'y) view for the data. Was wondering how/a good way to do this (front controller plugin I imagine?) or if someone can point me to an UP TO DATE tutorial that describes a really good way for building a larger ajax application. thx

    Read the article

  • PHP controllable menubar position

    - by craide
    I'm an admin for a page and I want to give certain users dynamic control of the menubar layout. The ideal would be a page with a list with menu items and arrows pointing up and down with each item and when you click them the item is reordered. I have a pretty basic idea of how I can do it but I would like some suggestions. The items are stored in MySQL and I only need help figuring out how the items should be ordered or numbered and how to re-order them. This probably needs some javascript trickery and I'm not familiar with JS.

    Read the article

  • How can I do monthly subscription credit card billing?

    - by NotDan
    I've written a subscription based web app that I want to charge (by credit card) a monthly fee. There are 3 different plans and once they sign up, they should be billed that amount, automatically, every month until they cancel. Is there an easy way to set this up (some sort of online service maybe?).

    Read the article

  • MPMoviePlayerController doesn't implement MPMediaPlayback protocal as advertised?

    - by goren
    I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that: You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms. Except just above in the header here: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html it doesn't seem to. All I want to do is slow down the playback rate for a video.

    Read the article

  • Major JQuery bug on IE not reproducible - What can i do in this situation to solve this bug?

    - by ming yeow
    I am hoping to get some help on this issue. Some users on IE have been reporting this javascript issue, but I have been unable to re-produce it. In essence, for some class of windows IE users, the game doesn't work (or $.ajax() is not working). What I know: I swapped out an ajax call (ajax_init_trainer) and used a standard link with some request parameters to do the initialization and ppl seemed to get passed the problem until they hit the next ajax call. I read somewhere that IE does crazy caching so you need to make the urls unique, which is why i added the _requestno parameter. However, setting the cache:false is said to also do this. This didn't fix it for someone who was complaining. function done(res, status) { var data = JSON.parse(res.responseText); hide_loading(); if (status == "success") { window.location.href="/bamo/battle/?{{ fb_sig}}"; } else { display_alert("Problem!",data.msg,$("#notifications")); } }; $(".monster_select_class").click(function() { $(this).attr("src","{{MEDIA_URL}}/bamo/button_select_click.png"); monster_class = $(this).attr("monster_class"); monster_type = $(this).attr("monster_type"); ajax_init_trainer(monster_class,monster_type); }); function ajax_init_trainer(trainer_class,monster_type) { var data = {trainer_class:trainer_class,monster_type:monster_type}; var d = new Date(); var args = { type:"POST",url:"/bamo/api/init_trainer/?_requestno="+d.getTime(),data:data,contentType:"application/json;", dataType: "json",cache:false,complete:done}; $.ajax(args); return false; };

    Read the article

  • Django 'ImproperlyConfigured' error after deployment on google app engine

    - by oreon
    Hello, I'm currently trying to get my first django project running on Google App Engine. I followed the instructions given here http://www.allbuttonspressed.com/projects/djangoappengine as best I could. Unfortunately I have run into some issues. Locally everything runs fine, no problems. I then tried to deploy my project to the cloud. This is where I'm totally stuck. I always receive 500 Server Errors coupled with google.appengine.runtime.DeadlineExceededError's. Every now and then I get the following error message in my logs, which I think is the root of the problem : <class 'django.core.exceptions.ImproperlyConfigured'>: ImportError projectyalanda.pricecompare: No module named projectyalanda.pricecompare Obviously something is wrong in the way I reference my django app. Why this is only an issue in the cloud is a mystery to me. The interesting part in the settings.py file is setup as following: INSTALLED_APPS = ( 'djangotoolbox', # 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'projectyalanda.pricecompare', ) I absolutely can't figure out why django/appengine wouldn't be able to find the module, especially since everything works perfectly locally. So where else can I look? The local folder structure is of course also correct as automatically done by django, so maybe something is messed up during deployment? How would I be able to find out? Please help me ;-) Thanks

    Read the article

  • Can someone please explain to me the basic function of Intents in the Android OS?

    - by K-RAN
    I'm new to programming applications for the Android OS. As far as general architecture of the OS goes, I understand that processes are implemented as Linux processes and that each one is sandboxed. However, I'm utterly confused on the IPCs and syscalls (if any) used. I know that the IBinder is a form of this; parcels are sent back and forth between processes and Bundles are array forms of parcels (?). But even that is still unfamiliar to me. Same with Intents. All in all, I don't understand what kinds of IPCs are implemented and how. Could someone briefly explain to me the specific methods used by user level applications in Android OS to communicate with each other and the OS? I've done kernel programming and played with various IPCs in Linux (Ubuntu and Debian) so it would help immensely if this was all explained in relation to what I'm familiar with... Thanks in advance!

    Read the article

  • Obtain Latitude and Longitude from a GeoTIFF File

    - by Mikee
    Using GDAL in Python, how do you get the latitude and longitude of a GeoTIFF file? GeoTIFF's do not appear to store any coordinate information. Instead, they store the XY Origin coordinates. However, the XY coordinates do not provide the latitude and longitude of the top left corner and bottom left corner. It appears I will need to do some math to solve this problem, but I don't have a clue on where to start. What procedure is required to have this performed? I know that the GetGeoTransform() method is important for this, however, I don't know what to do with it from there.

    Read the article

  • How do i select all the text nodes within a specific element node using XSL?

    - by user323719
    How do i select all the text nodes within a specific element node using XSL? Input xml: <node1 id="1"> <node2 id="2"> <node3 id="3" /> <node4 id="4"> <node5 id="5">Text node1</node5> <node6 id="6">Text node2</node6> </node4> </node2> <node7 id="7">Text node3 <node8 id="8">Text node4</node8> <node9 id="9">Text node5</node9> </node7> <node10 id="10">Text node6</node10> <node11 id="11">Text node3 <node12 id="12">Text node4</node12> <node13 id="13">Text node5</node13> </node11> </node1> Input Param: List of ids of the element nodes whose txt nodes are to be retrieved. <nodes><node>4</node><node>7</node><node>10</node></nodes> Expected Output: Text node1 Text node2 Text node3 Text node4 Text node5 Text node6 How can this be achieved using XSL? Please share your ideas.

    Read the article

  • C++: Templates for static functions?

    - by Rosarch
    I have a static Utils class. I want certain methods to be templated, but not the entire class. How do I do this? This fails: #pragma once #include <string> using std::string; class Utils { private: template<class InputIterator, class Predicate> static set<char> findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); public: static void PrintLine(const string& line, int tabLevel = 0); static string getTabs(int tabLevel); template<class InputIterator, class Predicate> static set<char> Utils::findAll_if(InputIterator begin, InputIterator end, Predicate pred); }; Error: utils.h(10): error C2143: syntax error : missing ';' before '<' utils.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int utils.h(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int utils.h(10): error C2238: unexpected token(s) preceding ';' utils.h(10): error C2988: unrecognizable template declaration/definition utils.h(10): error C2059: syntax error : '<' What am I doing wrong? What is the correct syntax for this? Incidentally, I'd like to templatize the return value, too. So instead of: template<class InputIterator, class Predicate> static set<char> findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); I'd have: template<class return_t, class InputIterator, class Predicate> static return_t findAll_if_rec(InputIterator begin, InputIterator end, Predicate pred, set<char> result); How would I specify that: 1) return_t must be a set of some sort 2) InputIterator must be an iterator 3) InputIterator's type must work with return_t's type. Thanks.

    Read the article

  • Help getting iPython to run from the OSX terminal.

    - by Azfar
    Hi there, Got a heads up from stackoverflow.com to ask the question here. I'm going through the matplotlib documentation and prepared to use the iPython interactive Python shell with ipython -pylab. However I get this: MBP:~ Me$ ipython -pylab -bash: ipython: command not found Did I fail to install iPython? I used easy_install as advised. Any ideas? Update Thought I'd just say that I found the iPython "executable" in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin after doing a Spotlight search. Still a little confused as to what to do.

    Read the article

  • mysql: how to set max_allowed_packet for shared hosting?

    - by Sadi
    Hello, I need to set (increase) max_allowed_packet. But the problem is I am using a shared hosting. So, I can not access the .ini or .cnf file. Also I can not use the SET command. How can I am able to set a value (actually increase) for the max_allowed_packet, without asking the hosting support. I have no SSH access there. EDIT: I am trying to use VB 4.0.3. In there the attachment size is limited by it. So, I do not think splitting the file can be an option in this case. Thank you Sadi

    Read the article

  • Pitfalls to avoid when starting a software company.

    - by Imagist
    It's been my goal to start my own software company basically since I started programming HyperCard on System 6 back in elementary school. Recent changes in my job situation have convinced me that I should be pursuing this goal more actively. My question is, what are some pitfalls that I should avoid when starting a software company? A lot of companies fail and I'm sure there are a lot of reasons. As a side-request, it would be particularly helpful if you could tell me a little about your own experience with starting a software company or being a part of a startup, so I know how you know what you know.

    Read the article

  • MPMoviePlayerController doesn't implement MPMediaPlayback protocol as advertised?

    - by goren
    I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that: You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms. Except just above in the header here: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html it doesn't seem to. All I want to do is slow down the playback rate for a video.

    Read the article

  • Enums, Constructor overloads with similar conversions.

    - by David Thornley
    Why does VisualC++ (2008) get confused 'C2666: 2 overloads have similar conversions' when I specify an enum as the second parameter, but not when I define a bool type? Shouldn't type matching already rule out the second constructor because it is of a 'basic_string' type? #include <string> using namespace std; enum EMyEnum { mbOne, mbTwo }; class test { public: #if 1 // 0 = COMPILE_OK, 1 = COMPILE_FAIL test(basic_string<char> myString, EMyEnum myBool2) { } test(bool myBool, bool myBool2) { } #else test(basic_string<char> myString, bool myBool2) { } test(bool myBool, bool myBool2) { } #endif }; void testme() { test("test", mbOne); } I can work around this by specifying a reference 'ie. basic_string &myString' but not if it is 'const basic_string &myString'. Also calling explicitly via "test((basic_string)"test", mbOne);" also works. I suspect this has something to do with every expression/type being resolved to a bool via an inherent '!=0'. Curious for comments all the same :)

    Read the article

  • Add JSON support to Rails app

    - by Meltemi
    I am experimenting with Rails and was wondering what's needed to allow/add support for JSON requests? I have a vanilla installation of Rails 2.3.5 and the default scaffolding seem to provide support for HTML & XML requests but not JSON. class EventsController < ApplicationController # GET /events # GET /events.xml def index @events = Event.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @events } end end # GET /events/1 # GET /events/1.xml def show @event = Event.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @event } end end ... I'm new to this but it would appear as though i would need to add a format line in each method along the lines of: format.js { render :js => @event.json } couldn't this be done automatically? perhaps there's a template somewhere i need to update...or a flag i can set? Or perhaps, and most likely, I've missed the boat entirely?!?

    Read the article

  • Apache POI HWPF Nested Lists?

    - by Mahadevan
    Hi, I used the following code to read list structures from a word file using hwpf. My question is how to read a list structure that is nested ie a list within a list within a list and so on. if (p instanceof ListEntry) { ListEntry entry = (ListEntry) p; outText = entry.text(); outText = "<li>" + outText + "</li>"; // verifca prima e ultimo if (i > 1) { pPrev = range.getParagraph(i - 1); if (!(pPrev instanceof ListEntry)) outText = "<ul>" + outText; } if (i < nParagrafi - 1) { pNext = range.getParagraph(i + 1); if (!(pNext instanceof ListEntry)) outText = outText + "</ul>"; } if (i == nParagrafi - 1) { outText = outText + "</ul>"; }

    Read the article

  • how to disable the lightbox to close after clicking on a submit button?

    - by Mahmoud
    Hey there i have a lightbox that contains a button images where once the user/visitor clicks on that images its adds the item into cart. what i am trying to do is that once the button is clicked it adds the item without close the ifram is it possible i am using http://www.huddletogether.com/projects/lightbox2/ the cart that i used is http://conceptlogic.com/jcart/ code used: echo"<div class='virtualpage hidepiece'><a href='gal/".$row['pro_image']."' rel='lightbox[roadtrip]' title='&lt;form class=&quot;jcart&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;".$row['pro_num']."&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;".$row['pro_name']."&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;price&quot; value=&quot;".$row['pro_price']."&quot; /&gt; &lt;input type=&quot;hidden&quot;name=&quot;qty&quot; size = &quot;1&quot; value=&quot;1&quot; /&gt; <br /> &lt;input type=&quot;image&quot; value=&quot;Submit&quot; name=&quot;addto&quot; src = &quot;images/add.png&quot; /&gt; &lt;/form&gt; ".$row['pro_name']." : ".$row['pro_mini_des']."' style='color:#000'><img title = ' ' src='thumb/".$row['pro_thumb']."' /> </a></div> ";

    Read the article

  • .NET XML Serialization without <?xml> root node

    - by Graphain
    Hi, I'm trying to generate XML like this: <?xml version="1.0"?> <!DOCTYPE APIRequest SYSTEM "https://url"> <APIRequest> <Head> <Key>123</Key> </Head> <ObjectClass> <Field>Value</Field </ObjectClass> </APIRequest> I have a class (ObjectClass) decorated with XMLSerialization attributes like this: [XmlRoot("ObjectClass")] public class ObjectClass { [XmlElement("Field")] public string Field { get; set; } } And my really hacky intuitive thought to just get this working is to do this when I serialize: ObjectClass inst = new ObjectClass(); XmlSerializer serializer = new XmlSerializer(inst.GetType(), ""); StringWriter w = new StringWriter(); w.WriteLine(@"<?xml version=""1.0""?>"); w.WriteLine("<!DOCTYPE APIRequest SYSTEM"); w.WriteLine(@"""https://url"">"); w.WriteLine("<APIRequest>"); w.WriteLine("<Head>"); w.WriteLine(@"<Field>Value</Field>"); w.WriteLine(@"</Head>"); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", ""); serializer.Serialize(w, inst, ns); w.WriteLine("</APIRequest>"); However, this generates XML like this: <?xml version="1.0"?> <!DOCTYPE APIRequest SYSTEM "https://url"> <APIRequest> <Head> <Key>123</Key> </Head> <?xml version="1.0" encoding="utf-16"?> <ObjectClass> <Field>Value</Field> </ObjectClass> </APIRequest> i.e. the serialize statement is automatically adding a <?xml root element. I know I'm attacking this wrong so can someone point me in the right direction? As a note, I don't think it will make practical sense to just make an APIRequest class with an ObjectClass in it (because there are say 20 different types of ObjectClass that each needs this boilerplate around them) but correct me if I'm wrong.

    Read the article

  • How to detect a gamepad button press on OSX 10.5 and higher?

    - by Steph Thirion
    How do I detect a button press on a USB gamepad on OSX 10.5 and higher? I can't wrap my head around the ridiculously complex HID Manager (even though apparently it was simplified with 10.5), and the code samples at Apple have thousands of lines of code that would take days to understand and isolate what I need, so I'd appreciate if someone posts a simple, and fully coded solution for this isolated problem. EDIT: so far all answers are links to source code or semi obscure libraries for all kinds of HID devices, which will require more research time than what I'd like to invest on this. I am starting a bounty to get an actual snippet of code that solves this simple problem (using an external library or not). EDIT POS BOUNTY: thanks to all for you help; but unfortunately the answer that has been automatically selected by the system is not working for me, can't figure out why; and the author has not yet replied to my comments. Any insight would be appreciated, but until a fix is found, anyone looking for resources on this topic should take this answer with a pinch of salt.

    Read the article

  • Url.Content() equivalent in php?

    - by stacker
    What is the Url.Content() of asp.net mvc equivalent in php? I have a file that use my style.css from both pathes: 'artciles/123/name' 'artciles/123' How can I use links to static content, witout using absolute urls?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >