pars99

If you had posted the page, we could have had a look at the DOM, to see if it was a regular pattern.

See, I would, but I believe the actual information isn't information I'm allowed to publish. Essentially, I'm trying to make my own for security reasons. Looking into the PHP functions you suggested. Thanks, mate.

pars99

I'm not sure how crazy this sounds, but bear with me. I have a long list of links that are people's names. Inside each link is a set of information, where an email address is located after other information. I need to make (or just find in general) something that will open each link and find the email and copy it. This sounds kinda ludacris to me, but I'm not as well informed on web scraping as you guys. The ultimate goal is to get the emails into the corresponding cell in excel (Mac, 2016). I have no idea how to go about this and have found zero solutions thus far. Any ideas? Thanks in advance.

Edit: I should also mention that the list of links we're using were put in by hand. There's no "master list" besides the one I made myself, but that one doesn't have links. I could make one, but the script/program would still need to go through and find the email.

pars99

I'm making a program that takes the last letter and second to last letter of a name and displays a formatted version in front of the name. I'm passing an array to hold all the names and it seems to work properly, but it displays null before each output. Why is this happening?

Don't mind the slop
Class:

public class EmployeeNames {
    public static String[] convertName(String[] lastNames){
        String lastLetter;
        String secondToLast;
        String[] putTogether = new String[10];

        for(int i = 0; i < putTogether.length; i++){
            lastLetter = (lastNames[i].substring(lastNames[i].length() - 1)).toUpperCase();
            secondToLast = (lastNames[i].substring(lastNames[i].length() - 2, lastNames[i].length() - 1)).toUpperCase();

            putTogether[i] += lastLetter + ". " + secondToLast + ". " + lastNames[i];
        }

        return putTogether;
    }
}

And don't mind the names
Driver:

public class EmployeeNamesTester {
    public static void main(String args[]){
        EmployeeNames prog = new EmployeeNames();
        String[] lastNames = {"Smith", "Jackson", "Sahara", "Adventist", "Maxwell", 
                              "Jainism", "Port", "Pritzker", "Scholomo", "Cobin"};

        for(int i = 0; i < 10; i++){
            String[] format = prog.convertName(lastNames);
            System.out.println(format[i]);
        }
    }
}

Current output:

nullH. T. Smith
nullN. O. Jackson
nullA. R. Sahara
nullT. S. Adventist
nullL. L. Maxwell
nullM. S. Jainism
nullT. R. Port
nullR. E. Pritzker
nullO. M. Scholomo
nullN. I. Cobin

pars99

I need to fill an image created using a ton of QuadCurves, but they don't fill it all the way using the traditional fill method. Any suggestions?

public class MonstercatComponent extends JComponent{
    public void paintComponent(Graphics g){
        Graphics2D g2 = (Graphics2D) g;
        drawGrid(g2);
        g2.setStroke(new BasicStroke(5));
        QuadCurve2D earLeft1 = new QuadCurve2D.Double(145, 155, 137.5, 49, 150, 49);
        g2.draw(earLeft1);
        QuadCurve2D earLeft2 = new QuadCurve2D.Double(150, 49, 156.25, 49, 200, 100);
        g2.draw(earLeft2);
        QuadCurve2D betweenEars = new QuadCurve2D.Double(200, 100, 237.5, 88, 262.5, 87.5);
        g2.draw(betweenEars);
        QuadCurve2D earRight1 = new QuadCurve2D.Double(262.5, 87.5, 287.5, 25, 300, 25);
        g2.draw(earRight1);
        QuadCurve2D earRight2 = new QuadCurve2D.Double(300, 25, 312.5, 25, 337.5, 137.5);
        g2.draw(earRight2);
        CubicCurve2D headPhoneLeft = new CubicCurve2D.Double(145, 155, 75, 175, 100, 250, 150, 250);
        g2.draw(headPhoneLeft);
        CubicCurve2D headPhoneRight = new CubicCurve2D.Double(337.5, 137.5, 387.5, 137.5, 393.75, 188, 362.5, 225);
        g2.draw(headPhoneRight);
        QuadCurve2D headbandTop1 = new QuadCurve2D.Double(109, 177, 150, 75, 225, 50);
        g2.draw(headbandTop1);
        QuadCurve2D headbandTop2 = new QuadCurve2D.Double(225, 50, 300, 50, 372, 150);
        g2.draw(headbandTop2);
        QuadCurve2D headbandBottom1 = new QuadCurve2D.Double(135, 155, 150, 112.5, 212.5, 78);
        g2.draw(headbandBottom1);
        QuadCurve2D headbandBottom2 = new QuadCurve2D.Double(212.5, 78, 306.25, 78, 351, 137.5);
        g2.draw(headbandBottom2);
        QuadCurve2D faceBottomLeft = new QuadCurve2D.Double(150, 250, 162.5, 275, 200, 300);
        g2.draw(faceBottomLeft);
        QuadCurve2D faceBottomRight = new QuadCurve2D.Double(362.5, 225, 363.5, 237.5, 350, 262.5);
        g2.draw(faceBottomRight);
        CubicCurve2D leftArm = new CubicCurve2D.Double(200, 300, 87.5, 300, 87.5, 375, 188.5, 362.5);
        g2.draw(leftArm);
        CubicCurve2D rightArm = new CubicCurve2D.Double(350, 262.5, 425, 237.5, 450, 300, 375, 325);
        g2.draw(rightArm);
        QuadCurve2D leftLegOuter = new QuadCurve2D.Double(188.5, 362.5, 154, 425, 200, 512.5);
        g2.draw(leftLegOuter);
        QuadCurve2D rightLegOuter = new QuadCurve2D.Double(375, 325, 388.5, 356.25, 387.5, 412.5);
        g2.draw(rightLegOuter);
        QuadCurve2D leftFootTop = new QuadCurve2D.Double(200, 512.5, 125, 500, 130, 562.5);
        g2.draw(leftFootTop); ...

pars99

I have to draw an image using Graphics and Graphics2D. The image is Monstercat

How would you guys suggest I do the parts that have several curves to them? Do I use multiple QuadCurve2D or is there a way to do it in one method?

monstercat_logo_vector_by_lmw_ybc-d63hlvv.png

On a side note, do you guys have any recommendations on a program I could use to find the points where the curves are and such? I'm on a mac at the moment, but at school I'm on windows. Oddly, paint has a grid that has (so far, not well though) been working out.

pars99

Everytime I link a webview into my OS X project, it always brings up Use of undeclared type 'WebView'. How am I supposed to fix this? I've tried linking the WebKit framework and things like that, but they never worked.

pars99

No, we stopped adding new forums in favor of tagging. Just create a new thread and tag it with "swift".

Oh, okay, thanks. I'll get right on that, haha.

pars99

I expected there to be one, especially on a site as popular as this one.

pars99

unless you getting it for FREE, you might consider buying a new one

Actually, I am getting it for free.

we would need much more info on make and model numbers of hardware in the 2year old computer

That's not currently possible because I'm out of the country. Let me mention that this computer was being used ~2-3 weeks ago, so it's a functioning computer.

Where you looking for the best parts for your current motherboard or just looking for the best parts in general? You'll have to make sure they are at least compatible with your motherboard and any other components.

Actually, I just wanted to know if I had to replace the motherboard like the man in the computer shop said. I'll be back home in about two weeks, so I can post information on the computer by then, even though you likely won't be checking this post anymore.

pars99

I keep running this code and it works until I press the button, findShapeCalc(), and then I get EXC_BAD_INSTRUCTION in the main.swift at the line NSApplicationMain(C_ARGC, C_ARGV). Why does this keep happening?

Code in question:

import Cocoa

class ViewController: NSViewController {
    @IBOutlet var dropDown : NSPopUpButton
    @IBOutlet var length : NSTextField
    @IBOutlet var label : NSTextField
    @IBOutlet var width : NSTextField

    @IBAction func findShapeCalc(sender : AnyObject) {
        dropDown.title.toInt()
        if dropDown.itemAtIndex(0){
            circle();
        }else if dropDown.itemAtIndex(1){
            rect();
        }
    }

    func circle(){
        var radius = (length.stringValue as NSString).floatValue
        var circumfrence = 2.0 * 3.14 * radius

        label.stringValue = "Circumfrence is \(circumfrence)"
    }

    func rect(){
        var rectLength = (length.stringValue as NSString).floatValue
        var rectWidth = (width.stringValue as NSString).floatValue

        var perimeter = (2.0 * rectLength) + (2.0 * rectWidth)

        label.stringValue = "Perimeter is \(perimeter)"
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

    }

    override var representedObject: AnyObject? {
        didSet {
        // Update the view, if already loaded.
        }

    }

}

Sorry about posting Swift code here. Since there doesn't seem to be a section for Swift yet, this section seems the most suitable.

I've probably made many errors while writing the code, I'm just starting out. If you have sugestions on how to make the code better or more efficient, please tell me!

pars99

I'm getting a two year old computer (from a trusted seller) and was looking to upgrade the hardware. I went to a mediocre computer store and asked to see some of the parts I was looking for and the guy asked me some questions. When I told him the computer was 2 years old, he told me I'd also have to replace the motherboard. Is this true?

And for future refernece: how long should I keep and use a computer for before replacing the motherboard and other hardware?

INFO:
I'm planning on using this computer for primarily gaming and using the internet. I want to replace the processor, GPU, and add more RAM.

pars99

If it's anything like gcc then -o myfile in the makefile link statement should do it.

I honestly never thought it would be the same as gcc. Wow, thanks!

pars99

So, I was doing some doing some research for a program I'm working on and I stumbled upon the information that clang++ is a better alternative to g++ on Mac. I've been trying to use it because I can define that I want to use C++11, yet, the file output is a.out. Is there any way I can fix this or am I stuck with renaming it?

pars99

http://www.daniweb.com/web-development/web-design-html-and-
css/threads/464040/how-to-make-footer-stick-bottom-of-the-page

That didn't really work.

Here's a link to the site, by the way: drhamedani.tk

pars99

I made a footer for a site I'm working on but I can't make it stick to the bottom of the page on any screen. any ideas how to do that?

Thanks.

pars99

There are no jQuery dialogs [except DIV's emulating dialogs] and no you can't modify the builtin browser prompt default title.

Sorry, that's what I meant. Alright. I figured as much. Thanks.

pars99

Whenever I create a prompt, I see this at the top: "The page at [the URL] says:".

Am I able to change this or do I, as I was told to use for something else, have to use jQuery dialogs?

pars99

nope.. you are correct.

Instead you would have to go with something like jQuery UI Dialog, or just build a custom modal popup and handle the button clicks via code.

Thanks! I looked into it and it looks really nice!

pars99

This may seem pretty basic, but a classmate of mine is learning Javascript and they keep asking me the same thing: Can I change the two buttons on Alert and Confirm methods so that they don't say "cancel" and "okay"? I guess the same would go with Prompt. Is there a way? I keep telling him no and I checked other sources but I want to be sure. Thank you in advance.

pars99

Thank you to both of you! Really clears it up!

pars99

So, I see pointers defined in many different ways but I never quite understood what the difference was. Could someone explain it to me?

Examples:

int * a; int* a; int *a

That second one may or may not be actual C++ but I've seen it done in all those ways.

pars99

That did shed light on things, yes, but what I'm trying to do is delete the content of the folders:
/private/var/mobile/Library/Spotlight/com.apple.MobileSMS/
/private/var/mobile/Library/Spotlight/com.apple.SpotlightTopHits/

It's a long story of why, but that's why I want to find them. iPhoneBrowser was an application that did this but the iPhone had to be jailbroken and mine isn't.

Thanks in advnace.

pars99

Okay, maybe I should've worded that differently, but thank you @sebastianedu, because what I meant was: how can I access those folders–which are on my iPhone–using a program on my iphone?

Thank you again.

pars99

I was wondering how to access the /private/var/mobile/library folder(s) on my iMac. This is (obviously) for my iPhone.

I'm currently using an iPhone 5 on iOS 7. I've been trying to use iExplorer but if I can't I'll try it on my laptop, too.

Thank you in advance.

P.S: I was also wondering what would happen if I deleted the Messages backup from the iCloud section on iExplorer?

pars99

Thank you rubberman. I'm hoping there is an application on the Android Market (now Google Play Store) that does what I'm hoping to do. I figured there would be a way to do this through ADB or something because this involved the OS itself. However, if there is an application, I can probably internet it, I can probably find a way to get it onto my Kindle through ADB. Again, thank you.

pars99

I've been reading a lot of books on neuroscience and things of that nature and I was wondering if I could integrate a medical dictionary into my Kindle just like the regular dictionary it already has. I know this sounds like an odd question but I have been looking for an answer to this question for a long time and XDA was zero help so I figured the best place would be daniweb.com. Thank you in advance.

pars99

How can I get the value of an input field in Javascript? For example, someone types somehing into an input field and I want them to press a button to in turn, store the data in a JS variable. I believe there is such a thing as .value, but it doesn't work. Nothing, so far, has. Please help.

pars99

Have you tried something like this:

// code snippet was here

To be honest I have never really worked with Cocoa but I have a hard time believing that something like what I've done above is not possible.

I know. It's quite odd, but I have tried just plainly entering in the symbols, but I get syntax errors everytime.It's something rather simple that I just haven't stumbled across yet.

pars99

I need to compare two numbers in a cocoa application, but it doesn't allow me to use the regular signs (>=, <=, <, >) nor will it let me use isGreaterThanOrEqualTo:[] (Which, I undestand only takes an object, but I thought I would try it). So can someone please tell me how you accomplish this? Thank you in advance.

pars99

Simply put, the dot (.) operator is used to access members of either a full instance or reference to and instance of an object. The pointer-to (->) operator is used to access members of a pointer to an instance. Ancient Dragon gave you some good examples.

So, the pointer itself utilizes the pointer-to operator, but when you're using a reference or not using pointers at all you use the operator?