Search Results

Search found 12222 results on 489 pages for 'initial context'.

Page 37/489 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Prove that the set of regular languages is a proper subset of the set of the context-free languages

    - by David Relihan
    I was brushing up (not homework)on some computation-theory and came accross this problem: How can you prove that the set of regular languages is a proper subset of the set of the context-free languages. Now I know a language is regular iff it is accepted by a finite automaton. And I know a language is context-free iff it is accepted by a pushdown automaton. But I'm not sure of what solution is.

    Read the article

  • Create a Color Picker, similar to Photoshop's, using Javascript and HTML Canvas

    - by André Alçada Padez
    I am not at all versed in Computer Graphics and am in need of creating a color picker as a javascript tool to embed in an HTML page. First, and looking at Photoshop's one, i thought of the RGB palette as a three-dimensional matrix. My first attempt envolved: <script type="text/javascript"> var rgCanvas = document.createElement('canvas'); rgCanvas.width = 256; rgCanvas.height = 256; rgCanvas.style.border = '3px solid black'; for (g = 0; g < 256; g++){ for (r = 0; r < 256; r++){ var context = rgCanvas.getContext('2d'); context.beginPath(); context.moveTo(r,g); context.strokeStyle = 'rgb(' + r + ', ' + g + ', 0)'; context.lineTo(r+1,g+1); context.stroke(); context.closePath(); } } var bCanvas = document.createElement('canvas'); bCanvas.width = 20; bCanvas.height = 256; bCanvas.style.border = '3px solid black'; for (b = 0; b < 256; b++){ var context = bCanvas.getContext('2d'); context.beginPath(); context.moveTo(0,b); context.strokeStyle = 'rgb(' + 0 + ', ' + 0 + ', ' + b + ')'; context.lineTo(20, b); context.stroke(); context.closePath(); } document.body.appendChild(rgCanvas); document.body.appendChild(bCanvas); </script> this results in something like My thought is this is too linear, comparing to the ones i see in Photoshop and on the web. I would like to know the logic behind the color mapping in a picker like this: I don't really need the algorythms itself, i'm mainly trying to understand the logic. Thanks

    Read the article

  • How to disable Middleware and Request Context in some views.

    - by xRobot
    I am creating a chat like facebook chat... so in views.py of my Chat Application, I need to retrieve only the last messages every 3-4 seconds with ajax poll ( the latency is not a problem for me ). If I can disable some Middlewares and some Request Context in this view, the response will be faster... no ? My question is: Is there a way to disable some Middlewares and some Request Context in some views ?

    Read the article

  • Can we use a sql data field as column name instead?

    - by Starx
    First a query SELECT * FROM mytable WHERE id='1' Gives me a certain number of rows For example id | context | cat | value 1 Context 1 1 value 1 1 Context 2 1 value 2 1 Context 1 2 value 3 1 Context 2 2 value 4 Now my problem instead of receiving the result in such way I want it is this way instead id | cat | Context 1 | Context 2 1 1 value 1 value 2 1 2 value 3 value 4

    Read the article

  • Is external JavaScript source available to scripting context inside HTML page?

    - by John K
    When an external JavaScript file is referenced, <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> is the JavaScript source (lines of code before interpretation) available from the DOM or window context in the current HTML page? I mean by using only standard JavaScript without any installed components or tools. I know tools like Firebug trace into external source but it's installed on the platform and likely has special ability outside the context of the browser sandbox.

    Read the article

  • Best Practice for Context Processors vs. Template Tags?

    - by mawimawi
    In which cases is it better to create template tags (and load them into the template), than creating a context processor (which fills the request automatically)? e.g. I have a dynamic menu that has to be included into all templates, so I'm putting it into my base.html. What is the preferred usage: context processor or custom template tag? And why?

    Read the article

  • "[INS-30131] Initial setup required for the execution of installer validations failed." Encountering this error while installing Oracle database 12c. [on hold]

    - by user132992
    I am trying to install Oracle 12c database on my machine running Fedora 20. And I am encountering this problem: "[INS-30131] Initial setup required for the execution of installer validations failed." And when we see the details then it is like this: Cause - Failed to access the temporary location. Action - Ensure that the current user has required permissions to access the temporary location. Additional Information: - Framework setup check failed on all the nodes - Cause: Cause Of Problem Not Available   - Action: User Action Not Available Summary of the failed nodes fedora - Version of exectask could not be retrieved from node "fedora"   - Cause: Cause Of Problem Not Available   - Action: User Action Not Available To eliminate this error I have tried various measures including the change of permission of the tmp folder and restarting the computer but none is working. Plz someone help me out of this. Any kind of help will be appreciated...

    Read the article

  • Why does setting a geometry shader cause my sprites to vanish?

    - by ChaosDev
    My application has multiple screens with different tasks. Once I set a geometry shader to the device context for my custom terrain, it works and I get the desired results. But then when I get back to the main menu, all sprites and text disappear. These sprites don't dissappear when I use pixel and vertex shaders. The sprites are being drawn through D3D11, of course, with specified view and projection matrices as well an input layout, vertex, and pixel shader. I'm trying DeviceContext->ClearState() but it does not help. Any ideas? void gGeometry::DrawIndexedWithCustomEffect(gVertexShader*vs,gPixelShader* ps,gGeometryShader* gs=nullptr) { unsigned int offset = 0; auto context = mp_D3D->mp_Context; //set topology context->IASetPrimitiveTopology(m_Topology); //set input layout context->IASetInputLayout(mp_inputLayout); //set vertex and index buffers context->IASetVertexBuffers(0,1,&mp_VertexBuffer->mp_Buffer,&m_VertexStride,&offset); context->IASetIndexBuffer(mp_IndexBuffer->mp_Buffer,mp_IndexBuffer->m_DXGIFormat,0); //send constant buffers to shaders context->VSSetConstantBuffers(0,vs->m_CBufferCount,vs->m_CRawBuffers.data()); context->PSSetConstantBuffers(0,ps->m_CBufferCount,ps->m_CRawBuffers.data()); if(gs!=nullptr) { context->GSSetConstantBuffers(0,gs->m_CBufferCount,gs->m_CRawBuffers.data()); context->GSSetShader(gs->mp_D3DGeomShader,0,0);//after this call all sprites disappear } //set shaders context->VSSetShader( vs->mp_D3DVertexShader, 0, 0 ); context->PSSetShader( ps->mp_D3DPixelShader, 0, 0 ); //draw context->DrawIndexed(m_indexCount,0,0); } //sprites void gSpriteDrawer::Draw(gTexture2D* texture,const RECT& dest,const RECT& source, const Matrix& spriteMatrix,const float& rotation,Vector2d& position,const Vector2d& origin,const Color& color) { VertexPositionColorTexture* verticesPtr; D3D11_MAPPED_SUBRESOURCE mappedResource; unsigned int TriangleVertexStride = sizeof(VertexPositionColorTexture); unsigned int offset = 0; float halfWidth = ( float )dest.right / 2.0f; float halfHeight = ( float )dest.bottom / 2.0f; float z = 0.1f; int w = texture->Width(); int h = texture->Height(); float tu = (float)source.right/(w); float tv = (float)source.bottom/(h); float hu = (float)source.left/(w); float hv = (float)source.top/(h); Vector2d t0 = Vector2d( hu+tu, hv); Vector2d t1 = Vector2d( hu+tu, hv+tv); Vector2d t2 = Vector2d( hu, hv+tv); Vector2d t3 = Vector2d( hu, hv+tv); Vector2d t4 = Vector2d( hu, hv); Vector2d t5 = Vector2d( hu+tu, hv); float ex=(dest.right/2)+(origin.x); float ey=(dest.bottom/2)+(origin.y); Vector4d v4Color = Vector4d(color.r,color.g,color.b,color.a); VertexPositionColorTexture vertices[] = { { Vector3d( dest.right-ex, -ey, z),v4Color, t0}, { Vector3d( dest.right-ex, dest.bottom-ey , z),v4Color, t1}, { Vector3d( -ex, dest.bottom-ey , z),v4Color, t2}, { Vector3d( -ex, dest.bottom-ey , z),v4Color, t3}, { Vector3d( -ex, -ey , z),v4Color, t4}, { Vector3d( dest.right-ex, -ey , z),v4Color, t5}, }; auto mp_context = mp_D3D->mp_Context; // Lock the vertex buffer so it can be written to. mp_context->Map(mp_vertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); // Get a pointer to the data in the vertex buffer. verticesPtr = (VertexPositionColorTexture*)mappedResource.pData; // Copy the data into the vertex buffer. memcpy(verticesPtr, (void*)vertices, (sizeof(VertexPositionColorTexture) * 6)); // Unlock the vertex buffer. mp_context->Unmap(mp_vertexBuffer, 0); //set vertex shader mp_context->IASetVertexBuffers( 0, 1, &mp_vertexBuffer, &TriangleVertexStride, &offset); //set texture mp_context->PSSetShaderResources( 0, 1, &texture->mp_SRV); //set matrix to shader mp_context->UpdateSubresource(mp_matrixBuffer, 0, 0, &spriteMatrix, 0, 0 ); mp_context->VSSetConstantBuffers( 0, 1, &mp_matrixBuffer); //draw sprite mp_context->Draw( 6, 0 ); }

    Read the article

  • Ideas for loading initial data in an iPhone application?

    - by Derek Clarkson
    Hi all, In my app I want to load some initial data to show the user how it works. The app uses a CoreData managed sqllite db. SO far I've thought of 3 options: Write code into a class to programmatically create the data. Create a xml file in the apps resources and load through a NSXmlParser whose delegate creates the entries in the sqllite db. Same as option #2, but use a json file and bring in a 3rd party lib to read it. Are there other options I have not found yet? and given that I'm talking about perhaps 6 records per table when there are 3 tables, which would you choose?

    Read the article

  • Are all "GET" requests to JSF "Initial Request"s?

    - by Pradyumna
    Hi, In JSF 1.1, I am assuming that GET requests are treated as initial requests (resulting in the creation of a new view), and POST requests are treated as Postbacks (resulting in the restoration of the old view). However, my application is behaving differently - it restores the same old view even for GET requests. Why does this happen? Is there a way to force the creation of a new view for GET requests? (My state-saving method is 'server'. I'm using MyFaces with JSP, and I have a t:saveState on a managed bean in the view) Regards, Pradyumna

    Read the article

  • Force initial Google Drive sync with a non-empty folder?

    - by Terrance Shaw
    I upgraded my iMac with an SSD last night and restored from a Time Capsule backup. Everything is now working substantially zippier and overall better, with the exception of one thing: Google Drive refuses to continue to sync with the Google Drive folder that it'd been using before the upgrade, and I ultimately ended up having to just delete the folder and let it resync from scratch to get past its stubborn error (alternatively, I suppose I could've simply moved the contents, set the path to the now-empty folder, then moved them back). Is there any way to get past this particular issue (for future reference), or is it something that Google put in place to ensure that a new user doesn't go and specify their root drive as the backup destination?

    Read the article

  • Why does outlook 2013, after initial setup, always fail to connect to an Exchange server/always ask for a password?

    - by jhstuckey
    After installing Outlook 2013 configuring it to connect to an exchange server (details about which, e.g., version, etc., I do not know how to provide) was stressful and the user used outlook without issue for a session. The next time outlook is started this error (Re. subject) occurs. The answer to this question solves the issue, or explains why it is happening (i.e., no one could provide a solution). Full size image: http://i.imgur.com/H2bVlyJ.png EDIT 5/18: To add more detail, a) after outlook 2013 was installed and configured (through the menu it prompts you with, add an account) it connected and was fine. It is only after outlook is closed and re-opened that it will not connect again to the server. This problem has been mentioned elsewhere, e.g., http://community.office365.com/en-us/forums/158/t/62832.aspx.

    Read the article

  • Losing JSESSIONID when using ProxyHTMLURLMap

    - by Matthew Schmitt
    I've setup a reverse proxy between an Apache front-end and multiple Tomcat backends. The below block of code includes the ProxyHTMLURLMap param so that the HTML can be rewritten to remove the Tomcat context path. With this setup in place, after logging into my application, an initial JSESSIONID is set properly, but when navigating to any other page, this JSESSIONID is lost and another one is set by the application. I should mention that the initial login directs to a URL that includes the current context path (i.e. https://app.domain.com/context/home), but when navigating to another page, that context path is not present in the URL (i.e. https://app.domain.com/page2). <Proxy balancer://happcluster> BalancerMember ajp://happ01.h.s.com:8009 route=worker1 loadfactor=10 timeout=15 retry=5 BalancerMember ajp://happ02.h.s.com:8009 route=worker2 loadfactor=10 timeout=15 retry=5 BalancerMember ajp://happ03.h.s.com:8009 route=worker3 loadfactor=5 timeout=15 retry=5 BalancerMember ajp://happ04.h.s.com:8009 route=worker4 loadfactor=5 timeout=15 retry=5 BalancerMember ajp://happ05.h.s.com:8009 route=worker5 loadfactor=5 timeout=15 retry=5 ProxySet lbmethod=bytraffic ProxySet stickysession=JSESSIONID </Proxy> ProxyPass /context balancer://happcluster/context ProxyPass / balancer://happcluster/context/ <Location /context/> # Rewrite HTTP headers and HTML/CSS links for everything else ProxyPassReverse / ProxyPassReverseCookieDomain / app.domain.com ProxyPassReverseCookiePath / /context ProxyHTMLURLMap /context/ / # Be prepared to rewrite the HTML/CSS files as they come back # from Tomcat SetOutputFilter INFLATE;proxy-html;DEFLATE </Location> Has anyone ever run into a similar situation?

    Read the article

  • Any ideas for automatic initial/scripted configuration of a NetApp?

    - by maddenca
    The background is to make a solution where we can automate as much as possible the building up of ‘pods’ that include server/network/storage and that will be built at remote sites. In an ideal world would be that we create a single management server which is preconfigured with DHCP/TFTP/or whatever. This management server is racked with a CISCO UCS, FAS31x0, etc. at a build site and is then transported to the final customer site where on power it almost configures itself, or at least bootstraps itself far enough that a remote skilled 'expert' can complete the setup of the pod. Ideas (doesn't have to resemble 100% of the above) would be helpful.

    Read the article

  • How do I push my initial snapshot to a subscriber server in SQL Server 2000?

    - by Kev
    I'm configuring Transactional Replication using the Push model. The scenario is: The SQL Servers: SQL01 (publisher) and SQL02 (subscriber) - both running SQL 2000 SP4. Both servers are standalone (i.e. not domain members) Both servers have their FQDN and NETBIOS names in their HOSTS files I've managed to configure SQL01 to publish my database and configured a Push subscription for SQL02 using the Push New Subscription wizard and set the Distribution Agent to update the subscription continuously. On the Push Subscription wizard "Initialise Subscription" page I've selected "Yes, initialise the schema and data" and ticked the "Start the Snapshot Agent to begin the initialisation process immediately" option. All the required services are running (SQL Agent). When I complete the wizard and browse the Replication - Publications folder I can see my publication (blue book with arrow). The publication shows the Push subscription and its status is Pending. If I look in the c:\Program Files\Microsoft SQL Server\Mssql\Repldata folder I see a number of T-SQL scripts for each table e.g. Products.bcp, Products.sch, Products.idx. What should happen now? Should my replicated database now (magically) appear on the subscription server?

    Read the article

  • DD-WRT Router Can't hold a connection after initial setup...

    - by AC
    Struggeling with my new DDWRT router (Buffalo WZR-HP-G300NH) configuration. I configured it using one machine while comparing the settings on my existing Linksys WRT54GL on another machine. To the best of my knowledge, I've set it up the same way as my Linksys, but DDWRT has so many other options. After configuring it, I plugged it into the modem, VOIP device & my network. I see the phones come back online. However after a few minutes, it seems I lose the outbound connection (phones die and I can't get out over HTTP). What's confusing me is it works for a few minutes, then it fails. No idea what to look for. Ideas?

    Read the article

  • Is Ninite a trusuted solution for initial package management on fresh/clean install of Windows 7 64Bit?

    - by Donat
    I'd like to re-open the question from link below, where several packages were suggested besides Ninite.com such as allmyapps.com. Package managers for Windows What I'd like to know is if they are all to be trusted to install in Windows 7 (64bit) so that the manager: Installs the latest version of software. Supports 64 bit installs where possible. Strips ads/toolbars/similar stuff. The later two points from previous questions are good but not a priority in the preparation of a clean install Provides a way to keep the programs updated after installation. If I can add custom installers to the software, that's a big plus. I am more concerned here about using a legitimate application I can trust to establish the basis of clean image of my operating system with all the application of choice installed without fuss and spam/bloatware.

    Read the article

  • How do I remove any SELinux context or ACL?

    - by polemon
    HI, I have some files, that I'd like to remove the SELinux context or ACLs from (denoted by a '.' or a '+' respectively when using ls -alZ). I don't have too much time on my hands to read on the , etc on how to use chcon etc., so I just want to quickly know how to disable them all. Also, if someone knows a SELinux/ACL Cheat-Sheet, that would be terrific. Here's a screen shot: Notice the dots right after the permission symbols: drwxr-xr-x., etc.

    Read the article

  • How do I install Skype on computer so that anyone who logs in does NOT have to go through the initial config?

    - by Matt
    I installed Skype when logged on to the (local) admin account. Now, when I log off that, and log on as myname on the domain, I have to click through the intial setup steps (after you've already run the installer) of Skype. So, I have to click next to get through the mic setup/test, and it asks me if I want to take a pic. How do I get it so that any person who logs in can just open Skype and go straight to the login screen? Windows 7 64 bit, 2008R2

    Read the article

  • Context menu opens slowly in Explorer in Windows 7, why?

    - by xxzoid
    I'm running a Windows 7 on my reasonably modern laptop, when I open the context menu in Windows Explorer it really takes it time to show up (~10 seconds). There are some programs that have their commands added to it (an archive manipulation utility, an antivirus, a version control system and such). I think one of them freezes the operation. Is there a benchmark tool to measure it somehow or a tool to turn them off by one in Explorer without uninstalling them (which would be a penultimate measure, because use them)?

    Read the article

  • CodeIt.Right Code File Header Template For StyleCop Rules

    - by Paulo Morgado
    I like to use both StyleCop and CodeIt.Right to validate my code – StyleCop because it’s free and CodeIt.Right because it’s really good. While StyleCop provides only validation, CodeIt.Righ provides both validation and correction of violations. Unfortunately, CodeIt.Right’s supplied template for code file headers does not conform to StyleCop rules. Fortunately, CodeIt.Right allows us to define our own template. Here’s the one I use: <#@ template language="C#" #> //----------------------------------------------------------------------- // <copyright file="<#= System.IO.Path.GetFileName(Context.DestinationFile) #>" // project="<#= Context.ProjectName #>" // assembly="<#= Context.AssemblyName #>" // solution="<#= Context.SolutionName #>" // company="<#= Context.GetGlobalProperty("CompanyName") #>"> // Copyright (c) <#= Context.GetGlobalProperty("CompanyName") #>. All rights reserved. // </copyright> // <author id="<#= Context.GetGlobalProperty("UserID") #>"><#= Context.GetGlobalProperty("UserName") #></author> // <summary></summary> //-----------------------------------------------------------------------

    Read the article

  • Entity Framework &amp; Transactions

    - by Sudheer Kumar
    There are many instances we might have to use transactions to maintain data consistency. With Entity Framework, it is a little different conceptually. Case 1 – Transaction b/w multiple SaveChanges(): here if you just use a transaction scope, then Entity Framework (EF) will use distributed transactions instead of local transactions. The reason is that, EF closes and opens the connection when ever required only, which means, it used 2 different connections for different SaveChanges() calls. To resolve this, use the following method. Here we are opening a connection explicitly so as not to span across multipel connections.   using (TransactionScope ts = new TransactionScope()) {     context.Connection.Open();     //Operation1 : context.SaveChanges();     //Operation2 :  context.SaveChanges()     //At the end close the connection     ts.Complete(); } catch (Exception ex) {       //Handle Exception } finally {       if (context.Connection.State == ConnectionState.Open)       {            context.Connection.Close();       } }   Case 2 – Transaction between DB & Non-DB operations: For example, assume that you have a table that keeps track of Emails to be sent. Here you want to update certain details like DataSent once if the mail was successfully sent by the e-mail client. Email eml = GetEmailToSend(); eml.DateSent = DateTime.Now; using (TransactionScope ts = new TransactionScope()) {    //Update DB    context.saveChanges();   //if update is successful, send the email using smtp client   smtpClient.Send();   //if send was successful, then commit   ts.Complete(); }   Here since you are dealing with a single context.SaveChanges(), you just need to use the TransactionScope, just before saving the context only.   Hope this was helpful!

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >