Search Results

Search found 2762 results on 111 pages for 'michael turner'.

Page 77/111 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • PHP array value becomes blank. What is going on?

    - by Michael Bruce
    I have written a web page that works fine expect for some weird behavior. The code below gets all expected values and populates them correctly except for $v-data["quick_phone_id"] and $v-data["quick_email_id"] which are integers. Those values come out blank in the string I am creating. The value for $v-data["id"] is another integer and works as expected. My only clue is that when I uncomment the commented out line, the code works properly. So I'm guessing this has to do with referencing getting broken for the array. Any ideas? I'd like to fix my code and my PHP knowledge. $contacts = ContactInfo::loadMyContacts($userId); $sb = new StringBuilder(); $idx = 0; //$vals = "vals: ".$contacts[0]->data["quick_phone_id"]; $sb->append(' dataRows = ['); foreach($contacts as $k => $v) { $sb->append('{ id:"'.strval($v->data["id"]).'",'); $sb->append('url:"edit_contact.php?id='.$v->data["id"].'",'); $sb->append('gname:"'.$v->data["given_name"].'",'); $sb->append('fname:"'.$v->data["family_name"].'",'); $sb->append('phone1id2:"'.strval($v->data["quick_phone_id"]).'",'); $sb->append('phone1type:"'.$v->data["quick_phone_type"].'",'); $sb->append('phone1:"'.$v->data["quick_phone"].'",'); $sb->append("email1id2:'".strval($v->data["quick_email_id"])."',"); $sb->append('email1type:"'.$v->data["quick_email_type"].'",'); $sb->append("email1:'".$v->data["quick_email"]."',"); $sb->append("dirty:false },\n"); } $sb->append('];');

    Read the article

  • SqlCE DB occasionally freezes on one handheld, not another

    - by Michael
    I have two types of custom handhelds which are similar, but slightly different, each running the same WinForm application and a WinCE database: Type 1: WinCE 4.2, 400 mhz, 93244 kb Type 2: WinCE 5.0, 520 mhz, 84208 kb Type 1 will happily proceed through a large batch db operation (initiated) by the app, by Type 2 will consistently begin c-r-a-w-l-i-n-g (for several to many cycles) at around the 200 cycle mark. As several points it will begin running normally and then crawl again. The app does several db op's (inserts, updates and selects, no deletes). To simplify my situation, I've built a small test app which essentially does this: command_s.CommandText = "select dvr from vr where vid = 2211250"; command_u.CommandText = "update pvr set LocationID=81 where Status='OK' and vri = 27861"; while(going) { command_s.ExecuteScalar(); command_u.ExecuteNonQuery(); } and set it off running on the two units side by side. Sure enough, the slower (400 mhz) unit is outpacing the faster (520 mhz) unit (it's about 5000 cycles ahead right now) and I can see noticable pauses on the 520 mhz unit. What is causing this?

    Read the article

  • iPhone apps for company-internal use - possible?

    - by Michael Stum
    I hope this is still programming related, as SuperUser doesn't seem the appropriate place. Basically I wonder if it is possible to have Applications that are internal to a company on the iPhone? That is something like a companion Application to an Intranet (when Safari and Mail just don't cut it) which wouldn't make sense on the AppStore (and likely wouldn't get approved anyway). Is something like that possible (without Jailbreaking or doing anything else that Apple doesn't normally want)?

    Read the article

  • How is it possible to extend an SWFLoader with MXML?

    - by michael-cereda
    I'm currently doing the following.. Main application: " " In the Component: First Try: ]]> </fx:Script> <fx:Declarations></fx:Declarations> <mx:SWFLoader x="0" y="0" id="loader"/> </s:Group> Second Try: <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ [Bindable] public var source:String; ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <mx:SWFLoader x="0" y="0" source="{source}"/> </s:Group> But the component displays only a "Not Found" icon in both cases. Thanks

    Read the article

  • Getting the first of a GROUP BY clause in SQL

    - by Michael Bleigh
    I'm trying to implement single-column regionalization for a Rails application and I'm running into some major headaches with a complex SQL need. For this system, a region can be represented by a country code (e.g. us) a continent code that is uppercase (e.g. NA) or it can be NULL indicating the "default" information. I need to group these items by some relevant information such as a foreign key (we'll call it external_id). Given a country and its continent, I need to be able to select only the most specific region available. So if records exist with the country code, I select them. If, not I want a records with the continent code. If not that, I want records with a NULL code so I can receive the default values. So far I've figured that I may be able to use a generated CASE statement to get an arbitrary sort order. Something like this: SELECT *, CASE region WHEN 'us' THEN 1 WHEN 'NA' THEN 2 ELSE 3 END AS region_sort FROM my_table WHERE region IN ('us','NA') OR region IS NULL GROUP BY external_id ORDER BY region_sort The problem is that without an aggregate function the actual data returned by the GROUP BY for a given row seems to be untameable. How can I massage this query to make it return only the first record of the region_sort ordered groups?

    Read the article

  • How do you manage tasks within your work?

    - by Michael
    Just wondering how you all manage your workload effectively when there's a lot of your plate? What do you do to break it down into bite-size chunks and how do you track progress of each task? Do you find TDD helps to focus your attention of getting areas of functionality complete before moving onto the next one? I quite often find myself getting a bit overwhelmed when I have an involving task on the go (even if it can be broken down into lots of small chunks), even though I know I'm more than capable of doing the work. We have a kind of agile approach Interested to hear how everyone manages things effectively.

    Read the article

  • Using Range Function

    - by Michael Alexander Riechmann
    My goal is to make a program that takes an input (Battery_Capacity) and ultimately spits out a list of the (New_Battery_Capacity) and the Number of (Cycle) it takes for it ultimately to reach maximum capacity of 80. Cycle = range (160) Charger_Rate = 0.5 * Cycle Battery_Capacity = float(raw_input("Enter Current Capacity:")) New_Battery_Capacity = Battery_Capacity + Charger_Rate if Battery_Capacity < 0: print 'Battery Reading Malfunction (Negative Reading)' elif Battery_Capacity > 80: print 'Battery Reading Malfunction (Overcharged)' elif float(Battery_Capacity) % 0.5 !=0: print 'Battery Malfunction (Charges Only 0.5 Interval)' while Battery_Capacity >= 0 and Battery_Capacity < 80: print New_Battery_Capacity I was wondering why my Cycle = range(160) isn't working in my program?

    Read the article

  • Crosstab with multiple items

    - by Michael Wexler
    In SPSS, it is (relatively) easy to create a cross tab with multiple variables using the factors as the table heading. So, something like the following (made up data, etc.). Q1, Q2, and Q3 each have either a 1, a 2, or a 3 for each person. 1 (very Often) 2 (Rarely) 3 (Never) Q1. Likes it 12 15 13 Q2. Recommends it 22 11 10 Q3. Used it 22 12 9 In SPSS, one can even request row, column, or total percentages. I've tried table(), ftable(), xtab(), CrossTable() from gmodels, and CrossTable() from descr, and none of these can handle (afaik) multiple variables; they mostly seem to handle 1 variable crossed with another variable, and the 3rd creates layers. Is there a package with some good cross tabbing/table examples that I could use to figure this out? I'm sure I'm missing something simple, so I appreciate you pointing out what I missed. Perhaps I have to generate each row as a separate list and then make a dataframe and print the dataframe?

    Read the article

  • php preg_replace, regexp

    - by Michael
    I'm trying to extract the postal codes from yell.com using php and preg_replace. I successfully extracted the postal code but only along with the address. Here is an example $URL = "http://www.yell.com/ucs/UcsSearchAction.do?scrambleSeed=17824062&keywords=shop&layout=&companyName=&location=London&searchType=advance&broaderLocation=&clarifyIndex=0&clarifyOptions=CLOTHES+SHOPS|CLOTHES+SHOPS+-+LADIES|&ooa=&M=&ssm=1&lCOption32=RES|CLOTHES+SHOPS+-+LADIES&bandedclarifyResults=1"; //get yell.com page in a string $htmlContent = $baseClass-getContent($URL); //get postal code along with the address $result2 = preg_match_all("/(.*)/", $htmlContent, $matches); print_r($matches); The above code ouputs something like Array ( [0] = Array ( [0] = 7, Royal Parade, Chislehurst, Kent BR7 6NR [1] = 55, Monmouth St, London, WC2H 9DG .... the problem that I have is that I don't know how to extract the the postal code because it doesn't have an exact number of digits (sometimes it has 6 digits and sometimes has only 5 times). Basically I should extract the lasted 2 words from each array . Thank you in advance for any help !

    Read the article

  • Why do some people prefer "T const&" over "const T&"?

    - by Michael Aaron Safyan
    So, I realize that const T& and T const& are identical and both mean a reference to a const T. In both cases, the reference is also constant (references cannot be reassigned, unlike pointers). I've observed, in my somewhat limited experience, that most C++ programmers use const T&, but I have come across a few people who use T const&. Is this just a personal preference? Why is one chosen over the other?

    Read the article

  • jQuery Validation Custom Message Before Listing Errors

    - by Michael
    I am looking to add a custom message before listing my errors for a login page: "Oops, you forgot to enter the following:" + "Username", "Password" (if both not entered) or "Oops, you forgot to enter the following:" + "Username" (if just username not entered) $(document).ready(function(){ $("#loginForm").validate({ errorLabelContainer: $('#RegisterErrors'), messages: { username: "Username", password: "Password" } }); }); With this in my HTML <div id="RegisterErrors">

    Read the article

  • Should uni provide "correct answer" after programming assignment is due?

    - by Michael Mao
    Hi all: This is my very first subjective question. And I think it is programming related - the assignment is to be written in a programming language. I am not for "getting the full marks out of a subject". I am actually not for a "correct answer", but for a "better solution", so that I can compare, and can improve. I reckon it is good that I practice programming first and check the solution later to pick up the things I've done wrong/bad. Without a "benchmark" to against, this would be much harder. Unfortunately as far as I know, not all programming subjects taught in uni would kindly provide the students with a "correct answer" in the end, after the assignment is due. One bad metaphor for this is like someone asks you a question which they don't have a clear answer themselves and hope to take advantage of your answer as the basis for their answer. Personally, I feel having a assignment solution provided by the academic staff is essential to students. I do appreciate this, and I feel I might not be the only one. I am a very proactive student in uni. I learn more, I practice more, an assignment for me is more like a challenge to achieve "the best solution I can come up with", not something "I have to pass"... The cause of this question is that for the past few days I have crafted 500+ lines of Perl code, for a tiny assignment. I feel pain when I look at my solution(not finished yet) and I feel like I am an idiot doing some crap code. I know there must be a much better solution. And I reckon it is better for the lecturer in this subject to get me one, rather than asking for an answer here, even I would shamelessly add the link to my solution apart from the assignment requirements. I know in SO, there are a lot of tutors/lecturers for programming subjects/courses. I'd like to hear your words on this question.

    Read the article

  • Animation of UINavigationController's UIToolbar

    - by Michael Waterfall
    When presenting a view controller that has toolbar items, is it possible for the toolbar to slide in with the view controller (i.e. slide in from the right) as opposed to it sliding from the bottom? In the view controller that is being presented, I've got the toolbar being shown within the -viewWillAppear: method, but the toolbar is being slid up from the bottom of the screen as opposed to it looking like it belongs to the view controller. - (void)viewWillAppear:(BOOL)animated { [self.navigationController setToolbarHidden:NO animated:YES]; ... }

    Read the article

  • Where is the taglib definition of PrimeFaces 4?

    - by Michael Wölm
    I am looking around how to define custom components in JSF. According to the Java EE tutorial, any custom component needs to be described in a taglib. When I take a look into the PrimeFaces source, I cannot find any taglib file or any hint where the namespace is bound and the available components are defined. I am adding primefaces jar to my dependencies, adding xmlns:p="http://primefaces.org/ui to the xml namespace, defining some primfaces components on my page and it works... Ok, but neither I can find the related taglib in the source or binary package nor my IDE (IntelliJ) is able to find where "xmlns:p="http://primefaces.org/ui" is pointing to. Therefore, code completion is also not possible. (all other mojarra taglibs are found.) Is it possible that PrimeFaces is defining the taglib via annotations directly in Java classes or is it generating it during runtime? I can easily find the UIComponents, primefaces defines in its source, but the configuration of the taglib seems to be missing. I am sure I just don't know how PrimeFaces is doing it, but the javaeetutorial is not describing any other opportunity than defining a ...-taglib.xml

    Read the article

  • Using beautifulsoup to extract text between line breaks (e.g. <br /> tags)

    - by Michael Altman
    I have the following HTML that is within a larger document <br /> Important Text 1 <br /> <br /> Not Important Text <br /> Important Text 2 <br /> Important Text 3 <br /> <br /> Non Important Text <br /> Important Text 4 <br /> I'm currently using BeautifulSoup to obtain other elements within the HTML, but I have not been able to find a way to get the important lines of text between <br /> tags. I can isolate and navigate to each of the <br /> elements, but can't find a way to get the text in between. Any help would be greatly appreciated. Thanks.

    Read the article

  • Capistrano + Git + DreamHost

    - by Michael Sync
    Hello, I'm trying to deploy my rails application by using Passenger and Capistrano on Dreamhost. I'm using Git as a version control and we bought an account from GitHub. I have installed all required gems, Passenger and Capistrano in my local machine and I have cloned the repository of my project from GitHub in my local machine as wel. According to Dreamhost support, they have Passenger, Ruby, Rails and etc on their server as well. I'm currently following this article http://github.com/guides/deploying-with-capistrano for my deployment. The following is my deploy.rb. default_run_options[:pty] = true ssh_options[:forward_agent] = true # be sure to change these set :user, 'gituser' set :domain, 'github.com' set :application, 'MyProjectOnGit' #[email protected]:MyProjectOnGit.git # the rest should be good set :repository, "[email protected]:MyProjectOnGit.git" set :deploy_to, "/ruby.michaelsync.net/" set :deploy_via, :remote_cache set :scm, 'git' set :branch, 'master' set :git_shallow_clone, 1 set :scm_verbose, true set :use_sudo, false set :git_enable_submodules, 1 server domain, :app, :web role :db, domain, :primary => true set :ssh_options, { :forward_agent => true } namespace :deploy do task :restart do run "touch #{current_path}/tmp/restart.txt" end end When I run "cap deploy", I'm getting the error below. [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: github.com (Net::SSH::AuthenticationFailed: gituser) connection failed for: github.com (Net::SSH::AuthenticationFailed: gituser) Thanks in advance..

    Read the article

  • jQuery Validation - Highlighting Radio Labels

    - by Michael
    I'm trying to use jQuery validation to highlight the labels for my radio buttons only, and not the labels for my other inputs. I have a label for my radio button set called 'type'. I can't seem to get it to work! $(document).ready(function(){ $("#healthForm").validate({ highlight: function(element, errorClass) { $(element).addClass(errorClass) $(element.form).find("label[for='type']") .addClass("radioerror"); }, unhighlight: function(element, errorClass) { $(element).removeClass(errorClass) $(element.form).find("label[for='type']") .removeClass("radioerror"); }, errorPlacement: function(error, element) { } }); });

    Read the article

  • Why does instanceof seem to work in a static generic function sometimes?

    - by michael
    Greetings. This is my first post in this site. I thought that because of type erasure, one could not expect the following code to compile, and indeed, it did not compile on an earlier version of Eclipse. My understanding was that instanceof was a run-time operator and could not know about the generic type which would be, by run-time, compiled away: public static <E extends Comparable<? super E>> void SampleForQuestion(E e) { if ( !(e instanceof String) ) System.out.println("I am not a String"); else System.out.println("I am a String"); } However, I was surprised to see that one of your threads actually included some code like this in an answer, and my latest Eclipse (Galileo on Windows with JVM 1.6 rev 20) is perfectly happy with it -- and it works, too. (I did notice that someone said it worked on Eclipse but not in another IDE/JDK in that thread, but don't remember the specifics.) Can someone explain why it works, and more importantly, because I have to guide my students, whether it should be expected to work in the future. Thank you. (I hope the code formatting comes through correctly - it looks indented correctly from my perspective and there are no tabs.)

    Read the article

  • How do I upload a files to google app engine app when field name is not known

    - by Michael Neale
    I have tried a few options, none of which seem to work (if I have a simple multipart form with a named field, it works well, but when I don't know the name I can't just grab all files in the request...). I have looked at http://stackoverflow.com/questions/81451/upload-files-in-google-app-engine and it doesn't seem suitable (or to actually work, as someone mentioned the code snipped it untested).

    Read the article

  • How make decides to build target

    - by Michael
    One sign is that target does not exist, understand this. Another is by comparing modification timestamp of target and prerequisites. How it works in more details? What is the logic of comparing target and prerequisite timestamps and how it works when there are multiple prerequisites?

    Read the article

  • ASP MVC dynamic fields in editor

    - by Michael Pardo
    I have a form which will include some optional questions that need to asked of the user. In my model it may look like pubic Dictionary<String, String> Questions { get; set; } where the key is the label and value is the text box. How can I create and populate controls for this? I'm new to ASP MVC, but it makes sense that something like this would be built in. Is there a built in way to do this, or do I have to implement it myself? It seems like there should be a helper for it, since you don't really want to put this kind of code in the view. I've tried Html.EditorFor(model => model.Questions); but it just spits out "[key, value]" to the view.

    Read the article

  • CSS Hidden DIV Form Submit

    - by Michael
    Using CSS, when a link is clicked it brings up a hidden DIV that contains a form. The user will then enter information and then submit the form. I'd like the hidden DIV to remain visisble, and a 'success message' to be displayed after submission. Then the user will have the option of closing the DIV. I can't get it to work without reloading the page, which causes the DIV to become hidden again. Any ideas? <body> <a href="javascript:showDiv()" style="color: #fff;">Click Me</a> <!--POPUP--> <div id="hideshow" style="visibility:hidden;"> <div id="fade"></div> <div class="popup_block"> <div class="popup"> <a href="javascript:hideDiv()"> <img src="images/icon_close.png" class="cntrl" title="Close" /> </a> <h3>Remove Camper</h3> <form method="post" onsubmit="email.php"> <p><input name="Name" type="text" /></p> <p><input name="Submit" type="submit" value="submit" /></p> </form> <div id="status" style="display:none;">success</div> </div> </div> </div> <!--END POPUP--> <script language=javascript type='text/javascript'> function hideDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'hidden'; } else { // IE 4 document.all.hideshow.style.visibility = 'hidden'; } } } function showDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'visible'; } else { // IE 4 document.all.hideshow.style.visibility = 'visible'; } } } </script> </body>

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >