text:
We Care a Lot is the debut studio album by American rock band Faith No More, originally released in 1985 and distributed through Mordam Records. On the original vinyl release, the band is credited as Faith. No More. on the album's liner notes, back cover, and on the record itself.

Album information
The title track "We Care a Lot" was rerecorded for their follow-up album Introduce Yourself and released as their first single. This later version of the song was incorrectly listed as the original and the album Introduce Yourself was listed as the début in the sleeve notes for some subsequent releases, such as the 1998 compilation Who Cares a Lot?.

The band is known to have re-recorded only one song from We Care a Lot in the studio with current singer Mike Patton on vocals. "As the Worm Turns" was recorded during the Angel Dust sessions.

However, a number of live recordings of songs from this album with Patton on vocals have been released over the years.

 "We Care a Lot"
 various "Falling to Pieces" singles
 Live at the Brixton Academy
 "We Care a Lot" (contains Patton's live version from Live At The Brixton Academy and Mosley's studio version from Introduce Yourself)
 "I'm Easy/Be Aggressive" CD2 single
 "We Care a Lot/I Started a Joke" (contains Patton's live version from Live At The Brixton Academy and Mosley's studio version from Introduce Yourself)
 various "I Started a Joke" singles
 "Mark Bowen"
 "I'm Easy/Be Aggressive" CD1 single
 "As the Worm Turns"
 various "Epic" CD singles
 Live at the Brixton Academy
 Angel Dust (Japanese edition)

A later recording of "We Care a Lot" (from the album Introduce Yourself) is used as the theme song for the show Dirty Jobs.

Production
The band initially started recording the album without backing from a record label and, after pooling their money, recorded five songs. This gained the attention of Ruth Schwartz (who was then forming the independent label Mordam Records) under which the band (after receiving the finances to do so) finished and released the album. It was the first official release for both the band and the label.

The album was recorded in a short space of time on a low budget. In a 2015 interview, bassist Billy Gould reflected, "There are probably things we could have done better, but at the same time I think that the performances were pretty damned good. And that had to do with us keeping focused and needing to work within those budget restrictions. We rehearsed quite a lot before we went in to record, so we were ready."

Release history

While released on vinyl and cassette in 1985, this album would not be released to buy as a CD until 1995 in Australia (on Mushroom Records) as a pink disc for the first pressing, and black disc for the second, to coincide with the tour for their fifth studio album King for a Day... Fool for a Lifetime, released that year. In 1996, it was reissued on CD, vinyl and cassette in the UK and Japan with slightly modified artwork, one being a purple disc. The CD reissue version of the album can be seen during a scene at a record store in the 1997 film Chasing Amy.

2016 reissue
The album was reissued by Koolarrow Records on August 19, 2016, and includes nine additional tracks, including three remixes, four demos and two live recordings from a 1986 show at the I-Beam, San Francisco. It was remastered by Maor Appelbaum

Music and lyrics
The third track "Mark Bowen" was titled after an early Faith No More/Faith No Man guitarist of the same name.

Critical reception

Select magazine, while also mentioning the roughness of production, said that the music is inexorable and "a lustful marriage of mutoid metal and dancefloor verve that owed nothing to anybody". AllMusic made repeated reference to the absence of future front man Mike Patton and criticized Chuck Mosley's vocals, calling him "often off-key, fairly monotonous, and colorless" but credited the album for having "lots of attitude", comparing it to early Public Image Ltd works.

Mike Patton labelled the album as "bad hippie music". However, his Mr. Bungle bandmate Trey Spruance was a fan. When Spruance joined Faith No More for their 1995 album King for a Day... Fool for a Lifetime, he suggested that the band return to the sound they had on We Care a Lot.

Track listing

2016 reissue bonus tracks

We Care a Lot - Deluxe Band Edition - Remastered by Maor Appelbaum

Personnel

Faith No More
 Mike Bordin – drums
 Roddy Bottum – keyboard
 Bill Gould – bass
 James B. Martin – guitar
 Chuck Mosley – vocals

Production
 Matt Wallace – producer
 Olga Gerrard – artwork, cover, graphics

Footnotes

1985 debut albums
Albums produced by Matt Wallace
Alternative metal albums by American artists
Faith No More albums
Funk metal albums
Post-punk albums by American artists


text:
Q: MVC javascript https So I use https on one page on website, and javascript doesn't work there, browser is blocking it because it is not secured.
How do you render javascript as https through MVC render strategy?

redpajama_set_name: RedPajamaStackExchange


The Virginia Tech Carilion School of Medicine's Art Exhibition Spring 2013 features photographs and sketches with a range of subjects, from landscapes to cityscapes, from braying zebras to dancing egrets, from scenes of nature to babes cradled in tattooed arms.
The exhibition will open on March 20 with a public reception from 5:30 to 7:30 p.m. in the school's atrium at 2 Riverside Circle in Roanoke.
During the reception, the school will also host a complement to More to Live For: An Evening Inspired by the Life of Michael Brecker. The film—which will be screened at the Jefferson Center on March 22, followed by a tribute performance featuring saxophonist Branford Marsalis and pianist Joey Calderazzo—chronicles the lives of the late jazz great Michael Brecker and two other men with leukemia. Its showings have inspired countless audience members to join the International Bone Marrow Registry. As part of the Virginia Tech Carilion School of Medicine's collaboration with community arts organizations and in advance of the tribute performance, during the art show the school will host cheek swabbing for all those interested in joining the registry.
The upcoming exhibition is the school's fifth, presented as part of the Creativity in Health Education Program, an initiative dedicated to using art to expand the social, cultural, and humanistic awareness of the school's students, faculty, and staff. The program, which sponsors two art exhibitions a year, also aims to involve community members in the life of the school.


text:
Sikirevci is een gemeente in de Kroatische provincie Brod-Posavina.
Sikirevci telt 2707 inwoners. De oppervlakte bedraagt 29,5 km², de bevolkingsdichtheid is 91,8 inwoners per km².

Gemeente in Kroatië
Brod-Posavina

redpajama_set_name: RedPajamaWikipedia


text:
CollegesMissouriLogan University
Logan University
$6,600	* See Total Tuition & Fees →
915	See All Student Demographics Data →
Unknown	Estimate your Chances →
Get Logan Admissions Info.
Logan is a 4-year private university located at 1851 Schoettler Rd in Chesterfield, Missouri. It's a Large campus in a Suburb-based setting with 915 enrolled students and a student faculty ratio of 12 to 1. Campus housing is not present on campus, and online programs are available.
Could I Receive Free College Credit Towards Logan?
About Logan University
Logan University, is a private university offering college education with special focus in the fields of chiropractic and the health sciences. It was established in 1935, and named as Logan Basic College of Chiropractic, in honor of its first president and founder, Hugh B. Logan, D.C. The college initially operated in a transformed residence at St. Louis' Central West End area. In the following year, the college moved to a 17-acre campus a suburb of St. Louis called Normandy. In 1958, the college merged with Carver College of Chiropractic (established in 1906). It also merged six years later with Missouri Chiropractic College, and then the college's name was changed to Logan College of Chiropractic. In 1972, the college was rehoused in the buildings and lands of the former Maryknoll Seminary in Chesterfield, Missouri. Many other buildings and centers were added later. The college changed its name to its current name of Logan University in 2013. Logan is now located in Chesterfield, Missouri, a suburb of St. Louis.
The college motto is "Maximizing Human Performance". The university 112-acre is listed among "America's Most Beautiful College Campuses" that was published by MSNBC in 2007. The University operates several unique centers and facilities as the William D. Purser Center and the Biofreeze Sports. Logan's mascot is the Leopard while the campus official colors are blue and white. While Logan previously played in intercollegiate athletic teams, it is no longer doing so since 2010–11. Logan has club sports only.
Logan is divided into two schools offering 2 Bachelor of Science Degrees, 3 Master of Science Degrees, 2 doctoral degrees, and general education science courses. The chiropractic program is authorized by the Council on Chiropractic Education (C.C.E.) and has had been fully accredited since 1978. The baccalaureate, master's and doctoral degree programs of Logan have all been granted by the Higher Learning Commission of the North Central Association of College and Schools in 1987.
Years Estd.1935
MascotLeopard
MottoMaximizing Human Performance
ColorsBlue & White
LocationMissouri
AthleticsClub sports only
Religious AffiliationNot applicable
Logan Tuition and Fees
The yearly tuition for Logan is $6,600. However, this number and one's actual expenses can vary. Some schools have tuition that is higher based on students with residency in-state vs out of state, books, fees, and on or off campus housing will all have an effect. We provide a free calculator tool so you can see what your actual yearly costs might be.
#1921 Nationally for Universities with highest tuition
#1738 Nationally for Colleges with the most expensive cost of living.
Calculate your Actual Expenses for Logan
Logan Simple Tuition vs. Actual Fees: What's the Difference?
Whether students live on-campus in designated student housing, or off-campus in a house or apartment, will change the cost of attending college. Logan University is located in Chesterfield which will also determine rents and cost of living. Use our free calculator to estimate your cost of living.
Logan is a prestigious 4-year institution in Missouri. The following are the rankings for the school relative to other universities across the country.
#1738 Nationally for Colleges with the most Expensive cost of living
Can I Get Accepted to Logan University?
Can I Get Accepted to Logan?
The Acceptance rate for Logan is Percent. Last year, there were applicants and percent of those who were accepted actually attended (Enrollment Rate). To apply, it's required to have the following: High school GPA, High School transcripts, SAT/ACT test scores.
Get Logan Admissions Information.
Available Degrees at Logan
The following are a list of Bachelors, Certificates, Masters-Graduate degrees offered by Logan University.
© 2021 — OnlineDegree.com, All Rights Reserved.
Terms of UsePrivacy PolicyXML SitemapHTML Sitemap
Taking Courses
Full Transfer Guide
OER Movement
Groups We Love
College Savings Plans Network
OnlineDegree.com is not a college or university and we don't offer degrees. Nor can we grant college credit for taking our courses. We have participating accredited universities who accept our courses for college credit, and our courses have earned a recommendation for credit from outside agencies like the National College Credit Recommendation Service (NCCRS) whose recommendations are considered by over 1400 accredited colleges and universities in the United States. We can't guarantee that you will get college or university credit for taking our courses since it's ultimately determined by your university or college and depends on a variety of factors specific to each individual, including but not limited to, which major you choose. We have tried to provide relevant, up to date information about colleges, careers and degree programs. Salary and growth data is based on recently published U.S. Bureau of Labor Statistics. Tuition and demographic data is based on recently published National Center for Education Statistics. Our recommendations and editorial content are our opinions based on our research.
Image Source(s): Image 1: By Midnightcomm (Own work) [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC BY 3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons;
We Help Get Your First Year of College, Tuition-Free. Learn How →

redpajama_set_name: RedPajamaCommonCrawl


This lake is located in the Department of La Paz, three hours by bus from the capital city of the same name. It is 283 meters deep and has a total extension of 176 Km. in length by 70 Km. in width.
The Titicaca Lake is the highest-navigable lake in the world. It has an average height of 3,810 meters above the sea level. A portion of the lake belongs to Bolivia and the other one to Peru. It is divided into two major basins, named "Lago Mayor del Titicaca" (Major Lake of the Titicaca) and "Lago Menor del Titicaca" (Minor Lake of the Titicaca).
The Major Lake or Chuchito Lake, has bluish-sweet waters and it is surrounded by beautiful scenery filled with mountains and snowy peaks, which remain covered with snow because of the intense cold in the mountain range region. The islands, which are splattered with archaeological remains, provide tangible proof of the domain that Aymara civilizations have had over this area.
The Minor Lake or Winay Marka Lake, has an incredible and panoramic view of the Royal Mountain Range (Cordillera Real). This view provides visitors a look at some tiny islands. These are still populated by the Aymara, most of whom live from fishing. The entire coast of the lake is connected to several natural areas that have "totorales" (patches of bulrush), which are also home to different species of birds such as ducks.
In the area that surround the Minor Lake; the culture of Tiwanaku reached a great deal of development.
The Titicaca Lake, also known as "The Sacred Lake of the Incas", is a great tourist attraction for nature lovers, a perfect place to enjoy a spectacular view of the snowy hills of the mountain range that contrast with the blue waters of the lake.
The Titicaca Lake is a perfect place to enjoy nature. The most typical species of fish include the following: suches (Suchy - Quechua Word, given to a species of fish native of the Titicaca Lake) carachis, bogas (Boga - Scientific Name: Sparus box, a small type of blue fish with golden stripes and very thin teeth), umantos, and ispis (Small type of fish with very thin body) and certain species of birds, such as: wallatas or wild geese.
Throughout the region there is the predominant presence of the Aymara, who have kept their own traditional forms of life and cultural values that date back to the time of their ancestors.
Island of the Sun, Suriki Island, Island of the Moon or Koati, Kewaya or Kala Uta Island, Pre-Columbian Cultivation Terraces, Sampaya, Yampupata.


text:
Andy Futuro
Literary Chemist
The Truth About Overwatch
Imagine a game of Overwatch with no duplicate characters—once a character is chosen no one else can play as them. In this scenario the characters of Overwatch are distinct persons.
In this world the characters of Overwatch are heroes cum mercenaries. Their watch ended, their struggle won or lost, they are reduced to venal pursuits to make ends meet or simply to stave off boredom. Puissant and bereft of a unifying cause, they often find themselves on opposite sides of a conflict. The battles revolve around mundane objectives—moving a payload from one location to another, capturing strategic territory.
In El Dorado and Junkertown a group of Overwatch mercenaries performs armored car duty. Perhaps they are transferring the weekly payroll for Union Pacific, or the ill-gotten gains of a cartel. In Hollywood the Overwatch mercenaries serve as bodyguards for Harvey Weinstein as he travels to the premier of a new Polanksi-Allen collaboration. Another group of Overwatch thugs attempts an assassination; the client remains unnamed.
In this world of violence, good and evil, right and wrong, are alien concepts. All that matters is completing the objective, and the next one, and the money and distraction it provides. Alliances shift with the wind. Your brothers (and sisters) in arms of yesterday find themselves in your sights today and you don't hesitate to pull the trigger.
Of course, in Overwatch there are duplicate characters, which leads me to believe something more sinister is afoot. The objectives are still basic and bloody, transportation and seizing of territory. Yet nothing is ever accomplished. The territory changes hands, the payload reaches its destination or it doesn't, and the same battles are fought over and over again with no conclusion. Death holds no sway; it is an annoyance that delays you a few seconds, just long enough for your ever-shifting team to be defeated.
More disturbing still is the fact that you can face yourself in battle, see an exact clone of your being and be forced to slay it before it slays you and your compatriots. How many times has McCree placed the killing bullet in his own skull; how many misses were due to a flicker of hesitation, a sense that this is all horribly, horribly wrong? How many times has Tracer unloaded the clip of an automatic weapon into her own spine, just to zip away with an insouciant "Wheee!" Surely, Mei, who seems of all the characters to wrestle most with a conscience, must feel a pang of remorse at slicing an icicle through her own heart.
There is an explanation for this unending cycle of violence—the war was lost. Maybe it was the war against the Omnics that the Overwatch characters reference obliquely from time to time. Or maybe it was a latter war against a stronger foe. A foe that conquered the Earth and subjugated or annihilated it denizens, and trapped their strongest exemplars in a simulated environment. Perhaps the heroes of Overwatch are plugged into a Matrix-style supercomputer, forced to battle in a world composed of zeroes and ones. Perhaps they are all Omnics, produced in the foundries of Volskaya, with a patina of skin and implanted memories to trick the consciousness. Or perhaps the conquering race possesses the power to command life and death, and it is full-fleshed organic clones that mash and blast and slaughter one another.
The purpose of this experiment is unknowable. It could be a training simulator, where the strategists of the conquerors incorporate the battle experience of the Earthlings into their own. It could be a punishment for resistance. It could be an experiment in human psychology, discovering how easy it is to draw violence from these creatures, a violence wreaked freely upon their erstwhile compatriots and even their very selves. Most likely the reason is one the hominids comprehend and prize above all others—it's entertaining.
Rooting for the Apocalypse
Cover / Front Matter
Chapter 1: Heat
Chapter 2: Definitely guilty of pre-crime
Chapter 3: Shut the fuck up, Lacy
Copyright Andy Futuro 2015


First take rice powder mix salt, sugar and add warm water and keep wet for 1 hour. Bit the egg in a bowl and mix it with the mixture of rice powder.
Then take a design of fuljhuri pitha it can easily found in market. Then take a fry pan and put it oil and make it warm and keep the design of fuljhuri in oil for 4 minute then put the design in the mixture and speared that more than half then put in to hot oil and fry the will speared from the design it self then fry it till brownie and remove from the oil.
Finally serve this fuljhuri pitha any decorated plate or bowl.


Looks very chic, spacious and very BA. I certainly like the design of the windows. Very brave or well thought strategic move by BA to introduce an improved First Class cabin, especially as demand is falling and others carriers are reducing capacity or removing their First Class Cabins. Lets hope it's a success for BA.


We are now enrolling for 1st Semester of the 2018-19 school year, with classes beginning in August. If you are interested in enrolling with Denver Online High School, please complete the Student Interest Application. From there, our faculty will be in touch to with full-time enrollment applicants to schedule an enrollment meeting where the student and parent will meet with Principal Ian Jones. Those students applying for part-time/supplemental enrollment will be emailed with next steps for enrollment.


Human Element Biometrics develops and integrates biometric based software systems and solutions. We are passionate about biometric technology and the opportunities that exist with its implementation. At Human Element Biometrics, we are constantly looking for new and exciting ways to incorporate biometric technology into processes and functions beyond typical security based solutions.
The solutions and services provided by Human Element Biometrics originated as a product set of RG2 Solutions, Inc., a credit union technology integration company. Our experience with biometric technology led us to new products and opportunities outside the core market of RG2 Solutions.
Seeing the increased demand for biometric based solutions, Human Element Biometrics, LLC was formed to apply and promote biometrics across the many target markets we see as the perfect fit for biometric technology.
Our mission is to promote biometric technology and its enormous potential by creating solutions that increase security, accountability and convenience.


text:
Q: Enable Proxy in Jenkins for Splunk Plugin I've installed Splunk plugin for Jenkins and I went to Jenkins configuration to update "Splunk for Jenkins Configuration". After saving the changes, I clicked test connection and got "Connection Refused" error.
When I ran CURL for splunk URL with proxy I was able to get the response back and this confirms that Jenkins is trying to hit without proxy.
Is there any place in Jenkins where I can configure the proxy so that Jenkins can pick that up while it is trying to connect to splunk server or is there any other alternative approach to this.

A: make sure you are running a latest release of the Splunk Plugin for Jenkins. You can see from this pull request, proxy configuration was integrated on Feb 13.
https://github.com/jenkinsci/splunk-devops-plugin/pull/11
You will then need to configure the JVM with the appropriate proxy settings,
JAVA_FLAGS=-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=myproxyport


text:
function varargout = chebguiWindow(varargin)
%CHEBGUIWINDOW   Driver file for Chebfun's CHEBGUI
%   This m-file populates and controls Chebfun's CHEBGUI.
%
% See also CHEBGUI.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DEVELOPER NOTE:
%  This method implements most callback method of CHEBGUI, i.e., methods that
%  get executed when the user interacts with the GUI figure. Many of these
%  methods are automatically generated by MATLAB, which explains why a lot of
%  them have input arguments that appear to be unused (but are needed for the
%  calling mechanism of MATLAB).
%
%  The more complicated methods of controlling the GUI layout live in the
%  @chebguiController folder.
%
%  The methods for actually solving problems using CHEBGUI live in the @chebgui/
%  folder.
%
%  The methods for dealing with exporting problems from the CHEBGUI figure to .m
%  files live in the @chebguiExporter folder, and its subclasses.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Copyright 2015 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

% Suppress irritating MLINT warnings:
%#ok<*INUSL,*DEFNU,*INUSD,*ST2NM,*MATCH2>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
    'gui_Singleton',  gui_Singleton, ...
    'gui_OpeningFcn', @chebguiWindow_OpeningFcn, ...
    'gui_OutputFcn',  @chebguiWindow_OutputFcn, ...
    'gui_LayoutFcn',  [] , ...
    'gui_Callback',   []);

if ( nargin && ischar(varargin{1}) )
    gui_State.gui_Callback = str2func(varargin{1});
end

if ( nargout )
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    warnstate = warning('off', 'MATLAB:hg:uicontrol:ParameterValuesMustBeValid');
    try
        gui_mainfcn(gui_State, varargin{:});
        warning(warnstate);
    catch ME
        warning(warnstate)
        MEID = ME.identifier;
        if ( ~isempty(strfind(lower(MEID), 'chebgui:')) )
            % These are expected GUI errors. We only show the dialog
            errordlg(cleanErrorMsg(ME.message), 'Chebgui error', 'modal');
            uiwait
            resetComponents(varargin{4});

            % If in debug mode, we throw the error to the command window as well
            if ( get(varargin{4}.menu_debug, 'UserData') )
                rethrow(ME)
            end
        else
            % Show an error dialog:
            errordlg(cleanErrorMsg(ME.message), 'Chebgui error', 'modal');
            uiwait
            resetComponents(varargin{4});
            % If in debug mode, we throw the error to the command window as well
            if ( get(varargin{4}.menu_debug, 'UserData') )
                rethrow(ME)
            end
        end
    end
end
% End initialization code - DO NOT EDIT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

end

% --- Executes just before chebguiWindow is made visible.
function chebguiWindow_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see Output(1-x^2)*exp(-30*(x+.5)^2)Fcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to chebguiWindow (see VARARGIN)

% The default fontsize of the panels.
handles.fontsizePanels = 12;

% Initalize fonts in the CHEBGUI window:
chebguiController.initalizeFields(handles);

% Choose default command line output for chebguiWindow
handles.output = hObject;

% Initialise the menus:
handles = chebguiController.initialiseMenus(handles);

% Set up the panels:
handles = chebguiController.setupPanels(handles);

% Initialise figures:
chebguiController.initialiseFigures(handles)

% Draw the Chebfun logo on the GUI:
handles = chebguiController.drawLogo(handles);

% Variable that determines whether a solution is available
handles.hasSolution = 0;

% Variable which stores the initial guess/condition
handles.init = [];

% Variable which stores imported variables from workspace
handles.importedVar = struct;

% Get the GUI object from the input argument
if ( ~isempty(varargin) )
    handles.guifile = varargin{1};
else
    handles.guifile = chebgui.demo(); % Load a random demo
end

% Create a new structure which contains information about the latest
% solution obtained
handles.latest = struct;

% Store the default length of pausing between plots for BVPs and the
% tolerance in the userdata field of relevant menu objects.
set(handles.menu_odeplottingpause, 'UserData', '0.5');
set(handles.menu_tolerance, 'UserData', '1e-10');

% Create UserData for the Fix-Y-axis options (so that we can display
% something if it gets called without selecting a demo).
set(handles.menu_pdefixon, 'UserData', {''});

% Populate the Demos menu, but only once (i.e. if user calls chebgui again,
% don't reload the examples).
if ( ~isfield(handles,'demosLoaded') )
    chebguiController.loadDemoMenu(handles);
    handles.demosLoaded = 1;
end

% Make sure the GUI starts in the correct mode:
chebguiController.switchMode(handles, handles.guifile.type);

% Load the input fields:
chebguiController.populate(hObject, handles, handles.guifile);

% Get the system font size and store in handles
s = char(com.mathworks.services.FontPrefs.getCodeFont);
if ( s(end-2) == '=' )
    fs = round(3/4*str2num(s(end-1)));
else
    fs = round(3/4*str2num(s(end-2:end-1)));
end
set(handles.tempedit, 'FontSize', fs);

% Set the solve button to green
set(handles.button_solve, 'String', 'Solve');
set(handles.button_solve, 'BackgroundColor', [43 129 86]/256);

% Ensure that we have a medium-grey colour in background
set(handles.mainWindow, 'BackgroundColor', .8*ones(1,3));

% Default discretization is chebcolloc2
handles.guifile.options.discretization = 'collocation';

% Default IVP solver is ode113:
handles.guifile.options.ivpSolver = 'ode113';

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes chebguiWindow wait for user response (see UIRESUME)
% uiwait(handles.chebguimainwindow);

end

% --- Outputs from this function are returned to the command line.
function varargout = chebguiWindow_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
if ( nargout > 0 )
    varargout{1} = handles.output;
end

% If nargout == 2, return the fll set of handles
if ( nargout > 1 )
    varargout{2} = handles;
end

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------- Callback functions for the objects of the GUI -----------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------ Functions which call chebgui methods ----------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function button_clear_Callback(hObject, eventdata, handles)
% Clear the GUI figure. This button also represents the 'Pause' button on the
% figure while problems are being solved.

if ( strcmp(get(handles.button_clear, 'String'), 'Clear all') )
    handles = chebguiController.clear(handles);
    % Clear information from the guifile as well
    handles.guifile = chebgui('type', handles.guifile.type);
    guidata(hObject, handles);
elseif strcmp(get(handles.button_clear, 'String'), 'Pause')
    set(handles.button_clear, 'String', 'Continue');
    set(handles.button_clear, 'BackgroundColor', [43 129 86]/256);
    % Re-enable figure button
    set(handles.button_figsol, 'Enable', 'on');
else
    % Disable figure button
    set(handles.button_figsol, 'Enable', 'off');
    set(handles.button_clear, 'String', 'Pause');
    set(handles.button_clear, 'BackgroundColor', [255 179 0]/256);
end

end

function button_solve_Callback(hObject, eventdata, handles)
handles = solveGUI(handles.guifile, handles);
guidata(hObject, handles);
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------- Functions which do their work without chebgui methods ------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function dom_left_Callback(hObject, eventdata, handles)
% Store the contents of input1_editText as a string. if the string is not a
% number then input will be empty
input = str2num(get(hObject, 'String'));

% Checks to see if input is not numeric or empty. If so, default left end
% of the domain is taken to be -1.
if ( isempty(input) || isnan(input) )
    warndlg('Left endpoint of domain unrecognized, default value -1 used.')
    set(hObject, 'String', '-1')
end

set(handles.input_GUESS, 'Enable', 'on');
set(handles.toggle_useLatest, 'Value', 0);
set(handles.toggle_useLatest, 'Enable', 'off');

handles.guifile.DomLeft = get(hObject, 'String');
guidata(hObject, handles);

end

function dom_right_Callback(hObject, eventdata, handles)
input = str2num(get(hObject, 'String'));

% Checks to see if input is not numeric or empty. If so, default right end
% of the domain is taken to be 1.
if ( isempty(input) || isnan(input) )
    warndlg('Right endpoint of domain unrecognized, default value 1 used.')
    set(hObject, 'String', '1')
end

set(handles.input_GUESS, 'Enable', 'on');
set(handles.toggle_useLatest, 'Value', 0);
set(handles.toggle_useLatest, 'Enable', 'off');

handles.guifile.DomRight = get(hObject, 'String');
guidata(hObject, handles);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -------- Functions which do their work in a couple of lines of code ----------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function str = removeTabs(str)
% Remove tabs from inputs
for k = 1:numel(str)
    idx = 1;
    strk = str{k};
    while ( ~isempty(idx) )
        idx = strfind(strk, double(9));
        strk(idx) = [];
    end
    str{k} = strk;
end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------------------------- Keypresses -------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% These methods go from one input box to another when the user presses the 'tab'
% button.

function popupmenu_sigma_KeyPressFcn(hObject, eventdata, handles)
if ( strcmp(eventdata.Key, 'tab') )
    if ( strcmp(eventdata.Modifier, 'shift') )
        uicontrol(handles.edit_eigN);
    else
        uicontrol(handles.button_solve);
    end
end
end

function button_solve_KeyPressFcn(hObject, eventdata, handles)
if ( strcmp(eventdata.Key, 'tab') )
    if ( strcmp(eventdata.Modifier, 'shift') )
        if ( get(handles.button_eig, 'value') )
            uicontrol(handles.input_BC);
        else
            uicontrol(handles.input_GUESS);
        end
    else
        uicontrol(handles.button_clear);
    end
elseif ( strcmp(eventdata.Key, 'return') )
    button_solve_Callback(hObject, eventdata, handles);
end
end

function button_clear_KeyPressFcn(hObject, eventdata, handles)
if ( strcmp(eventdata.Key, 'tab') )
    if ( strcmp(eventdata.Modifier, 'shift') )
        uicontrol(handles.button_solve);
    else
        uicontrol(handles.button_export);
    end
elseif ( strcmp(eventdata.Key, 'return') )
    button_clear_Callback(hObject, eventdata, handles);
end
end

function button_export_KeyPressFcn(hObject, eventdata, handles)
if ( strcmp(eventdata.Key, 'tab') )
    if ( strcmp(eventdata.Modifier, 'shift') )
        uicontrol(handles.button_clear);
    elseif ( get(handles.button_exportsoln, 'enabled') )
        uicontrol(handles.button_exportsoln);
    else
        uicontrol(handles.input_domain);
    end
elseif ( strcmp(eventdata.Key, 'return') )
    button_export_Callback(hObject, eventdata, handles);
end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------- Unsorted functions  --------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function button_figsol_Callback(hObject, eventdata, handles)
% Executed when the user wants to show figures in new window.

if ( get(handles.button_bvp, 'Value') || get(handles.button_ivp, 'Value') )
    % We're in ODE mode.

    % Plot the latest solution obtained:
    figure
    latestSolution = handles.latest.solution;
    plot(latestSolution, 'Linewidth', 2)
    title('Solution')
    xlabel(handles.indVarName);

    varnames = handles.varnames;
    if ( numel(varnames) == 1 )
        ylabel(varnames)
    end

    % Turn on grid
    if ( handles.guifile.options.grid )
        grid on
    end

    if ( numel(handles.varnames) > 1 )
        legend(handles.varnames)
    end

    % Also open the bottom figure in now window. This is either going to be the
    % PLOTCOEFFS, or a plot showing the norm of the updates during the Newton
    % iteration:
    figure

    plotType = get(handles.popupmenu_bottomFig, 'Value');

    if ( plotType == 1 ) % Show the norm plot
        latestNorms = handles.latest.normDelta;
        semilogy(latestNorms, '-*', 'Linewidth', 2)
        title('Norm of updates')
        xlabel('Number of iteration')

        if ( length(latestNorms) > 1 )
            skip = max(floor(length(latestNorms) / 5), 1);
            XTickVec = 1:skip:length(latestNorms);
            set(gca, 'XTick',  XTickVec)
            xlim([1 length(latestNorms)])
            grid on
        else % Don't display fractions on iteration plots
            set(gca, 'XTick',  1)
        end

    else % Show PLOTCOEFFS
        plotcoeffs(latestSolution, 'linewidth', 2)
        set(handles.popupmenu_bottomFig, 'Value', 2);
    end

elseif ( get(handles.button_pde, 'Value') )
    % We're in PDE mode.

    % Obtain solution and time range.
    u = handles.latest.solution;
    tt = handles.latest.solutionT;

    % Find out what our variables were called.
    varnames = handles.varnames;
    xLab = handles.indVarName{1};
    tLab = handles.indVarName{2};

    titleStr = sprintf('Solution at final time, %s = %f', tLab, tt(end));
    figure
    if ( ~iscell(u) )
        plot(u(:, end), 'Linewidth', 2)
        xlabel(xLab);
        ylabel(varnames);
        title(titleStr)
    else
        v = chebfun;
        for k = 1:numel(u)
            uk = u{k};
            v(:, k) = uk(:, end);
        end
        plot(v, 'Linewidth', 2);
        xlabel(xLab);
        legend(varnames);
        title(titleStr)
    end

    % Turn on grid
    if ( handles.guifile.options.grid )
        grid on
    end

    % Turn on fixed y-limits
    if ( ~isempty(handles.guifile.options.fixYaxisLower) )
        ylim([str2num(handles.guifile.options.fixYaxisLower) ...
            str2num(handles.guifile.options.fixYaxisUpper)]);
    end

    % Plot waterfall plots of the solution:
    if ( ~isa(u, 'chebmatrix') )
        figure
        waterfall(u, tt, 'simple', 'linewidth', 2)
        xlabel(xLab);
        ylabel(tLab);
        zlabel(varnames{1});
    else
        figure
        for k = 1:size(u, 1)
            subplot(1, size(u, 1), k);
            waterfall(u(k, :), tt, 'linewidth', 2)
            xlabel(xLab)
            ylabel(tLab)
            zlabel(varnames{k})
            title(varnames{k})
        end

        figure
        cols = get(0, 'DefaultAxesColorOrder');
        % Dummy plot to get legends right:
        for k = 1:size(u, 1)
            plot(0, NaN, 'linewidth', 2, 'color', cols(k, :))
            hold on
        end
        legend(varnames{:});
        % CHEBMATRIX/WATERFALL()
        waterfall(u, tt, 'linewidth', 2, 'edgecolors', cols)
        % Much pretty. Wow.
        view([322.5 30])
        box off
        grid on
    end
else
    figure
    h1 = gca;
    if ( strcmp(handles.latest.type, 'eig') )
        selection = get(handles.iter_list, 'Value');
        chebguiController.plotEigenmodes(handles, selection, h1, []);
    end

end

end

% --- Executes when chebguimainwindow is resized.
function chebguimainwindow_ResizeFcn(hObject, eventdata, handles)
% hObject    handle to chebguimainwindow (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
end

% --- Executes on button press in button_pde.
function button_pde_Callback(hObject, eventdata, handles)
% Switch to PDE mode.
handles = chebguiController.switchMode(handles, 'pde');
guidata(hObject, handles);

end

% --- Executes on button press in button_pde.
function button_eig_Callback(hObject, eventdata, handles)
% Switch to EIG mode.
handles = chebguiController.switchMode(handles, 'eig');
guidata(hObject,  handles);

end

% --- Executes on selection change in iter_list.
function iter_list_Callback(hObject, eventdata, handles)
% Called when user selects an eigenvalue from the list after solving.

% Developer note:
%   contents = cellstr(get(hObject, 'String')) returns iter_list contents as
%    cell array
%   contents{get(hObject, 'Value')} returns selected item from iter_list

% Selecting from the list only does something when we are in EIG mode. Display
% corresponding eigenfunctions when clicking on eigenvalues.

if ( strcmp(handles.latest.type, 'eig') )
    selection = get(handles.iter_list, 'Value');
    chebguiController.plotEigenmodes(handles, selection);
end

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------- Other subfunctions ---------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------------------All CreateFcn are stored here --------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% DEVELOPER NOTE: Most of these are automatically created by MATLAB.

function dom_left_CreateFcn(hObject, eventdata, handles)
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'),  ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end
end

function dom_right_CreateFcn(hObject, eventdata, handles)
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'),  ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end
end

function iter_list_CreateFcn(hObject, eventdata, handles)
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'),  ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end
end

function tempedit_CreateFcn(hObject, eventdata, handles)
end

function ylim1_CreateFcn(hObject, eventdata, handles)
end

function ylim1_Callback(hObject, eventdata, handles)
end

function ylim2_CreateFcn(hObject, eventdata, handles)
end

function ylim2_Callback(hObject, eventdata, handles)
end

function button_solve_ButtonDownFcn(hObject, eventdata, handles)
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ---------------------- Right-clicking functions ------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DEVELOPER NOTE: These methods will open the CHEBGUIEDIT sub-GUI

function editfontsize_CreateFcn(hObject, eventdata, handles)

bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'),  ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------------------- Callbacks for menu items  ----------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function menu_ivpSolver_Callback(hObject, eventdata, handles)
end

function menu_ivpGlobal_Callback(hObject, eventdata, handles)
end

function menu_ivpTimestepping_Callback(hObject, eventdata, handles)
end

function menu_ivpODE113_Callback(hObject, eventdata, handles)
set(handles.menu_ivpODE113, 'checked', 'on');
set(handles.menu_ivpODE15s, 'checked', 'off');
set(handles.menu_ivpODE45, 'checked', 'off');
set(handles.menu_ivpCollocation, 'checked', 'off');
set(handles.menu_ivpUltraspherical, 'checked', 'off');
handles.guifile.options.ivpSolver = 'ode113';
set(handles.panel_IVPsolver,'SelectedObject', handles.button_timestepping)
set(handles.panel_initialGuess, 'Visible', 'off')
guidata(hObject, handles);
end

function menu_ivpODE15s_Callback(hObject, eventdata, handles)
set(handles.menu_ivpODE113, 'checked', 'off');
set(handles.menu_ivpODE15s, 'checked', 'on');
set(handles.menu_ivpODE45, 'checked', 'off');
set(handles.menu_ivpCollocation, 'checked', 'off');
set(handles.menu_ivpUltraspherical, 'checked', 'off');
handles.guifile.options.ivpSolver = 'ode15s';
set(handles.panel_IVPsolver,'SelectedObject', handles.button_timestepping)
set(handles.panel_initialGuess, 'Visible', 'off')
guidata(hObject, handles);
end

function menu_ivpODE45_Callback(hObject, eventdata, handles)
set(handles.menu_ivpODE113, 'checked', 'off');
set(handles.menu_ivpODE15s, 'checked', 'off');
set(handles.menu_ivpODE45, 'checked', 'on');
set(handles.menu_ivpCollocation, 'checked', 'off');
set(handles.menu_ivpUltraspherical, 'checked', 'off');
handles.guifile.options.ivpSolver = 'ode45';
set(handles.panel_IVPsolver,'SelectedObject', handles.button_timestepping)
set(handles.panel_initialGuess, 'Visible', 'off')
guidata(hObject, handles);
end

function menu_ivpCollocation_Callback(hObject, eventdata, handles)
set(handles.menu_ivpODE113, 'checked', 'off');
set(handles.menu_ivpODE15s, 'checked', 'off');
set(handles.menu_ivpODE45, 'checked', 'off');
set(handles.menu_ivpCollocation, 'checked', 'on');
set(handles.menu_ivpUltraspherical, 'checked', 'off');
handles.guifile.options.ivpSolver = 'collocation';
set(handles.panel_IVPsolver,'SelectedObject', handles.button_global)
set(handles.panel_initialGuess, 'Visible', 'on')
guidata(hObject, handles);
end

function menu_ivpUltraspherical_Callback(hObject, eventdata, handles)
set(handles.menu_ivpODE113, 'checked', 'off');
set(handles.menu_ivpODE15s, 'checked', 'off');
set(handles.menu_ivpODE45, 'checked', 'off');
set(handles.menu_ivpCollocation, 'checked', 'off');
set(handles.menu_ivpUltraspherical, 'checked', 'on');
handles.guifile.options.ivpSolver = 'ultraspherical';
set(handles.panel_IVPsolver,'SelectedObject', handles.button_global)
set(handles.panel_initialGuess, 'Visible', 'on')
guidata(hObject, handles);
end

function menu_file_Callback(hObject, eventdata, handles)
end

function menu_opengui_Callback(hObject, eventdata, handles)
% Open a .guifile in the GUI

[filename, pathname, filterindex] = uigetfile('*.guifile', 'Pick a file');
if ( ~filterindex )
    return
end

cgTemp = chebgui(fullfile(pathname, filename));
chebguiController.populate(hObject, handles, cgTemp)
handles.guifile = cgTemp;
if ( ~isempty(cgTemp.type) )
    handles = chebguiController.switchMode(handles, cgTemp.type);
end

guidata(hObject, handles);

end

function menu_savegui_Callback(hObject, eventdata, handles)
% Save the current state of the GUI to a .guifile.

[filename, pathname, filterindex] = uiputfile('*.guifile', 'Pick a file');

if ( ~filterindex )
    return
end

% name = input('What would you like to name this GUI file? ');
name = '';

if ( get(handles.button_bvp, 'value') )
    demotype = 'bvp';
elseif ( get(handles.button_pde, 'value') )
    demotype = 'pde';
else
    demotype = 'eig';
end

% Extract all the needed info:
dom = get(handles.input_domain, 'string');
t = get(handles.input_timedomain, 'string');
DE = get(handles.input_DE, 'string');
BC = get(handles.input_BC, 'string');
LBC = get(handles.input_LBC, 'string');
RBC = get(handles.input_RBC, 'string');
init = get(handles.input_GUESS, 'string');
tol = '';
damping = '';
plotting = '';

DE = mycell2str(DE);
BC = mycell2str(BC);
LBC = mycell2str(LBC);
RBC = mycell2str(RBC);
init = mycell2str(init);

if ( strcmp(demotype, 'pde') )
    s = sprintf(['''%s''\n', ...
            'type = ''%s'';\n', ...
            'domain = ''%s'';\n', ...
            't = ''%s'';\n', ...
            'DE = %s;\n', ...
            'LBC = %s;\n', ...
            'RBC = %s;\n', ...
            'init = %s;\n', ...
            'tol = ''%s'';\n', ...
            'damping = ''%s'';\n', ...
            'plotting = ''%s'';'], ...
    name, demotype, dom, t, DE, LBC, RBC, init, tol, damping, plotting);
else
    s = sprintf(['''%s''\n', ...
            'type = ''%s'';\n', ...
            'domain = ''%s'';\n', ...
            'DE = %s;\n', ...
            'BC = %s;\n', ...
            'init = %s;\n', ...
            'tol = ''%s'';\n', ...
            'damping = ''%s'';\n', ...
            'plotting = ''%s'';'], ...
    name, demotype, dom, DE, BC, init, tol, damping, plotting);
end

% Write to a file:
fid = fopen(fullfile(pathname, filename), 'w+');
fprintf(fid, s);
fclose(fid);

end

function out = mycell2str(in)
% MYCELL2STR String manipulation, so that we can save to a .guifile.
isc = iscell(in);
if ( ~isc )
    in = {in};
    out = '';
else
    out = '{';
end

for k = 1:numel(in)
    if ( k > 1 )
        out = [out ' ; ']; %#ok<AGROW>
    end
    out = [out '''' strrep(in{k}, '''', '''''') '''']; %#ok<AGROW>
end

if ( isc )
    out = [out '}'];
end

end

function menu_demos_Callback(hObject, eventdata, handles)
end

function menu_help_Callback(hObject, eventdata, handles)
end

function menu_openhelp_Callback(hObject, eventdata, handles)
doc('chebgui')
end

function Untitled_9_Callback(hObject, eventdata, handles)
end

function menu_export_Callback(hObject, eventdata, handles)

% Offer more options if a solution exists.
if ( handles.hasSolution )
    set(handles.menu_exportmatfile, 'Enable', 'on')
    set(handles.menu_exportworkspace, 'Enable', 'on')
else
    set(handles.menu_exportmatfile, 'Enable', 'off')
    set(handles.menu_exportworkspace, 'Enable', 'off')
end

end

function menu_exportmfile_Callback(hObject, eventdata, handles)
% Call the button_export callback method to ensure they both do the same.
button_export_Callback(hObject, eventdata, handles)
end

function menu_exportchebgui_Callback(hObject, eventdata, handles)
% Call the export method of the CHEBGUIEXPORTER class:
chebguiExporter.toChebgui(handles.guifile)
end

function menu_exportworkspace_Callback(hObject, eventdata, handles)
% Create a CHEBGUIEXPORTER object of the correct type:
exporter = chebguiExporter.constructor(handles.guifile.type);
% Export the solution to the workspace
exporter.toWorkspace(handles);
end

function menu_exportmatfile_Callback(hObject, eventdata, handles)
% Create a CHEBGUIEXPORTER object of the correct type:
exporter = chebguiExporter.constructor(handles.guifile.type);
% Export the solution to the workspace
exporter.toMat(handles);
end

function menu_options_Callback(hObject, eventdata, handles)
end

function menu_close_Callback(hObject, eventdata, handles)
delete(handles.chebguimainwindow)
end

function mainWindow_DeleteFcn(hObject, eventdata, handles)
end

function tempedit_Callback(hObject, eventdata, handles)
end

function menu_odedampednewton_Callback(hObject, eventdata, handles)
end

function menu_odedampednewtonon_Callback(hObject, eventdata, handles)
% Turn on damped Newton iteration.
handles.guifile.options.damping = '1';
set(handles.menu_odedampednewtonon, 'checked', 'on');
set(handles.menu_odedampednewtonoff, 'checked', 'off');
guidata(hObject, handles);
end

function menu_odedampednewtonoff_Callback(hObject, eventdata, handles)
% Turn off damped Newton iteration.
handles.guifile.options.damping = '0';
set(handles.menu_odedampednewtonon, 'checked', 'off');
set(handles.menu_odedampednewtonoff, 'checked', 'on');
guidata(hObject, handles);
end

function menu_odeplotting_Callback(hObject, eventdata, handles)
end

function menu_pdeSolver_Callback(hObject, eventdata, handles)
end

function menu_pdeSolver_pde15s_Callback(hObject, eventdata, handles)
handles.guifile.options.pdeSolver = 'pde15s';
set(handles.menu_pdeSolver_pde15s, 'checked', 'on');
set(handles.menu_pdeSolver_pde23t, 'checked', 'off');
guidata(hObject, handles);
end

function menu_pdeSolver_pde23t_Callback(hObject, eventdata, handles)
handles.guifile.options.pdeSolver = 'pde23t';
set(handles.menu_pdeSolver_pde15s, 'checked', 'off');
set(handles.menu_pdeSolver_pde23t, 'checked', 'on');
guidata(hObject, handles);
end

function menu_pdeplotting_Callback(hObject, eventdata, handles)
end

function menu_odeplottingon_Callback(hObject, eventdata, handles)
% Turn on plotting.
handles.guifile.options.plotting = get(handles.menu_odeplottingpause, ...
    'UserData'); % Obtain length of pause from handles
set(handles.menu_odeplottingon, 'checked', 'on');
set(handles.menu_odeplottingoff, 'checked', 'off');
guidata(hObject, handles);
end

function menu_odeplottingoff_Callback(hObject, eventdata, handles)
% Turn off plotting.
handles.guifile.options.plotting = 'off'; % Should store plotting length
set(handles.menu_odeplottingon, 'checked', 'off');
set(handles.menu_odeplottingoff, 'checked', 'on');
guidata(hObject, handles)
end

function menu_odeplottingpause_Callback(hObject, eventdata, handles)
% Control the pause between plots during Newton iteration.
options.WindowStyle = 'modal';
valid = 0;
while ( ~valid )
    pauseInput = inputdlg('Length of pause between plots:', ...
        'Set pause length', 1, {get(hObject, 'UserData')}, options);
    if ( isempty(pauseInput) ) % User pressed cancel
        break
    elseif ( ~isempty(str2num(pauseInput{1})) ) % Valid input
        valid = 1;
        % Store new value in the UserData of the object
        set(hObject, 'UserData', pauseInput{1});
        % Update length of pause in the chebgui object
        handles.guifile.options.plotting = pauseInput{1};
        % Change the marking of the options
        set(handles.menu_odeplottingon, 'checked', 'on');
        set(handles.menu_odeplottingoff, 'checked', 'off');
    else
        f = errordlg('Invalid input.', 'Chebgui error', 'modal');
        uiwait(f);
    end
end
guidata(hObject, handles)
end

function menu_plotOpt_Callback(hObject, eventdata, handles)
end

function menu_showgrid_Callback(hObject, eventdata, handles)
end

function menu_pdeholdplot_Callback(hObject, eventdata, handles)
end

function menu_pdefix_Callback(hObject, eventdata, handles)
end

function menu_pdeplotfield_Callback(hObject, eventdata, handles)
end

function menu_pdeholdploton_Callback(hObject, eventdata, handles)
% Turn on holding on of previous solutions while solving PDEs.
handles.guifile.options.pdeholdplot = 1; % Turn holding off
set(handles.menu_pdeholdploton, 'checked', 'on');
set(handles.menu_pdeholdplotoff, 'checked', 'off');
guidata(hObject, handles);
end

function menu_pdeholdplotoff_Callback(hObject, eventdata, handles)
% Turn off holding on of previous solutions while solving PDEs.
handles.guifile.options.pdeholdplot = 0; % Turn holding off
set(handles.menu_pdeholdploton, 'checked', 'off');
set(handles.menu_pdeholdplotoff, 'checked', 'on');
guidata(hObject, handles);
end

function menu_pdeplottingon_Callback(hObject, eventdata, handles)
handles.guifile.options.plotting = 'on'; % Obtain length of pause from handles
set(handles.menu_pdeplottingon, 'checked', 'on');
set(handles.menu_pdeplottingoff, 'checked', 'off');
guidata(hObject, handles);
end

function menu_pdeplottingoff_Callback(hObject, eventdata, handles)
handles.guifile.options.plotting = 'off'; % Obtain length of pause from handles
set(handles.menu_pdeplottingon, 'checked', 'off');
set(handles.menu_pdeplottingoff, 'checked', 'on');
guidata(hObject, handles);
end

function menu_tolerance_Callback(hObject, eventdata, handles)
% Called when the user inputs tolerance.
options.WindowStyle = 'modal';
valid = 0;
while ( ~valid )
    tolInput = inputdlg('Tolerance for solution:', 'Set tolerance', ...
        1, {get(hObject, 'UserData')}, options);
    if ( isempty(tolInput) ) % User pressed cancel
        break
    elseif ( ~isempty(str2num(tolInput{1})) ) % Valid input
        valid = 1;
        % Store new value in the UserData of the object
        set(hObject, 'UserData', tolInput{1});
        % Update the chebgui object
        handles.guifile.tol = tolInput{1};
    else
        f = errordlg('Invalid input.', 'Chebgui error', 'modal');
        uiwait(f);
    end
end
guidata(hObject, handles)
end

function check_uselatest_Callback(hObject, eventdata, handles)
end

function menu_showgridon_Callback(hObject, eventdata, handles)
% Show grid on figures.
handles.guifile.options.grid = 1; % Turn grid on
set(handles.menu_showgridon, 'checked', 'on');
set(handles.menu_showgridoff, 'checked', 'off');
axes(handles.fig_sol);
grid on
axes(handles.fig_norm);
grid on
guidata(hObject, handles);
end

function menu_showgridoff_Callback(hObject, eventdata, handles)
% Don't show grid on figures.
handles.guifile.options.grid = 0; % Turn grid off
set(handles.menu_showgridon, 'checked', 'off');
set(handles.menu_showgridoff, 'checked', 'on');
axes(handles.fig_sol);
grid off
axes(handles.fig_norm);
grid off
guidata(hObject, handles);
end

function menu_fixN_Callback(hObject, eventdata, handles)
end

function menu_annotateplots_Callback(hObject, eventdata, handles)
end

function menu_pdefixon_Callback(hObject, eventdata, handles)
% Fix lower and upper y-lims of plot when solving PDEs.
options.WindowStyle = 'modal';
valid = 0;
defaultAnswer = {handles.guifile.options.fixYaxisLower, ...
    handles.guifile.options.fixYaxisUpper};
while ( ~valid )
    fixInput = inputdlg({'Lower y-limit:', 'Upper y-limit:'}, 'Fix y-axis', ...
        1, defaultAnswer, options);
    if ( isempty(fixInput) ) % User pressed cancel
        break
    elseif ( ~isempty(str2num(fixInput{1})) && ...
             ~isempty(str2num(fixInput{2})) ) % Valid input
        valid = 1;
        % Store new value in the UserData of the object
        set(hObject, 'UserData', fixInput);
        % Update the chebgui object
        handles.guifile.options.fixYaxisLower = fixInput{1};
        handles.guifile.options.fixYaxisUpper = fixInput{2};
    else
        f = errordlg('Invalid input.', 'Chebgui error', 'modal');
        uiwait(f);
    end
end

% Change checking
set(handles.menu_pdefixon, 'checked', 'on');
set(handles.menu_pdefixoff, 'checked', 'off');
guidata(hObject, handles);

end

function menu_pdefixoff_Callback(hObject, eventdata, handles)
% Don't fix y-lims when solving PDEs.
% Clear out fix information
handles.guifile.options.fixYaxisLower = '';
handles.guifile.options.fixYaxisUpper = '';
% Change checking
set(handles.menu_pdefixon, 'checked', 'off');
set(handles.menu_pdefixoff, 'checked', 'on');
guidata(hObject, handles);
end

function sigma_Callback(hObject, eventdata, handles)
end

function sigma_CreateFcn(hObject, eventdata, handles)
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'), ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end
end

function button_export_Callback(hObject, eventdata, handles)

    % What discretization do we want to use?
    if ( get(handles.button_collocation, 'Value') )
        handles.guifile.options.discretization = 'collocation';
    else
        handles.guifile.options.discretization = 'ultraspherical';
    end

    % Create a CHEBGUIEXPORTER object of the correct type:
    exporter = chebguiExporter.constructor(handles.guifile.type);
    % Call the export method of the E object:
    try
        [fileName, pathName] = uiputfile( ...
            {'*.m', 'M-files (*.m)'; '*.*',  'All Files (*.*)'}, ...
            'Save as', exporter.defaultFileName);
        if ( fileName ~= 0 )     % User did not press cancel
            toFile(exporter, handles.guifile, fileName, pathName)

            % Open the new file in the editor
            open([pathName, fileName])
        end

    catch ME
        % TODO: Which error do we want to throw?
        error('CHEBFUN:chebguiWindow:export', ...
            ['Error in exporting to .m file. Please make ' ...
            'sure there are no syntax errors.']);
    end
end

function button_realplot_Callback(hObject, eventdata, handles)
% We want to show the real part of eigenfunctions.
set(handles.button_realplot, 'Value', 1)
set(handles.button_imagplot, 'Value', 0)
selection = get(handles.iter_list, 'Value');
chebguiController.plotEigenmodes(handles, selection)
end

function button_imagplot_Callback(hObject, eventdata, handles)
% We want to show the imaginary part of eigenfunctions.
set(handles.button_realplot, 'Value', 0)
set(handles.button_imagplot, 'Value', 1)
selection = get(handles.iter_list, 'Value');
chebguiController.plotEigenmodes(handles, selection)
end

function menu_fixNon_Callback(hObject, eventdata, handles)
% Fix spatial discretization when solving PDEs.
options.WindowStyle = 'modal';
valid = 0;
defaultAnswer = {handles.guifile.options.fixN};
while ( ~valid )
    fixInput = inputdlg({'Number of gridpoints:'}, ...
        'Fix space discretisation', 1, defaultAnswer, options);
    if ( isempty(fixInput) ) % User pressed cancel
        break
    elseif ( ~mod(str2num(fixInput{1}), 1) ) % Only allow integers
        valid = 1;
        % Store new value in the UserData of the object
        set(hObject, 'UserData', fixInput);
        % Update the chebgui object
        handles.guifile.options.fixN = fixInput{1};
    else
        f = errordlg('Invalid input.', 'Chebgui error', 'modal');
        uiwait(f);
    end
end
% Change checking
set(handles.menu_fixNon, 'checked', 'on');
set(handles.menu_fixNoff, 'checked', 'off');
guidata(hObject, handles);
end

function menu_fixNoff_Callback(hObject, eventdata, handles)
% Don't fix spatical discretizations when solving PDEs.
handles.guifile.options.fixN = '';
% Change checking
set(handles.menu_fixNon, 'checked', 'off');
set(handles.menu_fixNoff, 'checked', 'on');
guidata(hObject, handles);
end

function menu_import_Callback(hObject, eventdata, handles)
% Import variables from the workspace to the scope of CHEBGUI

% Obtain a 'whos' list from the base workspace
variables =  evalin('base', 'whos');
baseVarNames = {variables.name};

% Create a list dialog
[selection, OK] = listdlg('PromptString', 'Select variable(s) to import:', ...
    'ListString', baseVarNames, 'Name', 'Import variables to GUI', ...
    'OKString', 'Import', 'ListSize', [160 200], 'ListString', baseVarNames);

if ( ~OK ) % User pressed cancel
    return
end

% Store all the selected variables in the handles
for selCounter = 1:length(selection)
    handles.importedVar.(baseVarNames{selection(selCounter)}) = ...
        evalin('base', baseVarNames{selection(selCounter)});
end

guidata(hObject, handles);

end

function menu_eigssystem_Callback(hObject, eventdata, handles)
end

% Executes on key press with focus on chebguimainwindow and none of its controls.
function chebguimainwindow_KeyPressFcn(hObject, eventdata, handles)
% hObject    handle to chebguimainwindow (see GCBO)
% eventdata  structure with the following fields (see FIGURE)
%	Key: name of the key that was pressed, in lower case
%	Character: character interpretation of the key(s) that was pressed
%	Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles    structure with handles and user data (see GUIDATA)
edata = eventdata;
if ( ~isempty(edata.Modifier) && strcmp(edata.Modifier{1}, 'control') )
    switch ( edata.Key )
        case 'return'
            button_solve_Callback(hObject, eventdata, handles);
        case 'e'
            button_export_Callback(hObject, eventdata, handles);
        case {'+', 'equal'}
            button_fontinc_Callback(hObject, eventdata, handles);
        case {'-', 'hyphen'}
            button_fontdec_Callback(hObject, eventdata, handles);
        case 'p'
            if ( any(strcmp(get(handles.button_clear, 'String'), ...
                    {'Pause', 'Continue'})) )
                button_clear_Callback(hObject, eventdata, handles);
            end
    end
end
% PressedKeyNo = double(get(gcbo, 'CurrentCharacter'))
end

function edit37_CreateFcn(hObject, eventdata, handles)
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'),  ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end
end

function edit37_Callback(hObject, eventdata, handles)
in = get(handles.edit_eigN, 'String');
if ( ~isempty(in) && isempty(str2num(in)) )
    errordlg('Invalid input.', 'Chebgui error', 'modal');
else
    handles.guifile.options.numeigs = in;
end
guidata(hObject, handles);
end

function menu_annotateon_Callback(hObject, eventdata, handles)
end

function menu_annotateoff_Callback(hObject, eventdata, handles)
end

function menu_about_Callback(hObject, eventdata, handles)
% The about information display.
aboutWindow = dialog('WindowStyle', 'normal', 'Name', 'About chebgui', ...
    'Position', [500 500 200 200]);
aboutString = sprintf(['Chebgui was developed by Asgeir Birkisson and Nick ' ...
    'Hale as an interface to the differential equations in Chebfun.']);
uicontrol(aboutWindow, ... % Text
             'Style', 'text', ...
             'String', aboutString, ...
             'position', [0 -90 200 200])
uicontrol(aboutWindow, ... % Close button
             'Style', 'pushbutton', 'String', 'Close', 'position', ...
             [65 10 75 20], 'callback', @(a, b, c) delete(aboutWindow))

hPlotAxes = axes(...       % Axes for plotting the selected plot
                 'Parent', aboutWindow, ...
                 'Units', 'normalized', ...
                 'HandleVisibility', 'callback', 'position', [0.1 0.6 .8 .25]);

% Plot the logo
f = chebpoly(10);
xx = linspace(-1, .957, 1000);
plot(hPlotAxes, xx, f(xx), 'linewidth', 3)
t = -cos(pi*(2:8)'/10) *0.99;  % cheb extrema (tweaked)
y = 0*t;
h = text(t, y, num2cell(transpose('chebgui')), ...
    'fontsize', 16, 'hor', 'cen', 'vert', 'mid', 'parent', hPlotAxes);
flist = listfonts;
k = strmatch('Rockwell', flist);        % 1st choice
k = [k; strmatch('Luxi Serif', flist)]; % 2nd choice
k = [k; strmatch('luxiserif', flist)];  % 2.5th choice
k = [k; strmatch('Times', flist)];      % 3rd choice

if ( ~isempty(k) )
    set(h, 'fontname', flist{k(1)})
end

axis(hPlotAxes, 'off')

end

function menu_shortcuts_Callback(hObject, eventdata, handles)
% hObject    handle to menu_shortcuts (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
aboutWindow = dialog('WindowStyle', 'normal', 'Name', 'About chebgui', ...
    'Position', [500 500 200 275]);
aboutString = sprintf(['The following keyboard shortcuts are supported ' ...
    '(case insensitive):\n', ...
    'Ctrl + Return = Solve\n', ...
    'Ctrl + P = Pause\n', ...
    'Ctrl + E = Export to .m file\n', ...
    'Ctrl + + = Increase font-size\n', ...
    'Ctrl + - = Decrease font-size',    ]);
uicontrol(aboutWindow, ... % Text
             'Style', 'text', ...
             'String', aboutString, ...
             'position', [0 -40 200 200])
uicontrol(aboutWindow, ... % Close button
             'Style', 'pushbutton', 'String',  'Close', 'position', ...
             [65 10 75 20], 'callback', @(a, b, c) delete(aboutWindow))

hPlotAxes = axes(...       % Axes for plotting the selected plot
                 'Parent', aboutWindow, ...
                 'Units', 'normalized', ...
                 'HandleVisibility', 'callback', 'position', [0.1 0.6 .8 .25]);

% Plot the logo
f = chebpoly(10);
xx = linspace(-1, .957, 1000);
plot(hPlotAxes, xx, f(xx), 'linewidth', 3)
t = -cos(pi*(2:8)'/10) *0.99;  % cheb extrema (tweaked)
y = 0*t;
h = text(t, y, num2cell(transpose('chebgui')), ...
    'fontsize', 16, 'hor', 'cen', 'vert', 'mid', 'parent', hPlotAxes);
flist = listfonts;
k = strmatch('Rockwell', flist);  % 1st choice
k = [k; strmatch('Luxi Serif', flist)];  % 2nd choice
k = [k; strmatch('luxiserif', flist)];  % 2.5th choice
k = [k; strmatch('Times', flist)];  % 3rd choice

if ( ~isempty(k) )
    set(h, 'fontname', flist{k(1)})
end

axis(hPlotAxes, 'off')

end

function msg = cleanErrorMsg(msg)
errUsingLoc = strfind(msg, sprintf('Error using'));
if ( errUsingLoc )
    % Trim everything before this
    msg = msg(errUsingLoc:end);
    % Look for first two line breaks (char(10))
    idx = find(msg == char(10), 1);
    % Take only what's after the 2nd
    msg = msg(idx+1:end);
end
end

function button_exportsoln_Callback(hObject, eventdata, handles)
% Create a CHEBGUIEXPORTER object of the correct type:
exporter = chebguiExporter.constructor(handles.guifile.type);
% Export the solution to the workspace
exporter.toWorkspaceSolutionOnly(handles);
end

function button_fontinc_Callback(hObject, eventdata, handles)
handles = chebguiController.changeFontsize(handles, 1);
guidata(hObject, handles);
end

function button_fontdec_Callback(hObject, eventdata, handles)
handles = chebguiController.changeFontsize(handles, -1);
guidata(hObject, handles);
end

function keypress(hObject, eventdata, handles)
newString = cellstr(get(hObject, 'String'));
newString = removeTabs(newString); % Remove tabs
set(hObject, 'String', newString);
handles = chebguiController.callbackBCs(handles,  newString, 'rbc');
handles.guifile.RBC = newString;
guidata(hObject, handles);
end

function menu_test_Callback(hObject, eventdata, handles)
% Try running all CHEBGUI demos.
T = 0;
folders = {'bvpdemos', 'pdedemos', 'eigdemos'};
for k = 1:numel(folders)
    subdir = fullfile(chebfunroot(), '@chebgui', 'private', folders{k});
    subdirlist = dir(subdir);
    subdirnames = { subdirlist.name };
    fprintf([folders{k}(1:3) , '\n']);

    for j = 1:length(subdirnames)
        if ( subdirlist(j).isdir )
            continue;
        end

        file = fullfile(subdir, subdirnames{j});
        cgTemp = chebgui(file);
        chebguiController.populate(hObject, handles, cgTemp)
        handles.guifile = cgTemp;
        if ( ~isempty(cgTemp.type) )
            handles = chebguiController.switchMode(handles, cgTemp.type);
        end

        handles.hasSolution = 0;
        name = subdirnames{j};
        name = strrep(name, '.guifile', '');
        fprintf(['  ' , name]);
        try
            tic
            handles = solveGUI(handles.guifile, handles);
            t = toc;
            guidata(hObject, handles);
            T = T + t;
            if ( ~handles.hasSolution )
                try
                   close('Chebgui error')
                catch
                    %
                end
                error('CHEBFUN:chebguiWindow:noSol', 'No solution returned.');
            end
            fprintf('  passed in %4.4f seconds.\n', t);
        catch ME
            try
                close('Chebgui error')
            catch
                %
            end
            fprintf('  FAILED.\n');
        end
    end
end

fprintf('TOTAL TIME = %4.4f.\n', T);

end

function menu_debug_Callback(hObject, eventdata, handles)
% hObject    handle to menu_debug (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if ( strcmp(get(handles.menu_debug, 'checked'), 'on') )
    set(handles.menu_debug, 'checked', 'off');
    set(handles.menu_debug, 'UserData', 0);
else
    set(handles.menu_debug, 'checked', 'on');
    set(handles.menu_debug, 'UserData', 1);
end
guidata(hObject, handles);
end

function resetComponents(handles)
% Enable buttons, figures, etc. Set button to 'solve' again
set(handles.button_solve, 'String', 'Solve');
set(handles.button_solve, 'BackgroundColor', [43 129 86]/256);
set(handles.button_clear, 'String', 'Clear all');
set(handles.button_clear, 'BackgroundColor', ...
    get(handles.button_export, 'BackgroundColor'));
set(handles.button_figsol, 'Enable', 'on');
set(handles.button_exportsoln, 'Enable', 'off');
set(handles.menu_demos, 'Enable', 'on');
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function popupmenu_bottomFig_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu_bottomFig (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% DEVELOPER NOTE:
%   contents = cellstr(get(hObject, 'String')) returns popupmenu_bottomFig
%       contents as cell array
%   contents{get(hObject, 'Value')} returns selected item from
%       popupmenu_bottomFig

% We should not be able to call this method without solution being available,
% but let's be on the safe side.
if ( ~handles.hasSolution )
    return
end

newVal = get(hObject, 'Value');
axes(handles.fig_norm)
switch ( newVal )
    case 1
        % User wants to see a plot showing the convergence of the Newton
        % iteration.
        normDelta = handles.latest.normDelta;

        % If normDelta is empty, we actually had a linear problem! So don't
        % do anything.
        if ( isempty(normDelta) )
            warndlg(['Problem was linear. Convergence information for' ...
                ' Newton iteration is not available.'], 'Linear problem');
            set(handles.popupmenu_bottomFig, 'Value', 2);
            return
        end

        semilogy(normDelta, '-*', 'Linewidth', 2)
        set(handles.panel_figNorm, 'title', 'Norm of updates');

        if ( length(normDelta) > 1 )
            step = max(floor(length(normDelta)/5), 1);
            XTickVec = 1:step:length(normDelta);
            set(gca, 'XTick', XTickVec)
            xlim([1 length(normDelta)])
            grid on
        else % Don't display fractions on iteration plots
            set(gca, 'XTick',  1)
        end

    case 2
        % User wants to see a PLOTCOEFFS plot..
        plotcoeffs(handles.latest.solution, 'linewidth', 2);
        plotCoeffsTitle = get(get(handles.fig_norm, 'title'), 'String');
        set(handles.panel_figNorm, 'title', plotCoeffsTitle);
        title('');
        % Hide the automatic y-label as it causes issues when fontsize is too big
        ylabel('');
        xlabel('');
end

end

function popupmenu_bottomFig_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu_bottomFig (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
bgColorIsDefault = isequal(get(hObject, 'BackgroundColor'), ...
    get(0, 'defaultUicontrolBackgroundColor'));
if ( ispc && bgColorIsDefault )
    set(hObject, 'BackgroundColor', 'white');
end

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

redpajama_set_name: RedPajamaGithub


text:
Praonethomimus is een kevergeslacht uit de familie van de boktorren (Cerambycidae). De wetenschappelijke naam van het geslacht werd voor het eerst geldig gepubliceerd in 1939 door Breuning.

Soorten
Praonethomimus is monotypisch en omvat slechts de volgende soort:
 Praonethomimus tuberosithorax Breuning, 1939

Boktorren


How did our CEO guest go from drug addict to successful businessman and extreme adventurer? Listen as Marco Broccardo, CEO of Colony Live, shares this journey... as well as how he is taking his business international - starting with America. Listen to this #FutureCEOs' #MeetTheCEO conversation.


9 pm / Serotonin Serotonin's first public performance and EP release celebration! Serotonin is a collaboration between Michael Mayo (Thelonious Monk Institute), Amber Navran (Moonchild), and Ted Case (Purple Crayon). Ted writes songs that Michael and Amber bring beautifully to life, illustrating lyrics with harmony.
10:15 pm / Kidi Band Kidi Band plays grooves to make you dance and melodies to make you sing. Polyrhythms and tight harmonies paint new aural landscapes, exploring the spectrum from quiet and sonorous to intense and saturated. Their four voices, prepared guitar, and percussion work together to create a unique musical experience.


text:
To Set Foot on a Foreign Land
June 3, 2015 July 7, 2015 / Richard Senior
"The whole object of travel," wrote Chesterton in The Riddle of the Ivy, "is not to set foot on foreign land; it is at last to set foot on one's own country as a foreign land".
The parochialism of the British newspapers seemed laughable after six months away. They wrote as if the nation's power and influence were unchanged since 1860, as if it were in a Cold War with the European Union, whose member states were all virtually communist, and as if the entire population of every country outside the OECD were determined to come to Britain to claim Job Seeker's Allowance, and would if the borders were not kept on a war footing. I had forgotten all that.
I had forgotten, too, that everything here always seems to be broken. The toilet at the airport did not flush; no water came out of the taps, no air came out of the hand dryers. The trains were delayed, as they usually are; several were cancelled, as ever. Every third or fourth shop on the high street had a fading To Let sign in the window. Some big names had gone bust while I had been away. Pawnbrokers were back, although they were not called that anymore.
I got cash from an ATM and stared at it for a moment, nonplussed. Sterling looked like something from a museum: so big, so thick, so conservative in design. No one else's currency is like that.
It was a five hour journey on four trains to get up north to see my family. Six months earlier, I would never have contemplated it straight after an overnight flight. But it no longer seemed such a big undertaking. In Australia, in New Zealand, in the States, I had routinely spent seven or eight hours on a bus, sometimes day after day. My sense of scale had changed.
For a time, I saw home as a tourist sees it. I noticed the black cabs and red buses; the unarmed policemen; the bluebell woods and the drizzly skies; the thatched cottages and cricket greens; and, less happily, the casual destruction of century-old buildings to make way for disposable office blocks.
The gratuitous thank yous and sorrys seemed quaint now; and it was alarming to see – underneath the civility – a constantly simmering aggression. There is the baffling hostility from shopkeepers who need your custom to stay in business, the tuts and muttered insults in the supermarket aisle if your trolley crosses somebody's path, the furious faces of the commuting crowd, the people who leap from their cars at the lights and scream obscenities at some other driver, and the virtual certainty of seeing a serious fight if you go out for the evening.
What was wrong with everyone, I wondered. Where was their sense of proportion? Why did they let themselves get so angry over so little? How could someone end up in intensive care because he, or the other guy, spilled a drink?
Seemingly I had set foot on a foreign land.
Image: "Red Phone Box" By Dunpharlain (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)%5D, via Wikimedia Commons
← A Bog Above Standard
Gangneung: Sun, Sea and Spy Submarines →
2 thoughts on "To Set Foot on a Foreign Land"
sweetsound
I've not seen a brawl but most of my Scottish acquaintances have been in them at some time or another, usually over something small or nothing but a passing glance, which always seemed a little baffling to me even though it no doubt happens in America too.
When I first moved to London, I didn't see a fight for a long time, while in my hometown it would be unusual not to see one on a Friday or Saturday night – some of them very nasty, with broken glass and furniture. Friends who had moved from the provinces said the same thing. But in the last few years I have seen a few in London too. I don't understand it. Obviously people fight in every country in the world but nowhere else that I've been to, including the US and much of Europe, is it so prevalent in the main streets/stations/trains.


text:
Bidessodes acharistus är en skalbaggsart som beskrevs av Young 1986. Bidessodes acharistus ingår i släktet Bidessodes och familjen dykare. Inga underarter finns listade i Catalogue of Life.

Källor

Dykare
acharistus


This Awesome Photo of 8 Fabulous Kitchen Curtain Valances is totally extraordinary for your inspiration. The image Resolution 864 x 1024 px and the image size only 99 kb. Many of our visitors choose this as favourite in Others Category.
8 Fabulous Kitchen Curtain Valances was added at November 27, 2014. More than thousand web visitors has already save as this photos to their device.
You can also download the photos under 8 Fabulous Kitchen Curtain Valances articles for free. All you need to do is just sharing this photos to your friends.


text:
Lenguas y Culturas (2) Apply Lenguas y Culturas filter
Mujeres Indígenas (4) Apply Mujeres Indígenas filter
Foro Permanente Para Cuestiones Indigenas 2014 (1) Apply Foro Permanente Para Cuestiones Indigenas 2014 filter
Indigenous Women Changemakers (2) Apply Indigenous Women Changemakers filter
UN Permanent Forum on Indigenous Issues 2015 (2) Apply UN Permanent Forum on Indigenous Issues 2015 filter
(-) Remove Entrevistas filter Entrevistas
Linda Coombs on Plymouth 400
The Wampanoag Peoples have lived in the region of what is now southeastern Massachusetts for more than 12,000 years. The year 2020 represents 400 years since colonizers voyaged on the Mayflower and founded Plymouth Colony as settlers on Native land. This anniversary is a time of reckoning with that history of violence, dispossession, removal. The story of Plymouth Colony cannot be told without the perspectives of Indigenous Peoples who were here as that ship arrived and who still remain.
Indigenous Food Security In The Arctic
For Indigenous Peoples, food security is necessary for health, and also to maintain a relationship with the earth and its resources.
What is also valuable for Indigenous Peoples is to consume culturally appropriate food. In this radio program, we speak to Dr. Dalee Sambo Dorough and Carolina Behe, as we find out more about food sovereignty and food security amongst Inuit and Peoples in the Arctic.
Producer: Shaldon Ferris (KhoiSan)
Interviewees: Carolina Behe and Dr. Dalee Sambo Dorough(Iñupiat)
Image: Berry picking. Photo by Chris Arend.
Stand Tall Like A Mountain_Indigenous Peoples' Day 2018
Indigenous peoples' day is about honoring indigenous resistance, and celebrating the contributions of indigenous peoples all over the world. In this newsletter we celebrate the activism of Antie Pua Case from Hawaii, and other activists around the world who fight to preserve our mountains, our rivers, our valleys, our Earth. The program ends with a song by Taino artist Brothery Mikey, who produced a song called "Like the Mauna", inspired by the Indigenous People of Hawaii's efforts to protect the sacred Mauna.
Indigenous Refugees Struggling to Find Nationhood- A Story of Displacement from Myanmar (Burma)
Indigenous Peoples from around the world represent a disproportionate number of refugees and internally displaced persons due to a number of reasons, including conflict. They are one of the main targets of violence, displacing them from their ancestral land and territories. Vulnerability to displacement as an intersectional issue is often overlooked, a situation that has further increased the vulnerability of these populations. This radio program recounts the experience of Nwe Oo, an Indigenous Rakhine refugee who is currently taking shelter in California, United States.
Bears Ears At Risk
The reduction in size of the Bears Ears National Monument by the Trump Administration runs contrary to the principles established in Article 26 of the United Nations Declaration of the Rights of Indigenous Peoples. We spoke to Braidan Weeks, the Communications Coordinator for Utah Diné Bikéyah, about the importance of Bears Ears, the unlawfulness of the actions taken by the Trump administration, and the advocacy currently underway to defend the monument led by the Tribes of the Bears Ears Inter-Tribal Coalition.
We Are Still Here- A Message of Unity for Thanksgiving
It was the Wampanoag People, the people of the first light, that encountered the Pilgrims when they arrived to Turtle Island (North America) from Europe in 1620. Since 1863, Thanksgiving has been celebrated as a national holiday in the United States, mythologizing the violent events that followed European arrival into a story of friendship and mutual sharing. But the reality is that the Wampanoags' generosity was met with genocide, and this truth has been systematically suppressed in the US education system, government, and popular culture.
Indigenous Resiliency Amidst Changes In Fire And Ice
A close relationship with local environments and ecosystems is more critical than ever in the face of a rapidly changing climate. This program features two perspectives from Indigenous communities that are practicing resiliency to global warming by adapting their traditional knowledge and science to put a changing climate into the context of their communities' history and lifeways.
Elizabeth Azzuz (Yurok), Cultural Fire Management Council
Jannie Staffansson (Saami), Arctic and Environment Unit of the Saami Council
Indigenous Human Rights Defenders
Indigenous solidarity has coalesced into a powerful movement thanks to the activism and perseverance of Indigenous leaders from communities around the world. Indigenous leaders that are defending land, language, culture, and the environment face acute persecution, both from governments directly and from extrajudicial actors.
What Will a Trump Presidency Mean for U.S. Indigenous Communities?
Suzanne Benally is a leader in Indigenous Rights advocacy, and serves as the Executive Director of Cultural Sur
UNSR Interview On Dakota Access Pipeline - Oct. 2016
Indigenous Rights Radio Producer Shaldon Ferris interviews Vicky Tauli-Corpuz, UN Special Rapporteur on the Rights of Indigenous Peoples, about the Dakota Access Pipeline. Vicky describes the central tensions underlying the current conflict, and details the opportunities for recourse available to the Standing Rock Sioux tribe through both local and international governing bodies.
Interview with Vicky Tauli-Corpuz
Production by Shaldon Ferris
"Danum", by Salidumayy DKK
Interview with Winona LaDuke at the People's Climate March
We're here in New York City at the People's Climate March, marching alongside Indigenous communities from all over the world who have joined together to demand action towards solutions for climate change. Here are some words from Winona LaDuke, a long time leader of the Native environmental movement in the United States.
Indigenous Women Changemakers: Dalee Sambo Dorough
Dr. Dalee Sambo Dorough (Innuit, Alaska, USA) discusses her early engagement in the politics of Indigenous Peoples land rights, and shares her insight into why the defense of land merits extra international legal attention. She urges leaders to have optimism, and take "the long view" approach to making progress in the protection of Indigenous rights.
Producer: Avexnim Cojti
Participants discuss what food sovereignty means for Indigenous Peoples. Speakers include Native American activist, and author Dr. Winona Laduke, and Dr. Grazia Borrini-Feyerabend, Global Coordinator of the ICCA Consortium, and David Strelneck, Senior Advisor at Ashoka Foundation.
Produced by Dev Kumar Sunuwar and Jagat Dong from Nepal, for Cultural Survival after attending the Indigenous Terra Madre conference held in November, 2015 in Meghalaya, North East India.
Dalee Sambo on Accountability at UNPFII 2015
Dalee Sambo discusses the exchange between the Brazilian government's representative and representatives of Brazil's Indigenous tribes at the UNPFII 2015. Violations of Land Rights continue in Brazil, including the criminalization of Indigenous Peoples who are trying to defend their rights to land.
Interview Antonio Gonzales on the Right to Free Prior and Informed Consent
Antonio Gonzales explains how without proper enforcement governments, cooperations, and extractive industries willingly ignore frameworks like FPIC which are designed to protect the rights of indigneous peoples.


text:
» While we're young
While we're young
(DVD)
Baumbach, Noah, 1969- film director,
Stiller, Ben, 1965- actor.
Watts, Naomi, 1968- actor.
Dizzia, Maria, 1974- actor.
Driver, Adam, actor.
A24 Media, production company.
IAC Films
Lions Gate Films (Santa Monica, Calif.) publisher.
[United States] : Lionsgate, [2015].
1 videodisc (97 min.) : sound, color ; 4 3/4 in.
MPAA rating: R; for language.
DVD-R WHI
Couples -- Drama.
Round Rock Public Library - Adult Audio/Video (1st floor) DVD-R WHI On Shelf
Participants/Performers
Ben Stiller, Naomi Watts, Adam Driver, Maria Dizzia, Adam Horovitz.
Cornelia and Josh get their lives turned upside down when a young couple enters their lives.
DVD, widescreen presentation; 5.1 Dolby Digital.
English dialogue; English or Spanish subtitles; closed-captioned.
Baumbach, N., Stiller, B., Watts, N., Dizzia, M., & Driver, A. (2015). While we're young . Lionsgate.
Noah Baumbach et al.. 2015. While We're Young. [United States]: Lionsgate.
Noah Baumbach et al.. While We're Young [United States]: Lionsgate, 2015.
Baumbach, Noah, et al. While We're Young Lionsgate, 2015.


Andrew Hirsekorn is a founding member of Eagle and has over 13 years of experience in private equity, management consulting and investment banking. He currently serves on the Board of Directors of United PF Partners, Chicken Salad Chick, LSO and Vasari. Prior to Eagle, he was an Engagement Manager at McKinsey & Company and led projects across multiple industries and functional areas. Prior to McKinsey, he was an Associate at Arcapita and worked on the 3PD acquisition, the sale of Smart Document Solutions and TLC Health Care Services and strategic projects for Church's Chicken and Southland Log Homes. Prior to Arcapita, Andrew served in the Industrial Investment Banking group at SunTrust Robinson Humphrey. He has a B.S. in Business Administration from Washington & Lee University and an M.B.A from the Wharton School at the University of Pennsylvania.


text:
Orlando's Murals by District: West Art Walls
Photographs by Roberto Gonzalez,
Orlando's Murals by District: Downtown
Downtown Orlando's murals, photographed by Roberto Gonzalez.
Orlando's Murals by District: Milk District
It's not all dairy in the Milk District.
Orlando's Murals by District: Mills 50
The Mills 50 scene is a mixture of young and old.
Orlando's Murals by District: Thornton Park
Look at these lovely murals found in and around Thornton Park!
Scroll Through Orlando's Murals By District
Driving along Mills Avenue or through the Milk District, you're likely to be treated to an informal art show. Orlando has become a city of murals. Some of these artistic expressions are whimsical and iconic, while others are memorials to those we've lost, and still others are sweet reminders of the goodness in ourselves. These artworks make statements and are to be celebrated. Turn the page and take a visual tour of the street art in Downtown Orlando, Mills 50, the Milk District, Thornton Park and the West Arts District.


This contract does not obligate me to a major in nursing at PLU; I may change my mind and switch majors.
I understand that if there is space available to enter the nursing major during a semester I was not assigned, that I may request to change by contacting the School of Nursing during my freshman year at PLU.
Should I fail to meet the University's standards of good conduct and academic honesty as outlined in the PLU Student Handbook, the PLU School of Nursing Student Handbook, and University Catalog , my offer of admission to the PLU School of Nursing will be rescinded and my enrollment in nursing courses at PLU (if I have registered) will be cancelled.
I must comply with all health and certification requirements set by the university and the School of Nursing and submit documentation of the same to the appropriate offices, by due dates set by the University and the School of Nursing.
I must maintain a clean criminal history free of arrests, charges, or convictions to enroll in nursing classes. I understand that prior to starting nursing classes, and semi-annually during the nursing program, I must pass a civil, administrative and criminal history clearance in all states, as well as any applicable territory or country.
If English is not my first language, documented fluency in speaking, reading, writing and comprehending college-level English may be required prior to starting nursing coursework; see http://www.plu.edu/admission/international/apply/.
I must follow an approved pre-nursing curriculum (see enclosed example), completing a total of 32 credit hours in attendance at PLU during my freshman year and be enrolled as a full-time student (12 credits minimum for all regular terms, and 4 credits for January term) while enrolled in the pre-nursing sequence of study (prior to taking N220).
Should I for any reason be unable to progress through the pre-nursing or nursing courses per the approved curriculum, I am not automatically granted a leave of absence or opportunity to repeat coursework. Any request to participate in the program at any other time is neither guaranteed nor implied, and is on a space-available basis, if at all.
I must complete all college courses prior to taking N220 with a minimum grade of 3.0 (B) on a 4.0 scale. This applies to nursing pre- and co-requisites, electives, and general education classes, taken at PLU or another institution. With the exception of courses only offered as pass/fail, all courses must be taken for a letter grade and may not be taken on a pass/fail basis. Grades of W, WM, or I (incomplete) are not accepted.
Completion of nursing prerequisites at PLU is a fundamental aspect of the early conditional admission program. Permission to apply non-PLU classes taken prior to high school graduation toward fulfillment of the nursing pre- or co-requisites must be requested in writing by September 1 by emailing Admissions Coordinator Tracy Pitt at nurs@plu.edu. Permission is not automatically granted and is not regularly granted for pre-/co-requisites in the sciences.
Prerequisite and/or co-requisite courses completed after high school graduation at any college or university other than PLU may not be applied toward fulfillment of nursing pre- and/or co-requisites as part of my offer of early admission.
Should I fail to meet any of the conditions set forth in my letter of acceptance or this Letter of Confirmation, my offer of admission to the PLU School of Nursing will be rescinded and my enrollment in nursing courses at PLU will be cancelled.
I am not promised admission at any other date should I fail to meet any of the conditions set forth in my letter of acceptance, fail to meet the minimum eligibility requirements, fail to meet the progression requirements, and/or should my offer of admission to the PLU School of Nursing be rescinded.
Admission at a later date will not be guaranteed if I do not accept this initial offer of admission by the indicated deadline.
Your admission materials indicate the semester in which you are conditionally-admitted into the 3-year BSN program. If you are admitted to Fall 2020, view a sample curriculum here. If you are admitted to Spring 2021, view a sample curriculum here.


text:
Q: Node js Date() is not showing system date and time in Linux(Ubuntu) When I type date in terminal it is showing the original date time. but when I use new Date() in node it is showing 6 hours back.
Note: the timezone of the machine was different at first. but I changed it using
sudo timedatectl set-timezone this command.
How can I make bothe time syncronized?

A: You could try manually setting up the time. As always, I would encourage you to research the following commands prior to implementing to ensure trustworthiness. You can also utilize the man pages with # man command
$ ln -sf /usr/share/zoneinfo/Country/Region /etc/localtime
$ vi /etc/locale.gen

Uncomment yourlocaltime
Uncomment yourlocaltime2
$ locale-gen
$ echo LANG=yourlocaltime > /etc/locale.conf
$ export yourlocaltime

Follow up for safe measure with your time sync
$ timedatectl set-ntp true

An example for setting time for American/CDT would be the following process.
$ ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
$ vi /etc/locale.gen

Uncomment en_US.UTF-8
Uncomment en_US ISO-8859-1
$ locale-gen

$ echo LANG=en_US.UTF-8 > /etc/locale.conf

$ export LANG=en_US.UTF-8

$ timedatectl set-ntp true