Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 57/96 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • How can I use JSONP to download client-side javascript objects?

    - by Alex Mcp
    I'm trying to get client-side javascript objects saved as a file locally. I'm not sure if this is possible. The basic architecture is this: Ping an external API to get back a JSON object Work client-side with that object, and eventually have a "download me" link This link sends the data to my server, which processes it and sends it back with a mime type application/json, which (should) prompt the user to download the file locally. Right now here are my pieces: Server Side Code <?php $data = array('zero', 'one', 'two', 'testing the encoding'); $json = json_encode($data); //$json = json_encode($_GET['']); //eventually I'll encode their data, but I'm testing header("Content-type: application/json"); header('Content-Disposition: attachment; filename="backup.json"'); echo $_GET['callback'] . ' (' . $json . ');'; ?> Relevant Client Side Code $("#download").click(function(){ var json = JSON.stringify(collection); //serializes their object $.ajax({ type: "GET", url: "http://www.myURL.com/api.php?callback=?", //this is the above script dataType: "jsonp", contentType: 'jsonp', data: json, success: function(data){ console.log( "Data Received: " + data[3] ); } }); return false; }); Right now when I visit the api.php site with Firefox, it prompts a download of download.json and that results in this text file, as expected: (["zero","one","two","testing the encoding"]); And when I click #download to run the AJAX call, it logs in Firebug Data Received: testing the encoding which is almost what I'd expect. I'm receiving the JSON string and serializing it, which is great. I'm missing two things: The Actual Questions What do I need to do to get the same prompt-to-download behavior that I get when I visit the page in a browser (much simpler) How do I access, server-side, the json object being sent to the server to serialize it? I don't know what index it is in the GET array (silly, I know, but I've tried almost everything)

    Read the article

  • Why does a sub-class class of a class have to be static in order to initialize the sub-class in the

    - by Alex
    So, the question is more or less as I wrote. I understand that it's probably not clear at all so I'll give an example. I have class Tree and in it there is the class Node, and the empty constructor of Tree is written: public class RBTree { private RBNode head; public RBTree(RBNode head,RBTree leftT,RBTree rightT){ this.head=head; this.head.leftT.head.father = head; this.head.rightT.head.father = head; } public RBTree(RBNode head){ this(head,new RBTree(),new RBTree()); } public RBTree(){ this(new RBNode(),null,null); } public class RBNode{ private int value; private boolean isBlack; private RBNode father; private RBTree leftT; private RBTree rightT; } } Eclipse gives me the error: "No enclosing instance of type RBTree is available due to some intermediate constructor invocation" for the "new RBTree()" in the empty constructor. However, if I change the RBNode to be a static class, there is no problem. So why is it working when the class is static. BTW, I found an easy solution for the cunstructor: public RBTree(){ this.head = new RBNode(); } So, I have no idea what is the problem in the first piece of code.

    Read the article

  • Which programming language to use for serious project?

    - by alex
    Hi! Which programming language to use for serious web project (price catalogue)? After some time of studying web PHP frameworks i got that: Codeigniter: good, but when i read about authorization (that 20% users can login correctly without party solutions), i am disappointed. Zend Framework: more serious, but raises questions about speed and i found only few examples. PHP: long time to understand PHP frameworks functionality

    Read the article

  • IE7 not Caching CSS Image over SSL

    - by Alex
    Hello, I'm using the WebDevHelper toolbar for Internet Explorer to troubleshoot HTTP requests/roundtrips on my SSL site and noticed that IE re-downloads my CSS :hover images every time they are triggered. This causes a huge amount of roundtrips. How can I prevent this from happening? Edit: All static content is served with cache-control: public, so images, javascript etc. are cached in Firefox and Chrome. This problem is IE specific.

    Read the article

  • A textbox class only accept integers in Java

    - by alex
    I just want to do a textbox class onl accepts integers.. I have done something, but i think it's not enough. Can anyone help me, please? Thanks... import java.awt.TextField public class textbox extends TextField{ private int value; public textbox(){ super(); } public textbox(int value){ setDeger(value); } public int getValue() { return value; } public void setValue(int value) { this.value = value; } }

    Read the article

  • How to concat a string in Python

    - by alex
    query = "SELECT * FROM mytable WHERE time=%s", (mytime) Then, I want to add a limit %s to it. How can I do that without messing up the %s in mytime? Edit: I want to concat query2, which has "LIMIT %s, %s"

    Read the article

  • Android SDK: hello world does not run

    - by Alex
    I have installed Java x64, Eclipse Classic Judo x64 + ADT Pluggin. OS win 7 x64. I did installation everything according to the manual. Then created first application and launched it. Emulator was launched but hello world was not. I have not idea what doing wrong. Do anyone knows of such error and my problem as a whole? thx Console log: [2012-10-06 13:35:42 - test] ------------------------------ [2012-10-06 13:35:42 - test] Android Launch! [2012-10-06 13:35:42 - test] adb is running normally. [2012-10-06 13:35:42 - test] Performing com.example.test.MainActivity activity launch [2012-10-06 13:35:42 - test] Automatic Target Mode: launching new emulator with compatible AVD 'AVD_41' [2012-10-06 13:35:42 - test] Launching a new emulator with Virtual Device 'AVD_41' [2012-10-06 13:35:42 - Emulator] Failed to create Context 0x3005 [2012-10-06 13:35:42 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. [2012-10-06 13:35:42 - Emulator] WARNING: Data partition already in use. Changes will not persist! [2012-10-06 13:35:42 - Emulator] WARNING: SD Card image already in use: C:\Users\Zewisa\.android\avd\AVD_41.avd/sdcard.img [2012-10-06 13:35:42 - Emulator] WARNING: Cache partition already in use. Changes will not persist! [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] could not get wglGetExtensionsStringARB [2012-10-06 13:35:42 - Emulator] emulator: warning: opening audio input failed [2012-10-06 13:35:42 - Emulator]

    Read the article

  • Add LINQ Auto-Generated Value Marker [Column(IsDbGenerated=true)] in Buddy Class

    - by Alex
    Hello, is it possible to decorate a field of a LINQ generated class with [Column(IsDbGenerated=true)] using a buddy class (which is linked to the LINQ class via [MetadataType(typeof(BuddyMetadata))]) ? My goal is to be able to clear and repopulate the LINQ ORM designer without having to set the "Auto Generate Value" property manually every time to re-establish the fact that certain columns are autogenerated. Thanks!

    Read the article

  • High performance querying - Suggestions please

    - by Alex Takitani
    Supposing that I have millions of user profiles, with hundreds of fields (name, gender, preferred pet and so on...). You want to make searches on profiles. Ex.:All profiles that has age between x and y, loves butterflies, hates chocolate.... With database would you choose? Suppose that You have a Facebook like load. Speed is a must. Open Source preferred. I've read a lot about Cassandra, HBase, Mongo, Mysql... I just can't decide.....

    Read the article

  • PHP shorthand syntax

    - by alex
    I've just came across this on GitHub. ($config === NULL) and $config = Kohana::config('email'); Is that the equivalent of if ($config === NULL) { $config = Kohana::config('email'); } Is this commonplace? Would I expect other developers looking at my code if I used that first way to instantly know what it was doing?

    Read the article

  • Space in DIV ??

    - by alex
    Hello all, Is it possible to avoid the spaces X & Y (see image)? There is no padding in CSS! <html> <head> <title>Prova WIDGET</title> <link rel="stylesheet" href="jquery-ui-1.8.1.custom/css/ui-lightness/jquery-ui-1.8.1.custom.css" type="text/css"> <script src="jquery-ui-1.8.1.custom/development-bundle/jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(themify); function themify(){ $("#pulsante").addClass("ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"); //ui-button-text } </script> <style>#test{display:none}</style> <script type="text/javascript"> function rendiVisibile(){ if(document.getElementById("test").style.display = "none"){ $("#test").css({"width":"100px","float":"right","text-align":"center"}); $("#test").show("slide",{},1000); } } </script> </head> <body> <h2 class="ui-widget-header">Tentativo widget con DIV</h2> <form action=""> <input type="button" value="Submit" id="pulsante" onclick="rendiVisibile()";><br/></br> <div id="test" class="ui-widget ui-widget-content ui-corner-all"> <h3 class="ui-widget-header ui-corner-all">CIAO</h3> <p class="ui-widget-content ui-corner-all">Un saluto</p> </div> </form> </body> </html>

    Read the article

  • How to configure AutoMapper if not ASP.net Application?

    - by alex
    I'm using AutoMapper in a number of projects within my solution. These projects may be deployed independantly, across multiple servers. In the documentation for AutoMapper it says: If you're using the static Mapper method, configuration only needs to happen once per AppDomain. That means the best place to put the configuration code is in application startup, such as the Global.asax file for ASP.NET applications. Whilst some of the projects will be ASP.net - most of these are class libraries / windows services. Where should I be configuring my mappings in this case?

    Read the article

  • Problem with mysql query to replace a string

    - by alex
    I've used mysql's update replace function before, but even though I think I'm following the same syntax, I can't get this to work. Here's what I'm trying to do: UPDATE contained_widgets SET preference_values = REPLACE(preference_values, '<li><a_href="/enewsletter"><span class="not-tc">eNewsletter</span></a></li>', '<li><a_href="/enewsletter"><span class="not-tc">eNewsletter</span></a></li> <li> <a_href="/projects"><span class="not-tc">Projects</span></a></li>'); Query OK, 0 rows affected (0.00 sec) Rows matched: 77 Changed: 0 Warnings: 0 I don't see what I'm missing. Any help is appreciated. I edited "a " to "a_" because the site thinks I'm posting spam links otherwise.

    Read the article

  • Help with jQuery Validation plugin and a form that uses 'panels'

    - by alex
    I have a form that works in 'sections' that I will refer to as 'panels'. By default, the form is listed out on the page, one panel after the other. However, with JavaScript, it puts the panels into one panel viewer, and displays them one after the other (with prev/next buttons). Example Form Workflow Panel 1: User Details - Panel 2: User Location - Panel 3: User Info - Panel 4: Confirm Details I am using the jQuery Validation plugin. My problem is, I have set up all the rules for all the inputs in the first 3 panels, and I'd like to be able to only validate a subset of them per panel. Example, when pushing 'next panel' after completing name & email (in the 1st, user details panel), I'd like to do a validation only on that panel first, and then get a boolean response (if the 1st panel validated), and if true, then proceed to the next panel. I've played around with a bit of the config, but unfortunately could not get it to work as I wanted. This is my first project with this plugin so I'm quite new to it! Is there a way to add rules dynamically to the plugin? i.e. not on $('form').validate(options) ? What I'd like to do, is call the validate() on the form, with all the error messages, and then on the 'next panel' code, do a switch case to determine which rules to add, and then call a validate() myself.

    Read the article

  • Testing the program in different OS

    - by Alex Farber
    I want to test my program by installing it in different OS versions. My development computer is Ubuntu. What other Linux versions can I test by installing them inside VirtualBox and running my program there? Though it is not critical for me right now, I want to try something different and see what happens. Also, what is the chance that the program running in Linux will work in the Unix OS? The program is not open source, I can distribute only pre-built binaries.

    Read the article

  • Setting minOccurs="0" (required) on web service parameters of type int

    - by Alex Angas
    I have an ASP.NET 2.0 web method with the following signature: [WebMethod] public QueryResult[] GetListData( string url, string list, string query, int noOfItems, string titleField) I'm running the disco.exe tool to generate .wsdl and .disco files from this web service for use in SharePoint. The following WSDL for the parameters is being generated: <s:element minOccurs="0" maxOccurs="1" name="url" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="list" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="noOfItems" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="titleField" type="s:string" /> Why does the int parameter have minOccurs set to 1 instead of 0 and how do I change it? I've tried using [XmlElementAttribute(IsNullable=false)] in the parameter declaration without success.

    Read the article

  • High performance querying - Sugestions please

    - by Alex Takitani
    Supposing that I have millions of user profiles, with hundreds of fields (name, gender, preferred pet and so on...). With database would You choose? Suppose that You have a Facebook like load. Speed is a must. Open Source preferred. I've read a lot about Cassandra, HBase, Mongo, Mysql... I just can't decide.....

    Read the article

  • help me to choose between two software architecture

    - by alex
    // stupid title, but I could not think anything smarter I have a code (see below, sorry for long code but it's very-very simple): namespace Option1 { class AuxClass1 { string _field1; public string Field1 { get { return _field1; } set { _field1 = value; } } // another fields. maybe many fields maybe several properties public void Method1() { // some action } public void Method2() { // some action 2 } } class MainClass { AuxClass1 _auxClass; public AuxClass1 AuxClass { get { return _auxClass; } set { _auxClass = value; } } public MainClass() { _auxClass = new AuxClass1(); } } } namespace Option2 { class AuxClass1 { string _field1; public string Field1 { get { return _field1; } set { _field1 = value; } } // another fields. maybe many fields maybe several properties public void Method1() { // some action } public void Method2() { // some action 2 } } class MainClass { AuxClass1 _auxClass; public string Field1 { get { return _auxClass.Field1; } set { _auxClass.Field1 = value; } } public void Method1() { _auxClass.Method1(); } public void Method2() { _auxClass.Method2(); } public MainClass() { _auxClass = new AuxClass1(); } } } class Program { static void Main(string[] args) { // Option1 Option1.MainClass mainClass1 = new Option1.MainClass(); mainClass1.AuxClass.Field1 = "string1"; mainClass1.AuxClass.Method1(); mainClass1.AuxClass.Method2(); // Option2 Option2.MainClass mainClass2 = new Option2.MainClass(); mainClass2.Field1 = "string2"; mainClass2.Method1(); mainClass2.Method2(); Console.ReadKey(); } } What option (option1 or option2) do you prefer ? In which cases should I use option1 or option2 ? Is there any special name for option1 or option2 (composition, aggregation) ?

    Read the article

  • Is jWYSIWYG editor too buggy for production use?

    - by alex
    After reading the comments on this site: http://www.webresourcesdepot.com/jwysiwyg-jquery-inline-content-editor-plugin/ There is a bit of consensus that jWYSIWYG editor is too buggy (especially in the last few recent comments). Has anyone had experience with it in a large production site? I haven't run a huge sample of markup through it yet, but so far it has seemed to do the job fine.

    Read the article

  • Dynamic resize with MPlayer and PyGTK

    - by alex
    Hi everyone; I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui. I assume I use GtkSocket and the slave mode of mplayer with the -wid option. But I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my stream, the stream appear centred inside the widget which embed MPlayer. (a gtk.Frame but I've also try with a gtk.DrawingArea) I would like to know how I can get my stream resize dynamically depending on the window's size. I don't want to use Glade or any GUI builder. Thanks in advance for any help, and please excuse my poor english.

    Read the article

  • Unicode and PHP - am I doing something wrong?

    - by alex
    I'm using Kohana 3, which has full support for Unicode. I have this as the first child of my <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> The Unicode character I am inserting into is é as in Café. However, I am getting the triangle with a ? (as in could not decode character). As far as I can tell in my own code, I am not doing any string manipulation on the text. In fact, I have placed the accent straight into a view's PHP file and it is still not working. I copied the character from this page: http://www.fileformat.info/info/unicode/char/00e9/index.htm I've only just started examining PHP's Unicode limitations, so I could be doing something horribly wrong. So, how do I display this character? Do I need to resort to the HTML entity?

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >