Search Results

Search found 46 results on 2 pages for 'remus rigo'.

Page 2/2 | < Previous Page | 1 2 

  • success, error events aren't working for ajax

    - by Rigo Vides
    Hi everyone, I have the following code: $(document).ready(function(){ $.ajax({ url: "svc/GetTweetsByUser.php", type: "POST", success: function(data) { alert('success'); }, failure: function(){ alert('fail'); }, data: ({twitter_user : 'AdoboHobo'}), dataType: "xml" } );//endof ajax }); I'm kind of starting with web and ajax stuff... this worked perfectly by yesterday. I don't know what is happening now that neither success nor failure events are triggering. I'm shure that the request and response are perfectly working, I checked that with firebug. Does anyone have any ideas for this? Thanks in advance.

    Read the article

  • REST API error return good practices

    - by Remus Rusanu
    I'm looking for guidance on good practices when it comes to return errors from a REST API. I'm working on a new API so I can take it any direction right now. My content type is XML at the moment, but I plan to support JSON in future. I am now adding some error cases, like for instance a client attempts to add a new resource but has exceeded his storage quota. I am already handling certain error cases with HTTP status codes (401 for authentication, 403 for authorization and 404 for plain bad request URIs). I looked over the blessed HTTP error codes but none of the 400-417 range seems right to report application specific errors. So at first I was tempted to return my application error with 200 OK and a specific XML payload (ie. Pay us more and you'll get the storage you need!) but I stopped to think about it and it seems to soapy (/shrug in horror). Besides it feels like I'm splitting the error responses into distinct cases, as some are http status code driven and other are content driven. So what is the SO crowd recommendation? Good practices (please explain why!) and also, from a client pov, what kind of error handling in the REST API makes life easier for the client code?

    Read the article

  • Who should call viewDidLoad on progammatically loaded views?

    - by Remus Rusanu
    When I need to load a view programatically I do the following: MyController* myController = [[MyController alloc] init]; [[NSBundle mainBundle] loadNibNamed:@"myNib" owner:myController options:nil]; // use my controller here, eg. push it in the nav controller This works fine, but my controller's viewDidLoad is never called. So I resorted to manually calling it after the loadNibNamed call, but it doesn't seem correct. I was expecting the framework to call the viewDidLoad on my behalf. Is this the right way or I'm missing something?

    Read the article

  • What is the most stupid coded solution you have read/improved/witnessed?

    - by Rigo Vides
    And for stupid I mean Illogical, non-effective, complex(the bad way), ugly code style. I will start: We had a requirement there when we needed to hide certain objects given the press of a button. So this framework we were using at the time provided a way to tag objects and retrieve all the objects with a certain tag in a complete iterable collection. So I presented the most logically solution given these conditions to my partner: Me: you know, tag all the objects we needed to hide with the same tag, then call the function to get them all, iterate trough them and make them hidden. Partner: I don't know, that is hardcoding for me... Me: So what do you suggest? 20 mins later... Partner: I don't know... let's put a tag to all the objects to be hidden like this, 1, 2, 3, 4, 5, 6, 7 (and so for each object to be hidden), Then we make a for from 1 to n (where n was the number of objects to hide) and we hide them all there!

    Read the article

  • [flash] swf in swf

    - by Remus Rigo
    hi all My wife is working in flash and she wants to load a swf inside another swf. I found a few links, tried to do as explained, but when I load the page the embedded swf is bigger than it was supposed to be and is not aligned well... PS: I managed to resize the embeded swf, as you can see This is the test page and here are the links that I found 1: Embed Swf In Swf 2: what is the script to play swf within an swf

    Read the article

  • How to Expression.Invoke an arbitrary LINQ 2 SQL Query

    - by Remus Rusanu
    Say I take an arbitrary LINQ2SQL query's Expression, is it possible to invoke it somehow? MyContext ctx1 = new MyContext("..."); var q = from t in ctx1.table1 where t.id = 1 select t; Expression qe = q.Expression; var res = Expression.Invoke(qe); This throws ArgumentException "Expression of type System.Linq.IQueryable`1[...]' cannot be invoked". My ultimate goal is to evaluate the same query on several different data contexts.

    Read the article

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • Which license do you choose for google code projects, and why?

    - by Remus Rusanu
    Starting a new project on Google code offers a choice of several licenses: Apache License 2.0 Artistic License/GPL Eclipse Public License GPL v2/v3 Lesser GPL MIT Mozilla License 1.1 New BSD License Which license do you choose, ans why? I'm also interested in opinions which license is the least restrictive license for commercial users, ie. allow commercial use of the code w/o restrictions.

    Read the article

  • How to autodoc .Net Google code projects?

    - by Remus Rusanu
    I know how to generate html documentation using Sandcastle and similar tools. But if I want to host the project on Google code, how can I easily publish the documentation straight into the Google project Wiki pages? I can see the SVN repository has a wiki folder which I assume maps to the project Wiki pages and I guess I can make a build step to build the documentation from the autodoc tags. But is there some tool that generates wiki compatible format from the code documentation tags?

    Read the article

  • dragging toolbars

    - by Remus Rigo
    I created in my app 2 toolbars. Because I wanted to be able to drag them, I put both TToolBar components inside a TControlBar. I this case I can move them, but I want to be able to drag them like in MS Office (drag a toolbar from top and put it left, right or at bottom of the window and save it's position).... Can anyone help me out?

    Read the article

  • My horizontal drop down with CSS, sub navigation menu items are being displayed on top of each other

    - by Rigo Collazo
    my sub navigation menu items are being displayed on top of each other here is the code: /* NAVIGATION */ .nav-bar {width: 100%; height: 80px; background-image:url(../images/bg-menu80.jpg);} .nav-hold {overflow: hidden;} .nav-list {float: right;} .nav-list li {float: left; width: auto; position: relative;} .nav-list li a {text-decoration: none; display:block; padding: 30px 7px 20px 7px; color: #f9f9f9; font-size: .9em; font-weight: bold;} .nav-list li ul {display: none;} .nav-list li a:hover {text-decoration: none; display: block; padding: 30px 7px 20px 7px; color: #000; font-size: .9em; font-weight: bold; background-color: #e7e4e4;} .nav-list li a:hover li{display: block; position: absolute; margin: 0; padding: 0;} .nav-list li a:hover li{float: left;} .nav-list li:hover li a{ background-color: #333; border-bottom: 1px solid #fff; color: #FFF;} <ul class="nav-list" id="navigation"><!--Menu list--> <li><a href="index.html">Home</a></li> <li><a href="about.html">About Us</a></li> <li> <ul><a href="members.html">Members</a> <li><a href="board.html">Board of Directors</a></li> <li><a href="committee.html">Committee</a></li> </ul></li> <li><a href="join.html">Join Us</a></li> <li><a href="events.html">Events</a></li> <li><a href="rules.html">Rules &amp; Guidelines</a></li> <li><a href="archive.html">Archive</a></li> <li><a href="contact.html">Contact Us</a></li> <li><a href="#">Login</a></li> </ul><!--ENDS Menu list-->

    Read the article

  • set movie clip "on-top"

    - by Remus Rigo
    I want to do a effect like the switching windows from Win 7 [Win]+[Tab] keys pressed. I created two "windows" (movie clips) and when I click on the 1st it displays on top of the other, but the problem is when I click on the 2nd I can see the 1st one displayed in it. Is there any way that i put a movie clip on top of the other. Thanks

    Read the article

  • [Delphi] open text files in one application

    - by Remus Rigo
    hi all I want to write an text editor and to assign the txt files to it. My problem is that I want to have only one instance running and when a new file is opened to send the filename to the first app that is already running... (I want to do this using mutex). Here is a small test DPR looks like this uses Windows, Messages, SysUtils, Forms, wndMain in 'wndMain.pas' {frmMain}; {$R *.res} var PrevWindow : HWND; S : string; CData : TCopyDataStruct; begin PrevWindow := 0; if OpenMutex(MUTEX_ALL_ACCESS, False, 'MyMutex') <> 0 then begin repeat PrevWindow:=FindWindow('TfrmMain', nil); until PrevWindow<>Application.Handle; if IsWindow(PrevWindow) then begin SendMessage(PrevWindow, WM_SYSCOMMAND, SC_RESTORE, 0); BringWindowToTop(PrevWindow); SetForegroundWindow(PrevWindow); if FileExists(ParamStr(1)) then begin S:=ParamStr(1); CData.dwData:=0; CData.lpData:=PChar(S); CData.cbData:=1+Length(S); SendMessage(PrevWindow, WM_COPYDATA, 0, DWORD(@CData) ); end; end; end else CreateMutex(nil, False, 'MyMutex'); Application.Initialize; Application.CreateForm(TfrmMain, frmMain); Application.Run; end. PAS: type TfrmMain = class(TForm) memo: TMemo; private procedure WMCopyData ( var msg : TWMCopyData ) ; message WM_COPYDATA; public procedure OpenFile(f : String); end; var frmMain: TfrmMain; implementation {$R *.dfm} procedure TfrmMain.WMCopyData ( var msg : TWMCopyData ) ; var f : String; begin f:=PChar(msg.CopyDataStruct.lpData); //ShowMessage(f); OpenFile(f); end; procedure TfrmMain.OpenFile(f : String); begin memo.Clear; memo.Lines.LoadFromFile(f); Caption:=f; end; this code should be ok, but if i want to open a text file (from the second app), the first app receives a message like this: thanks

    Read the article

  • detect click on submit button in PHP

    - by Remus Rigo
    hi all I have a php file that contains a form (witch contains 2 input boxes and a submit button) for updating a contact. I managed to fill the fields with the contact's data, but I can't detect if the submit button is clicked form looks like this echo "<form action=Contact.php><table>". "<tr><td>First Name</td><td><input type=text size=75% name=FirstName value='".$row['FirstName']."'></td></tr>". "<tr><td>Last Name</td><td><input type=text size=75% name=LastName value='".$row['LastName']."'></td></tr>". "<tr><td colspan=2><input type=submit name=UpdateContact value=Update></td></tr>". "</table></form>"; this code should output a "clicked" message if the button is clicked if (isset($_POST['UpdateContact'])) { echo "<p>clicked"; } else { echo "<p>not clicked"; } can anyone help me out or tell me what i've done wrong (I want from the same php file to fill the contact's data in a from and to update the database)

    Read the article

  • convert &uuml; to u

    - by Remus Rigo
    hi all I'm using a database that contains contacts (fields like name, address, ...). If i'm using in my database a city that contains special chars (like ü) or html codes (like &uuml;), then how can i convert them to u, so when i search for a city that contains that a special char should be shown in the result...

    Read the article

  • mysql result for pagination

    - by Reteras Remus
    The query is: SELECT * FROM `news` ORDER BY `id` LIMIT ($curr_page * 5), ( ($curr_page * 5) + 5 ) Where $curr_page is a php variable which is getting a value from $_GET['page'] I want to make a pagination (5 news on each page), but I don't know why the mysql is returning me extra values. On the first page the result ok: $curr_page = 0 The query would be: SELECT * FROM `news` ORDER BY `id` LIMIT 0, 5 But on the second page, the result from the query is adding extra news, 10 instead of 5. The query on the second page: SELECT * FROM `news` ORDER BY `id` LIMIT 5, 10 Whats wrong? Why the result has 10 values instead of 5? Thank you!

    Read the article

  • Can I provision half a core as a virtual CPU?

    - by ramdaz
    I am virtualization newbie. Please advise on these questions. Please note using a commercial VM software like Citrix or VMware is not a choice for me. I have at my disposal a couple of 2x 4 core servers with 32 GB RAM. I need to create 16 VMs on each server to test some web applications. Can I provision half a core as a virtual CPU for each VM? To my best knowledge I can't do so on Xen. Is it possible on KVM or some other free open source VM solution? If it's not possible to assign half a core, how do I ensure that uniform processing power is available for all VMs? Since the job is to create separate instances for hosting 16 web apps in a physical server, do you recommend setting up a private cloud using Ubuntu Enterprise Cloud as a better option? Is there HA solution under KVM, like Remus for Xen?

    Read the article

  • SSRS - Unable to determine if the owner of job has server access [SQLSTATE 42000] (Error 15404))

    - by John DaCosta
    SQL Server Reporting Services, in SSRS it seems like Schedules never fire, however a look at the SQL Agent reveals a permission issue related to not being able to resolve a user account. Seems SQL Agent does not rely on caching or whatever voodoo Windows magically works. link text Fix is listed here... edit -- Above is the fix I used to workaround this issue, has any one found any other work arounds or resolutions to this issue? It seems that by default the SSRS Generated Schedules are run as this phantom user account. How do I change this default? Is SSRS creating the jobs as the user the service runs as? Thanks Remus

    Read the article

  • Returning ifstream in a function

    - by wrongusername
    Here's probably a very noobish question for you: How (if at all possible) can I return an ifstream from a function? Basically, I need to obtain the filename of a database from the user, and if the database with that filename does not exist, then I need to create that file for the user. I know how to do that, but only by asking the user to restart the program after creating the file. I wanted to avoid that inconvenience for the user if possible, but the function below does not compile in gcc: ifstream getFile() { string fileName; cout << "Please enter in the name of the file you'd like to open: "; cin >> fileName; ifstream first(fileName.c_str()); if(first.fail()) { cout << "File " << fileName << " not found.\n"; first.close(); ofstream second(fileName.c_str()); cout << "File created.\n"; second.close(); ifstream third(fileName.c_str()); return third; //compiler error here } else return first; } EDIT: sorry, forgot to tell you where and what the compiler error was: main.cpp:45: note: synthesized method ‘std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(const std::basic_ifstream<char, std::char_traits<char> >&)’ first required here EDIT: I changed the function to return a pointer instead as Remus suggested, and changed the line in main() to "ifstream database = *getFile()"; now I get this error again, but this time in the line in main(): main.cpp:27: note: synthesized method ‘std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(const std::basic_ifstream<char, std::char_traits<char> >&)’ first required here

    Read the article

< Previous Page | 1 2