Daily Archives

Articles indexed Sunday November 25 2012

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

  • How can I find the approximate daily traffic of a site which I don't own?

    - by John Thomas
    I want to find the approximate daily traffic of a site which isn't ours, and the site is located in other country than US (in Greece - hence no Quantcast or Compete.com afaik) and it doesn't use Google Ads (hence no Google Ad Planner). I know about Alexa but the site(s) has/have relatively low traffic and the Alexa's rank isn't very useful (same stands to Google Trends). Or perhaps I should look more at Alexa's data? Any other ideas? PS: I looked before posting here and here. No luck.

    Read the article

  • Registering domain during christmas holydays

    - by arkascha
    One of the domain names I tried to register previously has been blocked by a domain grabber two days prior to my own attempt. That was about 1 year ago. The attempt to buy the domain from that person failed due to a totally exaggerated price. So I dropped the issue and watched the domain (offered at sedo.com). As expected there were no more offers, the domain was not sold. Now I learn from the whois database that the registration of that domain name ends on 25.12.2012 (christmas holyday). This raises two questions for me, I fail to find reliable answers on the internet. So maybe someone experienced here can drop a statement or a hint: is it reasonable that the domain name in question really will be free again when that date mentioned in the whois database up to when the domain is registered has passed? I certainly know that the registration can be prolonged, that is not what I mean. I expect (hope) that that domain grabber does not extend the registration, since it costs money and effort and he failed to sell the domain. Provided this is the case and the domain registration is not prolonged, is that date mentioned reliable? Or might it just be some 'default' date? I would like to try to register that domain name as soon as it is unregistered. Since that domain grabber registered that domain only two days before my own registration attempt I would like to prevent such annoying interference next time. So I ask myself: is it possible to register a domain name on a holyday? I mean not to send an email to my provider to do so on that day or before, but to actually have to process taking place as not to wait for 1-2 days after the unregistration? My own provider which I am very happy with does not offer such service on a holyday (which is perfectly understandable). They are 'still checking' if they can offer something automatic. I researched and did not find an answer to the question if that is possible at all. Is an autoomatic registration attempt on a holyday possible? Where can I do that? Is that reliable? Thanks for any reply!

    Read the article

  • Sudden drop in Total Indexed pages and increase in 'Not Selected' number.

    - by Pravin
    My blog is around 1 year old and have PR2. The average daily pageviews upto last 1 week were 1800. The total number of posts are 180. Though I have only 180 total posts, the total number of Indexed URL was increasing and it was as high as 510. But in the month of Sept2012, the total number of Indexed pages dropped from 510 to 214. The drop was sudden and it is now increasing very slowly. Also, the other main concern is huge increase in 'Not Selected' number. It is currently 814. I have never posted any post again and never copied any idea from any other blog. But I do use internal linking to some older post those are related to the new posts. The questions are:; Why there is sudden drop in the 'Total Indexed' pages. Why there was increase in total indexed pages to 500 even though the total posts were only 180. As the drop in 'Total Indexed' was in the month of sept2012, I was getting same organic traffic and it was steadily increasing till last week and then there was a 50 drop in the total pageviews. Why. Now, again the traffic is becoming to normal but still there is a problem. Is increase in the 'Not selected' number is a cause of drop in 'Total Indexed'? How to prevent or reduce the number of 'Not Selected' even though I do not have any duplicate post withing blog. Is the 'internal linking' to older post creating 'Not selected' problem? Should I edit my 'Robot.txt' to avoid crawling of labes that may be creating duplicate posts or something like that, if so, what is correct robot.txt. I have uploaded the screenshot of the graph of Webmaster Tools. Please take a look and give suggestions. Please help. Thank you in advance.

    Read the article

  • Arrive steering behavior

    - by dbostream
    I bought a book called Programming game AI by example and I am trying to implement the arrive steering behavior. The problem I am having is that my objects oscillate around the target position; after oscillating less and less for awhile they finally come to a stop at the target position. Does anyone have any idea why this oscillating behavior occur? Since the examples accompanying the book are written in C++ I had to rewrite the code into C#. Below is the relevant parts of the steering behavior: private enum Deceleration { Fast = 1, Normal = 2, Slow = 3 } public MovingEntity Entity { get; private set; } public Vector2 SteeringForce { get; private set; } public Vector2 Target { get; set; } public Vector2 Calculate() { SteeringForce.Zero(); SteeringForce = SumForces(); SteeringForce.Truncate(Entity.MaxForce); return SteeringForce; } private Vector2 SumForces() { Vector2 force = new Vector2(); if (Activated(BehaviorTypes.Arrive)) { force += Arrive(Target, Deceleration.Slow); if (!AccumulateForce(force)) return SteeringForce; } return SteeringForce; } private Vector2 Arrive(Vector2 target, Deceleration deceleration) { Vector2 toTarget = target - Entity.Position; double distance = toTarget.Length(); if (distance > 0) { //because Deceleration is enumerated as an int, this value is required //to provide fine tweaking of the deceleration.. double decelerationTweaker = 0.3; double speed = distance / ((double)deceleration * decelerationTweaker); speed = Math.Min(speed, Entity.MaxSpeed); Vector2 desiredVelocity = toTarget * speed / distance; return desiredVelocity - Entity.Velocity; } return new Vector2(); } private bool AccumulateForce(Vector2 forceToAdd) { double magnitudeRemaining = Entity.MaxForce - SteeringForce.Length(); if (magnitudeRemaining <= 0) return false; double magnitudeToAdd = forceToAdd.Length(); if (magnitudeToAdd > magnitudeRemaining) magnitudeToAdd = magnitudeRemaining; SteeringForce += Vector2.NormalizeRet(forceToAdd) * magnitudeToAdd; return true; } This is the update method of my objects: public void Update(double deltaTime) { Vector2 steeringForce = Steering.Calculate(); Vector2 acceleration = steeringForce / Mass; Velocity = Velocity + acceleration * deltaTime; Velocity.Truncate(MaxSpeed); Position = Position + Velocity * deltaTime; } If you want to see the problem with your own eyes you can download a minimal example here. Thanks in advance.

    Read the article

  • cocos2d event handler not fired when reentering scene

    - by Adam Freund
    I am encountering a very strange problem with my cocos2d app. I add a sprite to the page and have an event handler linked to it which replaces the scene with another scene. On that page I have another button to take me back to the original scene. When I am back on the original scene, the eventHandler doesn't get fired when I click on the sprite. Below is the relevant code. Thanks for any help! CCMenuItemImage *backBtnImg = [CCMenuItemImage itemWithNormalImage:@"btn_back.png" selectedImage:@"btn_back_pressed.png" target:self selector:@selector(backButtonTapped:)]; backBtnImg.position = ccp(45, 286); CCMenu *backBtn = [CCMenu menuWithItems:backBtnImg, nil]; backBtn.position = CGPointZero; [self addChild:backBtn]; EventHandler method (doesn't get called when the scene is re-entered). (void)backButtonTapped:(id)sender { NSLog(@"backButtonTapped\n"); CCMenuItemImage *backButton = (CCMenuItemImage *)sender; [backButton setNormalImage:[CCSprite spriteWithFile:@"btn_back_pressed.png"]]; [[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:.25 scene:[MenuView scene] withColor:ccBLACK]]; }

    Read the article

  • How to factorize code in Unreal Kismet (i.e. "Material Function"s for Kismet)

    - by Georges Dupéron
    In the Unreal Development Kit, when using the Material Editor, one can factorize frequently-used groups of nodes by creating a Material Function (content Browser ? right-click ? new matrial function, IIRC). When defining the behaviour of some actor in Kismet, one can easily have a dozen nodes involved. If I have many actors that share the same behaviour, then I'll copy-paste these nodes, and change the variables so they point to the other actors. This leads to inconsistencies (a modification in the behaviour of an actor isn't propagated in the copy-pasted nodes), complexity (you end up with hundreds of nodes), and generally useless effort. My question is : Can I create a "kismet function", just like a material function ? Note: I'd rather avoid using UnrealScript. I don't even know where to type UnrealScripts, don't know where the documentation is and more generally don't have enough time to invest in learning UnrealScript. This "kismet function" feature must be usable by graphists (with little programming knowledge). If a (simple) script suffices to add this feature in the Kismet editor, so that one can create several "functions" without using UnrealScript, then fine, but I don't really want to have to write a script each time I want to factorize a few nodes. Thanks for any information !

    Read the article

  • Many sources of movement in an entity system

    - by Sticky
    I'm fairly new to the idea of entity systems, having read a bunch of stuff (most usefully, this great blog and this answer). Though I'm having a little trouble understanding how something as simple as being able to manipualate the position of an object by an undefined number of sources. That is, I have my entity, which has a position component. I then have some event in the game which tells this entity to move a given distance, in a given time. These events can happen at any time, and will have different values for position and time. The result is that they'd be compounded together. In a traditional OO solution, I'd have some sort of MoveBy class, that contains the distance/time, and an array of those inside my game object class. Each frame, I'd iterate through all the MoveBy, and apply it to the position. If a MoveBy has reached its finish time, remove it from the array. With the entity system, I'm a little confused as how I should replicate this sort of behavior. If there were just one of these at a time, instead of being able to compound them together, it'd be fairly straightforward (I believe) and look something like this: PositionComponent containing x, y MoveByComponent containing x, y, time Entity which has both a PositionComponent and a MoveByComponent MoveBySystem that looks for an entity with both these components, and adds the value of MoveByComponent to the PositionComponent. When the time is reached, it removes the component from that entity. I'm a bit confused as to how I'd do the same thing with many move by's. My initial thoughts are that I would have: PositionComponent, MoveByComponent the same as above MoveByCollectionComponent which contains an array of MoveByComponents MoveByCollectionSystem that looks for an entity with a PositionComponent and a MoveByCollectionComponent, iterating through the MoveByComponents inside it, applying/removing as necessary. I guess this is a more general problem, of having many of the same component, and wanting a corresponding system to act on each one. My entities contain their components inside a hash of component type - component, so strictly have only 1 component of a particular type per entity. Is this the right way to be looking at this? Should an entity only ever have one component of a given type at all times?

    Read the article

  • Why does my VertexDeclaration apparently not contain Position0?

    - by Phil
    I'm trying to get my code from calling each individual draw call down to using at least a VertexBuffer, and preferably an indexBuffer, but now that I'm attempting to test my code, I'm getting the error: The current vertex declaration does not include all the elements required by the current vertex shader. Position0 is missing. Which makes absolutely no sense to me, as my VertexDeclaration is: public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration( new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(sizeof(float) * 3, VertexElementFormat.Color, VertexElementUsage.Color, 0), new VertexElement(sizeof(float) * 3 + 4, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0) ); Which clearly contains the information. I am attempting to draw with the following lines: VertexBuffer vb = new VertexBuffer(GraphicsDevice, VertexPositionColorNormal.VertexDeclaration, c.VertexList.Count, BufferUsage.WriteOnly); IndexBuffer ib = new IndexBuffer(GraphicsDevice, typeof(int), c.IndexList.Count, BufferUsage.WriteOnly); vb.SetData<VertexPositionColorNormal>(c.VertexList.ToArray()); ib.SetData<int>(c.IndexList.ToArray()); GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vb.VertexCount, 0, c.IndexList.Count/3); Where c is a Chunk class containing an 8x8x8 array of boxes. Full code is available at https://github.com/mrbaggins/Box/tree/ProperMeshing/box/box. Relevant locations are Chunk.cs (Contains the VertexDeclaration) and Game1.cs (Draw() is in Lines 230-250). Not much else of relevance to this problem anywhere else. Note that large commented sections are from old version of drawing.

    Read the article

  • XCode Build Parse Error 'Unexpected @ in Program'

    - by Grymjack
    I'm following a tutorial for creating an animation using Xcode Version 4.5.2 in Mountain Lion 10.8.2. When trying to build the code below, I get a Parse Error Unexpected '@' in program showing up for the 'hopAnimation=' line. While searching, I have found examples that build simple animations in a different way, but nothing that seems to address this particular problem. I'm a noob to XCode programming and if anyone could help me correct the syntax, I would highly appreciate it. I would also like to thank all the contributors to stackflow for making this such a valuable resource. Searching for the answers to most of my prior questions always seemed to have you guys at the top of the results list. ViewController.m - (void)viewDidLoad { // load all the frames of our animation into an array NSArray *hopAnimation; hopAnimation=[[NSArray alloc] arrayWithObjects: [UIImage imageNamed:@”frame-1.png”], [UIImage imageNamed:@”frame-2.png”], [UIImage imageNamed:@”frame-3.png”], [UIImage imageNamed:@”frame-4.png”], [UIImage imageNamed:@”frame-5.png”], [UIImage imageNamed:@”frame-6.png”], [UIImage imageNamed:@”frame-7.png”], [UIImage imageNamed:@”frame-8.png”], [UIImage imageNamed:@”frame-9.png”], [UIImage imageNamed:@”frame-10.png”], [UIImage imageNamed:@”frame-11.png”], [UIImage imageNamed:@”frame-12.png”], [UIImage imageNamed:@”frame-13.png”], [UIImage imageNamed:@”frame-14.png”], [UIImage imageNamed:@”frame-15.png”], [UIImage imageNamed:@”frame-16.png”], [UIImage imageNamed:@”frame-17.png”], [UIImage imageNamed:@”frame-18.png”], [UIImage imageNamed:@”frame-19.png”], [UIImage imageNamed:@”frame-20.png”],nil]; self.bunnyView1.animationImages=hopAnimation; self.bunnyView2.animationImages=hopAnimation; self.bunnyView3.animationImages=hopAnimation; self.bunnyView4.animationImages=hopAnimation; self.bunnyView5.animationImages=hopAnimation; self.bunnyView1.animationDuration=1; self.bunnyView2.animationDuration=1; self.bunnyView3.animationDuration=1; self.bunnyView4.animationDuration=1; self.bunnyView5.animationDuration=1; [super viewDidLoad]; }

    Read the article

  • Maven 3 plugin - How to programatically exclude a dependency and all its transitive dependencies?

    - by electrotype
    I'm developing a Maven 3 plugin and I want to exclude some dependencies, and their transitive dependencies, when a configuration is set to true in the plugin. I don't want to use <exclusions> in the POM itself, even in a profile. I want to exclude those dependencies programatically. In fact, what I want is to prevent the dependency jars to be included in the final war (I'm building a war), when a plugin configuration is set to true. I tried : @Mojo(requiresDependencyResolution=ResolutionScope.COMPILE, name="compileHook",defaultPhase=LifecyclePhase.COMPILE) public class compileHook extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { // ... Set<Artifact> artifacts = this.project.getArtifacts(); for(Artifact artifact : artifacts) { if("org.package.to.remove".equalsIgnoreCase(artifact.getGroupId())) { artifact.setScope("provided"); } } // ... } } Since this occures at the compile phase, it will indeed remove the artifacts with a group id "org.package.to.remove" from having their jars included in the war when packaged. But this doesn't remove the transitive artifacts those dependencies add! What is the best way to programatically remove some dependencies, and their transitive dependencies, from being included in a final .jar/.war?

    Read the article

  • python Requests login to website returns 403

    - by Jeff
    I'm trying to use requests to login to a website but as you can guess I'm having a problem here's the the code that I'm using import requests EMAIL = '***' PASSWORD = '***' URL = 'https://portal.bitcasa.com/login' client = requests.session(config={'verbose': sys.stderr}) login_data = {'username': EMAIL, 'password': PASSWORD,} r = client.post(URL, data=login_data, headers={"Referer": "foo"}) print r and if I print out r.text I get <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head><script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()])</script> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>403 Forbidden</title> <style type="text/css"> html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background:#eee; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; margin-bottom:.4em; } h1 span { font-size:60%; color:#666; font-weight:normal; } #info { background:#f6f6f6; } #info ul { margin: 0.5em 4em; } #info p, #summary p { padding-top:10px; } #summary { background: #ffc; } #explanation { background:#eee; border-bottom: 0px none; } </style> </head> <body> <div id="summary"> <h1>Forbidden <span>(403)</span></h1> <p>CSRF verification failed. Request aborted.</p> </div> <div id="explanation"> <p><small>More information is available with DEBUG=True.</small></p> </div> <script type="text/javascript">if(!NREUMQ.f){NREUMQ.f=function(){NREUMQ.push(["load",new Date().getTime()]);var e=document.createElement("script");e.type="text/javascript";e.src=(("http:"===document.location.protocol)?"http:":"https:")+"//"+"d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js";document.body.appendChild(e);if(NREUMQ.a)NREUMQ.a();};NREUMQ.a=window.onload;window.onload=NREUMQ.f;};NREUMQ.push(["nrfj","beacon-1.newrelic.com","0e859e0620",778660,"ZAZRbUcHWBAHURFYX11MdUxbBUIKCVxKVVpSDVRWGwtfBwJeAEZRQQYdWkYUUFklQRdXZloGRHRcAlIPA0UEQ1UdE0FWVgNFEDlEDFRH",0,7,new Date().getTime(),"","","","",""])</script></body> </html> They're using a combination of django and pyramid. I've been playing around with this for about two days now but, obviously, have gotten nowhere. Thanks for your help.

    Read the article

  • SaaS practical basics and projects

    - by Medardas
    So i need some directions. I want to understand Cloud Software as a Service(SaaS) practical initialization. The thing is I want to create a simple cloud service which would let me run programs on this cloud from remote machine. As I understand, I need some kind of specific backbone project to start this system, similar like OpenStack or Apache Cloud for Infostructure as a Service. Of course it may be that I understand it completely wrong and even if there is such project, it is not open source, free. I could also comprehend SaaS building on IaaS, but the thing is, I can't find any practical information at all. Could Somebody indulge me if there is any kind of free licence SaaS project or recommend a related articles or explain everything in a nut case with atleast vague direction.

    Read the article

  • When is (true == x) === !!x false?

    - by Paul S.
    JavaScript has different equality comparison operators Equal == Strict equal === It also has a logical NOT ! and I've tended to think of using a double logical NOT, !!x, as basically the same as true == x. However I know this is not always the case, e.g. x = [] because [] is truthy for ! but falsy for ==. So, for which xs would (true == x) === !!x give false? Alternatively, what is falsy by == but not !! (or vice versa)?

    Read the article

  • Accessing C# Variables in JavaScript

    - by mshahbazm
    I am Developing Windows 8 application in which i have to access variables of C# class in java script function, But Unfortunately i don not know how to do this: My C# class code is: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pakistan_Tour { public class UniversalValues { public static double xC; public static double yC; public static int selectedcity; public int retcity() { return selectedcity; } public void setcity(int val) { selectedcity=val; } public void setxy(double x, double y) { xC = x; yC = y; } public double getx() { return xC; } public double gety() { return yC; } } } I have to access the value of variables: xC and yc in java script I am doing like: function initialize() { var x = "<%=xC%>"; var y = "<%=yC%>"; } but is not working, Kindly help me with this, Thanks in advance.

    Read the article

  • Make fully visible one element from overflow:hidden element

    - by Oleksandr Khavdiy
    Please check http://jsfiddle.net/mtN6R/5/ .tooltip{ color:red; } .wrapper { overflow:hidden; height:50px; border:1px solid black; width:50px; } <div class="wrapper"> <div class='tooltip'>A big tooltip which should be visible fully</div> A lot of text<br> A lot of text<br> </div> I need .tooltip make fully visible but I can't take it outside wrapper. Can we stylize that example so .tooltip will be shown above wrapper and the rest content will stay as is?

    Read the article

  • How to loop an array with strings as indexes in PHP

    - by Axel Lambregts
    I had to make an array with as indexes A-Z (the alphabet). Each index had to have a value 0. So i made this array: $alfabet = array( 'A' => 0, 'B' => 0, 'C' => 0, 'D' => 0, 'E' => 0, 'F' => 0, 'G' => 0, 'H' => 0, 'I' => 0, 'J' => 0, 'K' => 0, 'L' => 0, 'M' => 0, 'N' => 0, 'O' => 0, 'P' => 0, 'Q' => 0, 'R' => 0, 'S' => 0, 'T' => 0, 'U' => 0, 'V' => 0, 'W' => 0, 'X' => 0, 'Y' => 0, 'Z' => 0 ); I also have got text from a file ($text = file_get_contents('tekst15.txt');) I have putted the chars in that file to an array: $textChars = str_split ($text); and sorted it from A-Z: sort($textChars); What i want is that (with a for loop) when he finds an A in the textChars array, the value of the other array with index A, goes up by one (so like: $alfabet[A]++; Can anyone help me with this loop? I have this atm: for($i = 0; $i <= count($textChars); $i++){ while($textChars[$i] == $alfabet[A]){ $alfabet[A]++; } } echo $alfabet[A]; Problem 1: i want to loop the alfabet array to, so now i only check for A but i want to check all indexes. Problem2: this now returns 7 for each alphabet index i try so its totally wrong :) I'm sorry about my english but thanks for your time.

    Read the article

  • using an already proved lema/theorem/corollary in coq

    - by André Hincu
    I am trying to make a proof in Coq, and I would like to use a lemma already definded and proved by me. Is it possible for the following code? Lemma conj_comm: forall A B : Prop, A /\ B -> B /\ A. Proof. intros. destruct H. split. exact H0. exact H. Qed. Lemma not_conj_comm: forall A B : Prop, ~(A /\ B) -> ~(B /\ A). Proof. intros. intro. unfold not in H. apply H. use H0. In the above I want to use the fact that A /\B is the same as B /\ A in order to prove that ~(A /\ B) is the same as ~(B /\ A). Is it possible to use my proved lemma?

    Read the article

  • char array split ip with strtok

    - by user1480139
    I'm trying to split a IP address like 127.0.0.1 from a file: using following C code: pch2 = strtok (ip,"."); printf("\npart 1 ip: %s",pch2); pch2 = strtok (NULL,"."); printf("\npart 2 ip: %s",pch2); And IP is a char ip[500], that containt an ip. When printing it prints 127 as part 1 but as part 2 it prints NULL? Can someone help me? EDIT: Whole function: FILE *file = fopen ("host.txt", "r"); char * pch; char * pch2; char ip[BUFFSIZE]; IPPart result; if (file != NULL) { char line [BUFFSIZE]; while(fgets(line,sizeof line,file) != NULL) { if(line[0] != '#') { //fputs(line,stdout); pch = strtok (line," "); printf ("%s\n",pch); strncpy(ip, pch, sizeof(pch)-1); ip[sizeof(pch)-1] = '\0'; //pch = strtok (line, " "); pch = strtok (NULL," "); printf("%s",pch); pch2 = strtok (ip,"."); printf("\nDeel 1 ip: %s",pch2); pch2 = strtok (NULL,"."); printf("\nDeel 2 ip: %s",pch2); //if(strcmp(pch,url) == 0) //{ // result.part1 = //} } } fclose(file); }

    Read the article

  • create Android .apk from a decompiled .apk

    - by user1851410
    i decompiled an Android .apk file using dex2jar, grabbed the java source files using jd-gui "File Save All Sources" and got a .zip file and the java files within. I did exactly the steps in this "guide": http://a4apphack.com/security/sec-code/extract-android-apk-from-market-and-decompile-it-to-java-source. Then i made some changes in a couple of the java files, now i am wondering how i can recreate an apk file. Decompiling with apktool, backsmali and smali tools work with .smali files, but now i have .java files...

    Read the article

  • issue about Concept of JFrame, JLabel and ContentPane

    - by Sun Hong Kim
    I just study window programming with awt. I see through several codes but I can not get concepts of JFrame, JLabel and ContentPane. I think JFrame only make outer Frame. ContentPane is container that contain JLabel that has contents(text, button, radio etc...). I don't know this is correct T.T Why I ask this is I failed combine the contents. I can not make TextField and InternalFrame at a time. I want to know the concept. I hope you take my question right.

    Read the article

  • send arrow keys using ganymed ssh java

    - by José Ramón Pérez Rubio
    I am using Ganymed ssh to connect to a remote machine and apart from sending commands I need to send the arrows keys (left and right keys). I can send commands but when I send the arrows keys nothing happends. This is what I have: public boolean createShell() throws Exception { try { // ... m_session= connection.openSession(); m_commandWriter = new OutputStreamWriter(m_session.getStdin()); String encoding=m_commandWriter.getEncoding(); //encoding is UFT8 m_errorPipe=new SSHSyncPipe(m_session.getStderr()); m_outputPipe=new SSHSyncPipe(m_session.getStdout()); m_outputPipe.start(); m_errorPipe.start(); // m_session.requestPTY("bash"); m_session.requestDumbPTY(); m_session.startShell(); m_shellCreated=true; return true; } } So if I use m_commandWriter.write(ls"\r\n"); m_commandWriter.flush(); It works, but m_commandWriter.write(37);//37 is the code for left arrow m_commandWriter.flush(); Doesn't work. Does anyone know what I am doing wrong? Thank you

    Read the article

  • How can I use linq to initialize an array of repeated elements?

    - by Eric
    At present, I'm using something like this to build a list of 10 objects: myList = (from _ in Enumerable.Range(0, 9) select new MyObject {...}).toList() This is based off my python background, where I'd write: myList = [MyObject(...) for _ in range(10)] Note that I want my list to contain 10 instances of my object, not the same instance 10 times. Is this still a sensible way to do things in C#? Is there a cost to doing it this way over a simple for loop?

    Read the article

  • How can i pull an image and data from a Database?

    - by user1851377
    I am trying to pull data from a Database using C#.net and use a Foreach loop to make it visible on a page. Every time i run the code i only get one item that shows up when i know that there is at least 7 items in the DB. i have placed the code below for the C#. SqlConnection oConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["HomeGrownEnergyConnectionString"].ToString()); string sqlEnergy = "Select * from Product p where p.ProductTypeId=3"; SqlCommand oCmd = new SqlCommand(sqlEnergy, oConnection); DataTable dtenergy = new DataTable(); SqlDataAdapter oDa = new SqlDataAdapter(oCmd); try { oConnection.Open(); ; oDa.Fill(dtenergy); } catch (Exception ex) { lblnodata.Text = ex.Message; return; } finally { oConnection.Close(); } DataTableReader results = dtenergy.CreateDataReader(); if (results.HasRows) { results.Read(); foreach(DataRow result in dtenergy.Rows) { byte[] imgProd = result["ThumnailLocation"] as byte[]; ID.Text = result["ProductID"].ToString(); Name.Text = result["Name"].ToString(); price.Text = FormatPriceColumn(result["Price"].ToString()); } } Here is the code for the asp.net. <div> <asp:Image ID="imgProd" CssClass="ProdImg" runat="server" /> <asp:Label runat="server" ID="ID" /> <asp:Label runat="server" ID="Name" /> <asp:Label runat="server" ID="price" /> <asp:TextBox ID="txtQty" MaxLength="3" runat="server" Width="30px" /> <asp:Button runat="server" ID="Addtocart" Text="Add To Cart" CommandName="AddToCart" ItemStyle-CssClass="btnCol" /> If someone could please help me that would be great thanks.

    Read the article

  • Currying a function n times in Scheme

    - by user1724421
    I'm having trouble figuring out a way to curry a function a specified number of times. That is, I give the function a natural number n and a function fun, and it curries the function n times. For example: (curry n fun) Is the function and a possible application would be: (((((curry 4 +) 1) 2) 3) 4) Which would produce 10. I'm really not sure how to implement it properly. Could someone please give me a hand? Thanks :)

    Read the article

  • Difficulty screen scraping http://www.momondo.com using nokogiri

    - by Khai Kiong
    I have some difficulty to extract the total price (css selector = '.total') from the flight result. http://www.momondo.com/multicity/?Search=true&TripType=oneway&SegNo=1&SO0=KUL&SD0=KBR&SDP0=31-12-2012&AD=2&CA=0,0&DO=false&NA=false#Search=true&TripType=oneway&SegNo=1&SO0=KUL&SD0=KBR&SDP0=31-12-2012&AD=2&CA=0,0&DO=false&NA=false I get the error "undefined method `text' for nil:NilClass nokogiri ". My code desc "Fetch product prices" task :fetch_details => :environment do require 'nokogiri' require 'open-uri' include ERB::Util OneWayFlight.find_all_by_money(nil).each do |flight| url = "http://www.momondo.com/multicity/Search=true&TripType=oneway&SegNo=1&SO0=KUL&SD0=KBR&SDP0=31-12-2012&AD=2&CA=0,0&DO=false&NA=false#Search=true&TripType=oneway&SegNo=1&SO0=KUL&SD0=KBR&SDP0=31-12-2012&AD=2&CA=0,0&DO=false&NA=false" doc = Nokogiri::HTML(open(url)) price = doc.at_css(".total").text[/[0-9\.]+/] flight.update_attribute(:price, price) end end

    Read the article

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