Daily Archives

Articles indexed Wednesday May 28 2014

Page 4/18 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Wifi not working on Acer Aspire One D270

    - by Dani
    brand new baby linux user here, never used Ubuntu or any other linux OS before, so be gentle and use short words! I installed Ubuntu 12.04 on my new Acer Aspire One D270-F61C/KF netbook (it's a Japanese computer which had Japanese windows preinstalled, and I decided to take the plunge and try Ubuntu because English Windows costs the earth and stars). Wifi isn't working; I enter my wireless password, it tries to connect for a while, then asks for my password again. And KEEPS ASKING, every few minutes. Wired connection works fine. Wireless card is a Broadcom BCM4313; I have the "additional drivers" checked and installed (I tried unchecking and then reinstalling them in case that would help, no joy, and now my home wifi connection isn't showing up in the list of available connections, argh). I've done a lot of googling and I gather there's a lot of issues with Broadcom cards, but some of the answers are for earlier ubuntu builds and many of them are a bit confusing for a new user. I gather I need to try installing some new drivers other than the proprietary ones provided, but I'm having trouble figuring out how that's done. Anyone got some simple, step by step instructions for me? Please bear in mind, TOTAL N00B. (EDIT): OKAY, got it fixed finally; after suggestions on the Ubuntu forums and messing around with drivers, what finally worked was installing Wicd. Not... using Wicd, for some reason, just installing it fixed it. ...I CHOOSE NOT TO QUESTION IT.

    Read the article

  • wayfinder, paginator, or breadcrumb?

    - by LOTUSMS
    My question is fairly simple. I've heard one or two people call it a "wayfinder" and I personally call it "breadcrumb", then again "paginator" can also fit the bill. Bottom line is I can't seem to find what I need because I am not coming up with the right term. What I want is the following: I have a site with a multiple-pages form. I want my users to see the steps through the form. I searched for all three terms and nothing I can use has shown. I could build one from scratch but I am interested in what is out there. Someone may have done a better job than I will be doing. Any idea on what to call this and if you have a link I can check out, that will be bonus Thanks

    Read the article

  • Licensing a website's code [on hold]

    - by RosiePea
    I just changed to a new contract that I want to use with all my future clients. I love this contract. It's in plain English, very readable, very understandable. It has this statement regarding ownership of the website after it's been paid for: After any outstanding balance for the project is paid, we will assign to you all copyrights in the graphical and visual elements of the design that we will create under the scope of this project. However, we will retain the copyright to all coding elements, but will provide you with a license for you to use these elements in the deliverables of this project. What is this license of which it speaks? I understand the concept: I maintain all rights to my code but allow them to use it in this particular website. That part's new in this contract, and I like it a lot. But now... what? I have to come up with a license to hand the client when the website is paid for. But which license? And do I physically (or electronically) give them something, a document kind of like the contract itself? I've been reading all about licenses all day today and I'm no closer to answering this question. Any words of advice out there?

    Read the article

  • Where to place php libraries/extensions?

    - by gdaniel
    I am new to a lot of server configurations and options. I want to add extra php libraries/extensions to my server. Where do I add them? (I am on a CENTOS 6.5 VPS) For example, I want to add the phpseclib php extension: Their website instructions are minimum: Usage This library is written using the same conventions that libraries in the PHP Extension and Application Repository (PEAR) used to be written in (current requirements break PHP4 compatibility). In particular, this library needs to be in your include_path: <?php set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib'); include('Net/SSH2.php'); ?> It tells me how to use it, but it doesn't tell me where to add the actual extension files. Should I added it under? usr/local/lib ? usr/local/lib/php ? usr/local/lib/php/pear ? Or can I add it under public_html? Also, my VPS has several users under /home/.. is that away to make the library available for only one user?

    Read the article

  • Is there any way to simulate a slow connection between my server and an iPad (without installing anything on the server)?

    - by Clay Nichols
    Some of our webapp users have difficulty on slower connections. I"m trying to get a better idea of what that "speed barrier is" so I'd like to be able to test a variety of connection speeds. I've found ways to do this on Windows but no on the iPad, so I'm looking more for some sort of proxy service that'll work with any device (not running ON that device) I did find an article about using the CharlesProxy and providing a connection to another device, but I was hoping for something simpler (need not be free) Constraints * We are on a shared server so we can't install anything and we are limited in our control over that server. * I'd like to test an iPad, Android Tablet, Windows PC.

    Read the article

  • Is mixing 'Adsense' banners and content okay on a Pinterest style layout?

    - by Theodores
    I was under the impression that Google likes to have their adverts clearly separated out from content so that people don't accidentally click on the adverts thinking they are articles. For a 'pinterest' style layout where you only see the one page and a few pop ups over that one page, you could mix in the adverts with the content, as demonstrated with the two adverts slap in the middle on this site: Clearly this can be done and it exists in the wild, with Google adverts being supplied to the site. However, is that against the spirit and/or the letter of what one signs up to with Adsense?

    Read the article

  • DNS - domain conflict?

    - by Stefanos.Ioannou
    I was given two domains: domain.com & domain.info (they are on GoDaddy). And I was also given two servers, 107.105.38.99 - Rails app and 107.107.90.17 - Wordpress platform, on Digital Ocean. At first, I was instructed to associate domain.com with the 107.107.38.99 (Rails app). Then I was instructed to de-associate this IP with domain.com and associated the 107.107.90.17 with the domain name domain.com. Then I was instructed to associated domain.info with the 107.107.38.99 (Rails app). Right now, when I go to domain.com the WordPress platform (107.107.90.17) loads fine and that is what is expected. But when I go to domain.info for the Rails app (107.107.38.99) I get redirected to domain.com. This is not expected and this is really weird for me. When I ping domain.info I get this: PING domain.info (107.107.38.99): 56 data bytes 64 bytes from 107.107.38.99: icmp_seq=0 ttl=50 time=74.601 ms Which is the expected result showing the correct IP but I don't understand why I get redirected to domain.com...(which when I ping is:) domain 64 bytes from 107.107.90.17: icmp_seq=0 ttl=50 time=75.057 ms The PTR Records on Digital Ocean are as follows: IP Address PTR Record 107.107.38.99 domain.info. 107.107.90.17 domain.com. and the DNS configurations on Digital Ocean are: domain.com A: @ 107.107.90.17 CNAME: * @ domain.info A: @ 107.107.38.99 CNAME: * @ I am not sure what the issue is, if you have any clue please let me know, I will be really grateful. If you need any other info let me know.

    Read the article

  • How do I redirect a FQDN to an internal URL?

    - by Dave
    We have internal DNS servers where we've registered a FQDN that resolves internally to identityreg.domain.com. We also have an existing web page at https://iamserver.domain.com/product/default.asp?Workflow=process1. We need our users to be redirected to the existing web page URL whenever they type identityreg.domain.com. We're using IIS for the web server. I'm a newbie here so forgive any misuse of terms. How do I get the FQDN to redirect to the URL?

    Read the article

  • MMO Web game mouse vs wasd

    - by LazyProgrammer
    If considering to develop a web browser based game with multiple people and it's an RPG, click to move would probably be the only choice in movement right? Because if you were to use WASD and then ajax to the server every second that a player held on to the WASD key, that'd be pretty resource intensive if the server had to calculate the position and return the map image, assuming the next few screens are already buffered right? or is there a way to implement a WASD style and still have server side do all the calculations. (server side calculations to avoid cheating)

    Read the article

  • I want to begin in this world, where can i meet information,help and people to start? [on hold]

    - by SYNOXYS
    So like the question says, I really want to begin to create something,or help creating something. I mess around with some 2d and 3d softwares like unity,gamemaker,UE... and tried to modelate (maya,3dmax),I use them a little,nothing professional, but all i've got is the sensation that i can't go really far. I feel like i am learning really slow, even having the will and some basics knows. But I want to change that, i want to really learn, to progress. I think that a good idea is meeting people like me, and start a non-commercial project or something. Thanks for your time,really. Greetings, SYNOXYS.

    Read the article

  • Camera Shake in Unreal Engine 4?

    - by The415
    Just to be straightforward, I am completely new to many aspects of coding and am searching for different specs and guidelines to aid me on my journey to crafting a wonderful game in Epic Games' Unreal Engine 4. I was wanting to know how to implement a third-person camera shake into my game, for use of the player sprinting, or crouching, etc. All I need is some tips on setting it up. I can figure the rest out.

    Read the article

  • Most efficient way to implement delta time

    - by Starkers
    Here's one way to implement delta time: /// init /// var duration = 5000, currentTime = Date.now(); // and create cube, scene, camera ect ////// function animate() { /// determine delta /// var now = Date.now(), deltat = now - currentTime, currentTime = now, scalar = deltat / duration, angle = (Math.PI * 2) * scalar; ////// /// animate /// cube.rotation.y += angle; ////// /// update /// requestAnimationFrame(render); ////// } Could someone confirm I know how it works? Here what I think is going on: Firstly, we set duration at 5000, which how long the loop will take to complete in an ideal world. With a computer that is slow/busy, let's say the animation loop takes twice as long as it should, so 10000: When this happens, the scalar is set to 2.0: scalar = deltat / duration scalar = 10000 / 5000 scalar = 2.0 We now times all animation by twice as much: angle = (Math.PI * 2) * scalar; angle = (Math.PI * 2) * 2.0; angle = (Math.PI * 4) // which is 2 rotations When we do this, the cube rotation will appear to 'jump', but this is good because the animation remains real-time. With a computer that is going too quickly, let's say the animation loop takes half as long as it should, so 2500: When this happens, the scalar is set to 0.5: scalar = deltat / duration scalar = 2500 / 5000 scalar = 0.5 We now times all animation by a half: angle = (Math.PI * 2) * scalar; angle = (Math.PI * 2) * 0.5; angle = (Math.PI * 1) // which is half a rotation When we do this, the cube won't jump at all, and the animation remains real time, and doesn't speed up. However, would I be right in thinking this doesn't alter how hard the computer is working? I mean it still goes through the loop as fast as it can, and it still has render the whole scene, just with different smaller angles! So this a bad way to implement delta time, right? Now let's pretend the computer is taking exactly as long as it should, so 5000: When this happens, the scalar is set to 1.0: angle = (Math.PI * 2) * scalar; angle = (Math.PI * 2) * 1; angle = (Math.PI * 2) // which is 1 rotation When we do this, everything is timsed by 1, so nothing is changed. We'd get the same result if we weren't using delta time at all! My questions are as follows Mostly importantly, have I got the right end of the stick here? How do we know to set the duration to 5000 ? Or can it be any number? I'm a bit vague about the "computer going too quickly". Is there a way loop less often rather than reduce the animation steps? Seems like a better idea. Using this method, do all of our animations need to be timesed by the scalar? Do we have to hunt down every last one and times it? Is this the best way to implement delta time? I think not, due to the fact the computer can go nuts and all we do is divide each animation step and because we need to hunt down every step and times it by the scalar. Not a very nice DSL, as it were. So what is the best way to implement delta time? Below is one way that I do not really get but may be a better way to implement delta time. Could someone explain please? // Globals INV_MAX_FPS = 1 / 60; frameDelta = 0; clock = new THREE.Clock(); // In the animation loop (the requestAnimationFrame callback)… frameDelta += clock.getDelta(); // API: "Get the seconds passed since the last call to this method." while (frameDelta >= INV_MAX_FPS) { update(INV_MAX_FPS); // calculate physics frameDelta -= INV_MAX_FPS; } How I think this works: Firstly we set INV_MAX_FPS to 0.01666666666 How we will use this number number does not jump out at me. We then intialize a frameDelta which stores how long the last loop took to run. Come the first loop frameDelta is not greater than INV_MAX_FPS so the loop is not run (0 = 0.01666666666). So nothing happens. Now I really don't know what would cause this to happen, but let's pretend that the loop we just went through took 2 seconds to complete: We set frameDelta to 2: frameDelta += clock.getDelta(); frameDelta += 2.00 Now we run an animation thanks to update(0.01666666666). Again what is relevance of 0.01666666666?? And then we take away 0.01666666666 from the frameDelta: frameDelta -= INV_MAX_FPS; frameDelta = frameDelta - INV_MAX_FPS; frameDelta = 2 - 0.01666666666 frameDelta = 1.98333333334 So let's go into the second loop. Let's say it took 2(? Why not 2? Or 12? I am a bit confused): frameDelta += clock.getDelta(); frameDelta = frameDelta + clock.getDelta(); frameDelta = 1.98333333334 + 2 frameDelta = 3.98333333334 This time we enter the while loop because 3.98333333334 = 0.01666666666 We run update We take away 0.01666666666 from frameDelta again: frameDelta -= INV_MAX_FPS; frameDelta = frameDelta - INV_MAX_FPS; frameDelta = 3.98333333334 - 0.01666666666 frameDelta = 3.96666666668 Now let's pretend the loop is super quick and runs in just 0.1 seconds and continues to do this. (Because the computer isn't busy any more). Basically, the update function will be run, and every loop we take away 0.01666666666 from the frameDelta untill the frameDelta is less than 0.01666666666. And then nothing happens until the computer runs slowly again? Could someone shed some light please? Does the update() update the scalar or something like that and we still have to times everything by the scalar like in the first example?

    Read the article

  • Frameskipping in Android gameloop causing choppy sprites (Open GL ES 2.0)

    - by user22241
    I have written a simple 2d platform game for Android and am wondering how one deals with frame-skipping? Are there any alternatives? Let me explain further. So, my game loop allows for the rendering to be skipped if game updates and rendering do not fit into my fixed time-slice (16.667ms). This allows my game to run at identically perceived speeds on different devices. And this works great, things do run at the same speed. However, when the gameloop skips a render call for even one frame, the sprite glitches. And thinking about it, why wouldn't it? You're seeing a sprite move say, an average of 10 pixels every 1.6 seconds, then suddenly, there is a pause of 3.2ms, and the sprite then appears to jump 20 pixels. When this happens 3 or 4 times in close succession, the result is very ugly and not something I want in my game. Therfore, my question is how does one deal with these 'pauses' and 'jumps' - I've read every article on game loops I can find (see below) and my loops are even based off of code from these articles. The articles specifically mention frame skipping but they don't make any reference to how to deal with visual glitches that result from it. I've attempted various game-loops. My loop must have a mechanism in-place to allow rendering to be skipped to keep game-speed constant across multiple devices (or alternative, if one exists) I've tried interpolation but this doesn't eliminate this specific problem (although it looks like it may mitigate the issue slightly as when it eventually draws the sprite it 'moves it back' between the old and current positions so the 'jump' isn't so big. I've also tried a form of extrapolation which does seem to keep things smooth considerably, but I find it to be next to completely useless because it plays havoc with my collision detection (even when drawing with a 'display only' coordinate - see extrapolation-breaks-collision-detection) I've tried a loop that uses Thread.sleep when drawing / updating completes with time left over, no frame skipping in this one, again fairly smooth, but runs differently on different devices so no good. And I've tried spawning my own, third thread for logic updates, but this, was extremely messy to deal with and the performance really wasn't good. (upon reading tons of forums, most people seem to agree a 2 thread loops ( so UI and GL threads) is safer / easier). Now if I remove frame skipping, then all seems to run nice and smooth, with or without inter/extrapolation. However, this isn't an option because the game then runs at different speeds on different devices as it falls behind from not being able to render fast enough. I'm running logic at 60 Ticks per second and rendering as fast as I can. I've read, as far as I can see every article out there, I've tried the loops from My Secret Garden and Fix your timestep. I've also read: Against the grain deWITTERS Game Loop Plus various other articles on Game-loops. A lot of the others are derived from the above articles or just copied word for word. These are all great, but they don't touch on the issues I'm experiencing. I really have tried everything I can think of over the course of a year to eliminate these glitches to no avail, so any and all help would be appreciated. A couple of examples of my game loops (Code follows): From My Secret Room public void onDrawFrame(GL10 gl) { //Rre-set loop back to 0 to start counting again loops=0; while(System.currentTimeMillis() > nextGameTick && loops < maxFrameskip) { SceneManager.getInstance().getCurrentScene().updateLogic(); nextGameTick += skipTicks; timeCorrection += (1000d / ticksPerSecond) % 1; nextGameTick += timeCorrection; timeCorrection %= 1; loops++; } extrapolation = (float)(System.currentTimeMillis() + skipTicks - nextGameTick) / (float)skipTicks; render(extrapolation); } And from Fix your timestep double t = 0.0; double dt2 = 0.01; double currentTime = System.currentTimeMillis()*0.001; double accumulator = 0.0; double newTime; double frameTime; @Override public void onDrawFrame(GL10 gl) { newTime = System.currentTimeMillis()*0.001; frameTime = newTime - currentTime; if ( frameTime > (dt*5)) //Allow 5 'skips' frameTime = (dt*5); currentTime = newTime; accumulator += frameTime; while ( accumulator >= dt ) { SceneManager.getInstance().getCurrentScene().updateLogic(); previousState = currentState; accumulator -= dt; } interpolation = (float) (accumulator / dt); render(interpolation); }

    Read the article

  • How do I calculate the motion of 2 massive bodies in space?

    - by 1224
    I'm writing code simulating the 2-dimensional motion of two massive bodies with gravitational fields. The bodies' masses are known and I have a gravitational force equation. I know from that force I can get a differential equation for coordinates. I know that I once I solve this equation I will get the coordinates. I will need to make up some initial position and some initial velocity. I'd like to end up with a numeric solver for the ordinal differential equation for coordinates to get the formulas that I can write in code. Could someone break down how from laws and initial conditions we get to the formulas that calculate x and y at time t?

    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

  • How to texture voxel terrain without triplanar texturing?

    - by Thelvyn
    How can a voxel terrain (marching cubes) be textured without triplanar mapping ? The goal being to have more artistic freedom. I think, I could unwrap the mesh while extracting the isosurface then use projective painting. But I do not know how to handle terrain modifications without breaking the texture. I also guess that virtual texturing could help here. Links for these matters would be appreciated.

    Read the article

  • Collision detection with heightmap based terrain

    - by Truman's world
    I am developing a 2D tank game. The terrain is generated by Midpoint Displacement Algorithm, so the terrain is represented by an array: index ---> height of terrain [0] ---> 5 [1] ---> 8 [2] ---> 4 [3] ---> 6 [4] ---> 8 [5] ---> 9 ... ... The rendered mountain looks like this: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0 1 2 3 4 5 ... I want tanks to be able to move smoothly on the terrain (I mean tanks can rotate according to the height when they move), but the surface of the terrain is not flat, it is polygonal. Can anyone give me some help with collision detection in this situation? Thanks in advance.

    Read the article

  • Optimal Compression for Speech

    - by ashes999
    I'm designing a game that depends heavily on audio; I will have some 300+ speech files (most of them just a word or two long). This can very quickly escalate the size of my final game. What's the optimal way to encode/compress speech files to keep the size minimal without getting audio artifacts? Please address both per-file compression/encoding, and also zipping/compressing the set of all speech files together in your answer. Because I'm not sure which (or combination of both) factors will give me the best results. Edit: I need this to run in Silverlight and Android, so I'm presumably stuck with only MP3 as my option (other than uncompressed wave files).

    Read the article

  • Paypal development. encrypt transactions. php p12

    - by ninchen
    when i take a look at the paypal documentation, they say "Note that the PayPal SDK for PHP does not require SSL encryption". https://developer.paypal.com/docs/classic/api/apiCredentials/#encrypting-your-certificate Is the statement of this phrase, that i don't have to create a p12 certificate when working with php, but use the public_key.pem and paypal_public_key.pem? If yes: Is it secure enough to create the encrypted form input elements without p12 certificate? If no: What do they mean? :-) Before this question came up, i've tested this little programm. http://www.softarea51.com/blog/how-to-integrate-your-custom-shopping-cart-with-paypal-website-payments-standard-using-php/ There is a config file paypal-wps-config.inc.php where i can define the paths to my certificates. // tryed to use // 'paypal_cert.p12 '; $config['private_key_path'] = '/home/folder/.cert/pp/prvkey.pem'; // must match the one you set when you created the private key $config['private_key_password'] = ''; //'my_password'; When i try to use the p12 certificate, openssl_error_string() returns "Could not sign data: error:0906D06C:PEM routines:PEM_read_bio:no start line openssl_pkcs7_sign When i instead use the prvkey.pem without password all works fine. Here is the function, which signs and encrypt the data. function signAndEncrypt($dataStr_, $ewpCertPath_, $ewpPrivateKeyPath_, $ewpPrivateKeyPwd_, $paypalCertPath_) { $dataStrFile = realpath(tempnam('/tmp', 'pp_')); $fd = fopen($dataStrFile, 'w'); if(!$fd) { $error = "Could not open temporary file $dataStrFile."; return array("status" => false, "error_msg" => $error, "error_no" => 0); } fwrite($fd, $dataStr_); fclose($fd); $signedDataFile = realpath(tempnam('/tmp', 'pp_')); **// here the error came from** if(!@openssl_pkcs7_sign( $dataStrFile, $signedDataFile, "file://$ewpCertPath_", array("file://$ewpPrivateKeyPath_", $ewpPrivateKeyPwd_), array(), PKCS7_BINARY)) { unlink($dataStrFile); unlink($signedDataFile); $error = "Could not sign data: ".openssl_error_string(); return array("status" => false, "error_msg" => $error, "error_no" => 0); } unlink($dataStrFile); $signedData = file_get_contents($signedDataFile); $signedDataArray = explode("\n\n", $signedData); $signedData = $signedDataArray[1]; $signedData = base64_decode($signedData); unlink($signedDataFile); $decodedSignedDataFile = realpath(tempnam('/tmp', 'pp_')); $fd = fopen($decodedSignedDataFile, 'w'); if(!$fd) { $error = "Could not open temporary file $decodedSignedDataFile."; return array("status" => false, "error_msg" => $error, "error_no" => 0); } fwrite($fd, $signedData); fclose($fd); $encryptedDataFile = realpath(tempnam('/tmp', 'pp_')); if(!@openssl_pkcs7_encrypt( $decodedSignedDataFile, $encryptedDataFile, file_get_contents($paypalCertPath_), array(), PKCS7_BINARY)) { unlink($decodedSignedDataFile); unlink($encryptedDataFile); $error = "Could not encrypt data: ".openssl_error_string(); return array("status" => false, "error_msg" => $error, "error_no" => 0); } unlink($decodedSignedDataFile); $encryptedData = file_get_contents($encryptedDataFile); if(!$encryptedData) { $error = "Encryption and signature of data failed."; return array("status" => false, "error_msg" => $error, "error_no" => 0); } unlink($encryptedDataFile); $encryptedDataArray = explode("\n\n", $encryptedData); $encryptedData = trim(str_replace("\n", '', $encryptedDataArray[1])); return array("status" => true, "encryptedData" => $encryptedData); } // signAndEncrypt } // PPCrypto The main questions: 1. Is it possible to use p12 cert with php, or is it secure enough to work without it? 2. Why i become an error when using openssl_pkcs7_sign Please help. Greetings ninchen

    Read the article

  • Callback function and function pointer trouble in C++ for a BST

    - by Brendon C.
    I have to create a binary search tree which is templated and can deal with any data types, including abstract data types like objects. Since it is unknown what types of data an object might have and which data is going to be compared, the client side must create a comparison function and also a print function (because also not sure which data has to be printed). I have edited some C code which I was directed to and tried to template, but I cannot figure out how to configure the client display function. I suspect variable 'tree_node' of class BinarySearchTree has to be passed in, but I am not sure how to do this. For this program I'm creating an integer binary search tree and reading data from a file. Any help on the code or the problem would be greatly appreciated :) Main.cpp #include "BinarySearchTreeTemplated.h" #include <iostream> #include <fstream> #include <string> using namespace std; /*Comparison function*/ int cmp_fn(void *data1, void *data2) { if (*((int*)data1) > *((int*)data2)) return 1; else if (*((int*)data1) < *((int*)data2)) return -1; else return 0; } static void displayNode() //<--------NEED HELP HERE { if (node) cout << " " << *((int)node->data) } int main() { ifstream infile("rinput.txt"); BinarySearchTree<int> tree; while (true) { int tmp1; infile >> tmp1; if (infile.eof()) break; tree.insertRoot(tmp1); } return 0; } BinarySearchTree.h (a bit too big to format here) http://pastebin.com/4kSVrPhm

    Read the article

  • IntelliJ IDEA non standard caret behaviour

    - by Vaat666
    I have an issue with IntelliJ IDEA when selecting a big amount of text, and I cannot find the parameter to set to change that. Here is an example of the situation: My caret is on line 3 I scroll with the mouse wheel towards line 300 I press ctrl + shift I press the left button of the mouse Such an action would result in the text from line 3 to 300 being selected in all common editors (even in MS-Word I think), but not in IntelliJ. Do you know how to set this right? Thanks!

    Read the article

  • How do I delete files in a class?

    - by user3682906
    I want to have a CRUD management on my gallery but I have no idea how. I have searched the internet but I did not find what I was looking for. This is my class: class Gallery { public function renderImages($map) { $images = ""; foreach (glob($map ."*.{jpeg,jpg,png,gif}", GLOB_BRACE) as $image){ $images .= "<a href='".$image."' data-lightbox='afbeelding'><img src='".$image."' class='thumbnail'></img></a>"; } return $images; } } and this is my gallery: <div class="gallery"> <center> <a href="index.php">Back:</a> <style> body { margin:0; padding:0; background:#efefef; font-family: "Helvetica Neue", helvetica, arial, sans-serif; color: black; text-align:center; /* used to center div in IE */ } </style> <?php $gallery = new Gallery(); echo $gallery -> renderImages("../images/"); $connection = new DatabaseConnection(); $render = new RenderData(); $page = 1; if(isset($_GET['page'])) { $check = new CheckData(); if($check->PageCheck($_GET['page'])) { $page = $_GET['page']; } } ?> <table> <div id="Intro"> <tr> <td>Hieronder kan je uploaden.</td> </tr> </div> <tr> <td>Max. 500000000Bytes</td> </tr> <tr> <form action="pages/upload_file.php" method="post" enctype="multipart/form-data"> <td><label for="file">Filename:</label></td> </tr> <tr> <td><input type="file" name="file" id="file"></td> </tr> <tr> <td><input type="submit" name="submit" value="Submit"></td> </tr> <tr> <td><input type="submit" name="delete" value="Delete"></td> </tr> </form> </table> How do I make a CRUD management on this? I want to select the photo and then delete it from my computer. I hope you guys can help me out...

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

  • Putting li's into rows

    - by panthro
    I have a long list of li's. <ul> <li> <img src="test.jpg"> </li> <li> <img src="test.jpg"> </li> //etc Each li has this styling: width: 10%; display: inline-block; vertical-align: middle; When I get to more than 10 li's in a row, they go on to the next row. Is this the correct way to do it? or should I wrap each 10 li's into something that breaks the line? What the best/correct method? i intialy chose this method as it would be easily to loop out data from a database.

    Read the article

  • mvc - how to avoid log out when refresh a page

    - by user235973457
    I have built the MVC application with WCF service. The major problem I have experienced with refreshing page. I have created a login page with session (username and password). But when you refresh the home page by pressing F5, it would automatically log out. That is my problem. I need to stay the home page after refresh. I have been googling around to find a solution but it seems not helpful. Any idea? Your advise or code example much appreciated.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >