Updating Pictures Daily

w/b at [email protected]
How do I get an img to change as the date changes?
I want to open/refresh my comic page and have the page return the respective strip for that date.
<script language="javascript">
<!--
     var mm, dd, yy, yyyy, Now, NowThen, Address
     Now = new Date(mm+'/'+ dd +'/'+ yy)
     NowThen = new Date(mm+'/'+ dd +'/'+ yyyy)
     yy = Now.getYear()
     yyyy = NowThen.getYear()
     mm = Now.getMonth() + 1
     dd = Now.getDate()
     Address = "'http://us.news2.yimg.com/us.yimg.com/p/cx/uc/' + yyyy + mm + dd + '/ga/ga' + yy + mm + dd + '.jpg'"
     document.write('<img alt="Garfield" id="ga" src="' + Address + '">;
//-->
</script>

Hi,
I've a different suggestion. Why don't you get the day of the week, from the user computer, using this:
java.util.GregorianCalendar, see the api at:
http://java.sun.com/products/jdk/1.2/docs/api/java/util/GregorianCalendar.html
And then in your applet code with some switch or if-else statement load the backgroung image...
Like:
private javax.swing.ImageIcon image;
switch(day)
  case 1:image=new javax.swing.ImageIcon(getClass().getResource("/yourPackage/images/imageDay1.gif"));repaint;break;
}Hope it helps!
Regards,
ANeto

Similar Messages

  • Exception has been thrown by the target of an invocation error while updating picture in user Profile

    Hi,
    I am working on updating picture of user profile in sharepoint 2013.
    I am getting error "exception has been thrown by the target of an invocation" while creating Thumbnail at the below line.
    "file = (SPFile)mi_CreateThumbnail.Invoke(null, new object[] { original, idealWidth, idealHeight, folder, fileName, null });"
    I have added SPUtility.ValidateFormDigest() before calling this method. but no luck.
    Please help me on this.
    Thanks
    Hareesh

    Hi,
    According to your post, my understanding is that you want to update picture in user Profile.
    If we are giving an option to change the Profile picture in our custom component, we need to create 3 different files and update the reference in User Profile property.
    To create Thumbnail, we can use the code as below:
    /// Get sealed function to generate new thumbernails
    public SPFile CreateThumbnail(Bitmap original, int idealWidth, int idealHeight, SPFolder folder, string fileName)
      SPFile file = null;
      Assembly userProfilesAssembly = typeof(UserProfile).Assembly;
    Type userProfilePhotosType = userProfilesAssembly.GetType("Microsoft.Office.Server.UserProfiles.UserProfilePhotos");
      MethodInfo [] mi_methods = userProfilePhotosType.GetMethods(BindingFlags.NonPublic | BindingFlags.Static);
      MethodInfo mi_CreateThumbnail = mi_methods[0];
      if (mi_CreateThumbnail != null)
        file = (SPFile)mi_CreateThumbnail.Invoke(null, new object[] { original, idealWidth, idealHeight, folder, fileName, null });
      return file;
    Then we can invoke the method as below:
    using (MemoryStream stream = new MemoryStream(buffer))
    using (Bitmap bitmap = new Bitmap(stream, true))
    CreateThumbnail(bitmap, largeThumbnailSize, largeThumbnailSize, subfolderForPictures, accountName + "_LThumb.jpg");
    CreateThumbnail(bitmap, mediumThumbnailSize, mediumThumbnailSize, subfolderForPictures, accountName + "_MThumb.jpg");
    CreateThumbnail(bitmap, smallThumbnailSize, smallThumbnailSize, subfolderForPictures, accountName + "_SThumb.jpg");
    More information:
    Update User Profile picture programmatically in SharePoint
    Upload User Profile Picture programmatically in SharePoint 2013
    Upload User Profile Pictures Programmatically – SharePoint 2013
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to Update Picture column in User Information List?

    Hi,
    The user updated his profile picture in mysite about 10 days ago. The updated picture is shown on his mysite but the same is not in sync with User Information List. The 2 timer job which takes care of the profile synchronization are scheduled as below:
    Profile Synchronization : hourly
    Quick Profile Synchronization : every 2 minutes
    And both the timer job status are shown as successful, yet the picture url is not updated.
    Can anyone kindly let me know is there any way to update the same manually.
    Please note that the version of SharEPoint is 2007 and Windows server 2003.
    Thanks in Advance.

    Hi Sheetal Lomate,
    It is correct to check the profile synchronization jobs to make sure profile information syncs between user profiles and user information list.
    If it is still not synced, please use the following stsadm command:
    stsadm –o sync –listolddatabases <x number of days>
    If one or more content databases show up in this list, clean up the list, they can be added to the list again:
    stsadm –o sync –deleteolddatabases <x number of days>
    Related reference:
    User Profiles and User Informtation list synchronization:
    http://www.sharepointchick.com/archive/2009/06/17/user-profiles-and-the-user-information-list-or-userinfo-table.aspx
    Thanks,
    Qiao
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Qiao Wei
    TechNet Community Support

  • Apple tv3 runs slowly on all apps in the box,after the last update.Picture sometimes runs slowly on netflix ,and all the apps in the apple tv3 box.But the sound is ok.Anyone else have this problem?

    Apple tv3 runs slowly on all apps in the box,after the last update.Picture sometimes run's slowly on netflix ,and all the apps in the apple tv3 box.But the sound is ok.Anyone else have this problem?I have a 20Mbit wireless line,but i had put a cable from my router to my apple box,but it did not help.

    Are you using a home network?
    Try the following :                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings

  • I thought my Iphone 4s updated contacts daily on Icloud.

    I thought my Iphone 4s updated contacts daily on Icloud.  My phone has over 700 contacts and Iphone 550.  How do I get these to update without plugging into my computer?

    correction Icloud has only 550 contacts

  • After I updated, pictures has gotten a yellow tint where it should be white.

    after I updated, pictures has gotten a yellow tint where it should be white. I checked the same websites in safari, and those sites shows perfect color.
    What can I do to fix this issue?
    Being a photographer, this is quite a big problem

    You are on Windows 2000, you do not have a "Firefox" button, and should consider yourself to be fortunate in that you still have menus and don't have to do anything to get the menus back instead of the "Firefox" button. (The same applies to Windows XP users).
    Use the "File" menu to get to Import. You are not on Windows 7 or Vista, and don't have to put up with the nonsense added for Aero.
    If you want the "Firefox" button you can get it with View -> toolbars -> (uncheck) Menu Bar. The menu bar and the "Firefox" button were supposed to be mutually exclusive (which is impossible in some cases without being incompatible).
    Once you are using the "Firefox" button ...
    Use the "Alt" key to view the menu bar (temporarily) containing File, Edit, View, History, Bookmarks, Tools, and Help. On Windows 7 and Vista, the menu bar was hidden by default in Firefox 4 and above. These menu items are more or less available under the "Firefox" button which has the most used of the built-in Firefox menu items available in a different format.
    To get back to having menus again. "Firefox" button -> Options (second column) -> (check) Menu Bar
    You can make '''Firefox 7.0.1''' look like Firefox 3.6.*, see numbered '''items 1-10''' in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 thru 8.0, look like 3.6)]. ''Whether or not you make changes, you should be aware of what has changed and what you have to do to use changed or missing features.''
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface

  • Blog Summary Page Does Not Update Picture

    For some reason, when I create a new blog entry by duplicating the last one and adding new content, the Blog Summary page will not update the picture. I sometimes either have to create a new blank blog entry, or drag a different picture into the placeholder, followed by my original.
    Is this happening to anyone else? I think I am going to finish out my year-long blog project with iWeb/MobileMe, then drop both! This is getting to frustrating.

    LawsonStone wrote:
    Is this happening to anyone else?
    Perhaps to this person:
    _blog summary didn't show the pictures_.
    LawsonStone wrote:
    I think I am going to finish out my year-long blog project with iWeb/MobileMe, then drop both! This is getting to frustrating.
    A wise move — problems with iWeb's blog are a recurring theme on these forums: Lost all blog entries or all comments or unable to publish, etc. If you switch to a dedicated blogging platform you're likely to have a better experience. For a success story using a non-iWeb blog hosted on WordPress, see this old thread:
    _To blog or not to blog_

  • Can PMAC be run Daily and Can we see the Batch Update Cost Daily?

    Dear Gurus,
    My Client wants to see Daily Updated Cost each end of day Through PMAC. Is it possible to run daily and Can we also see the COGS too.
    Now we have a Requirement here :
    My Clinet During the Production Process uses : Boiler Fuel, Chlorine, Electricity, Caustic Soda,Chain Lube, Generator Diesel.
    They would like to see each day how much has been consumed along with the cost during the Production Process at each end of the day and apportion the above things to all across the batches as per their KPIs (Key Performance Integrator).
    Now the challenge we cant take these Parameter as ingredients in Formulas. So Please guide us in providing the solution.
    They also informed us that they can not give these things in Hourly Basis. So Please Provide us the solution how to take this parameters to derive COGS..
    Please advice me.
    Regards,
    John

    Dear John,
    In Actual costing, PMAC, by definition, derives the weighted average rate only at the month end. You can refer to last period cost as a reference to perform Batch Cost SIMULATION (COGM). Same is the case with simulated COGS.
    Now coming to the problem of Cost Allocation. Let us discuss various options.
    Option1: FOH - Let us start with the simple one:
    - Consider all the indirect mfg. expenses as a Cost Component - Factory Overheads.
    - Derive standard rate (FOH/Unit) and apply it to onto products based on cost driver such as Production Volume cost components.
    - Once FOH applied for the last period, current period can use this as reference.
    Option2: Machine Recovery Rate, Utility Cost - Now let us try bringing in more precision by effective use of Routing definitions in Recipe:
    - You have mentioned that we cannot consider cleaning material, Utilities (Electricity, Water, Fuel) as a part of formula. So we consider Routing to absorb such cost (Equipment Cost, Utility Cost, Cleaning Material Cost) associating the Unit Rate to various activities in the Operations.
    - Define separate Cost Components - Equipment Cost, Utility Cost
    - With this definition, you will able to absorb the major part of the factory overheads in the production batches.
    - Rest of the indirect mfg. cost can be allocated onto the products as in option 1 at the month end @ actuals.
    This is very interesting topic from Activity Based Costing view point. Let us request cost accountants to contribute to this discussion.
    Regards,
    Sanjeev

  • Update picture slows down

    Hi
    I am trying to make a little robot that can draw a 2D map of the suroundings. (It uses a rotating distance sensor, like af radar)
    I whant to use the picture-control, to draw in the information, so i can get a printable picture out. I have already created a "picture-radarbeam" that reprecents one meassurement in the picture, and it works just fine.
    So, the problem is then i try to put the picture in a while-loop and i want the program to sketch the measurements all the time (I mean updating the picture canstantly). Short after it starts, its slows down dramaticly (It seams like it reamember all the preavues sketches, and sketch them all every time the picture updates.). I tried to solve the problem by write the pictue to a image-file, and then load it again to a picture-string, but that is also a very slow solution.
    Any sugestions?
    Best reguard
    Steffen Rasmussen - Danish Univerity of Science
    LabVIEW 2009 and 2011 user, with LabVIEW toolkit for Lego Mindstorms NXT.

    Yes, the right way would be to NOT use a shift register and uncheck "erase first?"
    This should work well assuming that all parts of the image are being overdrawn with new data as a new data arrives. That's why I wanted to see the code.
    LabVIEW Champion . Do more with less code and in less time .

  • IPhoto 6.0.4 new won't update pictures permission error

    I am still using 10.3.9; just got iLife 6.0; installed fine. Did whatever updates allowed to me. Trying to open iPhoto; as usual, goes through the updating process to all photos. here's where it gets interesting.
    I am the only user on this computer. I am the admin.
    iPhoto says that there are permission issues and to go into the iPhoto pictures folder and allow read and write. I did that. nothing. So then I went back and went folder to folder ensuring all were okay. All fine.
    Nothing.
    I can't sit here and check all of the 1000s of pictures to see which one is somehow not correct on permissions. Is this a glitch? Am I missing something? its never done this on all of the previous upgrades. Little help from you old pros

    Carl:
    Try the following: download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administartive name in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field. That often works where just the Info window does not.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

  • Ios 6 update picture of a battery on screen

    My Ipad 2 is trying to update to the Ios6 and the screen has a picture of a battery on it that is partially red, but it is hooked up to my computer to do the download.

    The Statusbar is gone and the "lock" with it. Security information about a web page is shown by the Site Identity Button.<br />
    https://support.mozilla.com/en-US/kb/Site+Identity+Button
    You can add a padlock to the location bar with the Padlock add-on- https://addons.mozilla.org/firefox/addon/padlock-icon

  • IPhoto 6.0.6 update picture thumbnails

    I had my camera hooked up to my Mac. When I opened up iPhoto for the second time, I had to update the thumbnails. The camera had a few pictures on it and iPhoto made thumbnails for those pictures. But not for the pictures from our last few years. The pictures are there, but no thumbnails. How can I make thumbnails for these pictures?

    Would it help if I deleted iPhoto 6.0.6 from my Mac, and put iPhoto 6.0.5 and see if I can look at my pictures?
    No.
    The issue is not with the iPhoto application but with your Library. Changing the application will not change the Library.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • IPhoto does not update pictures

    Any pictures I change in an external editor, I saved it as the orginal file would update in iPhoto, i.e. the picture would change to reflect the changes.
    In 6, it does not, if you select it and go full screen the corrected image will show, but in the main window it remains as the old picture.
    Is there a fix for this?

    Gary:
    To have iPhoto recognize edits made my a 3rd party editor like Photoshop Elements you must set iPhoto's preferences (in the General section) to open that 3rd party editor when you double click on the thumbnail. Then if you edit and save with the same file name and extension iPhoto will recognize the edit, both in the media window and in the thumbnail window. If you create a layered file or do an edit that requires a different extension you must either flatten the file and save in the original format or save to the desktop and import the new file.
    If you want to have both the 3rd party editor and iPhoto's without having to go into the preferences each time just set the preferences back, to edit in the main window. Then when you want to use the 3rd party editor just Control-click on the thumbnail and select Open in external editor from the drop down menu. That way you can have the best of both worlds.

  • CS4 doesn't update picture when adjustment layers are changed

    Basically the problem I have after just downloading CS4 is that, other than loving the improvements to the program, I'm irritated by the fact that I can't see the effect of any adjustments I make in the layers pallete until I click on the actual picture, or zoom it in or out.  Occasionally it will update on it's own but most of the time not.  Anybody ever had this problem?  Could it be related to the GPU thing -- maybe need new drivers?

    Well, I updated to the latest ATI driver and it still does the same thing.  It live-updates when I'm making adjustments in say a curves or levels or any other adjustment dialog, but the real problem is, if I turn a layer on or off I have to then either zoom or click the image to see the current status.  As I said earlier, very irritating when you're trying a bunch of different adjustments then want to turn off one or the other to quickly see the difference.
    Paul

  • Update picture in JPanel

    i'm have a picture, i showed it in JPanel, but my picture is change at any time, how i can update new picture on JPanel when my picture is updated
    //add picture in JPanel
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import javax.swing.JPanel;
    class ImagePanel extends JPanel {
        private Image img;
        public ImagePanel(Image img) {
            this.img = img;
            Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
            setPreferredSize(size);
            setMinimumSize(size);
            setMaximumSize(size);
            setSize(size);
            setLayout(null);
        public void paintComponent(Graphics g) {
            g.drawImage(img, 0, 0, null);
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.rmi.Naming;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    public class ShowClient extends JFrame implements MouseMotionListener{
        public ShowClient() {
            super("Control Client");
            UpdatePicture();
        //this method
        public void UpdatePicture(){
            ImagePanel panel =
                    new ImagePanel(new ImageIcon("screen.jpg").getImage());
            JScrollPane scrollPane = new JScrollPane(panel);
            this.setLayout(new BorderLayout());
            this.add(scrollPane, BorderLayout.CENTER);
            scrollPane.addMouseMotionListener(this);
              when mouser move will have a new picture.
        public void mouseMoved(MouseEvent e){
            int x = e.getX();
            int y = e.getY();
            EventServer event = null;
            try {
                event = (EventServer)Naming.lookup("//localhost/Client");
                event.MouseMove(x, y);
            catch (Exception exp){
                System.out.println("Err " + exp);
            UpdatePicture(); //why here my JPanel don't show new picture
        public void mouseDragged(MouseEvent e){
        public void Show(){
            this.setDefaultCloseOperation(HIDE_ON_CLOSE);
            Toolkit tool = Toolkit.getDefaultToolkit();
            Dimension size = tool.getScreenSize();
            this.setSize(size);
            this.setVisible(true);
    }Thank a lot of !!
    Edited by: bathong on May 23, 2009 10:39 AM

    >
    If you mean that the image file is updated, you will need to either reload the Image from the file using ImageIO#read(...) or flush() the Image.
    When you load the image using the ImageIcon constructor that takes a String parameter, it is cached by Toolkitand will not be reloaded even if the file content changes.
    Why create an ImageIcon just to retrieve its Image? Use ImageIO and just load an Image.
    db
    >
    I rewrite as :
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import javax.swing.JPanel;
    class ImagePanel extends JPanel {
        public BufferedImage img;
        public ImagePanel(BufferedImage img) {
            this.img = img;
            Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
            setPreferredSize(size);
            setMinimumSize(size);
            setMaximumSize(size);
            setSize(size);
            setLayout(null); 
        public void paintComponent(Graphics g) {
            g.drawImage( img, 0, 0, null);
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.rmi.Naming;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    public class ShowClient extends JFrame implements MouseMotionListener{  
        public ShowClient() {
            super("Control Client");
            UpdatePicture();
        public void UpdatePicture(){
            try { 
                File file = new File("screen.jpg");
                BufferedImage buff = ImageIO.read(file);
                ImagePanel panel = new ImagePanel(buff);
                JScrollPane scrollPane = new JScrollPane(panel);
                this.setLayout(new BorderLayout());
                this.add(scrollPane, BorderLayout.CENTER);
                scrollPane.addMouseMotionListener(this); 
            catch (Exception exp){
                System.out.println("Error here " + exp);
                exp.printStackTrace();
        public void mouseMoved(MouseEvent e){
            int x = e.getX();
            int y = e.getY();
            EventServer event = null;
            try {
                event = (EventServer)Naming.lookup("//localhost/Client");
                event.MouseMove(x, y);
            catch (Exception exp){
                System.out.println("Err " + exp);
            UpdatePicture();
        public void mouseDragged(MouseEvent e){
        public void Show(){
            this.setDefaultCloseOperation(HIDE_ON_CLOSE);
            Toolkit tool = Toolkit.getDefaultToolkit();
            Dimension size = tool.getScreenSize();
            this.setSize(size);
            this.setVisible(true);
    }but new picture also can't update!! please help me, thank !!!!

Maybe you are looking for