Search Results

Search found 1007 results on 41 pages for 'kevin'.

Page 32/41 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • How to copy files without slowing down my app?

    - by Kevin Gebhardt
    I have a bunch of little files in my assets which need to be copied to the SD-card on the first start of my App. The copy code i got from here placed in an IntentService works like a charm. However, when I start to copy many litte files, the whole app gets increddible slow (I'm not really sure why by the way), which is a really bad experience for the user on first start. As I realised other apps running normal in that time, I tried to start a child process for the service, which didn't work, as I can't acess my assets from another process as far as I understood. Has anybody out there an idea how a) to copy the files without blocking my app b) to get through to my assets from a private process (process=":myOtherProcess" in Manifest) or c) solve the problem in a complete different way Edit: To make this clearer: The copying allready takes place in a seperate thread (started automaticaly by IntentService). The problem is not to separate the task of copying but that the copying in a dedicated thread somehow affects the rest of the app (e.g. blocking to many app-specific resources?) but not other apps (so it's not blocking the whole CPU or someting) Edit2: Problem solved, it turns out, there wasn't really a problem. See my answer below.

    Read the article

  • Java: Are these 2 codes the same?

    - by Kevin Duke
    for (Player p : players) { p.addCard(deck.dealCard()); p.addCard(deck.dealCard()); } and for (int i = 0; i < players.size() ; i++) { Player p = players.get(i); p.addCard(deck.dealCard()); p.addCard(deck.dealCard()); } The second code yeilds a null pointer exception, what can be done to make the bottom one equivalent ?

    Read the article

  • Challenging yourself as a programmer?

    - by Kevin
    We used to be a Coldfusion development shop before hopping over to PHP in 2008, now we primarily develop custom Drupal websites. I enjoyed going from CF to PHP, but I feel like I am getting a bit stale. I have been looking at different things like Ruby, Python, Obj C (iPhone). The problem is, there just isn't enough time in the day. What would be a fun new thing to learn that would refresh me a bit and challenge myself to learn more?

    Read the article

  • C++ cin returns 0 for integer no matter what the user inputs

    - by kevin dappah
    No matter the cin it continues to to output 0 for score. Why is that? I tried returning the "return 0;" but still no go :/ #include "stdafx.h" #include <iostream> using namespace std; // Variables int enemiesKilled; const int KILLS = 150; int score = enemiesKilled * KILLS; int main() { cout << "How many enemies did you kill?" << endl; cin >> enemiesKilled; cout << "Your score: " << score << endl; return 0; }

    Read the article

  • Java: How to I change the color of a specific line or row of string in a Text area?

    - by Kevin
    Hi all, the one way I could change the color is by setForground(). However when there are multiple lines of code it makes everything green or black. Is there another method or any way of solving this problem? Thanks! int key = evt.getKeyCode(); if (key == KeyEvent.VK_ENTER) { String tb1EnterdValue = tb1.getText().toString(); if((tb1EnterdValue.equals("yes")) ) { TextArea1.setForeground(Color.green); else { TextArea1.setForeground(Color.lightGray); } this.TextArea1.append(">"+tb1EnterdValue+newline); this.tb1.setText("");

    Read the article

  • How do I get the users location latitude and longitude?

    - by kevin Mendoza
    I need to access the users location in this method contained in the mainViewController -(void)loadAnnotations{ [mapView removeAnnotations:mapView.annotations]; CLLocationCoordinate2D workingCoordinate; workingCoordinate.latitude= //here i need the users latitude workingCoordinate.longitude= //here i need the users longitude NSLog(@" this is %@", workingCoordinate.latitude); iProspectLiteAnnotation *tempMine = [[iProspectLiteAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:@"Present Location"]; [tempMine setAnnotationType:iProspectLiteAnnotationTypeUser]; [mapView addAnnotation:tempMine]; } however the mainViewController is already set to <fipsideViewControllerDelegate> What should I add to the header file and the implementation file to poll the location Manager for the users current latitude and longitude?

    Read the article

  • EditText and Button on the same line with Textiew underneath?

    - by Kevin
    Hi, I am trying to have an EditText widget next to a button with a text view underneath. The EditText should resize and fill the screen accordingly, while the button's width is always only what it needs to be by setting the width to wrap_content. The layout should not be relative. Below is the code I have so far some of which was found here on StackOverflow. Removing the text view gives the desired appearance for the EditText and button, but when the TextView is added the view goes to ... well. Not sure why the code is not showing? I put it into a < code< pre block without success. http://pastebin.com/WgH6qrTm

    Read the article

  • How do I register a Javascript function to run with every postback?

    - by Kevin
    I have a treeview in a user control. I need to run a javascript function with every synch postback to scroll the div it's in to the right position. I've got it working, but I think there has to be a "cleaner" way to do it. In the Page_Load function of the control, I have the following code. Is there a better way to do it? ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "key" + DateTime.Now.Ticks, "RestorePosition();", true);

    Read the article

  • Codeigniter: URI segments

    - by Kevin Brown
    How do I create an if statement saying something like this? $segment = "segment 2 or 3"; if($segment == 1{ do stuff } I know this is pretty elementary, but I don't totally understand the URI class...

    Read the article

  • How to write multiple files from one NSData object?

    - by Kevin Cupp
    Hi there! I'm writing an iPhone app that includes in-app purchasing. It downloads a zip file, then I unzip the file using the popular NSData category (zlibDeflate) which outputs the uncompressed file into an NSData object. The zip file contains multiple files in it which I need to write to the Documents directory. How can I write each file separately from this one NSData object? writeToFile just writes the whole thing to one file. Thank you and let me know if you need any more information.

    Read the article

  • jQuery: exclude class on click

    - by Kevin Brown
    //Table select $("#reports-table tr").click( function() { var detail_id = $(this).attr('id'); $(this).addClass("selected"); $(this).siblings().removeClass("selected"); $('#reports-right').show().load('/members/details/'+detail_id); $('#reports-table').width(680); } ); I currently am using this code to add a selected class to a table row and show details of the row clicked in a right 'aside'. The problem is, I have action buttons in the row--when they are clicked, becausee they are children of the tr, this function still runs... How can I exclude a certain class?

    Read the article

  • Reducing similar commands

    - by Kevin
    How can I reduce the amount of similar commands into a loop? Something like pictureBox7.BackColor = Color.FromArgb(187, 187, 187); pictureBox9.BackColor = Color.FromArgb(187, 187, 187); pictureBox10.BackColor = Color.FromArgb(187, 187, 187); pictureBox11.BackColor = Color.FromArgb(187, 187, 187); pictureBox12.BackColor = Color.FromArgb(187, 187, 187); pictureBox13.BackColor = Color.FromArgb(187, 187, 187); G2g for now, will add on later.

    Read the article

  • Added a Facebook badge, throwing off footer placement

    - by Kevin
    Added the for the facebook badge to the site and now it's thrown my placement for the footer off .. it's working fine in Chrome, but IE, FFox and Opera all experiencing problems... Here is a screenshot: The footer (brown bar) is supposed to be at the bottom... Here is the CSS : /* footer */ #footer{ background:url(../images/bg-footer.png) no-repeat; height:26px; overflow:hidden; padding:35px 0 0 55px; font-size:11px; } #footer p{ margin:0; display:inline; color:#766623; } #footer ul{ margin:0; padding:0; list-style:none; display:inline; } #footer li{ display:inline; background:url(../images/sep-f-nav.gif) no-repeat 100% 55%; padding:0 6px 0 0; position:relative; } * html #footer li{ padding:0 3px 0 3px; } *+html #footer li{ padding:0 3px 0 3px; } #footer a{ color:#30481f; text-decoration:none; } #footer a:hover{ text-decoration:underline; /*Facebook badge Holder*/ .fb-area{ width:287px; padding:0 0; margin:0 0; min-height:100%; }

    Read the article

  • Is there a file diff tool that allows for exceptions?

    - by Kevin
    We currently use Beyond Compare 3.0 and I am quite pleased with it. However, it would be great if I could easily specify an exclusion for a specific one-time case. This is needed when I am doing a code review of some refactoring. For instance: Old code doSomething(ConstantsInterface.FOOBAR); New code: doSomething(BetterEnumeration.FOOBAR); In this case, I have hundreds of changes that I am reviewing that are essentially all the same exact change and I just want to see the exceptions. It would be great if I could easily specify an exception that indicates these two cases are equal. I know of a way to do it in the grammar, but it is tedious and cumbersome in the case where there are ten or so exceptions. Any other tips?

    Read the article

  • Finding files with bash and copy to another location and reducing depth of folders

    - by Kevin F
    I'm trying to recover a mates hard drive, there is no structure what so ever so music and images are everywhere but in named folders sometimes 5 folders deep, I've managed to write a one-liner that finds the files and copies them to a mounted drive but it preserves the file structure completely. What I'm after is a bit of code that searches the drive and copies to another location and copies just the parent folder with the mp3/jpg files within and not the complete path. The other issue I have is the music is /folder/folder/folder/Artist/1.mp3..2.mp3..10.mp3 etc etc so I have to preserve the folder 'Artist' to give him any hope of finding his tracks again. What I have working currently: find /media/HP/ -name *.mp3 -fprintf /media/HP/MUSIC/Script.sh 'mkdir -p "/media/HP/MUSIC/%h" \n cp "%h/%f" "/media/HP/MUSIC/%h/"\n' I then run the script.sh and it does all the copying. Many Thanks

    Read the article

  • XAML Setter Property to Command

    - by Kevin
    I am trying to call a command when my mouse is over a toggle button. I have the following code. <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Cursor" Value="Hand"></Setter> <Setter Property="Command" Value="{Binding Path=PushPinMouse}" /> </Trigger> When I roll the mouse over, the hand shows. But when i roll the mouse over it doesn't hit my PushPinMouse method.. Why's that?

    Read the article

  • Split text files Accross threads

    - by Kevin
    The problem: I have a few text files (10) with numbers in them on every line. I need to have them split across some threads I create using the pthread library. these threads that are created (worker threads) are to find the largest prime number that gets sent to them (and over all the largest prime from all of the text files). My current thoughts on solutions: I am thinking myself to have two arrays and all of the text files in one array and the other array will contain a binary file that I can read say 1000 lines and send the pointer to the index of that binary file in a struct that contains the id, file pointer, and file position and let it crank through that. a little bit of what I am talking about pthread_create(&threads[index],NULL,calc_sqrt,(void *)threadFields[index]);//Pass struct to each worker Struct: typedef struct threadFields{ int *id, *position; FILE *Fin; }tField; If anyone has any insight or a better solution it would be greatly appreciated Thanks

    Read the article

  • Custom Content-Type for File in Rails 'public' Folder

    - by Kevin Sylvestre
    For assets stored in the 'public' folder of a ruby-on-rails application is it possible to change the 'Content-Type' when running 'script/server'? For example, I am attempting to create an HTML5 application supporting offline mode, and have an 'offline.manifest'. When I run: curl -I localhost:3000/offline.mainfest The following header information is returned: HTTP/1.1 200 OK ... Content-Type: text/plain ... However, HTML5 specifications require: HTTP/1.1 200 OK ... Content-Type: text/cache-manifest ...

    Read the article

  • Jquery change name attribute

    - by kevin
    Hi thereive got a jquery function that attempts to change the id, name and class of an elements the id and class change seems to work but for some curious reason, trying to change the name of the element never works, the code is below, any clues would be helpful $(document).ready(function () { $("table select").live("change", function () { var id = $(this).attr('id'); if ($(this).attr('classname') != "selected") { var rowIndex = $(this).closest('tr').prevAll().length; $.getJSON("/Category/GetSubCategories/" + $(this).val(), function (data) { if (data.length > 0) { $("#" + id).attr('classname', 'selected'); $("#" + id).attr('id', 'sel' + rowIndex); $("#" + id).attr('name', 'sel' + rowIndex); // this never works var position = ($('table').get(0)); var tr = position.insertRow(rowIndex + 1); var td1 = tr.insertCell(-1); var td2 = tr.insertCell(-1); td1.appendChild(document.createTextNode('SubCategory')); var sel = document.createElement("select"); sel.name = 'parent_id'; sel.id = 'parent_id'; sel.setAttribute('class', 'unselected'); td2.appendChild(sel); $.each(data, function (GetSubCatergories, Category) { $('#parent_id').append($("<option></option>"). attr("value", Category.category_id). text(Category.name)); }); } }); } }); });

    Read the article

  • MySql - set of time stamped data (timestamp,event) calculating events per day

    - by Kevin Ohashi
    I have a table: id, datetime, event i also have table dates: date (Y-m-d format) the problem is some days don't have any events, I would like them to show 0 (or null) SELECT DATE_FORMAT(table.timestamp, '%Y-%m-%d') ydm, count(table.fkUID) FROM `table` where table.fkUID=$var group by ydm; is there some way to join or use conditional statements to make the result show: date|count ---------- 2010-05-23| 5 2010-05-24| 0 <--- this line just doesn't exist in my query. 2010-05-26| 3

    Read the article

  • Zend_Paginator / Doctrine 2

    - by Kevin
    I'm using Doctrine 2 with my Zend Framework application and a typical query result could yield a million (or more) search results. I want to use Zend_Paginator in line with this result set. However, I don't want to return all the results as an array and use the Array adapter as this would be inefficient, instead I would like to supply the paginator the total amount of rows then and array of results based on limit/offset amounts. Is this doable using the Array adapter or would I need to create my own pagination adapter?

    Read the article

  • Javascript problem when setting src for img element in FireFox - string parsing error?

    - by Kevin
    I'm having problems with image's on the page. I'm using Javascript to create the elements, and in FireFox it seems the string that I'm using to set the innerHTML is not being parsed correctly. I'll see this when the server page is requested with invalid GET variables. They look like this (from the PHP script's error handler): GET[] = Array ( [shrink] => true [file_id] => \' file_id \' [refresh] => \' now.getTime() \' ) This only happens for about 5% of requests, which is making it difficult to solve. I have been able to reproduce this myself in FireFox, and Firebug will show that the URL it is trying to fetch is: https://www.domain.com/secure/%27%20+%20image_src%20+%20%27 I read somewhere that it might be related to FireFox prefetching content (can't find it googling now), since it seems to only happen on FireFox. Disabling prefetching in about:config does prevent the problem from occurring, but I'm looking for another solution or workaround that doesn't involve end users changing their configurations. Here's the specifics and code: I have an empty table cell on an HTML page. In JQuery's $(document).ready() function for the page, I used JQuery's $.ajax() method to get some data from the server about what should be in that cell. It returns the file_id variable, which for simplicity I just set below. It then sets the empty table cell to have an image with src that points to a page that will serve the image file depending on what file_id is passed. This part of the code was JQuery originally, so I changed it to straight Javascript but that didn't help anything. //get data about image from server //this is actually done through JQuery's $.ajax() but you get the idea var file_id = 12; //create the src for the img //the refresh is to prevent the image from being cached ever, since the page's //javascript will be it changes //during the course of the page's life var now = new Date(); var image_src = 'serve_image.php?shrink=true&file_id=' + file_id + '&refresh=' + now.getTime(); //create document.getElementById('image_cell').innerHTML = '<A target="_blank" href="serve_image.php?file_id=' + file_id + '">' + '<IMG id=image_element src="' + image_src + '" alt="Loading...">' + '</A>';` Any help would be greatly appreciated. Thanks!

    Read the article

  • Problems using Custom Layout in XML

    - by Kevin
    I've created a new GridLayout class that I want to use in an XML File. The class is in another project. I've created the attrs.xml file in the other project with my properties but when the constructor gets called with the AttributeSet, none of the values are set. In my xml for my screen layout, I refer to the layout with the following: xmlns:gridLayout="@com.mastertechsoftware.AndroidUtil:http://schemas.android.com/apk/res/com.mastertechsoftware.AndroidUtil" Not sure if that is right. I have the attrs.xml file being compiled to R.java in com/mastertechsoftware/AndroidUtil. All the right styleable values are there. In my constructor, I use: TypedArray a = c .obtainStyledAttributes(attrs, R.styleable.GridLayout); this.numRows = a.getInt(R.styleable.GridLayout_numRows, -1); Nothing comes back (-1 does but that means nothing is there) If I use int n = a.getIndexCount(); I get 0.

    Read the article

  • wxPython formatting questions

    - by Kevin
    I have an app I was working on to learn more about wxPython( I have been primarily been a scripter ). I forgot about it now I am opening it back up. It's a screen scraper, and I have it working almost the way I want it, going to build a regex parser to strip out the links in every scrape that I don't need. The questions I have are this. In it current state, if I check more than one site, it goes out and scrapes, and returns it in separate windows, the for:each section in the Clicked function. I want to put them in a frame, in the window, altogether. I also want to know if I can take the list they are read into and send it to a checklist, so someone could check off separate items, I want to build a save function and keep certain ones. In regards to a save function, I want to keep saved checks, are there calls to the widgets to save their states? I know it's a lot, but thanks for the help.

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >