Daily Archives

Articles indexed Saturday June 16 2012

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

  • Transparent PHP script execution using mod_rewrite

    - by tori3852
    I am looking for a solution for this a problem: I need that every HTTP request (method is irrelevant) in Apache http server would be served only after execution of specific PHP script. This is needed because I need to gather some information about requests, etc. As far as I understand - this could be achieved using mod_rewrite module. So far I have done this (in .htaccess file): RewriteEngine on RewriteRule ^(.*)$ script.php [C] script.php is executed, but I need that after this original request would be executed. Thanks - any help is appreciated.

    Read the article

  • HTML5 Canvas A* Star Path finding

    - by Veyha
    I am trying to learn A* Star Path finding. Library I am using this - https://github.com/qiao/PathFinding.js But I am don't understand one thing how to do. I am need find path from player.x/player.y (player.x and player.y is both 0) to 10/10 This code return array of where I am need to move - var path = finder.findPath(player.x, player.y, 10, 10, grid); I am get array where I am need to move, but how to apply this array to my player.x and player.y? Array structure like - 0: 0 1: 0 length: 2, 0: 1 1: 0 length: 2, ... I am very sorry for my bad English language. Thanks.

    Read the article

  • Rain effect looks like snowfall effect?

    - by Nikhil Lamba
    i am making a game in that game i want rain effect i am little bit far from this right now i am doing like below particleSystem.addParticleInitializer(new ColorInitializer(1, 1, 1)); particleSystem.addParticleInitializer(new AlphaInitializer(0)); particleSystem.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE); particleSystem.addParticleInitializer(new VelocityInitializer(2, 2, 20, 10)); particleSystem.addParticleInitializer(new RotationInitializer(0.0f, 30.0f)); particleSystem.addParticleModifier(new ScaleModifier(1.0f, 2.0f, 0, 150)); particleSystem.addParticleModifier(new ColorModifier(1, 1, 1, 1f, 1, 1, 1, 3)); particleSystem.addParticleModifier(new ColorModifier(1, 1, 1f, 1, 1, 1, 1, 6)); particleSystem.addParticleModifier(new AlphaModifier(0, 1, 0, 3)); particleSystem.addParticleModifier(new AlphaModifier(1, 0, 1, 125)); particleSystem.addParticleModifier(new ExpireModifier(50, 50)); scene.attachChild(particleSystem); But its looks like snowfall effect what changes i can do for make it rain effect please correct me EDIT : here is link for snapshot http://i.imgur.com/bRIMP.png

    Read the article

  • How do game engines implement certain features?

    - by Milo
    I have always wondered how modern game engines do things such as realistic water, ambient occluded lighting, eye adaptation, global illumination, etc. I'm not so much interested in the implementation details, but more on what part of the graphics API such as D3D or OpenGL allow adding such functionality. The only thing I can think of is shaders, but I do not think just shaders can do all that. So really what I'm asking is, what functions or capabilities of graphics APIs enable developers to implement these types of features into their engines? Thanks

    Read the article

  • Examples of good Javascript/HTML5 based games

    - by Zuch
    Now that Flash is largely being replaced with HTML5 elements (video, audio, canvas, etc.) are there any good examples of web-based games built on completely open standards (meaning Javascript, HTML and CSS)? I see a lot of examples of pure HTML5 implementations of what was once only in Flash (like stuff here: http://www.html5rocks.com/) but not many games, a domain which still seem dominated by Flash. I'm curious what's possible and what the limitations are.

    Read the article

  • Extrange gray rectangle when debugging with monodevelop

    - by SCL
    when I debug with Monodevelop, in Linux Mint, most of the times I get a small gray rectangle on top of the screen. It stays there, on top of any other application even If I minimize monodevelop. It won't go away until I close it. If I click on it, the elements in the background receive the events. I get this problem in two different machines, both with Mint 13 and monodevelop 2.6 and 3. How can I get rid of it?

    Read the article

  • Design best practice - best way to handle user selection

    - by user1457227
    I'm an experienced developer (WPF) moving over to Android development. My question: an app I am developing allows the user to browse their local storage (such as SDCARD) and select a file. Now, should I simply create a new Activity (after the user has made a selection) to handle what I want to have the app do with that chosen file, -or- is the better approach to pass the path/name of the selected file back to the main Activity and let IT launch the next Activity? In other words, is the better practice to have the main Activity launch other (support) activities, or is it perfectly ok and normal to have one activity chain to another and on and on? Thanks!

    Read the article

  • How to select Distinct records from SQL without a primary key

    - by Satheesh
    I need to show a Notification on user login if there is any unread messages.So if multiple users send(5 messages each) while the user is in offline these messages should be shown on login.Means have to show the last messages from each user. I use joining to find records. In this scenario Message from User is not a primary key. This is my query SELECT UserMessageConversations.MessageFrom, UserMessageConversations.MessageFromUserName,UserMessages.MessageTo, UserMessageConversations.IsGroupChat, UserMessageConversations.IsLocationChat, UserMessageConversations.Message, UserMessages.UserGroupID,UserMessages.LocationID FROM UserMessageConversations LEFT OUTER JOIN UserMessages ON UserMessageConversations.UserMessageID = UserMessages.UserMessageID ![enter image description here][1]Where UserMessageConversations.MessageTo=743 AND UserMessageConversations.ReadFlag=0 This is the output obtained from above query. MessageFrom -582 appears twice. I need only one record of this User. How is it possible

    Read the article

  • Javascript: How to test JSONP on localhost

    - by hqt
    Here is the way I test JSONP: I run XAMPP, and in folder htdocs I create a javascript folder . I create json1.json file contain some data to process. After that, I run this html file locally, and it will call a function in "other machine" (in this case is localhost) Here is my code : <head> <script> function updateSales(sales) { alert('test jsonp'); // real code here } </script> </head> <body> <h1>JSONP Example</h1> <script src="http://localhost:85/javascript/json1.json?callback=updateSales"></script> </body> But when I run, nothing happen. But if change to other real json on the internet, it will work. It means change line : <script src="http://localhost:85/javascript/json1.json?callback=updateSales"></script> to line: <script src="http://gumball.wickedlysmart.com/?callback=updateSales"></script> It will work smoothly. So, I don't know how to test JSONP by using localhost, please help me. Thanks :)

    Read the article

  • Why does JavaScript's getElementsByClassName provide an object that is NOT an array?

    - by Paragon
    I'm trying to get a list in JavaScript (not using jQuery) of all the elements on the page with a specific class name. I therefore employ the getElementsByClassName() function as follows: var expand_buttons = document.getElementsByClassName('expand'); console.log(expand_buttons, expand_buttons.length, expand_buttons[0]); Note that I have three anchor elements on my page with the class 'expand'. This console.log() outputs [] 0 undefined Next, for kicks, I threw expand_buttons into its own array as follows: var newArray = new Array(expand_buttons); console.log(newArray, newArray.length); This suddenly outputs [NodeList[3]] 1 and I can click through the nodelist and see the attributes of the three 'expand' anchor elements on the page. It's also worth noting that I was able to get my code working in a w3schools test page. It may also be of note that my use of document.getElementsByName actually does output (to the console) an array of elements, but when I ask for its length, it tells me 0. Similarly, if I try to access an array element using array_name[0] as normal, it outputs 'undefined', despite there clearly being an element inside of an array when I print the object to the console. Does anybody have any idea why this might be? I just want to loop through DOM elements, and I'm avoiding jQuery at the moment because I'm trying to practice coding with vanilla JavaScript. Thanks, ParagonRG

    Read the article

  • Good JDBC pattern

    - by Java Developer
    What is the good practice for database operation in Java application? Do you construct the DML syntax in the Java code and send the statements to DB engine for execution, or you just collect the parameters and then make a call to stored procedure with the parameters via java code? or neither because that's just not how to do it? can anyone give an example of a full database utility classes to do database operations in Java app? also what about the transaction manager? My assignment is to make database operation that is modular in Java. Thanks

    Read the article

  • iphone navigation

    - by Rona
    function handleClickEvent(event) { var linkFrom = $(event.target); if (typeof linkFrom.attr("href") == 'undefined') { linkFrom = $(event.target).parent(); } var targetPage = linkFrom.attr("href"); if (linkFrom.hasClass('submit')) { handleSubmitEvent(event); // if we want to stop processing: return false; } if (linkFrom.hasClass('backbutton')) { targetPage = historyStack.pop(); if (historyStack.length == 0) { lastPage = "index.html"; } } else { historyStack.push(lastPage); } lastPage = targetPage; $(event.target).css({ 'background-color': '#194fdb', 'color': '#ffffff' }); loadingWindowON(); // Add new unique div prevPageId = "page" + pageIdCounter; pageIdCounter = parseInt(pageIdCounter) + 1 nextPageId = "page" + pageIdCounter; nextPageDiv = "<div id='" + nextPageId + "' class='nextpage' /></div>"; $("body").append(nextPageDiv); if (linkFrom.attr("target") != "_blank") { event.preventDefault(); document.getElementById(nextPageId).addEventListener('webkitAnimationEnd', function () { // remove prev div element = document.getElementById(prevPageId); if (element) { element.parentNode.removeChild(element); } // set next div as current document.getElementById(nextPageId).className = 'currentpage'; }, false); document.getElementById(nextPageId).className += ' slideleftIn'; document.getElementById(prevPageId).className += ' slideleftOut'; loadContent(targetPage, nextPageId); } I use this javascript with a twitter app I had to do and when I click a button, instead of sliding the new page from the side it adds it to the existing page at the bottom. It works fine when i open it on my computer using google chrome but when I try to open it with my iphone it doesn't work. Any ideas?

    Read the article

  • Split a string by comma, quote and full-stop.. with a few exceptions

    - by dunc
    I've got a lot of text, similar to the following paragraph, which I'd like to split into words without punctuation (', ", ,, ., newline etc).. with a few exceptions. Initially considered endemic to the Chalakudy River system in Kerala state, southern India, but now recognised to have a wider distribution in surrounding drainages including the Periyar, Manimala, and Pamba river though the Manimala data may be questionable given it seems to be the type locality of P. denisonii. In the Achankovil River basin it occurs sympatrically, and sometimes syntopically, with P. denisonii. Wild stocks may have dwindled by as much as 50% in the last 15 years or so with collection for the aquarium trade largely held responsible although habitats are also being degraded by pollution from agricultural and domestic sources, plus destructive fishing methods involving explosives or organic toxins. The text refers to P. denisonii which is a species of fish. It's an abbreviation of Genus species. I would like this reference to be one word. So, for instance, this is the kind of array I'd like to see: Array ( ... [44] given [45] it [46] seems [47] to [48] be [49] the [50] type [51] locality [52] of [53] P. denisonii [54] In [55] the ... ) The only things that distinguish these species references such as P. denisonii from a new sentence like end. New are: The P (for Puntius, as in the P. in the aforementioned example) is only ever one letter, always a capital the d (as in . denisonii) is always either a lower case letter or an apostrophe (') What regexp can I use with preg_split to give me such an array? I've tried a simple explode( " ", $array ) but it doesn't do the job at all. Thanks in advance,

    Read the article

  • Returning a href within a string

    - by user701254
    How can I return a href within a string, I can access the start position but not sure how to get last position : Here is what I have so far : String str = "sadf ad fas dfa http:\\www.google.com sdfa sadf as dfas"; int index = str.indexOf("http"); String href = str.substring(index , ???); What should the end index be ? Note, this is targeted at j2me & I need to minimise download footprint so I cannot use regular expressions or third party regular expressions libraries.

    Read the article

  • Mult-line Svg tooltip

    - by John Vaughan
    I have created numerous polygon shapes in SVG format. and grouped them together. When the user hovers over the group a tooltip box appear. I have used ecmascript. What i am looking to do is make the tooltip box a multiline box. Any ideas how to do this? <script type="text/ecmascript"> <![CDATA[ function init(evt) { if ( window.svgDocument == null ) { svgDocument = evt.target.ownerDocument; } tooltip = svgDocument.getElementById('tooltip'); tooltip_bg = svgDocument.getElementById('tooltip_bg'); } function ShowTooltip(evt, mouseovertext) { tooltip.setAttributeNS(null,"x",evt.clientX+17); tooltip.setAttributeNS(null,"y",evt.clientY+14); tooltip.firstChild.data = mouseovertext; tooltip.setAttributeNS(null,"visibility","visible"); length = tooltip.getComputedTextLength(); tooltip_bg.setAttributeNS(null,"width",length+8); tooltip_bg.setAttributeNS(null,"x",evt.clientX+14); tooltip_bg.setAttributeNS(null,"y",evt.clientY+1); tooltip_bg.setAttributeNS(null,"visibility","visibile"); } function HideTooltip(evt) { tooltip.setAttributeNS(null,"visibility","hidden"); tooltip_bg.setAttributeNS(null,"visibility","hidden"); } ]]> </script> <SVG> <g onmousemove="ShowTooltip(evt, 'GHANA 2000')" onmouseout="HideTooltip(evt)"> <path fill="#EEEEEE" d="M250,0c47,0,85.183,10.506,125,33.494L250,250V0z"/> <path id="score" d="M250,57c36.284,0,65.761,8.11,96.5,25.857L250,250V57z"/> <path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M250,0c47,0,85.183,10.506,125,33.494L250,250V0z"/> <text transform="matrix(1 0 0 1 283.9883 92.0024)" fill="#FFFFFF" font-family="'WalkwayBlack'" font-size="16">62</text> </g> <rect class="tooltip_bg" id="tooltip_bg" x="0" y="0" width="55" height="17" visibility="hidden"/> <text class="tooltip" id="tooltip" x="0" y="0" visibility="hidden">Tooltip</text> <SVG>

    Read the article

  • Visual Studio 2012 not building dependent projects

    - by user1438940
    I just upgraded a VS2010 project to VS2012 and am now having a problem where dependent projects are not building on demand. For instance, say I have the following projects in my solution: Library A ConsoleApp 1 Where ConsoleApp 1 references Library A. If I change the signature of a method in a class in Library A and run ConsoleApp 1, there will be a compiler error due to ConsoleApp 1 not seeing my changes because running ConsoleApp 1 did NOT cause Library A to build. If I manually build Library A, then manually build ConsoleApp 1, it works fine. However, I would expect that running ConsoleApp 1 should cause any dependent projects to be rebuilt before launching. Could I have something configured incorrectly? Or is this a bug in VS2012?

    Read the article

  • Generate jpeg compressed Tiff using RGB colorspace (using Java + JAI)

    - by nOiSe gaTe
    I'm trying to make tiled pyramidal tiffs from master tiff images using Java (JAI 1.1.3 + imageIO). The problem is: I NEED to make tiff files compressed in jpeg with RGB photometric interpretation and no matter what I try, the image still faces YCbCr photometric interpretation. Note: if I change compression type (eg. LZW or Deflate) I can get RGB colorspace but, as I said, I need jpeg compression. Except this detail the tiled PTiff I create it's ok, so I think it's better to focus the attention on simple compression step (uncompressed tiff -- jpeg tiff) this may be a basic example (removing any check to make it more readable) // reading MASTER BufferedImage img = ImageIO.read(uncompressedTiff); ImageOutputStream ios=null; ImageWriter writer=null; ios = ImageIO.createImageOutputStream(outFile); Iterator <ImageWriter> writers = ImageIO.getImageWritersByFormatName("tiff"); writer = writers.next(); // saving and compression params writer.setOutput(ios); ImageWriteParam param = writer.getDefaultWriteParam(); param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); param.setCompressionType("JPEG"); param.setCompressionQuality(0.8f); param.setTilingMode(ImageWriteParam.MODE_EXPLICIT); param.setTiling(256, 256, 0, 0); IIOMetadata metadata = getWriteMD(writer, param); // writing writer.write(metadata, new IIOImage(img, null, metadata), param); in getWriteMD method: .... TIFFTag photoInterp = base.getTag(BaselineTIFFTagSet.TAG_PHOTOMETRIC_INTERPRETATION); TIFFField fieldPhotoInter = new TIFFField(photoInterp, BaselineTIFFTagSet.PHOTOMETRIC_INTERPRETATION_RGB); .... here is the full version of getWriteMD()

    Read the article

  • printing dynamically string in one line in python

    - by EngHamoud
    I'm trying to print strings in one line. I've found solutions but they don't works with windows correctly. I have text file contains names and I want to print them like this name=john then change john to next name and keep name=, I've made this code but didn't work correctly with windows: op = open('names.txt','r') print 'name=', for i in op.readlines(): print '\r'+i.strip('\n') thank you for your time

    Read the article

  • WPF DataGrid binding difficulties

    - by Jasmin Pvvlovic
    This is the class: public class TrainingData { public string Training { get; set; } } And this is the rest of the code in MainWindow: Excel.Workbook xlWorkbook = xlApp.Workbooks.Open("D:/excel.xlsx"); Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1]; Excel.Range xlRange = xlWorksheet.UsedRange; List <TrainingData> tData= new List <TrainingData>(); int rowCount = xlRange.Rows.Count; int colCount = xlRange.Columns.Count; //int k = 0; for (int i = 1; i <= rowCount; i++) { tData.Add(new TrainingData() { Training = xlRange.Cells[i, 1].Value2.ToString() }); //MessageBox.Show(tData[k].Training); //k++; } Prikaz.ItemsSource = tData; DataGrid: <DataGrid AutoGenerateColumns="False" Height="120" HorizontalAlignment="Left" Margin="12,12,0,0" Name="Prikaz" VerticalAlignment="Top" Width="105" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn Header="Header" /> </DataGrid.Columns> </DataGrid>` So, Prikaz is my DataGrid. tData is List of TrainingData objects. If I uncomment these three lines I can test if I have imported information from excel file correctly, and yes, that works just fine. So why am I getting empty DataGrid? It has right number of rows and only one column, that's ok, but there are no data in it. I used this line: Prikaz.ItemsSource = tData; to bind my objects list and DataGrid. Training is declared public so it should be present in DataGrid. What could be causing the problem?

    Read the article

  • Read varbinary data in java

    - by masoud farahani
    I made a Java application which reads some files from SQL server. Those files are saved to a varbinary(MAX) field in SQL Server by a third party web service. My problem is that when I want to read those files with my Java application, those binary data show different content in the Java application. In fact, I read data byte by byte and I figured out that some bytes did not show the real values which were saved in the database. I found out what the problem is, but I couldn’t find a solution yet. I found out that in the web service every varbinary data is saved to database as byte data (in .Net each byte takes 0 to 255). But, when I want to read the binary data in Java, it takes different values and cause an exception with some values, because in Java a byte value takes -127 to 127. In my Java application I want to write those data to a file by OutputStream.write(byte[]) method. How can I solve this problem? I think that I have to find a way to convert c# byte[] to a Java byte[] (or binary data), but how can I do that?

    Read the article

  • Yii , show tooltip in cgridview( table ) value

    - by Kiran
    I want to show tooltip in cgridview value as on hover on column it have to show whole contant stored in variable. I want to show contant in variable $data["comment"] as a tooltip ( title ), and currently it shows whole string as - $data["comment"]. array( 'name'=>'Comment', 'header'=>'Comment', 'value'=>'(strlen($data["comment"])>35)?substr($data["comment"], 0, 35)."..":$data["comment"];', 'htmlOptions'=>array('title'=>'$data["comment"]'), // this what i have do ),

    Read the article

  • Best way to use Cradle with Express.js (CouchDB, Node.js)

    - by Costa
    I'm building my website ( http://tedxgramercy.jit.su ) with express.js and so far I've been using the http.request method in node to access couch, and that's been cool. I've learned lots about how http, couch, and node work, which is awesome. Anyways, I'm thinking of moving over to cradle now (Let me know if you have a strong opinion about this) and I'd like to know the "right" way to set this up. Should I... require() cradle and make a new connection to my db in each separate route? create my database connection once, and then just pass that connection by require()ing the connection in each route? (if so, how do I do that?) Thanks!!!

    Read the article

  • steam condenser java errors

    - by w0rm
    I've been working on a little project involving Steam Condenser, a Steam API written in Java, but I haven't been able to actually do anything with it. I'll explain. This is what the wiki tells me: SteamId id = new SteamId("demomenz"); GameStats stats = id.getGameStats("tf2"); List achievements = stats.getAchievements(); The problem is, eclipse doesn't like it apparently, as it spits out this error: The constructor SteamId(String) is undefined and it gives me the option to change it to: SteamId id = new SteamId("demomenz", false); But at this point a different error comes out: The constructor SteamId(Object, boolean) is not visible So, I'm assuming this function is internal to the API, and should not be called from the outside. If anyone is familiar with this, or has a clue on why I'm getting this error (I'm fairly new to Java development), an answer would be greatly appreciated. UPDATE: The constructor SteamId(String) is undefined This is if I use SteamId.create(ConvertedID); (ConvertedID is a String containing the Steam64 ID). At this point I believe this API is not that well written, at least for java. Any other idea?

    Read the article

  • Sorting in SSRS Reports overriding Group sorting

    - by Siva
    I am new to SSRS (2005) and am creating my first report. I need to create a group-based running value but is sorted or some other field. For example, from the data below |Employee| Day |Hours|Salary| |E1 | 1.1 | 5 | 5 | |E2 | 1.2 | 6 | 6 | |E3 | 1.3 | 7 | 7 | |E2 | 2.1 | 6 | 12 | |E1 | 2.2 | 5 | 10 | |E3 | 2.3 | 7 | 14 | |E3 | 3.1 | 7 | 21 | |E2 | 3.2 | 6 | 18 | I am calculating the salary to be a running value on hours grouped by employee, which works fine. The problem is I want the report to be sorted on the Day column. If I use the Day as a sorting criteria in the employee group, the report is grouped on the employee, but within the group, the data is sorted on the Day column. Is there a way to build the report and then finally sort the report on the day column ? Please let me know in case I am unclear. Thanks a lot! Siva.

    Read the article

  • Customised email alerts through MailChimp API

    - by user1293351
    I am building a site that runs an automated process every 30 minutes to match up new flights with their respective user. Once this process is completed I want to email the flight details out to the respective user. However the flight info will be different for every single user with their being 0-300+ potential emails. Is this something that the MailChimp API will allow or do? I found this page http://apidocs.mailchimp.com/api/how-to/transactional-campaigns.php which I am not sure if this effects me. Is the STS more suited to this? http://apidocs.mailchimp.com/sts/1.0/ Thanks Alex

    Read the article

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