Daily Archives

Articles indexed Friday May 14 2010

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

  • Android: Haptic feedback: onClick() event vs hapticFeedbackEnabled in the view

    - by dreeves
    If you want a button to provide haptic feedback (ie, the phone vibrates very briefly so you can feel that you really pushed the button), what's the standard way to do that? It seems you can either explicitly set an onClick() event and call the vibrate() function, giving a number of milliseconds to vibrate, or you can set hapticFeedbackEnabled in the view. The documentation seems to indicate that the latter only works for long-presses or virtual on-screen keys: http://developer.android.com/reference/android/view/View.html#performHapticFeedback(int) If that's right, then I need to either make my button a virtual on-screen key or manually set the onClick() event. What do you recommend? Also, if I want the vibrating to happen immediately when the user's finger touches the button, as opposed to when their finger "releases" the button, what's the best way to accomplish that? Related question: http://stackoverflow.com/questions/2228151/how-to-enable-haptic-feedback-on-button-view

    Read the article

  • loading javascript file after jquery.ready

    - by Spines
    I want to load a javascript file at the end of jquery.ready so that the code in my ready handler doesn't have to wait to execute until this large javascript file is loaded. My jquery.ready code doesn't rely on this javascript file at all. Would this be a good way to do that? $(function(){ ... ... $('head').append('<script type="text/javascript" src="/largejs.js"></script>'); });

    Read the article

  • Using TortoiseHg to push to an authenticated git repository

    - by Nathan Palmer
    I'm trying to push a changeset from a local Mercurial repository created with TortoiseHg to a remote Git repository. I have hg-git installed and configured and it will pull just fine. But when I run the push it gives me this Command hg push git+ssh://git@dummyrepo:username/repo.git Result pushing to git+ssh://git@dummyrepo:username/repo.git importing Hg objects into Git creating and sending data abort: the remote end hung up unexpectedly There are several things I've done to get to this point. But I'm hoping to resolve this last thing because I find TortoiseHg to be much easier to work with than any of the Git tools out there (for windows.) Installed TortoiseHg Pulled down the hg-git from http://bitbucket.org/durin42/hg-git/ Configured mercurial.ini to point to the hg-git library Pulled down dulwich source from git://git.samba.org/jelmer/dulwich.git Compiled dulwich and put it into library.zip for TortoiseHg Configured TortoiseHg to use TortoisePlink.exe for ssh Added my private key to Pageant Any ideas what I could be missing?

    Read the article

  • Errors with shotgun gem and msvcrt-ruby18.dll when running my Sinatra app

    - by Adam Siddhi
    Greetings, Every time I make a change to a Sinatra app I'm working on and try to refresh the browser (located at http://localhost:4567/) the browser will refresh and, the console window seems to restart the WEB brick server. The problem is that the content in the browser window does not change. A friend of mine told me it was a shotgun issue and referred me to rtomayko's shotgun gem: http://github.com/rtomayko/shotgun On this page I read that the shotgun gem would basically solve my problem, allowing the changes made to my app to show up in the browser window after I refresh it. So I installed the shotgun gem. The installation was successful. To activate the shotgun function you have to type shotgun before the file name. In this case my Sinatra app's file name is shortener.rb When I type shotgun shortener.rb to run my Sinatra app I get this error: C:\ruby\sinatrashotgun shortener.rb c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:137:in `': No such f ile or directory - uname (Errno::ENOENT) from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:137:in block in ' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in each' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in find' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in <top (required)>' from c:/Ruby19/bin/shotgun:19:inload' from c:/Ruby19/bin/shotgun:19:in `' I should also mention that before testing the shotgun method out to see if it worked, I installed the mongrel (I realize I should have checked to see if shotgun worked before doing this as installing mongrel has complicated this problem). So on top of getting the error message above I also get a pop up window from Ruby.exe saying: Ruby.exe - Unable to load component This application has failed to start because msvcrt-ruby18.dll was not found. Re-installing the application may fix this problem. I have no idea what msvcrt-ruby18.dll is but I know that installing either shotgun and/or mongrel created this problem. Where to go from here? Thanks, Adam

    Read the article

  • Only compiles as an array of pointers, not array of arrays

    - by Dustin
    Suppose I define two arrays, each of which have 2 elements (for theoretical purposes): char const *arr1[] = { "i", "j" }; char const *arr2[] = { "m", "n" }; Is there a way to define a multidimensional array that contains these two arrays as elements? I was thinking of something like the following, but my compiler displays warnings about incompatible types: char const *combine[][2] = { arr1, arr2 }; The only way it would compile was to make the compiler treat the arrays as pointers: char const *const *combine[] = { arr1, arr2 }; Is that really the only way to do it or can I preserve the type somehow (in C++, the runtime type information would know it is an array) and treat combine as a multidimensional array? I realise it works because an array name is a const pointer, but I'm just wondering if there is a way to do what I'm asking in standard C/C++ rather than relying on compiler extensions. Perhaps I've gotten a bit too used to Python's lists where I could just throw anything in them...

    Read the article

  • How to configure MAVEN?

    - by i2ijeya
    I am a newbie to maven and i gone through the configuration steps given in Apache site, but still i cant configure it. So anyone please help me with simple steps to configure MAVEN in windows. Thanks in advance. EDITED C:\Documents and Settings\arselv>mvn install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven- resources- plugin/2.3/maven-resources-plugin-2.3.pom Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources- plugin/2.3/maven-resources-plugin-2.3.pom [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: org.apache.maven.plugins:maven-resources-plugin Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in repository: Unable to download the artifact from any repository org.apache.maven.plugins:maven-resources-plugin:pom:2.3 from the specified remote repositories: central (http://repo1.maven.org/maven2) for project org.apache.maven.plugins:maven-resources-plugin [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 42 seconds [INFO] Finished at: Fri Feb 05 13:10:06 IST 2010 [INFO] Final Memory: 2M/5M [INFO] ------------------------------------------------------------------------ So Above is the Error whil trying to do the steps given in apache site.

    Read the article

  • How do companies know they've been hacked?

    - by Chad
    With the news of Google and others getting hacked, I was wondering how companies find out, detect, and/or know they've been hacked in the first place? Sure, if they find a virus/trojan on user's computers or see a very high access rate to parts of their system that don't usually see much, if any, traffic. But, from what I've see in articles, the attack was pretty 'sophisticated', so I wouldn't imagine the hackers would make it so obvious of their hacking in the first place. Maybe someone can enlighten me on current detection schemes/heuristics. Thanks.

    Read the article

  • Wpf Resource: "Unknown Build Error, 'Path cannot be null..."

    - by Femaref
    The following is a snippet from a xaml defining a DataGrid in a Control, defining a template selector. <DataGrid.Resources> <selector:CurrencyColorSelector x:Key="currencyColorSelector"> <selector:CurrencyColorSelector.NegativeTemplate> <DataTemplate> <TextBlock Text="{Binding Balance, StringFormat=n}" Background="Red"/> </DataTemplate> </selector:CurrencyColorSelector.NegativeTemplate> <selector:CurrencyColorSelector.NormalTemplate> <DataTemplate> <TextBlock Text="{Binding Balance, StringFormat=n}"/> </DataTemplate> </selector:CurrencyColorSelector.NormalTemplate> </selector:CurrencyColorSelector> </DataGrid.Resources> Now, an error is thrown: "Unknown build error, 'Path cannot be null. Parameter name: path Line 27 Position 79.'" (Compiler or xaml validation error). I have no idea where this Path comes from, neither does my example show anything of it. If you doubleclick the error, it points to the end of the first line. Did anybody encounter such a problem and has a solution for it? The example was from here: http://www.wpftutorial.net/DataGrid.html (Row Details depending on the type of data)

    Read the article

  • [C++] STL list - how to find a list element by its object fields

    - by Dominic Bou-Samra
    I have a list: list<Unit *> UnitCollection; containing Unit objects, which has an accessor like: bool Unit::isUnit(string uCode) { if(this->unitCode == uCode) return true; else return false; } How do I search my UnitCollection list by uCode and return the corresponding element (preferably it's index). I have looked at the find() method, but i'm not sure you can pass a boolean method in instead of a searched item parameter if that makes sense.

    Read the article

  • jQuery in Opera User JS Doesn't Work

    - by Axonn
    Hello ::- ). I'm playing with some Opera User JS. I included "1jquery.min.js" in my User JS folder (1 in front because Opera loads them alphabetically). Unfortunately, it doesn't appear to be working. window.onload = OnWindowLoad; $(document).ready(function() { alert ($('#area_19')); }); function OnWindowLoad () { alert ($('#area_19')); alert(document.getElementById("area_19")); } What's interesting about this code is that the first two alerts come back in NULL, but the last one does find the object! So the element definitely exists in the page, but my jQuery seems unable to get it. What's even stranger is that the jQuery "ready" function works, indicating that I do have jQuery capability. I'm quite puzzled about all this ::- /. Hopefully somebody can give me a clue ::- ).

    Read the article

  • I am getting an error when trying to use melt() on a dataframe containing Dates

    - by Dan
    I'd like to melt the dataframe so that in one column i have dates in a second i have username as the variable and finally the value. I'm getting this error: Error in as.Date.numeric(value) : 'origin' must be supplied and while I understand the error I'm not exactly sure how to get around it. A small sample of the data is: structure(list(created_at = structure(c(14007, 14008, 14009, 14010, 14011, 14012), class = "Date"), benjamin = c(16, 0, 0, 0, 0, 0), byron = c(0, 0, 0, 0, 0, 0), cameronc = c(0, 0, 0, 0, 0, 0), daniel = c(0, 0, 0, 0, 0, 0), djdiaz = c(0, 0, 0, 0, 0, 0), gene = c(16, 77, 64, 38, 72, 36), joel = c(0, 0, 0, 0, 0, 2), kerem = c(0, 0, 0, 0, 0, 0), sophia = c(0, 0, 0, 0, 0, 0), SuperMoonMan = c(0, 0, 0, 0, 0, 0)), .Names = c("created_at", "benjamin", "byron", "cameronc", "daniel", "djdiaz", "gene", "joel", "kerem", "sophia", "SuperMoonMan"), row.names = c(NA, 6L), class = c("cast_df", "data.frame")) Thanks for your help.

    Read the article

  • Problem resizing loader after loading swf

    - by DanK
    I'm using the following code to load an swf in a pure actionscript project (Flex Builder 3) _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, Loader_Complete); _loader.contentLoaderInfo.addEventListener(Event.INIT, Loader_Init); var request:URLRequest = new URLRequest("Skins/TestSkin.swf"); _loader.load(request); this.addChild(_loader); This works okay and displays the swf on the stage (500x375 for some reason - not sure why, TestSkin.swf is a flex app with no defined width and height) However, when I try to scale the swf so that it will fill the stage, I have problems. I have tried: Setting _loader.width and _loader.height in my Loader_Complete handler Setting _loader.width and _loader.height in my Loader_Init handler Setting _loader.content.width and loader.content.height in my Loader_Complete handler Setting _loader.content.width and loader.content.height in my Loader_Init handler I have seen examples online where people say these work for them but whenever I set width or height in any of these ways, the loaded swf is simply not displayed at all. Any idea what could be causing this? What is the correct way to resize an swf that has been loaded with a Loader object?

    Read the article

  • How to distribute the android reusable code in a package?

    - by Kaillash
    Hi, I have developed some reusable android component which is basically a class . This class has some resource dependencies e.g. some png drawables, some xml layouts etc. So this class referenced the auto-generated R file.I would like to distribute this code in a single package like jar file to other developers for use in their applications. I have read that the only possible solution is to distribute code together with all my resources, which others have to copy to their "res" folder (source). So I created a jar file having the class file (say MyClass which is in the package com.xyz.android.app) and resources and tried to use this in my new application. So I added the jar file to my new applications build path using add external jars option in eclipse and copied all the resources to my new application's res folder. (The activity class say MainActivity of my new application is in com.abc.myapplication package, just for the case if it may helpful) But when I run this new application there is java.lang.ClassCastException in the MyClass class. I tried to debug the application and then I found that in the MyClass class, there is "R cannot be resolved" problem. Then I changed MainActivity's package to com.xyz.android.app (which is not the way, other developers will be happy to do), But again the same problem. But When I just copy the source java file such that both MainActivity.java and MyClass.java are in com.xyz.android.app package then application runs fine. So if I need to distribute such that other users need not to bother these package naming things, how can I accomplish this? Please help !!

    Read the article

  • Excel CSV into Nested Dictionary; List Comprehensions

    - by victorhooi
    heya, I have a Excel CSV files with employee records in them. Something like this: mail,first_name,surname,employee_id,manager_id,telephone_number [email protected],john,smith,503422,503423,+65(2)3423-2433 [email protected],george,brown,503097,503098,+65(2)3423-9782 .... I'm using DictReader to put this into a nested dictionary: import csv gd_extract = csv.DictReader(open('filename 20100331 original.csv'), dialect='excel') employees = dict([(row['employee_id'], row) for row in gp_extract]) Is the above the proper way to do it - it does work, but is it the Right Way? Something more efficient? Also, the funny thing is, in IDLE, if I try to print out "employees" at the shell, it seems to cause IDLE to crash (there's approximately 1051 rows). 2. Remove employee_id from inner dict The second issue issue, I'm putting it into a dictionary indexed by employee_id, with the value as a nested dictionary of all the values - however, employee_id is also a key:value inside the nested dictionary, which is a bit redundant? Is there any way to exclude it from the inner dictionary? 3. Manipulate data in comprehension Thirdly, we need do some manipulations to the imported data - for example, all the phone numbers are in the wrong format, so we need to do some regex there. Also, we need to convert manager_id to an actual manager's name, and their email address. Most managers are in the same file, while others are in an external_contractors CSV, which is similar but not quite the same format - I can import that to a separate dict though. Are these two items things that can be done within the single list comprehension, or should I use a for loop? Or does multiple comprehensions work? (sample code would be really awesome here). Or is there a smarter way in Python do it? Cheers, Victor

    Read the article

  • Hyperlinks to download files without stopping the current page load

    - by Evgeny
    I've got an ASP.NET page that takes a long time to download and returns partial results as it's loading (as per my previous question). On the page I have some links to download files, ie. the response headers contain "Content-Disposition: attachment", so that the browser doesn't navigate away from the page. However, if the user clicks one of these links while the page is still loading it stops loading - normal behaviour, but not what I want in this case. I can get around that by adding target=_"blank" to the links, but this momentarily opens a new window and the closes it again (once the browser realises it's an "attachment"). Is there any way to avoid having those links stop the current page load without this new window trick? JavaScript is OK.

    Read the article

  • firefox render order problem with div tag

    - by flavour404
    I have a div tag which I populate dynamically. The problem is that in Firefox when i do a test for size(height) I seem to need to run it twice in order to get the correct size. This is the code: alert("h = " + h + " height:" + document.getElementById("thumbDiv").clientHeight); Ignore 'h' for the time being, what I am curious to know is what is the correct way to get the div tags height in firefox. In ie I use offsetHeight which works for my purposes perfectly. The other thing is the render order in firefox. I populate the div and then query the height with .clientHeight and I get 102, which is I am assuming the empty height of the tag as I have set no height via style, if I press the button again I then get the height of the div with the enlcosed html page which I am pushing into the div. Its odd, and slightly annoying. I am trying to determine if there is enough room in the browser to display the div contents in their entireity, if not then I am disabling certain features otherwise I get into an infinite scroll problem... Thanks, R. Thanks R.

    Read the article

  • Problems with animateAlong in IE7

    - by Andrei
    Hi there, I'm having trouble making a simple shape move along a path in IE7 (the only version of IE I tried, actually). The following code works fine in chrome and firefox, but not IE. I couldn't find an obvious reason, has anybody seen something similar? canvas.path(rPath.path).attr("stroke", "blue"); var circle = canvas.circle(rPath.startX, rPath.startY, 5); circle.animateAlong(rPath.path, 3000, true); My rPath variable has the path and the starting point coordinates. Microsoft script debugger points to this line as the one where the code breaks: os.left != (t = x - left + "px") && (os.left = t); (line 2131 inside the uncompressed raphael.js script file, inside Element[proto].setBox = function (params, cx, cy) {...}) Any ideas? Any experience (good or bad) with raphael's animateAlong in IE7? TIA, Andrei

    Read the article

  • Correct way to load image into UIWebView from NSData object

    - by rustyshelf
    I have downloaded a gif image into an NSData object (I've checked the contents of the NSData object and it's definitely populated). Now I want to load that image into my UIWebView. I've tried the following: [webView loadData:imageData MIMEType:@"image/gif" textEncodingName:nil baseURL:nil]; but I get a blank UIWebView. Loading the image from the same URL directly works fine: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:imageUrl]]; [imageView loadRequest:request]; Do I need to set the textEncodingName to something, or am I doing something else wrong? I want to load the image manually so I can report progress to the user, but it's an animated gif, so when it's done I want to show it in a UIWebView. Edit: Perhaps I need to wrap my image in HTML somehow? Is there a way to do this without having to save it to disk?

    Read the article

  • iPhone UISearchBar animated to top

    - by hurley scott
    There are lots of apps where the searchbar moves upwards if active and moves down when it is inactive. There is a sample code from apple available which works with IB, but how can I achieve this behavior programmatically? Mostly it is combined with a navigationbar which moves out of the screen in replace with the searchbar

    Read the article

  • BerkeleyDB vs. Tokyo Cabinet

    - by vsedach
    I'm looking for general experiences from people who have used both, particularly on how the two compare on handling large numbers of records, transaction/concurrency/deadlock handling, and juicy stories about database corruption and backup procedures.

    Read the article

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