Daily Archives

Articles indexed Tuesday March 27 2012

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

  • google changing crawl speed: doesn't seem to work. Why?

    - by Olivier Pons
    I've changed 3 days ago the google crawling speed of mywebsite. Here it is: This means: 2 demands by second. I've got the message on the google webmasters tools that the change speed has been taken in account: But after more than three days, nothing happens: still one request every ten seconds See here: My webserver is very fast and can handle up to twenty simultaneous connexions. And my website is brand new, this means google is almost the only one here crawling my website. After more than 30000 successful requests (= no 404), I think there's something going on... or maybe this is just a bug? Has anyone ever had this problem?

    Read the article

  • How do I draw anti-aliased holes in a bitmap

    - by gyozo kudor
    I have an artillery game (hobby-learning project) and when the projectile hits it leaves a hole in the ground. I want this hole to have antialiased edges. I'm using System.Drawing for this. I've tried with clipping paths, and drawing with a transparent color using gfx.CompositingMode = CompositingMode.SourceCopy, but it gives me the same result. If I draw a circle with a solid color it works fine, but I need a hole, a circle with 0 alpha values. I have enabled these but they work only with solid colors: gfx.CompositingQuality = CompositingQuality.HighQuality; gfx.InterpolationMode = InterpolationMode.HighQualityBicubic; gfx.SmoothingMode = SmoothingMode.AntiAlias; In the two pictures consider black as being transparent. This is what I have (zoomed in): And what I need is something like this (made with photoshop): This will be just a visual effect, in code for collision detection I still treat everything with alpha 128 as solid. Edit: I'm usink OpenTK for this game. But for this question I think it doesn't really matter probably it is gdi+ related.

    Read the article

  • Memory allocation strategy for the vertex buffers (DirectX 10/11)

    - by Alex
    I have the following question. I write CAD system. So I have a 3D scene and there are many different objects (walls, doors, windows and so on). User can add or delete some objects. The question is: how can I organise the keeping of vertices for all my objects. I can create vertex buffer for every object. But I think drawing/switching from one buffer to another would have performance penalty. Another way - I can create several big buffers for every object type. But I don't understand how to update such buffers. It is too big to update whole buffer (for example buffer for all walls). What I need to do if I want to delete the object from the middle of the buffer? Actually I have the similar question: http://stackoverflow.com/questions/5515700/how-to-properly-update-vertex-buffers-in-directx-10 Most examples I've found work with very static models. Therefore, they tend to create a single vertex buffer with their list of points, and then are just manipulated by matrix transformations. I, on the other hand, will be updating the scene very often.

    Read the article

  • how to properly implement alpha blending in a complex 3d scene

    - by Gajet
    I know this question might sound a bit easy to answer but It's driving me crazy. There are too many possible situations that a good alpha blending mechanism should handle, and for each Algorithm I can think of there is something missing. these are the methods I've though about so far: first of I though about object sorting by depth, this one simply fails because Objects are not simple shapes, they might have curves and might loop inside each other. so I can't always tell which one is closer to camera. then I thought about sorting triangles but this one also might fail, thought I'm not sure how to implement it there is a rare case that might again cause problem, in which two triangle pass through each other. again no one can tell which one is nearer. the next thing was using depth buffer, at least the main reason we have depth buffer is because of the problems with sorting that I mentioned but now we get another problem. Since objects might be transparent, in a single pixel there might be more than one object visible. So for which Object should I store pixel depth? I then thought maybe I can only store the most front Object depth, and using that determine how should I blend next draw calls at that pixel. But again there was a problem, think about 2 semi transparent planes with a solid plane in middle of them. I was going to render the solid plane at the end, one can see the most distant plane. note that I was going to merge every two planes until there is only one color left for that pixel. Obviously I can use sorting methods too because of the same reasons I've explained above. Finally the only thing I imagine being able to work is to render all objects into different render targets and then sort those layers and display the final output. But this time I don't know how can I implement this algorithm.

    Read the article

  • DX10 sprite and pixel shader

    - by Alex Farber
    I am using ID3DX10Sprite to draw 2D image on the screen. 3D scene contains only one textured sprite placed over the whole window area. Render method looks like this: m_pDevice-ClearRenderTargetView(...); m_pSprite-Begin(D3DX10_SPRITE_SORT_TEXTURE); m_pSprite-DrawSpritesImmediate(&m_SpriteDefinition, 1, 0, 0); m_pSprite-End(); Now I want to make some transformations with the sprite texture in a shader. Currently the program doesn't work with shader. How it is possible to add pixel shader to the program with this structure? Inside the shader, I need to set all colors equal to red, and multiply pixel values by some coefficient. Something like this: float4 TexturePixelShader(PixelInputType input) : SV_Target { float4 textureColor; textureColor = shaderTexture.Sample(SampleType, input.tex); textureColor.x = textureColor.x * coefficient; textureColor.y = textureColor.x; textureColor.z = textureColor.x; return textureColor; }

    Read the article

  • Error when compiling FXAA shader

    - by mulletdevil
    I am getting the following error when compiling the FXAA shader downloaded from here http://timothylottes.blogspot.co.uk/2011/07/fxaa-311-released.html Fxaa3_11.h(934,5): error x4000: Use of potentially uninitialized variable (FxaaPixelShader) Here is the line in the shader if(earlyExit) #if (FXAA_DISCARD == 1) FxaaDiscard; #else return rgbyM; #endif Does anyone know what may be causing this? I have not changed any values in that shader. Here is a snippet from my current pixel shader #define FXAA_GREEN_AS_LUMA 1 #define FXAA_HLSL_4 1 #define FXAA_PC 1 #define FXAA_QUALITY__PRESET 12 #include "Fxaa3_11.h" PS_OUTPUT main(PS_INPUT fragment) { PS_OUTPUT output; const float2 pos = fragment.hPosition.xy; const float4 notUsedFloat4 = float4(0.0f, 0.0f, 0.0f, 0.0f); const float fxaaQualitySubpix = 0; const float fxaaQualityEdgeThreshold = 0.333; const float fxaaQualityEdgeThresholdMin = 0.0833; const float notUsedFloat = 0.0f; FxaaTex fxaaTex; fxaaTex.smpl = SampleType; fxaaTex.tex = inputTexture; output.colour = FxaaPixelShader(pos, //1 notUsedFloat4, //2 fxaaTex, //3 fxaaTex, //4 fxaaTex, //5 rcpFrame, //6 notUsedFloat4, //7 rcpFrameOpt, //8 notUsedFloat4, //9 fxaaQualitySubpix, //10 fxaaQualityEdgeThreshold, //11 fxaaQualityEdgeThresholdMin, //12 notUsedFloat, //13 notUsedFloat, //14 notUsedFloat, //15 notUsedFloat //16 ); return output; } Am I passing a wrong value into the shader?

    Read the article

  • Creating smooth lighting transitions using tiles in HTML5/JavaScript game

    - by user12098
    I am trying to implement a lighting effect in an HTML5/JavaScript game using tile replacement. What I have now is kind of working, but the transitions do not look smooth/natural enough as the light source moves around. Here's where I am now: Right now I have a background map that has a light/shadow spectrum PNG tilesheet applied to it - going from darkest tile to completely transparent. By default the darkest tile is drawn across the entire level on launch, covering all other layers etc. I am using my predetermined tile sizes (40 x 40px) to calculate the position of each tile and store its x and y coordinates in an array. I am then spawning a transparent 40 x 40px "grid block" entity at each position in the array The engine I'm using (ImpactJS) then allows me to calculate the distance from my light source entity to every instance of this grid block entity. I can then replace the tile underneath each of those grid block tiles with a tile of the appropriate transparency. Currently I'm doing the calculation like this in each instance of the grid block entity that is spawned on the map: var dist = this.distanceTo( ig.game.player ); var percentage = 100 * dist / 960; if (percentage < 2) { // Spawns tile 64 of the shadow spectrum tilesheet at the specified position ig.game.backgroundMaps[2].setTile( this.pos.x, this.pos.y, 64 ); } else if (percentage < 4) { ig.game.backgroundMaps[2].setTile( this.pos.x, this.pos.y, 63 ); } else if (percentage < 6) { ig.game.backgroundMaps[2].setTile( this.pos.x, this.pos.y, 62 ); } // etc... (sorry about the weird spacing, I still haven't gotten the hang of pasting code in here properly) The problem is that like I said, this type of calculation does not make the light source look very natural. Tile switching looks too sharp whereas ideally they would fade in and out smoothly using the spectrum tilesheet (I copied the tilesheet from another game that manages to do this, so I know it's not a problem with the tile shades. I'm just not sure how the other game is doing it). I'm thinking that perhaps my method of using percentages to switch out tiles could be replaced with a better/more dynamic proximity forumla of some sort that would allow for smoother transitions? Might anyone have any ideas for what I can do to improve the visuals here, or a better way of calculating proximity with the information I'm collecting about each tile? (PS: I'm reposting this from Stack Overflow at someone's suggestion, sorry about the duplicate!)

    Read the article

  • Drawing a circle in opengl es android, squiggly boundaries

    - by ladiesMan217
    I am new to OpenGL ES and facing a hard time drawing a circle on my GLSurfaceView. Here's what I have so far. the Circle Class public class MyGLBall { private int points=40; private float vertices[]={0.0f,0.0f,0.0f}; private FloatBuffer vertBuff; //centre of circle public MyGLBall(){ vertices=new float[(points+1)*3]; for(int i=3;i<(points+1)*3;i+=3){ double rad=(i*360/points*3)*(3.14/180); vertices[i]=(float)Math.cos(rad); vertices[i+1]=(float) Math.sin(rad); vertices[i+2]=0; } ByteBuffer bBuff=ByteBuffer.allocateDirect(vertices.length*4); bBuff.order(ByteOrder.nativeOrder()); vertBuff=bBuff.asFloatBuffer(); vertBuff.put(vertices); vertBuff.position(0); } public void draw(GL10 gl){ gl.glPushMatrix(); gl.glTranslatef(0, 0, 0); // gl.glScalef(size, size, 1.0f); gl.glColor4f(1.0f,1.0f,1.0f, 1.0f); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertBuff); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, points/2); gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glPopMatrix(); } } I couldn't retrieve the screenshot of my image but here's what it looks like As you can see the border has crests and troughs thereby renering it squiggly which I do not want. All I want is a simple curve

    Read the article

  • How to create a slipstreamed SharePoint Server 2010 SP1 and August Cumulative Update install

    - by ybbest
    When install SharePoint2010 ,you normally need to install the base the install and then install each Service Pack and cumulative update.Fortunately , there is an easy way to install the base and all the update at once.It is normally called slipstream installation.You need to follow the steps below. 1.Open the command prompt and extract the file using the command below. office2010-kb2553048-fullfile-x64-glb.exe \extract.\SP2010 Aug Update 2.Doing the same for SP1 and August cumulative update. 3.Next , you need to copy all the update files to the Updates folder under the base install. 4.Now , you are ready to install SharePoint2010 now , just click the PrerequisiteInstaller to install the prerequisite files. 5.Finally , you can click the setup.exe to start the installation. References: SharePoint Server 2010 SP1 SharePoint Foundation SP1 Service Pack 1 for SharePoint 2010 Products is Now Available for Download SharePoint Patching and “Action Required” Updates for SharePoint 2010 Products SharePoint Patching and “Action Required”  

    Read the article

  • How do I organize C# classes that inherit from one another, but also have properties that inherit from one another?

    - by Chris
    I have an application that has a concept of a Venue, a place where events happen. A Venue is owned by a Company and has many VenueParts. So, it looks like this: public abstract class Venue { public int Id { get; set; } public string Name { get; set; } public virtual Company Company { get; set; } public virtual ICollection<VenuePart> VenueParts { get; set; } } A Venue can be a GolfCourseVenue, which is a Venue that has a Slope and a specific kind of VenuePart called a HoleVenuePart: public class GolfCourseVenue { public string Slope { get; set; } public virtual ICollection<HoleVenuePart> Holes { get; set; } } In the future, there may also be other kinds of Venues that all inherit from Venue. They might add their own fields, and will always have VenueParts of their own specific type. My declarations above seem wrong, because now I have a GolfCourseVenue with two collections, when really it should just have the one. I can't override it, because the type is different, right? When I run reports, I would like to refer to the classes generically, where I just spit out Venues and VenueParts. But, when I render forms and such, I would like to be specific. I have a lot of relationships like this and am wondering what I am doing wrong. For example, I have an Order that has OrderItems, but also specific kinds of Orders that have specific kinds of OrderItems.

    Read the article

  • Imports and Depends

    - by David Diez
    I have read two recent posts that discuss Depends and Imports but I have four lingering, related questions: Suppose I want two packages to also be available to the end-user when they load in my package. Is there a good reason not to use Depends in this context? (The point here is to load all three packages via a command that loads just the one package.) Is it okay to specify a package in both the Depends and Imports fields? If a package is listed in Depends, is there a point to also listing it in Imports? Or are the benefits of Imports already negated by using Depends? [Added Question] Is the following correct? A package should be listed in the Imports field of the DESCRIPTION file if and only if the package is imported (in whole or in part) in the NAMESPACE file. Thanks much! David

    Read the article

  • C# Linq: Restructuring object

    - by Ben
    I'd like to take an object like this: SortedList<string, SortedList<int, SortedList<DateTime, double>>> Data and, for a given 'int' value (key of first nested sorted list), restructure it like this: SortedList<DateTime, SortedList<string, double>> or, better yet, this: SortedList<DateTime, double[]> where each 'double[]' has as many elements as there are KeyValue pairs in the SortedList. I'm guessing Linq is the way to go, but can't figure it out. Thanks for any suggestions.

    Read the article

  • Is unnecessary error handling recommended in business logic? eg. Null check/Percentage limit check etc

    - by novice_at_work
    We usually put unnecessary checks in our business logic to avoid failures. Eg. 1. public ObjectABC funcABC(){ ObjectABC obj = new ObjectABC; .......... .......... //its never set to null here. .......... return obj; } ObjectABC o = funABC(); if(o!=null){ //do something } Why do we need this null check if we are sure that it will never be null? Is it a good practice or not? 2. int pplReached = funA(..,..,..); int totalPpl = funB(..,..,..); funA() just puts a few more restriction over result of funB(). Double percentage = (totalPpl==0||totalPpl<pplReached) ? 0.0 : pplReached/totalPpl; Do we again need this check? The questions is: Aren't we swallowing some fundamental issue by putting such checks? Issues which should be shown ideally, are avoided by putting these checks. What is the recommended way?

    Read the article

  • Sudden issues reading uncompressed video using opencv

    - by JohnSavage
    I have been using a particular pipeline to process video using opencv to encode uncompressed video (fourcc = 0), and opencv python bindings to then open and work on these files. This has been working fine for me on OpenCV 2.3.1a on Ubuntu 11.10 until just a few days ago. For some reason it currently is only allowing me to read the first frame of a given file the first time I open that file. Further frames are not read, and once I touch the file once with my program, it then cannot even read the first frame. More detail: I created the uncompressed video files as follows: out_video.open(out_vid_name, 0, // FOURCC = 0 means record raw fps, Size(640, 480)) Again, these videos worked fine for me until about a week ago. Now, when I try to open one of these I get the following message (from what I think is ffmpeg): Processing video.avi Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later. [avi @ 0x29251e0] parser not found for codec rawvideo, packets or times may be invalid. It reads and displays the first frame fine, but then fails to read the next frame. Then, when I try to run my code on the same video, the capture still opens with the same message as above. However, it cannot even read the very first frame. Here is the code to open the capture: self.capture = cv2.VideoCapture(filename) if not self.capture.isOpened() print "Error: could not open capture" sys.exit() Again, this part is passed without any issue, but then the break happens at: success, rgb = self.capture.read() if not success: print "error: could not read frame" return False This part breaks at the second frame on the first run of the video file, and then on the first frame on subsequent runs. I really don't know where to even begin debugging this. Please help!

    Read the article

  • UrlRewriteFilter Direct to https

    - by adi
    I am using UrlRewriteFilter to redirect to SSL. I am running Glassfishv2. My rule looks something like this now. It's in my urlrewrite.xml in WEB-INF of my war folder. Is there any other glassfish setting that needs to be set? <rule> <condition name="host" operator="notequal">https://abc.def.com</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to> </rule> But FF keeps saying that the URL redirect rule is in a way that it will never complete. I am not exactly sure whats happening here. any ideas?

    Read the article

  • LINQ, creating unique collection of a collection

    - by Wish
    I have class Vertex and a class Edge (Edge holds 2 properties - Vertex Source and Vertex Target); Edges and Vertexes are collected into lists Some example: A-->B // edge from vertex A to B B-->C // edge from vertex B to C C-->A // edge from vertex C to A A-->C // edge from vertex A to C -- this is two way edge So I would like to make IDictionary<Edge, bool> which would hold edges (A--B and B--A would be like 1), and bool - if it is two way or no. I need it because when I draw them now, it draws 2 arrows under one another. I would better make 1 arrow. So I'm pretty stuck right here... May anybody help me a bit ?

    Read the article

  • Html5 - Callback when media is ready on iPad wont work

    - by Kap
    I'm trying to add a callback to a HTML5 audio element on an iPad. I added an eventlistener to the element, the myOtherThing() starts but there is no sound. If I pause and the play the sound again the audio starts. This works in chrome. Does anyone have an idea how I can do this? myAudioElement.src = "path_to_file"; addEventListener("canplay", function(){ myAudioElement.play(); myOtherThing.start(); }); SOLVED Just wanted to share my solution here, just in case someone else needs it. As far as I understand the iPad does not trigger any events without user interactions. So to be able to use "canply", "playing" and all the other events you need to use the built in media controller. Once you press play in that controller, the events gets triggered. After that you can use your custom interface.

    Read the article

  • Inverse relationship of two variables

    - by Jam
    this one is maybe pretty stupid.. Or I am just exhausted or something, but I just cant seem to solve it.. Problem : two variables X and Y, value of Y is dependent on value of X. X can have values ranging from some value to some value (lets say from 0 to 250) and y can have different values (lets say from 0.1 to 1.0 or something..) - but it is inverse relatonship (what I mean is: if value of X is e.g. 250, then value of Y would be 0.1 and when X decreases up to 0, value of Y raises up to 1.0.. So how should I do it? lets say I have function: -- double computeValue (double X) { /computation/ return Y; } Also, is there some easy way to somehow make the scaling of the function not so linear? - For example when X raises, Y decreases slower at first but then more rapidly in the end.. (rly dont know how to say it but I hope you guys got it) Thanks in advance for this stupid question :/

    Read the article

  • Replace token in ANTLR

    - by user1019710
    I want to replace a token using ANTLR. I tried with TokenRewriteStream and replace, but it didn't work. Any suggestions? ANTLRStringStream in = new ANTLRStringStream(source); MyLexer lexer = new MyLexer(in); TokenRewriteStream tokens = new TokenRewriteStream(lexer); for(Object obj : tokens.getTokens()) { CommonToken token = (CommonToken)obj; tokens.replace(token, "replacement"); } The lexer finds all occurences of single-line comments, and i want to replace them in the original source too.

    Read the article

  • symfony 1.4 embedForm not returning all embedded forms

    - by Patrick
    I have a form with multiple embedded forms and symfony is not binding all the embedded forms. The layout is a m-to-m layout: activity: id: link: id: activity_id: FOREIGN KEY to activity table other_data_id: FOREIGN KEY to other_data table other_data: id: For instance I have 7 identical embedded forms iterated at the end of each name (ie- form_1, form_2, ..., form_7). With the new and edit forms all the 7 fields display properly, but when I submit the form, the embedded forms after a certain number just aren't in the embedded forms array of the sfForm. I have two different embedded forms, the first form stops binding at 5 and the second form stops binding at 4. I've looked at the array of posted values through $request->getPostParameters(); and all the fields are there. If I manually enter the data into the database, the binding works without a problem. Any ideas would be greatly appreciated!

    Read the article

  • drawing to a JPanel without inheritance

    - by g.rocket
    Right now I'm working on a program that throws up a bunch of separate (generated at runtime) images, each in their own window. To do this i've tried this approach: public void display(){ JFrame window = new JFrame("NetPart"); JPanel canvas = new JPanel(); window.getContentPane().add(canvas); Graphics g = canvas.getGraphics(); Dimension d = getSize(); System.out.println(d); draw(g,new Point(d.minX*50,d.maxY*50), 50); window.setSize(d.size(50)); window.setResizable(false); window.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); window.setVisible(true); } public void draw(Graphics g, Point startLoc, int scale){ // generate and draw the image } public Dimension getSize(){ //returns my own dimensions class } However, this throws a NullPointerException in draw, claiming that the graphics is null. is there any way to externally draw to a JPanel from outside it (not inherit from JPanel and override PaintComponent)? Any help would be appreciated.

    Read the article

  • Categorize the approximate shape of an array of Points in 3D Space

    - by user1295133
    I have a set of points in 3d space and I want to be able to categorize the shape that best fits them - cube, sphere, cylinder, planar (flat) etc. I've looked at supervised/machine learning but since I need first generate a large training data set that's not really suitable. My dream solution would be a java library with a wonderful magical function something like : public enum ShapeType { CUBE, SPHERE, CYLINDER, PLANAR } public ShapeType CategorizeShapeFromPoints( 3DPoint[] points ) However, any and all help will be appreciated. Thanks

    Read the article

  • What is the basic design idea behind the Scala for-loop implicit box/unboxing of numerical types?

    - by IODEV
    I'm trying to understand the behavior of Scala for-loop implicit box/unboxing of "numerical" types. Why does the two first fail but not the rest? 1) Fails: scala for (i:Long <- 0 to 10000000L) {} <console>:19: error: type mismatch;<br> found : Long(10000000L) required: Int for (i:Long <- 0 to 10000000L) {} ^ 2 Fails: scala for (i <- 0 to 10000000L) {} <console>:19: error: type mismatch; found : Long(10000000L) required: Int for (i <- 0 to 10000000L) {} ^ 3) Works: scala for (i:Long <- 0L to 10000000L) {} 4) Works: scala for (i <- 0L to 10000000L) {}

    Read the article

  • make a default password for password textboxes that can't be reproduced by the client

    - by user420667
    Is it possible to set a password textbox text to text that the user could not reproduce on their end? Like are there special characters that can only be set from the server? For instance, one way to do this would be to use javascript to prevent typing of *'s, and to set the textbox text to be all *'s. But that's hacky. The motivation is to be able to tell on the server if the user changed the password at all, but not to restrict them from having a password of all *'s, for instance.

    Read the article

  • creating a .sh file programmatically under windows and running it on a linux system from cygwin

    - by user1296193
    i want to write program, in windows, which will write a .sh file, then connect to a linux machine via cygwin and ssh, and execute that .sh file. I've had to use dos2unix to convert .sh files that I created in windows to run under linux. Obviously if I am executing a script with ssh it will have to be linux formatted to work. so I need to know how to create a linux appropriate .sh file using c or openoffice basic or vBA. thanks!

    Read the article

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