Jump to content


fiveworlds

Member Since 06 Dec 2012
Online Last Active Today, 08:33 PM
***--

#973600 MS Office 2016: table and caption

Posted by fiveworlds on Yesterday, 03:22 PM

Could you not just add a row above the table with the heading in it???


  • 1


#972730 Beall's list under threat

Posted by fiveworlds on 19 February 2017 - 01:46 PM

List Attached

Attached Files


  • 1


#967635 New Keyboard layout

Posted by fiveworlds on 20 January 2017 - 08:10 PM

So its your fault.  Just because of you, we all have to put up with it!​

 

 

I use the caps lock too for typing constants.


  • 1


#967175 Let's talk about Bitcoin

Posted by fiveworlds on 17 January 2017 - 11:59 PM

But if the virus is actually a trojan or key logger, and someone steals all the money from your bank then all those backups won't help​

 

 

Not necessarily your bank can keep track of your frequently used devices and public ip address and notify you of irregular money transfers. Also you won't lose all your money if your house happens to burn down. Also paypal isn't all that secure either accounts are sold on the dark web.


  • 1


#967172 Let's talk about Bitcoin

Posted by fiveworlds on 17 January 2017 - 11:36 PM

The virus has to get there first. It's only possible if its occurs

 

 

It did to me so I don't see it as an unreasonable problem. If I use a bank I know that my data is at least backed up in triplicate in multiple datacentres bitcoin has nowhere near that level of security.


  • 1


#965251 Future of self-driving automobiles...

Posted by fiveworlds on 6 January 2017 - 12:08 AM

Go ahead, continue...

 

 

Strap a bomb to the car and blow it up whenever.


  • 1


#961651 Let's talk about Bitcoin

Posted by fiveworlds on 14 December 2016 - 05:10 AM

The main problems with bitcoin are

 

1. Security

2. Black Market

 

From a security standpoint it is possible to get a virus on your computer and therefore lose the bitcoin wallet. Bitcoin provides a fairly untraceable online currency for criminals to exchange goods.


  • 1


#961541 Profound speculations on the Speed of objects

Posted by fiveworlds on 13 December 2016 - 04:35 PM

What happens to the energy for values that exceed c?

 

 

When Cherenkov Radiation was discovered Einstein revised GR and wrote SR which allows for the existence of Tachyons. Stating that if a particle exceeds c it will always travel faster than c unless an external force causes it to slow down.


  • -1


#958472 Ideal way to dry washed dishes in a commercial kitchen?

Posted by fiveworlds on 25 November 2016 - 12:27 AM

Dishes washed in boiling water will dry faster than those washed in lukewarm water. You shouldn't need to be drying dishes with a tea towel they should air dry very quickly if washed in boiling water. Usually restaurants have a conveyer belt washer and dryer system.


  • 1


#958438 How to get a job?

Posted by fiveworlds on 24 November 2016 - 08:42 PM

Few PhDs actually develop their own products. What you market are your skills.​

 

 

Obviously but there is also the possibility that jobs in your field won't be around when you leave college. Your skillset could be completely irrelevant to 95% of the job market in your locality with you being in competition with other highly qualified people for the role. Most people with PhDs are already married with kids and there may not be the option to move for work without leaving the rest of the family behind.


  • 0


#958434 How to get a job?

Posted by fiveworlds on 24 November 2016 - 08:03 PM

P.S. But you are right, PHD always gets a higher pay

 

 

What? there are plenty of people with PHD's who work in Mc Donalds flipping burgers. Take for instance a guy gets a degree in chemistry. Sure he can make some product but he hasn't been taught any skills on how to market his product. If you need to market something and everything is done online nowadays then you need to be able to program. If you can program but can't do art then your website will look horrible and nobody will buy your product.


  • 0


#957393 Determine the Big-O of Java code snips

Posted by fiveworlds on 18 November 2016 - 09:45 PM

a. 4n^2 + 2 is:         O(1)  
b. n^2 + 14n + 6 is:        O(1)
c. 5n^3 + 10n^2 – n – 8 is:        O(1)
d. 3n^2 + 2n is:      O(1)

 

​Explain why the above is O(1) using CISC computer architecture. Explain why we don't use CISC architecture in relation to difficulty of design implementation.

 

​In a simple assignment function multiplying is a constant. In a risk architecture however the number is gotten through addition so therefore squaring a number takes a long time. Thing is you can also make a computer where addition takes a lot of time.

 

<script>
var s1 = 0, s2 = 0, s3 = 0;
var t1 = 0, t2 = 0, t3 = 0;
var test = Array();
test["000"] = 0;
test["001"] = 1;
test["010"] = 2;
test["011"] = 3;
test["100"] = 4;
test["101"] = 5;
test["110"] = 6;
test["111"] = 7;
for (var i = 0; i < 64; i = i + 1){
   
    document.write(s1.toString(10)+s2.toString(10)+s3.toString(10)+t1.toString(10)+t2.toString(10)+t3.toString(10)+"="+test[s1.toString(10)+s2.toString(10)+s3.toString(10)]*test[t1.toString(10)+t2.toString(10)+t3.toString(10)]+"<br>");
    s3=s3+1;
    if(s3>1){s2=s2+1;s3=0;}
    if(s2>1){s1=s1+1;s2=0;}
    if(s1>1){t3=t3+1;s1=0;}   
    if(t3>1){t2=t2+1;t3=0;}
    if(t2>1){t1=t1+1;t2=0;}
   
}
    function multiply(a,b){
        output = "overflow";
            if (a + b == "000000"){output = 0;}
            if (a + b == "001000"){output = 0;}
            if (a + b == "010000"){output = 0;}
            if (a + b == "011000"){output = 0;}
            if (a + b == "100000"){output = 0;}
            if (a + b == "101000"){output = 0;}
            if (a + b == "110000"){output = 0;}
            if (a + b == "111000"){output = 0;}
            if (a + b == "000001"){output = 0;}
            if (a + b == "001001"){output = 1;}
            if (a + b == "010001"){output = 2;}
            if (a + b == "011001"){output = 3;}
            if (a + b == "100001"){output = 4;}
            if (a + b == "101001"){output = 5;}
            if (a + b == "110001"){output = 6;}
            if (a + b == "111001"){output = 7;}
            if (a + b == "000010"){output = 0;}
            if (a + b == "001010"){output = 2;}
            if (a + b == "010010"){output = 4;}
            if (a + b == "011010"){output = 6;}
            if (a + b == "100010"){output = 8;}
            if (a + b == "101010"){output = 10;}
            if (a + b == "110010"){output = 12;}
            if (a + b == "111010"){output = 14;}
            if (a + b == "000011"){output = 0;}
            if (a + b == "001011"){output = 3;}
            if (a + b == "010011"){output = 6;}
            if (a + b == "011011"){output = 9;}
            if (a + b == "100011"){output = 12;}
            if (a + b == "101011"){output = 15;}
            if (a + b == "110011"){output = 18;}
            if (a + b == "111011"){output = 21;}
            if (a + b == "000100"){output = 0;}
            if (a + b == "001100"){output = 4;}
            if (a + b == "010100"){output = 8;}
            if (a + b == "011100"){output = 12;}
            if (a + b == "100100"){output = 16;}
            if (a + b == "101100"){output = 20;}
            if (a + b == "110100"){output = 24;}
            if (a + b == "111100"){output = 28;}
            if (a + b == "000101"){output = 0;}
            if (a + b == "001101"){output = 5;}
            if (a + b == "010101"){output = 10;}
            if (a + b == "011101"){output = 15;}
            if (a + b == "100101"){output = 20;}
            if (a + b == "101101"){output = 25;}
            if (a + b == "110101"){output = 30;}
            if (a + b == "111101"){output = 35;}
            if (a + b == "000110"){output = 0;}
            if (a + b == "001110"){output = 6;}
            if (a + b == "010110"){output = 12;}
            if (a + b == "011110"){output = 18;}
            if (a + b == "100110"){output = 24;}
            if (a + b == "101110"){output = 30;}
            if (a + b == "110110"){output = 36;}
            if (a + b == "111110"){output = 42;}
            if (a + b == "000111"){output = 0;}
            if (a + b == "001111"){output = 7;}
            if (a + b == "010111"){output = 14;}
            if (a + b == "011111"){output = 21;}
            if (a + b == "100111"){output = 28;}
            if (a + b == "101111"){output = 35;}
            if (a + b == "110111"){output = 42;}
            if (a + b == "111111"){output = 49;}
        return output;
    }
    document.write(multiply("110","011"));
</script>

  • -1


#956274 Clock dial...

Posted by fiveworlds on 14 November 2016 - 11:31 PM

What's the roman numeral for zero??


  • 1


#955785 c# syntax highlighting

Posted by fiveworlds on 13 November 2016 - 12:46 PM

This is how you should make highlighting in RichTextBox (C++ example):​

 

 

Cool I might rewrite the whole thing for c++ dunno why lines isn't working for me. I could try richtextbox.rtf but that requires a whole rich text parser...

 

edit

 

Finally got it working

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Documents;
using System.Windows.Forms.Design;
using ColorCode;
namespace Vedit
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            LineNumberTextBox.Font = richTextBox1.Font;

            richTextBox1.Select();
            AddLineNumbers();
            string[] words =
            {
                "Example",
                "public",
                "Highlighting",
            };
            Color[] colors =
            {
                Color.Aqua, Color.CadetBlue,
                Color.Orchid
            };
            for (int i = 0; i < words.Length; i++)
            {
                 string word = words[i];
                 Color color = colors[i];
                {
                    richTextBox1.SelectionColor = color;
                    richTextBox1.AppendText(word);
                    richTextBox1.AppendText(" ");
                }
                
            }
            richTextBox1.SelectionColor = Color.Black;
       }

        public int getWidth()
        {
            int w = 25;
            // get total lines of richTextBox1    
            int line = richTextBox1.Lines.Length;
            if (line <= 99)
            {
                w = 20 + (int)richTextBox1.Font.Size;
            }
            else if (line <= 999)
            {
                w = 30 + (int)richTextBox1.Font.Size;
            }
            else
            {
                w = 50 + (int)richTextBox1.Font.Size;
            }
            return w;
        }
        public void AddLineNumbers()
        {
            // create & set Point pt to (0,0)    
            Point pt = new Point(0, 0);
            // get First Index & First Line from richTextBox1    
            int First_Index = richTextBox1.GetCharIndexFromPosition(pt);
            int First_Line = richTextBox1.GetLineFromCharIndex(First_Index);
            // set X & Y coordinates of Point pt to ClientRectangle Width & Height respectively    
            pt.X = ClientRectangle.Width;
            pt.Y = ClientRectangle.Height;
            // get the font Size of richTextBox1 and update LineNumberTextBox
            LineNumberTextBox.Font = new Font(LineNumberTextBox.Font.Name, richTextBox1.Font.SizeInPoints,
                LineNumberTextBox.Font.Style, richTextBox1.Font.Unit);
            // get Last Index & Last Line from richTextBox1    
            int Last_Index = richTextBox1.GetCharIndexFromPosition(pt);
            int Last_Line = richTextBox1.GetLineFromCharIndex(Last_Index);
            // set Center alignment to LineNumberTextBox    
            LineNumberTextBox.SelectionAlignment = HorizontalAlignment.Center;
            // set LineNumberTextBox text to null & width to getWidth() function value    
            LineNumberTextBox.Text = "";
            LineNumberTextBox.Width = getWidth();
            // now add each line number to LineNumberTextBox upto last line    
            for (int i = First_Line; i <= Last_Line+1; i++)
            {
                LineNumberTextBox.Text += i + 1 + "\n";
            }
        }
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Clear();
        }
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();
            if (op.ShowDialog() == DialogResult.OK)
                richTextBox1.LoadFile(op.FileName, RichTextBoxStreamType.PlainText);
            this.Text = op.FileName;
        }
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sv = new SaveFileDialog();
            sv.Filter = "Text Documents(*.txt)|*.txt|All Files(*.*)|*.*";
            if (sv.ShowDialog() == DialogResult.OK)
                richTextBox1.SaveFile(sv.FileName,RichTextBoxStreamType.PlainText);
            this.Text = sv.FileName;
        }
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void cutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Cut();
        }
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Copy();
        }
        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Paste();
        }
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Undo();
        }
        private void redoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Redo();
        }
        private void fontToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FontDialog fd = new FontDialog();
            fd.Font = richTextBox1.SelectionFont;
            if (fd.ShowDialog() == DialogResult.OK)
            {
                richTextBox1.Font = fd.Font;
                LineNumberTextBox.Font = fd.Font;
            }
        }
        private void backgroundToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorDialog cr = new ColorDialog();
            if(cr.ShowDialog() == DialogResult.OK)
            {
                richTextBox1.BackColor = cr.Color;
            }
        }
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Ver 1.0.0\nCreated by David Mather");
        }

        private void richTextBox1_SelectionChanged(object sender, EventArgs e)
        {
            AddLineNumbers();
        }
        private void richTextBox1_VScroll(object sender, EventArgs e)
        {
            LineNumberTextBox.Text = "";
            AddLineNumbers();
            LineNumberTextBox.Invalidate();
        }

        private void richTextBox1_FontChanged(object sender, EventArgs e)
        {
            LineNumberTextBox.Font = richTextBox1.Font;
            richTextBox1.Select();
            AddLineNumbers();
        }
        private void LineNumberTextBox_MouseDown(object sender, MouseEventArgs e)
        {
            richTextBox1.Select();
            LineNumberTextBox.DeselectAll();
        }
        public void HighlightText(RichTextBox myRtb, string word, Color color)
        {
            if (word == string.Empty)
                return;
            int s_start = myRtb.SelectionStart, startIndex = 0, index;
            while ((index = myRtb.Text.IndexOf(word, startIndex)) != -1)
            {
                myRtb.Select(index, word.Length);
                myRtb.SelectionColor = color;
                startIndex = index + word.Length;
            }
            myRtb.SelectionStart = s_start;
            myRtb.SelectionLength = 0;
            myRtb.SelectionColor = Color.Black;
        }
        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            AddLineNumbers();
            HighlightText(richTextBox1, "Example", Color.Red);           
        }
        private void richTextBox1_Resize(object sender, EventArgs e)
        {
            AddLineNumbers();
        }
    }
}

  • 1


#954466 How to make correct output?

Posted by fiveworlds on 8 November 2016 - 05:26 PM

Isn't simpler to write

if( ( key >= '0' ) && ( key <= '9' ) )

 

 

Yeah i'm not that great at c++ and didn't want to risk it.


  • 0