Daily Archives

Articles indexed Monday June 24 2013

Page 16/22 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • State of the art Culling and Batching techniques in rendering

    - by Kristian Skarseth
    I'm currently working with upgrading and restructuring an OpenGL render engine. The engine is used for visualising large scenes of architectural data (buildings with interior), and the amount of objects can become rather large. As is the case with any building, there is a lot of occluded objects within walls, and you naturally only see the objects that are in the same room as you, or the exterior if you are on the outside. This leaves a large number of objects that should be occluded through occlusion culling and frustum culling. At the same time there is a lot of repetative geometry that can be batched in renderbatches, and also a lot of objects that can be rendered with instanced rendering. The way I see it, it can be difficult to combine renderbatching and culling in an optimal fashion. If you batch too many objects in the same VBO it's difficult to cull the objects on the CPU in order to skip rendering that batch. At the same time if you skip the culling on the cpu, a lot of objects will be processed by the GPU while they are not visible. If you skip batching copletely in order to more easily cull on the CPU, there will be an unwanted high amount of render calls. I have done some research into existing techniques and theories as to how these problems are solved in modern graphics, but I have not been able to find any concrete solution. An idea a colleague and me came up with was restricting batches to objects relatively close to eachother e.g all chairs in a room or within a radius of n meeters. This could be simplified and optimized through use of oct-trees. Does anyone have any pointers to techniques used for scene managment, culling, batching etc in state of the art modern graphics engines?

    Read the article

  • Simplest way to render image over top of another with another image used as mask in OpenGL?

    - by Adam Naylor
    The effect I'm looking for is to have a single large background image that is always visible (at full alpha) and then show a second image (what I call a light map or specular map) that is partially shown over the top based on a third image (which is effectively a mask). The effect is similar to this effect except instead of simply darkening or lightening the background image using the third image it needs to mask the second without effecting the first at all. The third image is the only one that moves therefore hard baking the third images alpha into the second image isn't an option. If my explanation isn't clear I'll provide visual examples when I have more time. I'd prefer not to go down a shader route as I haven't taught myself this area yet so unless I have too I'd rather try to achieve this with simple alpha blending. Happy to use a shader approach. Cheers. Additional These third images are obviously light sources being cast onto the first image showing the specular information from the second image to simulate the light 'shining' off the objects in the first image. The solution I implement will need to allow two light sources to potentially overlap so my current thoughts are that the alpha values of the two images will need to be combined (Added?) to produce a final image which masks the second image? Don't worry about things like coloured lights. For this technique the lights are all considered white.

    Read the article

  • My game seems to be incompatible with recording software. What could be causing this?

    - by Lewis Wakeford
    I've just finished a little Game-Dev project for university and I need to record a video to accompany my submission (just in case they can't get my source to work). Basically my game doesn't work at all when FRAPS or Bandicam attempts to attach to it, I get a black screen and a stream of GL INVALID OPERATION messages from my error reporting code. Dxtory can't seem to hook into it correctly at all, it doesn't display it's FPS counter or anything. My game logic appears to be running correctly from the debug traces, it just seems like all the gl library calls break. I don't know a huge amount about how these programs operate so I don't really know what I could be doing to cause this. I've heard they read from the OpenGL frame buffers so maybe I'm doing something wrong there? I'm letting GLFW and GLEW do all the low level initialization, but I have successfully recorded projects with the same setup and recording software. Essentially, has anyone ever run into something like this before or do you know anything about how these programs work that could give a clue as to the cause of the issue?

    Read the article

  • Procedural... house with rooms generator

    - by pek
    I've been looking at some algorithms and articles about procedurally generating a dungeon. The problem is, I'm trying to generate a house with rooms, and they don't seem to fit my requirements. For one, dungeons have corridors, where houses have halls. And while initially they might seem the same, a hall is nothing more than the area that isn't a room, whereas a corridor is specifically designed to connect one area to another. Another important difference with a house is that you have a specific width and height, and you have to fill the entire thing with rooms and halls, whereas with a dungeon, there is empty space. I think halls in a house is something in between a dungeon corridor (gets you to other rooms) and an empty space in the dungeon (it's not explicitly defined in code). More specifically, the requirements are: There is a set of predefined rooms I cannot create walls and doors on the fly. Rooms can be rotated but not resized Again, because I have a predefined set of rooms, I can only rotate them, not resize them. The house dimensions are set and has to be entirely filled with rooms (or halls) I.e. I want to fill a 14x20 house with the available rooms making sure there is no empty space. Here are some images to make this a little more clear: As you can see, in the house, the "empty space" is still walkable and it gets you from one room to another. So, having said all this, maybe a house is just a really really tightly packed dungeon with corridors. Or it's something easier than a dungeon. Maybe there is something out there and I haven't found it because I don't really know what to search for. This is where I'd like your help: could you give me pointers on how to design this algorithm? Any thoughts on what steps it will take? If you have created a dungeon generator, how would you modify it to fit my requirements? You can be as specific or as generic as you like. I'm looking to pick your brains, really.

    Read the article

  • Show path of a body of where it should go after linear impulse is applied

    - by Farooq Arshed
    I am making a game with Andengine and Box2D. I have a dynamic body and I apply linear impulse on the body to move it around when the user have touched the screen. Now I want to show the path where the body will go when the user have touched. If you have played Angry Birds or Basket Ball Shoot or any other which have projectile motion with a path shown you will get my point. I want to show the white dots which are shown in those games.

    Read the article

  • Trouble with UV Mapping Blender => Unity 3

    - by Lea Hayes
    For some reason I am getting nasty grey edges around the edges of rendered 3D models that are not present in Blender. I seem to be able to solve the problem by reducing the size of the UV coordinates within the part of the texture that is to be mapped. But this means that: I am wasting valuable texture space Loss of accuracy in drawn UV maps Could I be doing something wrong, perhaps a setting in Unity that needs changing? I have watched countless tutorials which demonstrate Blender default generated UV coordinates with "Texture Paint" which are perfectly aligned in Unity. Here is an illustration of the problem: Left: approximately 15 pixels of margin on each side of UV coordinates Right: Approximately 3 pixels of margin on each side of UV coordinates Note: Texture image resolution is 1024x1024

    Read the article

  • How to copy items using Nintex Workflow

    - by ybbest
    Nintex does not offer copying items from one SharePoint library to another out of box. However, it is not hard to implement one yourself. You can use the copy.asmx web services to achieve this. Here are the steps below and you can download the source here 1. Create a UDA with the following parameters: 2. Call the copy.asmx service to copy the item from SouceItemUrl to DestinationItemUrl 3. If your destination document library has versioning and check-in/out turned on , you can use list.asmx to check in your file as below: 4. You need to create constant of Credential type named SP_WORKFLOW_WS as below 5. Here is how it looks like in the Workflow designer. 6. To call this UDA, you can perform the following in your workflow

    Read the article

  • How to write PowerShell code part 4 (using loop)

    - by ybbest
    In this post, I’d like to show you how to loop through the xml element. I will use the list data deletion script as an example. You can download the script here. 1. To perform the loop, I use foreach in powershell. Here is my xml looks like <?xml version="1.0" encoding="utf-8"?> <Site Url="http://workflowuat/npdmoc"> <Lists> <List Name="YBBEST Collaboration Areas" Type="Document Library"/> <List Name="YBBEST Project" /> <List Name="YBBEST Document"/> </Lists> </Site> 2. Here is the PowerShell to manipulate the xml. Note, you need to get to the $configurationXml.Site.Lists.List variable rather than $configurationXml.Site.Lists foreach ($list in $configurationXml.Site.Lists.List){ AppendLog "Clearing data for $($list.Name) at site $weburl" Yellow if($list.Type -eq "Document Library"){ deleteItemsFromDocumentLibrary -Url $weburl -ListName $list.Name }else{ deleteItemsFromList -Url $weburl -ListName $list.Name } AppendLog "Data in $($list.Name) at $weburl is cleared" Green } How to write PowerShell code part 1 How to write PowerShell code part 2 How to write PowerShell code part 3 How to write PowerShell code part 4

    Read the article

  • How to display workflow related tasks in the item display page where the workflow is currently running on in SharePoint2013

    - by ybbest
    In one of the project, I need to display workflow related tasks in the item display page where the workflow is currently running on. To achieve this, I’d like to add the tasks list view web part and using the connected web part to achieve this.(ID=workflowitemid) However, to make it work I need to unhide the workflowitemid field in the task list, as it is hidden field and also cantogglehidden field is set to false. I need to use reflection to change the cantogglehidden field to true as it only has getter in the API and then I am able to unhide the field. You can download the script here. However, it is not ideal (make your environment not supported by Microsoft) to display tasks this way. Another way to display the related task is to use SharePoint designer solution with List view web part and data source. Here are the steps. 1. Create a new list display form as below 2. Edit the custom display form in advanced mode. 3. Find the PlaceHolderMain contentplace hoder and insert the DataView by choosing the associated workflow tasks list as below 4. Go to the List View Tools >> OPTIONS 5. Create a Parameter called workflowitemId Parameter which retrieve the value from the ID querystring as below 6. Create a filter based on UIVersion = workflowitemId as below ,we are going to change the UIVersion to WorkflowItemId property later as WorkflowItemId is a hidden field and cannot be selected from the wizard. 7. Replace UIVersion with WorkflowItemId in the caml for the XsltListViewWebPart. From: TO 8. Go to the new custom display page at http://yourserver/Lists/aa/CustomDisplayPage.aspx?ID=414, you will see the associated tasks are showing in the page. References: http://office.microsoft.com/en-us/sharepoint-designer-help/watch-this-design-a-document-review-workflow-solution-HA010256417.aspx (Video 12 and 13)

    Read the article

  • Truly understand the threshold for document set in document library in SharePoint

    - by ybbest
    Recently, I am working on an issue with threshold. The problem is that when the user navigates to a view of the document library, it displays the error message “list view threshold is exceeded”. However, in the view, it has no data. The list view threshold limit is 5000 by default for the non-admin user. This limit is not the number of items returned by your query; it is the total number of items the database needs to read to calculate the returned result set. So although the view does not return any result but to calculate the result (no data to show), it needs to access more than 5000 items in the database. To fix the issue, you need to create an index for the column that you use in the filter for the view. Let’s look at the problem in details. You can download a solution to replicate this issue here. 1. Go to Central Admin ==> Web Application Management ==>General Settings==> Click on Resource Throttling 2. Change the list view threshold in web application from 5000 to 2000 so that I can show the problem without loading more than 5000 items into the list. FROM TO 3. Go to the page that displays the approved view of the Loan application document set. It displays the message as shown below although I do not have any data returned for this view. 4. To get around this, you need to create an index column. Go to list settings and click on the Index columns. 5. Click on the “Create a new index” link. 6. Select the LoanStatus field as I use this filed as the filter to create the view. 7. After the index is created now I can access the approved view, as you can see it does not return any data. Notes: List View Threshold: Specify the maximum number of items that a database operation can involve at one time. Operations that exceed this limit are prohibited. References: SharePoint lists V: Techniques for managing large lists Manage large SharePoint lists for better performance http://blogs.technet.com/b/speschka/archive/2009/10/27/working-with-large-lists-in-sharepoint-2010-list-throttling.aspx

    Read the article

  • How to create a link to Nintex Start Workflow Page in the document set home page

    - by ybbest
    In this blog post, I’d like to show you how to create a link to start Nintex Workflow Page in the document set home page. 1. Firstly, you need to upload the latest version of jQuery to the style library of your team site. 2. Then, upload a text file to the style library for writing your own html and JavaScript 3. In the document set home page, insert a new content editor web part and link the text file you just upload. 4. Update the text file with the following content, you can download this file here. <script type="text/javascript" src="/Style%20Library/jquery-1.9.0.min.js"></script> <script type="text/javascript" src="/_layouts/sp.js"></script> <script type="text/javascript"> $(document).ready(function() { listItemId=getParameterByName("ID"); setTheWorkflowLink("YBBESTDocumentLibrary"); }); function buildWorkflowLink(webRelativeUrl,listId,itemId) { var workflowLink =webRelativeUrl+"_layouts/NintexWorkflow/StartWorkflow.aspx?list="+listId+"&ID="+itemId+"&WorkflowName=Start Approval"; return workflowLink; } function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.search); if(results == null){ return ""; } else{ return decodeURIComponent(results[1].replace(/\+/g, " ")); } } function setTheWorkflowLink(listName) { var SPContext = new SP.ClientContext.get_current(); web = SPContext.get_web(); list = web.get_lists().getByTitle(listName); SPContext.load(web,"ServerRelativeUrl"); SPContext.load(list, 'Title', 'Id'); SPContext.executeQueryAsync(setTheWorkflowLink_Success, setTheWorkflowLink_Fail); } function setTheWorkflowLink_Success(sender, args) { var listId = list.get_id(); var listTitle = list.get_title(); var webRelativeUrl = web.get_serverRelativeUrl(); var startWorkflowLink=buildWorkflowLink(webRelativeUrl,listId,listItemId) $("a#submitLink").attr('href',startWorkflowLink); } function setTheWorkflowLink_Fail(sender, args) { alert("There is a problem setting up the submit exam approval link"); } </script> <a href="" target="_blank" id="submitLink"><span style="font-size:14pt">Start the approval process.</span></a> 5. Save your changes and go to the document set Item, you will see the link is on the home page now. Notes: 1. You can create a link to start the workflow using the following build dynamic string configuration: {Common:WebUrl}/_layouts/NintexWorkflow/StartWorkflow.aspx?list={Common:ListID}&ID={ItemProperty:ID}&WorkflowName=workflowname. With this link you will still need to click the start button, this is standard SharePoint behaviour and cannot be altered. References: http://connect.nintex.com/forums/27143/ShowThread.aspx How to use html and JavaScript in Content Editor web part in SharePoint2010

    Read the article

  • Nintex workflow tips and tricks

    - by ybbest
    Here are some Nintex 2010 workflow related tips and tricks and I will keep updating them. 1. How to add a link in email using Nintex. a. Go to the insert tab and select Link b. Select the url you’d like to set for the link c. After you have done this , you will see the Link is inserted into the email. 2. How to make the Flexi task reject option called “Decline” and make the comments mandatory. a. Open the  Flexi task action config prompt as shown below b.Click on the edit icon and change the settings from TO 3. When saving or publishing Nintex workflow and receiving the following errors: Server was unable to process request. —> The file hxtp://../NintexWorkflows/Workflowname/Workflowname.xoml is checked out for editing by Domain/Username. To Fix it , you can perform the following steps: a.In the publish dialogue, uncheck “Overwrite existing version” and rename the workflow. b.Delete the old workflow which was checked out c.Publish the new workflow again with the old name d.Delete the “temporary” workflow again

    Read the article

  • How to use the client object model with SharePoint2010

    - by ybbest
    In SharePoint2010, you can use client object model to communicate with SharePoint server. Today, I’d like to show you how to achieve this by using the c# console application. You can download the solution here. 1. Create a Console application in visual studio and add the following references to the project. 2. Insert your code as below ClientContext context = new ClientContext("http://demo2010a"); Web currentWeb = context.Web; context.Load(currentWeb, web =&gt; web.Title); context.ExecuteQuery(); Console.WriteLine(currentWeb.Title); Console.ReadLine(); 3. Run your code then you will get the web title displayed as shown below Note: If you got the following errors, you need to change your target framework from .Net Framework 4 client profile to .Net Framework 4 as shown below: Change from TO

    Read the article

  • How to use Nintex Reusable Workflow Template

    - by ybbest
    If you like to re-use your workflow logic over more than one list or library, you can create reusable workflow template. Here are the steps 1. Go to site settings and create reusable workflow template. 2. Select the content type you like the template to bound to and give a workflow a title. 3.Create your workflow the same way as you did for a list workflow and publish your workfow. 4. Finally, you need add your workflow to the list you like to run your workflow. 5. Go to workflow settings and add a Workflow. 6. Select the content type and configure the workflow as below 7. After you done this, your workflow will run as usual. Note: 1. You cannot conditionally start your workflow. 2. Your workflow is not automatically bound to the list when you add the content type to the list, you need to configure it manually as shown in step 4-6.

    Read the article

  • How to use html and JavaScript in Content Editor web part in SharePoint2010

    - by ybbest
    Here are the steps you need to take to use html and JavaScript in content editor web part. 1. Edit a site page and add a content editor web part on the page. 2. After the content editor is added to the page, it will display on the page like shown below 3. Next, upload your html and JavaScript content as a text file to a document library inside your SharePoint site. Here is the content in the document <script type="text/javascript"> alert("Hello World"); </script> 4. Edit the content editor web part and reference the file you just uploaded. 5. Save the page and you will see the hello world prompt. References: http://stackoverflow.com/questions/5020573/sharepoint-2010-content-editor-web-part-duplicating-entries http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/

    Read the article

  • Java the little console game won't repeat?

    - by Jony Kale
    Okay, what I have so far is: You enter the game, and write "spin" to the console. Program will enter the while loop. In the while loop, if entered int is -1, return to the back (Set console input back to "", and let the user select what game he would like to play). Problem: Instead of going back, and selecting "spin" again, the program exits? Why is it happening? How can I fix this? private static Scanner console = new Scanner(System.in); private static Spin spin = new Spin(); private static String inputS = ""; private static int inputI = 0; private static String[] gamesArray = new String[] {"spin", "tof"}; private static boolean spinWheel = false; private static boolean tof = false; public static void main (String[] args) { if (inputS.equals("")) { System.out.println("Welcome to the system!"); System.out.print("Please select a game: "); inputS = console.nextLine(); } while (inputS.equals("spin")) { System.out.println("Welcome to the spin game! Please write 1 to spin. and -1 to exit back"); inputI = console.nextInt(); switch (inputI) { case 1: break; case -1: inputI = 0; inputS = ""; break; } } }

    Read the article

  • redirect user to a new page after clicking on like button on mobile web

    - by user2518048
    i built a page that can redirect a user to a new page after clicking on facebook like button on my page, but the like button does not show on mobile web. i did this with facebook javascript SDK not iframe because i need to use FB.Event.subscribe to do the redirect part. does anyone know how to solve this problem? or does anyone have some suggestions how to imply redirecting a user to a new web page after clicking facebook like button on mobile web page?

    Read the article

  • Where do files included in MANIFEST.in end up?

    - by Brian Hicks
    I'm not sure if I can't find this or if my google-fu is just lacking at the moment: I've got some HTML template files included in a package, with the following MANIFEST.in: recursive-include flockdoc/templates *.html In development, I'm including these (for Jinja) by doing path calculations, assuming that the "templates" directory is next to a certain file. When the package is installed with setup.py (using setuptools) the templates aren't copied into site-packages with the code. I understand that they're supposed to be somewhere like dist-packages, but none of the documentation I can find is pointing me to where the actual files are. It's also not giving me "best practice" for including these in my code. Any suggestions would be welcome there. the setup.py in question So: where are my files?

    Read the article

  • How to give the First image in a gallery a different class than the rest of the images - Carrierwave

    - by ChrisBedoya
    I have a model called "Photo" that belongs to a model called "Shoe". I using Carrierwave to upload multiple images. index.html.erb <% shoes.each do |shoe| %> <div class="shoe"> <div class="gallery"> <% shoe.photos.each do |photo| %> <%= link_to image_tag(photo.photo_file.url(:thumb).to_s), photo.photo_file.url.to_s, :class => 'fancybox', :rel => 'gallery' %> <% end %> </div> </div> <% end %> Outputs this: <div class="shoe"> <div class="gallery"> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> </div> </div> But I want the first image of each gallery to be able to have its own class and the rest of the images to have their own class. Something like this: <a class="firstclass" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> How can I do this? Also I want each gallery to have its own unique id but when I try to add this: :rel => 'gallery<%= shoe.id %>' I get a Syntax error. Thanks.

    Read the article

  • java 7 upgrade and hibernate annotation processor error

    - by Bill Turner
    I am getting the following warning, which seems to be triggering a subsequent warning and an error. I have been googling like mad, though have not found anything that makes it clear what it is I should do to resolve this. This issue occurs when I execute an Ant build. I am trying to migrate our project to Java 7. I have changed all the source='1.6' and target="1.6" to 1.7. I did find this related article: Forward compatible Java 6 annotation processor and SupportedSourceVersion It seems to indicate that I should build the Hibernate annotation processor jar myself, compiling it with with 1.7. It does not seem I should be required to do so. The latest version of the class in question (in hibernate-validator-annotation-processor-5.0.1.Final.jar) has been compiled with 1.6. Since the code in said class refers to SourceVersion.latestSupported(), and the 1.6 of that returns only RELEASE_6, there does not seem to be a generally available solution. Here is the warning: [javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.hibernate.validator.ap.ConstraintValidationProcessor' less than -source '1.7' And, here are the subsequent warnings/error. [javac] warning: No processor claimed any of these annotations: javax.persistence.PersistenceContext,javax.persistence.Column,org.codehaus.jackson.annotate.JsonIgnore,javax.persistence.Id,org.springframework.context.annotation.DependsOn,com.trgr.cobalt.infrastructure.datasource.Bucketed,org.codehaus.jackson.map.annotate.JsonDeserialize,javax.persistence.DiscriminatorColumn,com.trgr.cobalt.dataroom.authorization.secure.Secured,org.hibernate.annotations.GenericGenerator,javax.annotation.Resource,com.trgr.cobalt.infrastructure.spring.domain.DomainField,org.codehaus.jackson.annotate.JsonAutoDetect,javax.persistence.DiscriminatorValue,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactionMandatory,org.springframework.stereotype.Repository,javax.persistence.GeneratedValue,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactional,org.hibernate.annotations.Cascade,javax.persistence.Table,javax.persistence.Enumerated,org.hibernate.annotations.FilterDef,javax.persistence.OneToOne,com.trgr.cobalt.dataroom.datasource.config.core.CoreEntity,org.springframework.transaction.annotation.Transactional,com.trgr.cobalt.infrastructure.util.enums.EnumConversion,org.springframework.context.annotation.Configuration,com.trgr.cobalt.infrastructure.spring.domain.UpdatedFields,com.trgr.cobalt.infrastructure.spring.documentation.SampleValue,org.springframework.context.annotation.Bean,org.codehaus.jackson.annotate.JsonProperty,javax.persistence.Basic,org.codehaus.jackson.map.annotate.JsonSerialize,com.trgr.cobalt.infrastructure.spring.validation.Required,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactionNever,org.springframework.context.annotation.Profile,com.trgr.cobalt.infrastructure.spring.stereotype.Persistor,javax.persistence.Transient,com.trgr.cobalt.infrastructure.spring.validation.NotNull,javax.validation.constraints.Size,javax.persistence.Entity,javax.persistence.PrimaryKeyJoinColumn,org.hibernate.annotations.BatchSize,org.springframework.stereotype.Service,org.springframework.beans.factory.annotation.Value,javax.persistence.Inheritance [javac] error: warnings found and -Werror specified TIA!

    Read the article

  • Unexpected '{' with IF statement

    - by user1926208
    this is my code to move all the files in a directory to another directory which are 1 hour old or more. <?php $srcDir = 'code'; $destDir = 'code/old'; if (file_exists($destDir)) { if (is_dir($destDir)) { if (is_writable($destDir)) { if ($handle = opendir($srcDir)) { while (false !== ($file = readdir($handle))) { if (is_file($srcDir . '/' . $file)) { if(date("U",filectime($srcDir . '/' . $file) >= time() - 3600) { rename($srcDir . '/' . $file, $destDir . '/' . $file); } } } closedir($handle); } else { echo "$srcDir could not be opened.\n"; } } else { echo "$destDir is not writable!\n"; } } else { echo "$destDir is not a directory!\n"; } } else { echo "$destDir does not exist\n"; } ?> and I am getting this error: Parse error: syntax error, unexpected '{' in /home/tcity/public_html/myDir/movefiles.php on line 11

    Read the article

  • Variable text in links with knockout

    - by Gepser
    I'm generating a list of links and they have not the same text but I don't know how to put a text with knockout. This is what I have: <a data-bind="attr: { href: 'Controller/Method/' + Id, 'Title': CurrentTask }"> <!-- I need the name of the CurrentTask here--> CurrentTask </a> So, the text I want to show appears only in the "alt" property but not in the text of the link. It works but I need that the name of the CurrentTask be the link and now it's just showing me everything like this: <a href...>CurrentTask</a> <a href...>CurrentTask</a> <a href...>CurrentTask</a> <a href...>CurrentTask</a> and I need this <a href...>I get this data from de controller</a> <a href...>Sometext</a> <a href...>OtherText</a> <a href...>Anything</a>

    Read the article

  • Simple, but I'm stuck ....Updating a DataSet using code

    - by user2518039
    I have a simple Windows form in VB: textbox bound thru an adapter and a bindingsource to my dataset. I have a button that on Click I want it to update the database. The form loads and the first data row shows in the textbox, I change the text then click my button but no update happens. Any ideas what I'm doing wrong, or how I should do this?? Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.AToolsTableAdapter.Fill(Me.Qedsandb_TroyDataSet.aTools) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click AToolsTableAdapter.Update(Qedsandb_TroyDataSet.aTools) End Sub End Class

    Read the article

  • Can PetaPoco populate an object using a stored procedure with a join clause?

    - by Mark Kadlec
    I have a stored procedure that does something similar to: SELECT a.TaskId, b.CompanyCode FROM task a JOIN company b ON b.CompanyId = a.CompanyId; I have an object called TaskItem that has the TaskId and CompanyCode properties, but when I execute the following (which I would have assumed worked): var masterDatabase = new Database("MasterConnectionString"); var s = PetaPoco.Sql.Builder.Append("EXEC spGetTasks @@numberOfTasks = @0", numberOfTasks); var tasks = masterDatabase.Query<Task>(s); The problem is that the CompanyCode column does not exist in the task table, I did a trace and it seems that PetaPoco is trying to select all the properties from the task table and populating using the stored procedure. How can I use PetaPoco to simply populate the list of task objects with the results of the stored procedure?

    Read the article

  • Match Phrases (in array) in text string

    - by Tim Hanssen
    I'm using the Twitter API streaming to collect thousand of tweets every minute. They need to be matched to a list of keywords (can contain spaces). This is my current method: $text = preg_replace( '/[^a-z0-9]+/i', ' ', strtolower( $data['text'] ) ); $breakout = explode( " ", $text ); $result = array_intersect( $this->_currentTracks, $breakout ); I chop the tweet into words, and the matches them against my current keywords. This works well for all the keywords without a space ofc. If I wanted to find for example "Den Haag", It won't show up, because the string is exploded into words (based on the spaces). Any ideas about how I can do this in a quick way? Kind regards, Tim

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >