Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Line 24: Line 24:


:<ol><li>Clear your cache by going to ''Start &rarr; Control Panel &rarr; Network and Internet &rarr; Internet Options &rarr; Delete.'' The only thing you need to check in there is ''Temporary Internet Files.''</li><li>Has Internet Explorer 8 ever worked on your computer? If it has, I would do a system restore: ''Start &rarr; All Programs &rarr; Accessories &rarr; System Tools &rarr; System Restore'' and pick a date when the problem was not happening.</li><li>How long do you wait before using the task manager to kill Internet Explorer? I've seen Internet Explorer 8 take a long time to start up (especially on computers with slower CPUs and hard drives), but I've never seen it freeze indefinitely.</li></ol>&mdash;[[User:Best Dog Ever|Best Dog Ever]] ([[User talk:Best Dog Ever|talk]]) 23:07, 26 November 2011 (UTC)
:<ol><li>Clear your cache by going to ''Start &rarr; Control Panel &rarr; Network and Internet &rarr; Internet Options &rarr; Delete.'' The only thing you need to check in there is ''Temporary Internet Files.''</li><li>Has Internet Explorer 8 ever worked on your computer? If it has, I would do a system restore: ''Start &rarr; All Programs &rarr; Accessories &rarr; System Tools &rarr; System Restore'' and pick a date when the problem was not happening.</li><li>How long do you wait before using the task manager to kill Internet Explorer? I've seen Internet Explorer 8 take a long time to start up (especially on computers with slower CPUs and hard drives), but I've never seen it freeze indefinitely.</li></ol>&mdash;[[User:Best Dog Ever|Best Dog Ever]] ([[User talk:Best Dog Ever|talk]]) 23:07, 26 November 2011 (UTC)

Thanks, once I deleted temporary internet files, it worked. I'm even posting this from Internet Explorer. Any idea why temporary internet files would make Internet Explorer not work? [[Special:Contributions/173.141.192.113|173.141.192.113]] ([[User talk:173.141.192.113|talk]]) 03:40, 28 November 2011 (UTC)


== Using the search bar on Firefox ==
== Using the search bar on Firefox ==

Revision as of 03:40, 28 November 2011

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


November 23

Remote desktop

Resolved

I have a computer running Windows 7 which I want to connect to via remote desktop. I've set it up and everything works well, except for when I restart the computer. After restarting, I cannot connect to it or even see it in network discovery until I log into it with the account password. It is like the computer doesn't activate the network card until it has logged in. But this means I have to keep a physical screen and keyboard attached to it all the time, which I do not want. I want to be able to turn it on and log in via remote desktop, with no physical screen or keyboard needed. I know it is possible to change a setting to enable the network to start before logging in, because I've done it before on a different computer. But after an hour of searching google and the ref desk archives for my old questions on this, I cannot find the answer. 82.43.90.142 (talk) 00:39, 23 November 2011 (UTC)[reply]

I know that this isn't answering your question per se, but why do you need to keep a physical screen and keyboard attached? Can't you just make it auto-login with whatever username/password you would login in with? Not the best security practice but if the computer has no screen or keyboard it may not be a big risk to casual passers by and without full disk encryption the computer is always going to be vunerable to anyone dedicated enough. Presuming the problem is really as you suggest this will ensure the network works after a restart and you can later login in remotely if you desire. In fact, unless you really don't want it to login except when you choose, this sounds even better since after a restart you don't have to fluff around with logging in remotely but any background apps etc will start (even if there are no background apps of importance it does mean the restart/login will be more likely to be mostly completed by the time you login remotely). Nil Einne (talk) 02:40, 23 November 2011 (UTC)[reply]
That works! Thank you 82.43.90.142 (talk) 10:40, 23 November 2011 (UTC)[reply]

Telling Windows what part of my screen to use

Hello! I recently dropped my laptop. I caught it before it hit the ground with full force, and it works fine. The only part that received damage was the screen. There is a near perfect rectangle all the way to the left of the screen that does work; it is solid white. It spans the entire vertical length of the screen and about 150 pixels horizontally. Is there a way I can tell the Windows 7 OS to only paint to the quadrant of the screen that is functional? I've basically just been resizing my open windows to the dimensions of the functioning part of the screen, but it would be nice if I could trick the OS into thinking the screen is only as large as the part that still works. Thank you.--el Aprel (facta-facienda) 03:43, 23 November 2011 (UTC)[reply]

Not sure about that, but another suggestion is to use an external monitor, assuming your laptop has a connection for one. I use one on my laptop, now that the screen is damaged. StuRat (talk) 03:50, 23 November 2011 (UTC)[reply]

I don't know a really good way, but you could use something like MaxTo to make it easier. The last completely free version that was released that I know of is up at http://reisio.com/temp/MaxToSetup-2009-3-1.exe. You can also get a few versions from http://wayback.archive.org/web/*/http://www.maxto.net/download. ¦ Reisio (talk) 04:13, 23 November 2011 (UTC)[reply]

Maybe, just maybe, the internal cable between the motherboard and the screen might have come loose. If you don't find a software solution and can't use an external monitor, it might be worth trying a repair before disposing of it, though it would involve downloading the service manual and following the instructions to the letter to take the laptop apart. Astronaut (talk) 04:19, 23 November 2011 (UTC)[reply]
A screen repair is well worth checking the prices on- though looking through the service manual is key, it's just too easy to break the stupid clips they put on the things instead of real metal fasteners.

Server won't stay shutdown

I have a Dell Poweredge server with CentOS installed. When I want to shut it down, usually because I got fed up with the noisy fans, I can choose shutdown from the menu or type shutdown -h now in a terminal window. It goes through the shutdown process, but this server seems very reluctant to stay shutdown and after a brief (one second?) power off it starts right back up again. Even if I press and hold the power button, I get the same thing unless I let go of the power button at just the right time; and I shouldn't really have to fiddle with the power button anyway. This is probably a useful feature in a large company server room, but is damn annoying in my spare bedroom. I'm sure it didn't used to do this, so something must have changed. What can I do to make my server stay shutdown? Astronaut (talk) 04:27, 23 November 2011 (UTC)[reply]

Sounds like getting into the BIOS to see if there's anything relevant there could be the first order of business. If it will only turn off when the power switch is used in a certain manner, could it be a problem with the switch itself? If you've got a spare case around, you could try hooking up the switch from that to the pins on the server mobo. Failing that, there's always the various software suspend and sleep modes. Nevard (talk) 12:08, 23 November 2011 (UTC)[reply]
Try shutdown -P now instead of -h
-P explicitly requests a powerdown; -h requests a "halt", the meaning of which is system dependent (I think it's often a function of an ACPI BIOS setting). -- Finlay McWalterTalk 12:27, 23 November 2011 (UTC)[reply]
Answer 1: try turning off all the power-saving stuff in the BIOS settings. Answer 2: Why not just pull the plug out?  Chzz  ►  03:56, 25 November 2011 (UTC)[reply]

I tried shutdown -P now and it disabled connections to the server but didn't powerdown. I'll take a look at the BIOS and anything to do with ACPI in the BIOS or CentOS. The reason for preferring not to mess with the power button or pulling the plug, is I run it without keyboard or monitor in the spare room. I use my (Windows) laptop to remotely connect to it using SSH or xrdp and would prefer being able to power off from the comfort of my armchair without having to walk down the hall to the spare room. Messing with the power button or plug is also guess work - I have no idea what critical operation it is currently doing unless I drag my monitor into the spare room with me. Astronaut (talk) 12:45, 25 November 2011 (UTC)[reply]

CAD help

I need some help in finding a specific length in the attached image. I need the distance of the center of the circle (point near center and radius marked in red) from the corner or edge closest to the observer in the image. It is 0.88 from the center line which is in the y-axis. I need the dimension in the x-axis. The image is from the book Technical Graphics Communication by Gary R. Bertoline. Image: http://i44.tinypic.com/rwosas.jpg

Thanks. --175.110.237.118 (talk) 17:51, 23 November 2011 (UTC)[reply]

The arc with radius 1.44 appears tangent to the back edge, which is 5 units from the front edge. From that I get 5 - 1.44 = 3.56 for the distance from the front edge to the center point. Is that what you are looking for? -- Tom N (tcncv) talk/contrib 21:37, 23 November 2011 (UTC)[reply]
Yes, that seems to work. Thanks a lot mate. --175.110.237.118 (talk) 08:39, 24 November 2011 (UTC)[reply]

Java: Password storage and retrieval

I am learning to program in java. And my first project is to make a program that is capable of scheduling a YouTube upload. As far as i can tell this hasnt been done before so i figured it would be a good project to jump start my java learning. This project introduces me to 3 new fields: GUIs, Java, and password storage.

My question here today relates to proper/accepted handling of passwords in java.

At first i stored the passwords in clear text in the AppData folder of my windows 7 machine. But i quickly learned how to encrypt the data and i have been using that since.

What i am asking is... Does my program handle password storage in a secure & accepted manor?

My code

Downloadable at http://code.google.com/p/ytuscheduler/

{{
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

import java.awt.EventQueue;

import javax.swing.DefaultListModel;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.JButton;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.Action;
import javax.swing.JList;
import org.jasypt.util.text.BasicTextEncryptor;

import com.google.gdata.client.youtube.YouTubeService;
import com.google.gdata.data.media.MediaFileSource;
import com.google.gdata.data.media.mediarss.MediaCategory;
import com.google.gdata.data.media.mediarss.MediaDescription;
import com.google.gdata.data.media.mediarss.MediaTitle;
import com.google.gdata.data.youtube.VideoEntry;
import com.google.gdata.data.youtube.YouTubeMediaGroup;
import com.google.gdata.data.youtube.YouTubeNamespace;
import com.google.gdata.util.ServiceException;
import java.awt.Font;
import javax.swing.ListSelectionModel;
import javax.swing.JTabbedPane;


public class YtuSchedulerGUI2 {
   
    public static JFileChooser fc = new JFileChooser();
   
    public final static String uploadUrl = "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";
    public static String usershome = System.getProperty("user.home"); //%20
    public static String GDataDKey = "AI39si7Iw2fopIkvtGuNeHbPHqQRZyWuN3m-Cv21PX6CO_3EcqrFjOfWbrS59tifYjB6-oYszwbXegEvgF1JDpMq2WB5jwySLQ";   
    public static String appdata = usershome + "\\AppData\\Roaming\\";
    public static String textencryptorpass = "f9c6127646e881a939b23d6c9704679e42acdd3c1aa18bf143d211925615f761" + usershome;
    public static String filelocation2 = "";
    public static String videomimetype = "";
    public static String username2 = "";
    public static String passwrd2 = "";
    public static String savelogininformation3 = "No";
    public static String desiredtitle2 = "";
    public static String discription2 = "";
    public static String YTcatorgories3 = "";
    public static String privacyoption3 = "";
    public static String keywords2 = null;
    public static String filestringstr = null;
    public static String threadjopsmd = null;
    public static String filestring = "";
    public static String filelocationtest =  "";
    public static String systemoutvar = "";
    public static String[] YTcatorgories = { "Autos", "Comedy", "Education", "Entertainment", "Film", "Gaming", "Howto", "Music", "News", "Nonprofits", "People", "Tech", "Sports", "Travel" };
    public static String[] privacyoption = { "Public", "Private" };
    public static String[] savelogininformation = { "No", "Yes" };
    public static String[] AMPM = { "AM", "PM" };
    public static String[] arr = {};

    //public static String[] SchTaskarrlist=linearr[0].split("_");


    public static List savedloginU = new ArrayList();
    public static List savedloginP = new ArrayList();
    public static List savedloginUE = new ArrayList();
    public static List savedloginPE = new ArrayList();
    public static List SchTaskarrlist = new ArrayList();
    public static List SchTaskarralreadylisted = new ArrayList();
    public static List SchTaskarrlistraw = new ArrayList();
    public static List SchTaskarralreadylistedraw = new ArrayList();

   
    public static DefaultListModel listmodel = new DefaultListModel();
   
    public static JPasswordField passwrd;   
    public static JTextArea discription = new JTextArea();
    public static JTextField keywords;
    public static JTextField filelocation;
    public static JTextField ytstime = new JTextField();
    public static JTextField ytsdate = new JTextField();
    public static JComboBox AMPM2 = new JComboBox(AMPM);
    public static JTextField desiredtitle = new JTextField(); //threadjopsmd  
    public static JComboBox<?> YTcatorgories2 = new JComboBox<Object>(YTcatorgories);
    public static JComboBox<?> privacyoption2 = new JComboBox<Object>(privacyoption);
    public static JComboBox username;
    public static JList list = new JList(listmodel);
    public static JLabel statusbar = new JLabel("");
   
    private JFrame frame;
   
    public static boolean privacyoption4;
    public static boolean addusertolist = true;
    public static BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
    public static File fcstring = null;
   
    private final Action action = new SwingAction();
    private final Action action_1 = new SwingAction_1();
    private final Action action_2 = new SwingAction_2();
    private final Action action_3 = new SwingAction_3();
    private final Action action_4 = new SwingAction_4();
    private final Action action_5 = new SwingAction_5();
    private final Action action_6 = new SwingAction_6();
    private final Action action_7 = new SwingAction_7();
    private final Action action_8 = new SwingAction_8();
    private final Action action_9 = new SwingAction_9();
    private final Action action_10 = new SwingAction_10();

   
    public static MediaFileSource ms = null;
    public static VideoEntry newEntry = null;
   
    public static Thread startupload = new Thread(new Runnable(){
        public void run(){
            String videomimetype1 = videomimetype;
            String filestring1 = filestring;
            String username21 = username2;
            String passwrd21 = passwrd2;
            String desiredtitle21 = desiredtitle2;
            String discription21 = discription2;
            String YTcatorgories31 = YTcatorgories3;
            boolean privacyoption41 = privacyoption4;
            //String[] arr1 = arr;
           
            YouTubeService myService = new YouTubeService(username21, GDataDKey);
            VideoEntry newEntry = new VideoEntry();
            YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
            mg.setTitle(new MediaTitle());
            mg.getTitle().setPlainTextContent("Temp title");
            mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, YTcatorgories31));
            mg.setDescription(new MediaDescription());
            mg.getDescription().setPlainTextContent("Temp description");
            mg.setPrivate(privacyoption41);
            MediaFileSource ms = new MediaFileSource(new File(filestring1), videomimetype1);
            String uploadUrl =
              "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";
            YtuSchedulerGUI2.desiredtitle.setText("");
            YtuSchedulerGUI2.discription.setText("");
            YtuSchedulerGUI2.YTcatorgories2.setSelectedItem("Autos");   
            YtuSchedulerGUI2.privacyoption2.getSelectedItem();
            YtuSchedulerGUI2.keywords.setText("");
            YtuSchedulerGUI2.filelocation.setText("");
            try {
                newEntry.setMediaSource(ms);
                systemoutvar = "Your upload \"" + desiredtitle21 + "\" has started. Dont close this window.";
                new Thread(systemout).start();
                myService.setUserCredentials(username21,passwrd21);           
                VideoEntry createdEntry = myService.insert(new URL(uploadUrl), newEntry); //Uploads
                createdEntry.getMediaGroup().getDescription().setPlainTextContent(discription21);
                createdEntry.update();
                createdEntry.getMediaGroup().getTitle().setPlainTextContent(desiredtitle21);
                createdEntry.update();
                //createdEntry.getMediaGroup().getKeywords().clearKeywords();
                /*
                for(int i=0;i<arr1.length;i++) {
                    createdEntry.getMediaGroup().getKeywords().addKeyword((String) arr1[i]);
                }
                */
                for(int i=0;i<arr.length;i++) {
                    if (arr[i].length() > 1) {
                        if (arr[i].length() < 31) {
                            System.out.println("Adding keyword:" + arr[i]);
                            createdEntry.getMediaGroup().getKeywords().addKeyword((String) arr[i]);
                        }
                    }                   
                    /*
                    if (arr[i].length() > 1) {
                        System.out.println("arr[i]:" + arr[i]);
                        createdEntry.getMediaGroup().getKeywords().addKeyword((String) arr[i]);
                    }
                    createdEntry.update();
                    */
                }
               
            } catch (IOException | ServiceException e1) {
                systemoutvar = "Username authentication error. Is your stored username and password correct?";
                new Thread(systemout).start();
                e1.printStackTrace();
                return;
            }
            systemoutvar = "Uploaded";
            new Thread(systemout).start();


        }
    });
   
    /*
    
    Start the following thread like:
    systemoutvar = "what ever message you want";
    new Thread(systemout).start();
   
    new Thread(removeselecteduser).start();


     */
    public static Thread systemout = new Thread(new Runnable(){
        public void run(){
            System.out.println(systemoutvar);
            //listmodel.addElement(systemoutvar);
            YtuSchedulerGUI2.statusbar.setText(systemoutvar);
            Thread.currentThread();
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            YtuSchedulerGUI2.statusbar.setText("");
           
        }
    });
    public static Thread removeselecteduser = new Thread(new Runnable(){
        public void run(){
           
            for(int i=0; i<savedloginU.size(); i++) {
                if (username.getSelectedItem() == savedloginU.get(i)) {
                    System.out.println("removing selected user:" + username.getSelectedItem());
                    username.removeItem(username.getSelectedItem());           
                    savedloginU.remove(i);
                    savedloginP.remove(i);                        
                   
                }
            }
            File logininformationfile = new File( appdata + "YTscheduler/" + GDataDKey );
            PrintWriter pwInput = null;
            try {
                pwInput = new PrintWriter(logininformationfile);
            } catch (FileNotFoundException e) {
                systemoutvar = "File not found";
                new Thread(systemout).start();
                e.printStackTrace();
            }

            for(int i=0; i<savedloginU.size(); i++) {
                //savedloginU.get(i)
                String myEncryptedText = textEncryptor.encrypt((String) savedloginU.get(i));
                String myEncryptedText2 = textEncryptor.encrypt((String) savedloginP.get(i));
                pwInput.println(myEncryptedText);
                pwInput.println(myEncryptedText2);
                }
            pwInput.close();
        }
    });
    public static Thread deletetask = new Thread(new Runnable(){
        public void run(){
            Object Selectedtask = null;
        if (list.isSelectionEmpty()) {
            systemoutvar = "Nothing selected";
            new Thread(systemout).start();
        } else {
            int selected[] = list.getSelectedIndices();
            System.out.println("selected:" + selected[0]);
            for (int i=0; i < selected.length; i++) {
                Selectedtask = list.getModel().getElementAt(selected[i]);
                System.out.println("Selectedtask:" + Selectedtask);
                }
            for (int i=0; i<SchTaskarralreadylisted.size(); i++) {
                if (SchTaskarralreadylisted.get(i).equals(Selectedtask)) {
                    System.out.println(SchTaskarralreadylistedraw.get(i));
                    List cutdownSchTaskname = new ArrayList();
                    Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
                    Matcher regexMatcher = regex.matcher((CharSequence) SchTaskarralreadylistedraw.get(i));
                    while (regexMatcher.find()) {
                        if (regexMatcher.group(1) != null) {
                            // Add double-quoted string without the quotes
                            cutdownSchTaskname.add(regexMatcher.group(1));
                        }
                    }
                    System.out.println("cutdownSchTaskname:" + cutdownSchTaskname.get(0));
                    try {
                        String makeascheduler2 = "SchTasks /Delete /TN " + cutdownSchTaskname.get(0) + " /F";
                        Runtime rt = Runtime.getRuntime();
                        Process pr = rt.exec(makeascheduler2);
                        BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                        int exitVal = pr.waitFor();
                     } catch(Exception e1) {
                        System.out.println("e1.toString():" + e1.toString());
                        e1.printStackTrace();
                    }
                    for (int i1=0; i1<SchTaskarrlistraw.size(); i1++) {   
                        if (SchTaskarrlistraw.get(i1).equals(SchTaskarralreadylistedraw.get(i))) {
                            SchTaskarrlistraw.remove(i1);           
                        }
                    }
                    for (int i1=0; i1<SchTaskarrlist.size(); i1++) {   
                        if (SchTaskarrlist.get(i1).equals(SchTaskarralreadylisted.get(i))) {
                            SchTaskarrlist.remove(i1);           
                        }
                    }
                    list.clearSelection();
                    listmodel.remove(selected[0]);
                    SchTaskarralreadylistedraw.remove(i);
                    SchTaskarralreadylisted.remove(i);
                    systemoutvar = "Task deleted";
                    new Thread(systemout).start();
                   
                }

            }
           
        }
        new Thread(loadtasks).start();
        //System.out.println(listmodel.getSelectedValue());
        }
    });
    public static Thread loadtasks = new Thread(new Runnable(){
        public void run(){

           
            System.out.println(SchTaskarrlist.size());
            System.out.println(SchTaskarrlistraw.size());
            System.out.println(SchTaskarralreadylisted.size());
            System.out.println(SchTaskarralreadylistedraw.size());
           
        }
    });
    public static Thread runtask = new Thread(new Runnable(){
        public void run(){ //TODO finish this
            Object Selectedtask = null;
        if (list.isSelectionEmpty()) {
            systemoutvar = "Nothing selected";
            new Thread(systemout).start();
        } else {
            int selected[] = list.getSelectedIndices();
            System.out.println("selected:" + selected[0]);
            for (int i=0; i < selected.length; i++) {
                Selectedtask = list.getModel().getElementAt(selected[i]);
                System.out.println("Selectedtask:" + Selectedtask);
                }
            for (int i=0; i<SchTaskarralreadylisted.size(); i++) {
                if (SchTaskarralreadylisted.get(i).equals(Selectedtask)) {
                    System.out.println(SchTaskarralreadylistedraw.get(i));
                    List cutdownSchTaskname = new ArrayList();
                    Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
                    Matcher regexMatcher = regex.matcher((CharSequence) SchTaskarralreadylistedraw.get(i));
                    while (regexMatcher.find()) {
                        if (regexMatcher.group(1) != null) {
                            // Add double-quoted string without the quotes
                            cutdownSchTaskname.add(regexMatcher.group(1));
                        }
                    }
                    System.out.println("cutdownSchTaskname:" + cutdownSchTaskname.get(0));
                    try {
                        String makeascheduler2 = "SchTasks /Run /TN " + cutdownSchTaskname.get(0) + " /I";
                        Runtime rt = Runtime.getRuntime();
                        Process pr = rt.exec(makeascheduler2);
                        BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                        int exitVal = pr.waitFor();
                     } catch(Exception e1) {
                        System.out.println("e1.toString():" + e1.toString());
                        e1.printStackTrace();
                    }               
                }
            }           
        }           
        }
    });
    public static Thread rescheduletask = new Thread(new Runnable(){
        public void run(){
            // TODO ================================================================================================================================
            String ytstime4 = "";
            String ytsdate4 = "";
            DateFormat dateFormat3 = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
            DateFormat dateFormatdate3 = new SimpleDateFormat("MM/dd/yyyy");
            DateFormat dateFormattime3 = new SimpleDateFormat("HH:mm");
            Date date = new Date();
            String dateFormatdate4 = dateFormatdate3.format(date);
            String dateFormattime4 = dateFormattime3.format(date);
                      
            String[] AMPM = { "AM", "PM" };
            String[] RAUO = { "No", "Yes" };
            JComboBox<?> AMPM2 = new JComboBox<Object>(AMPM);
            JComboBox<?> RAU = new JComboBox<Object>(RAUO);
            //JTextField winusername = new JTextField();
            JTextField winpasswrd = new JPasswordField();
            JTextField ytsdate = new JTextField(dateFormatdate4);
            JTextField ytstime = new JTextField(dateFormattime4);
            //JTextField location = new JTextField();
            //JTextField keywords = new JTextField();
           
            Object[] msg5 = {"Windows Password", winpasswrd, "Date to be ran MM/DD/YYYY", ytsdate, "Time to be ran HH:MM (12h or 24h)", ytstime, "AM/PM", AMPM2 };
          
            final JOptionPane op2 = new JOptionPane(
                msg5,
                JOptionPane.PLAIN_MESSAGE,
                JOptionPane.OK_CANCEL_OPTION,
                null,
                null,
                null);
           
            final JDialog dialog2 = op2.createDialog("Reschedule");
            dialog2.setVisible(true); // program stops here
           
            int value = ((Integer) op2.getValue()).intValue();
            if (value == JOptionPane.OK_OPTION) {

            String ytsdate2 = ytsdate.getText();
            String ytstime2 = ytstime.getText();
            String winpasswrd2 = winpasswrd.getText();
            String AMPM3 = (String) AMPM2.getSelectedItem();
           
            String[] ytstime3 = ytstime2.split(":"); // uses : as a delimiter and splits a string in to an array
            String[] ytsdate3 = ytsdate2.split("/"); // uses / as a delimiter and splits a string in to an array
           
            String ytsdateMM = ytsdate3[0];
            String ytsdateDD = ytsdate3[1];
            String ytsdateYY = ytsdate3[2];

            String ytstimeHH = ytstime3[0];
            String ytstimeMM = ytstime3[1];
           
            String ytshourString = null;

            if (AMPM3 == "PM") {
                System.out.println("PM cought");
                switch (ytstimeHH) {
                case "1": ytshourString = "13";       break;
                case "2": ytshourString = "14";      break;
                case "3": ytshourString = "15";         break;
                case "4": ytshourString = "16";         break;
                case "5": ytshourString = "17";           break;
                case "6": ytshourString = "18";          break;
                case "7": ytshourString = "19";          break;
                case "8": ytshourString = "20";        break;
                case "9": ytshourString = "21";     break;
                case "01": ytshourString = "13";       break;
                case "02": ytshourString = "14";      break;
                case "03": ytshourString = "15";         break;
                case "04": ytshourString = "16";         break;
                case "05": ytshourString = "17";           break;
                case "06": ytshourString = "18";          break;
                case "07": ytshourString = "19";          break;
                case "08": ytshourString = "20";        break;
                case "09": ytshourString = "21";     break;
                case "10": ytshourString = "22";       break;
                case "11": ytshourString = "23";      break;
                case "12": ytshourString = "12";      break;
                default: ytshourString = ytstimeHH; break;
               
            }

            }else if (AMPM3 == "AM") {
                System.out.println("AM cought");

                switch (ytstimeHH) {
                case "01": ytshourString = "01";       break;
                case "02": ytshourString = "02";      break;
                case "03": ytshourString = "03";         break;
                case "04": ytshourString = "04";         break;
                case "05": ytshourString = "05";           break;
                case "06": ytshourString = "06";          break;
                case "07": ytshourString = "07";          break;
                case "08": ytshourString = "08";        break;
                case "09": ytshourString = "09";     break;
                case "1": ytshourString = "01";       break;
                case "2": ytshourString = "02";      break;
                case "3": ytshourString = "03";         break;
                case "4": ytshourString = "04";         break;
                case "5": ytshourString = "05";           break;
                case "6": ytshourString = "06";          break;
                case "7": ytshourString = "07";          break;
                case "8": ytshourString = "08";        break;
                case "9": ytshourString = "09";     break;
                case "10": ytshourString = "10";       break;
                case "11": ytshourString = "11";      break;
                case "12": ytshourString = "00";       break;
                default: ytshourString = ytstimeHH; break;
                }
               
            }
            ytstimeHH = ytshourString;
            ytstime4 = ytstimeHH + ":" + ytstimeMM;
            ytsdate4 = ytsdateMM + "/" + ytsdateDD + "/" + ytsdateYY;
           
            Object Selectedtask = null;
        if (list.isSelectionEmpty()) {
            systemoutvar = "Nothing selected";
            new Thread(systemout).start();
        } else {
            int selected[] = list.getSelectedIndices();
            System.out.println("selected:" + selected[0]);
            for (int i=0; i < selected.length; i++) {
                Selectedtask = list.getModel().getElementAt(selected[i]);
                System.out.println("Selectedtask:" + Selectedtask);
                }
            for (int i=0; i<SchTaskarralreadylisted.size(); i++) {
                if (SchTaskarralreadylisted.get(i).equals(Selectedtask)) {
                    System.out.println(SchTaskarralreadylistedraw.get(i));
                    List cutdownSchTaskname = new ArrayList();
                    Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
                    Matcher regexMatcher = regex.matcher((CharSequence) SchTaskarralreadylistedraw.get(i));
                    while (regexMatcher.find()) {
                        if (regexMatcher.group(1) != null) {
                            // Add double-quoted string without the quotes
                            cutdownSchTaskname.add(regexMatcher.group(1));
                        }
                    }
                    System.out.println("cutdownSchTaskname:" + cutdownSchTaskname.get(0));
                    try {
                        String makeascheduler2 = "SchTasks /Change /TN " + cutdownSchTaskname.get(0) + " /SD " + ytsdate4 + " /ST " + ytstime4 + " /RP " + winpasswrd2;
                        Runtime rt = Runtime.getRuntime();
                        Process pr = rt.exec(makeascheduler2);
                        System.out.println("makeascheduler2:" + makeascheduler2);
                        BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                        int exitVal = pr.waitFor();
                     } catch(Exception e1) {
                        System.out.println("e1.toString():" + e1.toString());
                        e1.printStackTrace();
                    }               
                }
            }           
        }

 
            } else if (value == JOptionPane.CANCEL_OPTION) {
                 System.out.println("You hit \"cancel\"");
                 return;

            }
            //TODO =================================================================================================================================
        }
    });
    FocusListener listener = new FocusListener() {
        public void focusGained(FocusEvent event) {
          System.out.println("Gained focus");
        }
        public void focusLost(FocusEvent event) {
            System.out.println("lost focus");
            new Thread(setmimetype).start();
        }
      };
    public static Thread setmimetype = new Thread(new Runnable(){
        public void run(){
            filelocation2 = (String) YtuSchedulerGUI2.filelocation.getText();

            String[] filestringarr=filelocation2.split("\\\\"); // uses \\ as a delimiter and splits a string in to an array
            for(int i=0; i<filestringarr.length; i++) {
                filestringstr = filestringarr[i];
            }
            System.out.println("Setting mime type");
            String ext="";
            int mid= filelocation2.lastIndexOf(".");
            ext=filelocation2.substring(mid+1,filelocation2.length());
            videomimetype = "video/" + ext; 
            System.out.println("File ext:" + ext);
       
        }
    });
    public static Thread settime = new Thread(new Runnable(){
        public void run(){
            //DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
            DateFormat dateFormatdate = new SimpleDateFormat("MM/dd/yyyy");
            DateFormat dateFormattime = new SimpleDateFormat("HH:mm");
            Date date = new Date();
            String dateFormatdate2 = dateFormatdate.format(date);
            String dateFormattime2 = dateFormattime.format(date);
            ytsdate.setText(dateFormatdate2);
            ytstime.setText(dateFormattime2);
           
        }
    });

    public static Thread makevideoconfig = new Thread(new Runnable(){
        public void run(){
            username2 = (String) YtuSchedulerGUI2.username.getSelectedItem();
            passwrd2 = (String) YtuSchedulerGUI2.passwrd.getText();
            desiredtitle2 = YtuSchedulerGUI2.desiredtitle.getText();
            discription2 = YtuSchedulerGUI2.discription.getText();
            YTcatorgories3 = (String) YtuSchedulerGUI2.YTcatorgories2.getSelectedItem();
            privacyoption3 = (String) YtuSchedulerGUI2.privacyoption2.getSelectedItem();
            keywords2 = YtuSchedulerGUI2.keywords.getText();
            filelocationtest = (String) YtuSchedulerGUI2.filelocation.getText();

            if (privacyoption3 == "Private") {
                privacyoption4 = true;
            } else if (privacyoption3 == "Public") {
                privacyoption4 = false;
            }
            //filelocation
            if (filestringstr == null) {
                if (filelocationtest.length() == 0) {
                    systemoutvar = "Please choose a file";
                    new Thread(systemout).start();
                    JOptionPane.showMessageDialog(null, systemoutvar);
                    return;
                   
                } else {
                    systemoutvar = "setting filestringstr to filelocationtest";
                    new Thread(systemout).start();
                    String[] filestringarr = filelocationtest.split("\\\\"); // uses \\ as a delimiter and splits a string in to an array
                    for(int i=0; i<filestringarr.length; i++) {
                        //System.out.println("array place " + i + ":" + args[i]);
                        filestringstr = filestringarr[i];
                    }
                    //filestringstr = filelocationtest;
                   
                }
                systemoutvar = filestringstr;
                new Thread(systemout).start();

                /*
                System.out.println("Please choose a file");
                threadjopsmd = "Please choose a file";
                JOptionPane.showMessageDialog(null, threadjopsmd);
                return;
                */

               
            }
            if (username2 == null) {
                systemoutvar = "Please enter a username";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
            if (passwrd2.length() == 0) {
                systemoutvar = "Please enter a password";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
           
            if (discription2.length() < 1) {
                discription2 = filestringstr;
            }
            if (desiredtitle2.length() < 1) {
                desiredtitle2 = filestringstr;
            }
            if (keywords2.length() < 2) {
                keywords2 = filestringstr;
            }
            String videomimetype1 = videomimetype;
            //String filestring1 = filestring;
            String username21 = username2;
            //String passwrd21 = passwrd2;
            String desiredtitle21 = desiredtitle2;
            String discription21 = discription2;
            String YTcatorgories31 = YTcatorgories3;
            //boolean privacyoption41 = privacyoption4;
            //String[] arr1 = arr;
            filestringstr = filestringstr.replace( "\'",""); //TODO
            filestringstr = filestringstr.replace( "\"",""); 
            System.out.println("Saving entered information for later");
            File mainconfig = new File( appdata + "YTscheduler\\" + username2 + "_" + filestringstr + ".txt" );
            PrintWriter MCpwInput = null;
            try {
                MCpwInput = new PrintWriter(mainconfig);
            } catch (FileNotFoundException e) {
                //Auto-generated catch block
                e.printStackTrace();
            } // + .description
            MCpwInput.println(username21);
            MCpwInput.println(desiredtitle21);
            MCpwInput.println(filelocationtest);
            MCpwInput.println(YTcatorgories31);
            MCpwInput.println(privacyoption4);
            MCpwInput.println(videomimetype1);
            MCpwInput.print(keywords2);
            MCpwInput.close();
           
            File DESconfig = new File( appdata + "YTscheduler\\" + "description." + username2 + "_" + filestringstr + ".txt" );
            PrintWriter pwInputDES = null;
            try {
                pwInputDES = new PrintWriter(DESconfig);
            } catch (FileNotFoundException e) {
                //Auto-generated catch block
                e.printStackTrace();
            } // "description." +
            pwInputDES.print(discription21);
            pwInputDES.close();

            System.out.println("The file has been created at:" + appdata + "YTscheduler\\"  + username2 + "_" + filestringstr + ".txt");       
        }
    });  
    public static Thread saveloginstuff = new Thread(new Runnable(){
        public void run(){      
        //savelogininformation3 = ;
        if (savelogininformation3 == "Yes") {
            //textEncryptor.setPassword(textencryptorpass);
            username2 = (String) YtuSchedulerGUI2.username.getSelectedItem();
            passwrd2 = (String) YtuSchedulerGUI2.passwrd.getText();
            //String myEncryptedText = textEncryptor.encrypt(passwrd2);
            //String myEncryptedText2 = textEncryptor.encrypt(username2);
            boolean username2found = false;
            for(int i=0; i<savedloginU.size(); i++) {
                if (username2 == savedloginU.get(i)) {
                    username2found = true;
                }
            }
           
            System.out.println("username2:" + username2);
            //savedloginU.remove(n)
            if (username2found == true) {
                System.out.println("Username already stored:" + username2);
                for(int i=0; i<savedloginU.size(); i++) {
                    if (username2 == savedloginU.get(i)) {
                        //System.out.println("savedloginU.get(i)" + savedloginU.get(i));
                        String passwrdloginP = (String) savedloginP.get(i);
                        //System.out.println(passwrdloginP);
                        //System.out.println("passwrd2:" + passwrd2);
                        if (passwrd2.equals(passwrdloginP)) {
                            //System.out.println("Username already stored with that password")
                            systemoutvar = "Username already stored with that password";
                            new Thread(systemout).start();
                        } else {
                            username2found = false;
                            username.removeItem(username2);           
                            System.out.println("Password not the same, removing old username/pass and saving new information");
                            //System.out.println("savedloginU.get(i)" + savedloginU.get(i));
                            //System.out.println("savedloginP.get(i)" + savedloginP.get(i));
                            savedloginU.remove(i);
                            savedloginP.remove(i);
                        }
                    }
                }
            }

           
            if (username2found == false) {
                File logininformationfile = new File( appdata + "YTscheduler/" + GDataDKey );
                savedloginU.add(username2);
                savedloginP.add(passwrd2);
                username.addItem(username2);
                username.setSelectedItem(username2);
               
                PrintWriter pwInput = null;
                try {
                    pwInput = new PrintWriter(logininformationfile);
                } catch (FileNotFoundException e) {
                    systemoutvar = "File not found";
                    new Thread(systemout).start();
                    e.printStackTrace();
                }

                for(int i=0; i<savedloginU.size(); i++) {
                    //savedloginU.get(i)
                    String myEncryptedText = textEncryptor.encrypt((String) savedloginU.get(i));
                    String myEncryptedText2 = textEncryptor.encrypt((String) savedloginP.get(i));
                    pwInput.println(myEncryptedText);
                    pwInput.println(myEncryptedText2);
                    }
                pwInput.close();
                //System.out.println(savedloginU);
                systemoutvar = "Log-in information saved";
                new Thread(systemout).start();
            } else { //if username2found == false
                System.out.println("User information already saved");
               
            }
            savelogininformation3 ="No";
              }
        }
    });
   
    public static Thread loadusersandpass = new Thread(new Runnable(){
        public void run(){
            File Storeduserpass = new File(  appdata + "YTscheduler/" + GDataDKey );
            if( Storeduserpass.exists() ) {
                Scanner opnScanner2 = null;
                try {
                    opnScanner2 = new Scanner(Storeduserpass);
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                }
                String decryptedU = "";
                while( opnScanner2.hasNext() ) {
                    //String loadedusrnme2 = opnScanner2.nextLine(); // filestring
                    //String loadedpsswrd2 = opnScanner2.nextLine(); // YTcatorgories3
                    //String loadedusrnme = textEncryptor.decrypt(opnScanner2.nextLine());
                    //String loadedpsswrd = textEncryptor.decrypt(opnScanner2.nextLine());
                    decryptedU = textEncryptor.decrypt(opnScanner2.nextLine());
                    savedloginP.add(textEncryptor.decrypt(opnScanner2.nextLine()));
                    savedloginU.add(decryptedU);
                    if (addusertolist == true) {
                        username.addItem(decryptedU);
                    }
                }
               
            }
            addusertolist = true;
        }
    });
    public static Thread makecopy = new Thread(new Runnable(){
        public void run(){
            File targetcopyfrom =  new File(YtuSchedulerGUI2.class.getProtectionDomain().getCodeSource().getLocation().getPath());
            String targetcopyfromstring = targetcopyfrom.toString();
            String targetcopyfromreplace2 = targetcopyfromstring.replace( "%20"," ");
            String copytopath = appdata + "YTscheduler\\YtuScheduler.jar";
            //File isfilethere =  new File(copytopath);
            //if(!isfilethere.exists()) {
                System.out.println("File not there. Making a new one");
                Path p1 = Paths.get(copytopath);
                Path p2 = Paths.get(targetcopyfromreplace2);
                System.out.println("copytopath: " + copytopath);
                System.out.println("targetcopyfromreplace2: " + targetcopyfromreplace2);
                try {
                    Files.copy(p2, p1, REPLACE_EXISTING);
                } catch (IOException e) {
                    e.printStackTrace();
                    return;
                }
                System.out.println("File copied");
            //}

        }
    });
    public static void main(final String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                textEncryptor.setPassword(textencryptorpass);
                if (args.length == 0) {
                    //new Thread(loadtasks).start();
                    new Thread(makecopy).start();
                    new Thread(loadusersandpass).start();
                    new Thread(settime).start();
                    boolean success = (new File(appdata + "YTscheduler")).mkdirs();
                    if (!success) {}
                    try {
                        YtuSchedulerGUI2 window = new YtuSchedulerGUI2();
                        window.frame.setVisible(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else { //if (args.length > 0)
                       String filefromargslist = "";
                    for(int i=0; i<args.length; i++) {
                        //System.out.println("array place " + i + ":" + args[i]);
                        filefromargslist = filefromargslist + args[i] + " ";
                        //System.out.println(filefromargslist);
                    }
                    //String loadedusrnme = "";
                    //String loadedpsswrd = "";
                    //String plainTextpassword = "";
                    //String plainTextuser = "";
                    //String appdata2 = usershome + "\\AppData\\Roaming\\";
                    //File storedpassword = new File( appdata2 + "YTscheduler/" + GDataDKey);                   
                    addusertolist = false;
                    new Thread(loadusersandpass).start();
                    int counter1 = 0;
                    System.out.print("Loading users");
                    while (addusertolist == false) {
                        //do nothing
                        counter1 = counter1 + 1;
                        System.out.print(".");
                        try {
                            Thread.currentThread();
                            Thread.sleep(500);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                       
                    }
                    System.out.println("");
                    File fleExample = new File( appdata + "YTscheduler/" + filefromargslist);
                    File fleExampleDES = new File( appdata + "YTscheduler/" + "description." + filefromargslist);
                    if( fleExample.exists() ) {
                        String selecteduser = null;
                        String username2 = "";
                        String passwrd2 = "";
                        String desiredtitle2 = null;
                        String discription2 = "";
                        String filestring = null;
                        String YTcatorgories3 = null;
                        String privacyoption3 = null;
                        String keywords2 = null;
                        String videomimetype = null;
                        String[] arr = null;
                        Scanner opnScanner2 = null;
                        try {
                            opnScanner2 = new Scanner(fleExample);
                        } catch (FileNotFoundException e2) {
                            e2.printStackTrace();
                        }
                        while( opnScanner2.hasNext() ) {
                            // Read each line and display its value
                            selecteduser = (String) opnScanner2.nextLine(); // discription2
                            desiredtitle2 = opnScanner2.nextLine(); // desiredtitle2                   
                            filestring = opnScanner2.nextLine(); // filestring
                            YTcatorgories3 = opnScanner2.nextLine(); // YTcatorgories3
                            privacyoption3 = (String) opnScanner2.nextLine(); // privacyoption3
                            videomimetype = opnScanner2.nextLine(); // privacyoption3
                            keywords2 = opnScanner2.nextLine(); // keywords2   
                           
                            String matchList = "";
                            Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
                            Matcher regexMatcher = regex.matcher(keywords2);
                            while (regexMatcher.find()) {
                                if (regexMatcher.group(1) != null) {
                                    // Add double-quoted string without the quotes
                                    matchList =  matchList + regexMatcher.group(1) + ";";
                                } else if (regexMatcher.group(2) != null) {
                                    // Add single-quoted string without the quotes
                                    matchList =  matchList + regexMatcher.group(2) + ";";
                                } else {
                                    // Add unquoted word
                                    matchList =  matchList + regexMatcher.group() + ";";
                                }
                            }
                           
                            arr = matchList.split(";");
                        }
                        opnScanner2.close();                   
                        String username21 = selecteduser;
                        List testarray = new ArrayList();
                        testarray.add(username21);
                        for(int i=0; i<savedloginU.size(); i++) {
                            if (savedloginU.get(i).equals(testarray.get(0))) {
                                System.out.println("username " + savedloginU.get(i) + " found");
                                passwrd2 = (String) savedloginP.get(i);
                                username2 = (String) savedloginU.get(i);
                            }
                        }
                        if (passwrd2 == "") {
                            System.out.println("Password for stored username not found");
                            return;
                        }
                        Scanner opnScannerDES = null;                       
                        try {
                            opnScannerDES = new Scanner(fleExampleDES);
                        } catch (FileNotFoundException e1) {
                            e1.printStackTrace();
                        }
                        while( opnScannerDES.hasNext() ) {
                            discription2 =  discription2 + opnScannerDES.nextLine() + "\n"; // discription2
                        }
                        opnScannerDES.close();                               
                        boolean privacyoption4 = Boolean.parseBoolean(privacyoption3) ;                       
                        YouTubeService myService = new YouTubeService(username2, GDataDKey);
                        VideoEntry newEntry = new VideoEntry();
                        YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
                        mg.setTitle(new MediaTitle());
                        mg.getTitle().setPlainTextContent("Temp title");
                        mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, YTcatorgories3));
                        mg.setDescription(new MediaDescription());
                        mg.getDescription().setPlainTextContent("Temp description");
                        mg.setPrivate(privacyoption4);               
                        threadjopsmd = "Your scheduled upload \"" + desiredtitle2 + "\" has started \n Please dont close the \"Taskeng.exe\" window";
                        System.out.println("Your scheduled upload \"" + desiredtitle2 + "\" has started \n Please dont close the \"Taskeng.exe window\"");               
                        MediaFileSource ms = new MediaFileSource(new File(filestring), videomimetype);
                        newEntry.setMediaSource(ms);
                        String uploadUrl =
                          "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads";
                        try {
                            myService.setUserCredentials(username2,passwrd2);           
                            VideoEntry createdEntry = myService.insert(new URL(uploadUrl), newEntry); //Uploads
                            createdEntry.getMediaGroup().getDescription().setPlainTextContent(discription2);
                            createdEntry.update();
                            createdEntry.getMediaGroup().getTitle().setPlainTextContent(desiredtitle2);
                            createdEntry.update();
                            for(int i=0;i<arr.length;i++) {
                                if (arr[i].length() > 1) {
                                    if (arr[i].length() < 31) {
                                        System.out.println("Adding keyword:" + arr[i]);
                                        createdEntry.getMediaGroup().getKeywords().addKeyword((String) arr[i]); //TODO bad request on keywords
                                    }
                                }
                                createdEntry.update();
                            }
                        } catch (IOException | ServiceException e) {
                            e.printStackTrace();
                            System.out.println("Username authentication error. Is your stored username and password correct?");
                            return;
                        }              
                        System.out.println("Video uploaded");
                        System.exit(0);                                               
                    } else { // if( !fleExample.exists() )                       
                        System.out.println(fleExample + ": No file exists with that name");
                        return;
                    }
                    return;           
                }
            }
        });
    }
    public YtuSchedulerGUI2() {
        initialize();
    }
    private void initialize() {
        frame = new JFrame("YtuScheduler" + discription.getText());
        frame.setBounds(100, 100, 669, 559);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(null);
           
        JLabel lblUsername = new JLabel("Username");
        lblUsername.setBounds(377, 26, 59, 20);
        frame.getContentPane().add(lblUsername);
       
        JLabel lblPassword = new JLabel("Password");
        lblPassword.setBounds(518, 26, 59, 20);
        frame.getContentPane().add(lblPassword);
       
        passwrd = new JPasswordField();
        passwrd.setBounds(518, 44, 127, 20);
        frame.getContentPane().add(passwrd);
       
        desiredtitle.setBounds(10, 44, 359, 20);
        frame.getContentPane().add(desiredtitle);
        desiredtitle.setColumns(10);
       
        JLabel lblTitle = new JLabel("Title");
        lblTitle.setBounds(10, 29, 46, 14);
        frame.getContentPane().add(lblTitle);
       
        JLabel lblDescription = new JLabel("Description");
        lblDescription.setBounds(10, 90, 98, 14);
        frame.getContentPane().add(lblDescription);
        discription.setLineWrap(true);
       
       
        discription.setBounds(1, 125, 633, 77);
        frame.getContentPane().add(discription);
       
        JScrollPane discriptionJSP = new JScrollPane(discription);
        discriptionJSP.setBounds(10, 106, 635, 203);
        frame.getContentPane().add(discriptionJSP);
       
        JLabel lblNewLabel = new JLabel("Catorgory");
        lblNewLabel.setBounds(237, 64, 59, 14);
        frame.getContentPane().add(lblNewLabel);
       
        JLabel lblNewLabel_1 = new JLabel("Privacy");
        lblNewLabel_1.setBounds(138, 64, 46, 14);
        frame.getContentPane().add(lblNewLabel_1);
       
        JLabel lblKeywords = new JLabel("Keywords");
        lblKeywords.setBounds(10, 311, 68, 14);
        frame.getContentPane().add(lblKeywords);
       
        YTcatorgories2.setBounds(236, 79, 133, 20);
        frame.getContentPane().add(YTcatorgories2);
       
        privacyoption2.setBounds(137, 79, 97, 20);
        frame.getContentPane().add(privacyoption2);
       
        keywords = new JTextField();
        keywords.setBounds(9, 327, 636, 20);
        frame.getContentPane().add(keywords);
        keywords.setColumns(10);
       
        JButton btnUploadNow = new JButton();
        btnUploadNow.setAction(action);
        btnUploadNow.setBounds(10, 355, 309, 30);
        frame.getContentPane().add(btnUploadNow);
       
        JButton btnScheduleIt = new JButton();
        btnScheduleIt.setAction(action_1);
        btnScheduleIt.setBounds(540, 355, 105, 30);
        frame.getContentPane().add(btnScheduleIt);
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       
        list.setBounds(10, 509, 629, 70);
        frame.getContentPane().add(list);
       
        JScrollPane scrollPane = new JScrollPane(list);
        scrollPane.setBounds(10, 393, 529, 105);
        frame.getContentPane().add(scrollPane);
       
       
        filelocation = new JTextField("");
        filelocation.setBounds(105, 5, 537, 20);
        frame.getContentPane().add(filelocation);
        filelocation.setColumns(10);
        filelocation.addFocusListener(listener);
        filelocation.setAction(action_7);

       
        JButton btnNewButton = new JButton();
        btnNewButton.setAction(action_2);
        btnNewButton.setBounds(8, 5, 89, 20);
        frame.getContentPane().add(btnNewButton);
       
        JButton btnReschedule = new JButton("Reschedule");
        btnReschedule.setAction(action_3);
        btnReschedule.setBounds(540, 392, 105, 23);
        frame.getContentPane().add(btnReschedule);
       
        JButton btnRunNow = new JButton("Run now");
        btnRunNow.setAction(action_4);
        btnRunNow.setBounds(540, 447, 105, 23);
        frame.getContentPane().add(btnRunNow);
       
        JButton btnDelete = new JButton("Delete");
        btnDelete.setAction(action_5);
        btnDelete.setBounds(540, 474, 105, 23);
        frame.getContentPane().add(btnDelete);
       
        username = new JComboBox();
        username.setEditable(true);
        username.setBounds(377, 44, 136, 20);
        frame.getContentPane().add(username);
        //username.addActionListener
        username.setAction(action_6);
       
        statusbar.setFont(new Font("Tahoma", Font.PLAIN, 12));
        statusbar.setBounds(10, 500, 633, 21);
        frame.getContentPane().add(statusbar);
       
        ytstime.setBounds(422, 364, 61, 20);
        frame.getContentPane().add(ytstime);
        ytstime.setColumns(10);
       
        ytsdate.setBounds(329, 364, 86, 20);
        frame.getContentPane().add(ytsdate);
        ytsdate.setColumns(10);
       
        JLabel lblDate = new JLabel("Date mm/dd/yyyy");
        lblDate.setBounds(329, 352, 111, 14);
        frame.getContentPane().add(lblDate);
       
        JLabel lblTimeHhmm = new JLabel("  Time HH:MM");
        lblTimeHhmm.setBounds(422, 352, 86, 14);
        frame.getContentPane().add(lblTimeHhmm);
       
        AMPM2.setBounds(490, 364, 47, 19);
        frame.getContentPane().add(AMPM2);
       
        JButton button = new JButton("New button");
        button.setAction(action_9);
        button.setBounds(504, 79, 141, 20);
        frame.getContentPane().add(button);
       
        JButton btnNewButton_1 = new JButton("New button");
        btnNewButton_1.setAction(action_8);
        btnNewButton_1.setBounds(376, 79, 128, 20);
        frame.getContentPane().add(btnNewButton_1);
       
        JButton btnReschedule_1 = new JButton("Reschedule");
        btnReschedule_1.setAction(action_10);
        btnReschedule_1.setBounds(540, 419, 105, 23);
        frame.getContentPane().add(btnReschedule_1);
    }
    private class SwingAction extends AbstractAction {
        private static final long serialVersionUID = 5440391449648952784L;
        public SwingAction() {
            putValue(NAME, "Upload now");
            putValue(SHORT_DESCRIPTION, "Click here to upload your video now");
        }
        public void actionPerformed(ActionEvent e) {
            username2 = (String) YtuSchedulerGUI2.username.getSelectedItem();
            passwrd2 = (String) YtuSchedulerGUI2.passwrd.getText();
            desiredtitle2 = YtuSchedulerGUI2.desiredtitle.getText();
            discription2 = YtuSchedulerGUI2.discription.getText();
            YTcatorgories3 = (String) YtuSchedulerGUI2.YTcatorgories2.getSelectedItem();
            privacyoption3 = (String) YtuSchedulerGUI2.privacyoption2.getSelectedItem();
            keywords2 = YtuSchedulerGUI2.keywords.getText();
            filelocationtest = (String) YtuSchedulerGUI2.filelocation.getText();
            if (filestringstr == null) {
                if (filelocationtest.length() == 0) {
                    systemoutvar = "Please choose a file";
                    new Thread(systemout).start();
                    JOptionPane.showMessageDialog(null, systemoutvar);
                    return;
                   
                } else {
                    systemoutvar = "setting filestringstr to filelocationtest";
                    new Thread(systemout).start();
                    String[] filestringarr = filelocationtest.split("\\\\"); // uses \\ as a delimiter and splits a string in to an array
                    for(int i=0; i<filestringarr.length; i++) {
                        //System.out.println("array place " + i + ":" + args[i]);
                        filestringstr = filestringarr[i];
                    }       
                }
                systemoutvar = filestringstr;
                new Thread(systemout).start();
            }
            if (username2 == null) {
                systemoutvar = "Please enter a username";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
            if (passwrd2.length() == 0) {
                systemoutvar = "Please enter a password";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
           
            if (discription2.length() == 0) {
                discription2 = filestringstr;
            }
            if (desiredtitle2.length() == 0) {
                desiredtitle2 = filestringstr;
            }
            if (keywords2.length() < 2) {
                keywords2 = filestringstr;
            }
            System.out.println("File location: " + filelocationtest);
            System.out.println("File name: " + filestringstr);
            String matchList = "";
            Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
            Matcher regexMatcher = regex.matcher(keywords2);
            while (regexMatcher.find()) {
                if (regexMatcher.group(1) != null) {
                    // Add double-quoted string without the quotes
                    matchList =  matchList + regexMatcher.group(1) + ";";
                } else if (regexMatcher.group(2) != null) {
                    // Add single-quoted string without the quotes
                    matchList =  matchList + regexMatcher.group(2) + ";";
                } else {
                    // Add unquoted word
                    matchList =  matchList + regexMatcher.group() + ";";
                }
            }
            arr = matchList.split(";");
            if (privacyoption3 == "Public") {
                privacyoption4 = false;
            } else {
                privacyoption4 = true;
            };
            new Thread(makevideoconfig).start();
            try {
                Thread.currentThread();
                Thread.sleep(1000);
            } catch (InterruptedException e1) {
                e1.printStackTrace();
            }
            new Thread(saveloginstuff).start();
            new Thread(startupload).start();
            return;
        }
    }
    private class SwingAction_1 extends AbstractAction {
        private static final long serialVersionUID = -7249609492621075126L;
        public SwingAction_1() {
            putValue(NAME, "Schedule it");
            putValue(SHORT_DESCRIPTION, "Click here to upload the video later");
        }
        public void actionPerformed(ActionEvent e) {
            new Thread(makevideoconfig).start();
            username2 = (String) YtuSchedulerGUI2.username.getSelectedItem();
            passwrd2 = (String) YtuSchedulerGUI2.passwrd.getText();
            desiredtitle2 = YtuSchedulerGUI2.desiredtitle.getText();
            discription2 = YtuSchedulerGUI2.discription.getText();
            YTcatorgories3 = (String) YtuSchedulerGUI2.YTcatorgories2.getSelectedItem();
            privacyoption3 = (String) YtuSchedulerGUI2.privacyoption2.getSelectedItem();
            keywords2 = YtuSchedulerGUI2.keywords.getText();
            filelocationtest = (String) YtuSchedulerGUI2.filelocation.getText();
            if (filestringstr == null) {
                if (filelocationtest.length() == 0) {
                    systemoutvar = "Please choose a file";
                    new Thread(systemout).start();
                    //JOptionPane.showMessageDialog(null, systemoutvar);
                    return;
                   
                } else {
                    systemoutvar = "setting filestringstr to filelocationtest";
                    new Thread(systemout).start();
                    String[] filestringarr = filelocationtest.split("\\\\"); // uses \\ as a delimiter and splits a string in to an array
                    for(int i=0; i<filestringarr.length; i++) {
                        filestringstr = filestringarr[i];
                    }                   
                }
                systemoutvar = filestringstr;
                new Thread(systemout).start();           
            }
            if (username2 == null) {
                systemoutvar = "Please enter a username";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
            if (passwrd2.length() == 0) {
                systemoutvar = "Please enter a password";
                new Thread(systemout).start();
                JOptionPane.showMessageDialog(null, systemoutvar);
                return;
               
            }
           
            if (discription2.length() == 0) {
                discription2 = filestringstr;
            }
            if (desiredtitle2.length() == 0) {
                desiredtitle2 = filestringstr;
            }
            if (keywords2.length() < 2) {
                keywords2 = filestringstr;
            }
            String ytsdate2 = ytsdate.getText();
            String ytstime2 = ytstime.getText();
            String AMPM3 = (String) AMPM2.getSelectedItem();          
            String[] ytstime3 = ytstime2.split(":"); // uses : as a delimiter and splits a string in to an array
            String[] ytsdate3 = ytsdate2.split("/"); // uses / as a delimiter and splits a string in to an array           
            String ytsdateMM = ytsdate3[0];
            String ytsdateDD = ytsdate3[1];
            String ytsdateYY = ytsdate3[2];
            String ytstimeHH = ytstime3[0];
            String ytstimeMM = ytstime3[1];      
            String ytshourString = null;
            if (AMPM3 == "PM") {
                System.out.println("PM cought");
                switch (ytstimeHH) {
                case "1": ytshourString = "13";       break;
                case "2": ytshourString = "14";      break;
                case "3": ytshourString = "15";         break;
                case "4": ytshourString = "16";         break;
                case "5": ytshourString = "17";           break;
                case "6": ytshourString = "18";          break;
                case "7": ytshourString = "19";          break;
                case "8": ytshourString = "20";        break;
                case "9": ytshourString = "21";     break;
                case "01": ytshourString = "13";       break;
                case "02": ytshourString = "14";      break;
                case "03": ytshourString = "15";         break;
                case "04": ytshourString = "16";         break;
                case "05": ytshourString = "17";           break;
                case "06": ytshourString = "18";          break;
                case "07": ytshourString = "19";          break;
                case "08": ytshourString = "20";        break;
                case "09": ytshourString = "21";     break;
                case "10": ytshourString = "22";       break;
                case "11": ytshourString = "23";      break;
                case "12": ytshourString = "12";      break;
                default: ytshourString = ytstimeHH; break;               
            }
            }else if (AMPM3 == "AM") {
                System.out.println("AM cought");
                switch (ytstimeHH) {
                case "01": ytshourString = "01";       break;
                case "02": ytshourString = "02";      break;
                case "03": ytshourString = "03";         break;
                case "04": ytshourString = "04";         break;
                case "05": ytshourString = "05";           break;
                case "06": ytshourString = "06";          break;
                case "07": ytshourString = "07";          break;
                case "08": ytshourString = "08";        break;
                case "09": ytshourString = "09";     break;
                case "1": ytshourString = "01";       break;
                case "2": ytshourString = "02";      break;
                case "3": ytshourString = "03";         break;
                case "4": ytshourString = "04";         break;
                case "5": ytshourString = "05";           break;
                case "6": ytshourString = "06";          break;
                case "7": ytshourString = "07";          break;
                case "8": ytshourString = "08";        break;
                case "9": ytshourString = "09";     break;
                case "10": ytshourString = "10";       break;
                case "11": ytshourString = "11";      break;
                case "12": ytshourString = "00";       break;
                default: ytshourString = ytstimeHH; break;
                }               
            }
            ytstimeHH = ytshourString;
            String ytstime4 = ytstimeHH + ":" + ytstimeMM;
            String ytsdate4 = ytsdateMM + "/" + ytsdateDD + "/" + ytsdateYY;
            String ytsdate5 = ytsdateYY + "." + ytsdateMM + "." + ytsdateDD;
            String ytstime5 = ytstimeHH + "." + ytstimeMM;
            String Ytusjarfilelocation = "\"java.exe -jar \'" + usershome + "\\AppData\\Roaming\\YTscheduler\\YtuScheduler.jar\'";
            String olsytu = " " + username2 + "_" + filestringstr + ".txt";
            String taskname = desiredtitle2;
            String[] taskname2 = taskname.split(" ");
            String taskname3 = "";
            olsytu = olsytu.replace( "\'",""); //TODO
            olsytu = olsytu.replace( "\"",""); 
            for(int i=0; i<taskname2.length; i++) {
                taskname3 = taskname3 + taskname2[i] + "_";
            }
            String taskname4 = "YtuScheduler_"  + username2 + "_" + taskname3 + ytsdate5 + "_" + ytstime5;       
            taskname4 = taskname4.replace( "\'",""); 
            taskname4 = taskname4.replace( "\"","");
            try {
                System.out.println("Ytusjarfilelocation:" + Ytusjarfilelocation);
                // FIXED: scheduled task fails when there is a single or double quote in the title (maybe filename as well?) just remove them from text file name.
                String makeascheduler = "SchTasks /Create /SC ONCE /TN " + taskname4 + " /TR " + Ytusjarfilelocation + olsytu + "\" /ST " + ytstime4 + " /SD "  + ytsdate4;
                Runtime rt = Runtime.getRuntime();
                Process pr = rt.exec(makeascheduler);
                System.out.println(makeascheduler);
                BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                String line=null;
                String linetake2 = "";  
                linetake2 = "Task creation has failed";
                while((line=input.readLine()) != null) {
                    //System.out.println(line);
                    linetake2 = line;
                }
                //JOptionPane.showMessageDialog(frame, linetake2);   
                systemoutvar = linetake2;
                new Thread(systemout).start();
                int exitVal = pr.waitFor();
                System.out.println("code:"+exitVal);
             } catch(Exception e1) {
                System.out.println(e1.toString());
                e1.printStackTrace();
            }
            YtuSchedulerGUI2.desiredtitle.setText("");
            YtuSchedulerGUI2.discription.setText("");
            YtuSchedulerGUI2.YTcatorgories2.setSelectedItem("Autos");   
            YtuSchedulerGUI2.privacyoption2.getSelectedItem();
            YtuSchedulerGUI2.keywords.setText("");
            YtuSchedulerGUI2.filelocation.setText("");
            System.out.println("Task has been scheduled");
        }
    }
    private class SwingAction_2 extends AbstractAction {
        private static final long serialVersionUID = -4109162319778233662L;
        public SwingAction_2() {
            putValue(NAME, "Browse");
            putValue(SHORT_DESCRIPTION, "Borwse for a video file");
        }
        public void actionPerformed(ActionEvent e) {
            System.out.println("File selection dialog opened");
            int answer = fc.showOpenDialog(fc);
            if (answer == JFileChooser.APPROVE_OPTION) 
            {             
                fcstring = fc.getSelectedFile();
                filestring = fcstring.toString();
                System.out.println("File choosen");
            } else {
                System.out.println("No file choosen");
                return;
            }
            filelocation.setText(filestring);
            new Thread(setmimetype).start();
        }
    }
    private class SwingAction_3 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = 6962752476160718560L;
        public SwingAction_3() {
            putValue(NAME, "Load tasks");
            putValue(SHORT_DESCRIPTION, "Load currently scheduled tasks ... Use this to confirm that your task has been scheduled"/*"Reschedule selected task"*/);
           
        }
        public void actionPerformed(ActionEvent e) {
            try {
                String makeascheduler1 = "SchTasks /Query /FO CSV";// > SchTasksCSVoutput.txt";
                Runtime rt = Runtime.getRuntime();
                Process pr = rt.exec(makeascheduler1);
                //System.out.println(makeascheduler);
                BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                String line=null;
                String linetake2 = "";  
                while((line=input.readLine()) != null) {
                    String[] linearr=line.replace( "\"","").split(",");
                    String[] linearr2=linearr[0].split("_");
                    if (linearr2[0].equals("\\YtuScheduler")) {
                        //System.out.println("linearr[0]:" + linearr[0]);
                        SchTaskarrlist.add(line.replace( "\"","").replace( "\\YtuScheduler_",""));
                        SchTaskarrlistraw.add(line);
                        System.out.println(line);
                    }
                }
                System.out.println(linetake2);
                int exitVal = pr.waitFor();
             } catch(Exception e1) {
                System.out.println(e1.toString());
                e1.printStackTrace();
            }
            boolean yesadd = true;
            for(int i=0; i<SchTaskarrlist.size(); i++) {
                yesadd = true;
                for(int i1=0; i1<SchTaskarralreadylisted.size(); i1++) {
                    if (SchTaskarralreadylisted.get(i1).equals(SchTaskarrlist.get(i))) {
                        yesadd = false;
                    }                   
                }
                if (yesadd == true) {
                    System.out.println("adding:" + SchTaskarrlist.get(i));
                    listmodel.addElement(SchTaskarrlist.get(i));
                    SchTaskarralreadylisted.add(SchTaskarrlist.get(i));
                    SchTaskarralreadylistedraw.add(SchTaskarrlistraw.get(i));
                    //System.out.println("SchTaskarrlist.get(i):" + SchTaskarrlist.get(i));
                }
            }
            new Thread(loadtasks).start();
        }
    }
    private class SwingAction_4 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = 1541079814375640616L;
        public SwingAction_4() {
            putValue(NAME, "Run now");
            putValue(SHORT_DESCRIPTION, "Run the selected task now (the task may still run as originally scheduled"/*Run the selected task now (will delete task after upload)*/);
        }
        public void actionPerformed(ActionEvent e) {
            new Thread(runtask).start();
        }
    }   
    private class SwingAction_5 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = -83110152283876448L;
        public SwingAction_5() {
            putValue(NAME, "Delete");
            putValue(SHORT_DESCRIPTION, "Deletes selected task");
        }
        public void actionPerformed(ActionEvent e) {
            new Thread(deletetask).start();

        }
    }
    private class SwingAction_6 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = 6786548599216332991L;
        public SwingAction_6() {
        }
        public void actionPerformed(ActionEvent e) {
            System.out.println("user selection change detected");
            //new Thread(systemout).start();
            //System.out.println(systemoutvar);
            for(int i=0; i<savedloginU.size(); i++) {
                if ((String) savedloginU.get(i) == username.getSelectedItem()) {
                    //System.out.println("savedloginU currently selected:" + (String) savedloginU.get(i));
                    System.out.println("Retrieving password for:" + (String) savedloginU.get(i));
                    YtuSchedulerGUI2.passwrd.setText((String) savedloginP.get(i));
                }
            }           
        }
    }
    private class SwingAction_7 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = 1982263906556842811L;
        public SwingAction_7() {
        }
        public void actionPerformed(ActionEvent e) {
            System.out.println("Change detected in file path area");
            new Thread(setmimetype).start();
        }
    }
    private class SwingAction_8 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = -2388188843950976676L;
        public SwingAction_8() {
            putValue(NAME, "Save username");
            putValue(SHORT_DESCRIPTION, "Save the currently typed in username and password (will ignore \'save login\' selection \n You can use this to update the password aswell");
        }
        public void actionPerformed(ActionEvent e) {
            savelogininformation3 ="Yes";
            new Thread(saveloginstuff).start();        }
    }
    private class SwingAction_9 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = -1753372711425999802L;
        public SwingAction_9() {
            putValue(NAME, "Remove username");
            putValue(SHORT_DESCRIPTION, "Deletes the saved username and password");
        }
        public void actionPerformed(ActionEvent e) {
            new Thread(removeselecteduser).start();
        }
    }
    private class SwingAction_10 extends AbstractAction {
        /**
         *
         */
        private static final long serialVersionUID = 1541173214575640616L;
        public SwingAction_10() {
            putValue(NAME, "Reschedule");
            putValue(SHORT_DESCRIPTION, "Reschedule selected task"/*Run the selected task now (will delete task after upload)*/);
        }
        public void actionPerformed(ActionEvent e) {
            new Thread(rescheduletask).start();
        }
    }
}
}}


– Elliott(Talk|Cont)  20:33, 23 November 2011 (UTC)[reply]

If I understand your code correctly (it's not very readable; you didn't ask for general comments on the code, so I'm biting my tongue) what you're doing is, rather than rather than store the password in a plaintext file, you're storing it in an encrypted file, and the key to that in a plaintext file (the compiled java .class file). That's no more secure. For entirely non-interactive tasks that need to store passwords the cleanest way is simply OS level file protection. If a program needs access to a secret (and not a hash of the secret, or a token that gets someone else to manipulate the secret on their behalf) then anyone who can run that program (locally) can see the secret. -- Finlay McWalterTalk 22:13, 23 November 2011 (UTC)[reply]
If you have some pointers on my code feel free to express them. As for the key, yes part of it is being stored in clear text in the source. But part of it is being pulled via a system variable(user.home). My thinking here was that the key would change depending on the system its being ran on. I am not sure how to make a key that changes on every system without changing every time the program is ran. – Elliott(Talk|Cont)  22:46, 23 November 2011 (UTC)[reply]
As you've got a GUI, your safest to not store the password in the file system at all, but to prompt the user for it at startup and forget it as soon as you're through with it. -- Finlay McWalterTalk 22:20, 23 November 2011 (UTC)[reply]
The user can choose to store the password or not. But if they choose to not store the password then the scheduling part will not work. – Elliott(Talk|Cont)  22:46, 23 November 2011 (UTC)[reply]
I strongly suggest storing the Youtube login cookies (if possible) instead. MER-C 10:43, 28 November 2011 (UTC)[reply]

unzip a 7 G B

I have downloaded a software of size 7 G B ,computer shows it is of type winrar zip archive, WIN RAR can not able to unzip it and i get an error message as " unexpected end of archieve".I think win rar has limit up to 4 G.B .which software i can use to open it.Is their any free software --119.152.37.249 (talk) 21:54, 23 November 2011 (UTC)tpf[reply]

According to this page, the maximum file and/or archive size is much much more than 7GB. As that page notes, you must be using NTFS to store any file that is larger than 4GB. If you are sure your file system can handle the 7GB file, then you should check that your download is complete and not corrupted. --LarryMac | Talk 22:02, 23 November 2011 (UTC)[reply]

There are also various unrar utilities out there, with various levels of support. When in doubt try to use something from the RAR creators, RARLAB. ¦ Reisio (talk) 00:24, 24 November 2011 (UTC)[reply]

Try 7zip. It's open-source. I suspect that the download has been corrupted though. Try to check if the file size matches. Either redownload or resume download using the partial file.-- Obsidin Soul 06:17, 24 November 2011 (UTC)[reply]
Mayhaps the OP had unbeknownst downloaded an ISO file? What is the actual file extension? --Ouro (blah blah) 06:59, 24 November 2011 (UTC)[reply]

If you're hitting a limit at around 4 GB it's undoubtedly because either the program or more likely the filesystem you're using is limited to 4GB files (FAT32 is the most obvious of these). It's probably due to you working on a FAT32 filesystem. Shadowjams (talk) 07:08, 24 November 2011 (UTC)[reply]


November 24

Jpegs refusing to save as lower quality

They're scanned images - I had them scanned at high resolution, which I regret now, because I can't do much with them; but when I try to Save As a lower quality file, the file remembers all the other changes I've made, but not that one. What gives?

Thanks Adambrowne666 (talk) 05:26, 24 November 2011 (UTC)[reply]

The what remembers all other changes? Program? Which? mogrify -resize 800 *jpg inside a duplicate directory would resize them all to 800 pixels wide. ¦ Reisio (talk) 06:09, 24 November 2011 (UTC)[reply]

SOrry - it's a programme called Preview, in a friend's Mac. Adambrowne666 (talk) 06:34, 24 November 2011 (UTC)[reply]

In JPEG encoding, the word "quality" usually refers to the selection of a quantization matrix, which results in a lesser or greater degree of lossiness. Low quality will mean a smaller file and more visible compression artifacts (the basic tradeoff of lossy compression), but will have no effect on the resolution (width and height). 67.162.90.113 (talk) 09:12, 24 November 2011 (UTC)[reply]
What makes you think it isn't remembering that change? --Mr.98 (talk) 12:37, 24 November 2011 (UTC)[reply]

Wasn't remembering, cos when I opened the file after closing it, the other changes remained, but not that. But never mind, everyone; I opened them instead in another programme, and was able to change the quality - thanks for the note about lossiness, too, 67.162; was interesting. Adambrowne666 (talk) 01:15, 25 November 2011 (UTC)[reply]

I strongly suspect the quality setting only controls how the currently loaded image is saved into JPEG format, but there's no actual quality value that is stored in the JPEG file. When you re-open the file and look at the quality setting again, Preview might show a default value every time. The other program you're using might just be showing the last quality setting you used. --Bavi H (talk) 03:01, 25 November 2011 (UTC)[reply]
The easiest way to see that it is in fact saving the quality is that the file size will correlate with the quality setting. Preview tells you what the resultant file size is with a given quality; if that's the file size of the file, then the quality has been downgraded appropriately. --Mr.98 (talk) 16:36, 25 November 2011 (UTC)[reply]
The JPEG format does have a "quality" value listed in its header, in the range from 1 to 100, although values above 95 are not considered useful, as they increase the file size without improving fidelity to the original. Looie496 (talk) 16:50, 25 November 2011 (UTC)[reply]

Will Apache Software Foundation post its OpenOffice.org releases to www.openoffice.org? Or to another website? 171.226.92.170 (talk) 11:23, 24 November 2011 (UTC)[reply]

According to this page the main Open Office pages will migrate to http://ooo-site.apache.org/ You can already download Open Office from there. If you have more questions about open office, it would be more sensible to ask in the OO forums[1]. --Colapeninsula (talk) 14:29, 24 November 2011 (UTC)[reply]

http://www.libreoffice.org/ ¦ Reisio (talk) 16:33, 24 November 2011 (UTC)[reply]

To make sense of Reisio's offered link... Many of the top guys involved in OpenOffice formed a group called The Document Foundation. The goal appeared to be to flip the roles between Oracle and OpenOffice. Instead of OpenOffice being under Oracle, they wanted Oracle to be just a contributor to The Document Foundation, which would own OpenOffice. Oracle refused the offer and told the guys to leave OpenOffice. They left and started LibreOffice, a fork of OpenOffice. The end result is that many people call LibreOffice the latest version of OpenOffice. It is actually a fork of OpenOffice. -- kainaw 17:20, 24 November 2011 (UTC)[reply]

Problem with Word 2003

I don't know when or how it happened, but opening a new blank document gives something essentially unusable. Rather than line breaks defining distinct paragraphs, so that for example the main heading can be bold/underlined/centred, each section heading can be left-justified/underlined and basic text just left-justified, any change in formatting applies to the whole document. Selecting specific text, e.g. the main heading to restore it to centred, causes the whole document to be treated in the same way. I can't describe everything which can occur as I now don't do things this way - I have a document from the past which works OK, so that has been trimmed to almost nothing and used as a blank. But I'd like to be able to use the new document which opens within Word - can anyone suggest what needs to be done so that the nice simple default comes back?→109.151.180.61 (talk) 12:04, 24 November 2011 (UTC)[reply]

The problem is probably in the default template called "normal.dot". If you happen to have a backup of this, you could try restoring a previous version (preferably renaming the current version first, just in case). It is also possible to save your "good" blank document as a template to overwrite "normal.dot". The existing file is likely to be in either C:\Program Files\Microsoft Office\Templates\1033 or C:\Program Files\Microsoft Office\Office11 or C:\Documents and Settings\<Username>\Application Data\Microsoft\Templates. I'm still using Word 2000 which uses the template slightly differently, so I can't check fully for you. Dbfirs 13:04, 24 November 2011 (UTC)[reply]
Many thanks. The file was in the third location, and all is now well after it was replaced by the known good one.→109.151.180.61 (talk) 14:23, 24 November 2011 (UTC)[reply]
You can actually just delete (or rename to be extra safe) the normal.dot file and word automatically recreates it next time it runs. Vespine (talk) 00:17, 25 November 2011 (UTC)[reply]
Yes, I considered mentioning that fact, but the disadvantage is that you lose any modifications that you might have made to toolbars etc. I'm still using a normal.dot that was copied from many years and several computers ago. Dbfirs 11:10, 25 November 2011 (UTC)[reply]

GIMP: After entering manual parameters, then what?

I'm talking about over in the bottom portion of the tool window for most of the tools, for example, the rectangle select, I want to select a rectangle exactly with the upper left corner at (57, 63) and to have dimensions of (39x44) (just to pick some random examples). Obviously, it's easier in a case like this to type in the values than to try to do it with my hand on the mouse. But when I type in those values and try hitting the return key while the cursor is in any of those boxes, nothing happens. And there's no 'do it' button. How do I make (any) tool do what they do after setting parameters in the tool window? I'm using the Windows version of GIMP 2.6.11. And I don't want to sidestep the particular example I gave by creating guide lines and snapping to them because I'd still have to rely on my hand to get the guide bars in the right spot, make the box, and then get rid of the guides that I don't need any more, just for one box. 69.243.220.115 (talk) 12:30, 24 November 2011 (UTC)[reply]

Nevermind, I figured it out myself. I just create any box so there is a box on the screen and then enter my values so that box becomes the one I want. It always happens that I find the answer right after asking something. 69.243.220.115 (talk) 12:36, 24 November 2011 (UTC)[reply]
Correct. It makes sense if you work on more than one image at a time. There is only one toolbox. You must select the tool, then click on the image, then you can work with it. With one image, it is kind of obvious which one you are using. With more than one image open, it isn't obvious which one you are working with at the moment. -- kainaw 17:12, 24 November 2011 (UTC)[reply]

After wlan mal-function...

I get the following messages from dmesg:

[ 122.400319] PCI: Setting latency timer of device 0000:00:02.1 to 64 [ 122.400775] [drm] Initialized i915 1.6.0 20060119 on minor 1 [ 157.689304] NET: Registered protocol family 17 [ 264.413157] eth1: no IPv6 routers present [ 361.252423] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 378.155320] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 456.797599] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 354.891677] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 226.260692] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 649.037067] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 650.112046] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 650.129128] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 328.284400] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 534.841781] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 534.864297] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 331.711532] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 723.806547] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 364.678884] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 373.857744] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 390.905024] ipw2100: Fatal interrupt. Scheduling firmware restart. [ 393.233920] ipw2100: Fatal interrupt. Scheduling firmware restart.

......

eth1 and ipw2100 and my wireless...

Can something be done to repair it or is it the hardware broken? — Preceding unsigned comment added by 80.58.205.105 (talk) 17:25, 24 November 2011 (UTC)[reply]

We need a LOT more context. Ipw2100 is a common driver for a lot of intel chipset wireless drivers. The timing on your dmesg is intermittent as well. I assume you're trying to get a wireless connection on your laptop, and it's not working. Could you describe what processes you're using upt o that point? Indeed the dmesg seems to indicate some issues, but we need more info before it's clear that it's a hardware issue. Shadowjams (talk) 14:52, 25 November 2011 (UTC)[reply]


November 25

User interfaces for stock trading?

I'm trying to find an article I read online a while back - maybe two or three years ago - that discussed the user interface design of the terminals that financial professionals (stock traders etc) use. The article (probably from some blog) talked about how these user interfaces are very poorly designed, but that these professionals take pride in understanding and being able to use these unnecessarily complex systems, so any attempts at redesigned or improved systems have been met with disinterest.

I've tried to search for this article, but have not been able to find anything. I realize the chance that you have read it is fairly slim - what could help me find it though, is if anyone knows the name of these systems? This page has some examples of the kinds of systems I'm talking about. Thank you. Obiha (talk) 09:45, 25 November 2011 (UTC)[reply]

Perhaps start at electronic trading platform. ¦ Reisio (talk) 19:30, 25 November 2011 (UTC)[reply]

Help retrieving a deleted fanfiction

Hey, my little sister likes to read fanfictions on fanfiction.net, and she came to me crying a while ago. Apparently she'd read "a really, really, good Land Before Time" fanfiction called 'Two from the past' a long time ago. She'd really, really liked it, and recently went back to read it again to find it'd been deleted. She wants me to try and get it back for her.

A google search found that she's probably talking about this one: https://www.google.com/search?hl=en&safe=off&client=firefox-a&hs=LfE&rls=org.mozilla:en-US:official&sa=X&ei=3GzPTtO4MoPY2gWJm4nQDw&ved=0CCAQvwUoAQ&q=%22two+from+the+past%22+land+before+time&spell=1&biw=1366&bih=671 It's too far back for Google Cache to find, at least when I tried.

Is there any other way to retrieve the content of the story? 68.111.165.176 (talk) 10:41, 25 November 2011 (UTC)[reply]

Have you tried the Wayback Machine?--Shantavira|feed me 12:33, 25 November 2011 (UTC)[reply]
The site's robots.txt file excludes archiving, so it isn't on there. --Mr.98 (talk) 16:21, 25 November 2011 (UTC)[reply]
Could you email the person that wrote it, asking them to put it back or send you a copy? A long shot, but it might work. 148.197.81.179 (talk) 16:50, 25 November 2011 (UTC)[reply]
For clarification, the robots.txt ([2]) file on fanfiction.net specifically excludes the Wayback Machine archiver (ia_archiver). There's no way in general to exclude archiving while allowing indexing via the robots.txt file itself AFAIK. However you can use a meta element on a page by page basis [3]. From what I can tell having checked a specific story and the main page, fanfiction.net use the noarchive tag on all their pages, so they do forbid archiving throughout as well. Most bots which archive including Google, Bing & Webcitation do respect the robot meta tag. So unless you can find some fanfiction.net archive site, likely one which uses a bot which ignores normal convention and archives the site anyway yet hasn't been blocked; there's not much chance of finding a generic cached or archived copy of the story.
It sounds like the OP or their sister has already attempted to get in contact with the story writers via fanfiction.net without reply, possibly because the person simply hasn't checked their messages. Since the OP or their sister apparently used a third party I would recommend the OP create an account on fanfiction.net and make the contact themselves, not because I doubt the third party but simply because it's another line of communication that could fall down. Particularly if it takes a few months to hear from the authors.
But other then hoping the authors do eventual get in contact from the website, the only other real options I can think of are 1) Find some other contact for the authors, although from the limited info provided on the site, I don't know if you have much chance. 2) Find someone who has read the story and kept a personal copy. From one of the search results, it looks like Phoenix710 reviewed that specific story so an obvious person to ask. Other then that you could look for people who have reviewed a number of Land Before Time stories on fanfiction.net from different authors, but you're starting to get in to extreme long shot territory.
Nil Einne (talk) 13:08, 26 November 2011 (UTC)[reply]

Wget with proxies

Hi,

I'm using Wget 1.11.4 on Windows XP and, whereas I have no trouble (by calling wget with a URL as the unique argument) fetching files from the local intranet, it's impossible to get files from the WWW. So I looked in the Internet Explorer parameters (IE works fine with all URLs) and I found a link to a .pac file, which in turn gave me a proxy address and port number. So I typed:


C:\>set HTTP_PROXY = the_proxy_address:port_number (or http://the_proxy_address:port_number

or https://the_proxy_address:port_number)

C:\>set PROXY = on

(the .wgetrc file contains nothing but commented out lines)

But when I then call wget, I get nothing but "Connexion timed out" (even if I add "--proxy = on" to the command line and replace the User Agent description with -U), so I'm wondering what could be wrong. Also, I'd like to know if it's normal if, even with the --debug option, wget tells me it's trying to connect to the specified URL but never says it's connecting to the proxy first.

Thanks. Apokrif (talk) 11:58, 25 November 2011 (UTC)[reply]

In my info file it says the environment variables are lower case: http_proxy=url, also do you need authentication at your proxy? proxy_user and proxy_password will do this. Graeme Bartlett (talk) 12:18, 25 November 2011 (UTC)[reply]
Thanks, but I tried both upper- and lower-case. I think that if the proxy needed authentication, I would see it somewhere in IE settings or in the .pac file? (I found nothing). Apokrif (talk) 12:35, 25 November 2011 (UTC)[reply]

recording sounds

I want to have a microphone on my computer record sounds from my room, however, having gotten such a microphone and plugged it in, nothing happened. How do I set it up and open the program that tells it to start recording? The instruction book only tells me how to plug it in.

148.197.81.179 (talk) 16:48, 25 November 2011 (UTC)[reply]

Try Audacity. Comet Tuttle (talk) 16:53, 25 November 2011 (UTC)[reply]

OK, that works now, thanks. Just such a shame it's so quiet, and then buzzes when I turn the volume up enough. Still, guess I can't have everything perfect. 148.197.81.179 (talk) 17:07, 25 November 2011 (UTC)[reply]

1) Assuming it's an ordinary unpowered microphone, make sure the microphone is in connected to the pink microphone socket not the green line-in socket. 2) In the operating system's audio control panel / mixer, make sure to turn the level of the MIC port up. -- Finlay McWalterTalk 18:11, 25 November 2011 (UTC)[reply]

You can remove some of the "noise" in Audacity later. Avoiding it in the first place would require more expensive hardware, and isolation from other sound sources (including, usually, those generated by a running computer). ¦ Reisio (talk) 19:32, 25 November 2011 (UTC)[reply]

Yes, I tried the noise remover on the program before, when recording on my camera, which was even worse, but it removed almost all the sounds, leaving just a high pitched whistling in the loudest parts. I shall try the other suggestions, though, and also try moving the microphone a little closer to the source of the sounds, or perhaps the other way around. 148.197.81.179 (talk) 21:01, 25 November 2011 (UTC)[reply]

Have you tried using the noise remover in Audacity that you have to supply with a few seconds of background noise so it knows what to remove? I can't say anything concrete now, since this computer doesn't have Audacity installed, but you may find Spoken Wikipedia project's recording guidelines to be of assistance. ~Alison C. (Crazytales) 17:28, 30 November 2011 (UTC)[reply]

Projected cloud-computing costs

If present exponential trends in cost-effectiveness continue, what will be the annual cost in 2060 (in today's US$) of a cloud-computing system with the following specs? Processing, 30 exaflops, all GPGPU; data storage, 2150 bits with 2136 bit/s throughput, solid state, and with the standard replication level for critical life-support-equivalent data; Internet bandwidth, 10 Gbit/s fiber optic. (In case anyone's wondering, this is my personal retirement plan -- and yes, I know it doesn't include the upfront cost of digitization.) NeonMerlin 17:18, 25 November 2011 (UTC)[reply]

Seriously? There is no way we can even begin to reliably answer this question... --Ouro (blah blah) 19:04, 25 November 2011 (UTC)[reply]

For starters you could consider Moore's law. Cloud computing costs will probably be the cheapest eventually, as they require less work per client I would say. I'm not sure solid state as we know it will endure that long... remember only 30 years ago a portable tape cassette player was new, you're talking about 50 years from now. ¦ Reisio (talk) 19:43, 25 November 2011 (UTC)[reply]

Assuming Moore's Law type progressions, 30 Exaflops is probably achievable in 50 years (only 3000 times today's fastest supercomputer), but 2150 bits is 1022 times the world's entire storage capacity today. Such a large data storage array would not be expected to exist at any price in 2060 unless storage capacities progress much faster than Moore's Law predicts. Dragons flight (talk) 20:09, 25 November 2011 (UTC)[reply]

internet translation

Just wondering, can anyone here translate for me either of these two messages I received recently:

^^ ;-)
OLOOOL'd

I tried running them through my online translator, but nothing.

148.197.81.179 (talk) 20:58, 25 November 2011 (UTC)[reply]

  1. I agree with the preceding and/or it makes me smile and/or wink
  2. I am out loud laughing out out out loud or at least I just did
¦ Reisio (talk) 20:59, 25 November 2011 (UTC)[reply]

The ^^ emoticon is supposed to be two anime-style eyes closed as if you were smiling.

http://www.urbandictionary.com/define.php?term=%5E%5E

82.1.124.153 (talk) 11:56, 27 November 2011 (UTC)[reply]

High Gain Wireless USB Adapters

Those which look like a pen-drive with an antenna. Do they work much better than, say, the 'normal' laptop embedded wifi? 88.9.214.242 (talk) 22:29, 25 November 2011 (UTC)[reply]

You'd probably get a slight improvement. Probably a good idea to get one where the antenna can be removed and be replaced by a more sensitive one if possible. Most laptops I've seen inside had an antenna connected to the internal wireless card that ran round the back of the screen, which added up to a reasonable length. It is often possible to disconnect the internal connection and jerry rig up an external antenna connection, like you see on most wireless PCI cards. Nevard (talk) 03:11, 26 November 2011 (UTC)[reply]

November 26

Internet Explorer 8 Freezes

Internet Explorer 8 freezes when I open it. The tab just says connecting and I can't click on anything. The page doesn't load and it's only a white screen. I have to use ctl-alt-dlt to exit the window. I'm really not sure how to fix this. I tried installing the internet explorer 9 but it just hangs while it says its downloading. I have Windows 7 and any help would be appreciated. — Preceding unsigned comment added by 173.140.166.139 (talk) 00:20, 26 November 2011 (UTC)[reply]

Go to Start → Control Panel → Network and Internet → Internet Options → Advanced and click on the button that says Reset. Then, try to start Internet Explorer, again.—Best Dog Ever (talk) 01:50, 26 November 2011 (UTC)[reply]

That didn't work. 173.140.166.139 (talk) 02:07, 26 November 2011 (UTC)[reply]

Do Firefox, Opera, or other web browsers work OK on your machine? Comet Tuttle (talk) 07:02, 26 November 2011 (UTC)[reply]

Yes, I'm using Safari to answer this question. 173.141.192.113 (talk) 15:50, 26 November 2011 (UTC)[reply]

  1. Clear your cache by going to Start → Control Panel → Network and Internet → Internet Options → Delete. The only thing you need to check in there is Temporary Internet Files.
  2. Has Internet Explorer 8 ever worked on your computer? If it has, I would do a system restore: Start → All Programs → Accessories → System Tools → System Restore and pick a date when the problem was not happening.
  3. How long do you wait before using the task manager to kill Internet Explorer? I've seen Internet Explorer 8 take a long time to start up (especially on computers with slower CPUs and hard drives), but I've never seen it freeze indefinitely.
Best Dog Ever (talk) 23:07, 26 November 2011 (UTC)[reply]

Thanks, once I deleted temporary internet files, it worked. I'm even posting this from Internet Explorer. Any idea why temporary internet files would make Internet Explorer not work? 173.141.192.113 (talk) 03:40, 28 November 2011 (UTC)[reply]

Using the search bar on Firefox

I've got the latest version of Firefox (using GB spelling) on Ubuntu and Windows 7. For both, the search bar gives results for the UK for Google, Bing, Amazon, eBay and Yahoo. I assumed that it was due to the language variation I had downloaded but that isn't the case. My son has the US version on his laptop and it is giving the same results. How do we get the search bar to show us the Canadian site for the above? CambridgeBayWeather (talk) 08:20, 26 November 2011 (UTC)[reply]

It may be that geolocation systems are misidentifying your IP as being in the UK. What does http://www.dnsstuff.com/ report as your "located near" (top left of screen)? -- Finlay McWalterTalk 12:26, 26 November 2011 (UTC)[reply]
Assuming you have a Google account, click on the options icon (top right of screen) and then complete the location field.--Shantavira|feed me 16:05, 26 November 2011 (UTC)[reply]
The dnsstuff page says that I'm near Whitehorse, Yukon, which is where the provider has their mailing address. Strangely enough I can't find the place to enter my location into Google. I know it was (is) in there because Google sends the occasional email to remind me about it. I just noticed that if I click on the magnifying glass to the right of the search bar I get Google Canada. CambridgeBayWeather (talk) 17:05, 27 November 2011 (UTC)[reply]

How can a dictionary attack work?

Hi, I've often wondered how people can crack into systems by something as simple as a dictionary attack. I get the principle, but when I log into anything, there is a delay while the system does the handshaking etc., possibly on the order of about 3 to 10 seconds. How do people avoid this time wasting when they search by using "bots" and the like to crack a password? One attempt every 3 to 10 seconds looks decidedly slow to me. IBE (talk) 11:31, 26 November 2011 (UTC)[reply]

Several ways:
  • The bot is a hydra: it has dozens of concurrent heads all trying to log in at once
  • And it has hundreds of heads in dozens of other sites all trying to log in at once (if it's attacking your site, it's just trawling; it's very rarely personal)
  • They have infinite patience, and can try for weeks and months if they like
  • If a site imposes a progressive delay (a failed log-in means the next attempt is delayed by 5 or 10 seconds) the bot just disconnects. Even of that 3-10 second handshake that you as a human being see, it's likely that it's possible to spot the difference between a success and a failure some of the way through (and so again it need not wait a failure out)
  • Successful bots operate from botnets, where the connections come from regular PCs around the world. So blocking a given IP briefly has no effect. Worse, because some countries funnel all their traffic through a handful of IPs, blocking such an IP prevents all your legitimate users on that IP from accessing. A common strategy is progressively increasing block lengths (just like wikipedia does) but the problem is the same - you quickly deny service to all your legitimate users in that country.
  • They're also relying on non-random passwords; they know a reasonably proportion of most accounts have weak passwords, and they have a huge list of common passwords - so they can charge through that first (rather than the same dictionary you'd use for spell-checking).
All of this gets them the low-hanging fruit, which is often all they need. -- Finlay McWalterTalk 12:21, 26 November 2011 (UTC)[reply]

Now that is really dastardly :) thanks for the reply. IBE (talk) 14:21, 26 November 2011 (UTC)[reply]

Dictionary attacks are sometimes used against stolen databases and the hashed passwords they contain. Artificial delays don't affect attackers who get to run the hash algorithm and check for validity themselves. Paul (Stansifer) 23:25, 26 November 2011 (UTC)[reply]
Right, most dictionary attacks are probably offline attacks where the database was compromised and the attackers have access to the database offline. Shadowjams (talk) 02:40, 27 November 2011 (UTC)[reply]
Currently I'm watching Zoominfo try out loads of different email addresses it has made up to try and reach people where it doesn't have an email address. I hide the addresses behind a check so they don't get spammed It's vaguely amusing them trying different names for a person who refuses to use email and doesn't have an email address but yes a distionary attack is the same sort of persistent attck by a robot but multiplied up quite a bit. Dmcq (talk) 18:22, 27 November 2011 (UTC)[reply]

How does jailbreaking work?

How it is work without directly connection, and why Apple doesn't block it? Exx8 (talk) 20:59, 26 November 2011 (UTC)[reply]

Don't really understand the first part of your statement. As for the second, I'm sure Apple does what they can to block it, but there are a lot more people working for the opposite. ¦ Reisio (talk) 21:51, 26 November 2011 (UTC)[reply]

I ment in the first part that the jailbreaker usually does not have a direct connection to the iphone's bios or to the cpu. He needs to find an exploit to the shell isn't he?Exx8 (talk) 22:59, 26 November 2011 (UTC)[reply]

November 27

HTML code for inuktitut short u (ᐅ)

What is the HTML code (for example &eta; for η,, what gives you "ᐅ"? Bestη-θ 01:52, 27 November 2011 (UTC)[reply]

You can just use 'ᐅ' if you send the proper encoding via your server headers. ¦ Reisio (talk) 02:12, 27 November 2011 (UTC)[reply]
What is the HTML code? η-θ 02:16, 27 November 2011 (UTC)[reply]
The number for ᐅ is 1405 in hexadecimal. See http://www.unicode.org/charts/PDF/U1400.pdf.
Wavelength (talk) 02:24, 27 November 2011 (UTC)[reply]
The hexadecimal code &#x1405; produces ᐅ.
Wavelength (talk) 21:44, 27 November 2011 (UTC)[reply]

A story title written in code

Hey, I'm writing a story, and I wanted the title to be a string of computing language. Specifically, a single line of code that could represent a virus or other harmful effect to a computer. (Since this is what the story is about.) I'd appreciate if the code somehow still resembled a real word or couple of words. I don't mean exactly (I doubt any code could perfectly make a word) but just so its possible to still say the title.

Any language will work or anything, I'm not really a coder so I don't know anything about that sort of thing. Just a writer.

This is kinda an odd request, and I'm not sure how well I stated my request. If you have any questions or want clarification, ask and I'll answer. Thanks. 68.111.165.176 (talk) 07:54, 27 November 2011 (UTC)[reply]

Not sure if this helps, but a common trick along these lines that you sometimes see used in blog article titles is the C increment operator, which is two plusses in a row. Basically you take a word that reprisents something you want more of and put two plusses before or after.
So some potential titles might be
Viruses++
++Murder
Greed++
You get the idea.
(You notice they even used this trick to name the successor to C.)
Two minuses do the opposite, of course, but they don't look as cool.
Hope this helps. APL (talk) 09:07, 27 November 2011 (UTC)[reply]
other good code-like constructions might be "Murder[The_President]" (There are lots of murders, but this book is about the president's ) or "Murder.Victim" (There are many aspects of this murder, but this book is about the victim.)
Or, just make up a regular title, but use underscores instead of spaces. Or make a math equation in the title. APL (talk) 09:16, 27 November 2011 (UTC)[reply]
There's also the kill command in Unix-like systems... so maybe something like kill -s President? --Ouro (blah blah) 09:34, 27 November 2011 (UTC)[reply]
Some shell commands whose names might be useful: kill (see above), unset, rm, del, erase. One could approximate an OOP function calling with something like: Johnny.kill();. Really you could use any function name there (even murder();), as they can be defined arbitrarily by the programmer. If you put it after the "object" it's acting on, with the parens and the semicolon, most people with even a smattering of programming will recognize it as a function. --Mr.98 (talk) 15:16, 27 November 2011 (UTC)[reply]

My suggestion is rm -rf /, which in Unix systems is a command to delete the entire file system on your computer. Looie496 (talk) 17:53, 27 November 2011 (UTC)[reply]

T-Rex has a suggestion. Paul (Stansifer) 20:04, 27 November 2011 (UTC)[reply]
But the downside of rm -rf / is that it will only be understood by the few percent who use the systems it works in. A command like kill or erase is, in addition to its function, also a plainly understandable word. And that might be good marketing-wise. --Ouro (blah blah) 20:27, 27 November 2011 (UTC)[reply]
Ps. That's a terrific one, Paul! --Ouro (blah blah) 20:30, 27 November 2011 (UTC)[reply]
Yes, The Simpsons have a similarly low opinion of the prospective audience for such material - in "They Saved Lisa's Brain" Comic Book Guy wears his C:/DOS C:/DOS/RUN RUN/DOS/RUN T-shirt, of which Lisa says "only one person in a million would find that funny." -- Finlay McWalterTalk 21:09, 27 November 2011 (UTC)[reply]

HTML/Javascript list sorting

I have a webpage ( http://www.stocton.org/geocache.htm ) which lists geocaches I have hidden sorted in two ways, by date of hiding and by family. At present I maintain two separate lists and hide one / show the other to achieve the effect I want. There are also other sort orders that would be nice (eg date of most recent find, date of maintenance...). If I add these I would only want to maintain one list and have javascript sort and reformat the page appropriately. This is harder than just sorting a ul or ol list as I want to break the list up with intermediate headings (eg family type or year of hiding or ...). All the sort info could easily be hidden in parameters in the li fields etc, but could someone provide / point to a page on how to achieve this please. -- SGBailey (talk) 09:51, 27 November 2011 (UTC)[reply]

It's easiest if you start with the data in a javascript array, which you sort by whichever field you want:
//      date          location    description
d = [ [ "2011-11-02", "Arsia",    "Under a big rock" ],
      [ "2011-06-10", "Pavonis",  "Down a crack" ],
      [ "2011-09-22", "Ascraeus", "On a hilltop" ]
    ];

d.sort(function(a,b){return a[0]>b[0]});
print ("by date, ascending:");
for(rec in d) print(d[rec]);

d.sort(function(a,b){return a[1]>b[1]});
print("by location, ascending:");
for(rec in d) print(d[rec]);

d.sort(function(a,b){return a[2]>b[2]});
print("by description, ascending:");
for(rec in d) print(d[rec]);
In a webpage context, instead of print you'd generate html content and add it into the document with document.write or by manipulating an element's innerHTML -- Finlay McWalterTalk 11:56, 27 November 2011 (UTC)[reply]
Will mull on that. Thanks. -- SGBailey (talk) 01:12, 28 November 2011 (UTC)[reply]

Folder Disappeared - Win7

Resolved

This is odd - I have two folders on my desktop with currently active work in them. Both folders were there last night when I went to sleep. I left my computer on, as it was doing its usual virus checking, etc., and when I awoke this morning, one of the folders has disappeared. I know it has nothing to do with the virus check, as the computer performs this every day, and this folder has been there for weeks (plus, there was nothing in the folder last night). I've done a search for the folder in question, but can find nothing. OK, there is nothing in it, so I could just make a new one, but I am concerned that important folders like this are just disappearing, and would like to find out where it is, and why/how it got there, so I can prevent this sort of thing in the future. Does anyone have any ideas? KägeTorä - (影虎) (TALK) 12:14, 27 November 2011 (UTC)[reply]

EDIT - I have found the culprit. ASC v5 is deleting all my empty folders. KägeTorä - (影虎) (TALK) 12:19, 27 November 2011 (UTC)[reply]

Theory: Skyrim's Creation Engine is the Gamebryo Engine.

Mainstream gaming media apparently wont admit this. Journalism is dead so they just take Todd Howard's press releases and print it as fact and news. I believe anyone who is intelligent about game design and programming can obviously see that Skyrim's engine is possibly updated but is not in any way a fully rewritten engine from the ground up as claimed.

The same technical limitations and bugs exist from previous games using the Gamebryo engine. Also features that have become standard on modern engines since Gamebryo was first programed are strangely absent from Skyrim.

It's my understanding that Skyrim uses the same file format, the same directory structure as the previous games/engine. This alone doesnt prove anything but it's my hope that when the Creation Kit (Modification Tools) are released I can explore the game content better and locate ties to the past.

Is Skyrim using the Gamebryo engine and if so how can we prove it? --184.175.1.120 (talk) 16:52, 27 November 2011 (UTC)[reply]

Judging by this, it's not a secret that Skyrim's engine is based on Gamebryo. Whether a set of changes is enough to justify calling it a "full rewrite" is a marketing issue. In any event, when you're rewriting code, things like file formats and directory structures are important for backwards compatibility, so it's not a surprise that they didn't get changed, regardless of whatever else happened in the engine. Paul (Stansifer) 00:08, 28 November 2011 (UTC)[reply]

Seagate GoFlex cable for desktop eSATA

Dear Wikipedians:

Where can I find Seagate GoFlex cable adapter for desktop eSATA port?

There is one here:

http://www.amazon.com/Seagate-FreeAgent-GoFlex-Upgrade-Powered/dp/B003IT6PH2

however, it uses the eSATAp port found on notebook computers, not the eSATA port found on desktop computers.

Thanks,

174.88.35.172 (talk) 17:43, 27 November 2011 (UTC)[reply]

Hashing IP addresses

Hey all. I'm hoping to write a simple polling script and have turned my attention to its security. Ideally I would like to stop both accidentally and deliberate oting multiple times, but stopping the former is the priority. I am limited by the fact that I do not wish to leave any cookies, etc, on the voters' computers, nor store their IP addresses if I can avoid it. At the moment, I'm thinking that my best bet is a temporary storage of (hashed) IP addresses as a form of rate limiting. Are there any better ways to achieve my goals with those limitations in place? And does hashing actually achieve anything since IP-address-space is so small? Thanks, - Jarry1250 [Weasel? Discuss.] 18:15, 27 November 2011 (UTC)[reply]

One point of clarity: who are you trying to protect the data from? E.g. is it a situation where you're trying to keep yourself from being able to see it, or another server admin who might be using the script, or a hacker who has potentially gotten ahold of the data? Because the answer will change some of the response. If you're only worried about hackers, for example, adding a salt probably fixes the problem. If you're worried about sysadmins, then it's a much harder problem — especially since it would be pretty trivial for a sysadmin to just remove whatever obfuscation you're doing. If it were me I'd probably just salt and hash and not worry about it. That's going to stop the external misuse. You can't really stop the internal misuse. --Mr.98 (talk) 18:52, 27 November 2011 (UTC)[reply]
If Jarry is only keeping the hashed IPs (and nothing analogous to a username) then the salt would have to be the same for each IP (so it's much less useful that salting a password database, where one can have a different salt per user and recover the salt by looking up the username). So that would protect against a pre-made rainbow table, but not a freshly computed one. And Jarry's suspicion is correct - the IPV4 space is much too small. A little throw-away Python script on my aging Pentium D can SHA-1 hash the entire IPV4 space in a little over 2 hours (and a better hash function won't help, because the small input space remains the same). If Jarry can have a different salt per user, that's 2 hours per user (but surely much less with an optimished hash engine on a modern system). I don't see the point. -- Finlay McWalterTalk 19:48, 27 November 2011 (UTC)[reply]
Just a technical note: It would be two hours per user if you knew what the salt was. In my opinion, salting is over-rated. If you add a salt to an open-source program, you've wasted your time. Anyone can look at the code and see what the salt is and add that to the rainbow table. It creates a false sense of security. If you add a salt to a closed-source program, you hope that nobody has a dissembler and nobody can read assembly. Hell, I've seen dissemblers that convert all the way to C. So, even then, it is a false sense of security. You are only protecting yourself from script kiddies, not hackers. For this particular application, I suggest a hash that includes what you can get, such as IP address and browser info. It means that using a different browser lets you have a second vote. But, using IP address means that if one person in an office votes, all others behind the same router won't get to vote. On the Internet, it is not possible to ensure one person = one vote. -- kainaw 21:51, 27 November 2011 (UTC)[reply]
The IPv4 space is only 32 bits which is much too small. However if you incorporate other information, like browser user agents, OS, screen size, etc., all of which is available from the request (or in logs) you could have presumably a much larger input space. It's not perfect because the inputs are predictable, but it'd help. You could also use a very computationally intensive hash, or iterate it thousands of times. It would be relatively inexpensive for your server but harder for an attacker. This is what PBKDF2 does. Ramp it up a few thousand times over and you can buy whatever level of security you want.
I disagree with Kainaw about salting. There's not just one salt per program: there's a different salt value for every user. This is why pre-computed attacks won't work unless you know the unique salt, or you're trying every salt in the database. Shadowjams (talk) 22:58, 27 November 2011 (UTC)[reply]
I didn't claim there is one salt per program. I claimed there is one salt algorithm per program. For example, you write a program and use the first 2 letters of a person's last name as the salt. So, I grab your database and try to unhash the passwords. I'm not stupid enough to try every possible salt. I try the first to letters of the person's last name because I looked at your code and saw that is what you did. The salt doesn't help. I get back something like "SmMySuperDuperPassword01" for John Smith. I already knew it began with Sm. There is a very lengthy explanation of this false sense of security in the libPurple statement about not adding encryption to an open-source program. -- kainaw 23:15, 27 November 2011 (UTC)[reply]
Finlay pointed out above that the salt value in this program wouldn't be a traditional salt. You could make it traditional but then you'd have to check every previous salt value to see look for a duplicate. But in the traditional sense a salt does two things for you. It 1) prevents a precomputed hash table, 2) makes identical values have different hashes. These both enhance security. As Ben says, the salt is not supposed to be secret. Maybe you're describing something different? Shadowjams (talk) 01:05, 28 November 2011 (UTC)[reply]
A password salt is always stored in the clear whether the program is open-source or not. It's not secret, or supposed to be. Read the article. -- BenRG (talk) 23:45, 27 November 2011 (UTC)[reply]

SSL verification

a. is there a way to encrypt with ssl without getting a lincese and without a notice to the user that there is illegal ssl(I mean in webpages)? b.if a man in the middle will watch the whole communication of the computers, will it be able to get the keys and unencrypt it? Exx8 (talk) 21:18, 27 November 2011 (UTC)[reply]

For the first question, if you manually install the certificate on both computers, you won't get a warning. But, if you want to make an SSL page for the general public that doesn't throw a warning, you must get a real SSL certificate, not a self-signed one. For the second question, yes. A man in the middle can get information that can be decrypted - but it will take a very long time (decades, not hours). I know, the official claim is that it will take trillions of years, but that is based on computers circa 1995. So, I assume that quantum-super number-crunching computers will come around along with some new number factoring algorithm and cut it from 20 trillion years to 20 years. Still, it is too long to do anything useful. Finally, I want to note that your description of what the man in the middle will do is not what a man in the middle attack is all about. A man in the middle will pretend to be the server to the client and pretend to be the client to the server. He will block traffic between the two, not just copy it. -- kainaw 21:45, 27 November 2011 (UTC)[reply]
Quantum computers break SSL completely, not because they're fast but because efficient quantum algorithms for breaking SSL encryption are known. Non-quantum computers are never going to be fast enough to break SSL by currently known approaches. A semi-efficient algorithm that breaks SSL in 20 years might be found next year, I might win the lottery next year, and a flu epidemic might wipe out half of the human race next year, but these are not useful things to say in a ref desk reply. -- BenRG (talk) 23:40, 27 November 2011 (UTC)[reply]
A simplified form of SSL works like this: the server sends an RSA public key to the client. The client generates a random AES key, encrypts it with the RSA key, and sends it back. The server decrypts it, and then later communication is encrypted using AES with that key.
A passive eavesdropper, who doesn't alter any of the data, can't spy on this. This is what you seem to mean by "man in the middle". An active eavesdropper can spy on it by intercepting the public key en route and substituting a different one for which he has the corresponding private key. This is what's usually called "man in the middle". The SSL certificate signing system exists to prevent this attack. You can't use an "unlicensed" certificate without a warning because, for all the client knows, you might be the man in the middle. If there were a way to avoid the warning (without being blocked or caught) then attackers would use that method and the whole system would be pointless.
According to Comparison of SSL certificates for web servers, there's at least one CA trusted by all major browsers that will issue certificates for free, if that's any help. -- BenRG (talk) 23:40, 27 November 2011 (UTC)[reply]

matplotlib colorbar

I'm trying to plot a series of polygons in python using matplotlib where each polygon gets a color based on data value. For example a minimal code:

import numpy as np
import matplotlib as m
import matplotlib.pyplot as plt

data=np.random.rand(5)

cm = plt.get_cmap('jet_r')

for i in range(5):
    x=np.random.rand(4)
    y=np.random.rand(4)
    plt.fill(x,y,color=cm(data[i]))
plt.show()

But if a drop a

 plt.colorbar()

before the plt.show() i get

 
Traceback (most recent call last):
  File "/home/Rob/code/colorbar.py", line 21, in <module>
    plt.colorbar()
  File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1519, in colorbar
    ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
  File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1104, in colorbar
    cb = cbar.Colorbar(cax, mappable, **kw)
  File "/usr/lib64/python2.7/site-packages/matplotlib/colorbar.py", line 706, in __init__
    mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax
AttributeError: 'NoneType' object has no attribute 'autoscale_None'

Now i think i need pass something to colorbar() to tell it what the axes and scale is but i'm not sure what, as all the example i can find on the 'net seem to use imshow or pcolor rather than fill. What can i do to get a colorbar? Thanks for any help--2.102.129.237 (talk) 23:26, 27 November 2011 (UTC)[reply]

November 28

x86 tablet PC that uses EFI or a simple boot ROM

I am looking for a decent quality (can be Chinese) x86 tablet that uses EFI or a simple boot ROM in place of a traditional BIOS to experiment with. I want to install Android-x86 on it, which has now released a 3.x version of Android. --Melab±1 02:33, 28 November 2011 (UTC)[reply]