Search Results

Search found 85 results on 4 pages for 'eddy freeman'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Initializing Multidimentional Arrays

    - by Eddy Freeman
    Hi Guy, I have a 3-multidimentional array : int[][][] env; which i would like to initialize with data in a text file. The data in the text file looks like this: { { { 0, 1,-1}, { 0, 2,-1}, {-1,-1,-2}, { 0, 0, 0} }, { { 0, 0,-1}, { 0, 0,-1}, {-1,-1,-2}, { 0, 0, 0} } } Actually the accolades can be removed and replaced with different characters if it is necessary. If there are any better way to format the values in the text file, then it is welcomed. I am looking for the best way to initialize the array in the java program with the values from the text file. All your help is appreciated. Thanks.

    Read the article

  • BufferedImage Help

    - by Eddy Freeman
    I posted a question in sun java forums sometime ago and i am finding it hard to understand the first response i received from the replier though it seems he gave me the correct approach to my problem. The link to the question is: http://forums.sun.com/thread.jspa?threadID=5436562&tstart=0 Someone replied that i should use BufferedImage and make tiles. I don't really understand what the tiles mean in connection with the BufferedImage. I would like someone to explain to me what the tiles are and how they are created in the BufferedImage. I have searched the web for a while but couldn't find any link that can help me understanding the basics of the tiles and creating the tiles. Any pointer to a site is also appreciated. I need help in understanding the tiles in connection with the BufferedImage and also how they are created.

    Read the article

  • adding a flash object to FancyBox using jquery swfobject

    - by Freeman
    Fellows, I dont seem to be getting a solution. I have a a video gallery which I create by dynamically from a database. I have managed to create a flash object which plays well without FancyBox, however I want a person to click on the gallery and then an swobject is created which will then be show on a fancybox. Here is part of my javascript which is not working. $.ajax({ data:"search=vids&id="+ art, type: "POST", url: "doyit.php", success: function(msg){ $(".videogallery").html('<h3>Click to view videos of '+name+'</h3>'+msg); $('.video').bind('click',function(ev){ var vid=$(this).attr("href"); var img=$(this).find("img").attr("src") $(this).flash({swf: "mediaplayer.swf", flashvars: { file: vid, image: img } }) $(this).fancybox( { ajax:{ type:"POST"}, 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'title' : this.title, 'width' : 680, 'height' : 495 } ); $(this).unbind(ev) return false; }) } Any suggestions?

    Read the article

  • Fastest way to zero out a 2d array in C?

    - by Eddy
    I want to repeatedly zero a large 2d array in C. This is what I do at the moment: for(j = 0; j < n; j++) { for(i = 0; i < n; i++) { array[i][j] = 0; } } I've tried using memset: memset(array, 0, sizeof(array)) But this only works for 1D arrays. When I printf the contents of the 2D array, the first row is zeroes, but then I got a load of random large numbers and it crashes.

    Read the article

  • How to define and work with an array of bits in C?

    - by Eddy
    I want to create a very large array on which I write '0's and '1's. I'm trying to simulate a physical process called random sequential adsorption, where units of length 2, dimers, are deposited onto an n-dimensional lattice at a random location, without overlapping each other. The process stops when there is no more room left on the lattice for depositing more dimers (lattice is jammed). Initially I start with a lattice of zeroes, and the dimers are represented by a pair of '1's. As each dimer is deposited, the site on the left of the dimer is blocked, due to the fact that the dimers cannot overlap. So I simulate this process by depositing a triple of '1's on the lattice. I need to repeat the entire simulation a large number of times and then work out the average coverage %. I've already done this using an array of chars for 1D and 2D lattices. At the moment I'm trying to make the code as efficient as possible, before working on the 3D problem and more complicated generalisations. This is basically what the code looks like in 1D, simplified: int main() { /* Define lattice */ array = (char*)malloc(N * sizeof(char)); total_c = 0; /* Carry out RSA multiple times */ for (i = 0; i < 1000; i++) rand_seq_ads(); /* Calculate average coverage efficiency at jamming */ printf("coverage efficiency = %lf", total_c/1000); return 0; } void rand_seq_ads() { /* Initialise array, initial conditions */ memset(a, 0, N * sizeof(char)); available_sites = N; count = 0; /* While the lattice still has enough room... */ while(available_sites != 0) { /* Generate random site location */ x = rand(); /* Deposit dimer (if site is available) */ if(array[x] == 0) { array[x] = 1; array[x+1] = 1; count += 1; available_sites += -2; } /* Mark site left of dimer as unavailable (if its empty) */ if(array[x-1] == 0) { array[x-1] = 1; available_sites += -1; } } /* Calculate coverage %, and add to total */ c = count/N total_c += c; } For the actual project I'm doing, it involves not just dimers but trimers, quadrimers, and all sorts of shapes and sizes (for 2D and 3D). I was hoping that I would be able to work with individual bits instead of bytes, but I've been reading around and as far as I can tell you can only change 1 byte at a time, so either I need to do some complicated indexing or there is a simpler way to do it? Thanks for your answers

    Read the article

  • Remove objects from UINavigationController

    - by Joshep Freeman
    I would like to know if there is a way to know which objects [UIViewControllers?] are stored inside [self navigationController] (I'm guessing they are stored there with pushViewController?), and if there is a way to remove such objects. Consider this scenario: 1.- Show "Presentation screen" (a logo) 2.- Wait 2 seconds 3.- Push "Data screen" (no need for "Presentation screen" anymore but it's stored in Memory) Thanks for your time.

    Read the article

  • Add/remove validation rules Dynamically

    - by eddy
    Hi, I need to dynamically add validation rules to a text box when the user clicks on the checkbox in that row and remove it when the user unchecks it. This is what I did, and it works fine, but I'm not sure if it is the right way to do it. Here's my html code: <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectItems" value="<c:out value="${item.numberPlate}"/>" /> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}"/></td> <td align="left"><input type="text" name="mileage_<c:out value="${item.numberPlate}"/>" value="" /></td> </tr> </c:forEach> </tbody> and my jquery: $("input[name=selectItems]").change(function() { if (this.checked) { $(this).closest("tr").find("input[name^=mileage]").attr("class","required"); $(this).closest("tr").find("input[name^=mileage]").attr("number",true); } else { $(this).closest("tr").find("input[name^=mileage]").attr("class","") } }); any suggestion is welcome and... I almost forgot, Merry Xmas!

    Read the article

  • How to pass data from selected rows using checkboxes from JSP to the server

    - by eddy
    Hi, I'd like to know if there's any way to send data to the server for the selected rows using the checkboxes I've put on those rows? I mean , how can I send only the data (in this case mileage ) of those selected rows (selected with the checkboxes) to the server ? see the image Here's the html code I use: <table> <thead> <tr class="tableheader"> <td width="10%"></td> <td width="30%">Vehicle</td> <td width="40%">Driver</td> <td width="10%">Mileage</td> </tr> </thead> <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectedItems" value="c:out value="${item.numberPlate}"/>"/> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}" /></td> <td align="left"><input type="text" name="mileage" value="" /></td> </tr> </c:forEach> </tbody> </table> I really hope you can give some guidance on this. Thanks in beforehand.

    Read the article

  • How to add next and previous buttons to my pager row

    - by eddy
    Hi folks!! How would I add next/previous buttons to this snippet, cause as you can see ,it will display as many links as it needs, so if you have a high number of pages then this might not be the best solution <c:choose> <c:when test="${pages >1}"> <div class="pagination art-hiddenfield" > <c:forEach var="i" begin="1"end="${pages}" step="1"> <c:url value="MaintenanceListVehicles.htm" var="url"> <c:param name="current" value="${i}"/> </c:url> <c:if test="${i==current}"> <a href="<c:out value="${url}"/> " class="current" > <c:out value="${i}" /></a> </c:if> <c:if test="${i!=current}"> <a href="<c:out value="${url}"/> " > <c:out value="${i}" /></a> </c:if> </c:forEach> </div> </c:when> <c:otherwise> <div align="center"> </div> </c:otherwise> </c:choose> CSS: .pagination .current { background: #26B; border: 1px solid #226EAD; color: white; } .pagination a { display: block; border: 1px solid #226EAD; color: #15B; text-decoration: none; float: left; margin-bottom: 5px; margin-right: 5px; padding: 0.3em 0.5em; } .pagination { font-size: 80%; float: right; } div { display: block; } This is what I get with my current code: And this is what I'd like to display, with ellipsis if possible Hope you can help me out.

    Read the article

  • How can I make my counter look less fake?

    - by Eddy Pronk
    I'm using this bit of code to display the number of users on a site. My customer is complaining it looks fake. Any suggestions? var visitors = 187584; var updateVisitors = function() { visitors++; var vs = visitors.toString(), i = Math.floor(vs.length / 3), l = vs.length % 3; while (i-->0) if (!(l==0&&i==0)) vs = vs.slice(0,i*3+l) + ',' + vs.slice(i*3+l); $('#count').text(vs); setTimeout(updateVisitors, Math.random()*2000); }; setTimeout(updateVisitors, Math.random()*2000);

    Read the article

  • ajax Post data missing with tinyMCE on Firefox

    - by Freeman
    I have a problem with my form when I try to submit with ajax. I am using Malsup Form plugin for Jquery but also using tinyMCE editor. When I submit the form and check the $_POST array, there is no data from the textarea. I have tried to use the triggerSave() function but to no avail. Everything is working well in IE. // These options are common and will be used for many form submissions var options = { target: '#notice', // target element(s) to be updated with server response dataType:'html', resetForm:true, beforeSubmit: function(){tinyMCE.triggerSave(false,true); }, success:function(msg){ $('#notice').html( msg) refresh(3) } }; //prepare form $('#savetext').ajaxForm(options);

    Read the article

  • How to pass checkbox array to Java from jsp

    - by eddy
    Hi, I'd like to know if there's any way to send data to the server for the selected rows using the checkboxes I've put on those rows? I mean , how can I send only the data of those selected rows to the server? Here's the html code I use: <table> <thead> <tr class="tableheader"> <td width="10%"></td> <td width="30%">Vehicle</td> <td width="40%">Driver</td> <td width="10%">Mileage</td> </tr> </thead> <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectedItems" value="c:out value="${item.numberPlate}"/>"/> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}" /></td> <td align="left"><input type="text" name="mileage" value="" /></td> </tr> </c:forEach> </tbody> </table> I really hope you can give some guidance on this. Thanks in beforehand.

    Read the article

  • How do I clear the contents of a file using c?

    - by Eddy
    I'm writing some code so that at each iteration of a for loop it runs a functions which writes data into a file, like this: int main() { int i; /* Write data to file 100 times */ for(i = 0; i < 100; i++) writedata(); return 0; } void writedata() { /* Create file for displaying output */ FILE *data; data = fopen("output.dat", "a"); /* do other stuff */ ... } How do I get it so that when I run the program it will delete the file contents at the beginning of the program, but after that it will append data to the file? I know that using the "w" identifier in fopen() will open a new file that's empty, but I want to be able to 'append' data to the file each time it goes through the 'writedata()' function, hence the use of the "a" identifier.

    Read the article

  • Finding an unnamed union in a struct::Haiku

    - by Freeman Lou
    So I have this assignment, and I have to find an unnamed union in struct _pthread_rwlock in pthread.h in the Haiku open source project. I began this assignment with some knowledge of c++ (past inheritance, polymorphism, and classes), but I find that what I learned do not help at all in my situation. I've opened the header file, and a source file named pthread_rwlock.cpp, and tried to look for the unnamed union, but there seems to be no unions in either file. What would be the correct way to find the problem?

    Read the article

  • Placing error message for a checkbox array

    - by eddy
    Hello all. I am using the Validation Plugin for jQuery and it works wonders. Except when I have a group of checkboxes...the error messages will display right after the first checkbox...like so: <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectItems" value="<c:out value="${item.numberPlate}"/>" /> </td> <!--some other columns--> </tr> </c:forEach> </tbody> I found that I can use a wrapper for these checkboxes ,then place the error message there, but I have no idea how to do it since I'm creating the rows dynamically. Hope you can help me out.

    Read the article

  • Drupal 7 front page URL after changing the front page

    - by Freeman
    I have used Configuration|Site Information|Default Front Page to designate node/55 as my front page. How can I create a menu linking to the original front page, i.e. the one with the list of articles? If I link to <front> it goes to node/55. P.S.: I have been able to simulate this by enabling the frontpage view, but, if possible, it would be more efficient to just link to the original front page URL.

    Read the article

  • How to define 2-bit numbers in C, if possible?

    - by Eddy
    For my university process I'm simulating a process called random sequential adsorption. One of the things I have to do involves randomly depositing squares (which cannot overlap) onto a lattice until there is no more room left, repeating the process several times in order to find the average 'jamming' coverage %. Basically I'm performing operations on a large array of integers, of which 3 possible values exist: 0, 1 and 2. The sites marked with '0' are empty, the sites marked with '1' are full. Initially the array is defined like this: int i, j; int n = 1000000000; int array[n][n]; for(j = 0; j < n; j++) { for(i = 0; i < n; i++) { array[i][j] = 0; } } Say I want to deposit 5*5 squares randomly on the array (that cannot overlap), so that the squares are represented by '1's. This would be done by choosing the x and y coordinates randomly and then creating a 5*5 square of '1's with the topleft point of the square starting at that point. I would then mark sites near the square as '2's. These represent the sites that are unavailable since depositing a square at those sites would cause it to overlap an existing square. This process would continue until there is no more room left to deposit squares on the array (basically, no more '0's left on the array) Anyway, to the point. I would like to make this process as efficient as possible, by using bitwise operations. This would be easy if I didn't have to mark sites near the squares. I was wondering whether creating a 2-bit number would be possible, so that I can account for the sites marked with '2'. Sorry if this sounds really complicated, I just wanted to explain why I want to do this.

    Read the article

  • Suggestion To Stackoverflow [closed]

    - by Eddy Freeman
    Hello Stackoverflow Team, This is just a suggestion to you. In the first place i must say that you guys are doing a great job. I suggest that you build into the forum system a mail notifier(to notify users whenever there is a move/deletion of a post with the reason of the move/deletion) so that whenever you move or removed someone's post then he can be notified about the move, so that we don't spend time looking for posts that are removed. I think by so doing the number of duplicate posts and mistakes from users can be minimized. The reason is i spent hours searching through the posts to locate my posts that you have re/moved. That is why i was a little bit upset. Sorry if here is the wrong place to post my suggestion. Point me to the right place. Thanks for your work.

    Read the article

  • why C clock() returns 0

    - by eddy ed
    I've got something like this: clock_t start, end; start=clock(); something_else(); end=clock(); printf("\nClock cycles are: %d - %d\n",start,end); and I always get as an output "Clock cycles are: 0 - 0" Any idea why this happens? (Just to give little detail, the something_else() function performs a left-to-right exponentiation using montgomery represantation, moreover I don't know for certain that the something_else() function does indeed take some not negligible time.) This is on Linux. The result of uname -a is: Linux snowy.*****.ac.uk 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

    Read the article

  • WHY HAVE YOU ROMOVED MY POST? [closed]

    - by Eddy Freeman
    I posted a question about how to rotate a tile in BufferedImage. I did it in the morning and you removed it. Why have you removed it again? What is wrong with the posts? Tell me before i become angry. You have removed the post twice without informing/telling me the problem. with the posts What is wrong? Tell me. Reply to this post and tell me what is wrong.

    Read the article

  • How to use SQL trigger to record the affected column's row number

    - by Freeman
    I want to have an 'updateinfo' table in order to record every update/insert/delete operations on another table. In oracle I've written this: CREATE TABLE updateinfo ( rnumber NUMBER(10), tablename VARCHAR2(100 BYTE), action VARCHAR2(100 BYTE), UPDATE_DATE date ) DROP TRIGGER TRI_TABLE; CREATE OR REPLACE TRIGGER TRI_TABLE AFTER DELETE OR INSERT OR UPDATE ON demo REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW BEGIN if inserting then insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'insert',sysdate); elsif updating then insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'update',sysdate); elsif deleting then insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'delete',sysdate); end if; -- EXCEPTION -- WHEN OTHERS THEN -- Consider logging the error and then re-raise -- RAISE; END TRI_TABLE; but when checking updateinfo, all rnumber column is zero. is there anyway to retrieve the correct row number?

    Read the article

  • Rotating A Tile In A BufferedImage

    - by Eddy Freeman
    I have created a a bufferedImage of 6 tiles of 2 rows and 3 columns and i want to rotate the last tile of the second row. This tile serves as a crossing for my animation. My problems are : How can i get access to that specifc tile alone and rotate it alone without affecting others. I have googled for a while but no answer.

    Read the article

  • I need to create a very large array of bits/boolean values. How would I do this in C/C++?

    - by Eddy
    Is it even possible to create an array of bits with more than 100000000 elements? If it is, how would I go about doing this? I know that for a char array I can do this: char* array; array = (char*)malloc(100000000 * sizeof(char)); If I was to declare the array by char array[100000000] then I would get a segmentation fault, since the maximum number of elements has been exceeded, which is why I use malloc. Is there something similar I can do for an array of bits?

    Read the article

  • How can I get all children from a parent row in the same table?

    - by Johnny Freeman
    Let's say I have a table called my_table that looks like this: id | name | parent_id 1 | Row 1 | NULL 2 | Row 2 | NULL 3 | Row 3 | 1 4 | Row 4 | 1 5 | Row 5 | NULL 6 | Row 6 | NULL 7 | Row 7 | 8 8 | Row 8 | NULL 9 | Row 9 | 4 10 | Row 10 | 4 Basically I want my final array in PHP to look like this: Array ( [0] => Array ( [name] => Row 1 [children] => Array ( [0] => Array ( [name] => Row 3 [children] => ) [1] => Array ( [name] => Row 4 [children] => Array ( [0] => Array ( [name] => Row 9 [children] => ) [1] => Array ( [name] => Row 10 [children] => ) ) ) ) ) [1] => Array ( [name] => Row 2 [children] => ) [2] => Array ( [name] => Row 5 [children] => ) [3] => Array ( [name] => Row 6 [children] => ) [4] => Array ( [name] => Row 8 [children] => Array ( [0] => Array ( [name] => Row 7 [children] => ) ) ) ) So, I want it to get all of the rows where parent_id is null, then find all nested children recursively. Now here's the part that I'm having trouble with: How can this be done with 1 call to the database? I'm sure I could do it with a simple select statement and then have PHP make the array look like this but I'm hoping this can be done with some kind of fancy db joining or something like that. Any takers?

    Read the article

  • How do I return the indices of a multidimensional array element in C?

    - by Eddy
    Say I have a 2D array of random boolean ones and zeroes called 'lattice', and I have a 1D array called 'list' which lists the addresses of all the zeroes in the 2D array. This is how the arrays are defined: define n 100 bool lattice[n][n]; bool *list[n*n]; After filling the lattice with ones and zeroes, I store the addresses of the zeroes in list: for(j = 0; j < n; j++) { for(i = 0; i < n; i++) { if(!lattice[i][j]) // if element = 0 { list[site_num] = &lattice[i][j]; // store address of zero site_num++; } } } How do I extract the x,y coordinates of each zero in the array? In other words, is there a way to return the indices of an array element through referring to its address?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >