Daily Archives

Articles indexed Monday September 3 2012

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

  • Process is killed without a (obvious) reason and program stops working

    - by Krzysiek Gurniak
    Here's what my program is supposed to do: create 4 child processes: process 0 is reading 1 byte at a time from STDIN, then writing it into FIFO process 1 is reading this 1 byte from fifo and write its value as HEX into shared memory process 2 is reading HEX value from shared memory and writing it into pipe finally process 3 is reading from pipe and writing into STDOUT (in my case: terminal) I can't change communication channels. FIFO, then shared memory, then pipes are the only option. My problem: Program stops at random moments when some file is directed into stdin (for example:./program < /dev/urandom). Sometimes after writing 5 HEX values, sometimes after 100. Weird thing is that when it is working and in another terminal I write "pstree -c" there is 1 main process with 4 children processes (which is what I want), but when I write "pstree -c" after it stopped writing (but still runs) there are only 3 child processes. For some reason 1 is gone even though they all have while(1) in them.. I think I might have problem with synchronization here, but I am unable to spot it (I've tried for many hours). Here's the code: #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/shm.h> #include <sys/sem.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> #include <string.h> #include <signal.h> #define BUFSIZE 1 #define R 0 #define W 1 // processes ID pid_t p0, p1, p2, p3; // FIFO variables int fifo_fd; unsigned char bufor[BUFSIZE] = {}; unsigned char bufor1[BUFSIZE] = {}; // Shared memory variables key_t key; int shmid; char * tab; // zmienne do pipes int file_des[2]; char bufor_pipe[BUFSIZE*30] = {}; void proces0() { ssize_t n; while(1) { fifo_fd = open("/tmp/fifo",O_WRONLY); if(fifo_fd == -1) { perror("blad przy otwieraniu kolejki FIFO w p0\n"); exit(1); } n = read(STDIN_FILENO, bufor, BUFSIZE); if(n<0) { perror("read error w p0\n"); exit(1); } if(n > 0) { if(write(fifo_fd, bufor, n) != n) { perror("blad zapisu do kolejki fifo w p0\n"); exit(1); } memset(bufor, 0, n); // czyszczenie bufora } close(fifo_fd); } } void proces1() { ssize_t m, x; char wartosc_hex[30] = {}; while(1) { if(tab[0] == 0) { fifo_fd = open("/tmp/fifo", O_RDONLY); // otwiera plik typu fifo do odczytu if(fifo_fd == -1) { perror("blad przy otwieraniu kolejki FIFO w p1\n"); exit(1); } m = read(fifo_fd, bufor1, BUFSIZE); x = m; if(x < 0) { perror("read error p1\n"); exit(1); } if(x > 0) { // Konwersja na HEX if(bufor1[0] < 16) { if(bufor1[0] == 10) // gdy enter { sprintf(wartosc_hex, "0x0%X\n", bufor1[0]); } else { sprintf(wartosc_hex, "0x0%X ", bufor1[0]); } } else { sprintf(wartosc_hex, "0x%X ", bufor1[0]); } // poczekaj az pamiec bedzie pusta (gotowa do zapisu) strcpy(&tab[0], wartosc_hex); memset(bufor1, 0, sizeof(bufor1)); // czyszczenie bufora memset(wartosc_hex, 0, sizeof(wartosc_hex)); // przygotowanie tablicy na zapis wartosci hex x = 0; } close(fifo_fd); } } } void proces2() { close(file_des[0]); // zablokuj kanal do odczytu while(1) { if(tab[0] != 0) { if(write(file_des[1], tab, strlen(tab)) != strlen(tab)) { perror("blad write w p2"); exit(1); } // wyczysc pamiec dzielona by przyjac kolejny bajt memset(tab, 0, sizeof(tab)); } } } void proces3() { ssize_t n; close(file_des[1]); // zablokuj kanal do zapisu while(1) { if(tab[0] == 0) { if((n = read(file_des[0], bufor_pipe, sizeof(bufor_pipe))) > 0) { if(write(STDOUT_FILENO, bufor_pipe, n) != n) { perror("write error w proces3()"); exit(1); } memset(bufor_pipe, 0, sizeof(bufor_pipe)); } } } } int main(void) { key = 5678; int status; // Tworzenie plikow przechowujacych ID procesow int des_pid[2] = {}; char bufor_proces[50] = {}; mknod("pid0", S_IFREG | 0777, 0); mknod("pid1", S_IFREG | 0777, 0); mknod("pid2", S_IFREG | 0777, 0); mknod("pid3", S_IFREG | 0777, 0); // Tworzenie semaforow key_t klucz; klucz = ftok(".", 'a'); // na podstawie pliku i pojedynczego znaku id wyznacza klucz semafora if(klucz == -1) { perror("blad wyznaczania klucza semafora"); exit(1); } semafor = semget(klucz, 1, IPC_CREAT | 0777); // tworzy na podstawie klucza semafor. 1 - ilosc semaforow if(semafor == -1) { perror("blad przy tworzeniu semafora"); exit(1); } if(semctl(semafor, 0, SETVAL, 0) == -1) // ustawia poczatkowa wartosc semafora (klucz, numer w zbiorze od 0, polecenie, argument 0/1/2) { perror("blad przy ustawianiu wartosci poczatkowej semafora"); exit(1); } // Tworzenie lacza nazwanego FIFO if(access("/tmp/fifo", F_OK) == -1) // sprawdza czy plik istnieje, jesli nie - tworzy go { if(mkfifo("/tmp/fifo", 0777) != 0) { perror("blad tworzenia FIFO w main"); exit(1); } } // Tworzenie pamieci dzielonej // Lista pamieci wspoldzielonych, komenda "ipcs" // usuwanie pamieci wspoldzielonej, komenta "ipcrm -m ID_PAMIECI" shmid = shmget(key, (BUFSIZE*30), 0666 | IPC_CREAT); if(shmid == -1) { perror("shmget"); exit(1); } tab = (char *) shmat(shmid, NULL, 0); if(tab == (char *)(-1)) { perror("shmat"); exit(1); } memset(tab, 0, (BUFSIZE*30)); // Tworzenie lacza nienazwanego pipe if(pipe(file_des) == -1) { perror("pipe"); exit(1); } // Tworzenie procesow potomnych if(!(p0 = fork())) { des_pid[W] = open("pid0", O_WRONLY | O_TRUNC | O_CREAT); // 1 - zapis, 0 - odczyt sprintf(bufor_proces, "Proces0 ma ID: %d\n", getpid()); if(write(des_pid[W], bufor_proces, sizeof(bufor_proces)) != sizeof(bufor_proces)) { perror("blad przy zapisie pid do pliku w p0"); exit(1); } close(des_pid[W]); proces0(); } else if(p0 == -1) { perror("blad przy p0 fork w main"); exit(1); } else { if(!(p1 = fork())) { des_pid[W] = open("pid1", O_WRONLY | O_TRUNC | O_CREAT); // 1 - zapis, 0 - odczyt sprintf(bufor_proces, "Proces1 ma ID: %d\n", getpid()); if(write(des_pid[W], bufor_proces, sizeof(bufor_proces)) != sizeof(bufor_proces)) { perror("blad przy zapisie pid do pliku w p1"); exit(1); } close(des_pid[W]); proces1(); } else if(p1 == -1) { perror("blad przy p1 fork w main"); exit(1); } else { if(!(p2 = fork())) { des_pid[W] = open("pid2", O_WRONLY | O_TRUNC | O_CREAT); // 1 - zapis, 0 - odczyt sprintf(bufor_proces, "Proces2 ma ID: %d\n", getpid()); if(write(des_pid[W], bufor_proces, sizeof(bufor_proces)) != sizeof(bufor_proces)) { perror("blad przy zapisie pid do pliku w p2"); exit(1); } close(des_pid[W]); proces2(); } else if(p2 == -1) { perror("blad przy p2 fork w main"); exit(1); } else { if(!(p3 = fork())) { des_pid[W] = open("pid3", O_WRONLY | O_TRUNC | O_CREAT); // 1 - zapis, 0 - odczyt sprintf(bufor_proces, "Proces3 ma ID: %d\n", getpid()); if(write(des_pid[W], bufor_proces, sizeof(bufor_proces)) != sizeof(bufor_proces)) { perror("blad przy zapisie pid do pliku w p3"); exit(1); } close(des_pid[W]); proces3(); } else if(p3 == -1) { perror("blad przy p3 fork w main"); exit(1); } else { // proces macierzysty waitpid(p0, &status, 0); waitpid(p1, &status, 0); waitpid(p2, &status, 0); waitpid(p3, &status, 0); //wait(NULL); unlink("/tmp/fifo"); shmdt(tab); // odlaczenie pamieci dzielonej shmctl(shmid, IPC_RMID, NULL); // usuwanie pamieci wspoldzielonej printf("\nKONIEC PROGRAMU\n"); } } } } exit(0); }

    Read the article

  • Configuring Team City internal.properties to increase git fetch memory

    - by 78lro
    When pulling from GIT my Team City install is getting an out of memory error. According to the Team City documentation I should be able to increase the memory assigned to the git fetch process, by setting the value for teamcity.git.fetch.process.max.memory to something greater than the default 512MB. http://confluence.jetbrains.net/display/TCD65/Git+%28JetBrains%29#Git%28JetBrains%29-InternalProperties Problem is there does not appear to be an internal.properties file in the location specified. I have tried creating one in the TeamCity/conf/internal.properties as suggested here: http://devnet.jetbrains.net/thread/302596 But I still get the out of memory issue when Team City tries to pull from github thx

    Read the article

  • how can I enter character "<" in strings.xml?

    - by yrajabi
    I want to enter string " -< " in strings.xml file, the string has character < and I couldn't add it to xml file without error! I even tried to escaping by \ character: <string name="search_target_arrow"> -\< </string> or enclosing it between "" as below: <string name="search_target_arrow">" -< "</string> but none worked. Maybe I'm very amateur at this and the answer is not hard for you. so please tell me how you add such special chars in strings.xml?

    Read the article

  • Order a foreach, by the value of a calculation of values in the array

    - by Mark
    I have an array as follows: $players = array( $player = array( 'name' => 'playername', 'speed' => '10', 'agility' => '10', 'influence' => '10' ) etc Then I calculate a $score, based on the sum of speed, agility and influence. $score = $p['speed'] + $p['agility'] + $p['influence']; How can I loop through my array, but order the results from highest to lowest $score? PS- http://pastebin.com/eUEQ5y4u

    Read the article

  • Get the id of the link and pass it to the jQueryUI dialog widget

    - by Mike Sanchez
    I'm using the dialog widget of jQueryUI. Now, the links are grabbed from an SQL database by using jQuery+AJAX which is the reason why I used "live" $(function() { var $dialog = $('#report') .dialog({ autoOpen: false, resizable: false, modal: true, height: 410, width: 350, draggable: true }) //store reference to placeholders $uid = $('#reportUniqueId'); $('.reportopen').live("click", function (e) { $dialog.dialog('open'); var $uid = $(this).attr('id'); e.preventDefault(); }); }); My question is, how do I pass the id of the link that triggered the dialog widget to the dialog box itself? The link is set up like this: <td align="left" width="12%"> <span id="notes"> [<a href="javascript:void(0)" class="reportopen" id="<?=$reportId;?>">Spam</a>] </span> </td> And the dialogbox is set up like this: <div id="report" title="Inquire now"> HAHAHAHAHA <span id="reportUniqueId"></span> </div> I'd like for the id to be passed and generated in the <span id="reportUniqueId"></span> part of the dialog box. Any idea?

    Read the article

  • jquery $.GET loading order

    - by welovedesign
    I am loading all external pages in jquery for a slider. The problem is it loads in a different order. What I need to do is sequence the loading of pages $.get("page1.php", function( my_var ) { $('#slider').append($('.content', my_var)); }); $.get("page2.php", function( my_var ) { $('#slider').append($('.content', my_var)); }); $.get("page3.php", function( my_var ) { $('#slider').append($('.content', my_var)); }); sometimes page3 loads before page2.

    Read the article

  • Two floating div's, one underneath. works in every browser except IE

    - by Veltar
    So I have an html-structure that looks like this: <div id="contact-wrapper"> <div> <h4>België</h4> <p>Tuinwijklaan 79<br /> 9000 Gent<br /> Tel. 0468/115967<br /> [email protected]<br /> </p> </div> <div> <h4>Nederland</h4> <p>Kerkstraat 423-C<br /> 1017 HX Amsterdam<br /> Tel: +32 468 11 59 67<br /> [email protected] </p> </div><br /> <a id="link-contact" href="#">Contacteer ons</a> </div> The two div's are displayed next to each other, and the link under it, like this: But in ie9 it shows like this: This is my css for the divs: footer div#contact-wrapper, footer h1 { float: left; } footer div#contact-wrapper div { margin: 16px 0px 0px 45px; float: left; } footer div#contact-wrapper div:first-of-type { padding-right: 30px; margin-left: 60px; border-right: 1px dashed #a3b0b9; } footer div#contact-wrapper a#link-contact { display: inline-block; background: #ffffff url('../img/contact-arrow.gif') no-repeat 95% center; border: 4px solid #bbc2c7; font-size: 12px; color: #bbc2c7; margin: 5px 0px 0px 60px; padding: 3px 0px 3px 5px; width: 150px; }

    Read the article

  • What jquery based table plugin can hide sub rows?

    - by user1458290
    I'm in the need to convert excel macros into jquery code, the function is that you need to click on the plus sign to unfold and show the sub rows to modify column2 if you want to type values in column2, the other columns can't be modified. You can't straightly modify values of column2 until you unfold the parent row, because there are many sub rows belonging to parent row,say Car. The values of Name, Model, Code are existing, they are master data, no need to type or modify. please see the snapshot at folded and unfolded, besides modifying values in sub rows , I need to be able to know which sub rows are modified and values of those rows.Initially the editable columns are blank. And when you click on the minus sign, the sub rows can be folded again,but the modified values won't be lost,they are still there when unfolded again. One last requirement is it's cross devices, the code must run well on pc,mobile phone,pad. Is that possible? Many thanks.

    Read the article

  • When dragged and on mouseup/mouseleave in the document I want to call my Ajax request

    - by Sappy
    For slider range - when dragged and on mouseup/mouseleave in the document I want to call my Ajax request. Explained: When I mousedown to slide my slider I want to say isDown = "true" But it doesn't works. Can anyone please help me with this and let me know how do I achieve this. // Default isDown = false $("#slider-range").find('a').mousedown(function(){ isDown=true; console.log(isDown); // It works here! }); console.log(isDown); // It doesn't works here if(isDown) { $(document).onmouseup(function() { return setAjaxRequest(); isDown = false; }); }

    Read the article

  • How to use numpy with OpenBLAS instead of Atlas in Ubuntu?

    - by pierotiste
    I have looked for an easy way to install/compile Numpy with OpenBLAS but didn't find an easy answer. All the documentation I have seen takes too much knowledge as granted for someone like me who is not used to compile software. There are two packages in Ubuntu related to OpenBLAS : libopenblas-base and libopenblas-dev. Once they are installed, what should I do to install Numpy again with them? Thanks! Note that when these OpenBLAS packages are installed, Numpy doesn't work anymore: it can't be imported: ImportError: /usr/lib/liblapack.so.3gf: undefined symbol: ATL_chemv. This was noticed here already. Answer to the question: Run sudo update-alternatives --all and set liblapack.so.3gf to /usr/lib/lapack/liblapack.so.3gf

    Read the article

  • How can i modify remote machine input.properties file from web page in C#.Net

    - by picnic4u
    i have build script in remote machine.but i want to start the build from my local machine.so for this i need to update the input.properties file in remote machine and then run the batch file to start the build process. For this i have created one web page so how can i modify the remote input.properties file and run the batch file in C#. please give me some suggestion for this. thanks in advance...

    Read the article

  • How to format the Facebook news feed description of grouped app posts?

    - by JcFx
    I have an app which posts a message like this to a user's Facebook timeline: This is working fine, but if I post a few times, my posts get grouped on my news feed, and I get this: What settings should I use to control the way this news report appears? Instead of 'All about periods' and the page link in the box at the top, I'd like 'Body iQ Quiz' and the app description. Where would I set these values? And is it possible to make the grouped report say 'Jay cee Effex shared a link via Body iQ Quiz', the way the original post does? I'm posting from the Facebook AS3 API, and my post code looks like this: var auth:FacebookAuthResponse = Facebook.getAuthResponse(); var token:String = auth.accessToken; var user:String = auth.uid; var values:Object = { access_token: token, name: "Body iQ Quiz", picture: "http://a7.sphotos.ak.fbcdn.net/hphotos-ak-snc6/282950_427728213914009_630526316_n.jpg", link:"http://www.lil-lets.co.uk/en-GB/Wellbeing", description: "Women, how well do we know our bodies? Click here to find out what your Body iQ is.", message: result.FacebookBody + " " + result.FacebookTitle }; Facebook.api("/" + user + "/feed", handleSubmitFeed, values, URLRequestMethod.POST); ... but I'm not sure if this is something I can fix in code, or if the app configuration needs tweaking? NOTE: Some users report getting the latter format in their news feed even with a single post (I can't reproduce this), so perhaps grouping is a red herring, and the real question is how to format the news feed report of a timeline post?

    Read the article

  • Selecting first records of a type in a given period

    - by Emanuil Rusev
    I have a database table that stores user comments: comments(id, user_id, created_at) I want to get from it the number of users that have commented for the first time in the past week. Here's what I have so far: SELECT COUNT(DISTINCT `user_id`) FROM `comments` WHERE `created_at` BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW() This would give the number of users that have commented, but it would not take into consideration whether these comments are first for these users.

    Read the article

  • load domain specific content

    - by wayne
    Let's say I have an app sitting at myapp.com The app has clients or users that are situated here myapp.com/jonny myapp.com/sally I want to allow users to point their own domain to my server (A record) and load their specific content. No redirects or anything. jonnysapp.com -> myapp.com/jonny So somehow my server needs to detect where the request is coming from and set the client... correct?

    Read the article

  • spring mvc nested model validation

    - by hguser
    I have two models : User,Project public class Project{ private int id; @NotEmpty(message="Project Name can not be empty") private String name; private User manager; private User operator; //getter/setter omitted } public class User{ private int id; private String name; //omit other properties and getter/setter } Now, when I create a new Project, I will submit the following parameters to ProjectController: projects?name=jhon&manager.id=1&operator.id=2... Then I will create a new Project object and insert it to db. However I have to validate the id of the manager and operator is valid,that's to say I will validate that if there is matched id in the user table. So I want to know how to implement this kind of validation?

    Read the article

  • How to turn off SSL on heroku

    - by rockyroadster555
    I'm redirecting a domain to Heroku using a cname. Currently Its working but is giving me an ssl error. Is there a way to turn off ssl on heroku? Heres the SSL Error This is probably not the site you are looking for! You attempted to reach app.grewpr.com, but instead you actually reached a server i identifying itself as *.herokuapp.com. This may be caused by a misconfiguration on the server or by something more serious. An attacker on your network could be trying to get you to visit a fake (and potentially harmful) version of app.grewpr.com. You should not proceed, especially if you have never seen this warning before for this site. When I try to go to http://pure-chamber-1979.herokuapp.com/ it automatically redirects me to the ssl version. Is there a way to turn this off?

    Read the article

  • Selenium navigation inside foreach loop

    - by smudgedlens
    I am having an issue with navigation. I get a list of rows from an html table. I iterate over the rows and scrape information from them. But there is also a link on the row that I click to go to more information related to the row to scrape. Then I navigate back to the page with the original table. This works for the first row, but for the subsequent rows, it throws an exception. I look at my row collection after the first time the link inside a row is clicked, and none of them have the correct values like they did before I clicked the link. I believe that there is something going on when I navigate to a different URL that I'm not getting. My code is below. How do I get this working so I can iterate over the parent table, click the links in each row, navigate to the child table, but still continue iterating over the rows in the parent table? private List<Document> getResults() { var documents = new List<Document>(); //Results IWebElement docsTable = this.webDriver.FindElements(By.TagName("table")) .Where(table => table.Text.Contains("Document List")) .FirstOrDefault(); var validDocRowRegex = new Regex(@"^(\d{3}\s+)"); var docRows = docsTable.FindElements(By.TagName("tr")) .Where(row => //It throws an exception with .FindElement() when there isn't one. row.FindElements(By.TagName("td")).FirstOrDefault() != null && //Yeah, I don't get this one either. I negate the match and so it works?? !validDocRowRegex.IsMatch( row.FindElement(By.TagName("td")).Text)) .ToList(); foreach (var docRow in docRows) { //Todo: find out why this is crashing on some documents. var cells = docRow.FindElements(By.TagName("td")); var document = new Document { DocID = Convert.ToInt32(cells.First().Text), PNum = Convert.ToInt32(cells[1].Text), AuthNum = Convert.ToInt32(cells[2].Text) }; //Go to history for the current document. cells.Where(cell => cell.FindElements(By.TagName("a")).FirstOrDefault() != null) .FirstOrDefault().Click(); //Todo: scrape child table. this.webDriver.Navigate().Back(); } return documents; }

    Read the article

  • A versioning workflow for multiple similar (but not identical) deployments

    - by rs77
    I'm currently employed at a small non-tech organisation and have been given the role of coding the organisations' website. While I have enjoyed the task and have learnt much with web dev I've encountered a few issues that I'm hoping someone will be able to help with me or at least point me in the right direction on. A little background: The site I work on has subdomains that each have their own separate WordPress installation on - as this has been the easiest "backend" admin panel for the type of user who will be responsible for updating content (etc). Within the organisation I work under the Marketing Manager (MM) and I code according to his style guide and wire frames. While we have been working with only one subdomain since the beginning of the year the project has been relatively simple and straightforward. However, lately the workflow is becoming a little more complicated as our original subdomain has been copied over to the other subdomains. Each of the new subdomains receives minor edits to their stylesheets (eg. different pictures for background, slightly different colours here and there, etc). The issue: At the moment managing all the different subdomains has been "bearable", but the straw that's braking the camel's back at the moment has been the slight reversions the MM has required now that the CEO has seen the final product. The problem I'm having with reversions in stylesheets is that the CEO will one week state that he likes change "X" and then as the MM and I continue to modify the site (to now "Z"), will another week state that he wants us to change "X" to "W" but keeping most of the changes made in "Y". What I'm looking for is something that allows for: tracking file changes reverting changes made (or reverting back to 'a' from 'e' but including changes 'b' & 'c') easily upload necessary files to their respective WP-theme installation Does anything out there come close to addressing these issues? If so, what? Thanks for any help! PS - I'm learning Git at the moment and it seems to do the "tracking file changes" quite nicely. Haven't learnt about the reverting changes bit yet, though. Maybe for my final point I'm thinking of creating a shell script to automatically upload the files to their folders. Does Git do this too though? Addendum (alexbbrown) I had a similar problem: I ran a custom version of mediawiki where I installed various extensions in the versioned core (with svn). Each of the extensions required an section in the confit file, but the confit file also needed local configuration for each of several deployments. I could have implemented it using includes, but they would not be versioned; and rebasing branches each time is a chore. +50 experience points for a good answer in git.

    Read the article

  • JAR file: Could not find main class

    - by ApertureT3CH
    Okay, I have a strange problem. I wanted to run one of my programs as a .jar file, but when I open it by double-clicking it, I get an error message like "Could not find main class, program is shutting down". I'm pretty sure I did everything right, the jar should work afaik. I also tried other programs, it's the same with every single one. (I'm creating the .jar's through BlueJ) There is no problem when I run them through a .bat . And here comes the strangest thing of all: The .jar's have worked some time ago (one or two months I guess), and I don't remember doing anything different. It's the same BlueJ-Version. Okay, maybe Java updated and something got messed up... I googled, but I couldn't find a solution. (some people seem to have a similar problem, and it seems to be only them who can't run their .jar's; they uploaded them and other people say the .jar's run fine.) What could be the problem? How can I solve it? I'd really appreciate some help here. Thank you :) ApertureT3CH EDIT: okay guys, you're making me unsure here. Imma check the manifest again, at this unholy time ( 1:34 am ) :P EDIT2: This is my MANIFEST.MF Manifest-Version: 1.0 Class-Path: Main-Class: LocalChatClientGUI [empty line] [empty line] The Main class is correct. EDIT3: Thanks to hgrey: There is nothing wrong with the jar. I can run it from a bat file, which actually should not be different from double-clicking the jar, right? Yet I get the error when clicking it, and it works fine through the bat. EDIT4: I finally solved the problem. I re-installed the JRE and now it works, although I can't see any version differences. Thanks to everyone!

    Read the article

  • Image Upload with Mootools

    - by notme
    I am creating an ajax uploader with mootools. When I remove the ajax and simply upload the form I get $_FILES with the file data present. But when I use the ajax version, the $_FILES super global is empty. Every other part of the form is present. It acts as if it does not send the image at all but only in the ajax version. Any help is appreciated. Thanks! <form id="uploadphoto_pod" action="upload.php" enctype="multipart/form-data" method="post"> <input type='file' id='uploadphoto' name='uploadphoto'/> <input type="submit" class="submit" name="add_product" value="Upload" /> </form> <div id="response"><!-- Ajax Response --></div> <script type="text/javascript"> window.addEvent('domready', function(){ $('uploadphoto').addEvent('submit', function(e) { //Prevents the default submit event from loading a new page. e.stop(); //("this" refers to the $('uploadphoto') element). this.set('send', {onComplete: function(response) { $('response').set('html', response); }}); //Send the form. this.send(); }); }); </script>

    Read the article

  • File.Exists() returns false, but not in debug

    - by Tor Haugen
    I'm being completely confused here folks, My code throws an exception because File.Exists() returns false public override sealed TCargo ReadFile(string fileName) { if (!File.Exists(fileName)) { throw new ArgumentException("Provided file name does not exist", "fileName"); } Visual studio breaks at the throw statement, and I immediately check the value of File.Exists(fileName) in the immediate window. It returns true. When I drag the breakpoint back up to the if statement and execute it again, it throws again. fileName is an absolute path to a file. I'm not creating the file, nor writing to it (it's there all along). If I paste the path into the open dialog in Notepad, it reads the file without problems. The code is executing in a background worker. It's the only complicating factor I can think of. I am positive the file has not been opened already, either in the worker thread or elsewhere. What's going on here?

    Read the article

  • How to make ActiveRecord work with legacy partitioned/sharded databases/tables?

    - by Utensil
    thanks for your time first...after all the searching on google, github and here, and got more confused about the big words(partition/shard/fedorate),I figure that I have to describe the specific problem I met and ask around. My company's databases deals with massive users and orders, so we split databases and tables in various ways, some are described below: way database and table name shard by (maybe it's should be called partitioned by?) YZ.X db_YZ.tb_X order serial number last three digits YYYYMMDD. db_YYYYMMDD.tb date YYYYMM.DD db_YYYYMM.tb_ DD date too The basic concept is that databases and tables are seperated acording to a field(not nessissarily the primary key), and there are too many databases and too many tables, so that writing or magically generate one database.yml config for each database and one model for each table isn't possible or at least not the best solution. I looked into drnic's magic solutions, and datafabric, and even the source code of active record, maybe I could use ERB to generate database.yml and do database connection in around filter, and maybe I could use named_scope to dynamically decide the table name for find, but update/create opertions are bounded to "self.class.quoted_table_name" so that I couldn't easily get my problem solved. And even I could generate one model for each table, because its amount is up to 30 most. But this is just not DRY! What I need is a clean solution like the following DSL: class Order < ActiveRecord::Base shard_by :order_serialno do |key| [get_db_config_by(key), #because some or all of the databaes might share the same machine in a regular way or can be configed by a hash of regex, and it can also be a const get_db_name_by(key), get_tb_name_by(key), ] end end Can anybody enlight me? Any help would be greatly appreciated~~~~

    Read the article

  • Are there hosted jQuery UI themes anywhere? [closed]

    - by Kip
    Possible Duplicate: Downloading jQuery CSS from Google's CDN I'm using Google-hosted jQuery and jQueryUI, but I'm wondering if there are hosted jQueryUI themes anywhere? I'd like to just point to a hosted CSS file (the same way I do with the hosted JS file), so that I don't have to worry about setting up directories for the widget images or the CSS files or anything like that. Update I've found this, referenced by the jqueryui.com source code: <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" /> Substituting the name of other themes from the themeroller page seems to work, but I'd love it if someone could find where on Google they list all the available themes that they are hosting. I'm not finding anything about this (maybe it is very recent?).

    Read the article

  • Designing for mobile (aka designing for everything)

    - by ihaynes
    Last Saturday I went to 'Developer Developer Developer 10' on the Microsoft campus at Reading (UK). This is one of a series of regular events put on by the developer community for the developer community. The guys who organise these events put in a huge amount of time and effort into them and they are well worth getting to if you can.I enjoy these events because there's always something currently relevant but also I can get an insight into things I don't normally come across or work with.Having said that, it's web related things that always grab my attention and this year one of my favourite speakers, George Adamson, gave a session on 'Designing for mobile (aka designing for everything)'. This is a subject close to my heart and I've tried to put the argument forward myself on http://www.ew-resource.co.uk/mobile/ but George makes a far better job of it that I can.His slideshow from the session is available on http://www.slideshare.net/george.adamson and although you won't get his unique presentation style in the static slideshow, this is well worth watching if you have the time.

    Read the article

  • PHP fastcgi handler dont work

    - by user1260968
    I have CentOS server ( Server version: Apache/2.2.15 (Unix) Server built: Feb 13 2012 22:31:42 ) with mod_fastcgi.x86_64(2.4.6-2.el6.rf) and php 5.3.3. some sites not work on fastcgi mode. In apache error.log: [Mon Sep 03 19:20:37 2012] [warn] [client 80.*.*.*] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Mon Sep 03 19:20:37 2012] [error] [client 80.*.*.*] Premature end of script headers: index.php Can anybody tell me how solve this?

    Read the article

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