Daily Archives

Articles indexed Saturday December 25 2010

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

  • Django queries Especial Caracters

    - by Jorge Machado
    Hi, I Working on location from google maps and using django to. My question is: I have a String in request.GET['descricao'] lets say it contains "Via rapida". In my database i have store = "Via Rápida" i'm doing : local = Local.objects.filter(name__icontains=request.GET['descricao']) with that i can get everthing fine like "Via Rapida" but the result that have "Via rápida" never get match in the query (ASCI caracter may be ?) what must i do given a string "Via rapida" match "via rápida" and "via rapida" ? Regular Expressions ? how ? Thanks

    Read the article

  • How do you use build labels in publishers in cruisecontrol?

    - by Omnifarious
    I have this section in my CruiseControl config.xml file: <publishers> <onsuccess> <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/fred"/> <execute command="hg -R hg-succeeded/${project.name} pull"/> <execute command="hg -R hg-succeeded/${project.name} tag -l build-${label} -r tip"/> </onsuccess> </publishers> I'm getting tags that look like build-${label}. The ${label} part isn't being replaced by the build label like I expect. I'm expecting something like build.1 to show up in place of ${label}. How do I make this happen? I do have the default labelincrementer configured with a <labelincrementer /> tag in my project. Also, the CruiseControl documentation is absolutely awful. Is there better documentation anywhere?

    Read the article

  • Address component type in google maps geocoding

    - by user552828
    this is a part of my geocoding code. I want it to show only country of the selected place, but it shows all address components, My problem is I cant specify the address components object. There is a way of doing it that is written on documentation but I didnt understand, can you do it for me. if (geocoder) { geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var str = ""; $.each(results, function(){ str += "address components: <ul>" $.each(this.address_components, function(){ str +="<li>"+this.types.join(", ")+": "+this.long_name+"</li>"; }); str +="</ul>"; }); $("#geocode_info").html(str);

    Read the article

  • what's the reason that the left ,right column always equal the center height.

    - by enjoylife
    this is the code. the css: #content{overflow:hidden;} .left{width:200px; margin-bottom:-200px;padding-bottom:200px; background:#cad5eb; float:left;} .right{width:400px; margin-bottom:-200px; padding-bottom:200px; background:#f0f3f9; float:right; border:1px solid red;} .center{margin:0 410px 0 210px; background:#ffe6b8; height:100px;} HTML: <div id="content"> <div class="left">hello</div> <div class="right">right </div> <div class="center">center</div> </div> what's the reason that the left ,right column always equal the center's height.

    Read the article

  • What causes my borderless C++ app to crash when overriding WndProc?

    - by Ste
    I use a form with border NONE. I need to override WndProc for resize and move form. However, using this code, my app crashes! static const int WM_NCHITTEST = 0x0084; static const int HTCLIENT = 1; static const int HTCAPTION = 2; protected: virtual void Form1::WndProc(System::Windows::Forms::Message %m) override { switch (m.Msg) { case WM_NCHITTEST: if (m.Result == IntPtr(HTCLIENT)) { m.Result = IntPtr(HTCAPTION); } break; } Form1::WndProc(m); } virtual System::Windows::Forms::CreateParams^ get() override { System::Windows::Forms::CreateParams^ cp = __super::CreateParams; cp->Style |= 0x40000; return cp; } How can I fix my code not to crash but still allow my form to be moved and resized?

    Read the article

  • Criticise/Recommendations for my code

    - by aLk
    Before i go any further it would be nice to know if there is any major design flaws in my program so far. Is there anything worth changing before i continue? Model package model; import java.sql.*; import java.util.*; public class MovieDatabase { @SuppressWarnings({ "rawtypes", "unchecked" }) public List queryMovies() throws SQLException { Connection connection = null; java.sql.Statement statement = null; ResultSet rs = null; List results = new ArrayList(); try { DriverManager.registerDriver(new com.mysql.jdbc.Driver()); connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "password"); statement = connection.createStatement(); String query = "SELECT * FROM movie"; rs = statement.executeQuery(query); while(rs.next()) { MovieBean bean = new MovieBean(); bean.setMovieId(rs.getInt(1)); bean.setTitle(rs.getString(2)); bean.setYear(rs.getInt(3)); bean.setRating(rs.getInt(4)); results.add(bean); } } catch(SQLException e) { } return results; } } Servlet public class Service extends HttpServlet { @SuppressWarnings("rawtypes") protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("Movies!"); MovieDatabase movies = new MovieDatabase(); try { List results = movies.queryMovies(); Iterator it = results.iterator(); while(it.hasNext()) { MovieBean movie = new MovieBean(); movie = (MovieBean)it.next(); out.println(movie.getYear()); } } catch(SQLException e) { } } } Bean package model; @SuppressWarnings("serial") public class MovieBean implements java.io.Serializable { protected int movieid; protected int rating; protected int year; protected String title; public MovieBean() { } public void setMovieId(int movieidVal) { movieid = movieidVal; } public void setRating(int ratingVal) { rating = ratingVal; } public void setYear(int yearVal) { year = yearVal; } public void setTitle(String titleVal) { title = titleVal; } public int getMovieId() { return movieid; } public int getRating() { return rating; } public int getYear() { return year; } public String getTitle() { return title; } }

    Read the article

  • Stubhub like map in HTML5?

    - by Switz
    I have an image of a floor plan. Best way to think if it is a hotel floor plan. (Similar to how stubhub does their ticket maps) I want the user to select rooms. Instead of slicing each room in Photoshop, is there a way to split up the image in HTML5 canvas or Javascript. Would like to avoid flash. Thanks for the responses! example: http://adamsaewitz.com/housing/housing.html (top left rooms, hover)

    Read the article

  • jQuery - Show field based on value of a type-hidden on refresh.

    - by Sebhael
    Hello, I'm trying to create something in jQuery and having a bit of problems with it. I'm not too adept on the framework, so I'm sure this is all wrong. Anyways, the ultimate goal is a full form that contains 3 radio buttons - depending on the value of the button, a LI is shown. I have all of that done, but my problem is coming with validation. If something fails then the page is reloaded and the div that was selected doesn't show without clicking another radio first, then back to the original. This process is basically the same as someone came up with here. Here's what I got so far. HTML <li> <label> License (radio) </label> <label for="commercial" class="checkBox"> Commercial </label> <input type="radio" name="license" value="commercial" id="commercial" class="checkBox" <?php echo set_radio('license', 'commercial'); ?> /> <label for="abandonware" class="checkBox"> Abandonware </label> <input type="radio" name="license" value="abandonware" id="abandonware" class="checkBox" <?php echo set_radio('license', 'abandonware'); ?> /> <label for="freeware" class="checkBox"> Freeware </label> <input type="radio" name="license" value="freeware" id="freeware" class="checkBox" <?php echo set_radio('license', 'freeware'); ?> /> </li> This is followed by three LI's that contain id="commercial, abandonware, and freeware" and class="licenseli" My jQuery is, as said, something from here. $('li.licenseli').hide(); $('input[name=license]:radio').change(function(){ var Type = $(this).val(); // Get value of radio $('li.licenseli').slideUp(); // Hide non-selected $('li#'+Type).slideDown(); // Show Selected }); So what I need help with is I have a hidden input that retrieves the value of the radio box from validation - I want to take this value (or the radio's if possible?) and have the original selected option's LI already visible.

    Read the article

  • jquery tablesorter problem in FF only - header row disappears after show-hide of rows

    - by dac
    When the page loads, all the records show. Sorting works great until show-hide is used to filter the rows so only some show. Then the header row--with the arrows for sorting--DISAPPEARS. The problem is only in Firefox. It works great in IE7 and IE8. I'm using jQuery 1.4.2 from google. Code for show-hide $(document).ready(function() { // show all the rows $("#org_status tr").show(); //find selected filter $("#filter_status a").click(function(evt) { evt.preventDefault(); $("#org_status tr").hide(); var id = $(this).attr('id'); $("." + id).show(); }); }); Here is the HTML: <!-- show-hide "buttons" --> <p id='filter_status'>Filter by status: <a href='#' id='All'>All</a> <a href='#' id='Active'>Active</a> <a href='#' id='Inactive'>Inactive</a> <a href='#' id='Pending'>Pending</a> </p> <!-- table to sort -> <table id='org_status' class='info_table tablesorter'> <thead> <tr> <th class='org-name-col'>Name</th> <th class='org-status-col'>Status</th> </tr> </thead> <tbody> <tr class='All Active'> <td><a href='admin/org_edit.php?org=29'>Foo Net</a></td> <td>Active</td>"; </tr> <tr class='All Inactive'> <td><a href='admin/org_edit.php?org=22'>Bar</a></td> <td>Active</td>"; </tr> <tr class='All Pending'> <td><a href='admin/org_edit.php?org=11'> Bar Foo Very Long Org Name Goes Here</a></td> <td>Active</td>"; </tr> </tbody> </table>

    Read the article

  • CSplitterWnd flip between horizonal and vertical splitter?

    - by buttercup
    Hi, Suppose I have a splitter with 2 rows. -------- |        | -------- |        | -------- How do I make it to this --------- |    |    | |    |    | |    |    | --------- switch from horizontal split to vertical split without having to re-create the whole splitter? Code is: if (!m_wndSplitter.CreateStatic(this, 1, 2, WS_CHILD|WS_VISIBLE)) { TRACE0("Failed to create splitter window\n"); return FALSE; } if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CWnd), CSize(200, 100), NULL)) { TRACE0("Failed to create CView1\n"); return FALSE; } if (!m_wndSplitter.CreateView(0, 2, RUNTIME_CLASS(CWnd), CSize(500, 100), NULL)) { TRACE0("Failed to create CView2\n"); return FALSE; }

    Read the article

  • Breaking from for loop in MATLAB GUI

    - by Nick
    I have a for loop in the opening function of a GUI in MATLAB and I'm trying to use a callback button to break the loop. I'm new to MATLAB. Here's the code I have: %In the opening function of the GUI handles.stop_now = 0; for i=1:inf if handles.stop_now==1 break; end end % Executes on button press function pushbutton_Callback(hObject, eventdata, handles) % hObject handle to end_segmenting_button (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) handles.stop_now=1; guidata(hObject, handles); For some reason, despite defining the variables with handles, the loop doesn't break upon pressing the button. Anyone know what's going on? Thanks.

    Read the article

  • Nagios escalation debugging

    - by Oesor
    I'm having some issues with escalations happening properly and I'm not sure if it's because of my config or because the nagios binary is nonstandard and something may be broken. I've got little experience with nagios, and just want to make sure this is being set appropriately. Should the following config file definition allow the escalations to take over and increment the notification interval as expected? Is there somewhere else in the config files I should be looking at to figure out what's going on? I've enabled debug 32 in the config and it's simply spitting out 'Host notification will NOT be escalated.' for each notification. The configuration does pass the pre flight check with no issues, and reports that it's parsing the three host escalations in the config. # test host definition define host { host_name test alias test address 10.0.0.10 hostgroups test check_interval 0 retry_interval 1 max_check_attempts 2 flap_detection_enabled 0 icon_image windows.png icon_image_alt LOGO - Windows vrml_image windows.png statusmap_image windows.png action_url /info/host/275 check_period 24x7 contact_groups hostgroup15_servicegroup1,hostgroup15_servicegroup10,hostgroup15_servicegroup13,hostgroup15_servicegroup14,hostgroup15_servicegroup2,hostgroup15_servicegroup3,hostgroup15_servicegroup4,hostgroup15_servicegroup42,hostgroup15_servicegroup45,hostgroup15_servicegroup46,hostgroup15_servicegroup47,hostgroup15_servicegroup5,hostgroup15_servicegroup8,hostgroup15_servicegroup9,ov_monitored_by_master check_command check_host_15!-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100% parents nagios notifications_enabled 1 notification_interval 3 notification_period 24x7 notification_options u,d,r use host-global } define hostescalation{ host_name test first_notification 3 last_notification 4 notification_interval 10 contact_groups hostgroup15_servicegroup1,hostgroup15_servicegroup10,hostgroup15_servicegroup13,hostgroup15_servicegroup14,hostgroup15_servicegroup2,hostgroup15_servicegroup3,hostgroup15_servicegroup4,hostgroup15_servicegroup42,hostgroup15_servicegroup45,hostgroup15_servicegroup46,hostgroup15_servicegroup47,hostgroup15_servicegroup5,hostgroup15_servicegroup8,hostgroup15_servicegroup9,ov_monitored_by_master } define hostescalation{ host_name test first_notification 4 last_notification 5 notification_interval 30 contact_groups hostgroup15_servicegroup1,hostgroup15_servicegroup10,hostgroup15_servicegroup13,hostgroup15_servicegroup14,hostgroup15_servicegroup2,hostgroup15_servicegroup3,hostgroup15_servicegroup4,hostgroup15_servicegroup42,hostgroup15_servicegroup45,hostgroup15_servicegroup46,hostgroup15_servicegroup47,hostgroup15_servicegroup5,hostgroup15_servicegroup8,hostgroup15_servicegroup9,ov_monitored_by_master } define hostescalation{ host_name test first_notification 5 last_notification 0 notification_interval 240 contact_groups hostgroup15_servicegroup1,hostgroup15_servicegroup10,hostgroup15_servicegroup13,hostgroup15_servicegroup14,hostgroup15_servicegroup2,hostgroup15_servicegroup3,hostgroup15_servicegroup4,hostgroup15_servicegroup42,hostgroup15_servicegroup45,hostgroup15_servicegroup46,hostgroup15_servicegroup47,hostgroup15_servicegroup5,hostgroup15_servicegroup8,hostgroup15_servicegroup9,ov_monitored_by_master }

    Read the article

  • dell server display on laptop screen

    - by hari
    Please redirect if this is not (and probably thats true) the correct forum/site. I have a dell server and I am trying to configure it for the first time. It is running windows server 2003. I do not have a monitor screen. Can I use laptop screen to display dell server and set it up? I mean to say is, if I can display dell server on laptop screen, it would be great. I am trying that with a dell laptop but not getting the display. Any help/pointer would be appreciated. Thanks in advance.

    Read the article

  • Simple secured SFTP tunnel?

    - by babonk
    I'd like to setup an sftp tunnel so that I can connect to an IP-secured SFTP server through a gateway computer from anywhere, and download the files to anywhere. I was thinking of using a combination with netcat, having it listen to either WinSCP or PuTTY sFTP (doesn't matter which). Not sure how I would download the files to the connecting computer though. I would like the tunnel to be secured, preferably, with a username/password. I'm open to using alternative software but I'm looking for unintrusive, simple command line stuff because I don't want to install a lot on this computer. Thanks

    Read the article

  • An XEvent a Day (24 of 31) – What is the package0.callstack Action?

    - by Jonathan Kehayias
    One of the actions inside of Extended Events is the package0.callstack and the only description provided by sys.dm_xe_objects for the object is 16-frame call stack. If you look back at The system_health Session blog post, you’ll notice that the package0.callstack Action has been added to a number of the Events that the PSS team thought were of significance to include in the Event Session. We can trigger an event that will by logged by our system_health Event Session by raising an error of severity...(read more)

    Read the article

  • How to : required validator based on user role ASP.Net MVC 3

    - by user70909
    Hi, i have a form where i have the field "Real Cost" i want to customize its appearance and wither it should be validated based on user role. to be more clear is say the client want to show his field in the form or details page and also make it editable for users in Roles "Senior Sales, Manager" but not other roles, so can anyone please guide me of the best way ? should i write custom required validation based on user in role, and if so can you please provide the right implementation of it? some may tell me create custom model for this, but i think it would be hassle plus the Roles will be dynamic so it is not predefined set of roles. i hope i was clear enough

    Read the article

  • Terminology for mobile computing with a tablet?

    - by Idrise_Coulombe
    This is more of a terminology question... I'm developing an occasionally connected application that will run on a tablet for clinicians or field service workers but I'm struggling with what this type of computing is referred to. Mobile computing as connotations of a phone app. Whereas our clients may be occasionally at their desk. Microsoft uses Smart Client a lot, but I'm not sure if that best describes this scenario or is the common term for this kind of computing.

    Read the article

  • PHP Doxygen Collaboration Diagrams

    - by Shabbyrobe
    I've started playing around with doxygen to generate documentation from my PHP code. I notice there are two diagrams in the generated output - inheritance and collaboration. I know about the inheritance one, but the collaboration one has piqued my interest since reading the manual: If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen will generate a graph for each documented class showing the direct and indirect implementation dependencies (inheritance, containment, and class references variables) of the class with other documented classes. The impression I get from that description is that composition relationships should be represented by the collaboration diagram as well, but it always seems to just be identical to the inheritance one. Is there something I can do to hint to Doxygen the things I would like to appear in this diagram? Does it just not work with PHP?

    Read the article

  • ASP.net MVC How to change the Textbox Class upon validation failure?

    - by Harry
    I notice in the default MVC template project that the Account registration fields are highlighted via a class change. I can't seem to get the same behavour out of my own code (in the same project - same CSS etc) What might be stopping this from occuring? Update I believe this relates to one of my other questions Because I was having trouble with NullReferenceExceptions I have changed the Html.ValidationMessage fields to have different names than the target fields. So really, I need to resolve this question

    Read the article

  • How to load a jar file at runtime

    - by Amir Arad
    Hi, I was asked to build a java system that will have the ability to load new code (expantions) while running. How do I re-load a jar file while my code is running? or how do I load a new jar? Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if it does not complicate things too much). What are the things I should look out for? (think of it as two different questions - one regarding reloading classes at runtime, the other regarding adding new classes).

    Read the article

  • Codeigniter: user defined helper function does not load.

    - by cbrandolino
    Hi everybody. I made a custom helper extending the system string_helper.php. I placed it in my /application/helpers folder, called MY_string_helper.php as required, unit-tested its functions. Now, when I try to call one of its functions from a model, it does not work. The functions in the default string helper work, instead. It looks like my extension is not loaded for some reasons. Thanks a lot, and happy holidays.

    Read the article

  • How would I send a POST Request via Ajax?

    - by Gotactics
    I have a php page, Post.php it recieves the POST's Action, and that has two functions. Insert, and Update.Now how would I go about posting INSERT with this Ajax code. The code posts update fine but is doesnt post insert at all. $(document).ready(function(){ //global vars var inputUser = $("#nick"); var inputMessage = $("#message"); var loading = $("#loading"); var messageList = $(".content ul"); //functions function updateShoutbox(){ //just for the fade effect messageList.hide(); loading.fadeIn(); //send the post to shoutbox.php $.ajax({ type: "POST", url: "Shoutbox.php", data: "action=update", complete: function(data){ loading.fadeOut(); messageList.html(data.responseText); messageList.fadeIn(2000); } }); } //check if all fields are filled function checkForm(){ if(inputUser.attr("value") && inputMessage.attr("value")) return true; else return false; } //Load for the first time the shoutbox data updateShoutbox(); //on submit event $("#form").submit(function(){ if(checkForm()){ var nick = inputUser.attr("value"); var message = inputMessage.attr("value"); //we deactivate submit button while sending $("#send").attr({ disabled:true, value:"Sending..." }); $("#send").blur(); //send the post to shoutbox.php $.ajax({ type: "GET", url: "Shoutbox.php", data: "action=insert&nick=" + nick + "&message=" + message, complete: function(data){ messageList.html(data.responseText); updateShoutbox(); //reactivate the send button $("#send").attr({ disabled:false, value:"Shout it!" }); } }); } else alert("Please fill all fields!"); //we prevent the refresh of the page after submitting the form return false; }); });emphasized text

    Read the article

  • Is it possible to use CSS to align these divs/spans in a table-like manner? (While still retaining continuity)

    - by Justin L.
    I have <div class='line'> <div class='chord_line'> <span class='chord_block'></span> <span class='chord_block'>E</span> <span class='chord_block'>B</span> <span class='chord_block'>C#m</span> <span class='chord_block'>A</span> </div> <div class='lyric_line'> <span class='lyric_block'></span> <span class='lyric_block'>Just a</span> <span class='lyric_block'>small-town girl</span> <span class='lyric_block'>living in a</span> <span class='lyric_block'>lonely world</span> </div> </div> (Excuse me for not being too familiar with proper css conventions for when to use div/spans) I want to be able to display them so that each chord_block span and lyric_block span is aligned vertically, as if they were left-aligned and on the same row of a table. For example: E B C#m A Just a small-town girl living in a lonely world (There will often be cases where an empty chord block is matched up to non-empty lyric block, and vice-versa.) I'm completely new to using CSS to align things, and have had no real understanding/experience of CSS aside from changing background colors and link styles. Is this possible in CSS? If not, how could the div/class nesting structure be revised to make this possible? I could change the spans to divs if necessary. Some things I cannot use: I can't change the structure to group things by a chord_and_lyric_block div (and have their width stretch to the length of the lyric, and stack them horizontally), because I couldn't really copy/select the lyrical lines continuously in their entirety, which is extremely critical. I'm trying to avoid a table-like solution, because this data is not tabular at all. The chord line and the lyric line are meant to be read as one continuous line, not a set of cells. Also, apart from the design philosophy reasons, I think it might have the same problems as the previous thing bullet point. If this is possible, what div/span attributes should I be using? Can you provide sample css? If this is not possible, can it be done with javascript? EDIT: I'm sorry I wasn't clear at the start, but I would like a solution that allows both the chord line and the lyric line to be "selectable" and continuous.

    Read the article

  • conversion from C++ to C

    - by Dave
    Hi I am interested by converting some code from C++ to C (mostly because i need to use the library with/from other C program and other language) . C is a better gateway for that I am interested to replicate few C++ concept like inheritance for inst . Does anyone know good references or has already work on some similar issues. For inst how to deal with inheritance , adding new members variable/ methods to child class , ... Thx for your help

    Read the article

  • Image does not update when file name remains the same in XCode 3.1.2

    - by vman049
    Hi Everyone, I'm using XCode version 3.1.2 and am developing for iPhone using the Simulator with iOS 2.2.1 on Leopard. I had an image file named "img.jpg" in my project which I decided to switch for a different file. After adding the new file into the XCode Resources folder, I removed the first file and renamed the new file to the same name as the previous one, "img.jpg." When I run my program, however, the Simulator loads the old image instead of the new one, even though the old one has been deleted from disk (not just the reference). I tried changing the name of the file to "img2.jpg," and it worked like it should - loading the new image, but I want to keep the name "img.jpg." I ran a search with Spotlight for "img.jpg" to see if there was another copy stored somewhere that XCode was using, but it only returned my new image file. I have tried uninstalling the app from the Simulator and running the application again, but that also does not fix the problem. What must I do for XCode to recognize that I want to use the new image file and not the old one? Thanks for your help!!

    Read the article

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