I'm staring at all these square brackets in ObjectiveC wondering what they mean. Any suggestions for a crash course on the iOS SDK for someone familiar with other GUI toolkits?
I'm staring at all these square brackets in ObjectiveC wondering what they mean. Any suggestions for a crash course on the iOS SDK for someone familiar with other GUI toolkits?
Have any of you who have been developing for several years (7+) encountered fatigue?
I want to go more into product management, but shit's annoying if I have to start at another location in a few months.
.Yea but for me it just means it's time to move to a new project or new company
So I'm trying to do a project for my intro to coding class, but im not exactly sure how to accomplish it. Its Java. I need to make the yellow character move when i click and drag it, but only it. I have no idea how to do this and a lab instructor i asked just made it worse lol. I basically tried to limit the mouseDragged function to a 'box' around the character which makes it not work away from the character but as a result it wont drag outside of the box. Any help?
https://www.khanacademy.org/computer-programming/follow-the-mouse/3037220411
I know barely anything about programming so dont get too complicated
Yeah, that was also me rambling in the comments. One can dream ;_;Kristoffer was that you asking about rust green threads over on reddit?
That's strange, I've barely seen any issues with automatic bug testing in school projects. I'd be curious to know what kind of mistakes you've encounered...Man, I keep getting TAs that make mistakes grading my project assignments. It's really frustrating to work hard to make sure all of your cases are covered, and they say "This doesn't work with X" when it clearly does. I know I can just get it corrected, and I do, but it is something that just bugs me. I am guessing these TAs just churn out grading these things too fast to do a proper testing job.
1. That is Javascript. And while it does have a similar name, Java is as similar to Javascript as a car is to carpet. As in, not very similar at all.
2. Try having another two variables to keep track of the last mouse position (the initial values should probably start at the cat). And when the mouse is dragged, compare the mouse coordinates to those variables instead of static values.
You don't have to keep track of coordinates manually, HTML5 made drag and drop standard:
http://www.w3schools.com/html/html5_draganddrop.asp
I found this website of problems to solve for last year's Christmas, one per day. Seems interesting, so I took it on myself to learn Rust by solving them.
Kind of fun. Maybe my time would be better spent doing C++, but eh. Maybe next time.
Advent of Code
My solutions so far
I found this website of problems to solve for last year's Christmas, one per day. Seems interesting, so I took it on myself to learn Rust by solving them.
Kind of fun. Maybe my time would be better spent doing C++, but eh. Maybe next time.
Advent of Code
My solutions so far
const defaultInput = "your_input";
function getMaterialTotal(input) {
let total = {wrappingPaper: 0, ribbon: 0};
input.split(" ").forEach((box) => {
const dimensions = box.split(/\D/gi);
const [l, w, h] = dimensions;
const lw = l * w;
const wh = w * h;
const hl = h * l;
const smallestArea = Math.min.apply(null, [lw, wh, hl]);
let perimeter = null;
switch (smallestArea) {
case lw:
perimeter = 2 * l + 2 * w;
break;
case wh:
perimeter = 2 * w + 2 * h;
break;
case hl:
perimeter = 2 * h + 2 * l;
break;
}
const boxSize = ((2 * lw) + (2 * wh) + (2 * hl) + smallestArea);
const bow = l * w * h;
total.wrappingPaper += boxSize;
total.ribbon += (bow + perimeter);
});
return total;
}
console.log(getMaterialTotal(defaultInput));
Woooo 70% through Python in CodeAcademy
Anybody got some good material for me to continue learning Pythong after I complete CodeAcademy ? Would really appreciate it !
Figured this might be of interest to people in the programming community.
http://www.neogaf.com/forum/showthread.php?t=1194959
Tonight Google will make history by (hopefully!) defeating Lee Sedol in the first of 5 even matches of Go, a challenge which most thought would be impossible for at least another 2 generations.
If successful, it will be a monumental breakthrough in AI.
Figured this might be of interest to people in the programming community.
http://www.neogaf.com/forum/showthread.php?t=1194959
Tonight Google will make history by (hopefully!) defeating Lee Sedol in the first of 5 even matches of Go, a challenge which most thought would be impossible for at least another 2 generations.
If successful, it will be a monumental breakthrough in AI.
I'll be watching, even though I know nothing about how Go is played.
A Go AI from Google? I hope it's written in Go.Figured this might be of interest to people in the programming community.
http://www.neogaf.com/forum/showthread.php?t=1194959
Tonight Google will make history by (hopefully!) defeating Lee Sedol in the first of 5 even matches of Go, a challenge which most thought would be impossible for at least another 2 generations.
If successful, it will be a monumental breakthrough in AI.
Hey guys, I'm trying to think of a good design to replicate tab targetting in MMOs.
So lets say I boot up a random MMORPG and I'm in the middle of a map. I can press tab to select the nearest enemy.
Let's say that the game doesn't offer this functionality anymore.
So now I want to write a function that will click the point on the screen where an enemy is, and make this generic enough to work in any game.
So now I'm thinking how do humans instantly recognize an enemy on screen? It stands out from the surroundings... but how does this translate to code logic?
Sounds like any solution you use is going to be error prone and not work that well. I'd start by looking for health bars or name plates though
Sounds like any solution you use is going to be error prone and not work that well. I'd start by looking for health bars or name plates though
or you can check movement of blocks of pixels. Of course, you have to separate enemies from environment elements, (size, repetitive movement, etc.) Or, you check the internal variables where the locations of enemies are stored.
Or you can just borrow Goolge's alpha go. (It's actually Alpha's alpha go, isn't it?)
Assuming you can efficiently grab the display, there's plently of work on optical flows, and it can be made efficient.might be tough to make it efficient and fast though.
Assuming you can efficiently grab the display, there's plently of work on optical flows, and it can be made efficient.
Care to tell us more about the game? The solutions can be pretty different depending on many factors (point of view, moving/static background, etc.)
It's Breath of Fire 6. I just realized however that my AI party members are also moving around on the screen which makes this more difficult.
For capturing the screen I was thinking of using the GDI Plus api (GdipCreateBitmapFromHBITMAP), so capture it at two points in time and scan areas for large differences in pixel values, but with friendly characters on screen that's more difficult. Even in other games, other players may be walking by.
Obviously not, and I don't think you'll be able to find anything like an "universal" solution.I'd rather not have the code be specific to sprite based games (and I can't seem to find the sprite files). At the same time, there doesn't seem to be an easy solution to this for differentiating monsters from other players walking by.
You may be able to identify all "active blobs" on screen, assuming there's not too many effects on screen (magic can really mess things). Once you've done that, you can probably identify your partners by doing a color identification of the blobs. It usually works pretty well, and you can use unsupervised learning using k-means or something.It's Breath of Fire 6. I just realized however that my AI party members are also moving around on the screen which makes this more difficult.
For capturing the screen I was thinking of using the GDI Plus api (GdipCreateBitmapFromHBITMAP), so capture it at two points in time and scan areas for large differences in pixel values, but with friendly characters on screen that's more difficult. Even in other games, other players may be walking by.
Just getting into podcasts, any good programming (or related) ones?
Some stupid idea... Instead of guessing where to click, wouldn't the other way around simpler? Track your own character, click in a spiralling curve around it, and stop when you detect that a you've a lock by detecting the health bar?
I've been looking around for some time and sadly there aren't that many options for pure programming podcasts. Most tend to focus on the industry or high level discussions about tech.
I recommend trying these:
Programming Throwdown
Casual programming talk. Each episode features a tech or programming language. Unfortunately they usually spend most of the time talking about personal life and tangential things, leaving the main topic to 10-15 minutes at the end but it's still fairly enjoyable I guess.
Cppcast
As the name hints, this podcast is focused on c++. Since I only found out about it a few weeks ago I haven't had a chance to listen to many episodes yet but production seems to be of high quality. They often have high profile guests which some might find interesting.
Jeff and Casey show
I like this show because it's fun and entertaining. It's the least focused on programming out of these three - some episodes don't even touch on the subject. Also I think it might be discontinued or put on hold but there's still an archive of many episodes available.
Room
has a private member variable. A pointer to another room.
Room *roomPoint;
And these functions
getInfo()
{
cout << "This is a generic room" << endl;
}
nextRoom()
{
return roomPoint;
}
int main()
Room r1;
Bathroom b1;
Room* currentRoom;
r1's roomPointer set to point to b1.
currentRoom = r1.
currentRoom->getInfo(). This couts the generic message.
Now if I do
currentRoom = currentRoom->nextRoom();
currentRoom should now be pointing to the bathroom. In fact I have confirmed it DOES point to the bathroom.
but if I do
currentRoom->getInfo() it still couts the generic message. It isn't using the overwritten "getInfo" function