Search Results

Search found 390 results on 16 pages for 'samuel kim'.

Page 12/16 | < Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >

  • How can I embed a conditional comment for IE with innerHTML?

    - by Samuel Charpentier
    Ok so I want to conditionally add this line of code; <!--[if ! IE]> <embed src="logo.svg" type="image/svg+xml" /> <![endif]--> Using: document.getElementById("logo") .innerHTML='...'; In a if()/else() statement and it don't write it! If i get rid of the selective comment ( <!--[if ! IE]><![endif]-->) and only put the SVG ( <embed src="logo.svg" type="image/svg+xml" /> ) it work! what should I do? I found a way around but i think in the Android browser the thing will pop up twice. here's what I've done ( and its Validated stuff!); <!DOCTYPE html> <html> <head> <META CHARSET="UTF-8"> <title>SVG Test</title> <script type="text/javascript"> //<![CDATA[ onload=function() { var ua = navigator.userAgent.toLowerCase(); var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); if(isAndroid) { document.getElementById("logo").innerHTML='<img src="fin_palais.png"/>'; } } //]]> </script> </head> <body> <div id="logo"> <!--[if lt IE 9]> <img src="fin_palais.png"/> <![endif]--> <!--[if gte IE 9]><!--> <embed src="fin_palais.svg" type="image/svg+xml" /> <!--<![endif]--> </div> </body>

    Read the article

  • does it make sense to send password information during email communication from websites

    - by Samuel
    Most of the online sites on registration do send a link to activate the site and on any further correspondence with the end user they provide information about the site and also provide the login credentials with password in clear text (as given below) Username - [email protected] Password - mysecretpassword What would you do in such a case? From a usability perspective does it make sense to send the password information in clear text or should you just avoid sending this information. I was under the impression that most of the passwords are MD5 hashed before storing in the database and hence the service provider will not have any access to clear text passwords, is this a security violation?

    Read the article

  • Projections.count() and Projections.countDistinct() both result in the same query

    - by Kim L
    EDIT: I've edited this post completely, so that the new description of my problem includes all the details and not only what I previously considered relevant. Maybe this new description will help to solve the problem I'm facing. I have two entity classes, Customer and CustomerGroup. The relation between customer and customer groups is ManyToMany. The customer groups are annotated in the following way in the Customer class. @Entity public class Customer { ... @ManyToMany(mappedBy = "customers", fetch = FetchType.LAZY) public Set<CustomerGroup> getCustomerGroups() { ... } ... public String getUuid() { return uuid; } ... } The customer reference in the customer groups class is annotated in the following way @Entity public class CustomerGroup { ... @ManyToMany public Set<Customer> getCustomers() { ... } ... public String getUuid() { return uuid; } ... } Note that both the CustomerGroup and Customer classes also have an UUID field. The UUID is a unique string (uniqueness is not forced in the datamodel, as you can see, it is handled as any other normal string). What I'm trying to do, is to fetch all customers which do not belong to any customer group OR the customer group is a "valid group". The validity of a customer group is defined with a list of valid UUIDs. I've created the following criteria query Criteria criteria = getSession().createCriteria(Customer.class); criteria.setProjection(Projections.countDistinct("uuid")); criteria = criteria.createCriteria("customerGroups", "groups", Criteria.LEFT_JOIN); List<String> uuids = getValidUUIDs(); Criterion criterion = Restrictions.isNull("groups.uuid"); if (uuids != null && uuids.size() > 0) { criterion = Restrictions.or(criterion, Restrictions.in( "groups.uuid", uuids)); } criteria.add(criterion); When executing the query, it will result in the following SQL query select count(*) as y0_ from Customer this_ left outer join CustomerGroup_Customer customergr3_ on this_.id=customergr3_.customers_id left outer join CustomerGroup groups1_ on customergr3_.customerGroups_id=groups1_.id where groups1_.uuid is null or groups1_.uuid in ( ?, ? ) The query is exactly what I wanted, but with one exception. Since a Customer can belong to multiple CustomerGroups, left joining the CustomerGroup will result in duplicated Customer objects. Hence the count(*) will give a false value, as it only counts how many results there are. I need to get the amount of unique customers and this I expected to achieve by using the Projections.countDistinct("uuid"); -projection. For some reason, as you can see, the projection will still result in a count(*) query instead of the expected count(distinct uuid). Replacing the projection countDistinct with just count("uuid") will result in the exactly same query. Am I doing something wrong or is this a bug? === "Problem" solved. Reason: PEBKAC (Problem Exists Between Keyboard And Chair). I had a branch in my code and didn't realize that the branch was executed. That branch used rowCount() instead of countDistinct().

    Read the article

  • User name form validation message

    - by Samuel
    I have a form validation message for the user name field which says the following Name can only contain alphabets, '.' and ' ' characters OR should it be Name can only contain alphabets, dot and space characters OR should it be Name can only contain alphabets, dot (".") and space (" ") characters Which is preferable from a usability perspective assuming the end users has very less exposure to computers.

    Read the article

  • Windows XP: RegSvr32 /i:[cmdline]: What exactly is "Command line" in this case?

    - by Kim
    I am trying to register a dll using regsvr32 in a cmd window. I do this on an administrator account, but I need this dll to be registered for all the users. Turns out regsvr32 does not do that, it only registers for your current user. Well, when you use it this way anyways: "regsvr32 /i "C:\MyDll.dll"" What happens; The entry is added to Local_User, and Classes in the registry, but not Local_Machine. The msdn article on regsvr32 says it also takes a [cmdline] when using the /i option. But the article fails to specify what I can put in place of [cmdline]. Google is refusing to help me as well, so I'm a bit stuck on this. I realize this is not exactly on the topic of programming, but this is something programmers might know, so... Has anyone run into this before? Perhaps someone knows how this [cmdline] tag works? Are there any other ways to add this dll to all users? (Apart from editing the registry manually that is.) Any insight would be greatly appreciated!

    Read the article

  • Warning vs. error

    - by Samuel
    I had an annoying issue, getting a "Possible loss of precision" error when compiling my Java program on BlueJ (But from what i read this isn't connected to a specific IDE). I was surprised by the fact that the compiler told me there is a possible loss of precision and wouldnt let me compile/run the program. Why is this an error and not a warning saying you might loose precision here, if you don't want that change your code? The program runs just fine when i drop the float values, it wouldn't matter since there is no point (e.g [143.08, 475.015]) on my screen. On the other hand when i loop through an ArrayList and in this loop i have an if clause removing elements from the ArrayList it runs fine, just throws an error and doesn't display the ArrayList [used for drawing circles] for a fraction of a second. This appears to me as a severe error but doesn't cause (hardly) any troubles, while i wouldn't want to have such a thing in my code at all. What's the boundary?

    Read the article

  • Guide on writing my first open source software ?

    - by Kim Jong Woo
    Hello Stackoverflow, Since last August 2009, I have been working on project but then decided to release it as an open source project. The purpose of this project is to provide an alternative to existing commercial & expensive solution. So my question is, how can I get started ? The prototype has been ready since May and now being rewritten in Java. Which license type do I need to pursue ? LGPL? MIT? Thank you, John.

    Read the article

  • jquery in ajax loaded content

    - by Kim Gysen
    My application is supposed to be a single page application and I have the following code that works fine: home.php: <div id="container"> </div> accordion.php: //Click functions: load content $('#parents').click(function(){ //Load parent in container $('#container').load('http://www.blabla.com/entities/parents/parents.php'); }); parents.php: <div class="entity_wrapper"> Some divs and selectors </div> <script type="text/javascript"> $(document).ready(function(){ //Some jQuery / javascript }); </script> So the content loads fine, while the scripts dynamically loaded execute fine as well. I apply this system repetitively and it continues to work smoothly. I've seen that there are a lot of frameworks available on SPA's (such as backbone.js) but I don't understand why I need them if this works fine. From the backbone.js website: When working on a web application that involves a lot of JavaScript, one of the first things you learn is to stop tying your data to the DOM. It's all too easy to create JavaScript applications that end up as tangled piles of jQuery selectors and callbacks, all trying frantically to keep data in sync between the HTML UI, your JavaScript logic, and the database on your server. For rich client-side applications, a more structured approach is often helpful. Well, I totally don't have the feeling that I'm going through the stuff they mention. Adding the javascript per page works really well for me. They are html containers with clear scope and the javascript is just related to that part. More over, the front end doesn't do that much, most of the logic is managed based on Ajax calls to external PHP scripts. Sometimes the js can be a bit more extended for some functionalities, but all just loads as smooth in less than a second. If you think that this is bad coding, please tell me why I cannot do this and more importantly, what is the alternative I should apply. At the moment, I really don't see a reason on why I would change this approach as it just works too well. I'm kinda stuck on this question because it just worries me sick as it seems to easy to be true. Why would people go through hard times if it would be as easy as this...

    Read the article

  • Returning C++ objects from Windows DLL

    - by R Samuel Klatchko
    Due to how Microsoft implements the heap in their non-DLL versions of the runtime, returning a C++ object from a DLL can cause problems: // dll.h DLL_EXPORT std::string somefunc(); and: // app.c - not part of DLL but in the main executable void doit() { std::string str(somefunc()); } The above code runs fine provided both the DLL and the EXE are built with the Multi-threaded DLL runtime library. But if the DLL and EXE are built without the DLL runtime library (either the single or multi-threaded versions), the code above fails (with a debug runtime, the code aborts immediately due to the assertion _CrtIsValidHeapPointer(pUserData) failing; with a non-debug runtime the heap gets corrupted and the program eventually fails elsewhere). Two questions: Is there a way to solve this other then requiring that all code use the DLL runtime? For people who distribute their libraries to third parties, how do you handle this? Do you not use C++ objects in your API? Do you require users of your library to use the DLL runtime? Something else?

    Read the article

  • how to structure code that uses std::rel_ops

    - by R Samuel Klatchko
    I was working on some code and wanted to make use of std::rel_ops. From what I can tell, you need to do using std::rel_ops to your source code to make use of them. But I'm not sure where the best place to put that is. Let's say I have a header file with a class that only defines the minimal operator== and operator<: // foo.h class foo { public: bool operator==(const foo &other) const; bool operator<(const foo &other) const; }; I'm not sure where to put using std::rel_ops. If I leave it out of the foo.h, then every user of foo.h needs to know the implementation detail that foo is not defining all the operators itself. But putting using std::rel_ops inside foo.h breaks the rule of thumb about not having a using in a header file. How do other people resolve this issue?

    Read the article

  • Disabling Remote-Debugging Connection on Windows 2000

    - by Kim Leeper
    I have two machines one running Win 2000 and one running Win XP both with VSC++ 6. I created an application on the Win XP machine (local) and sucessfuly used the Win2000 machine (remote) as the target for debugging. The code was in a shared drive on the Win2000 machine. This setup worked well, just like in the movies! However, I now wish to use my Win2000 machine as a develpment machine again and I find I can not. When attempting to execute a natively compiled application on this machine, I get a dialog with the title of "Remote Execution Path And Filename" asking me for same. When dialog is cancelled as the program that is attemptng to execute is not remote, the program terminates without error. Extra info! On the WinXP machine, VSC++, under the Build menu-Debugger Remote Connection-Remote Connection Dialog-the "Connection:" list box has two entries 'Local' and 'Network', on the Win2000 machine the 'Local' entry is not present, only the entry for 'Network'. How do I get back my 'Local' entry on what used to be my target machine?

    Read the article

  • How should I do a loop a nokogiri search in ruby?

    - by kim
    I have the following that I retreive the title of each url from an array that contains a list of urls. require 'rubygems' require 'nokogiri' require 'open-uri' @urls = ["http://google.com", "http://yahoo.com", "http://rubyonrails.org"] @found_titles = Array.new @found_titles[0] = Nokogiri::HTML(open("#{@urls[0]}")).search("title").inner_html #this can go on forever...but #@found_titles[1] = Nokogiri::HTML(open("#{@urls[1]}")).search("title").inner_html #@found_titles[2] = Nokogiri::HTML(open("#{@urls[2]}")).search("title").inner_html puts "#{@found_titles[0]}" How should i form a loop method for this so i can get the title even when the list in @url array gets longer.

    Read the article

  • user specifc maven settings in repository

    - by Samuel
    http://maven.apache.org/settings.html As per documentation the user specific settings can be either copied to the .m2 folder or under the maven installation. If a developer changes a machine or gets a new user id, such properties have to be copied manually to these newer machines. Would it be possible to store user specific setting information in the repository itself (say SVN) and somehow have the mvn scripts load it on startup.

    Read the article

  • jQuery JSON help

    - by kim
    okay I'm new to jQuery and JSON but I have now done so I got some information from the database in JSON format and now I want to show the results in a nice way but I don't know how ;) what I want is to show 5 newest threads on my page so will this script try to load all the time or do I need to do something else? I want it to show the 5 newest threads and when there somes a new thread i should slide down and the 6 threads at the bottom should disappear Here is my code <script type="text/javascript"> $.getJSON('ajax/forumThreads', function(data) { //$('<p>' + data[0].overskrift + '</p>').appendTo('#updateMe > .overskrift'); $('<div class="overskrift">' + data[0].overskrift + '</div>') { $(this).hide().appendTo('updateMe').slideDown(1000); } //alert(data[0].overskrift); }); </script>

    Read the article

  • how to selectively filter items in a collection

    - by Samuel
    I use the following snippet to filter the list of selected users, where isSelected is a boolean variable. Is there a simpler way (helper function) to populate the selectedUsers collection instead of writing the following lines of code. List<User> selectedUsers = new ArrayList<User>(0); for (User user : this.getUsers()) { if (user.isSelected()) { selectedUsers.add(user.getId()); } }

    Read the article

  • Getting full path for Windows Service

    - by Samuel Kim
    How can I find out the folder where the windows service .exe file is installed dynamically? Path.GetFullPath(relativePath); returns a path based on C:\WINDOWS\system32 directory. However, the XmlDocument.Load(string filename) method appears to be working against relative path inside the directory where the service .exe file is installed to.

    Read the article

  • Problems with Backbone.Model callback and THIS

    - by Rev. Samuel
    I'm building a simple weather widget. The current weather conditions are read out of the National Weather Service xml file and then I want to parse and store the relevant data in the model but the callback for the $.ajax won't connect (the way I'm doing it). var Weather = Backbone.Model.extend({ initialize: function(){ _.bindAll( this, 'update', 'startLoop', 'stopLoop' ); this.startLoop(); }, startLoop: function(){ this.update(); this.interval = window.setInterval( _.bind( this.update, this ), 1000 * 60 * 60 ); }, stopLoop: function(){ this.interval = window.clearInterval( this.interval ); }, store: function( data ){ this.set({ icon : $( data ).find( 'icon_url_name' ).text() }); }, update: function(){ $.ajax({ type: 'GET', url: 'xml/KROC.xml', datatype: 'xml' }) .done( function( data ) { var that = this; that.store( $( data ).find( 'current_observation' )[ 0 ] ); }); } }); var weather = new Weather(); The data is read correctly but I can't get the done function of the call back to call the store function. (I would be happy if the "done" would just parse and then do "this.set". Thanks in advance for your help.

    Read the article

  • jQuery.Form wont submit

    - by kim
    Im´trying to submit a form without refreshing the page, but I´m having a problem. When I click submit the page refreshes and anothing gets posted. Here is the code, what am I doing wrong? (I´m a newbie) jQuery 1.4.2 and the jQuery Form Plugin 2.43 is present. tnx $(document).ready(function() { var options = { target: '#output2', url: https://graph.facebook.com/<%=fbUid%>/feed, type: post, clearForm: true // clear all form fields after successful submit //dataType: null // 'xml', 'script', or 'json' (expected server response type) //resetForm: true // reset the form after successful submit // $.ajax options can be used here too, for example: //timeout: 3000 }; // bind to the form's submit event $('#fbPostStatus').submit(function() { // inside event callbacks 'this' is the DOM element so we first // wrap it in a jQuery object and then invoke ajaxSubmit $(this).ajaxSubmit(options); // !!! Important !!! // always return false to prevent standard browser submit and page navigation return false; }); });

    Read the article

  • user height and weight in sql

    - by Samuel
    We are planning to capture a user's height and weight and am looking for ideas on representing them in sql. I have the following questions in mind weight can be expressed in kilograms and grams and height in meters and centimeters, so should I capture them as a BigDecimal with an appropriate precision and scale or capture them as vanilla strings and do the manipulation in the user interface. Note: I am planning to capture the kilograms and grams separately in the user interface. should the metric of measurement be part of the sql (i.e. the end user might want to view this information in pounds, inches according to his preference) OR Should I just support kilograms / meters in the database and do the conversion while showing this in the user interface

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >