Daily Archives

Articles indexed Thursday June 12 2014

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Can inbound links through template-based layouts result in penalties?

    - by Liam Sorsby
    So obviously link building is encouraged as long as it is natural, organic and has meaningful links with content relevant to your site. Obviously with the constant release of new updates to algorithms, Google is flagging sites for unnatural links to their sites. My Question is: Can this be caused by templating systems? With WordPress for example, where you can add a link on the footer and it is repeated throughout the entire website generating thousands of links? If we don't add any links, Good Content will be re-posted and linked to, surely if your content is constantly linked to this will flag your site for "unnatural" content as it's difficult to see if someone has been paid to write an article on your content. Or does Google just simply want us to audit some of the links to show we are making an effort? As you can tell we have had a Manual action for: Unnatural links to your site—impacts links. However, this seems to impact our website as well. Edit: To clarify the question: Can you get penalised for paying for advertising on a site that uses a templated sidebar. So when they create a new blog/page ect your link is also added onto the page hence resulting in 1000's of links to one page on our site. I know that one effect maybe a 0 pagerank web page linking to your page dilutes the PR of our page. However the links are only inbound not reciprocal

    Read the article

  • How to prevent a specific website from linking to our domain?

    - by Edward
    We have a landing page which is used only for running an ad campaign. There is a website that has found this link somehow and is linking to it. I've been told by marketing they don't want that website linking to the landing page. How can I prevent a specific website from linking to our domain? I don't want to block all websites from linking to it, just this specific one. Is there solution something to do with .htaccess? If so, please provide an example of doing this or a link to example because I've been unable to find one.

    Read the article

  • Does the user agent in any regular browser contain 'bot' or 'crawl'?

    - by Echo
    Does the user agent in any regular browser contain 'bot' or 'crawl'? I check the user agent on my site to see if it is coming from a bot or not. If it is, I can do some little optimizations since they don't login. (I don't change the content at all) After adding checks for 30-40+ bots, I'm getting tired of added them. So I was wondering if checking if it just contains 'bot' or 'crawl'. I know that wont get all bots, but it would get a lot of them. But if that could cause any false positives, then it would totally mess up the ability to add to cart, place an order, and login in.

    Read the article

  • Anisotropic and trilinear filtering?

    - by fedab
    I'm confused about the usage of trilinear filtering and anisotropic filtering in SharpDX. As far as i understood, trilinear filtering does linear filtering to the textures and in a case of LOD-change it also interpolates between the too LODs to smooth the transition. Anisotropic filtering make the texture bigger. Now it is possible to use trilinear filtering to do the same thing, due to anisotropic filtering with bigger textures. This causes a lesser blurred image, when you use anisotropy, because the interpolation is better. Now, it should be possible to use trilinear filtering and anisotropic filtering at the same time. But in the SamplerState i can only choose Filter.Anisotropy or Filter.MinMagMipLinear (should be trilinear, right?). You can see all possible filters here: D3D11 Filter Enumeration. So my question: Can you use both techniques together, if yes, how can i archieve that in SharpDX with SamplerState?

    Read the article

  • How can i get latency when using Game Center?

    - by Freddy
    I'm pretty new to network programming. Basically I'm using game center for making a relatively simple iPhone game using Game-center p2p. However i'm now working on a algorithm to improve the multiplayer performance. But, I need to know how long it took for a package to travel from one device to the another device (latency) for the algorithm to work good. As for now, I have solved the problem by sending a double with time interval since 1970 in the package and then I compare it with the time at the other device. However I have heard that the NSDate methods is connected to the internet, which also will cause latency so the time interval would not be perfectly correct. What is the ideal way to check for how long it take for a package to be sent?

    Read the article

  • Libgdx change color of Texture at runtime [on hold]

    - by Springrbua
    i allready asked this on Stackoverflow, but i think this question may belong here. In a Libgdx game i have some Animations for my Player. All the Frames for this Animation are inside a TextureAtlas. The Player Textures show a human, with a white T-Shirt. The T-Shirt is the only white part of the Player. Now i want to be able to replace the white color with red for Player1, with green for Player2 and so on. How can i do that, without loosing the advantage of the TextureAtlas (Texture switching)? Ofc 1 way would be to store 4 versions of every Frame, for 4 different Players (colors). But there are games out there, where you can fully customize the Player, give him a blue hat, red pants and pink shirts and so on. How can this be done? Thanks a lot! EDIT: The question on Stackoverflow

    Read the article

  • Render on other render targets starting from one already rendered on

    - by JTulip
    I have to perform a double pass convolution on a texture that is actually the color attachment of another render target, and store it in the color attachment of ANOTHER render target. This must be done multiple time, but using the same texture as starting point What I do now is (a bit abstracted, but what I have abstract is guaranteed to work singularly) renderOnRT(firstTarget); // This is working. for each other RT currRT{ glBindFramebuffer(GL_FRAMEBUFFER, currRT.frameBufferID); programX.use(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, firstTarget.colorAttachmentID); programX.setUniform1i("colourTexture",0); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, firstTarget.depthAttachmentID); programX.setUniform1i("depthTexture",1); glBindBuffer(GL_ARRAY_BUFFER, quadBuffID); // quadBuffID is a VBO for a screen aligned quad. It is fine. programX.vertexAttribPointer(POSITION_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); glDrawArrays(GL_QUADS,0,4); programY.use(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, currRT.colorAttachmentID); // The second pass is done on the previous pass programY.setUniform1i("colourTexture",0); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, currRT.depthAttachmentID); programY.setUniform1i("depthTexture",1); glBindBuffer(GL_ARRAY_BUFFER, quadBuffID); programY.vertexAttribPointer(POSITION_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); glDrawArrays(GL_QUADS, 0, 4); } The problem is that I end up with black textures and not the wanted result. The GLSL programs program(X,Y) works fine, already tested on single targets. Is there something stupid I am missing? Even an hint is much appreciated, thanks!

    Read the article

  • Rendering only a part of the screen in high detail

    - by Bart van Heukelom
    If graphics are rendered for a large viewing angle (e.g. a very large TV or a VR headset), the viewer can't actually focus on the entire image, just a part of it. (Actually, this is the case for regular sized screens as well.) Combined with a way to track the viewer's eyes, you could theoretically exploit this and render the graphics away from the viewer's focus with progressively less details and resolution, gaining performance, without losing perceived quality. Are there any techniques for this available or under development today?

    Read the article

  • Player & Level class structure in 2D python console game?

    - by Markus Meskanen
    I'm trying to create a 2D console game, where I have a player who can freely move around in a level (~map, but map is a reserved keyword) and interfere with other objects. Levels construct out of multiple Blocks, such as player(s), rocks, etc. Here's the Block class: class Block(object): def __init__(self, x=0, y=0, char=' ', solid=False): self.x = x self.y = y self.char = char self.solid = solid As you see, each block has a position (x, y) and a character to represent the block when it's printed. Each block also has a solid attribute, defining whether it can overlap with other solids or not. (Two solid blocks cannot overlap) I've now created few subclasses from Block (Rock might be useless for now) class Rock(Block): def __init__(self, x=0, y=0): super(Rock, self).__init__(x, y, 'x', True) class Player(Block): def __init__(self, x=0, y=0): super(Player, self).__init__(x, y, 'i', True) def move_left(self, x=1): ... # How do I make sure Player wont overlap with rocks? self.x -= x And here's the Level class: class Level(object): def __init__(self, name='', blocks=None): self.name = name self.blocks = blocks or [] Only way I can think of is to store a Player instance into Level's attributes (self.player=Player(), or so) and then give Level a method: def player_move_left(self): for block in self.blocks: if block.x == self.player.x - 1 and block.solid: return False But this doesn't really make any sense, why have a Player class if it can't even be moved without Level? Imo. player should be moved by a method inside Player. Am I wrong at something here, if not, how could I implement such behavior?

    Read the article

  • Collision detection via adjacent tiles - sprite too big

    - by BlackMamba
    I have managed to create a collision detection system for my tile-based jump'n'run game (written in C++/SFML), where I check on each update what values the surrounding tiles of the player contain and then I let the player move accordingly (i. e. move left when there is an obstacle on the right side). This works fine when the player sprite is not too big: Given a tile size of 5x5 pixels, my solution worked quite fine with a spritesize of 3x4 and 5x5 pixels. My problem is that I actually need the player to be quite gigantic (34x70 pixels given the same tilesize). When I try this, there seems to be an invisible, notably smaller boundingbox where the player collides with obstacles, the player also seems to shake strongly. Here some images to explain what I mean: Works: http://tinypic.com/r/207lvfr/8 Doesn't work: http://tinypic.com/r/2yuk02q/8 Another example of non-functioning: http://tinypic.com/r/kexbwl/8 (the player isn't falling, he stays there in the corner) My code for getting the surrounding tiles looks like this (I removed some parts to make it better readable): std::vector<std::map<std::string, int> > Game::getSurroundingTiles(sf::Vector2f position) { // converting the pixel coordinates to tilemap coordinates sf::Vector2u pPos(static_cast<int>(position.x/tileSize.x), static_cast<int>(position.y/tileSize.y)); std::vector<std::map<std::string, int> > surroundingTiles; for(int i = 0; i < 9; ++i) { // calculating the relative position of the surrounding tile(s) int c = i % 3; int r = static_cast<int>(i/3); // we subtract 1 to place the player in the middle of the 3x3 grid sf::Vector2u tilePos(pPos.x + (c - 1), pPos.y + (r - 1)); // this tells us what kind of block this tile is int tGid = levelMap[tilePos.y][tilePos.x]; // converts the coords from tile to world coords sf::Vector2u tileRect(tilePos.x*5, tilePos.y*5); // storing all the information std::map<std::string, int> tileDict; tileDict.insert(std::make_pair("gid", tGid)); tileDict.insert(std::make_pair("x", tileRect.x)); tileDict.insert(std::make_pair("y", tileRect.y)); // adding the stored information to our vector surroundingTiles.push_back(tileDict); } // I organise the map so that it is arranged like the following: /* * 4 | 1 | 5 * -- -- -- * 2 | / | 3 * -- -- -- * 6 | 0 | 7 * */ return surroundingTiles; } I then check in a loop through the surrounding tiles, if there is a 1 as gid (indicates obstacle) and then check for intersections with that adjacent tile. The problem I just can't overcome is that I think that I need to store the values of all the adjacent tiles and then check for them. How? And may there be a better solution? Any help is appreciated. P.S.: My implementation derives from this blog entry, I mostly just translated it from Objective-C/Cocos2d.

    Read the article

  • Simple Java networking game engine [on hold]

    - by Florian Peschka
    I want to create a simple java networking game and search a networking engine that eases use of sockets etc. I have already read some questions on here and the internet about java networking for games, but many of them were over 10 years old or not really answered. I have no idea whatsoever about what exactly I need to send in terms of messages, but I figured simple strings or integers will be enough for my purposes. It's basically a peer to peer game, so I don't need a centralized server structure. Messaging doesn't have to have an extremely low ping, yet of course all players need to have a synchronized view. What are the possibilities I have here?

    Read the article

  • uint64_t has incorrectly reached 18,446,744,071,590,568,320

    - by user3400450
    Whenever I input an age of 65 or less, I get a number somewhere less than 2,100,000. However, when I input an age of 68 or higher, the result is instantly put at 18,446,744,071,590,568,320, which is the maximum value for uint64_t. I have no idea why there is this jump in results. It works fine all the way until about 2,100,000. // How many seconds have I lived? #include <stdio.h> #include <string> #include <cstdint> using namespace std; string addCommas(uint64_t answer); int main () { int seconds = 60, minutes = 60, hours = 24, days = 365; int years; uint64_t secondsLived, secondsAwake; printf("How many years have you lived? "); scanf("%d",&years); secondsLived = seconds*minutes*hours*days*years; secondsAwake = (float)secondsLived*0.666; printf("\nYou have existed for %s seconds\n",addCommas(secondsLived).c_str()); printf("You have been awake for %s seconds\n",addCommas(secondsAwake).c_str()); } string addCommas(uint64_t answer){ string num = to_string(answer); int insertplace = (int)num.length() - 3; while (insertplace > 0) { num.insert(insertplace, ","); insertplace-=3; } return num; } Here are a couple outputs: How many years have you lived? 67 You have existed for 2,112,912,000 seconds You have been awake for 1,407,199,392 seconds How many years have you lived? 69 You have existed for 18,446,744,071,590,568,320 seconds You have been awake for 12,285,531,553,090,562,048 seconds

    Read the article

  • TFS2010 API - Which server event fires when checkin notes are changed?

    - by user3708981
    I've written a TFS plugin that impliments the ISubscribe interface, and creates an external ticket base off of the contents of a check-in note. What I would like to do, if when I go back through older TFS check-ins in VS and edit a check-in note, the plugin would process that event and create an external ticket retroactively. What event / SubscribedType do I need to subscribe to in order for ProcessEvents to fire? My stubbed out code - using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.Common; using Microsoft.TeamFoundation.VersionControl.Client; // From C:\Program Files\Microsoft Team Foundation Server 2010\Tools\ using Microsoft.TeamFoundation.Framework.Server; using Microsoft.TeamFoundation.VersionControl.Server; using Changeset = Microsoft.TeamFoundation.VersionControl.Server.Changeset; public class EmbeddedWorkItemEventHandler : ISubscriber { const string EVENT_NAME = "TicketEvent"; const string APP_LOG = "Application"; public Type[] SubscribedTypes() { return new Type[1] { typeof(CheckinNotification) }; // What else do I need here? } public string Name { get { return EVENT_NAME; } } public SubscriberPriority Priority { get { return SubscriberPriority.Normal; } } public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties) { // Create the event source, if it doesn't exist if (!System.Diagnostics.EventLog.SourceExists(EVENT_NAME)) { System.Diagnostics.EventLog.CreateEventSource(EVENT_NAME, APP_LOG); } statusCode = 0; properties = null; statusMessage = String.Empty; string ErrorLine = ""; try { // Here we'll validate the Ticket name if (notificationType == NotificationType.DecisionPoint && notificationEventArgs is CheckinNotification) { //Check-in blocking logic here. } else if (notificationType == NotificationType.Notification && notificationEventArgs is CheckinNotification) { // Tickets on check-in here. } } Catch { // Error checking } return EventNotificationStatus.ActionPermitted; }

    Read the article

  • HTML5 Form: Page Is Reloading Instantly After Restyling (And It Shouldn't Be)

    - by user3689753
    I have a form. I have made it so that if your name is not put in, a red border is put on the name field. That works, BUT...it's for a split second, and then the page reloads. I want the red border to appear, and then stay there. For some reason it's for a split second. Can someone help me make it so the page doesn't reload after displaying the red border? Here's the script. window.onload = function() { document.getElementById("Hogwarts").onsubmit = function () { window.alert("Form submitted. Owl being sent..."); var fname = document.getElementById("fName"); if(!fName.value.match("^[A-Z][A-Za-z]+( [A-Z][A-Za-z]*)*$")) { window.alert("You must enter your name."); addClass(fName, "errorDisp"); document.getElementById("fName").focus(); } else return true; } } function addClass(element, classToAdd) { var currentClassValue = element.className; if (currentClassValue.indexOf(classToAdd) == -1) { if ((currentClassValue == null) || (currentClassValue === "")) { element.className = classToAdd; } else { element.className += " " + classToAdd; } } } function removeClass(element, classToRemove) { var currentClassValue = element.className; if (currentClassValue == classToRemove) { element.className = ""; return; } var classValues = currentClassValue.split(" "); var filteredList = []; for (var i = 0 ; i < classValues.length; i++) { if (classToRemove != classValues[i]) { filteredList.push(classValues[i]); } } element.className = filteredList.join(" "); } Here's the HTML. <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>Hogwarts School of Witchcraft And Wizardry Application Form</title> <link rel="stylesheet" type="text/css" href="main.css" media="screen"/> <script src="script.js" type="text/javascript"></script> </head> <body> <section> <header> <h1>Hogwarts School of Witchcraft And Wizardry</h1> <nav></nav> </header> <main> <form method="post" id="Hogwarts"> <!--<form action="showform.php" method="post" id="Hogwarts">--!> <fieldset id="aboutMe"> <legend id="aboutMeLeg">About Me</legend> <div class="fieldleading"> <label for="fName" class="labelstyle">First name:</label> <input type="text" id="fName" name="fName" autofocus maxlength="50" value="" placeholder="First Name" size="30"> <label for="lName" class="labelstyle">Last name:</label> <input type="text" id="lName" name="lName" required maxlength="50" value="" placeholder="Last Name" pattern="^[A-Za-z ]{3,}$" size="30"> <label for="age" class="labelstyle">Age:</label> <input type="number" id="age" name="age" required min="17" step="1" max="59" value="" placeholder="Age"> </div> <div class="fieldleading"> <label for="date" class="labelstyle">Date Of Birth:</label> <input type="date" name="date1" id="date" required autofocus value=""> </div> <div id="whitegender"> <div class="fieldleading"> <label class="labelstyle">Gender:</label> </div> <input type="radio" name="sex" value="male" class="gender" required="required">Male<br/> <input type="radio" name="sex" value="female" class="gender" required="required">Female<br/> <input type="radio" name="sex" value="other" class="gender" required="required">Other </div> </fieldset> <fieldset id="contactInfo"> <legend id="contactInfoLeg">Contact Information</legend> <div class="fieldleading"> <label for="street" class="labelstyle">Street Address:</label> <input type="text" id="street" name="street" required autofocus maxlength="50" value="" placeholder="Street Address" pattern="^[0-9A-Za-z\. ]+{5,}$" size="35"> <label for="city" class="labelstyle">City:</label> <input type="text" id="city" name="city" required autofocus maxlength="30" value="" placeholder="City" pattern="^[A-Za-z ]{3,}$" size="35"> <label for="State" class="labelstyle">State:</label> <select required id="State" name="State" > <option value="Select Your State">Select Your State</option> <option value="Delaware">Delaware</option> <option value="Pennsylvania">Pennsylvania</option> <option value="New Jersey">New Jersey</option> <option value="Georgia">Georgia</option> <option value="Connecticut">Connecticut</option> <option value="Massachusetts">Massachusetts</option> <option value="Maryland">Maryland</option> <option value="New Hampshire">New Hampshire</option> <option value="New York">New York</option> <option value="Virginia">Virginia</option> </select> </div> <div class="fieldleading"> <label for="zip" class="labelstyle">5-Digit Zip Code:</label> <input id="zip" name="zip" required autofocus maxlength="5" value="" placeholder="Your Zip Code" pattern="^\d{5}$"> <label for="usrtel" class="labelstyle">10-Digit Telephone Number:</label> <input type="tel" name="usrtel" id="usrtel" required autofocus value="" placeholder="123-456-7890" pattern="^\d{3}[\-]\d{3}[\-]\d{4}$"> </div> <div class="fieldleading"> <label for="email1" class="labelstyle">Email:</label> <input type="email" name="email1" id="email1" required autofocus value="" placeholder="[email protected]" pattern="^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" size="35"> <label for="homepage1" class="labelstyle">Home Page:</label> <input type="url" name="homepage1" id="homepage1" required autofocus value="" placeholder="http://www.hp.com" pattern="https?://.+" size="35"> </div> </fieldset> <fieldset id="yourInterests"> <legend id="yourInterestsLeg">Your Interests</legend> <label for="Major" class="labelstyle">Major/Program Choice:</label> <select required id="Major" name="Major" > <option value="">Select Your Major</option> <option value="Magic1">Magic Horticulture</option> <option value="Magic2">Black Magic</option> <option value="White">White Magic</option> <option value="Blue">Blue Magic</option> <option value="Non">Non-Wizardry Studies</option> </select> </fieldset> <button type="submit" value="Submit" class="submitreset">Submit</button> <button type="reset" value="Reset" class="submitreset">Reset</button> </form> </main> <footer> &copy; 2014 Bennett Nestok </footer> </section> </body> </html> Here's the CSS. a:link { text-decoration: none !important; color:black !important; } a:visited { text-decoration: none !important; color:red !important; } a:active { text-decoration: none !important; color:green !important; } a:hover { text-decoration: none !important; color:blue !important; background-color:white !important; } ::-webkit-input-placeholder { color: #ffffff; } /* gray80 */ :-moz-placeholder { color: #ffffff; } /* Firefox 18- (one color)*/ ::-moz-placeholder { color: #ffffff; } /* Firefox 19+ (double colons) */ :-ms-input-placeholder { color: #ffffff; } body { margin: 0px auto; text-align:center; background-color:grey; font-weight:normal; font-size:12px; font-family: verdana; color:black; background-image:url('bgtexture.jpg'); background-repeat:repeat; } footer { text-align:center; margin: 0px auto; bottom:0px; position:absolute; width:100%; color:white; background-color:black; height:20px; padding-top:4px; } h1 { color:white; text-align:center; margin: 0px auto; margin-bottom:50px; width:100%; background-color:black; padding-top: 13px; padding-bottom: 14px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); text-shadow: 0 -1px 1px rgba(0,0,0,0.25); } button.submitreset { -moz-border-radius: 400px; -webkit-border-radius: 400px; border-radius: 400px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); text-shadow: 0 -1px 1px rgba(0,0,0,0.25); } .labelstyle { background-color:#a7a7a7; color:black; -moz-border-radius: 400px; -webkit-border-radius: 400px; border-radius: 400px; padding:3px 3px 3px 3px; } #aboutMe, #contactInfo, #yourInterests { margin-bottom:30px; text-align:left !important; padding: 10px 10px 10px 10px; } #Hogwarts { text-align:center; margin:0px auto; width:780px; padding-top: 20px !important; padding-bottom: 20px !important; background: -webkit-linear-gradient(#474747, grey); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(#474747, grey); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(#474747, grey); /* For Firefox 3.6 to 15 */ background: linear-gradient(#474747, grey); /* Standard syntax */ border-color:black; border-style: solid; border-width: 2px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); text-shadow: 0 -1px 1px rgba(0,0,0,0.25); } @media (max-width: 800px){ .labelstyle { display: none; } #Hogwarts { width:300px; } h1 { width:304px; margin-bottom:0px; } .fieldleading { margin-bottom:0px !important; } ::-webkit-input-label { /* WebKit browsers */ color: transparent; } :-moz-label { /* Mozilla Firefox 4 to 18 */ color: transparent; } ::-moz-label { /* Mozilla Firefox 19+ */ color: transparent; } :-ms-input-label { /* Internet Explorer 10+ */ color: transparent; } ::-webkit-input-placeholder { /* WebKit browsers */ color: grey !important; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: grey !important; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: grey !important; } :-ms-input-placeholder { /* Internet Explorer 10+ */ color: grey !important; } #aboutMe, #contactInfo, #yourInterests { margin-bottom:10px; text-align:left !important; padding: 5px 5px 5px 5px; } } br { display: block; line-height: 10px; } .fieldleading { margin-bottom:10px; } legend { color:white; } #whitegender { color:white; } #moreleading { margin-bottom:10px; } /*opera only hack attempt*/ @media not all and (-webkit-min-device-pixel-ratio:0) { .fieldleading { margin-bottom:30px !important; } } .errorDisp { border-color: red; border-style: solid; border-width: 2px; }

    Read the article

  • gethostname() returns accurate hostname, bind() doesn't like it

    - by user2072848
    Doing a python socket tutorial, entire codebase is as follows import socket as so s = so.socket() host = so.gethostname() port = 12345 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print 'Got connection from', addr c.send('Thank you for connecting') c.close() and error message: Traceback (most recent call last): File "server.py", line 13, in <module> s.bind((host, port)) File "/Users/solid*name*/anaconda/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.gaierror: [Errno 8] nodename nor servname provided, or not known Printing hostname gives me super*name* Which is, in fact, my computer's hostname.

    Read the article

  • Am I right in thinking there is no way to put an if statement and an else statement on line in Python?

    - by Louise
    Am I right in thinking I can't put an if-statement and the corresponding else-statement on one line in Python? NB: variable = value1 if condition else value2 is NOT two statements. It's one statement which can take the value of one of two expressions. I want to do something like if condition a=value else b=value Am I right in thinking this requires a full if-else in Python? Like if condition: a=value else: b=value Thanks, Louise

    Read the article

  • Auto populate input based on file name with AngularJS

    - by LouieV
    I am playing around with AngularJS and have not been able to solve this problem. I have a view that has a form to upload a file to a node server. So far I have manage to do this using some directives and a service. I allow the user to send a custom name to the POST data if they desire. What I wan to accomplish is that when the user selects a file the filename models auto populates. My view looks like: <div> <input file-model="phpFile" type="file"> <input name="filename" type="text" ng-model="filename"> <button ng-click="send()">send</button> </div> file-model is my directive that allows the file to be assigned to a scope. myApp.directive('fileModel', ['$parse', function($parse) { return { restrict: 'A', link: function(scope, element, attrs) { var model = $parse.(attrs.fileModel); var modelSetter = model.assign; element.bind('change', function() { scope.$apply(function() { modelSetter(scope, element[0].files[0]); }); }); } }]); The service: myApp.service('fileUpload', ['$http', function($http){ this.uploadFileToUrl = function(file, uploadUrl, optionals) { var fd = new FormData(); fd.append('file', file); for (var key in file) { fd.append(key, file[key]); } for(var i = 0; i < optionals.length; i++){ fd.append(optionals[i].name, optionals[i].data); } }); }]); Here as you can see I pass the file, append its properties, and append any optional properties. In the controller is where I am having the troubles. I have tried $watch and using the file-model but I get the same error either way. myApp.controller('AddCtrl', function($scope, $location, PEberry, fileUpload){ //$scope.$watch(function() { // return $scope.phpFile; //},function(newValue, oldValue) { // $scope.filename = $scope.phpFile.name; //}, true); // if ($scope.phpFiles) { // $scope.filename = $scope.phpFiles.name; // } $scope.send = function() { var uploadUrl = "/files"; var file = $scope.phpFile; //var opts = [{ name: "uname", data: file.name }] fileUpload.uploadFileToUrl(file, uploadUrl); }; }); Thank you for your help!

    Read the article

  • How to cleverly stop "while loop" (php)

    - by user3735697
    I'm having trouble with creating code that echoes a bunch of stuff that is corresponding to the mysql database row. It needs to keep creating the content until all rows are used and then stop. But for some reason the php file causes the browser to keep loading (it never ends). Any help would be appreciated! Thanks! <?php mysql_connect ("localhost", "root", "") or die ("We couldn't connect!"); mysql_select_db ("dr"); mysql_query ("SELECT * FROM songs"); $result = mysql_query ("SELECT * FROM songs"); while ($row=mysql_fetch_array($result)) { $name = $row ['songname']; $genres = $row ['songgenres']; $mediafire = $row ['mediafirelink']; $dropbox = $row ['dropboxlink']; $source = $row ['audiosource']; echo " <div class='playing'> <!-- ======== Song Name ======== --> <li class='songnameli' id='$source'> <span class='info'>$name</span> <audio> <source src='music/singles/$source.mp3'> <source src='music/singles/$source.ogg'> </audio> </li> <!-- ======== Playlist ======== --> <li class='playlistli'> <img src='icons/addtoplaylist.png' title='Add tot the playlist!' /> </li> <!-- ======== Genres ======== --> <li class='genresli'> <img src='icons/genres.png' title='Related genres' /> <span class='addedtext genres'>$genres</span> </li> <!-- ======== Social Media links ======== --> <li> <span> <img src='icons/share.png' alt='Share this with your friends!' title='Share this!'> <!-- /// facebook /// --> <a href='http://www.facebook.com/sharer.php?u=http://www.declassified-recordings.com' class='addedtext nlink' target='blank_' onclick='popup (this.href, 800, 500); return false'>Facebook </a> <span>/</span> <!-- /// Twitter /// --> <a href='http://twitter.com/share? text=Thank%20you%20For%20Sharing!%20It%20means%20the%20world%20to%20us!%40Declassifi3d%20 &url=http://www.declassified-recordings.com' class='twitterlink nlink' target='blank_' onclick='popup (this.href, 800, 500); return false'>Twitter</a> </span> </li> <!-- ======== Download links ======== --> <li> <img src='icons/download.png' title='Download!' /> <span> <!-- /// Mediafire /// --> <a href='$mediafire' class='addedtext nlink' target='_blank'>Mediafire</a> <span class='genres'>/</span> <!-- /// Dropbox /// --> <a href='$mediafire' class='twitterlink nlink' target='_blank'>Dropbox</a> </span> </li> </div>"; } mysql_close (); ?>

    Read the article

  • vertical align of some inline-block divs with different content

    - by Jan Möller
    i want to center some inline-block divs. I want to create a responsive design, so if the screen size is too small, the horizontal elements should be under each other. How can i center them vertical, so they are side by side without a difference in height? (See fiddle). Moveover those elements should be verticaly centered, if the screen size is too small. http://jsfiddle.net/5dpRs/52/ CSS .repeat { display:inline-block; border-style:solid; border-width:2px; height:50px; width:50px; } #content { border-style:solid; border-width:2px; text-align:center; } HTML <div id="content"> <div class="repeat"> <p>hello</p> </div> <div class="repeat"> </div> </div> Thank you :)

    Read the article

  • difficulties in javascript coding [on hold]

    - by user3718986
    Question is, It takes me 3 hours to fly from NY to CA. How much it will take me if I fly directly from NY to Florida. suppose that distance from CA to Flordia is 8 hours by air..Rule is if you suppose to travel from NY to Florida you will have to pass through CA. I did the quesiton in JavaScript below but coding isn't correct. Can someone fixed this issue for me please? var destination = prompt('Please enter your destinations. We are currently flying to NY,CA and FL'); var locatioon = prompt("specify your current location. "); switch (destination) { case 'NY': { distanceTeller(locatioon); break; } break; case 'CA': { distanceTeller(locatioon); break; } break; case 'FL': { alert("11 HR"); } default: alert('dont look at me'); break; } function distanceTeller(locatioon) { if (locatioon == 'CA') { alert('it will take you 3 hours'); } else if (locatioon == 'FL') { alert('it will take you 8 hours'); } else alert('it will take you 11 hours to reach NY'); }

    Read the article

  • Doing things with objects as if they were parents

    - by General Ackbar
    Sorry that this is probably a super noob question. But the following code give me an error saying that there are invalid arguments in my call of doStuffToLines(segments) shouldnt I be able to do this since I have my DimensionLineSegment inherits from Lines? private void doStuff() { List<DimensionLineSegment> segments = new List<DimensionLineSegment>(); doStuffToLines(segments); } private void doStuffToLines(List<Line> lines) { }

    Read the article

  • How do I integrate a new MVC C# Project with an existing Web Forms VB.NET Web Application Project?

    - by Jordan Rieger
    We have a corporate website with a large amount of dynamic business application pages (e.g. Shopping Cart, Helpdesk, Product/Service management, Reporting, etc.) The site was built as an ASP.Net Web Application Project (WAP). Our systems have evolved over the years to use .NET 4.5 and various custom business logic DLLs (written in a mix of C# and VB.NET). However, the site itself is still using VB.NET Web Forms. We now have done a few side projects in MVC 4 using Razor/C#, and we want to use this framework for new pages on the main corporate site going forward. What would be the easiest way to achieve this? I found this nice list of steps to integrate MVC 4 into an existing Web Forms app. The problem is that because our existing app is a VB.NET WAP, it compiles into a single DLL, and .NET allows only one language per DLL. The site is way too big for us to contemplate converting it to C# all at once (yes, I've looked at the conversion tools, and they're good, but even 99% accuracy would leave us a huge amount of cleanup work.) I thought about converting the existing WAP into a Web Site Project (WSP) which does allow mixing languages and then following the steps above, but after a few pages of Google results, I couldn't find any steps for converting a WAP to WSP. (Plenty of sites offer the reverse steps: converting a WSP to a WAP.) Another idea I had was to create a completely separate MVC project, and then somehow squish them together into the same folder structure, where they would share the bin folder but compile to separate DLL's. I have no idea if this is possible, because certain files would collide (e.g. Global.asax, web.config, etc.) Finally, I can imagine a compromise solution where we keep all the MVC stuff in its own separate application under a subfolder of the main solution. We already use our own custom session state solution, so it wouldn't be difficult to pass data between the old site to the new pages. Which of the ideas above do you think makes the most sense for us? Is there another solution that I'm missing?

    Read the article

  • super(type,subclass) in simple singleton implementation

    - by Tianchen Wu
    when I was implementing naive singleton in python, I came up with a problem with super key word. As usual the behavior of super is always tricky and buggy, hope someone can shed light on it. Thanks :) The problem is that: class Singleton(object): def __new__(cls,*args,**kw): if not hasattr(cls,'_instance'): #create a instance of type cls, origin=super(Singleton,Singleton).__new__(cls,*args,**kw) cls._instance=origin return cls._instance class B(Singleton): def __init__(self,b): self.b=b It actually works, but I am wondering Will it be better if I change line 5 to the below, like in most of the books? origin=super(Singleton,cls).__new__(cls,*args,**ks) what's the difference to make?

    Read the article

  • AS3: currentFrame & stop ();

    - by Eleonara
    So, my next problem. Sorry for asking so much, but my teacher doens't respond. So, this doesn't work. The stop command doesn't seem too respond, but i don't get an error either. I know i miss a bracket, but my function isn't finished. Due to copy and paste the place of the brackets have shifted a bit. function Knipperen (event:TimerEvent):void { if (event.currentTarget.currentCount == 3 && geknipperd < 3) { geknipperd ++; timer.reset(); timer.start(); trace (geknipperd); gotoAndPlay(1); if (currentFrame == 13) { stop(); } }

    Read the article

  • Cannot convert to string [on hold]

    - by user3598883
    I am trying to transfer information from form1 to form2 and I am getting the error of "Cannot implicitly convert type form1.employee to 'string' Some coding i have used for this transfer process is as follows: (everything is set to public) I'll Also add that I ONLY have it set to FirstName.FirstName because it seems tog et it to work if I remove one one of the FirstName then It tells me it cannot convert to string public void Enter_Click(object sender, EventArgs e) Form2 frm2 = new Form2(); Employee FirstName = new Employee(); if (Directions.Text == "Please Enter Employee First Name") { FirstName.FirstName = Info.Text; Directions.Text = "Please Enter Employee Last Name"; } frm2.FN.Text = FirstName; public class Employee { public string FirstName; }

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >