Search Results

Search found 79 results on 4 pages for 'jerome'.

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

  • passing an array of structures (containing two mpz_t numbers) to a function

    - by jerome
    Hello, I'm working on some project where I use the type mpz_t from the GMP C library. I have some problems passing an array of structures (containing mpz_ts) adress to a function : I wille try to explain my problem with some code. So here is the structure : struct mpz_t2{ mpz_t a; mpz_t b; }; typedef struct mpz_t2 *mpz_t2; void petit_test(mpz_t2 *test[]) { printf("entering petit test function\n"); for (int i=0; i < 4; i++) { gmp_printf("test[%d]->a = %Zd and test[%d]->b = %Zd\n", test[i]->a, test[i]->b); } } /* IN MAIN FUNCTION */ mpz_t2 *test = malloc(4 * sizeof(mpz_t2 *)); for (int i=0; i < 4; i++) { mpz_t2_init(&test[i]); // if I pass test[i] : compiler error mpz_set_ui(test[i].a, i); //if test[i]->a compiler error mpz_set_ui(test[i].b, i*10); //same problem gmp_printf("%Zd\n", test[i].b); //prints correct result } petit_test(test); The programm prints the expected result (in main) but after entering the petit_test function produces a segmentation fault error. I would need to edit the mpz_t2 structure array in petit_test. I tried some other ways allocating and passing the array to the function but I didn't manage to get this right. If someone has a solution to this problem, I would be very thankfull! Regards, jérôme.

    Read the article

  • Connecting with SMB from Mac to Windows server

    - by Jérôme
    I'm trying to connect from my Mac to a directory on a Windows server. Here is what I'm doing from the finder : menu Go->connect to server->smb://srv-fichiers1/Personnel/conujer I get an error (error code -36). But, from the finder window, if I click on Shared->All->srv-fichier1->Personnel->conujer, I have access to the directory. I don't understand why I cannot connect straight to conujer.

    Read the article

  • How do you create virtual folders from saved search

    - by Jérôme Radix
    I would like to have on unix-like platforms, the same functionality as to Windows 7 Library folders (aka virtual folders) you see in Windows Explorer. Gnome Nautilus do that kind of virtual folders through saved search. But I want a system-wide solution, not a gnome-wide solution. Is there a tool that creates virtual folders from the concatenation of multiple search queries (the result of multiple find commands ?). The solution should index files for better performances and you should be able to define the default folder for copy operations. I assume the solution of this kind of problem certainly use FUSE, but I can't see a complete solution to this kind of task in FUSE applications.

    Read the article

  • How do you create virtual folders from saved search

    - by Jérôme Radix
    I would like to have on unix-like platforms, the same functionality as to Windows 7 Library folders (aka virtual folders) you see in Windows Explorer. Gnome Nautilus do that kind of virtual folders through saved search. But I want a system-wide solution, not a gnome-wide solution. Is there a tool that creates virtual folders from the concatenation of multiple search queries (the result of multiple find commands ?). The solution should index files for better performances and you should be able to define the default folder for copy operations. I assume the solution of this kind of problem certainly use FUSE, but I can't see a complete solution to this kind of task in FUSE applications.

    Read the article

  • lucid lynx runaway process

    - by Jerome
    I am runnning lucid lynx with a gnome desktop. After uninstalling the klipper program there is a new and unwelcome process that begins at startup and takes around 66% of my cpu time. According to "top", the process number is 10 and the name of the process is "events/1". I am unable to kill the process using "top" or "kill". I have no extra startup applications except for gnome-do and tomboy. Eliminating these has no effect. Can anyone help?

    Read the article

  • Connecting with SMB from Mac to Windows server

    - by Jérôme
    I'm trying to connect from my Mac to a directory on a Windows server. Here is what I'm doing from the finder : menu Go->connect to server->smb://srv-fichiers1/Personnel/conujer I get an error (error code -36). But, from the finder window, if I click on Shared->All->srv-fichier1->Personnel->conujer, I have access to the directory. I don't understand why I cannot connect straight to conujer.

    Read the article

  • "invalid label" Firebug error with jQuery getJSON

    - by jerome
    Hi all, I'm making a jQuery getJSON request to another domain, so am making sure that my GET URI ends with "callback=?" (i.e. using JSONP). The NET panel shows that I am receiving the data as expected, but for some reason the Console logs the following error: "invalid label". The JSON validates with JSONLint so I doubt that there is anything truly wrong with the structure of the data. Any ideas why I might be receiving this error?

    Read the article

  • How to use Maven2 with Apache Sling?

    - by Jerome Baum
    Google doesn't help, neither does a stackoverflow.com search, and browsing through Apache Sling documentation doesn't show any solution so here goes: How can I best use Maven2 with Apache Sling? Basically as far as I see the entire application code will need to be placed in the JCR repository, but I need it versioned. There is some documentation about OSGi bundles that could contain resources, but isn't it kind of overkill to create a bundle with a bunch of Java code to talk to Sling when all I want to do is load some files to corresponding URLs? What I was hoping for is something like jetty:run that will automatically deploy a WAR into a new Jetty instance. Ideally the goal for Sling would run Sling and then load the specified content -- is there some Maven2 plugin for this right now? Or is the bundle-based solution the "canonical" way of doing this?

    Read the article

  • Variable scoping and the jQuery.getJSON() method

    - by jerome
    The jQuery.getJSON() method seems to ignore the normal rules of scoping within JavaScript. Given code such as this... someObject = { someMethod: function(){ var foo; $.getJSON('http://www.somewhere.com/some_resource', function(data){ foo = data.bar; }); alert(foo); // undefined } } someObject.someMethod(); Is there a best practice for accessing the value of the variable outside of the getJSON scope?

    Read the article

  • Removing a fields from a dynamic ModelForm

    - by Jérôme Pigeot
    In a ModelForm, i have to test user permissions to let them filling the right fields : It is defined like this: class TitleForm(ModelForm): def __init__(self, user, *args, **kwargs): super(TitleForm,self).__init__(*args, **kwargs) choices = [] # company if user.has_perm("myapp.perm_company"): self.fields['company'] = forms.ModelChoiceField(widget=forms.HiddenInput(), queryset=Company.objects.all(), required=False) choices.append('Company') # association if user.has_perm("myapp.perm_association") self.fields['association'] = forms.ModelChoiceField(widget=forms.HiddenInput(), queryset=Association.objects.all(), required=False) choices.append('Association') # choices self.fields['type_resource'] = forms.ChoiceField(choices = choices) class Meta: Model = Title This ModelForm does the work : i hide each field on the template and make them appearing thanks to javascript... The problem is this ModelForm is that each field defined in the model will be displayed on the template. I would like to remove them from the form if they are not needed: exemple : if the user has no right on the model Company, it won't be used it in the rendered form in the template. The problem of that is you have to put the list of fields in the Meta class of the form with fields or exclude attribute, but i don't know how to manage them dynamically. Any Idea?? Thanks by advance for any answer.

    Read the article

  • Using a regex to determine domain using JavaScript

    - by jerome
    Hi All, If, as here at work, we have test, staging and production environments, such as: http://test.my-happy-work.com http://staging.my-happy-work.com http://www.my-happy-work.com I am writing some javascript that will redirect the browser to a url such as: http://[environment].my-happy-work.com/my-happy-video I need to be able to determine the current environment that we are in. There is the possibility that I will currently be at a url such as: http://[environment].my-happy-work.com/my-happy-path/my-happy-resource I want to be able to grab the window.location but strip it of everything but: http://[environment].my-happy-work.com And then append to that string + "/" + "my-happy-video". I am not skilled with regex, but I suppose there would be a way to parse the window.location up to the ".com" Thoughts? Thanks!

    Read the article

  • YAQ: Yet Another Question

    - by Jerome WAGNER
    When you have to code something, you can either : start from scratch (Yet Another approach) fork another existing project participate in an existing project to add the features you miss What do you think are the keys aspects that make you choose option 1, 2 or 3 ?

    Read the article

  • Why delete-orphan needs "cascade all" to run in JPA/Hibernate ?

    - by Jerome C.
    Hello, I try to map a one-to-many relation with cascade "remove" (jpa) and "delete-orphan", because I don't want children to be saved or persist when the parent is saved or persist (security reasons due to client to server (GWT, Gilead)) But this configuration doesn't work. When I try with cascade "all", it runs. Why the delete-orphan option needs a cascade "all" to run ? here is the code (without id or other fields for simplicity, the class Thread defines a simple many-to-one property without cascade): when using the removeThread function in a transactional function, it does not run but if I edit cascade.Remove into cascade.All, it runs. @Entity public class Forum { private List<ForumThread> threads; /** * @return the topics */ @OneToMany(mappedBy = "parent", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY) @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) public List<ForumThread> getThreads() { return threads; } /** * @param topics the topics to set */ public void setThreads(List<ForumThread> threads) { this.threads = threads; } public void addThread(ForumThread thread) { getThreads().add(thread); thread.setParent(this); } public void removeThread(ForumThread thread) { getThreads().remove(thread); } } thanks.

    Read the article

  • Display a ranking grid for game : optimization of left outer join and find a player

    - by Jerome C.
    Hello, I want to do a ranking grid. I have a table with different values indexed by a key: Table SimpleValue : key varchar, value int, playerId int I have a player which have several SimpleValue. Table Player: id int, nickname varchar Now imagine these records: SimpleValue: Key value playerId for 1 1 int 2 1 agi 2 1 lvl 5 1 for 6 2 int 3 2 agi 1 2 lvl 4 2 Player: id nickname 1 Bob 2 John I want to display a rank of these players on various SimpleValue. Something like: nickname for lvl Bob 1 5 John 6 4 For the moment I generate an sql query based on which SimpleValue key you want to display and on which SimpleValue key you want to order players. eg: I want to display 'lvl' and 'for' of each player and order them on the 'lvl' The generated query is: SELECT p.nickname as nickname, v1.value as lvl, v2.value as for FROM Player p LEFT OUTER JOIN SimpleValue v1 ON p.id=v1.playerId and v1.key = 'lvl' LEFT OUTER JOIN SimpleValue v2 ON p.id=v2.playerId and v2.key = 'for' ORDER BY v1.value This query runs perfectly. BUT if I want to display 10 different values, it generates 10 'left outer join'. Is there a way to simplify this query ? I've got a second question: Is there a way to display a portion of this ranking. Imagine I've 1000 players and I want to display TOP 10, I use the LIMIT keyword. Now I want to display the rank of the player Bob which is 326/1000 and I want to display 5 rank player above and below (so from 321 to 331 position). How can I achieve it ? thanks.

    Read the article

  • Parse lines of integers in C

    - by Jérôme
    This is a classical problem, but I can not find a simple solution. I have an input file like: 1 3 9 13 23 25 34 36 38 40 52 54 59 2 3 9 14 23 26 34 36 39 40 52 55 59 63 67 76 85 86 90 93 99 108 114 2 4 9 15 23 27 34 36 63 67 76 85 86 90 93 99 108 115 1 25 34 36 38 41 52 54 59 63 67 76 85 86 90 93 98 107 113 2 3 9 16 24 28 2 3 10 14 23 26 34 36 39 41 52 55 59 63 67 76 Lines of different number of integers separated by a space. I would like to parse them in an array, and separate each line with a marker, let say -1. The difficulty is that I must handle integers and line returns. Here my existing code, it loops upon the scanf loop (because scanf can not begin at a given position). #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { if (argc != 4) { fprintf(stderr, "Usage: %s <data file> <nb transactions> <nb items>\n", argv[0]); return 1; } FILE * file; file = fopen (argv[1],"r"); if (file==NULL) { fprintf(stderr, "Error: can not open %s\n", argv[1]); fclose(file); return 1; } int nb_trans = atoi(argv[2]); int nb_items = atoi(argv[3]); int *bdd = malloc(sizeof(int) * (nb_trans + nb_items)); char line[1024]; int i = 0; while ( fgets(line, 1024, file) ) { int item; while ( sscanf (line, "%d ", &item )){ printf("%s %d %d\n", line, i, item); bdd[i++] = item; } bdd[i++] = -1; } for ( i = 0; i < nb_trans + nb_items; i++ ) { printf("%d ", bdd[i]); } printf("\n"); }

    Read the article

  • Wordpress : display all articles of a month on one page

    - by Jérôme
    I would like to change the default behavior of Wordpress regarding the number of articles displayed on a same page to be the following : when displaying the home page, the 10 most recent articles should be displayed, 10 being the setting which can be changed through the admin panel (posts_per_page) when displaying the articles of a specific month (given through the URL like this : ?m=200906&order=ASC, I'd like to display on the same page all articles of this month (in other words, I don't want to have to browse through articles using previous entries or next entries. EDIT : I forgot something else I'd like to change : On the page where all articles of the specified month are displayed, I would like to display the comments for each article. Is this possible to do ? How ?

    Read the article

  • How do i add a new object with suds?

    - by Jerome
    I'm trying to use suds but have so far been unsuccessful at figuring this out. Hopefully it's something simple that i'm missing. Any help would be highly appreciated. This is supposed to be the raw soap message that i need to achieve: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.service.apimember.soapservice.com/"> <soapenv:Header/> <soapenv:Body> <api:insertOrUpdateMemberByObj> <token>t67GFCygjhkjyUy8y9hkjhlkjhuii</token> <member> <dynContent> <entry> <key>FIRSTNAME</key> <value>hhhhbbbbb</value> </entry> </dynContent> <email>[email protected]</email> </member> </api:insertOrUpdateMemberByObj> </soapenv:Body> </soapenv:Envelope> So i use suds to create the member object: member = client.factory.create('member') produces: (apiMember){ attributes = (attributes){ entry[] = <empty> } } How exactly do i append an 'entry'? I try this: member.attributes.entry.append({'key':'FIRSTNAME','value':'test'}) and that produces this: (apiMember){ attributes = (attributes){ entry[] = { value = "test" key = "FIRSTNAME" }, } } However, what i actually need is: (apiMember){ attributes = (attributes){ entry[] = (entry) { value = "test" key = "FIRSTNAME" }, } } How do i achieve this?

    Read the article

  • google chrome extension update text after response callback

    - by Jerome
    I am writing a Google Chrome extension. I have reached the stage where I can pass messages back and forth readily but I am running into trouble with using the response callback. My background page opens a message page and then the message page requests more information from background. When the message page receives the response I want to replace some of the standard text on the message page with custom text based on the response. Here is the code: chrome.extension.sendRequest({cmd: "sendKeyWords"}, function(response) { keyWordList=response.keyWordsFound; var keyWords=""; for (var i = 0; i FIRST QUESTION: This all seems to work fine but the text on the page doesn't change. I am almost certainly because the callback completes after the page is finished loading and the rest of the code finishes before the callback completes, too. How do I update the page with the new text? Can I listen for the callback to complete or something like that? SECOND QUESTION: The procedure I am pursuing first opens the message page and then the message page requests the keyword list from background. Since I always want the keyword list, it makes more sense to just send it when I create the tab. Can I do that? Here is the code from background that opens the message page: //when request from detail page to open message page chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { if(request.cmd == "openMessage") { console.log("Received Request to Open Message, Profile Score: "+request.keyWordsFound.length); keyWordList=request.keyWordsFound; chrome.tabs.create({url: request.url}, function(tab){ msgTabId=tab.id; //needed to determine if message tab has later been closed chrome.tabs.executeScript(tab.id, {file: "message.js"}); }); console.log("Opening Message"); } });

    Read the article

  • Planning a competition

    - by Jérôme
    I need to produce the schedule of a sport-event. There are 30 teams. Each team has to play 8 matches. This means that it is not possible for each team to compete again all other teams, but I need to avoid that two team compete more than once against each other. My idea was to generate all possible matches (for 30 teams: (30*29)/2 = 435 matches) and select from this list 120 matches (8 match for each team: 8 * 30 / 2 = 120 matches). This is where I'm having a hard time: how can I select these 120 matches? I tried some simple solutions (take first match of the list, then the last, and so on) but they don't seem to work with 30 teams. I also tried to generate all possible match combination and find which one is working but with 30 team, this is too much calculation time. Is there an existing algorithm that I could implement?

    Read the article

  • Recommendations for jQuery tooltips

    - by jerome
    I am looking for tooltip plugins for jQuery that would allow for the following type of behavior. <a href="somewhere.html"> <span> <img src="someimage.jpg" style="display: none;" /> Here is the tooltip content. </span> Here is the link to somewhere. </a> The behavior that I am hoping for is to hover over "Here is the link to somewhere" and have a tooltip pop up showing the content of the span containing "someimage.jpg" and "Here is the tooltip content". I would prefer that the tooltip track along with the mouse's movement over the link and that the tooltip's appearace (background color, opacity, border color, etc.) be configurable. The two most popular tooltips that I have found, "clueTip" and Jörn Zaefferer's "Tooltip" do not seem to fit the bill, unless I am missing something. Ultimately, the links and images will be dynamically generated.

    Read the article

  • Decimal problem in Java

    - by Jerome
    I am experimenting with writing a java class for financial engineering (hobby of mine). The algorithm that I desire to implement is: 100 / 0.05 = 2000 Instead I get: 100 / 0.05 = 2000.9999999999998 I understand the problem to be one with converting from binary numbers to decimals (float -- int). I have looked at the BigDecimal class on the web but have not quite found what I am looking for. Attached is the program and a class that I wrote: // DCF class public class DCF { double rate; double principle; int period; public DCF(double $rate, double $principle, int $period) { rate = $rate; principle = $principle; period = $period; } // returns the console value public double consol() { return principle/rate; } // to string Method public String toString() { return "(" + rate + "," + principle + "," + period + ")"; } } Now the actual program: // consol program public class DCFmain { public static void main(String[] args) { // create new DCF DCF abacus = new DCF(0.05, 100.05, 5); System.out.println(abacus); System.out.println("Console value= " + abacus.consol() ); } } Output: (0.05,100.05,5) Console value= 2000.9999999999998 Thanks!

    Read the article

  • multiple definition in header file

    - by Jérôme
    Here is a small code-example from which I'd like to ask a question : complex.h : #ifndef COMPLEX_H #define COMPLEX_H #include <iostream> class Complex { public: Complex(float Real, float Imaginary); float real() const { return m_Real; }; private: friend std::ostream& operator<<(std::ostream& o, const Complex& Cplx); float m_Real; float m_Imaginary; }; std::ostream& operator<<(std::ostream& o, const Complex& Cplx) { return o << Cplx.m_Real << " i" << Cplx.m_Imaginary; } #endif // COMPLEX_H complex.cpp : #include "complex.h" Complex::Complex(float Real, float Imaginary) { m_Real = Real; m_Imaginary = Imaginary; } main.cpp : #include "complex.h" #include <iostream> int main() { Complex Foo(3.4, 4.5); std::cout << Foo << "\n"; return 0; } When compiling this code, I get the following error : multiple definition of operator<<(std::ostream&, Complex const&) I've found that making this fonction inline solves the problem, but I don't understand why. Why does the compiler complain about multiple definition ? My header file is guarded (with #define COMPLEX_H). And, if complaining about the operator<< fonction, why not complain about the public real() fonction, which is defined in the header as well ? And is there another solution as using the inline keyword ?

    Read the article

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