Search Results

Search found 2327 results on 94 pages for 'reverse geocoding'.

Page 62/94 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • Thinking skills to be a good programmer

    - by Paul
    I have been programming for last 15 years with non-CS degree. Main reason I got into programming was that I liked to learn new things and apply them to my work. And I was able to find and fix programming errors and their causes faster than others. But I never find myself a a guru or an expert, maybe due to my non-CS major. And when I saw great programmers, I observed they are very good, much better than me of course, at solving problems. One skill I found good in my mid-career is thinking of requirements and tasks in a reverse order and in abstract. In that way, I can see what is really required for me to do without detail and can quickly find parts of solution that already exist. So I wonder if there are other thinking skills to be a good programmer. I've followed Q&As below and actually read some of books recommended there. But I couldn't really pickup good methods directly applicable for my programming work. What non-programming books should a programmer read to help develop programming/thinking skills? Skills and habits to develop to be good at programming (I'm a newbie)

    Read the article

  • what are some good interview questions for a position that consists of reviewing code for security vulnerabilities?

    - by John Smith
    The position is an entry-level position that consists of reading C++ code and identifying lines of code that are vulnerable to buffer overflows, out-of-bounds reads, uncontrolled format strings, and a bunch of other CWE's. We don't expect the average candidate to be knowledgeable in the area of software security nor do we expect him or her to be an expert computer programmer; we just expect them to be able to read the code and correctly identify vulnerabilities. I guess I could ask them the typical interview questions: reverse a string, print a list of prime numbers, etc, but I'm not sure that their ability to write code under pressure (or lack thereof) tells me anything about their ability to read code. Should I instead focus on testing their knowledge of C++? Ask them if they understand what a pointer is and how bitwise operators work? My only concern about asking that kind of question is that I might unfairly weed out people who don't happen to have the knowledge but have the ability to acquire it. After all, it's not like they will be writing a single line of code, and it's not like we are looking only for people who already know C++, since we are willing to train the right candidate. (It is true that I could ask those questions only to those candidates who claim to know C++, but I'd like to give the same "test" to everyone.) Should I just focus on trying to get an idea of their level of intelligence? In other words, should I get them to talk and pay attention to the way they articulate their thoughts, and so on?

    Read the article

  • Does purposely linking to an invalid URL and then using 301 affect SEO?

    - by Mike
    On a section of my site, I am currently using .htaccess rewrites to put the ID as part of the URL instead of in the query, like so: RewriteRule ^([a-z_]+)?/?tours/([0-9]+)/(.*) /tours/tour_text.php?lang=$1&id=$2&urlstr=$3 [L] For example, if someone goes to /en/tours/12/some-text-here it will rewrite it to /tours/tour_text.php?lang=en&id=12&urlstr=some-text-here. However I don't want the users to be able to put just any text, so if they type in the wrong some-text-here part it will 301 redirect them to the right page. This works perfectly, but I can see a potential problem potential arising when localizing the website, so I just wanted to make sure it's not actually a problem. How it is now, if someone goes to /en/tours/12/some-text-here, the anchor to the Spanish version of that page will be /es/tours/12/some-text-here (i.e. only changing the "en" to "es"), and then the script will then 301 them to the correct Spanish text (something like /es/tours/12/algun-texto-aqui). And the reverse will also be the same. The anchor on the Spanish version to the English version would be /en/tours/12/algun-texto-aqui and then they will be forwarded with 301 back to /en/tours/12/some-text-here. Basically, the anchor changes the language and the 301 changes the string at the end. So I have two questions: Does purposely and permanently having invalid URLs on your site that get 301'ed to the correct ones have any effect on SEO? I could make it just show the correct URL to begin with, but this is a significant amount of work due to how I am handling the translations, so I would prefer just to 301 them. Will the invalid URLs that are contained in the links be added to the search engine indexes even if they get 301'ed to another page?

    Read the article

  • "Viral" license that only blocks legal actions of user and developer against each other

    - by Lukasz Zaroda
    I was thinking a lot about software licensing lately, because I would like to do some coding. I'm not an expert in all those licenses, so I came up with my own idea, and before I will put in on paper, I would like to make sure that I didn't reinvent a wheel, so maybe I would be able to use something that exists. Main idea behind my license is to guarantee freedom of use the software, but not "freedom to" (positive) (e.g. freedom to having source code), but "freedom from" (negative) (strictly from legal actions against you). It would be "viral" copyleft license. You would be able to without fear do everything you want with the software (and binaries e.g. reverse engineering), as long as You will include information about author and/or authors, and all derivative works will be distributed with the same license. I'm not interested in anything that would restrict a freedom of company to do something like "tivoization". I'm just trying to accomplish something that would block any legal actions of user and developer, targeted against each other, with the exception of basic attribution. Does exist something like that?

    Read the article

  • Smooth waypoint traversing

    - by TheBroodian
    There are a dozen ways I could word this question, but to keep my thoughts in line, I'm phrasing it in line with my problem at hand. So I'm creating a floating platform that I would like to be able to simply travel from one designated point to another, and then return back to the first, and just pass between the two in a straight line. However, just to make it a little more interesting, I want to add a few rules to the platform. I'm coding it to travel multiples of whole tile values of world data. So if the platform is not stationary, then it will travel at least one whole tile width or tile height. Within one tile length, I would like it to accelerate from a stop to a given max speed. Upon reaching one tile length's distance, I would like it to slow to a stop at given tile coordinate and then repeat the process in reverse. The first two parts aren't too difficult, essentially I'm having trouble with the third part. I would like the platform to stop exactly at a tile coordinate, but being as I'm working with acceleration, it would seem easy to simply begin applying acceleration in the opposite direction to a value storing the platform's current speed once it reaches one tile's length of distance (assuming that the tile is traveling more than one tile-length, but to keep things simple, let's just assume it is)- but then the question is what would the correct value be for acceleration to increment from to produce this effect? How would I find that value?

    Read the article

  • Apache DVB http video Streaming bandwidth or priority problem

    - by igino manfre'
    I'm streaming few precompressed DVB videos from cloud. The streams are generated from VLC on "impossible" ports (such as 64085, 64086 etc) reverse proxed by Apache on port 80 and 8080. All the generated streams are listed in "http://95.110.164.61/indexv.html". From an ADSL connection with enough downlink bandwidth, recalling the stream generated by VLC (such as "http://95.110.164.61:64087/mpg2_6.4") it flows fluently. Recalling the same stream proxed by Apache ("http://95.110.164.61/mpg2_6.4") the stream stops and goes. The only situation in which the Apache proxed streams flow regularly is from a site connected through 64 Mbps warranted bandwith with RTT to the server less than 10 mseconds. Please note that streams below 2 Mbps are fluently proxed. The system is a single core xeon with windows 2008 R2 on 4 GB of RAM with 1 Gbps of network bandwidth. The drain of computational and bandwidth resources is negligeable, the RAM usage always lower than 50%. On the system I run many VLC streamers. Any of them drains a variable amount of RAM (from about 25 to 70 MB). On the contrary the couple of httpd.exe processes drain no more than 7 MB. Using Wireshark (on the server) I see that VLC directy send to the client much more packets than Apache, and the stream is framgmented on many frames. I'm not a programmer, a newby of Apache. Can anyone please address me to a specific portion of the Apache's huge documentation? Thank you. igino

    Read the article

  • Reconstruct a file from a TCP stream

    - by Abhishek Chanda
    I have a client and a server and a third box which sees all packets from the server to the client (but not the other way around). Now when the client requests a file from the server (over HTTP), the third box sees the response. I am trying to reconstruct the file there. I am using libpcap to capture TCP datagrams and trying to reconstruct the file there. Here is what I did Listen for packets on an interface Group all packets which have the same ACK number Sort the group based on SEQ number Extract data from each packet and combine them and write to the disk The problem is, the file thus generated is not exactly the same as the original file. Does everything sound correct here? Some more details: I am using C++ The packet data is being stored as std::vector<char> I did change the byte order while reading the ack number and seq number from the packet using ntohl I am not sure if I need to change the byte order for the data as well. I tried to reverse the data from each packet before combining them, even that did not work. Is there something I am missing?

    Read the article

  • Possible to draw a select portion of a render target? (in XNA)

    - by TheBroodian
    I'm going to try to do this in reverse fashion and skip straight to the punch line, and then give the back story afterward: Is it possible to, after drawing a scene to a RenderTarget2D, only draw a select portion of the RenderTarget2D, if I don't want the entire thing? I'm using xTile to manage world data in my game (it's a great piece of work, colinvella [xTile's author] has made an amazing product), and for the most part it works great. xTile supports parallax effects in its layers to add some wonderful depth to 2d scenes, which was great, until I implemented a dynamic split-screen system into my game. Wanted to make a co-op game that wouldn't require players to be in close proximity to each other, so I made it so that if the players separate too far apart, the singular full-screen viewport 'snaps-apart', and is replaced by two split-screen viewports, which then smoothly transition to their respective player targets. The effect is pretty smooth aside from the part where the parallax backgrounds become skewed once the viewports split, because xTile's ratio for handling parallax effects is dependent upon viewport size. This is unfortunate, because the effect would otherwise be really snazzy, but the backgrounds become pretty heavily affected when the game goes from single-viewport to multi-viewport. So, Colinvella suggests using rendertargets to record the scene at full viewport size, and then only drawing a portion of it. But as far as I can tell, that isn't even possible? That being said, I've never even used render targets before, so I'm still learning, hence the question here.

    Read the article

  • General List of Common Programming Errors

    - by javamonkey79
    As one journey's from apprentice to journeyman to master I've noticed that one accumulates a list of best practices for things they've been bitten by. Personally, I write most of my stuff in java & SQL so my list tends to be slated towards them. I've accumulated the following: When doing list removal, always reverse iterate Avoid adding items to a list you are currently iterating on Watch out for NullPointerExceptions Now, I know there are language specific "common errors" links out there like this one. And I'm also aware of the pragmatic programmer tips, Martin Fowler's "code smells". Does anyone know of any good lists out there of things like I've listed above (re: list removal, adding items, etc). My guess is that there are some good QA folks out there that can probably throw me a bone here. I'm not looking for things the compiler can catch - I'm looking for common things that cause bugs. In the event that there isn't a list out there already then I welcome posting your own findings here. Thanks in advance!

    Read the article

  • unreachable subnet in one direction

    - by Carl Michaud
    I'm unable to route traffic to a subnet in my home. Here's my topology: INET <- Router A <- Router B <- WIFI AP where: Router A - ARRIS TG862G/CT (from comcast) - WAN DHCP, LAN 10.0.0.99 Router B - Linksys WRT400N with DD-WRT - WAN 10.0.0.12 , LAN 10.0.1.1 I was able to use DD-WRT to configure a static route for the 10.0.1.x network back to the 10.0.0.x network. But I'm not sure if i can do the reverse on the ARRIS router and was looking for suggestions on how to fix that. I've set things up this wasy because I am using OpenDNS to mange internet content for my kids and of course I wasn't able to configure DNS to my liking on Router A either. So at present I'm using Router A on 10.0.0.x to provide a private unfiltered WIFI AP (no ssid broadcast) that I use for netflix only and then I use router B to provide a filtered WIFI AP for the rest of my WIFI devices on 10.0.1.x. However I would like to be able to connect to my 10.0.1.x devices from the internet via dynamic dns; but I can't see anything behind router B this way. Thoughts?

    Read the article

  • Obtain reference to Parent object during instantiation

    - by GoldBishop
    I have a situation where a custom class is a property of another class. What i need to be able to do, if it is possible at all, is obtain a reverse to the "parent" class (ie the the class that holds the current class as a property). For Instance: Public Class Class1 ... public readonly property Prop11 as Class2 public property Prop12 as String ... End Class Public Class Class2 ... private _par as Class1 private _var21 as string ... Public Sub New(...) me._par = ???? ... End Sub public readonly property Prop21 as string Get return me._par.Prop12 & me._var21 End Get End Property ... End Class Ultimately, i am trying to access other properties within Class1 from Class2 as they do have substance for information from within Class2. There are several other classes within Class1 that provide descriptive information to other classes contained within it as properties but the information is not extensible to all of the classes through Inheritance, as Class1 is being used as a resource bin for the property classes and the application itself. Diagram, lazy design ;): Application <- Class1.Prop12 Application <- Class1.Prop11.Prop21 Question: Is it possible to get a recursion through this design setup?

    Read the article

  • If I send an IPA over TestFlight, can it be used to deploy to the app store?

    - by Reid Belton
    I am currently working for a small startup. I was previously under contract, now I am working for equity (no pay). The thing is, there is not yet a signed agreement in place as the details are being worked out. I may finish development before the contract is ready. I'm not currently under any contract or agreement, so the other party doesn't have any legal claim (that I know of) to the code I'm writing now, other than NDA (which just precludes me from cutting him out and releasing on my own). He already has the old code that I wrote under contract. I've made it clear to the other party that I won't submit the app or turn over the code until there's something signed to protect my interests. I've stopped pushing commits to the company repo (I'm now the only developer actively working on the project). However, I would still like to send builds over TestFlight for feedback and testing purposes. The other party has access to the developer portal and iTunes Connect for code signing, etc. Things are amicable and I don't foresee getting burnt on this, but I'm not going to put myself in that position. My concern is that if I send a finished build via TestFlight, it could be extracted and submitted to the app store without my participation. They wouldn't have the source for future maintenance and updates, of course, but it could be reverse-engineered by another developer later working from the old code base. Is this technically feasible at all? If so, is there a way I can send builds for testing while protecting my interests?

    Read the article

  • is wisdom of what happens 'behind scenes' (in compiler, external DLLs etc.) important?

    - by I_Question_Things_Deeply
    I have been a computer-fanatic for almost a decade now. I've always loved and wondered how computers work, even from the purest, lowest hardware level to the very smallest pixel on the screen, and all the software around that. That seems to be my problem though ... as I try to write code (I'm pretty fluent at C++) I always sit there enormous amounts of time in front of a text-editor wondering how every line, statement, datum, function, etc. will correspond to every Assembly and machine instruction performed to do absolutely everything necessary for the kernel to allocate memory to run my compiled program, and all of the other hardware being used as well. For example ... I would write cout << "Before memory changed" << endl; and run the debugger to get the Assembly for this, and then try and reverse disassemble the Assembly to machine code based on my ISA, and then research every .dll, library file, linked library, linking process, linker source code of the program, the make file, the kernel I'm using's steps of processing this compilation, the hardware's part aside from the processor (e.g. video card, sound card, chipset, cache latency, byte-sized registers, calling convention use, DDR3 RAM and disk drive, filesystem functioning and so many other things). Am I going about programming wrong? I mean I feel I should know everything that goes on underneath English syntax on a computer program. But the problem is that the more I research every little thing the less I actually accomplish at all. I can never finish anything because of this mentality, yet I feel compelled to know everything... what should I do?

    Read the article

  • Is IDirectInput8::FindDevice totally broken on Windows 7?

    - by Noora
    I'm developing on Windows 7, and using DirectInput8 for my input needs. I'm tracking gamepad additions and removals (that is, GUID_DEVINTERFACE_HID devices) using the DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE messages, which works fine. However, what I've come to find out is that no matter what I do, passing the received values from DBT_DEVICEARRIVAL to IDirectInput8's FindDevice method, it will always fail to identify the device, returning DIERR_DEVICENOTREG. DirectInput still clearly knows about the device, because I can enumerate and create it just fine. I've tried with three different gamepads, and the error persists, so it's not about that either. I also tried passing some alternative interface GUIDs for the RegisterDeviceNotification call, didn't help. So, has anyone else faced the same problem, and have you found a usable workaround? I'm afraid I'll soon have to stoop down to re-enumerating all devices when something is added or removed, but I'll first give this question one last shot here. EDIT: For the record, I've also tried pretty much every single HID API & SetupAPI function for alternative ways of figuring out the needed GUIDs, with zero success. So if you're facing the same problem as me, don't bother with that route. I'm pretty sure those GUIDs are made up by DirectInput itself somehow. Short of reverse engineering dinput8.dll, I'm truly out of ideas now.

    Read the article

  • XNA 2D vehicle wall collisions

    - by mike
    I am attempting to implement collisions for my truck game, where the truck can drive around the world and hit walls surrounding the level and various randomly placed walls within the level. I am able to get direct collisions working correctly. However, it is getting very complicated and tricky very quickly. I am trying to accommodate various other collisions such as when a truck is against the wall then turns an adjacent direction or when they reverse into a wall. Both of these result in a slight collision as the image of the truck flips around to the direction the player wants to move. All of this has resulted in a whole lot of if statements to check how I should be fixing the collision. This in turn makes the player jump to random locations and "teleport" around corners, etc. The rest of my game is fine, I am not completely new to game development or C# for that matter. It's just the logic of collisions. Any ideas on how I can approach this? Image of the collisions I am trying to resolve: http://tinypic.com/r/2qtflvq/6

    Read the article

  • From the Coalface - 3 - Work as hard as you can to be as lazy as you can!

    - by TATWORTH
    The saga of the Change Log A recent conversation reminded me of the need for change logs within a database, to record when various change scripts were run. Creating such the required table is simple. A typical table for this consists of: Id - identity Integer primary key ChangeFileName - NVARCHAR(128) to hold the name of the file run. DateAdded - DateTime non-null with default value of getutcdate() Purpose - NVARCHAR(128) Rerunnable - Bit non-null default 0. By good design of the table only two data values normally need to be supplied. Two stored procedures, one for inserting data and one to list in reverse sequence the log complete the database essentials. The complete implementation can be found in the CommonData solution at http://CommonData.CodePlex.Com By including a call the add Change Log stored procedure, each script can log its name and purpose for posterity. The scripts that were applied to say the UAT system and their sequence of application can be readily identified for running on the Live system. Formatting XML XML is often produced as one continous string with no embedded CR/LF. To get it into human readable form, open it in visual studio, swap to another tab and back and click the format document button. The XML will then be nicely formatted!

    Read the article

  • Common Substring of two strings

    - by Chander Shivdasani
    This particular interview-question stumped me: Given two Strings S1 and S2. Find the longest Substring which is a Prefix of S1 and suffix of S2. Through Google, I came across the following solution, but didnt quite understand what it was doing. public String findLongestSubstring(String s1, String s2) { List<Integer> occurs = new ArrayList<>(); for (int i = 0; i < s1.length(); i++) { if (s1.charAt(i) == s2.charAt(s2.length()-1)) { occurs.add(i); } } Collections.reverse(occurs); for(int index : occurs) { boolean equals = true; for(int i = index; i >= 0; i--) { if (s1.charAt(index-i) != s2.charAt(s2.length() - i - 1)) { equals = false; break; } } if(equals) { return s1.substring(0,index+1); } } return null; }

    Read the article

  • How often do you review fundamentals?

    - by mlnyc
    So I've been out of school for a year and a half now. In school, of course we covered all the fundamentals: OS, databases, programming languages (i.e. syntax, binding rules, exception handling, recursion, etc), and fundamental algorithms. the rest were more in-depth topics on things like NLP, data mining, etc. Now, a year ago if you would have told me to write a quicksort, or reverse a singly-linked list, analyze the time complexity of this 'naive' algorithm vs it's dynamic programming counterpart, etc I would have been able to give you a decent and hopefully satisfying answer. But if you would have asked me more real world questions I might have been stumped (things like how would handle logging for an application, or security difference between GET and POST, differences between SQL Server and Oracle SQL, anything I list on my resume as currently working with [jQuery questions, ColdFusion questions, ...] etc) Now, I feel things are the opposite. I haven't wrote my own sort since graduating, and I don't really have to worry much about theoretical things that do not naturally fall into problems I am trying to solve. For example, I might give you some great SQL solutions using an analytical function that I would have otherwise been stumped on or write a cool web application using angular or something but ask me to write an algo for insertAfter(Element* elem) and I might not be able to do it in a reasonable time frame. I guess my question here to the experienced programmers is how do you balance the need to both learn and experiment with new technologies (fun!), working on personal projects (also fun!) working and solving real world problems in a timeboxed environment (so I might reach out to a library that does what I want rather than re-invent the wheel so that I can focus on the problem I am trying to solve) (work, basically), and refreshing on old theoretical material which is still valid for interviews and such (can be a drag)? Do you review older material (such as famous algorithms, dynamic programming, Big-O analysis, locking implementations) regularly or just when you need it? How much time do you dedicate to both in your 'deliberate practice' and do you have a certain to-do list of topics that you want to work on?

    Read the article

  • How do spambots work?

    - by rlb.usa
    I have a forum that's getting hit a lot by forum spambots, and of course the best way to defeat something is to know thy enemy. I'll worry about defeating those spambots later, but right now I'd like to know more about them. Reading around, I felt surprised about the lack of thorough information on the subject (or perhaps my ineptness to input the correct search terms for better google results). I'm interested in learning all about spambots. I've asked on other forums and gotten brush-off answers like "Spambots are always users registering on your site." How do forum spambots work? How do they find the 'new user registration' page? (I'm especially surprised because some forums don't have a dedicated URL for this eg, www.forum.com/register.html , but instead use query strings or even other methods invisible to the URL bar) How do they know what to enter into each 'new user registration' field? How do they determine what's a page they can spam / enter data into and what is not? Do they even 'view' this page at all? ..If not, then I'd assume they're communicating with the server directly - how is - this possible? How do they do it? Can forum spambots break CAPTCHAs? Can they solve logic questions (how?)? Math questions? Do they reverse-engineer client-side anti-bot validation scripts? Server-side scripts? What techniques are still valid to prevent them? Where do spambots come from? Is someone sitting behind the computer snickering as they watch their bot destroy site after site? Or are they snickering as they simply 'release' it onto the internet somehow? Are spambots 'run' by an infected computer somewhere? Do they replicate themselves? etc

    Read the article

  • Reversing animated sprites

    - by brandon sedgwick
    I have created a sprite sheet of which consists of 6 frames with a character moving legs each frame, now I have coded it so that the animation is running successfully from frame 1 to 6, however I am trying to reverse this so then when it goes from 1 to 6 instead of restarting it go's 6 to 1 in a continuous loop. The coding for current animation is: void SpriteGame::Update(int tickTotal, int tickDelta) { //This is where you manage the state of game objects if ( tickTotal >= this->playerLastFrameChange + 4) { //Four ticks have elapsed since the last frame change this->playerFrame = this->playerFrame + 1; this->playerLastFrameChange = tickTotal; //We've just changed the frame if (this->playerFrame >= this->playerSheetLength) { this->playerFrame = playerLastFrameChange + 4; } //Frame has changed so change the source rectangle this->playerSourceRect->left = this->playerFrame * 64; this->playerSourceRect->top = 0; this->playerSourceRect->right = (this->playerFrame + 1) * 64; this->playerSourceRect->bottom = 64; } } any help please I am using DirectX11 as thats what we are being told to use as its for an win 8 game.

    Read the article

  • SunSpace - a sentimental moment

    - by me
    I just came back from California where I had a little sentimental moment.With the great help from some former Sun colleagues we move the old SunSpace gear into a new data center in Santa Clara.We will re-purpose the hardware as a new development infrastructure to build integrated demos around Oracle WebCenter products, Business Applications and Social Services. now - I could not resist to restart the SunSpace applications and see if it still works. And hey - even though we had to re-IP the entire  stack (sun.com domain is gone) and with some little hacking (thanks to Apache reverse proxy) -  we got it back! Hey Max - now I just need to change your SSO hack to get login working again Hmm - I won't - but it is really nice to see it working again .. and it's time to switch it off and to work  on the next cool things .. Do you know Oracle WebCenter Sites (formely Fatwire)? Its Oracle's Web Experience Management Solution - a pretty cool technology and a very slick User Interface. I specially like the drag&drop functionality which allows non technical users to easily publish content.  Why do I mention it here ?  Because we will use the SunSpace gear to build cool  Oracle WebCenter Sites demos and proof of concepts integration  into Business Applications and Social Services  This is a sneak preview what we are working on. Stay tuned.....

    Read the article

  • Is this too much to ask for a game programming and developing enthusiast? Am I doing this wrong?

    - by I_Question_Things_Deeply
    I have been a computer-fanatic for almost a decade now. I've always loved and wondered how computers work, even from the purest, lowest hardware level to the very smallest pixel on the screen, and all the software around that. That seems to be my problem though ... as I try to write code (I'm pretty fluent at C++) I always sit there enormous amounts of time in front of a text-editor wondering how every line, statement, datum, function, etc. will correspond to every Assembly and machine instruction performed to do absolutely everything necessary for the kernel to allocate memory to run my compiled program, and all of the other hardware being used as well. For example ... I would write cout << "Before memory changed" << endl; and run the debugger to get the Assembly for this, and then try and reverse disassemble the Assembly to machine code based on my ISA, and then research every .dll, library file, linked library, linking process, linker source code of the program, the make file, the kernel I'm using's steps of processing this compilation, the hardware's part aside from the processor (e.g. video card, sound card, chipset, cache latency, byte-sized registers, calling convention use, DDR3 RAM and disk drive, filesystem functioning and so many other things). Am I going about programming wrong? I mean I feel I should know everything that goes on underneath English syntax on a computer program. But the problem is that the more I research every little thing the less I actually accomplish at all. I can never finish anything because of this mentality, yet I feel compelled to know everything... what should I do?

    Read the article

  • Characteristics, what's the inverse of (x*(x+1))/2? [closed]

    - by Valmond
    In my game you can spend points to upgrade characteristics. Each characteristic has a formula like: A) out = in : for one point spent, one pont gained (you spend 1 point on Force so your force goes from 5 to 6) B) out = last level (starting at 1) : so the first point spent earns you 1 point, the next point spent earns you an additional 2 and so on (+3,+4,+5...) C) The inverse of B) : You need to spend 1 point to earn one, then you need to spend 2 to earn another one and so on. I have already found the formula for calculating the actual level of B when points spent = x : charac = (x*(x+1))/2 But I'd like to know what the "reverse" version of B) (usable for C) is, ie. if I have spent x points, how many have I earned if 1 spent gives 1, 1+2=3 gives 2, 1+2+3=6 gives 3 and so on. I know I can just calculate the numbers but I'd like to have the formula because its neater and so that I can stick it in an excel sheet for example... Thanks! ps. I think I have nailed it down to something like charac = sqrt( x*m +k) but then I'm stuck doing number guessing for k and m and I feel I might be wrong anyway as I get close but never hits the spot.

    Read the article

  • update jframe in java or revalidate/repaint/ panel

    - by user1516251
    How to update a java frame with changed content I want to update a frame or just the panel with updated content. What do I use for this Here is where i want to revalidate the frame or repaint mainpanel or whatever will work I have tried a number of things, but none of them have worked. public void actionPerformed(ActionEvent e) { //System.out.println(e.getActionCommand()); if (e.getActionCommand().equals("advance")) { multi--; // Revalidate update repaint here <<<<<<<<<<<<<<<<<<< } else if (e.getActionCommand().equals("reverse")) { multi++; // Revalidate update repaint here <<<<<<<<<<<<<<<<<<< } else { openURL(e.getActionCommand()); } } Here is the whole java file /* * * */ package build; import java.lang.reflect.Method; import javax.swing.JOptionPane; import java.util.Arrays; import java.util.*; import java.util.ArrayList; import javax.swing.*; import javax.swing.AbstractButton; import javax.swing.JScrollPane; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.ImageIcon; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; /* * ButtonDemo.java requires the following files: * images/right.gif * images/middle.gif * images/left.gif */ public class StockTable extends JPanel implements ActionListener { static int multi = 1; int roll = 0; static TextVars textvars = new TextVars(); static final String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "seamonkey", "galeon", "kazehakase", "mozilla", "netscape" }; JFrame frame; JPanel mainpanel, panel1, panel2, panel3, panel4, panel2left, panel2center, panel2right; JButton stknames_btn[] = new JButton[textvars.getNumberOfStocks()]; JLabel label[] = new JLabel[textvars.getNumberOfStocks()]; JLabel headlabel, dayspan, namelabel; JRadioButton radioButton; JButton button; JScrollPane scrollpane; int wid = 825; public JPanel createContentPane() { mainpanel = new JPanel(); mainpanel.setPreferredSize(new Dimension(wid, 800)); mainpanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); panel1 = new JPanel(); panel1.setPreferredSize(new Dimension(wid, 25)); c.gridx = 0; c.gridy = 0; c.insets = new Insets(0,0,0,0); mainpanel.add(panel1, c); // Panel 2------------ panel2 = new JPanel(); panel2.setPreferredSize(new Dimension(wid, 51)); c.gridx = 0; c.gridy = 1; c.insets = new Insets(0,0,0,0); mainpanel.add(panel2, c); panel2left = new JPanel(); panel2left.setPreferredSize(new Dimension(270, 51)); c.gridx = 0; c.gridy = 1; c.insets = new Insets(0,0,0,0); panel2.add(panel2left, c); panel2center = new JPanel(); panel2center.setPreferredSize(new Dimension(258, 51)); c.gridx = 1; c.gridy = 1; c.insets = new Insets(0,0,0,0); panel2.add(panel2center, c); panel2right = new JPanel(); panel2right.setPreferredSize(new Dimension(270, 51)); c.gridx = 2; c.gridy = 1; c.insets = new Insets(0,0,0,0); panel2.add(panel2right, c); // ------------------ panel3 = new JPanel(); panel3.setLayout(new GridBagLayout()); scrollpane = new JScrollPane(panel3); scrollpane.setPreferredSize(new Dimension(wid, 675)); c.gridx = 0; c.gridy = 2; c.insets = new Insets(0,0,0,0); mainpanel.add(scrollpane, c); ImageIcon leftButtonIcon = createImageIcon("images/right.gif"); //b1 = new JButton("Disable middle button", leftButtonIcon); //b1.setVerticalTextPosition(AbstractButton.CENTER); //b1.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales //b1.setMnemonic(KeyEvent.VK_D); //b1.setActionCommand("disable"); //Listen for actions on buttons 1 //b1.addActionListener(this); //b1.setToolTipText("Click this button to disable the middle button."); //Add Components to this container, using the default FlowLayout. //add(b1); headlabel = new JLabel("hellorow1"); c.gridx = 0; c.gridy = 0; c.insets = new Insets(0, 0, 0, 0); panel1.add(headlabel, c); radioButton = new JRadioButton("Percentage"); c.gridx = 2; c.gridy = 0; c.insets = new Insets(0, 0, 0, 0); panel1.add(radioButton, c); radioButton = new JRadioButton("Days Range"); c.gridx = 3; c.gridy = 0; c.insets = new Insets(0, 0, 0, 0); panel1.add(radioButton, c); radioButton = new JRadioButton("Open / Close"); c.gridx = 4; c.gridy = 0; c.insets = new Insets(0, 0, 0,0 ); panel1.add(radioButton, c); button = new JButton("<<"); button.setPreferredSize(new Dimension(50, 50)); button.setActionCommand("reverse"); button.addActionListener(this); c.gridx = 0; c.gridy = 1; c.insets = new Insets(0, 0, 0, 0); panel2left.add(button, c); dayspan = new JLabel("hellorow2"); dayspan.setHorizontalAlignment(JLabel.CENTER); dayspan.setVerticalAlignment(JLabel.CENTER); dayspan.setPreferredSize(new Dimension(270, 50)); c.gridx = 1; c.gridy = 1; c.insets = new Insets(0, 0, 0, 0); panel2center.add(dayspan, c); button = new JButton(">>"); button.setPreferredSize(new Dimension(50, 50)); button.setActionCommand("advance"); button.addActionListener(this); if (multi == 0) { button.setEnabled(false); } else { button.setEnabled(true); } c.gridx = 2; c.gridy = 1; c.insets = new Insets(0, 0, 0, 0); panel2right.add(button, c); int availSpace_int = textvars.getStocks().size()-textvars.getNumberOfStocks()*7; ArrayList<String[]> stocknames = textvars.getStockNames(); ArrayList<String[]> stocks = textvars.getStocks(); for (int column = 0; column < 8; column++) { for (int row = 0; row < textvars.getNumberOfStocks(); row++) { if (column==0) { if (row==0) { namelabel = new JLabel(stocknames.get(0)[0]); namelabel.setVerticalAlignment(JLabel.CENTER); namelabel.setHorizontalAlignment(JLabel.CENTER); namelabel.setPreferredSize(new Dimension(100, 25)); c.gridx = column; c.gridy = row; c.insets = new Insets(0, 0, 0, 0); panel3.add(namelabel, c); } else { stknames_btn[row] = new JButton(stocknames.get(row)[0], leftButtonIcon); stknames_btn[row].setVerticalTextPosition(AbstractButton.CENTER); stknames_btn[row].setActionCommand(stocknames.get(row)[1]); stknames_btn[row].addActionListener(this); stknames_btn[row].setToolTipText("go to Google Finance "+stocknames.get(row)[0]); stknames_btn[row].setPreferredSize(new Dimension(100, 25)); c.gridx = column; c.gridy = row; c.insets = new Insets(0, 0, 0, 0); //scrollpane.add(stknames[row], c); panel3.add(stknames_btn[row], c); } } else { label[row]= new JLabel(textvars.getStocks().get(columnMulti(multi))[1]); label[row].setBorder(BorderFactory.createLineBorder(Color.black)); label[row].setVerticalAlignment(JLabel.CENTER); label[row].setHorizontalAlignment(JLabel.CENTER); label[row].setPreferredSize(new Dimension(100, 25)); c.gridx = column; c.gridy = row; c.insets = new Insets(0,0,0,0); panel3.add(label[row], c); } } } return mainpanel; } public void actionPerformed(ActionEvent e) { //System.out.println(e.getActionCommand()); if (e.getActionCommand().equals("advance")) { multi--; } else if (e.getActionCommand().equals("reverse")) { multi++; } else { openURL(e.getActionCommand()); } } /** Returns an ImageIcon, or null if the path was invalid. */ protected static ImageIcon createImageIcon(String path) { java.net.URL imgURL = StockTable.class.getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.err.println("Couldn't find file: " + path); return null; } } public static void openURL(String url) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class<?> fileMgr = Class.forName("com.apple.eio.FileManager"); Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); openURL.invoke(null, new Object[] {url}); } else if (osName.startsWith("Windows")) { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); } else { //assume Unix or Linux boolean found = false; for (String browser : browsers) if (!found) { found = Runtime.getRuntime().exec( new String[] {"which", browser}).waitFor() == 0; if (found) Runtime.getRuntime().exec(new String[] {browser, url}); } if (!found) throw new Exception(Arrays.toString(browsers)); } } catch (Exception e) { JOptionPane.showMessageDialog(null, "Error attempting to launch web browser\n" + e.toString()); } } int reit = 0; int start = textvars.getStocks().size()-((textvars.getNumberOfStocks()*5)*7)-1; public int columnMulti(int multi) { reit++; start++; if (reit == textvars.getNumberOfStocks()) { reit = 0; start=start+64; } //start = start - (multi*(textvars.getNumberOfStocks())); return start; } /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { //Create and set up the window. JFrame frame = new JFrame("Stock Table"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. StockTable newContentPane = new StockTable(); //newContentPane.setOpaque(true); //content panes must be opaque //frame.setContentPane(newContentPane); frame.setContentPane(newContentPane.createContentPane()); frame.setSize(800, 800); //Display the window. frame.pack(); frame.setVisible(true); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }

    Read the article

  • Google Maps API - Marker not showing

    - by popnbrown
    I'm trying to add markers for every single row from a table, that sits on the page. The page is http://www.sravanks.com/first/2013ftcmap.php This is the JS code that's loading the markers: $(document).ready(function() { var mapOptions = { center: new google.maps.LatLng(39.740, -89.503), zoom: 7 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var infowindow = new google.maps.InfoWindow(); /* City Markers */ var cityCircle = new Array(); var i = 0; $.each($('.events tr'), function(index, value) { var name = $(this).find('td:first()').html(); var address = $(this).find('.address').html(); var linkUrl = "http://www.sravanks.com/first/geocode.php?address=" + address; $.ajax({ url: linkUrl }).done(function(data){ var json = $.parseJSON(data.substring(0, data.length-1)); lat = json.results[0].geometry.location.lat; lng = json.results[0].geometry.location.lng; var latlng = new google.maps.LatLng(lat, lng); var marker = new google.maps.Marker({ position: latlng, map: map, icon: 'map-pointer-medium.gif' }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(name); infowindow.open(map, marker); cityCircle[i] = new google.maps.Circle({strokeColor: '#00FF00', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#00FF00', fillOpacity: 0.35, map: map, center: latlng, radius: 144841}); i++; }); }); }); /*Team Markers*/ var markers = {}; var teamName, teamNumber, lat, lng, content; $.each($('.list tr'), function(index, value) { teamName = $(this).find('td.name').html(); teamNumber = $(this).find('td.number').html(); markers[teamNumber] = {}; lat = parseFloat($(this).find('td.lat').html()); lng = parseFloat($(this).find('td.lng').html()); content = "Name: " + teamName + "<br />Number: " + teamNumber; markers[teamNumber]['latlng'] = new google.maps.LatLng(lat, lng); markers[teamNumber]['marker'] = new google.maps.Marker({ position: markers[teamNumber]['latlng'], map: map }); google.maps.event.addListener(markers[teamNumber]['marker'], 'click', function() { infowindow.setContent(content); infowindow.open(map, markers[teamNumber]['marker']); }); }); google.maps.event.addListener(infowindow, 'closeclick', function() { for(var i=0;i<cityCircle.length;i++){ cityCircle[i].setMap(null); } }); }); I've got no errors, but the Team Markers do not show up. The strange thing is that the City Markers do show up. Some more info, the City Markers ajax call is just to a proxy that calls the google geocoding api. Again the link's at http://www.sravanks.com/first/2013ftcmap.php

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >