But if I have something wrong in the file name it points directly to that folder where the images are created. And why is it showing up in the stupid editor window if it isn't running or throwing an error. If the image didn't exist in that place then it would error out on me like it always does.
If your images folder is at the root of your app, then you need to root out that path. The reason it's working in the designer is because the designer has a different current working resource path than the runtime will. It's annoying, and another reason to never use the editor.
Error 1 Could not find file 'C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1\ccmidsTestApp1\images\fdsa.pngasdf'. C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1\ccmidsTestApp1\MainWindow.xaml 31 15 ccmidsTestApp1
Well then I'm not sure from what you posted. :rotate:
But if I have something wrong in the file name it points directly to that folder where the images are created. And why is it showing up in the stupid editor window if it isn't running or throwing an error. If the image didn't exist in that place then it would error out on me like it always does.
If your images folder is at the root of your app, then you need to root out that path. The reason it's working in the designer is because the designer has a different current working resource path than the runtime will. It's annoying, and another reason to never use the editor.
C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1
Would be the root right? That contains the .sln and .suo files.
Probably not. Don't try and move your images folder, that's not going to solve your problem. Your problem is your code is not taking the environment into consideration when it's run, so it assumes the "." always refers to the folder the images are in, which may differ from where your executable is run from and points it's current directory towards. Ever change a windows shortcut? You can specify a different "current directory" than where the application is originating from, which will FUBAR your code because it's basing it off that.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
But if I have something wrong in the file name it points directly to that folder where the images are created. And why is it showing up in the stupid editor window if it isn't running or throwing an error. If the image didn't exist in that place then it would error out on me like it always does.
If your images folder is at the root of your app, then you need to root out that path. The reason it's working in the designer is because the designer has a different current working resource path than the runtime will. It's annoying, and another reason to never use the editor.
C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1
Would be the root right? That contains the .sln and .suo files.
The root of the project, not the solution. Where is the csproj file? Is the 'images' directory right off of that?
Well it's gotta be a path issue. I put the full file path into it and it showed the image... But I'd like to be able to use relative pathing (I know... I know...) just so we can make this work on everyone's machine.
But if I have something wrong in the file name it points directly to that folder where the images are created. And why is it showing up in the stupid editor window if it isn't running or throwing an error. If the image didn't exist in that place then it would error out on me like it always does.
If your images folder is at the root of your app, then you need to root out that path. The reason it's working in the designer is because the designer has a different current working resource path than the runtime will. It's annoying, and another reason to never use the editor.
C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1
Would be the root right? That contains the .sln and .suo files.
The root of the project, not the solution. Where is the csproj file? Is the 'images' directory right off of that?
Yeah it's:
TestApp1\TestApp1\Images
And TestApp1\TestApp1 contains the .vbproj file
Off the top of my head, I think you need to mark your image file with a build action of embedded resource for that to work properly.
Or "Copy to output folder" such things etc. etc.
When you posted that error, you implied that was different from what you had before. :P
So it wasn't different at all? Not found error?
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
No, do not mark it Embedded Resource, mark it Resource. Embedded Resource is an embedded Win32 resource (old school resources), Resource is a new-school WPF resource pack.
You need to change the path to /images/file.jpg
If you're trying to get to it from an assembly outside of the executing one, the path would be:
pack://application:,,,/<AssemblyNameHere>;component/<pathtofile>
Where <AssemblyNameHere>, is the name of your assembly. In your case, TestApp1.
Off the top of my head, I think you need to mark your image file with a build action of embedded resource for that to work properly.
Or "Copy to output folder" such things etc. etc.
When you posted that error, you implied that was different from what you had before. :P
So it wasn't different at all? Not found error?
The error I posted said the file was not found (obviously) and it was pointing to the correct folder where all the images reside.
I have also added each image as a resource and it still didn't work as well as using "/images/file.jpg". I'm at a loss. I swear this image problem didn't happen early this morning, but now they just are completely wrecked.
Does anyone have any good links on different testing methodologies and where they're most useful? I'm much better at writing tests that I used to be, but I'm sure I'm not "doing it right". For example, I have no idea how to write regression tests that involve services which I won't have credentials for once my part in the project ends.
Wouldn't the credentials be parametrized somewhere and updated by whoever ends up maintaining the app?
Our clients have relationships with third parties. Credentials are between the third parties and our clients and change regularly. The non-production services we have access to for testing go down or get altered without notice once the software for our clients is shipped. In cases like that, I check if something blows while calling the service and that I get a proper credential error returned, which is more like parity checking than actual testing.
There are other situations where I can easily check some things, but I don't understand how to check a wide enough range of important things.
I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
Xbox - PearlBlueS0ul, Steam
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
Does anyone have any good links on different testing methodologies and where they're most useful? I'm much better at writing tests that I used to be, but I'm sure I'm not "doing it right". For example, I have no idea how to write regression tests that involve services which I won't have credentials for once my part in the project ends.
Wouldn't the credentials be parametrized somewhere and updated by whoever ends up maintaining the app?
Our clients have relationships with third parties. Credentials are between the third parties and our clients and change regularly. The non-production services we have access to for testing go down or get altered without notice once the software for our clients is shipped. In cases like that, I check if something blows while calling the service and that I get a proper credential error returned, which is more like parity checking than actual testing.
There are other situations where I can easily check some things, but I don't understand how to check a wide enough range of important things.
If they change regularly, they need to be updated by whoever is maintaining? It is either done or it isn't, not sure I'm understanding your problem here.
You aren't responsible for unit testing someone elses service either.
0
Options
baronfelWould you say I havea _plethora_?Registered Userregular
edited May 2012
@Urahonky The problem is definitely what Gnome mentioned above. I've been bit by it several times before. Use the pack syntax and set the image to the Resource Build Action and all will be well.
Image pointing like that is an annoyingly wonky part of WPF.
So, I think I'm going to write my web crawler in Python. Any specific editors people like for that? I'll be doing development on Windows. Any tips and tricks that you wish you knew? I did PERL a few years back, but never Python. Should be fun!
If you want a full IDE, Aptana is really nice and free. PyCharm is also pretty good most of the time, but I found it to be a bit buggy and would just randomly corrupt my workspace on occasion and it's not free.
@Urahonky The problem is definitely what Gnome mentioned above. I've been bit by it several times before. Use the pack syntax and set the image to the Resource Build Action and all will be well.
Image pointing like that is an annoyingly wonky part of WPF.
I don't know how to do the pack syntax. Is that a part of XAML or is it a part of VB/C#?
e: I realize Gnome posted it above but I have no idea where to put that... in the UriSource?
urahonky on
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
"/images/file.jpg" works just as well as that pack does. But you have to set it to Resource and you have to rebuild it about 3 times for it to actually show up.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
"/images/file.jpg" works just as well as that pack does. But you have to set it to Resource and you have to rebuild it about 3 times for it to actually show up.
It was the Resource thing all along most likely. You'll notice I said last page to make sure the build action was Resource, hehe.
"/images/file.jpg" works just as well as that pack does. But you have to set it to Resource and you have to rebuild it about 3 times for it to actually show up.
It was the Resource thing all along most likely. You'll notice I said last page to make sure the build action was Resource, hehe.
I swear I had done that multiple times it just didn't take. :P I'm using Visual Studio 11 beta or whatever so maybe it was just a bug or something.
If they change regularly, they need to be updated by whoever is maintaining? It is either done or it isn't, not sure I'm understanding your problem here.
You aren't responsible for unit testing someone elses service either.
No, but I am responsible for making sure that changes to my integration module haven't screwed up integration with any third party services or applications it connects to. The services should be the easy part to automate, but the credential issue makes proper testing difficult.
I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
Xbox - PearlBlueS0ul, Steam
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Are any of you good with sed/awk?
Basically, I have a yaml file (my Rails database config), that is checked in to source control. I want to fill in 99% of my production environments database info, but not the password. I'd like to put a replacement token in place of the password, and then use the tail output of a file (mysql.pass) to replace that replacement token as part of my production deploy.
I know this can be done with sed/awk, but I am not a UNIX command master.
Basically, I have a yaml file (my Rails database config), that is checked in to source control. I want to fill in 99% of my production environments database info, but not the password. I'd like to put a replacement token in place of the password, and then use the tail output of a file (mysql.pass) to replace that replacement token as part of my production deploy.
I know this can be done with sed/awk, but I am not a UNIX command master.
A simple token replace is done with sed, something like:
SQLPASS=`cat mysql.pass`
sed "s/TOKEN/$SQLPASS/g" inputfile > outputfile
You can also do a sed in-place on the inputfile, but I don't recommend it. Usually you have your input template > output final in these scenarios.
If they change regularly, they need to be updated by whoever is maintaining? It is either done or it isn't, not sure I'm understanding your problem here.
You aren't responsible for unit testing someone elses service either.
No, but I am responsible for making sure that changes to my integration module haven't screwed up integration with any third party services or applications it connects to. The services should be the easy part to automate, but the credential issue makes proper testing difficult.
You probably want to make a mock of the service, since you're not actually testing the service itself.
The results that you expect can be captured and then mock it in for tests.
If they change regularly, they need to be updated by whoever is maintaining? It is either done or it isn't, not sure I'm understanding your problem here.
You aren't responsible for unit testing someone elses service either.
No, but I am responsible for making sure that changes to my integration module haven't screwed up integration with any third party services or applications it connects to. The services should be the easy part to automate, but the credential issue makes proper testing difficult.
You probably want to make a mock of the service, since you're not actually testing the service itself.
The results that you expect can be captured and then mock it in for tests.
And this is why interfaces are magical! Most good mocking frameworks will let you stub out a dummy implementation of an interface that you use for testing instead of being hard-linked to an actual service somewhere. You can just whip up a test data set, mock up the service, and set up an expectation to return your test data set.
Keep in mind that your system test phase will want that real service, though...
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
So, regarding PAdev hub accounts, I'm hoping @Infidel or someone else can tell me if these Linode servers would be suitable for some stuff I'd like to host. Basically, I just have a portfolio of Web development projects that I add to regularly, and I need a webhost for a domain name I own. I would need SSH access, CGI/FastCGI, MySQL, mod_rewrite (or something else for URL rewriting), and recent versions of PHP, Perl, Python, Ruby, and Lua. This gets ~10 hits a day, serves mostly low-bandwidth textual content, and the database access is very minimal (~10 tables, ~1000 records max).
Is this the sort of thing that this shared Linode would be good for?
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
So, regarding PAdev hub accounts, I'm hoping @Infidel or someone else can tell me if these Linode servers would be suitable for some stuff I'd like to host. Basically, I just have a portfolio of Web development projects that I add to regularly, and I need a webhost for a domain name I own. I would need SSH access, CGI/FastCGI, MySQL, mod_rewrite (or something else for URL rewriting), and recent versions of PHP, Perl, Python, Ruby, and Lua. This gets ~10 hits a day, serves mostly low-bandwidth textual content, and the database access is very minimal (~10 tables, ~1000 records max).
Is this the sort of thing that this shared Linode would be good for?
I'm not Infidel, but I can answer mostly in the affirmative for him. He's very responsive about installing things you need, and a lot of what you want is already there. Not sure about mod_rewrite and FastCGI, but SSH check, MySQL check, Python, PHP, Ruby, Perl, check, Lua is a pretty simple install. I think it would be perfect for you.
Hey, everyone. Not A Programmer in the house here.
I'm going to be starting an Associate Degree education in Web Programming (I can provide specifics if it's important) and I was wondering if I could get an idea of hardware requirements for a laptop. Right now my only computer is hooked up to my TV and there's no way I'm hunching in front of that for all of my class work.
I can't imagine that the hardware requirements would be very demanding for those sorts of projects, correct?
Also, how concerned should I be about being bad at math?
So, regarding PAdev hub accounts, I'm hoping @Infidel or someone else can tell me if these Linode servers would be suitable for some stuff I'd like to host. Basically, I just have a portfolio of Web development projects that I add to regularly, and I need a webhost for a domain name I own. I would need SSH access, CGI/FastCGI, MySQL, mod_rewrite (or something else for URL rewriting), and recent versions of PHP, Perl, Python, Ruby, and Lua. This gets ~10 hits a day, serves mostly low-bandwidth textual content, and the database access is very minimal (~10 tables, ~1000 records max).
Is this the sort of thing that this shared Linode would be good for?
I'm not Infidel, but I can answer mostly in the affirmative for him. He's very responsive about installing things you need, and a lot of what you want is already there. Not sure about mod_rewrite and FastCGI, but SSH check, MySQL check, Python, PHP, Ruby, Perl, check, Lua is a pretty simple install. I think it would be perfect for you.
Yes to everything except possibly Lua, might have to install that one still can't recall.
Posts
If your images folder is at the root of your app, then you need to root out that path. The reason it's working in the designer is because the designer has a different current working resource path than the runtime will. It's annoying, and another reason to never use the editor.
Well then I'm not sure from what you posted. :rotate:
C:\Users\kharris\Documents\Visual Studio 11\Projects\ccmidsTestApp1
Would be the root right? That contains the .sln and .suo files.
The root of the project, not the solution. Where is the csproj file? Is the 'images' directory right off of that?
Yeah it's:
TestApp1\TestApp1\Images
And TestApp1\TestApp1 contains the .vbproj file
Because your debug environment is far different from your runtime one.
Or "Copy to output folder" such things etc. etc.
When you posted that error, you implied that was different from what you had before. :P
So it wasn't different at all? Not found error?
You need to change the path to /images/file.jpg
If you're trying to get to it from an assembly outside of the executing one, the path would be:
pack://application:,,,/<AssemblyNameHere>;component/<pathtofile>
Where <AssemblyNameHere>, is the name of your assembly. In your case, TestApp1.
The error I posted said the file was not found (obviously) and it was pointing to the correct folder where all the images reside.
I have also added each image as a resource and it still didn't work as well as using "/images/file.jpg". I'm at a loss. I swear this image problem didn't happen early this morning, but now they just are completely wrecked.
Our clients have relationships with third parties. Credentials are between the third parties and our clients and change regularly. The non-production services we have access to for testing go down or get altered without notice once the software for our clients is shipped. In cases like that, I check if something blows while calling the service and that I get a proper credential error returned, which is more like parity checking than actual testing.
There are other situations where I can easily check some things, but I don't understand how to check a wide enough range of important things.
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
If they change regularly, they need to be updated by whoever is maintaining? It is either done or it isn't, not sure I'm understanding your problem here.
You aren't responsible for unit testing someone elses service either.
Image pointing like that is an annoyingly wonky part of WPF.
If you want a full IDE, Aptana is really nice and free. PyCharm is also pretty good most of the time, but I found it to be a bit buggy and would just randomly corrupt my workspace on occasion and it's not free.
I don't know how to do the pack syntax. Is that a part of XAML or is it a part of VB/C#?
e: I realize Gnome posted it above but I have no idea where to put that... in the UriSource?
And it's not really working for something else I'm trying... Ugh...
"/images/file.jpg" works just as well as that pack does. But you have to set it to Resource and you have to rebuild it about 3 times for it to actually show up.
It was the Resource thing all along most likely. You'll notice I said last page to make sure the build action was Resource, hehe.
I swear I had done that multiple times it just didn't take. :P I'm using Visual Studio 11 beta or whatever so maybe it was just a bug or something.
No, but I am responsible for making sure that changes to my integration module haven't screwed up integration with any third party services or applications it connects to. The services should be the easy part to automate, but the credential issue makes proper testing difficult.
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
Basically, I have a yaml file (my Rails database config), that is checked in to source control. I want to fill in 99% of my production environments database info, but not the password. I'd like to put a replacement token in place of the password, and then use the tail output of a file (mysql.pass) to replace that replacement token as part of my production deploy.
I know this can be done with sed/awk, but I am not a UNIX command master.
A simple token replace is done with sed, something like:
You can also do a sed in-place on the inputfile, but I don't recommend it. Usually you have your input template > output final in these scenarios.
You probably want to make a mock of the service, since you're not actually testing the service itself.
The results that you expect can be captured and then mock it in for tests.
And this is why interfaces are magical! Most good mocking frameworks will let you stub out a dummy implementation of an interface that you use for testing instead of being hard-linked to an actual service somewhere. You can just whip up a test data set, mock up the service, and set up an expectation to return your test data set.
Keep in mind that your system test phase will want that real service, though...
Is this the sort of thing that this shared Linode would be good for?
I'm not Infidel, but I can answer mostly in the affirmative for him. He's very responsive about installing things you need, and a lot of what you want is already there. Not sure about mod_rewrite and FastCGI, but SSH check, MySQL check, Python, PHP, Ruby, Perl, check, Lua is a pretty simple install. I think it would be perfect for you.
I'm going to be starting an Associate Degree education in Web Programming (I can provide specifics if it's important) and I was wondering if I could get an idea of hardware requirements for a laptop. Right now my only computer is hooked up to my TV and there's no way I'm hunching in front of that for all of my class work.
I can't imagine that the hardware requirements would be very demanding for those sorts of projects, correct?
Also, how concerned should I be about being bad at math?
Yes to everything except possibly Lua, might have to install that one still can't recall.