Search Results

Search found 221 results on 9 pages for 'kim johansson'.

Page 6/9 | < Previous Page | 2 3 4 5 6 7 8 9  | Next Page >

  • appending <a href> to keywords in rails

    - by kim
    Basically, there are some keywords that i want to pick out and assign a link to them dynamically. How should i go about in doing this? Let's say i have something like this; <p>ruby, rails, php, python, django and sinatra</p> and i would like to assign links to keywords like ruby and python, so the end results should look like this; <p><a href="http://www.ruby-lang.org">ruby</a>, rails, php, <a href="http://www.python.org">python</a>, django and sinatra</p> Any help or suggestion would be much appreciated!

    Read the article

  • Using Google Common Collection in GWT

    - by Jeeyoung Kim
    This is a simple problem, but I'm having problems with it... I'm trying to use Google common collection's Objects.equal() method in a GWT client code, but I'm keep getting the error "20:12:10.001 [ERROR] [gwt_regex] Line 39: No source code is available for type com.google.common.base.Objects; did you forget to inherit a required module?" Tried to Google for the answer, but couldn't find any answer regarding this - everyone just said "Google collection should work off the box with GWT".

    Read the article

  • How to call regular JS function with params within jQuery ?

    - by Kim
    Is there another way to run a regular JS function with params passed than what I use below ? It seems redundant use a on-the-way function to do this. function regularJSfunc(param1,param2) { // do stuff } $(document).ready(function(){ $('#myId').change(function(){ regularJSfunc('data1','data2'); }); } Using a .bind event seems much better, however I am not sure how to access the params. Note: Example below doesnt work. $(document).ready(function(){ $('#myId').bind('change',{'data1','data2'},regularJSfunc); }

    Read the article

  • Extending an entity

    - by Kim L
    I have class named AbstractUser, which is annotated with @MappedSuperclass. Then I have a class named User (@Entity) which extends AbstractUser. Both of these exist in a package named foo.bar.framework. When I use these two classes, everything works just fine. But now I've imported a jar containing these files to another project. I'd like to reuse the User class and expand it with a few additional fields. I thought that @Entity public class User extends foo.bar.framework.User would do the trick, but I found out that this implementation of the User only inherits the fields from AbstractUser, but nothing from foo.bar.framework.User. The question is, how can I get my second User class to inherit all the fields from the first User entity class? Both User class implementation have different table names defined with @Table(name = "name").

    Read the article

  • using an array in a custom formula in crystal reports xi

    - by Kim Sharpe
    I have a formula which is working; the formula uses an array. I tried to extract the formula to create a custom formula but now get an error in the syntax. I am wondering if the array is causing the problem as the error is on the line: last_element_current:=val(sc_array[1]) + 1; and the error is: the ) is missing and highlights the variable sc_array before the index [1].

    Read the article

  • issue about Concept of JFrame, JLabel and ContentPane

    - by Sun Hong Kim
    I just study window programming with awt. I see through several codes but I can not get concepts of JFrame, JLabel and ContentPane. I think JFrame only make outer Frame. ContentPane is container that contain JLabel that has contents(text, button, radio etc...). I don't know this is correct T.T Why I ask this is I failed combine the contents. I can not make TextField and InternalFrame at a time. I want to know the concept. I hope you take my question right.

    Read the article

  • How to show jQuery is working/waiting/loading ?

    - by Kim
    How do I show a loading picture and/or message to the user ? If possible, would I like to know how to make it full screen with grey-dimmed background. Kinda like when viewing the large picture from some galleries (sorry, no example link). Currently do I add a CSS class which has the image and other formating, but its not working for some reason. Results from the search do get inserted into the div. HTML <div id="searchresults"></div> CSS div.loading { background-image: url('../img/loading.gif'); background-position: center; width: 80px; height: 80px; } JS $(document).ready(function(){ $('#searchform').submit(function(){ $('#searchresults').addClass('loading'); $.post('search.php', $('#'+this.id).serialize(),function(result){ $('#searchresults').html(result); }); $('#searchresults').removeClass('loading'); return false; }); });

    Read the article

  • How to return radio checked object with jQuery ?

    - by Kim
    HTML <input type="radio" name="rdName" id="uniqueID1" value="1" checked="checked"> <input type="radio" name="rdName" id="uniqueID2" value="2"> <input type="radio" name="rdName" id="uniqueID3" value="3"> jQuery #1 $('input:radio[name=rdName]:checked').val(); jQuery #2 $('input[name=rdName]:checked'); jQuery #1 gets the value of checked radio, but I need to get the whole object to get the ID. jQuery #2 get this (from Chrome Dev console). Object "0" is the actual object I need, but I am unable to just that. 0: HTMLInputElement constructor: function Object() context: HTMLDocument length: 1 prevObject: Object selector: input[name=rdName]:checked __proto__: Object Any ideas how to isolate the needed object ?

    Read the article

  • C++ cin questions

    - by Kim
    This seems to be weird: int main(int argc, char* argv[]) { cout << "function main() .." << '\n'; char ch = 0; double number_value=1.1; cin >> ch; cin.putback(ch); cin >> number_value; cout << "1 .. " << " " << cin.good() << " " << number_value << '\n'; cin >> number_value; cout << "2 .. " << " " << cin.good() << " " << number_value << '\n'; return 0; } If I input the following: 7a 1 I get the following: function main() .. 7a 1 1 .. 1 7 2 .. 0 0 I understand the: 1 .. 1 7 but why the variable number_value is 0. cin.good() shows failure so nothing would have read and the value in number_value from the previous assignment would remain. I expect the value of 7.

    Read the article

  • JSONArray does not work when I am getting the JSON string from the server

    - by Taehoon A Kim
    I've looked up some answers but am not sure why mine is failing exactly... The code looks something like this HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); String json = EntityUtils.toString(httpEntity); //Convert to JsonArray JSONArray jsonArray = new JSONArray(json); Log.i(DEBUG_TAG, Integer.toString(jsonArray.length())); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Log.i(DEBUG_TAG, jsonObject.getString(KEY_ID)); // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put(KEY_ID, jsonObject.getString(KEY_ID)); map.put(KEY_TITLE, jsonObject.getString(KEY_TITLE)); map.put(KEY_ARTIST, jsonObject.getString(KEY_ARTIST)); map.put(KEY_DURATION, jsonObject.getString(KEY_DURATION)); map.put(KEY_VOTECOUNT, jsonObject.getString(KEY_VOTECOUNT)); map.put(KEY_THUMB_URL, jsonObject.getString(KEY_THUMB_URL)); map.put(KEY_GENRE, jsonObject.getString(KEY_GENRE)); //Adding map to ArrayList if (Integer.parseInt(jsonObject.getString(KEY_VOTECOUNT)) == -1){ //If VoteCount is -1 then add to header headerList.add(map); }else { songsList.add(map); } } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } When I run logcat on String json, it seems to show correct info which is kind of like this... { "userdata": [ { "id": "8", "title": "Baby One More Time", "artist": "Britney Spears", "duration": "03:24:00", "votes": "0", "thumb_url": "http://api.androidhive.info/music/images/dido.png", "genre": null }, { "id": "2", "title": "As Long As You Love Me", "artist": "Justin Bieber", "duration": "05:26:00", "votes": "0", "thumb_url": "http://api.androidhive.info/music/images/enrique.png", "genre": "Rock" } ] } and the logcat on JSONArray jsonArray = new JSONArray(json); tells me that jsonArray.length() 10-31 22:57:28.433: W/CustomizedListView(26945): error! Invalid index 0, size is 0 Please let me know Thank you,

    Read the article

  • Running Maven Goals in CLI.

    - by Jeeyoung Kim
    Hello, I have a maven pom.xml file with multiple instances of a same goal defined (inside with different s). I'm wondering how I can run a specific goal via maven command line. I've tried mvn --help, but I couldn't find an entry regarding this.

    Read the article

  • When exactly does a method have side effects?

    - by Kim
    As I always understood it, any change to the programs state (or anything to do with IO) is a side effect. It does not matter, whether the change occurs in a global variable or in a private field of the object the method is called on. It follows that all methods which do not return anything either do nothing at all or have a side effect. My confusion comes from one of our university's instructors (who is still a student and thus not omniscient yet;) ) telling me setters don't have side effects.

    Read the article

  • Instagram API and Zend/Loader.php

    - by Jaemin Kim
    I want to use Instagram API and I found this code. <html> <head></head> <body> <h1>Popular on Instagram</h1> <?php // load Zend classes require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Http_Client'); // define consumer key and secret // available from Instagram API console $CLIENT_ID = 'YOUR-CLIENT-ID'; $CLIENT_SECRET = 'YOUR-CLIENT-SECRET'; try { // initialize client $client = new Zend_Http_Client('https://api.instagram.com/v1/media/popular'); $client->setParameterGet('client_id', $CLIENT_ID); // get popular images // transmit request and decode response $response = $client->request(); $result = json_decode($response->getBody()); // display images $data = $result->data; if (count($data) > 0) { echo '<ul>'; foreach ($data as $item) { echo '<li style="display: inline-block; padding: 25px"><a href="' . $item->link . '"><img src="' . $item->images->thumbnail->url . '" /></a> <br/>'; echo 'By: <em>' . $item->user->username . '</em> <br/>'; echo 'Date: ' . date ('d M Y h:i:s', $item->created_time) . '<br/>'; echo $item->comments->count . ' comment(s). ' . $item->likes->count . ' likes. </li>'; } echo '</ul>'; } } catch (Exception $e) { echo 'ERROR: ' . $e->getMessage() . print_r($client); exit; } ?> </body> </html> In here, I found Zender/Load.php, and I've never heard about that. Is it okay to go http://www.zend.com/en/products/guard/downloads here, and download Zend for linux?? And for another question, is this code available to use Instagram API?? For last, could you let me know that is there any simple code to use Instagram API? Thank you.

    Read the article

  • Javascript: gradually adding to string in each iteration ?

    - by Kim Jong Woo
    I have a string like this that is split up: var tokens = "first>second>third>last".split(">"); What I would like in each iteration is for it to return Iteration 0: "last" Iteration 1: "third>last" Iteration 2: "second>third>last" Iteration 3: "first>second>third>last" I am thinking of using decrementing index for loop.... but is there a more efficient approach ? for (int w = tokens.length-1; w == 0; w--) { }

    Read the article

  • Java Swing: JWindow appears behind all other process windows, and will not disappear

    - by Kim Jong Woo
    I am using JWindow to display my splash screen during the application start up. however it will not appear in front of all windows as it should, and it will not disappear as well. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Toolkit; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JWindow; public class MySplash { public static MySplash INSTANCE; private static JWindow jw; public MySplash(){ createSplash(); } private void createSplash() { jw = new JWindow(); JPanel content = (JPanel) jw.getContentPane(); content.setBackground(Color.white); // Set the window's bounds, centering the window int width = 328; int height = 131; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; jw.setBounds(x, y, width, height); // Build the splash screen JLabel label = new JLabel(new ImageIcon("splash.jpg")); JLabel copyrt = new JLabel("SplashScreen Test", JLabel.CENTER); copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 12)); content.add(label, BorderLayout.CENTER); content.add(copyrt, BorderLayout.SOUTH); Color oraRed = new Color(156, 20, 20, 255); content.setBorder(BorderFactory.createLineBorder(oraRed, 0)); } public synchronized static MySplash getInstance(){ if(INSTANCE==null){ INSTANCE = new MySplash(); } return INSTANCE; } public void showSplash(){ jw.setAlwaysOnTop(true); jw.toFront(); jw.setVisible(true); return; } public void hideSplash(){ jw.setAlwaysOnTop(false); jw.toBack(); jw.setVisible(false); return; } } So in my main class which extends JFrame, I call my splash screen by SwingUtilities.invokeLater(new Runnable(){ @Override public void run() { MySplash.getInstance().showSplash(); } }); However, the JWindow appears behind the all open instances of windows on my computer. Hiding the JWindow also doesn't work. SwingUtilities.invokeLater(new Runnable(){ @Override public void run() { MySplash.getInstance().hideSplash(); } });

    Read the article

  • How to approach this SQL query

    - by Kim
    I have data related as follows: A table of Houses A table of Boxes (with an FK back into Houses) A table of Things_in_boxes (with an FK back to Boxes) A table of Owners (with an FK back into Houses) In a nutshell, a House has many Boxes, and each Box has many Things in it. In addition, each House has many Owners. If I know two Owners (say Peter and Paul), how can I list all the Things that are in the Boxes that are in the Houses owned by these guys? Also, I'd like to master this SQL stuff. Can anyone recommend a good book/resource? (I'm using MySQL). Thanks!

    Read the article

  • C++ STL type_traits question.

    - by Kim Sun-wu
    I was watching the latest C9 lecture and noticed something interesting.. In his introduction to type_traits, Stephan uses the following (as he says, contrived) example: template <typename T> void foo(T t, true_type) { std::cout << t << " is integral"; } template <typename T> void foo(T t, false_type) { std::cout << t << " is not integral"; } template <typename T> void bar(T t) { foo(t, typename is_integral<T>::type()); } This seems to be far more complicated than: template <typename T> void foo(T t) { if(std::is_integral<T>::value) std::cout << "integral"; else std::cout << "not integral"; } Is there something wrong with the latter way of doing it? Is his way better? Why? Thanks.

    Read the article

  • How Do I Import a 3D Object into Adobe Flex?

    - by Kim
    Hi everyone, I wanted to know if anyone here knows how to import a 3D Object (i.e. Maya 3D Model) into Adobe Flex Application? I needed to create a simple Flex application which will allow me to rotate the 3D Object by dragging but I cannot seem to start doing it because I'm having a hard time trying to figure out how I can import my 3D model into Flex. This is exactly what I wanted to do: 3D Object in Flex I hope someone can help me. Thanks a lot :)

    Read the article

  • How do you unit test the real world?

    - by Kim Sun-wu
    I'm primarily a C++ coder, and thus far, have managed without really writing tests for all of my code. I've decided this is a Bad Idea(tm), after adding new features that subtly broke old features, or, depending on how you wish to look at it, introduced some new "features" of their own. But, unit testing seems to be an extremely brittle mechanism. You can test for something in "perfect" conditions, but you don't get to see how your code performs when stuff breaks. A for instance is a crawler, let's say it crawls a few specific sites, for data X. Do you simply save sample pages, test against those, and hope that the sites never change? This would work fine as regression tests, but, what sort of tests would you write to constantly check those sites live and let you know when the application isn't doing it's job because the site changed something, that now causes your application to crash? Wouldn't you want your test suite to monitor the intent of the code? The above example is a bit contrived, and something I haven't run into (in case you haven't guessed). Let me pick something I have, though. How do you test an application will do its job in the face of a degraded network stack? That is, say you have a moderate amount of packet loss, for one reason or the other, and you have a function DoSomethingOverTheNetwork() which is supposed to degrade gracefully when the stack isn't performing as it's supposed to; but does it? The developer tests it personally by purposely setting up a gateway that drops packets to simulate a bad network when he first writes it. A few months later, someone checks in some code that modifies something subtly, so the degradation isn't detected in time, or, the application doesn't even recognize the degradation, this is never caught, because you can't run real world tests like this using unit tests, can you? Further, how about file corruption? Let's say you're storing a list of servers in a file, and the checksum looks okay, but the data isn't really. You want the code to handle that, you write some code that you think does that. How do you test that it does exactly that for the life of the application? Can you? Hence, brittleness. Unit tests seem to test the code only in perfect conditions(and this is promoted, with mock objects and such), not what they'll face in the wild. Don't get me wrong, I think unit tests are great, but a test suite composed only of them seems to be a smart way to introduce subtle bugs in your code while feeling overconfident about it's reliability. How do I address the above situations? If unit tests aren't the answer, what is? Thanks!

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9  | Next Page >