• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

CrankyJay

Banned
I'm looking for assistance on this matter. Any help would be excellent.

I'm using C# (Visual Studio) and I'm trying to send emails through Outlook through late binding.

This is my code.

Code:
      ...

This is an overloaded method. I'm just posting the overload that uses attachments because that's where my problem is. The code works fine for the non-attachment overload, but if I try to use an attachment, it errors out on the line
Code:
objMailAttachments.GetType().InvokeMember("Add", BindingFlags.InvokeMethod, null, objMailAttachments, new object[] { Attachment, Type.Missing, Type.Missing, Type.Missing });

"Exception has been thrown by the target of an invocation."

I check the inner exception, and I get "You don't have appropriate permission to perform this operation."

Which leads me to believe that security changes have been made to our email server, since it's been working fine until now. Unfortunately I can't do anything about that.

So my question is, is there something I can change in my existing code which will allow attachments to be sent? If not, is there an alternate method I can use to send emails with attachments, using late binding, without any dialogs, or the user having to provide credentials, and with the ability to display the email before sending it?

Does your solution absolutely have to use Outlook? A simple work around would be to just use the SmtpClient.
 

BHZ Mayor

Member
Does your solution absolutely have to use Outlook? A simple work around would be to just use the SmtpClient.

I'm not too well versed in email code, but as far as I can tell, yes. Outlook is all we use, and I absolutely need to have the option to display the email before sending, which I couldn't find in any of my googling of using the SmtpClient.
 

CrankyJay

Banned
I'm not too well versed in email code, but as far as I can tell, yes. Outlook is all we use, and I absolutely need to have the option to display the email before sending, which I couldn't find in any of my googling of using the SmtpClient.

I guess I'm confused, how are you going to show the email before sending without using a dialog?
 

upandaway

Member
So my university just sent me a message that there will be a mathematics review course to prep for the first year (of CS), over August-September. It'll go over the high school material and prep a bit for what's to come, but people who got over 90 in Math in high school don't have to attend, so I don't have to, and it's also not really cheap.

Anyone have any experience with this if I should go for it or not? I finished high school 4 years ago, but I guess I could review independently..
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
I don't have experience with a class like that, but I am in a similar situation as you. 5 years since high school and back in college.

Algebra was really rusty, but that can be improved independently.

Look into Khan Academy and Purple Math for help if you begin to feel lost.
 

usea

Member
Yeah I dropped out of high school and didn't go to university until 5 years later. My math was really rusty and I was worried, but it turned out not to be a problem at all. The pre-calc math class I was required to take reviewed algebra the first half, and did trig the second half.

I'd review independently if you feel like you need it.
 

upandaway

Member
Oh right I forgot about those online courses like Khan Academy. That sounds like a great idea. I'm a bit worried that it'll be tricky since it's all in English (I'm not in an English country) but yeah that sounds good.

It's also supposed to be in 2 halves where the second half is more direct prep for the degree, and I can sign up only for the second year if I want, but for now I guess I can skip the first half and do it myself. Thanks~
 

Celcius

°Temp. member
I'm a java developer but I would like to get better at using the Spring framework and using Jibx. Are there any books that cover these topics well?
 

jdavid459

Member
Could somebody recommend me a website that walks you through, step by step, or provides you the code w/ comments of many different projects? Trying to learn C through Harvard's CS50 EDX course but I'm getting stuck a lot. I'd like to work in some other resources to keep pushing forward . thanks!
 
This is maybe a weird/impossible question but I don't know where else to ask it so here goes.

Let's say I want to make an iOS app that serves as a mobile version of a MediaWiki site. Basically, the Wikipedia app, just not for Wikipedia. And let's also assume that I know Objective-C but my web development experience doesn't extend much beyond some basic JavaScript knowledge. What sort of stuff would I need to learn to be able to make something like this? Where would I begin? Would it even be feasible to make on my own? I know I'm probably reaching well beyond my current skill level with something like this but I really want to do it, and I think it would be a great learning opportunity, not to mention a good portfolio piece for me.
 

Quasar

Member
Working on my first asp.net/c# thing as part of learning some database design.

Looking at some exception handling. I have pages with forms on them where they are populated with data from a database call, and then once the form is filled in its submitted to the database. Would a sqlexception catch both failed connections to the database as well as problems with a failed sqlcommand? Or are these two different kinds of exceptions?

Also with sqlsource objects in asp code, like this:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" SelectCommand="SELECT * FROM table"></asp:SqlDataSource>

How do you catch sqlexceptions? Is it just not possible? Do I need to create the connection is the c# code instead?
 
Man, I gotta vent for a second. Tomorrow, 3 PM is the due date for a programming assignment and since yesterday afternoon, the submission system has been offline. And I can't test my solution because only 5 of the 15 test cases are public. The rest we don't know anything about. Also, you only get 30 attempts at submitting the solution, after that the best solution is taken and you can't change it anymore. All that wouldn't be such a problem if they didn't require every single test case to pass for us to even get a passing grade. It's so frustrating right now because I've been sitting on my solution since yesterday and I've tested it as much as I can offline but I can't do anything right now.

edit: Okay, they noticed and put all of the test cases online so we can test the program by ourselves. And it works. Thank God.
 
Well, that's the thing. We don't actually know what those numbers are. Good people who use pair programming a lot find it very productive. You're not going to get hard numbers on that sort of thing without serious work - and trying pair programming a couple of times and dismissing it doesn't count as serious. It doesn't help that productivity isn't exactly an easy thing to measure at the best of times...

Edit: My view on pair programming used to be very much the same as yours. I've come around to the idea somewhat having seen serious professionals using it on serious projects to good effect.
It seems to me that this is a fairly simple question, and the onus of proof is on the side making what at face value is an extraordinary claim: "pair programming provides measurable productivity benefits, despite the loss of time that comes from having two people work on the same task at the same time". Or, put into more definitive terms, "pair programming allows us to achieve over 200% efficiency per man hour".

Every tool has its place. I say I'm not a fan of pair programming, but what I really mean is that I'm not a fan of it as a religion. I've been in environments that used pair programming effectively -- sometimes the scope of a problem is so big that literally any person (expert or not) will be overwhelmed. That's a good time for another set of eyes.

But for every one of those, there are ten tasks that carry the mundanity of "implement incremental feature X". What we want for that is code review, not pair programming.

It can do, depending on the management style applied. If the people who could have finished the project three months late are forced to spend all their time bringing up to speed people who then make mistakes that need fixing and aren't as productive as the people with deep knowledge of the project, then it very easily can.

Edit: Essentially, if the cost of bringing on the new people (in terms of the extra work they create and training they need) is higher than the time they'll save - which it very often is for failing projects - then more manpower makes the project later.
You're not going to get an argument from me about this. Can speed you up or slow you down depending on the scenario. It depends more on the team makeup than "management style", IMO, but we may just be using different semantics.
 

Linkhero1

Member
I've decided that my current job isn't sufficient for me and I really need to move on towards something along my degree. I really want to get into a programming related position. I'm rewriting my resume from scratch so it contains more of my programming skill set I've obtained while in university. Can anyone provide me any tips on crafting my resume? Actually, any advice would be great. I'm looking for entry-level positions.
 

BreakyBoy

o_O @_@ O_o
I don't really have any resume tips unfortunately, but I would recommend working on some projects and posting the code in some public-facing repository.

Whether that's working on your own things, or contributing to an existing open-source project.

Everyone I've ever spoken to that has had any experience hiring programmers has told me that few things beat being able to see examples of a prospective hire's work.
 

Mabef

Banned
Starting tomorrow, I'm teaching ~25 middle schoolers ALICE for programming simple games. Wish me lucckkkk.

Really fortunate to have landed this job, though.
Hmm. I don't really know what to work on. I only have code for projects I've worked on in school.
Personally, I'm working on an iOS app. Easy for others to understand, and easy to carry around for that whole elevator pitch thing that supposedly happens.
 

Linkhero1

Member
I haven't worked on mobile development before. Any sources that can help me begin a project? I'd probably be more inclined to work on something Java based so Android would be a perfect platform for me.
 

leroidys

Member
Continuing my python adventure, my initial awe has been replaced by some serious discomfort, at best. I see pydocs praised everywhere, but to me, they are terrible. There's about a 50% chance (maybe less) that they even tell you what the method returns and an even lower chance it will tell you what kind of errors it can raise or what they mean. They also rarely tell you if there's another function that can do similar things that might be a better option. Really irritating. I'm probably just spoiled by man pages. Dynamic typing also makes more problems for me than it solves, and not having to declare variables means that my typos are new objects. Ugh.

Are there any good general-usage python reference books out there? Or a better online resource? Also looking for some python best practice hints. Thanks!
 

Water

Member
Starting tomorrow, I'm teaching ~25 middle schoolers ALICE for programming simple games. Wish me lucckkkk.
Good luck bro!

We're sort of in the same boat. I'm working over this summer to put together an introductory programming and game prototyping course for ~15 university students using Unity. I have real trouble getting started, it's such a big and nebulous task. I'm relatively comfortable with creating and running exercises but I've never planned and lectured an entire course before.
 

r1chard

Member
Are there any good general-usage python reference books out there? Or a better online resource? Also looking for some python best practice hints. Thanks!
I can't help with the books/other resources. The Planet Python aggregator might have something for you. For help, and I guess this is my 90s Internet background coming out here, but try the python mailing lists (either python-tutors or just python-list if you feel you're beyond basics). Maybe try watching some of the recorded conference videos at pyvideo.org to pick up some advice?


Starting tomorrow, I'm teaching ~25 middle schoolers ALICE for programming simple games. Wish me lucckkkk.
Awesome, I hope it goes well!
 

FinalD

Member
Since I learned about it in this thread, I'm sure some of you would like to know the Project Euler website has been hacked:

Project Euler is offline.

Due to the discovery of a serious security issue a decision was made on Sunday 15 June 2014 to take down the website. The full extent of the issue is still being investigated but in an attempt to be as honest as possible to our members we must make you aware that we have reason to suspect that all or parts of the database may have compromised. Passwords at Project Euler are strongly encrypted using a one-way hash, but if you use the same password at other websites then it is strongly advised that you change it. We are extremely sorry for this inconvenience. At this time we can provide no more information and there is no indication when Project Euler will return.

Check your passwords and all that.
 

CrankyJay

Banned
Working on my first asp.net/c# thing as part of learning some database design.

Looking at some exception handling. I have pages with forms on them where they are populated with data from a database call, and then once the form is filled in its submitted to the database. Would a sqlexception catch both failed connections to the database as well as problems with a failed sqlcommand? Or are these two different kinds of exceptions?

Also with sqlsource objects in asp code, like this:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" SelectCommand="SELECT * FROM table"></asp:SqlDataSource>

How do you catch sqlexceptions? Is it just not possible? Do I need to create the connection is the c# code instead?

I wouldn't recommend doing this. If you're using ASP.NET your database connections should be in the code behind, that's where you can put your try/catch.

If you're using MVC, your database stuff would go in a controller.
 

Tonza

Member
I need help urgently with an Android app. I uploaded an application to the Play store and for some reason, it does not let me install it on my Nexus 5. The app ran perfectly on it by installing it via ADT but I can't install it from the store. The Nexus 5 is running 4.4.3. It also shows Nexus 5 as compatible in the apk details. (developer console)

The sdk targets in manifest are:

android:minSdkVersion="14"
android:targetSdkVersion="19"


EDIT: Ahh, now it works. Probably a bug or something.
 

oxrock

Gravity is a myth, the Earth SUCKS!
Continuing my python adventure, my initial awe has been replaced by some serious discomfort, at best. I see pydocs praised everywhere, but to me, they are terrible. There's about a 50% chance (maybe less) that they even tell you what the method returns and an even lower chance it will tell you what kind of errors it can raise or what they mean. They also rarely tell you if there's another function that can do similar things that might be a better option. Really irritating. I'm probably just spoiled by man pages. Dynamic typing also makes more problems for me than it solves, and not having to declare variables means that my typos are new objects. Ugh.

Are there any good general-usage python reference books out there? Or a better online resource? Also looking for some python best practice hints. Thanks!

Not sure how helpful this is, but often times my googled python queries bring me to stackoverflow.com. There's a lot of information there and you get to see relevant code.
 
I see pydocs praised everywhere, but to me, they are terrible.

Yeah, I've never understood the praise for python documentation. It's okay, but it's not fantastic. When I first saw it I thought maybe I just needed to get used to it, but even after some time they don't really work for me.
 

Calieum

Neo Member
Hi! Relatively new to GAF here, so I apologize if this is not the correct place to ask.

I'm building a Beer Review site. I'm using WordPress. I've searched for a plugin that will let me rate posts (there are a ton!), however, none of them work the way I'd like.

So I'm looking for someone that can create the plugin! (You would be paid for it!) or,

If you guys happen to know of a good place to hire someone to write WordPress Plugins?

I have my BA in Game Art and Design... and while I dabble in programming, I know my limits, and this is too much for me! haha

I appreciate any advice/help GAF could offer here, thanks!
 

Aurarian

Member
Hey guys, just started taking my first programming class(Java) and i'm having a little trouble with my assignment that's due tomorrow night.

I have a couple of static variables in my class that need to be pulled to the output file.
I don't know how to proceed on getting two of the variables to work. My teacher has specified that it has to be gotten from the class.

This is the class file.
http://pastebin.com/index/vJwKuBfw

So far I've gotten four out of the six to work with the constructors. Just not sure how to make the other two work, the other two being totalTip and totalAmount(this is the gross that takes the gross from the others and puts it together).
 

Kansoku

Member
So, I'm doing my chrome extension, but I'm getting an error that makes no sense, can someone help me? I'm getting Uncaught TypeError: Cannot read property 'getTree' of undefined on this (on the first line):

Code:
chrome.bookmarks.getTree(function(tree){
		var html = generateHTML(tree[0].children);
		tree.innerHTML = html;
}

Any clues?
 

CrankyJay

Banned
So, I'm doing my chrome extension, but I'm getting an error that makes no sense, can someone help me? I'm getting Uncaught TypeError: Cannot read property 'getTree' of undefined on this (on the first line):

Code:
chrome.bookmarks.getTree(function(tree){
		var html = generateHTML(tree[0].children);
		tree.innerHTML = html;
}

Any clues?

Yeah, bookmarks is undefined for some reason.
 

doodle

Member
So, I'm doing my chrome extension, but I'm getting an error that makes no sense, can someone help me? I'm getting Uncaught TypeError: Cannot read property 'getTree' of undefined on this (on the first line):

Code:
chrome.bookmarks.getTree(function(tree){
		var html = generateHTML(tree[0].children);
		tree.innerHTML = html;
}

Any clues?

I'm not sure if it is what is causing your error, or if it is a quirk of writing a Chrome extension, or if I am just missing it, but it looks as if you are missing your closing ')' for getTree.
 
So, I'm doing my chrome extension, but I'm getting an error that makes no sense, can someone help me? I'm getting Uncaught TypeError: Cannot read property 'getTree' of undefined on this (on the first line):

Code:
chrome.bookmarks.getTree(function(tree){
		var html = generateHTML(tree[0].children);
		tree.innerHTML = html;
}

Any clues?

1) Have you included the following in your extension manifest?

Code:
"permissions": [
  "bookmarks"
],

2) last line should be:

Code:
});

Source: chrome.bookmarks developer reference
 

Kansoku

Member
1) Have you included the following in your extension manifest?

Code:
"permissions": [
  "bookmarks"
],

2) last line should be:

Code:
});

Source: chrome.bookmarks developer reference

Yeah both. (The ");" didn't get selected when I copied :p). And I moved it to different places in my code and even tried to use it on background.js (modified to just print hello word on the console for the callback function) and even there it didn't work.
 
Just started programming last week. Signed up for "programming for everybody" at Coursera, I am four weeks in and having a lot of fun solving problems! Also picked up C++ for beginners at the library and C++ is also fun :D

But I really need to start reviewing my math, I used to love math, but I have practiced it since early last year :/

Nothing to do with programming, but also studying for A+ exam, very basic stuff...I hope i can get an entry level job after finishing the two exams. Maybe I can write the network+ exam as well. After I have a job I can study computer science at university during nights or something
 

oxrock

Gravity is a myth, the Earth SUCKS!
Just started programming last week. Signed up for "programming for everybody" at Coursera, I am four weeks in and having a lot of fun solving problems! Also picked up C++ for beginners at the library and C++ is also fun :D

But I really need to start reviewing my math, I used to love math, but I have practiced it since early last year :/

Nothing to do with programming, but also studying for A+ exam, very basic stuff...I hope i can get an entry level job after finishing the two exams. Maybe I can write the network+ exam as well. After I have a job I can study computer science at university during nights or something

The highlighted parts seem pretty conflicting, perhaps I'm missing something. Anyhow, you don't need an intimate knowledge of math to get a program to run. It certainly comes in handy with getting things to run optimally though.
 
The highlighted parts seem pretty conflicting, perhaps I'm missing something. Anyhow, you don't need an intimate knowledge of math to get a program to run. It certainly comes in handy with getting things to run optimally though.

You can go through the materials on Coursera on your own phase (I think? The on going courses are by weekly basis maybe).
 

oxrock

Gravity is a myth, the Earth SUCKS!
You can go through the materials on Coursera on your own phase (I think? The on going courses are by weekly basis maybe).

So the courses are setup in weekly segments but you can fly through it as fast as you like? That makes sense to me, just the way it was worded without explanation was strange. It's a total non issue, I just get hung up on strange things.

In other news:

After a long hiatus from my video game, I am finally making progress again. I have some nice changes on the way (including less horrific art!) and once they're a tad bit further along I'll be posting another video to share. I know you're all riveted!
 

Splatt

Member
Anyone know why RestSharp's AddFile method adds useless headers and footers to the file(thus making it useless) whenever I try to upload it through a POST request?
 

Majine

Banned
Someone mind helping me with one Java thing?

iCeLe9PbSsXEx.png


I need it to be an accessor, but "get" doesn't work ;( Been programing java for 2 weeks, so be nice ;p
 

nan0

Member
Someone mind helping me with one Java thing?


I need it to be an accessor, but "get" doesn't work ;( Been programing java for 2 weeks, so be nice ;p

Code:
class SecretNumber{

private int guessCounter = 0

public int GetGuessCounter(){
return this.guessCounter;
}

public void SetGuessCounter(int guessCounter){
this.guessCounter = guessCounter;
}

// Rest of your class
}

What do you need i in SecretNumber for anyway? It's just a counter variable for the loop and you currently don't use it in SecretNumber.
 

Majine

Banned
What do you need i in SecretNumber for anyway? It's just a counter variable for the loop and you currently don't use it in SecretNumber.

It's not shown in the screencap, but I need the value of i to tell the user how many guesses he has left.
 
Top Bottom