Daily Archives

Articles indexed Tuesday December 4 2012

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

  • Still no wireless after b43 with Dell Inspiron 1525 (Ubuntu 12.04)

    - by DanielleN
    So I followed the instructions here http://ubuntuforums.org/showthread.php?t=1974006 about how to solve this issue. It worked for a bit and then stopped. After doing a modprobe I could at least see my network and click on it but it would not connect (I can always see it if I look under the listed wireless networks under VPN Connections, however). I'm thinking, from what I read at least, the issue might be that my wireless switch was on during those first steps. Do I now have to undo the b43 install and do it again? Or is there something else I could try? I just made the switch to Linux yesterday, so I am hesitant at this point to mess with anything on my own. I should note now that it was installed by someone who knows what they are doing, so we are all good on that front.

    Read the article

  • How do I get my Lenovo T61 to connect to a wireless network?

    - by Ross Fleming
    I have a Lenovo Thinkpad T61 and the wireless works just fine so I installed Ubuntu straight away only to find that the wireless will not connect, it will see the networks but just not connect. Has anyone managed to solve this all the forums seem to relate to Ubuntu 9.04 and before. Edit:Sorry about that, I didn't realise that there were 2 models mine is the Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection. Any help is much appreciated.

    Read the article

  • Migrate add-on domain olddomain.com to newdomain.com

    - by eHx
    I have 2 domains that are registered at GoDaddy : domaina.com (not hosted, only domain name is registered to GD) domainb.com (hosted at a different webhost, domain name registered to GD) domainb.com is an already working site, with a different webhost, but the domain name is registered to GoDaddy(and I assume the nameservers are changed to redirect to the webhost). Now, I don't understand why this was done, but domainb.com is considered a subdomain on the host... meaning the files are in a seperate folder on the server. Ex : public-html/domainb.com/public-html/FILES The structure is similar to this on the webhost : HostNAME (main root folder) domainb.com (subdomain of hostname) domainc.com (etc...) domaind.com (etc...) I want to transfer the site domainb.com to domaina.com, meaning domaina.com will become the new website, without having to re-upload all the content and CMS. The old one will redirect to domaina.com once the transfer is done (using 301 redirects). Can anyone tell me how I can do this?

    Read the article

  • circle - rectangle collision in 2D, most efficient way

    - by john smith
    Suppose I have a circle intersecting a rectangle, what is ideally the least cpu intensive way between the two? method A calculate rectangle boundaries loop through all points of the circle and, for each of those, check if inside the rect. method B calculate rectangle boundaries check where the center of the circle is, compared to the rectangle make 9 switch/case statements for the following positions: top, bottom, left, right top left, top right, bottom left, bottom right inside rectangle check only one distance using the circle's radius depending on where the circle happens t be. I know there are other ways that are definitely better than these two, and if could point me a link to them, would be great but, exactly between those two, which one would you consider to be better, regarding both performance and quality/precision? Thanks in advance.

    Read the article

  • Handling game logic events by behavior components

    - by chehob
    My question continues on topic discussed here I have tried implementing attribute/behavior design and here is a quick example demonstrating the issue. class HealthAttribute : public ActorAttribute { public: HealthAttribute( float val ) : mValue( val ) { } float Get( void ) const { return mValue; } void Set( float val ) { mValue = val; } private: float mValue; }; class HealthBehavior : public ActorBehavior { public: HealthBehavior( shared_ptr< HealthAttribute > health ) : pHealth( health ) { // Set OnDamage() to listen for game logic event "DamageEvent" } void OnDamage( IEventDataPtr pEventData ) { // Check DamageEvent target entity // ( compare my entity ID with event's target entity ID ) // If not my entity, do nothing // Else, modify health attribute with received DamageEvent data } protected: shared_ptr< HealthAttribute > pHealth; }; My question - is it possible to get rid of this annoying check for game logic events? In the current implementation when some entity must receive damage, game logic just fires off event that contains damage value and the entity id which should receive that damage. And all HealthBehaviors are subscribed to the DamageEvent type, which leads to any entity possesing HealthBehavior call OnDamage() even if he is not the addressee.

    Read the article

  • Black Screen: How to set Projection/View Matrix

    - by Lisa
    I have a Windows Phone 8 C#/XAML with DirectX component project. I'm rendering some particles, but each particle is a rectangle versus a square (as I've set the vertices to be positions equally offset from each other). I used an Identity matrix in the view and projection matrix. I decided to add the windows aspect ratio to prevent the rectangles. But now I get a black screen. None of the particles are rendered now. I don't know what's wrong with my matrices. Can anyone see the problem? These are the default matrices in Microsoft's project example. View Matrix: XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f); XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f); XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(XMMatrixLookAtRH(eye, at, up))); Projection Matrix: void CubeRenderer::CreateWindowSizeDependentResources() { Direct3DBase::CreateWindowSizeDependentResources(); float aspectRatio = m_windowBounds.Width / m_windowBounds.Height; float fovAngleY = 70.0f * XM_PI / 180.0f; if (aspectRatio < 1.0f) { fovAngleY /= aspectRatio; } XMStoreFloat4x4(&m_constantBufferData.projection, XMMatrixTranspose(XMMatrixPerspectiveFovRH(fovAngleY, aspectRatio, 0.01f, 100.0f))); } I've tried modifying them to use cocos2dx's WP8 example. XMMATRIX identityMatrix = XMMatrixIdentity(); float fovy = 60.0f; float aspect = m_windowBounds.Width / m_windowBounds.Height; float zNear = 0.1f; float zFar = 100.0f; float xmin, xmax, ymin, ymax; ymax = zNear * tanf(fovy * XM_PI / 360); ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; XMMATRIX tmpMatrix = XMMatrixPerspectiveOffCenterRH(xmin, xmax, ymin, ymax, zNear, zFar); XMMATRIX projectionMatrix = XMMatrixMultiply(tmpMatrix, identityMatrix); // View Matrix float fEyeX = m_windowBounds.Width * 0.5f; float fEyeY = m_windowBounds.Height * 0.5f; float fEyeZ = m_windowBounds.Height / 1.1566f; float fLookAtX = m_windowBounds.Width * 0.5f; float fLookAtY = m_windowBounds.Height * 0.5f; float fLookAtZ = 0.0f; float fUpX = 0.0f; float fUpY = 1.0f; float fUpZ = 0.0f; XMMATRIX tmpMatrix2 = XMMatrixLookAtRH(XMVectorSet(fEyeX,fEyeY,fEyeZ,0.f), XMVectorSet(fLookAtX,fLookAtY,fLookAtZ,0.f), XMVectorSet(fUpX,fUpY,fUpZ,0.f)); XMMATRIX viewMatrix = XMMatrixMultiply(tmpMatrix2, identityMatrix); XMStoreFloat4x4(&m_constantBufferData.view, viewMatrix); Vertex Shader cbuffer ModelViewProjectionConstantBuffer : register(b0) { //matrix model; matrix view; matrix projection; }; struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; PixelInputType main(VertexInputType input) { PixelInputType output; // Change the position vector to be 4 units for proper matrix calculations. input.position.w = 1.0f; //===================================== // TODO: ADDED for testing input.position.z = 0.0f; //===================================== // Calculate the position of the vertex against the world, view, and projection matrices. //output.position = mul(input.position, model); output.position = mul(input.position, view); output.position = mul(output.position, projection); // Store the texture coordinates for the pixel shader. output.tex = input.tex; // Store the particle color for the pixel shader. output.color = input.color; return output; } Before I render the shader, I set the view/projection matrices into the constant buffer void ParticleRenderer::SetShaderParameters() { ViewProjectionConstantBuffer* dataPtr; D3D11_MAPPED_SUBRESOURCE mappedResource; DX::ThrowIfFailed(m_d3dContext->Map(m_constantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)); dataPtr = (ViewProjectionConstantBuffer*)mappedResource.pData; dataPtr->view = m_constantBufferData.view; dataPtr->projection = m_constantBufferData.projection; m_d3dContext->Unmap(m_constantBuffer.Get(), 0); // Now set the constant buffer in the vertex shader with the updated values. m_d3dContext->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf() ); // Set shader texture resource in the pixel shader. m_d3dContext->PSSetShaderResources(0, 1, &m_textureView); } Nothing, black screen... I tried so many different look at, eye, and up vectors. I tried transposing the matrices. I've set the particle center position to always be (0, 0, 0), I tried different positions too, just to make sure they're not being rendered offscreen.

    Read the article

  • XNA 2D Top Down game - FOREACH didn't work for checking Enemy and Switch-Tile

    - by aldroid16
    Here is the gameplay. There is three condition. The player step on a Switch-Tile and it became false. 1) When the Enemy step on it (trapped) AND the player step on it too, the Enemy will be destroyed. 2) But when the Enemy step on it AND the player DIDN'T step on it too, the Enemy will be escaped. 3) If the Switch-Tile condition is true then nothing happened. The effect is activated when the Switch tile is false (player step on the Switch-Tile). Because there are a lot of Enemy and a lot of Switch-Tile, I have to use foreach loop. The problem is after the Enemy is ESCAPED (case 2) and step on another Switch-Tile again, nothing happened to the enemy! I didn't know what's wrong. The effect should be the same, but the Enemy pass the Switch tile like nothing happened (They should be trapped) Can someone tell me what's wrong? Here is the code : public static void switchUpdate(GameTime gameTime) { foreach (SwitchTile switch in switchTiles) { foreach (Enemy enemy in EnemyManager.Enemies) { if (switch.Active == false) { if (!enemy.Destroyed) { if (switch.IsCircleColliding(enemy.EnemyBase.WorldCenter, enemy.EnemyBase.CollisionRadius)) { enemy.EnemySpeed = 10; //reducing Enemy Speed if it enemy is step on the Tile (for about two seconds) enemy.Trapped = true; float elapsed = (float)gameTime.ElapsedGameTime.Milliseconds; moveCounter += elapsed; if (moveCounter> minMoveTime) { //After two seconds, if the player didn't step on Switch-Tile. //The Enemy escaped and its speed back to normal enemy.EnemySpeed = 60f; enemy.Trapped = false; } } } } else if (switch.Active == true && enemy.Trapped == true && switch.IsCircleColliding(enemy.EnemyBase.WorldCenter, enemy.EnemyBase.CollisionRadius) ) { //When the Player step on Switch-Tile and //there is an enemy too on this tile which was trapped = Destroy Enemy enemy.Destroyed = true; } } } }

    Read the article

  • Precise Touch Screen Dragging Issue: Trouble Aligning with the Finger due to Different Screen Resolution

    - by David Dimalanta
    Please, I need your help. I'm trying to make a game that will drag-n-drop a sprite/image while my finger follows precisely with the image without being offset. When I'm trying on a 900x1280 (in X [900] and Y [1280]) screen resolution of the Google Nexus 7 tablet, it follows precisely. However, if I try testing on a phone smaller than 900x1280, my finger and the image won't aligned properly and correctly except it still dragging. This is the code I used for making a sprite dragging with my finger under touchDragged(): x = ((screenX + Gdx.input.getX())/2) - (fruit.width/2); y = ((camera_2.viewportHeight * multiplier) - ((screenY + Gdx.input.getY())/2) - (fruit.width/2)); This code above will make the finger and the image/sprite stays together in place while dragging but only works on 900x1280. You'll be wondering there's camera_2.viewportHeight in my code. Here are for two reasons: to prevent inverted drag (e.g. when you swipe with your finger downwards, the sprite moves upward instead) and baseline for reading coordinate...I think. Now when I'm adding another orthographic camera named camera_1 and changing its setting, I recently used it for adjusting the falling object by meter per pixel. Also, it seems effective independently for smartphones that has smaller resolution and this is what I used here: show() camera_1 = new OrthographicCamera(); camera_1.viewportHeight = 280; // --> I set it to a smaller view port height so that the object would fall faster, decreasing the chance of drag force. camera_1.viewportWidth = 196; // --> Make it proportion to the original screen view size as possible. camera_1.position.set(camera_1.viewportWidth * 0.5f, camera_1.viewportHeight * 0.5f, 0f); camera_1.update(); touchDragged() x = ((screenX + (camera_1.viewportWidth/Gdx.input.getX()))/2) - (fruit.width/2); y = ((camera_1.viewportHeight * multiplier) - ((screenY + (camera_1.viewportHeight/Gdx.input.getY()))/2) - (fruit.width/2)); But the result instead of just following the image/sprite closely to my finger, it still has a space/gap between the sprite/image and the finger. It is possibly dependent on coordinates based on the screen resolution. I'm trying to drag the blueberry sprite with my finger. My expectation did not met since I want my finger and the sprite/image (blueberry) to stay close together while dragging until I release it. Here's what it looks like: I got to figure it out how to make independent on all screen sizes by just following the image/sprite closely to my finger while dragging even on most different screen sizes instead.

    Read the article

  • Keeping Aspect Screen Ratio While Stays in Center

    - by David Dimalanta
    I sqw and I tried this suggestion on PISTACHIO BRAINSTORMIN* on how to make a good and adaptive screen ration. For every different screen size, let's say I put the perfect circle as a Texture in LibGDX and played it on screen. Here's the blueberry image example and it's perfectly rounded: When I played it on the Google Nexus 7, the circle turn into a slightly oblonng shape, resembling as it was being flatten a bit. Please observe this snapshot below and you can see the blueberry is almost but slightly not perfectly rounded: Now, when I tried the suggested code for aspect ratio, the perfect circle retained but another problem is occured. The problem is that I expecting for a view on center but instead it's been moved to the right offset leaving with a half black screen. This would be look like this: Here is my code using the suggested screen aspect ratio code: Class' Field // Ingredients Needed for Screen Aspect Ratio private static final int VIRTUAL_WIDTH = 720; private static final int VIRTUAL_HEIGHT = 1280; private static final float ASPECT_RATIO = ((float) VIRTUAL_WIDTH)/((float) VIRTUAL_HEIGHT); private Camera Mother_Camera; private Rectangle Viewport; render() // Camera updating... Mother_Camera.update(); Mother_Camera.apply(Gdx.gl10); // Reseting viewport... Gdx.gl.glViewport((int) Viewport.x, (int) Viewport.y, (int) Viewport.width, (int) Viewport.height); // Clear previous frame. Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); show() Mother_Camera = new OrthographicCamera(VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Was this code useful for screen aspect ratio-proportion fixing or it is statically dependent on actual device's width and height? *see http://blog.acamara.es/2012/02/05/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/#comment-317

    Read the article

  • How can I get the palette of an 8-bit surface in SDL.NET/Tao.SDL?

    - by lolmaster
    I'm looking to get the palette of an 8-bit surface in SDL.NET if possible, or (more than likely) using Tao.SDL. This is because I want to do palette swapping with the palette directly, instead of blitting surfaces together to replace colours like how you would do it with a 32-bit surface. I've gotten the SDL_Surface and the SDL_PixelFormat, however when I go to get the palette in the same way, I get a System.ExecutionEngineException: private Tao.Sdl.Sdl.SDL_Palette GetPalette(Surface surf) { // Get surface. Tao.Sdl.Sdl.SDL_Surface sdlSurface = (Tao.Sdl.Sdl.SDL_Surface)System.Runtime.InteropServices.Marshal.PtrToStructure(surf.Handle, typeof(Tao.Sdl.Sdl.SDL_Surface)); // Get pixel format. Tao.Sdl.Sdl.SDL_PixelFormat pixelFormat = (Tao.Sdl.Sdl.SDL_PixelFormat)System.Runtime.InteropServices.Marshal.PtrToStructure(sdlSurface.format, typeof(Tao.Sdl.Sdl.SDL_PixelFormat)); // Execution exception here. Tao.Sdl.Sdl.SDL_Palette palette = (Tao.Sdl.Sdl.SDL_Palette)System.Runtime.InteropServices.Marshal.PtrToStructure(pixelFormat.palette, typeof(Tao.Sdl.Sdl.SDL_Palette)); return palette; } When I used unsafe code to get the palette, I got a compile time error: "Cannot take the address of, get the size of, or declare a pointer to a managed type ('Tao.Sdl.Sdl.SDL_Palette')". My unsafe code to get the palette was this: unsafe { Tao.Sdl.Sdl.SDL_Palette* pal = (Tao.Sdl.Sdl.SDL_Palette*)pixelFormat.palette; } From what I've read, a managed type in this case is when a structure has some sort of reference inside it as a field. The SDL_Palette structure happens to have an array of SDL_Color's, so I'm assuming that's the reference type that is causing issues. However I'm still not sure how to work around that to get the underlying palette. So if anyone knows how to get the palette from an 8-bit surface, whether it's through safe or unsafe code, the help would be greatly appreciated.

    Read the article

  • How to solve High Load average issue in Linux systems?

    - by RoCkStUnNeRs
    The following is the different load with cpu time in different time limit . The below output has parsed from the top command. TIME LOAD US SY NICE ID WA HI SI ST 12:02:27 208.28 4.2%us 1.0%sy 0.2%ni 93.9%id 0.7%wa 0.0%hi 0.0%si 0.0%st 12:23:22 195.48 4.2%us 1.0%sy 0.2%ni 93.9%id 0.7%wa 0.0%hi 0.0%si 0.0%st 12:34:55 199.15 4.2%us 1.0%sy 0.2%ni 93.9%id 0.7%wa 0.0%hi 0.0%si 0.0%st 13:41:50 203.66 4.2%us 1.0%sy 0.2%ni 93.8%id 0.8%wa 0.0%hi 0.0%si 0.0%st 13:42:58 278.63 4.2%us 1.0%sy 0.2%ni 93.8%id 0.8%wa 0.0%hi 0.0%si 0.0%st Following is the additional Information of the system? cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz stepping : 10 cpu MHz : 1992.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr dca sse4_1 lahf_lm bogomips : 4658.69 clflush size : 64 power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz stepping : 10 cpu MHz : 1992.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 1 cpu cores : 4 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr dca sse4_1 lahf_lm bogomips : 4655.00 clflush size : 64 power management: processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz stepping : 10 cpu MHz : 1992.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 2 cpu cores : 4 apicid : 2 initial apicid : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr dca sse4_1 lahf_lm bogomips : 4655.00 clflush size : 64 power management: processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz stepping : 10 cpu MHz : 1992.000 cache size : 6144 KB physical id : 0 siblings : 4 core id : 3 cpu cores : 4 apicid : 3 initial apicid : 3 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr dca sse4_1 lahf_lm bogomips : 4654.99 clflush size : 64 power management: Memory: total used free shared buffers cached Mem: 2 1 1 0 0 0 Swap: 5 0 5 let me know why the system is getting abnormally this much high load?

    Read the article

  • EF Code First - Relationships

    - by CaffGeek
    I have these classes public class EntityBase : IEntity { public int Id { get; set; } public DateTime Created { get; set; } public string CreatedBy { get; set; } public DateTime Updated { get; set; } public string UpdatedBy { get; set; } } public class EftInterface : EntityBase { public string Name { get; set; } public Provider Provider { get; set; } public List<BusinessUnit> BusinessUnits { get; set; } } public class Provider : EntityBase, IEntity { public string Name { get; set; } public decimal DefaultDebitLimit { get; set; } public decimal DefaultCreditLimit { get; set; } public decimal TreasuryDebitLimit { get; set; } public decimal TreasuryCreditLimit { get; set; } } public class BusinessUnit : EntityBase { public string Name { get; set; } } An interface, is really a Provider, with a collection of Business Units. The issue is that while my db model ends up having a correct EftInterfaces table, with a FK to Provider_Id, the BusinessUnits table has a FK to EftInterface_Id. But, a BusinessUnit can be included in more than one EftInterface. I need a many to many relationship. A BusinessUnit can be part of many EftInterfaces, and an EftInterface can contain many BusinessUnits. How can I get CodeFirst to generate the many-to-many table?

    Read the article

  • SQL server recursive query error.The maximum recursion 100 has been exhausted before statement completion

    - by ienax_ridens
    I have a recursive query that returns an error when I run it; in other databases (with more data) I have not the problem. In my case this query returns 2 colums (ID_PARENT and ID_CHILD) doing a recursion because my tree can have more than one level, bit I wanna have only "direct" parent. NOTE: I tried to put OPTION (MAXRECURSION 0) at the end of the query, but with no luck. The following query is only a part of the entire query, I tried to put OPTION only at the end of the "big query" having a continous running query, but no errors displayed. Error have in SQL Server: "The statement terminated.The maximum recursion 100 has been exhausted before statement completion" The query is the following: WITH q AS (SELECT ID_ITEM, ID_ITEM AS ID_ITEM_ANCESTOR FROM ITEMS_TABLE i JOIN ITEMS_TYPES_TABLE itt ON itt.ID_ITEM_TYPE = i.ID_ITEM_TYPE UNION ALL SELECT i.ID_ITEM, q.ID_ITEM_ANCESTOR FROM q JOIN ITEMS_TABLE i ON i.ID_ITEM_PADRE = q.ID_ITEM JOIN ITEMS_TYPES_TABLE itt ON itt.ID_ITEM_TYPE = i.ID_ITEM_TYPE) SELECT ID_ITEM AS ID_CHILD, ID_ITEM_ANCESTOR AS ID_PARENT FROM q I need a suggestion to re-write this query to avoid the error of recursion and see the data, that are few.

    Read the article

  • SQL Server- PIVOT table. transform row into columns

    - by Matt
    I am trying to convert rows into columns. here is my query SELECT M.urn, M.eventdate, M.eventlocation, M.eventroom, M.eventbed, N.time FROM admpatevents M INNER JOIN admpattransferindex N ON M.urn = N.urn AND M.eventseqno = N.eventseqno AND M.eventdate = N.eventdate WHERE M.urn = 'F1002754364' AND M.eventcode = 'TFRADMIN' Current result URN Date Location Room Bed Time F1002754364 20121101 EDEXPRESS 4-152 02 0724 F1002754364 20121101 CARDSURG 3-110 02 1455 F1002754364 20121102 CHEST UNIT 6-129-GL04 1757 required result F1002754364 20121101 EDEXPRESS 4-152 02 0724 20121101 CARDSURG 3-110 02 1455 20121102 CHEST UNIT 6-129-GL 04 1757 Thanks for your help.

    Read the article

  • deliver c++ application for the final customer

    - by Nebrass
    I am working on a c++ windows application on visual studio 2010. I want to deliver my application to my customer so he can use it easly, without the obligation of installing visual runtime fx. And to be executed every where. How do I set up the installer so that the customer does not need to separately install any required Visual Studio runtime libraries? Please i want a solution for this problem, because my costumers are so far from computing, they love just "next, next, install, finish" system. Thank you for your help.

    Read the article

  • One Common View In Every ViewController

    - by l3v
    I am having a hard time wording this when searching the internet so I am just going to ask the question. I have an options view in my app that slides into view when the user clicks a button. This options view will display app information like settings. I want this options view to be displayed on every view controller in my app. I do not want to copy and paste the code for the options view into every viewcontroller file. The options view has quite a few outlets and actions and also calls many delegates. How can I reuse this options view in all my view controllers without adding all the outlets, actions, and delegate methods each time? I was going to make a new file with public methods, but I would still have to copy the outlets. Would this public methods file have to include delegate methods as well then? Let me know if my question does not make sense. I am hoping there is a standard way of implementing something like this.

    Read the article

  • Refresher on Java classes in separate files

    - by JohnFaig
    I need a refresher on moving classes from one file into two files. My sample code is in one file called "external_class_file_main". The program runs fine and the code is shown below: Public class external_class_file_main { public static int get_a_random_number (int min, int max) { int n; n = (int)(Math.random() * (max - min +1)) + min; return (n); } public static void main(String[] args) { int r; System.out.println("Program starting..."); r = get_a_random_number (1, 5); System.out.println("random number = " + r); System.out.println("Program ending..."); } } I move the get_a_random_number class to a separate file called "external_class_file". When I do this, I get the following error: Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method get_a_random_number(int, int) is undefined for the type external_class_file_main at external_class_file_main.main(external_class_file_main.java:20) The "external_class_file_main" now contains: public class external_class_file_main { public static void main(String[] args) { int r; System.out.println("Program starting..."); r = get_a_random_number (1, 5); System.out.println("random number = " + r); System.out.println("Program ending..."); } } The "external_class_file" now contains: public class external_class_file { public static int get_a_random_number (int min, int max) { int n; n = (int)(Math.random() * (max - min +1)) + min; return (n); } }

    Read the article

  • C# Minimize all running windows when application runs

    - by Derek
    I am working on a C# windows form application. How can i edit my code in a way that when more than 2 faces is being detected by my webcam. More information: When "FaceDetectedLabel.Text = "Faces Detected : " + cam.facesdetected.ToString();" becomes Face Detected: 2 or more... How can i do the following: Minimize all program running except my application. Log out of my computer Here is my code: namespace PBD { public partial class MainPage : Form { //declaring global variables private Capture capture; //takes images from camera as image frames public MainPage() { InitializeComponent(); } private void ProcessFrame(object sender, EventArgs arg) { Wrapper cam = new Wrapper(); //show the image in the EmguCV ImageBox WebcamPictureBox.Image = cam.start_cam(capture).Resize(390, 243, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC).ToBitmap(); FaceDetectedLabel.Text = "Faces Detected : " + cam.facesdetected.ToString(); } private void MainPage_Load(object sender, EventArgs e) { #region if capture is not created, create it now if (capture == null) { try { capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion Application.Idle += ProcessFrame; }

    Read the article

  • How do we simplify this kind of code in Java? Something like macros in C?

    - by Terry Li
    public static boolean diagonals(char[][] b, int row, int col, int l) { int counter = 1; // because we start from the current position char charAtPosition = b[row][col]; int numRows = b.length; int numCols = b[0].length; int topleft = 0; int topright = 0; int bottomleft = 0; int bottomright = 0; for (int i=row-1,j=col-1;i>=0 && j>=0;i--,j--) { if (b[i][j]==charAtPosition) { topleft++; } else { break; } } for (int i=row-1,j=col+1;i>=0 && j<=numCols;i--,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } for (int i=row+1,j=col-1;i<=numRows && j>=0;i++,j--) { if (b[i][j]==charAtPosition) { bottomleft++; } else { break; } } for (int i=row+1,j=col+1;i<=numRows && j<=numCols;i++,j++) { if (b[i][j]==charAtPosition) { bottomright++; } else { break; } } return topleft + bottomright + 1 >= l || topright + bottomleft + 1 >= l; //in this case l is 5 } After I was done posting the code above here, I couldn't help but wanted to simplify the code by merging the four pretty much the same loops into one method. Here's the kind of method I want to have: public int countSteps(char horizontal, char vertical) { } Two parameters horizontal and vertical can be either + or - to indicate the four directions to walk in. What I want to see if possible at all is i++; is generalized to i horizontal horizontal; when horizontal taking the value of +. What I don't want to see is if or switch statements, for example: public int countSteps(char horizontal, char vertical) { if (horizontal == '+' && vertical == '-') { for (int i=row-1,j=col+1;i>=0 && j<=numCols;i--,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } } else if (horizontal == '+' && vertical == '+') { for (int i=row+1,j=col+1;i>=0 && j<=numCols;i++,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } } else if () { } else { } } Since it is as tedious as the original one. Note also that the comparing signs for the loop condition i>=0 && j<=numCols; for example, >= && <= have correspondence with the value combination of horizontal and vertical. Sorry for my bad wording, please let me know if anything is not clear.

    Read the article

  • jQuery cookie behaves differently on local machine vs production server

    - by user1810414
    I'm setting a jQuery cookie for some site javascript effects. I'm setting expiration date to 30 days. On local development machine cookie expiration is set properly, whereas on production expiration is being set to end of session. After inspecting the created cookies with web develoer tools, everything is identical except production machine cookie is marked as "session cookie" and setting expiration is disallowed, while cookie created on local development machine is not set to "session" and expiration date is editable. Is there a way to make production machine cookie accept the expiration date? This is how I set the cookie: $.cookie('skip_animation','skip', 2592000); Using jQuery 1.6.4 (legacy site) All browsers behave the same way

    Read the article

  • LINQ to XML : A query body must end with a select clause or a group clause

    - by Josh
    Can someone guide me on to repairing the error on this query : var objApps = from item in xDoc.Descendants("VHost") where(from x in item.Descendants("Application")) select new clsApplication { ConnectionsTotal = item.Element("ConnectionsTotal").Value }; It displays a compiler error "A query body must end with a select clause or a group clause". Where am I going wrong? Would appreciate any help.. Thanks. Edit : Here is my XML(haven't closed the tags here)...I need the connectioncount values inside the Application.. - <Server> <ConnectionsCurrent>67</ConnectionsCurrent> <ConnectionsTotal>1424182</ConnectionsTotal> <ConnectionsTotalAccepted>1385091</ConnectionsTotalAccepted> <ConnectionsTotalRejected>39091</ConnectionsTotalRejected> <MessagesInBytesRate>410455.0</MessagesInBytesRate> <MessagesOutBytesRate>540146.0</MessagesOutBytesRate> - <VHost> <Name>_defaultVHost_</Name> <TimeRunning>5129615.178</TimeRunning> <ConnectionsLimit>0</ConnectionsLimit> <ConnectionsCurrent>67</ConnectionsCurrent> <ConnectionsTotal>1424182</ConnectionsTotal> <ConnectionsTotalAccepted>1385091</ConnectionsTotalAccepted> <ConnectionsTotalRejected>39091</ConnectionsTotalRejected> <MessagesInBytesRate>410455.0</MessagesInBytesRate> <MessagesOutBytesRate>540146.0</MessagesOutBytesRate> - <Application> <Name>TestApp</Name> <Status>loaded</Status> <TimeRunning>411642.953</TimeRunning> <ConnectionsCurrent>11</ConnectionsCurrent> <ConnectionsTotal>43777</ConnectionsTotal> <ConnectionsTotalAccepted>43135</ConnectionsTotalAccepted> <ConnectionsTotalRejected>642</ConnectionsTotalRejected> <MessagesInBytesRate>27876.0</MessagesInBytesRate> <MessagesOutBytesRate>175053.0</MessagesOutBytesRate>

    Read the article

  • ncurses - resizing glitch

    - by ryyst
    I'm writing an ncurses program and am trying to make it respond correctly to terminal resizing. While I can read the terminal dimensions correctly in my program, ncurses doesn't seem to deal with new dimensions correctly. Here's a (somewhat lengthy) sample program: #include <ncurses.h> #include <string.h> #include <signal.h> #include <sys/ioctl.h> void handle_winch(int sig){ struct winsize w; ioctl(0, TIOCGWINSZ, &w); COLS = w.ws_col; LINES = w.ws_row; wresize(stdscr, LINES, COLS); clear(); mvprintw(0, 0, "COLS = %d, LINES = %d", COLS, LINES); for (int i = 0; i < COLS; i++) mvaddch(1, i, '*'); refresh(); } int main(int argc, char *argv[]){ initscr(); struct sigaction sa; memset(&sa, 0, sizeof(struct sigaction)); sa.sa_handler = handle_winch; sigaction(SIGWINCH, &sa, NULL); while(getch() != 27) {} endwin(); return 0; } If you run it, you can see that the terminal dimensions are correctly retrieved. But the second line, which is supposed to draw *-characters across the screen, doesn't work. Try resizing the window horizontally to make it larger, the line of *s will not get larger. What's the problem here? I'm aware that one can temporarily leave curses mode, but I'd prefer a cleaner solution. Thanks!

    Read the article

  • Is there a way to opt-out from WP8 when submiting an Windows Phone app?

    - by Igor Kulman
    I have a Windows Phone app build using the 7.1 SDK that works great on WP7 but does not work at all on WP8 (I am using multicast using UDP and WP8 can join the group but send/receives no message for some reason, other people having the same problem: UDP multicast group on Windows Phone 8). Is there a way to opt-out from WP8 when I submit my app? I just want the app to be available t WP7 users. I am looking for something like the 256MB opt-out option.

    Read the article

  • MVC4 not binding a list of basic types

    - by admanb
    I cannot, for the life of me, get this data to bind. Here's my JavaScript: var params = { 'InvItemIDs': ["188475", "188490"]}; $.post("api/Orders/OrderFromInventory?" + $.param(params)) and the Controller action: public HttpResponseMessage OrderFromInventory(IList<int> InvItemIDs) { return new HttpResponseMessage(); } I've built the query string so that it's sending: ?InvItemIDs=188475&InvItemIDs=188490 as well as ?InvItemIDs[]=188475&InvItemIDs[]=188490 and even ?InvItemIDs[0]=188475&InvItemIDs[1]=188490 and none of them are binding. InvItemIDs is always null. What am I doing wrong? EDIT: So it turns out all this is a bug (or something) in the new Web API controller code in MVC4. As soon as I moved the exact same code over to a standard controller it started working. I'm still interested if anyone has any insight as to why the Web API would break this binding.

    Read the article

  • AngularJS Templates run twice

    - by Curt
    I'm working on an AngularJS web app with Twitter Bootstrap. The templates run twice. I don't know why they do this. Below is some of the code in the index.html file: <html data-ng-app="app" ng-controller="AppCtrl"> <div class="container ng-view" data-ng-view></div> ... <script> (function (angular) { "use strict"; // jshint ;_; // http://coenraets.org/blog/2012/02/sample-application-with-angular-js/ angular.module('app', ['filters', 'angular', 'currency']) .config(function($routeProvider) { var _view_ = 'view/'; $routeProvider. when('/app', {templateUrl:_view_+'app/index.html', }). when('/account/settings', {templateUrl:_view_+'app/settings.html', }). when('/profile/:profile_ID', {templateUrl:_view_+'app/profile.html', controller:ProfilePageCtrl}). when('/discuss', {templateUrl:_view_+'discuss/discuss.html', controller:DiscussCtrl}). when('/', {templateUrl:_view_+'page/home.html' }). when('/:page', {templateUrl:_view_+'page.html', controller:PageCtrl}). otherwise({redirectTo:'/'}); }) ... Can anybody provide suggestions? Are the templates supposed to run twice? 2012-12-04 Update: I found out that the templates are running twice, not the controller.

    Read the article

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