Search Results

Search found 2571 results on 103 pages for 'extend'.

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

  • Extend legacy site with another server-side programming platform best practice

    - by Andrew Florko
    Company I work for have a site developed 6-8 years ago by a team that was enthusiastic enough to use their own private PHP-based CMS. I have to put dynamic data from one intranet company database on this site in one week: 2-3 pages. I contacted company site administrator and she showed me administrative part - CMS allows only to insert html blocks & manage site map (site is deployed on machine that is inside company & fully accessible & upgradeable). I'm not a PHP-guy & I don't want to dive into legacy hardly-who-ever-heard-about CMS engine I also don't want to contact developers team, 'cos I'm not sure they are still present and capable enough to extend this old days site and it'll take too much time anyway. I am about to deploy helper asp.net site on IIS with 2-3 pages required & refer helper site via iframe from present site. New pages will allow to download some dynamic content from present site also. Is it ok and what are the pitfalls with iframe approach?

    Read the article

  • Extend footer wrap to width of page.

    - by hawkeye126
    I've made a footer wrap outside the content wrap (which everything else is in). I would like to make the footer wrap extend to fill the width of the page and I would like it to be fixed on the bottom. Here's the code: footerWrap { background-color:#000; width: auto; } footer { margin: auto; text-align:center; width:965px; height:150px; background-color:#000; border:#000 inset medium; } The website is item9andthemadhatters.com please let me know if you need any other code or info. Thanks!! update: html { padding:0; height:100%; width: 100%; } body{ margin: -1px 0 0 0; background-color:#FFF; font-family: calibri; background-image:url(images/item9HeaderSideFiller.gif); background-repeat: repeat-x; padding:0; height:100%; width: 100%; } wrap { width: 965px; margin:auto auto; min-height:462px; max-height:4000 px; footerWrap { background-color:#000; position:absolute; bottom:0; width:100% } footer { margin: auto; text-align:center; width:965px; height:150px; background-color:#000; } }

    Read the article

  • Android Extend BaseExpandableListAdapter

    - by Robert Mills
    I am trying to extend the BaseExpandableListAdapter, however when once I view the list and I select one of the elements to expand, the order of the list gets reversed. For example, if I have a list with 4 elements and select the 1st element, the order (from top to bottom) is now 4, 3, 2, 1 with the 4th element (now at the top) expanded. If I unexpand the 4th element the order reverts to 1, 2, 3, 4 with no expanded elements. Here is my implementation:`public class SensorExpandableAdapter extends BaseExpandableListAdapter { private static final int FILTER_POSITION = 0; private static final int FUNCTION_POSITION = 1; private static final int NUMBER_OF_CHILDREN = 2; ArrayList mParentGroups; private Context mContext; private LayoutInflater mInflater; public SensorExpandableAdapter(ArrayList<SensorType> parentGroup, Context context) { mParentGroups = parentGroup; mContext = context; mInflater = LayoutInflater.from(mContext); } @Override public Object getChild(int groupPosition, int childPosition) { // TODO Auto-generated method stub if(childPosition == FILTER_POSITION) return "filter"; else return "function"; } @Override public long getChildId(int groupPosition, int childPosition) { return childPosition; } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { if(convertView == null) { //do something convertView = (RelativeLayout)mInflater.inflate(R.layout.sensor_row_list_item, parent, false); if(childPosition == FILTER_POSITION) { ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText("Add Filter"); } else { ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText("Add Function"); ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setEnabled(false); } } return convertView; } @Override public int getChildrenCount(int groupPosition) { // TODO Auto-generated method stub return NUMBER_OF_CHILDREN; } @Override public Object getGroup(int groupPosition) { return mParentGroups.get(groupPosition); } @Override public int getGroupCount() { // TODO Auto-generated method stub return mParentGroups.size(); } @Override public long getGroupId(int groupPosition) { // TODO Auto-generated method stub return groupPosition; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if(convertView == null) { convertView = mInflater.inflate(android.R.layout.simple_expandable_list_item_1, parent, false); TextView tv = ((TextView)convertView.findViewById(android.R.id.text1)); tv.setText(mParentGroups.get(groupPosition).toString()); } return convertView; } @Override public boolean hasStableIds() { // TODO Auto-generated method stub return true; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { // TODO Auto-generated method stub return true; } } ` I just need to take a simple ArrayList of my own SensorType class. The children are the same for all classes, just two. Also, how do I go about making the parent in each group LongClickable? I have tried in my ExpandableListActivity with this getExpandableListView().setOnLongClickableListener() ... and on the parent TextView set its OnLongClickableListener but neither works. Any help on either of these is greatly appreciated!

    Read the article

  • Cannot extend a class located in another file, PHP

    - by NightMICU
    I am trying to set up a class with commonly used tasks, such as preparing strings for input into a database and creating a PDO object. I would like to include this file in other class files and extend those classes to use the common class' code. However, when I place the common class in its own file and include it in the class it will be used in, I receive an error that states the second class cannot be found. For example, if the class name is foo and it is extending bar (the common class, located elsewhere), the error says that foo cannot be found. But if I place the code for class bar in the same file as foo, it works. Here are the classes in question - Common Class abstract class coreFunctions { protected $contentDB; public function __construct() { $this->contentDB = new PDO('mysql:host=localhost;dbname=db', 'username', 'password'); } public function cleanStr($string) { $cleansed = trim($string); $cleansed = stripslashes($cleansed); $cleansed = strip_tags($cleansed); return $cleansed; } } Code from individual class include $_SERVER['DOCUMENT_ROOT'] . '/includes/class.core-functions.php'; $mode = $_POST['mode']; if (isset($mode)) { $gallery = new gallery; switch ($mode) { case 'addAlbum': $gallery->addAlbum($_POST['hash'], $_POST['title'], $_POST['description']); } } class gallery extends coreFunctions { private function directoryPath($string) { $path = trim($string); $path = strtolower($path); $path = preg_replace('/[^ \pL \pN]/', '', $path); $path = preg_replace('[\s+]', '', $path); $path = substr($path, 0, 18); return $path; } public function addAlbum($hash, $title, $description) { $title = $this->cleanStr($title); $description = $this->cleanStr($description); $path = $this->directoryPath($title); if ($title && $description && $hash) { $addAlbum = $this->contentDB->prepare("INSERT INTO gallery_albums (albumHash, albumTitle, albumDescription, albumPath) VALUES (:hash, :title, :description, :path)"); $addAlbum->execute(array('hash' => $hash, 'title' => $title, 'description' => $description, 'path' => $path)); } } } The error when I try it this way is Fatal error: Class 'gallery' not found in /home/opheliad/public_html/admin/photo-gallery/includes/class.admin_photo-gallery.php on line 10

    Read the article

  • Extend base class properties

    - by user1888033
    I need your help to extend my base class, here is the similar structure i have. public class ShowRoomA { public audi AudiModelA { get; set; } public benz benzModelA { get; set; } } public class audi { public string Name { get; set; } public string AC { get; set; } public string PowerStearing { get; set; } } public class benz { public string Name { get; set; } public string AC { get; set; } public string AirBag { get; set; } public string MusicSystem { get; set; } } //My Implementation class like this class Main() { private void UpdateDetails() { ShowRoomA ojbMahi = new ShowRoomA(); GetDetails( ojbMahi ); // this works fine } private void GetDetails(ShowRoomA objShowRoom) { objShowRoom = new objShowRoom(); objShowRoom.audi = new audi(); objShowRoom.audi.Name = "AUDIMODEL94CD698"; objShowRoom.audi.AC = "6 TON"; objShowRoom.audi.PowerStearing = "Electric"; objShowRoom.benz= new benz(); objShowRoom.audi.Name = "BENZMODEL34LCX"; objShowRoom.audi.AC = "8 TON"; objShowRoom.audi.AirBag = "Two (1+1)"; objShowRoom.audi.MusicSystem = "Poineer 3500W"; } } // Till this cool. // Now I got requirement for ShowRoomB with replacement of old audi and benz with new models and new other brand cars also added. // I don't want to modify GetDetails() method. by reusing this method additional logic i want to apply to my new extended model. // Here I struck in designing my new model of ShowRoomB (base of ShowRoomA) ... I have tried some thing like... but not sure. public class audiModelB:audi { public string JetEngine { get; set; } } public class benzModelB:benz { public string JetEngine { get; set; } } public class ShowRoomB { public audiModelB AudiModelB { get; set; } public benzModelB benzModelB { get; set; } } // My new code to Implementation class like this class Main() { private void UpdateDetails() { ShowRoomB ojbNahi = new ShowRoomB(); GetDetails( ojbNahi ); // this is NOT working! I know this object does not contain base class directly, still some what i want fill my new model with old properties. Kindly suggest here } } Can any one please give me solutions how to achieve my extending requirement for base class "ShowroomA" Really appreciated your time and suggestions. Thanks in advance,

    Read the article

  • Extending a singleton class

    - by cakyus
    i used to create an instance of a singleton class like this: $Singleton = SingletonClassName::GetInstance(); and for non singleton class: $NonSingleton = new NonSingletonClassName; i think we should not differentiate how we create an instance of a class whether this is a singleton or not. if i look in perception of other class, i don't care whether the class we need a singleton class or not. so, i still not comfortable with how php treat a singleton class. i think and i always want to write: $Singleton = new SingletonClassName; just another non singleton class, is there a solution to this problem ?

    Read the article

  • Custom component which displays voice recognition button if available

    - by steff
    Hi evereyone, I'd like to create a custom component which supports voice recognition. It will primarily be an extended EditText which should show the microphone button for voice recognition if it is available. I wanted to to look at the search app-widget on the homescreen but I don't find it in the source. This is intended to use the voice recognition as some sort of dictation device, i.e. the user does not have to type but use his voice instead. So could anyone please point me in some direction? Thanks in advance, Steff

    Read the article

  • After extending the User model in django, how do you create a ModelForm?

    - by mlissner
    I extended the User model in django to include several other variables, such as location, and employer. Now I'm trying to create a form that has the following fields: First name (from User) Last name (from User) Location (from UserProfile, which extends User via a foreign key) Employer (also from UserProfile) I have created a modelform: from django.forms import ModelForm from django.contrib import auth from alert.userHandling.models import UserProfile class ProfileForm(ModelForm): class Meta: # model = auth.models.User # this gives me the User fields model = UserProfile # this gives me the UserProfile fields So, my question is, how can I create a ModelForm that has access to all of the fields, whether they are from the User model or the UserProfile model? Hope this makes sense. I'll be happy to clarify if there are any questions.

    Read the article

  • Configurable Values in Enum

    - by Omer Akhter
    I often use this design in my code to maintain configurable values. Consider this code: public enum Options { REGEX_STRING("Some Regex"), REGEX_PATTERN(Pattern.compile(REGEX_STRING.getString()), false), THREAD_COUNT(2), OPTIONS_PATH("options.config", false), DEBUG(true), ALWAYS_SAVE_OPTIONS(true), THREAD_WAIT_MILLIS(1000); Object value; boolean saveValue = true; private Options(Object value) { this.value = value; } private Options(Object value, boolean saveValue) { this.value = value; this.saveValue = saveValue; } public void setValue(Object value) { this.value = value; } public Object getValue() { return value; } public String getString() { return value.toString(); } public boolean getBoolean() { Boolean booleanValue = (value instanceof Boolean) ? (Boolean) value : null; if (value == null) { try { booleanValue = Boolean.valueOf(value.toString()); } catch (Throwable t) { } } // We want a NullPointerException here return booleanValue.booleanValue(); } public int getInteger() { Integer integerValue = (value instanceof Number) ? ((Number) value).intValue() : null; if (integerValue == null) { try { integerValue = Integer.valueOf(value.toString()); } catch (Throwable t) { } } return integerValue.intValue(); } public float getFloat() { Float floatValue = (value instanceof Number) ? ((Number) value).floatValue() : null; if (floatValue == null) { try { floatValue = Float.valueOf(value.toString()); } catch (Throwable t) { } } return floatValue.floatValue(); } public static void saveToFile(String path) throws IOException { FileWriter fw = new FileWriter(path); Properties properties = new Properties(); for (Options option : Options.values()) { if (option.saveValue) { properties.setProperty(option.name(), option.getString()); } } if (DEBUG.getBoolean()) { properties.list(System.out); } properties.store(fw, null); } public static void loadFromFile(String path) throws IOException { FileReader fr = new FileReader(path); Properties properties = new Properties(); properties.load(fr); if (DEBUG.getBoolean()) { properties.list(System.out); } Object value = null; for (Options option : Options.values()) { if (option.saveValue) { Class<?> clazz = option.value.getClass(); try { if (String.class.equals(clazz)) { value = properties.getProperty(option.name()); } else { value = clazz.getConstructor(String.class).newInstance(properties.getProperty(option.name())); } } catch (NoSuchMethodException ex) { Debug.log(ex); } catch (InstantiationException ex) { Debug.log(ex); } catch (IllegalAccessException ex) { Debug.log(ex); } catch (IllegalArgumentException ex) { Debug.log(ex); } catch (InvocationTargetException ex) { Debug.log(ex); } if (value != null) { option.setValue(value); } } } } } This way, I can save and retrieve values from files easily. The problem is that I don't want to repeat this code everywhere. Like as we know, enums can't be extended; so wherever I use this, I have to put all these methods there. I want only to declare the values and that if they should be persisted. No method definitions each time; any ideas?

    Read the article

  • Android; Confused by views?

    - by javano
    I have created a class (InputControl) which extends the view of my main class (Main), and takes focus of the screen. I have a button on the main xml layout which calls control() and sets up my InputControl view, from there I capture user input. How can I return back to the xml layout from the InputControl view class? public class Main extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); InputControl = new InputControl(this); } //......SNIP! public void control(){ setContentView(InputControl); InputControl.requestFocus(); } } public class InputControl extends View implements OnTouchListener { public InputControl(Context context) { super(context); setFocusable(true); setFocusableInTouchMode(true); this.setOnTouchListener(this); } public boolean onTouch(View view, MotionEvent event) { //...I AM CAPTURING USER TOUCH EVENTS HERE } }

    Read the article

  • Objective-C protocol vs inheritance vs extending?

    - by ryanjm.mp
    I have a couple classes that have nearly identical code. Only a string or two is different between them. What I would like to do is to make them "x" from another class that defines those functions and then uses constants or something else to define those strings that are different. I'm not sure if "x" is inheritance or extending or what. That is what I need help with. For example: objectA.m: -(void)helloWorld { NSLog("Hello %@",child.name); } objectBob.m: #define name @"Bob" objectJoe.m #define name @"Joe" (I'm not sure if it's legal to define strings, but this gets the point across) It would be ideal if objectBob.m and objectJoe.m didn't have to even define the methods, just their relationship to objectA.m. Is there any way to do something like this? It is kind of like protocol, except in reverse, I want the "protocol" to actually define the functions. If all else fails I'll just make objectA.m: -(void)helloWorld:(NSString *name) { NSLog("Hello %@",name); } And have the other files call that function (and just #import objectA.m).

    Read the article

  • Django design question: extending User to make users that can't log in

    - by jobrahms
    The site I'm working on involves teachers creating student objects. The teacher can choose to make it possible for a student to log into the site (to check calendars, etc) OR the teacher can choose to use the student object only for record keeping and not allow the student to log in. In the student creation form, if the teacher supplies a username and a password, it should create an object of the first kind - one that can log in, i.e. a regular User object. If the teacher does not supply a username/password, it should create the second type. The other requirement is that the teacher should be able to go in later and change a non-logging-in student to the other kind. What's the best way to design for this scenario? Subclass User and make username and password not required? What else would this affect?

    Read the article

  • How can I extend the desktop onto an external monitor/projector?

    - by hellocatfood
    I've plugged in a projector into my laptop and I'm attempting to extend the desktop onto it (so that I can run a full screen app on the projector and have the controls on my laptop). I'm able to mirror the screens effectively (it does this by default) but I can't extend it. When I untick "Mirror screens" and press apply it asks me to log out and then back in again but it goes back to mirroring the screens. I'm able to extend desktop on to my external monitor at home, just not this projector. Is there a manual way or other way to do this other that through Monitors setting? My computer model is Dell Studio 1555: Pentium Dual Core T4300(2.1GHz,800MHz,1MB), 4096MB 800MHz DDR2 Dual Channel, 512 MB ATI Mobility RADEON HD 4570 using the ATI proprietary driver. My screen resolution is 1366x768 (16:9) The projector that it wont connect properly is a Hitachi CPX3. That page specifies that it's especially designed for projectors that use 16:10 aspect ratio, but considering my external monitor at home uses 4:3 should the differences in aspect ratio matter or be causing this error?

    Read the article

  • AlertDialog.Builder vs class to extend AlertDialog - Application size

    - by wuntee
    I am trying to figure out what is the best way to go about creating dialogs. I can either create my own Dialog class (which, to me, is more clean and organized), or I can use AlertDialog.Builder (which would be done inline, and funky looking)... What are the positivies and negatives of either implementation? The only thing I can think of is application size...

    Read the article

  • Actionscript/Flex - Is it possible to dynamically extend an object, modify functions, add functions

    - by RR
    I know this question might be frowned upon, but actionscript is a dynamic language similar to javascript and in javascript I can take an object from a library written by someone else and dynamically (at runtime) add/remove/modify functions, properties, prototypes etc. this is kind of like dynamically extending an object to make it work with the library it came with as well as another library. Is something like this possible in flex actionscript? I'm thinking it is only possible with classes that are declared 'dynamic' and definitely not possible with classes declared 'final'. What are your thoughts? Any ideas/tricks?

    Read the article

  • Javascript, AJAX, Extend PHP Session Timeout, Bank Timeout

    - by Guhan Iyer
    Greetings, I have the following JS code: var reloadTimer = function (options) { var seconds = options.seconds || 0, logoutURL = options.logoutURL, message = options.message; this.start = function () { setTimeout(function (){ if ( confirm(message) ) { // RESET TIMER HERE $.get("renewSession.php"); } else { window.location.href = logoutURL; } }, seconds * 1000); } return this; }; And I would like to have the timer reset where I have the comment for RESET TIMER HERE. I have tried a few different things to no avail. Also the code calling this block is the following: var timer = reloadTimer({ seconds:20, logoutURL: 'logout.php', message:'Do you want to stay logged in?'}); timer.start(); The code may look familiar as I found it on SO :-) Thanks!

    Read the article

  • Trying to extend ActionView::Helpers::FormBuilder

    - by nibbo
    Hello I am trying to DRY up some code by moving some logic into the FormBuilder. After reading the documentation about how to select and alternative form builder the logical solution for me seemed to be something like this. In the view <% form_for @event, :builder => TestFormBuilder do |f| %> <%= f.test %> <%= f.submit 'Update' %> <% end %> and then in app/helpers/application_helper.rb module ApplicationHelper class TestFormBuilder < ActionView::Helpers::FormBuilder def test puts 'apa' end end end This, however, gives me an error at the "form_for" uninitialized constant ActionView::Base::CompiledTemplates::TestFormBuilder Where am I doing it wrong?

    Read the article

  • How to extend the Smarty class right

    - by Evolutio
    I have a Problem with Smarty. I have made this class: <?php require_once(INCLUDE_PATH.'smarty/Smarty.class.php'); class IndexPage extends Smarty { public $templateName = 'index.tpl'; public function __construct() { parent::__construct(); $this->showTemplate(); } public function showTemplate() { self::display('index.tpl'); } } ?> But why it doesn't works? Here is the Error: Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php:127 Stack trace: #0 D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #1 D:\xampp\htdocs\aiondb\lib\classes\IndexPage.class.php(14): Smarty_Internal_TemplateBase->display('index.tpl') #2 D:\xampp\htdocs\aiondb\lib\classes\IndexPage.class.php(10): IndexPage->showTemplate() #3 D:\xampp\htdocs\aiondb\index.php(3): IndexPage->__construct() #4 {main} thrown in D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php on line 127

    Read the article

  • Extend RedCloth via Redmine plugin?

    - by FLX
    Hello, I'm new to Ruby/Redmine/Redcloth but I'm trying to achieve the following: The default way to build a link in Textile is "foo":http://bar. However, 90% of the day I use Atlassian products, which use [foo|http://bar] as link markup. To keep everything a bit uniform I'd like to implement this in Redmine via a plugin. However, it appears that you can't change the macro syntax so instead I'll have to look into extending RedCloth to accept this form of inserting links. Does anyone know how I can achieve this? Thank you and merry christmas, Dennis

    Read the article

  • Mimic remote API or extend existing django model

    - by drozzy
    I am in a process of designing a client for a REST-ful web-service. What is the best way to go about representing the remote resource locally in my django application? For example if the API exposes resources such as: List of Cars Car Detail Car Search Dealership summary So far I have thought of two different approaches to take: Try to wrangle the django's models.Model to mimic the native feel of it. So I could try to get some class called Car to have methods like Car.objects.all() and such. This kind of breaks down on Car Search resources. Implement a Data Access Layer class, with custom methods like: Car.get_all() Car.get(id) CarSearch.search("blah") So I will be creating some custom looking classes. Has anyone encoutered a similar problem? Perhaps working with some external API's (i.e. twitter?) Any advice is welcome. PS: Please let me know if some part of question is confusing, as I had trouble putting it in precise terms.

    Read the article

  • extend base.html problem

    - by momo
    I'm getting the following error: Template error In template /home/mo/python/django/templates/yoga/index.html, error at line 1 Caught TemplateDoesNotExist while rendering: base.html 1 {% extends "base.html" %} 2 3 {% block main %} 4 <p>{{ page.title }}</p> 5 <p>{{ page.info}}</p> 6 <a href="method/">Method</a> 7 {% endblock %} 8 this is my base.html file, which is located at the same place as index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <div style="width:50%; marginleft:25%;"> {% block main %}{% endblock %} </div> what exactly is going on here? should the base.html file be located somewhere else?

    Read the article

  • What is the best way to extend restful_authentication/AuthLogic to support lazy logins by an anonymo

    - by Kevin Elliott
    I'm building an iPhone application that talks to a Ruby on Rails backend. The Ruby on Rails application will also service web users. The restful_authentication plugin is an excellent way to provide quick and customizable user authentication. However, I would like users of the iPhone application to have an account created automatically by the phone's unique identifier ([[UIDevice device] uniqueIdentifier]) stored in a new column. Later, when users are ready to create a username/password, the account will be updated to contain the username and password, leaving the iPhone unique identifier intact. Users should not be able to access the website until they've setup their username/password. They can however, use the iPhone application, since the application can authenticate itself using it's identifier. What is the best way to modify restful_authentication to do this? Create a plugin? Or modify the generated code? What about alternative frameworks, such as AuthLogic. What is the best way to allow iPhones to get a generated auth token locked to their UUID's, but then let the user create a username/password later?

    Read the article

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