Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
I think Java2D is pretty easy to work with, but if you don't already know Java there's a fair amount of stuff you need to do up-front. Here's a basic Java application that opens a window and provides a Graphics object, the basis of all Java2D drawing:

code:
import java.awt.*;
import javax.swing.*;

public class Java2DDemo extends JPanel {

	public static void main(String[] args) {
		Java2DDemo app = new Java2DDemo();
		JFrame window = new JFrame();
		window.add(app);
		window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		window.pack();
		window.setVisible(true);
	}

	public Java2DDemo() {
		setPreferredSize(new Dimension(320, 240));
	}

	public void paint(Graphics g) {
		g.setColor(new Color(120, 255, 0));
		g.fillRect(0, 0, getWidth(), getHeight());
		g.setColor(new Color(0, 150, 199));
		g.drawRect(10, 10, 100, 100);
		g.setColor(Color.RED);
		g.fillOval(100, 50, 60, 70);
		// etc.
	}
}
The Graphics maintains drawing state, like clipping, translation, pen color and so on. I'd be happy to answer any specific questions, but the docs are pretty good.

Adbot
ADBOT LOVES YOU

Reisen
Aug 5, 2005

That seems simple enough, and Java is one of the two modern languages I know (the other being Python). I'll give it a shot!

little munchkin
Aug 15, 2010

Reisen posted:

That seems simple enough, and Java is one of the two modern languages I know (the other being Python). I'll give it a shot!

Pygame is pretty simple too. I would say it a little easier to use and a little more intuitive than Swing, but the documentation isn't too good; Java definitely has the advantage in that department.

Here's a bunch of Pygame examples if you choose to go that route:
http://cs.simpson.edu/?q=node/26

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)
I am lucky enough to have work pay for some java training for me. I used to program, but have not done any real coding in at least 5 years. I have narrowed it down to 3 courses that seem to fit what I need, but I don't know which one, if it matters, would be best. Have any of you taken classes or courses with any of these places, and if so do you have a recommendation? Does it not really matter in the scheme of things?

Exitcertified
http://www.exitcertified.com/sun-microsystems-training/fundamentals-java-programming-language-sl-110-se6-D66374GC10.html

Learningtree
http://www.learningtree.com/courses/471.htm

Hands on Technology Transfer
http://www.traininghott.com/CityCourses/Philadelphia-PA-Learning-Java-Programming-Classes.htm

All of the above have onsite offerings which I would prefer. Just so much easier and nicer for me to learn at than a virtual class.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I don't know C++ or Windows programming at all, so...could anyone tell me why the compiled version of this source isn't printing its output to stdout? It outputs to the console just fine, but if I try to redirect it from the command line like "compiled.exe > test.txt" I get a blank file...same results if I try to capture stdout by calling it from Python's subprocess or popen.

I see it's using wprintf to output, but from my meager Googlin' that's supposed to write to stdout...

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Thermopyle posted:

I don't know C++ or Windows programming at all, so...could anyone tell me why the compiled version of this source isn't printing its output to stdout? It outputs to the console just fine, but if I try to redirect it from the command line like "compiled.exe > test.txt" I get a blank file...same results if I try to capture stdout by calling it from Python's subprocess or popen.

I see it's using wprintf to output, but from my meager Googlin' that's supposed to write to stdout...
When you redirect to a file, does the output still appear on the console?

nesbit37 posted:

I am lucky enough to have work pay for some java training for me. I used to program, but have not done any real coding in at least 5 years. I have narrowed it down to 3 courses that seem to fit what I need, but I don't know which one, if it matters, would be best. Have any of you taken classes or courses with any of these places, and if so do you have a recommendation? Does it not really matter in the scheme of things?

Exitcertified
http://www.exitcertified.com/sun-microsystems-training/fundamentals-java-programming-language-sl-110-se6-D66374GC10.html

Learningtree
http://www.learningtree.com/courses/471.htm

Hands on Technology Transfer
http://www.traininghott.com/CityCourses/Philadelphia-PA-Learning-Java-Programming-Classes.htm

All of the above have onsite offerings which I would prefer. Just so much easier and nicer for me to learn at than a virtual class.
The best way to code is to just, well, code. I think that classes like these, where they teach you nothing of value and just dick around with Swing and JDBC, are an awful way to spend money.

Is there any reason you're looking at these types of classes as opposed to something that will add value to your resume?

Vulture Culture fucked around with this message at 02:13 on Jul 28, 2011

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Misogynist posted:

When you redirect to a file, does the output still appear on the console?


Nope.

I've tested it on two Win7 64 bit computers and it didn't work on either, but it does work on a Vista 32 bit computer...

Here it is compiled. It's an exe on the internet, so don't download it if you don't feel like it, but that is the source I just posted.

Just to show my utter ignorance in this area...I haven't actually compiled this source, another goon did it for me. Would it have to be compiled differently for 64 and 32 bit architectures?

Thermopyle fucked around with this message at 03:12 on Jul 28, 2011

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Misogynist posted:

When you redirect to a file, does the output still appear on the console?

The best way to code is to just, well, code. I think that classes like these, where they teach you nothing of value and just dick around with Swing and JDBC, are an awful way to spend money.

Is there any reason you're looking at these types of classes as opposed to something that will add value to your resume?

I'm going to agree and say that those classes are horrible. You'll be getting the time off work to go for a week, see if they'll just buy you a laptop and a couple books and a Starbucks card with the $2495. Then just sit around writing code.

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)

Misogynist posted:

The best way to code is to just, well, code. I think that classes like these, where they teach you nothing of value and just dick around with Swing and JDBC, are an awful way to spend money.

Is there any reason you're looking at these types of classes as opposed to something that will add value to your resume?

Because they are paid for, structured, and are in a time block that will force me to work on learning to code in Java. My main purpose at work and my personal life is not coding, its a secondary if not tertiary aspect of my job and now we have grant funding to pay for it. I don't particularly want to spend my free time teaching myself to code, nor do I want to assume that I will teach myself to do it in the same time when I have other work I could be doing instead. If I was paying for this myself and I was in my early 20s I would totally agree with you, but right now life doesn't seem to work that way for me and the opportunity is here.

Bottom line is I have a fixed amount of money that must be spent on programming training, specifically java. If there are better structured classes or methods out there that's fine, but go and buy a couple a books and teach yourself isn't an option. Not so much because I can't do it, but because I know won't do it if it goes that way (and the money can't be spent that way, federal grants are very strict).

Scaevolus
Apr 16, 2007

So you don't care enough to actually learn, but you still need to spend money to make it look like you're learning. Got it.

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)
No, I want to learn, but I also know what does and does not work for me, and I have limits on how and when the funds can be spent. Just because buying a couple books and sitting in a coffee shop for a week working through them works for some of you does not mean it works for me or that it is even an option I can consider. If you have a suggestion for a structured learning method with instruction that costs around $2500 I am all ears. If you think all 3 of those places are crap, that's equally valid. If you have experience that one is better than the other I would like to hear it. I do have to ask, have you attended the ~5 day bootcamp type courses before or only believe they are terrible?

Its also not like I haven't coded before. I did get my undergraduate education in computer science in the late 90s and did programming work for a few years after wards. Coding just has not been a big part of my responsibilities lately and they are not going to become a major part of them anytime in the near future.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

nesbit37 posted:

If you have a suggestion for a structured learning method with instruction that costs around $2500 I am all ears.

There's a very common sentiment among programmers that all (or nearly all) such "structured learning methods" are a waste of time. So I'm not surprised to see you get little help here. (And I think saying "it needs to cost $2500" is putting people off--maybe just say your grant is for $2500. Surely you'd accept a workable solution that cost $10?)

You say you got your undergrad in CS. Did the classes that involved programming work for you? If they did, or you think they would, why not take your grant and enrol in a course for a semester at a local college? Call up an advisor or someone and explain your situation, see if they have a course that might work for you. $2500 might get you close enough for tuition for one course, and you can stretch your week off into a few hours off a week to attend lectures.

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)
Yes, that is certainly true that I am open to other less expensive suggestions as well. I am sorry if I came off as abrasive, but it was a little frustrating to ask about the quality of trainers and then be presented with the idea that your wasting your time and the only way to learn to program is to teach yourself.

The courses in my program did teach me and I liked how they went. Its just that not only have I not written code in quite a while, but I learned in Object pascal and last wrote things in C++. I, too, furthered my own education after school and work by coding for fun and just trying new things, but I have an opportunity right now to have something structured paid for to get me back into it so I can hopefully do some support and possibly even plugins for our open source platforms.

I did look into local schools and, unfortunately, they are not going to work. The community collage would have been an option but they don't have an applicable course available this coming semester. The other area colleges won't accept me without enrolling as a student and into the program, and they didn't want an auditor for a course like this. As far as I can tell, and I very well could be wrong, but these boot camp type courses are all that are available that fit the stipulations of the grant.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

nesbit37 posted:

I do have to ask, have you attended the ~5 day bootcamp type courses before or only believe they are terrible?

I've never taken a Java one, but I have for things like HTML and SQL. They buzz through a book and some examples, skip a ton of stuff, and you don't really learn much. Why? There's just not enough time to actually explain things, ask questions, and learn from each other.

Now, they can be a good way to get started with a new technology. But if you look at the amount of things they plan on covering in the class, you'll see there's no way they can spend any more than 10 or 15 minutes on each thing. You could literally spend 3 days going over just classes in Java, along with the application/examples of them.

Usually, the classes are full of fucktards who are forced to go their by their jobs. And most of them just play around on the internet all day. Those schools are in it for the money and know corporations will pay. But it's like companies don't care (or don't know) that they are literally gaining nothing by sending their employees to poo poo like this. You just can't learn programming in 5 days.

Second, do you personally want to learn Java or is your employer making that decision for you? Unless you have a personal project you want to do in Java (Android stuff for instance) I would run like hell and take a class on C# or Ruby or PHP or anything else.

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)

Bob Morales posted:

Second, do you personally want to learn Java or is your employer making that decision for you? Unless you have a personal project you want to do in Java (Android stuff for instance) I would run like hell and take a class on C# or Ruby or PHP or anything else.

Its a bit of both. I would like to get back into coding a bit, but I have so much stuff on my plate right now professionally and personally that I can't be too choosy. Java fits work needs, as we have 3 open source platforms that are all based on java, and I can make it fit for most things I might want to do personally.

I was a little worried these types of classes might be like that. I'll probably just have to make the best of it. If nothing else I am hoping that it also makes me more eager to work on coding more. Even if the class itself isn't the best that doesn't mean it can't be an inspiration to start messing around more on your own with at least some sort of grounding to start from.

nielsm
Jun 1, 2009



Just to run it into the ground, let me just link the classic Teach Yourself Programming in Ten Years essay.

If you do decide to take one of those courses, I would suggest to bring one of your own projects and work on it when the teacher is just rambling, then take any chances to ask the teacher for advice on any problems you face with your own project.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

nesbit37 posted:

I was a little worried these types of classes might be like that. I'll probably just have to make the best of it. If nothing else I am hoping that it also makes me more eager to work on coding more. Even if the class itself isn't the best that doesn't mean it can't be an inspiration to start messing around more on your own with at least some sort of grounding to start from.

If it's free, go right ahead.

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)

nielsm posted:

Just to run it into the ground, let me just link the classic Teach Yourself Programming in Ten Years essay.

If you do decide to take one of those courses, I would suggest to bring one of your own projects and work on it when the teacher is just rambling, then take any chances to ask the teacher for advice on any problems you face with your own project.

Thanks for the article, that was a good read. I am not expecting to be a java expert after one of these courses, but to at least have a better standing afterwards than I do with my current coding foundation. The class is indeed free for me, so if there is no discernible difference between the organization teaching them I guess I will just go with whoever fits my schedule best and make the most of it.

Met48
Mar 15, 2009
Quick question here, but is it possible to stop an application from stealing global hotkeys on Windows? I've got a game (not fullscreen) that eats my foobar global hotkeys. They aren't media keys but rather Alt + numpad keys (I don't care about using them for special characters).

Autohotkey is strangely unaffected, so I've got an Autohotkey script that will temporarily change focus from the game when I press these keys. This is still not the best as the double-focus switch is far from instantaneous. Any better solutions? I've tried using Autohotkey's SendControl function but it isn't working with foobar.

Edit: Basically, what's the best way to capture and redirect the keystrokes to foobar without using Autohotkey's SendControl function or changing window focus. I'm happy to use a proper language to make this if it's going to work, I'm just not sure where to look.

Met48 fucked around with this message at 21:58 on Jul 28, 2011

Quarantini
Aug 9, 2010
can someone with much more regex kung-foo than I whip an expression that will match:
[any upper character or digit 0-9][dash][any upper character or digit 0-9] (for php)

example data
AAAA-BBBB
A123-B456
1234-4567
DEFG-HIJK

edit: I tried ([A-Za-z0-9-]+) with some online regex maker but it only seems to match the 1st valid needle in a haystack and not any of the others, i want to be able to feed the expression a bunch of data containing the above strings and be able to have it returned into a cleaned array

ToxicFrog
Apr 26, 2008


The regex is a straightforward translation of your description.

[any upper character or digit 0-9] = [A-Z0-9]
[dash] = -

So the regex is [A-Z0-9]-[A-Z0-9]

As for the actual problem - given a string and a regex, return a list of all substrings matching that regex - there's bound to be something in PHP's string library that does that, right? (I don't know PHP.)

Quarantini posted:

edit: I tried ([A-Za-z0-9-]+) with some online regex maker but it only seems to match the 1st valid needle in a haystack and not any of the others, i want to be able to feed the expression a bunch of data containing the above strings and be able to have it returned into a cleaned array

The problem with that is not the regex (although it is wrong) but presumably the fact that you're searching using a function that returns the first match rather than all matches.

1337JiveTurkey
Feb 17, 2005

Quarantini posted:

can someone with much more regex kung-foo than I whip an expression that will match:
[any upper character or digit 0-9][dash][any upper character or digit 0-9] (for php)

example data
AAAA-BBBB
A123-B456
1234-4567
DEFG-HIJK

edit: I tried ([A-Za-z0-9-]+) with some online regex maker but it only seems to match the 1st valid needle in a haystack and not any of the others, i want to be able to feed the expression a bunch of data containing the above strings and be able to have it returned into a cleaned array

If you're only doing four before the dash and four after, try [A-Za-z0-9]{4}-[A-Za-z0-9]{4} or (if PHP supports regex character classes) [:alphanum:]{4}-[:alphanum:]{4}

qntm
Jun 17, 2009

Quarantini posted:

can someone with much more regex kung-foo than I whip an expression that will match:
[any upper character or digit 0-9][dash][any upper character or digit 0-9] (for php)

example data
AAAA-BBBB
A123-B456
1234-4567
DEFG-HIJK

edit: I tried ([A-Za-z0-9-]+) with some online regex maker but it only seems to match the 1st valid needle in a haystack and not any of the others, i want to be able to feed the expression a bunch of data containing the above strings and be able to have it returned into a cleaned array

The example data you're giving doesn't match the expression you guessed. "[any upper character or digit 0-9][dash][any upper character or digit 0-9]" is written as [A-Z0-9]-[A-Z0-9]. The examples you're giving, however, would return A-B, 3-B, 4-4 and G-H if you used that expression. Then it looks like you're trying ([A-Za-z0-9-]+). Why did you put a-z in there if you specifically want "any upper character"? Also, this expression matches nonsense like 0 and ---23097FSGSDHkadsf-d-.

Assuming that the examples indicate what you actually want better than anything else, your answer is probably [A-Z0-9]{4}-[A-Z0-9]{4}.

qntm
Jun 17, 2009
Also: http://php.net/manual/en/function.preg-match-all.php

oxidation
May 22, 2011
I'm a CS undergrad looking to get much more involved in the field past my mandatory coursework. I don't know much about the field as a whole and looking to explore my options.

Do any of you have any solid resources on the following?:
-Notable communities, forums, blogs, etc. that I should be watching and participating in.
-Comparisons/explanations of the various subfields and specializations of computer science.
-Notable opensource projects that a beginner could work on.

limip
Oct 24, 2003

Thermopyle posted:

Nope.

I've tested it on two Win7 64 bit computers and it didn't work on either, but it does work on a Vista 32 bit computer...

Here it is compiled. It's an exe on the internet, so don't download it if you don't feel like it, but that is the source I just posted.

Just to show my utter ignorance in this area...I haven't actually compiled this source, another goon did it for me. Would it have to be compiled differently for 64 and 32 bit architectures?

I can't explain why it's happening, but fflush isn't being called during program shutdown. If he adds fflush(stdout) before main returns, it should work fine.

The Saddest Robot
Apr 17, 2007

qntm posted:

The example data you're giving doesn't match the expression you guessed. "[any upper character or digit 0-9][dash][any upper character or digit 0-9]" is written as [A-Z0-9]-[A-Z0-9]. The examples you're giving, however, would return A-B, 3-B, 4-4 and G-H if you used that expression. Then it looks like you're trying ([A-Za-z0-9-]+). Why did you put a-z in there if you specifically want "any upper character"? Also, this expression matches nonsense like 0 and ---23097FSGSDHkadsf-d-.

Assuming that the examples indicate what you actually want better than anything else, your answer is probably [A-Z0-9]{4}-[A-Z0-9]{4}.

He might want to anchor that too, make sure that it matches the entire string and not just a substring. This may not be needed, depending on the language and how the data is organized. Is the data you are searching in seperate variables/strings, or are they all in one string separated by newlines or some other character?

^([A-Z0-9]{4})-([A-Z0-9]{4})$

fankey
Aug 31, 2001

I'm trying to figure out if it's possible to pass something like a pointer to a member function in lua. Given the following
code:
Foo = {  Name = "a foo" }

function Foo:New(obj)
  obj = obj or {}
  setmetatable(obj, self)
  self.__index = self
  return obj
end

function Foo:Test(value)
  print( "Foo", self, value)
end

function DoSomethingFourTimes(func)
  for x = 1, 4 do
    func(x)
  end
end


foo = Foo:New()
foo:Test(3)

-- This is what I want but the parser complains
-- DoSomethingFourTimes(foo:Test)

-- this parses but does not work correctly
DoSomethingFourTimes(foo.Test)

-- this works correctly but I'm hoping there's a little cleaner way
DoSomethingFourTimes(function(v) foo:Test(v) end)
I get this output
code:
Foo	table: 004DB6B8	3
Foo	1	nil
Foo	2	nil
Foo	3	nil
Foo	4	nil
Foo	table: 004DB6B8	1
Foo	table: 004DB6B8	2
Foo	table: 004DB6B8	3
Foo	table: 004DB6B8	4
I want to be able to pass either a plain function or a function associated with a particular table instance to another function that will end up calling it. Is my only option the last one?

nielsm
Jun 1, 2009



fankey posted:

I want to be able to pass either a plain function or a function associated with a particular table instance to another function that will end up calling it. Is my only option the last one?

I'm not much into the actual semantics of the OO-ish notations in Lua, but as far as I know you have to use that last idiom. You can of course wrap it into something simpler.

You know, one thing you could do was override the table lookup metamethod for your objects, such that looking up one of the functions in the class using the regular . operator yields a function bound to the object.

code:
function Foo.__index(obj, key)
    local val = rawget(obj, key)
    if type(val) == "function" then
        return function(...) return val(obj, ...) end
    else
        return val
    end
end
I'm pretty sure this won't work as-is, but I hope you get my idea!

ToxicFrog
Apr 26, 2008


^^ Looks like it should work to me.

Of course, this means that while foo.Test(3) will work, and DoSomethingFourTimes(foo.Test) will work, foo:Test(3) will not (which can be an interesting surprise violation for other Lua coders looking at your program).

I'm pretty sure that there's an unofficial patch on the lua-users wiki that makes foo:bar syntactic sugar for function(...) return foo:bar(...) end, which you could use if you don't mind breaking compatibility with "stock" lua.

Alternately, you can wrap it in something more explicit:

code:
function Foo:close(method_name)
  return function(...) return self[method_name](self, ...) end
end

-- ... --

DoSomethingFourTimes(foo:close "Test")

The King of Swag
Nov 10, 2005

To escape the closure,
is to become the God of Swag.
Here's something someone might be able to help me with:

I'm integrating Lua support into my application and I built both 64 and 32 bit static Lua libraries using TDM-GCC; these of course correlate to the 64 and 32 bit builds of the program I'm integrating Lua into. I have no problem with either build on my 64-bit machine (using gcc flags -m64 and -m32).

I'm on my laptop though and it's 32-bit only, and attempting to build a 32 bit on it provides me with these errors:

code:
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_mktime32'|
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_time32'|
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_difftime32'|
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_localtime32'|
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_gmtime32'|
Libraries\liblua32.a(loslib.o):loslib.c|| undefined reference to `_time32'|
Libraries\libmss32.a(log.o):log.c|| undefined reference to `_time32'|
Libraries\libmss32.a(log.o):log.c|| undefined reference to `_ctime32'|
Libraries\libmss32.a(init.o):init.c|| undefined reference to `_time32'|
Obviously something is up with <time.h>, but I haven't been able to find anything that would cause this. The runtime libraries should also be the same as the home computer is using the TDM-GCC 64/32 compiler and the laptop is running TDM-GCC 32 compiler.

abelwingnut
Dec 23, 2002


I asked this in the 'Random Questions' megathread in Ask/Tell but did not receive a response. Maybe this is a better place?

I'm trying to properly categorize an application for my resume.

This application allows users to log on and send subject data to our company via an internet browser per FDA rules. The user can give us details about the transfer, see past transfers, write on a message board, read and answer queries, ask questions, and download information regarding their specific trials. This application runs on a server at our data center in NJ. The client needs to download an ActiveX plug-in and that's it.

Is this SaaS CRM? SaaS CMS? Just SaaS? Just CRM? Just CMS? ASP? None of the above? I don't know!

At present I'm calling it a content management system/data transfer application. However that strikes me as wrong, misleading, outside of the industry nomenclature, and unprofessional.

So yes, please let me know how best to describe this application. Thanks in advance.

baquerd
Jul 2, 2007

by FactsAreUseless

Abel Wingnut posted:

At present I'm calling it a content management system/data transfer application. However that strikes me as wrong, misleading, outside of the industry nomenclature, and unprofessional.

Real answer: tailor it to the job descriptions if it's that important to you. Calling it content management software is pretty misleading though.

rolleyes
Nov 16, 2006

Sometimes you have to roll the hard... two?
Whatever you call it, if you really have written it to adhere to federal guidelines/rules then I'd talk that aspect up too because it shows you take care to follow the regulations of your industry. Better still if it had to pass validation/certification/whatever.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



baquerd posted:

Real answer: tailor it to the job descriptions if it's that important to you. Calling it content management software is pretty misleading though.

Yeah, this. Keep a master resume full of everything you've ever done, then make a copy and cut that down so it fits whatever job you're applying for to a tee.

Keep the master resume up to date, try to add new stuff to it at least once a year so you don't forget all the kickass projects you can mention having worked on. This also helps when negotiating a raise, as you'll be able to point to stuff that added value or whatever.

abelwingnut
Dec 23, 2002


Oh yea, I definitely tailor my resume per the job. I'm just wondering if there's a short, accurate, industry-standard way of describing this program without me having to waste a line detailing what it does.

Thanks for the info, guys.

nielsm
Jun 1, 2009



Abel Wingnut posted:

Oh yea, I definitely tailor my resume per the job. I'm just wondering if there's a short, accurate, industry-standard way of describing this program without me having to waste a line detailing what it does.

It sounds pretty CRM-ish to me. I'd only add the SaaS qualifier if it's actually built such that you can (relatively) quickly set up a new, independent instance for a new organisation.

abelwingnut
Dec 23, 2002


nielsm posted:

It sounds pretty CRM-ish to me. I'd only add the SaaS qualifier if it's actually built such that you can (relatively) quickly set up a new, independent instance for a new organisation.

Thanks. It is specifically made to add new users/trials/studies in a few seconds so I'll add the SaaS qualifier.

duck monster
Dec 15, 2004

I've got some jquery that looks like this:

code:
for (item in adlist) {
			counter = counter + 1
			if ((counter >= startv) && (counter <= endv)) {
					icounter = icounter +1
					$('#cp'+icounter).html(adlist[item]+'&nbsp;');
					$('#cp'+icounter).unbind();
					$('#cp'+icounter).click( function() {
						window.location.href="/editad/?id="+item; }
					);
				}
			}

All the links end up going to the same place. After much headscratching I realised that the code binded was exactly the same with window.location.href="/editad/?id="+item being evaluated at the click point, rather than at binding. Doh.

The question is, how do i set these so that the ?id=nn is set to the correct item value.

Excuse the goofy code, its bit of a deadline o_O

e: Solved

quote:


$('#cp'+icounter).bind('click', {'itm':item}, function(event) {
window.location.href="/editad/?id="+event.data.itm; }
);

duck monster fucked around with this message at 04:07 on Aug 2, 2011

Adbot
ADBOT LOVES YOU

Pointless Metaphor
Jan 13, 2009
I am attempting to resolve an error message in a set of php code and I am struggling to determine why. Note: I am not a very experienced programmer (to say the least) and I was given this code by our programming team to adapt and modify for use in our department. I have been able to resolve every error and issue up until this point, but now I am struggling.

The page itself is a listing of different values for a given trainee, each of which is selectable in a form which can be submitted to updated the given information in the database.


I am consistently getting the error message

quote:

Warning: Invalid argument supplied for foreach() in /home/kaplanho/public_html/Testing/KTDP/ktdp/scheduling/admin/headers.php on line 45

I am assuming this is because the argument in that foreach() loop is either null or not an array, but I cannot figure out why that is true. The posted changes do get saved, but I cannot figure out how to get rid of that error message.

Here is the code in question. First, a portion of the revelant trainee.php page code:

code:
<?
include ('headers.php');
if (post('trainee_id'))
	{
	$trainee_id = post('trainee_id');
	$updates = array('tech_check','first_name','last_name','faculty_manager','class_id','course','email','type','fm_priority','status', 'address', 'materials');
	foreach($updates as $field)
		{
		if ($value = post($field))
			{
			if ($field == 'class_id')
				{
				$result_rank = query("select max(rank) from ktdp_trainee where class_id = '$value'");
				if (mysql_num_rows($result_rank))
					{$rank = mysql_result($result_rank, 0) + 1;}
					else

						{$rank = 1;}
				query("update ktdp_trainee set $field = '$value', rank = $rank where id = $trainee_id");
				}
			query("update ktdp_trainee set $field = '$value' where id = $trainee_id");
			}
		}
	}
?>
Here is the corresponding code in headers.php:

code:
if ($_POST['status'])
	{
	$updates = array('status','rank','class_id','tech_check','course','faculty_manager','address', 'materials');
	foreach($updates as $field)
		{
		if ($_POST[$field])
			{
			foreach($_POST[$field] as $trainee_id => $value) //this is the offender
				{
				$trainee_id = addslashes(trim($trainee_id));
				$value = addslashes(trim($value));
				if ($field == 'class_id')
					{
					$result_rank = query("select max(rank) from ktdp_trainee where class_id = '$value'");
					if (mysql_num_rows($result_rank))
						{$rank = mysql_result($result_rank, 0) + 1;}
						else
							{$rank = 1;}
					query("update ktdp_trainee set $field = '$value', rank = $rank where id = $trainee_id");
					}
				query("update ktdp_trainee set $field = '$value' where id = $trainee_id");
				}
			}
		}
	}
This isn't all the code, of course, so if more of it would help clarify how the code works I can post it, but it's quite long.

I don't understand how the argument could be null or not an array given the check that's used the line before the offending line to ensure the contents of the posted field.

Any and all help is hugely appreciated!!!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply