Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 118/191 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • PHP - How can I check if return() was called from an include()'d file?

    - by John Himmelman
    How can I tell if return() was called from within the included file. The problem is that include() returns 'int 1', even if return() wasn't called. Here is an example... included_file_1.php <?php return 1; included_file_2.php <?php echo 'no return here, meep'; main.php <?php $ret = include('included_file_1.php'); // This file DID return a value, int 1, but include() returns this value even if return() wasn't called in the included file. if ($ret === 1) { echo 'file did not return anything'; } var_dump($ret); $ret = include('included_file_2.php'); // The included file DID NOT return a value, but include() returns 'int 1' if ($ret === 1) { echo 'file did not return anything'; } var_dump($ret);

    Read the article

  • android widget unresponsive

    - by John
    I have a widget that you press and it then it will update the text on the widget. I have set an on click listener to launch another activity to perform the text update, But for some reason it only works temporarily and then it will become unresponsive and not do anything when pressed. Does anyone know why it might be doing that? i have posted my widget code below in case it is helpful. @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) { thisWidget = new ComponentName(context, MemWidget.class); Intent intent = new Intent(context, updatewidget.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); // Get the layout for the App Widget and attach an on-click listener to the button RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); views.setOnClickPendingIntent(R.id.ImageButton01, pendingIntent); // Tell the AppWidgetManager to perform an update on the current App Widget appWidgetManager.updateAppWidget(thisWidget, views); } @Override public void onReceive(Context context, Intent intent) { appWidgetManager = AppWidgetManager.getInstance(context); remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); thisWidget = new ComponentName(context, MemWidget.class); // v1.5 fix that doesn't call onDelete Action final String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { super.onReceive(context, intent); } }

    Read the article

  • How to add value to second column using wxListCtrl in wxWidgets (C++ code)??

    - by azm882
    I've following code: int column_width = 100; long indx1 = alist-InsertColumn(0, L"User Name", wxLIST_FORMAT_LEFT, column_width); long indx2 = alist-InsertColumn(1, L"User Id", wxLIST_FORMAT_LEFT, column_width); long itemIndex1 = alist-InsertItem(indx1, L"John Smith", -1); alist-SetItem(indx1, 1, L"jsmith"); I expect to see two columns with User Name and User Id as heading with "My Name" and "My Id" as values on the first row. Instead I only see "John Smith" under column User Name but nothing under User ID column. Here is a link to the snapshot showing the result: http://drop.io/agtyt6s Thanks!

    Read the article

  • In Java, is it possible for a super constructor invocation actually invoke a constructor in the calling class?

    - by John Assymptoth
    Super constructor invocation definition: [Primary.] [NonWildTypeArguments] super ( ArgumentListopt ) ; A super constructor call can be prefixed by an Primary expression. Example (taken from JLS): class Outer { class Inner{ } } class ChildOfInner extends Outer.Inner { ChildOfInner() { (new Outer()).super(); // (new Outer()) is the Primary } } Does a Primary expression exist that makes the call to super() the invocation of a constructor of the calling class? Or Java prevents that?

    Read the article

  • How do you have grayed out text in a textfield that dissapears when the user clicks on it

    - by John Smith
    In HTML & JS, how do you make a textfield that has grayed out text telling the user what the field is for that goes away when the user clicks on the field? For example, in firefox the search field in the top right hand side says which search engine it uses when there's nothing entered, then once you click it's an empty textfield, but if you leave it blank and remove focus from the textfield then the grayed out text is back again. Is there a name for this behavior? Also, is it possible to do in pure css without the use of js to do the on focus / on blur events?

    Read the article

  • Rewriting .each() loop as for loop to optimize, how to replicate $(this).attr()

    - by John B
    I running into some performance issues with a jquery script i wrote when running in ie so I'm going through it trying to optimize any way possible. Apparently using for loops is way faster than using the jQuery .each method. This has led me to a question regarding the equivalent of $(this) inside a for loop. I'm simplifying what I'm doing in my loop down to just using an attr() function as it gets across my main underlying question. Im doing this with each(simplified) var existing = $('#existing'); existing.each(function(){ console.log($(this).attr('id')); }); And I've tried rewriting it as a for loop as such: var existing = $('#existing'); for(var i = 0;i < existing.length;i++) { console.log(existing[i].attr('id')); } Its throwing an error saying: Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr' Thanks.

    Read the article

  • MySQL - Calculate the net time difference between two date-times while excluding breaks?

    - by John M
    In a MySQL query I am using the timediff/time_to_sec functions to calculate the total minutes between two date-times. For example: 2010-03-23 10:00:00 - 2010-03-23 08:00:00 = 120 minutes What I would like to do is exclude any breaks that occur during the selected time range. For example: 2010-03-23 10:00:00 - 2010-03-23 08:00:00 - (break 08:55:00 to 09:10:00) = 105 minutes Is there a good method to do this without resorting to a long list of nested IF statements?

    Read the article

  • Migrating away from Clearcase

    - by John Clark
    We are migrating from Clearcase to another VCS (probably either SVN or Mercurial). For companies that have made this transition, what factors did they find important in selecting another VCS tool, and what practices did they find eased the transition?

    Read the article

  • Countdown timer using jquery or google app engine ?

    - by john
    hi everybody, I need to do a countdown clock, that counts down the days, hours, minutes and seconds that are left to a date of my choice,Using jquery or google app engine(Python). I created a timer using Javascript,But in that i used system time. I need to use server time.Can any body give me ideas to build up a count down Timer using server UTC time.

    Read the article

  • Django Show M2M field in both model forms

    - by John
    Hi I am using the forms.ModelForm to create my form. I want to be able to show the manytomany field in both model forms, how do I do this? If the manytomany relationship is defined in the model it is fine and just appears but if it is not in the model (but is still linked via the other model) it does not appear. Hope this makes sense. How can I make it show up? Thanks

    Read the article

  • unwanted space before and after nested html table using Internet Explorer 8

    - by John
    I have an html table nested in an html table cell. I want the nested table to use the full size of the cell it is nested in. When I use firefox or google chrome I get the result I want but when I use Internet Explorer 8 (even if I use td style="height="100%") the height of the nested cell depends on it's content. As a result I get whitespace before and after my nested table.

    Read the article

  • jQuery - getting the id of the item selected

    - by John Leonard
    I have a basic jQuery selector question. Let's say I'm parsing JSON and generating a row of data for each item in my result set. On each item row, I want an action button. What is the best practice to script that button so its click action can reference the data specific to that row? Starting with the block below, how do I generate a 'Click Me' button that when clicked will alert with its json data? $.getJSON(url,params,function(json){ if(json.items){ $.each(json.items, function(i, n){ var item = json.items[i];

    Read the article

  • Can I have a CASE statement within a WHILE loop?

    - by John
    This is what I'm doing: while (@counter < 3 and @newBalance >0) begin CASE when @counter = 1 then ( @monFee1 = @monthlyFee, @newBalance = @newBalance-@fee) when @counter = 2 then ( @monFee2 = @monthlyFee, @newBalance = @newBalance-@fee) END @counter = @counter +1 end I get this error: Incorrect syntax near the keyword 'CASE'. No idea why. Please help!

    Read the article

  • Best way to simulate a domain?

    - by John Isaacks
    I am going to build a website on a test server that will behave differently depending on which domain is used to access it (The real website will have multiple domains pointing to it). But how will I be able to simulate the different domains on the test server?

    Read the article

  • Where is the best place to call the .tolist(); inside my controller classes or inside my model repository classes

    - by john G
    I have the following action method, inside my asp.net mvc web application:- public JsonResult LoadZoneByDataCenter(string id) { var zonelist = repository.getrealtedzone(Convert.ToInt32(id)).ToList(); //code goes here Which calls the following model repository method:- public IQueryable<Zone> getrealtedzone(int? dcid) { return tms.Zones.Where(a=> a.DataCenterID == dcid || dcid == null); } Currently I am calling the .tolist() which will interpret the Database from my action method, but my question is where is the best place to call the .tolist() inside the controller or inside the model classes and why ? thanks

    Read the article

  • Advantage to parsing Excel Spreadsheet data vs. CSV?

    - by john
    I have tabulated data in an Excel spreadsheet (file size will likely never be larger than 1 mb). I want to use PHP to parse the data and insert in to a MySQL database. Is there any advantage to keeping the file as an .xls/.xlsx and parsing it using a PHP Excel Parsing Library? If so, what are some good libraries to use? Obviuously, I can save the .xls/.xlsx as a CSV and handle the file that way. Thanks!

    Read the article

  • Library to parse C/C++ source code

    - by John
    Which library should I use to parse C/C++ source code file? I need to parse source file, calculate how much useful strings inside, how much 'for' blocks, 'if' blocks, how much comments inside. I also may need to insert a comment or small piece of code after each 'for' block. Is there any libraries? May be any library included in Microsoft Visual Studio?

    Read the article

  • Should I move client to Lamp or develop on Wamp?

    - by John Isaacks
    I have never developed for WAMP, the hosting guy for my new client says they are using Windows servers, they can setup PHP and MySQL for me, but they cannot switch to a *nix server. He said there are some nuances from PHP on *nix Vs. win. So my question is, if I have never programmed PHP on win, should I go through the hassle of switching hosts (since they cannot do *nix themselves), or are the differences slight enough that it shouldn't be too big a problem for me? (side note: the state of the clients website has no effect since it is a static all-flash site and is going to be completely rebuilt) Thanks!

    Read the article

  • Checking deployed port in ruby on rails application

    - by john chan
    Is there an elegant way to check which port you deployed a ruby on rails application using mongrel? I could not find a directive (i.e. such as #{RAILS_ROOT} which contains the root directory of the application) that I can use to perform a check. I need this to do a check since I am deploying the same application on different ports and I need the app to do different things according to the port that is being accessed. Any help would be appreciated, Thanks

    Read the article

  • javascript error listener

    - by John Doe
    hi all i try using window.attachEvent (or addEventListener) to capture js errors my callback function gets only one event parameter my question is: how do i get line number and source file of the error from this event? the alternative usage window.onerror=callback; works but an event listener has other benefits thus im giving it a try

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >