Search Results

Search found 7897 results on 316 pages for 'generate'.

Page 217/316 | < Previous Page | 213 214 215 216 217 218 219 220 221 222 223 224  | Next Page >

  • Pseudorandom Number Generation with Specific Non-Uniform Distributions

    - by carnun
    Hello all, I'm writing a program that simulates various random walks (with differing distributions). At each timestep, I need randomly generated, two dimensional step distances and angles from the distribution of the random walk. I'm hoping someone can check my understanding of how to generate these random numbers. As I understand it I can use Inverse Transform Sampling as follows: If f(x) is the pdf of our random walk that has a non-uniform distribution, and y is a random number from a uniform distribution. Then if we let f(x) = y and solve to find x then we have a random number from the non-uniform distribution. Is this a feasible solution?

    Read the article

  • server side of adsense

    - by dole
    Hi there Google ask you to add a javascript code to your page and it will generate the links. The script has some id which are sent to the server, but I don't know how. <script type="text/javascript"><!-- google_ad_client = "ca-pub-1234567890123456"; /* snipet_name */ google_ad_slot = "123456789"; google_ad_width = 728; google_ad_height = 90; //--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> I'm curious to know how the client and slot ids are send to the server. Javascript is client side and I wish to know how those parameters are sent to the server in order to query a db and to return the links. A link, sample, explanation related to PHP will work great for me. TY

    Read the article

  • C++ code generation for repeted task

    - by sateesh
    Hi, I have something like below which will get repeated many times based on the function that get called for e.g acceptfunction() { inserter["quantity"] = sdd.getfloat(quantity); inserter["prodtype"] = sdd.getstring(prodtype); : : so on } Like accept above there are 20 more functions(reject,cancel etc) which will do the similar thing.But the parameteres they insert can differ based on function called. How can I automate this kind of code.So that I dont need to write new function from scratch.Basically what I need is if i provide parametres like ("quantity",prodtype) through some text file or xml, it should generate the required function with the input parametres. Is this task can be handled through C++ tempalte Meta programming or someother code generation tool will help me to do this?

    Read the article

  • Need generated UML diagrams for C++ plugin modules

    - by archer1742
    I need various UML diagrams (sequence/collaboration, class, package, and system component) from some C++ files. However, these files are plugins in a larger programming framework. I have tried generating UML from Rational Rose 7 (2002 version), but I am not very experienced and I am unsure if RR simply cannot produce the diagram, I am doing something wrong, or the diagrams are not rendering correctly because the source files are plugins instead of standalone programs. I have also tried Star Modeler with little success and there seem to be no tutorials on how to generate these models. Is there a simple, bulletproof way to get UML diagrams for C++ files?

    Read the article

  • C#: Basic Reflection Class

    - by Mike
    I'm trying to find a basic reflection abstract class that will generate basic information about a class. I have a template of how I would like it to work: class ThreeList<string,Type,T> { string Name {get; set;} Type Type {get; set;} T Value {get; set;} } abstract class Reflect<T> { List<ThreeList<string, Type, T> list; ReturnType MethodName() { foreach (System.Reflection.PropertyInfo prop in this.GetType().GetProperties()) { object value = prop.GetValue(this, new object[] { }); list.Add(prop.Name, prop.DeclaringType, value); } } } I'd like it to be infinitely deep, recursively calling Reflect. Something like this has to exist. I'm not really opposed to coding it myself, I just don't want to go through the hassle if its already been done.

    Read the article

  • Preventing objects from being linked if they are not needed?

    - by Massif
    I have an ARM project that I'm building with make. I'm creating the list of object files to link based on the names of all of the .c and .cpp files in my source directory. However, I would like to exclude objects from being linked if they are never used. Will the linker exclude these objects from the .elf file automatically even if I include them in the list of objects to link? If not, is there a way to generate a list of only the objects that need to be linked?

    Read the article

  • resource embedding in asp.net

    - by Mike
    I have a project which needs to generate PDF documents. I am using iTextSharp. I have a pdf which needs to be read and then appended to. To read the pdf document, I'm using PdfReader(), which accepts many forms, but I can't figure out how to reference a pdf in my webapplication to PdfReader. My host does not allow Binary Serialization (apparently that's bad), so I don't think I can load from an embedded resource. I've tried just using PdfReader("report.pdf"), but it keeps throwing an exception telling me that the file isn't found. I've tried putting the file in the bin directory, root directory, in the same directory as the class, but this still doesn't work. It works if I use a fully qualified path to the pdf document, but I can't use that when I upload it to my hosting provider. Does anyone have any suggestions on how I should do this? Thanks

    Read the article

  • Does XSD allow simpleContent and complexContent at the same time?

    - by Willi Schönborn
    I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like: <value><int>123</int></value> <value><boolean>1</boolean></value> But at the same time it requires: If no type is indicated, the type is string. Which means i could receive something like this: <value>test123</value> which is equivalent to <value><string>test123</string></value> Is there a way to define this in an xsd.

    Read the article

  • Problem with displaying my Image..

    - by Josh
    Here is my full problem so if anyone has any ideas or can offer some help, please let me know. I have a Website that will generate a Report and this Report takes some time to create. There is a MyReport.ASPX file that has a form1, Image1, and a ReportViewer control. There is also a MyReport.cs file that has C# code to generated a HTMLText string that the ReportViewer control will display. When I pull the Website up in the browser, the MyReport.cs file creates the Report before MyReport.ASPX ever gets called so my Image1 (which I need to display while the Report is being created) never gets displayed until AFTER the Report is created and displayed. What do you suggest I do here? If I did not supply enough information, please let me know what else you need to know and I will gladly post it. Thanks,

    Read the article

  • parsing command option with default values and range constrains in C

    - by agramfort
    Hi, I need to parse command line arguments in C. My arguments are basically int or float with default values and range constrains. I've started to implement something that look like this: option_float(float* out, int argc, char* argv, char* name, description, float default_val, int is_optional, float min_value, float max_value) which I call for example with: float* pct; option_float(pct, argc, argv, "pct", "My super percentage option", 50, 1, FALSE, 0, 100) however I don't want to reinvent the wheel ! My objective is to have error checking of range constrains, throw an error when the option is not optional and is not set. And generate the help message usually given by usage() function. The usage text would look like this: --pct My super percentage option (default : 50). Should be in [0, 100] I've started with getopt but it is too limited for what I want to do and I feel it still requires me to write too much code for a simple usecase like this. thanks

    Read the article

  • Makefile rule depending on change of number of files instead of change in content of files.

    - by goathens
    I'm using a makefile to automate some document generation. I have several documents in a directory, and one of my makefile rules will generate an index page of those files. The list of files itself is loaded on the fly using list := $(shell ls documents/*.txt) so I don't have to bother manually editing the makefile every time I add a document. Naturally, I want the index-generation rule to trigger when number/title of files in the documents directory changes, but I don't know how to set up the prerequisites to work in this way. I could use .PHONY or something similar to force the index-generation to run all the time, but I'd rather not waste the cycles. I tried piping ls to a file list.txt and using that as a prerequisite for my index-generation rule, but that would require either editing list.txt manually (trying to avoid it), or auto-generating it in the makefile (this changes the creation time, so I can't use list.txt in the prerequisite because it would trigger the rule every time).

    Read the article

  • How to introduce multi-column constraint with JPA annotations?

    - by plouh
    I am trying to introduce a multi-key constraint on a JPA-mapped entity: public class InventoryItem { @Id private Long id; @Version private Long version; @ManyToOne @JoinColumn("productId") private Product product; @Column(nullable=false); private long serial; } Basically (product, serial) pair should be unique, but I only found a way to say that serial should be unique. This obviously isn't a good idea since different products might have same serial numbers. Is there a way to generate this constraint via JPA or am I forced to manually create it to DB?

    Read the article

  • how should i echo the data

    - by Syom
    for example i want to generate html code, using some data from database. here is two ways of printing data <? echo '<li><img src="'.$row['image'].'" /></li>';?> or <? echo "<li><img src='$row[image]' /></li>";?> both of them are working. and if so, why people use the first method, if without spliting the row by . it works fine too.

    Read the article

  • SQL: joining multiples tables into one.

    - by Graveen
    I have 4 tables. r1, r2, r3 and r4. The table columns are the following: rId | rName I want to have, in fine, an unique table - let's call it R. Obviously, R will have the following structure: rTableName | rId | rName I'm looking for a solution, and the more natural for me is to: add a single column to all rX insert this column the table name i'm processing generate SQLs and concatenate them all Although I see exactly how to perform 1 and 3 with batching, editing, etc... (I have only to perform it once and for all), I don't see how to do the point 2: self-getting the tablename to insert into SQL. Have you an idea / or a different way to do that could solve my problem? Note: In fact, there are 250+ rX tables. That's why i can't do this manually. Note2: Precisely, this is with MySQL.

    Read the article

  • Aborted core dumped C++

    - by avd
    I have a large C++ function which uses OpenCV library and running on Windows with cygwin g++ compiler. At the end it gives Aborted(core dumped) but the function runs completely before that. I have also tried to put the print statement in the end of the function. That also gets printed. So I think there is no logical bug in code which will generate the fault. Please explain. I am also using assert statements.But the aborted error is not due to assert statement. It does not say that assertion failed. It comes at end only without any message. Also the file is a part of a large project so I cannot post the code also.

    Read the article

  • enumerate all combinations in c++

    - by BCS
    My question is similar to this combinations question but in my case I have N (N 4) small sets (1-2 items per set for now might go to 3 maybe 4) and want to generate each combination of one item from each set. The current solution looks somethinging along the lines of this for(T:: iterator a = setA.begin(); a != setA.end(); ++a) for(T:: iterator b = setB.begin(); b != setB.end(); ++b) for(T:: iterator c = setC.begin(); c != setC.end(); ++c) for(T:: iterator d = setD.begin(); d != setD.end(); ++d) for(T:: iterator e = setE.begin(); e != setE.end(); ++e) something(*a,*b,*c,*d,*e); Simple, effective, probably reasonably efficient, but ugly and not very extensible. Does anyone know of a better/cleaner way to do this?

    Read the article

  • Make a <div> square when there is a dynamically changing width based on percentage

    - by Nate
    I am working on a web app that will generate an NxN grid based on the user's selection of N. I want the total width of the grid to be relative (ie 100% of the available space) so that users can print on various paper sizes. I can easily calculate the width of the squares in the grid by % (ie: 100%/N), but I am having issues calculating the height. The height of a web page is always going to be infinite unless I artificially limit it which, like I said, I don't want to do. How can I make the squares in my grid be square versus rectangular when the height and width constraints of my grid are dynamic and not square? Thanks in advance!

    Read the article

  • Documenting an existing website (symfony)

    - by Mark Blades
    Hi, I need to document a web application which wasn't built by me. It was built in symfony. The documentation needed is code documentation, including list/description of classes, components etc and their interdependencies. At the moment the code isn’t commented much and the way it has been commented is inconsistent. I was thinking of using Doxygen to generate initial documentation and then take it from there. Any other suggestions? Thanks in advance. Mark.

    Read the article

  • An RMIPRoxyFactoryBean factory in Spring?

    - by Robert Munteanu
    I'm currently using a Spring RmiProxyFactoryBean to access remote services. Since requirements have changed, I need to specify at runtime a different host - there can be many of them - , but the remoteServiceInterface and the non-host components of the remoteServiceUrl remain the same. Conceptually speaking, I'd see a bean definition similar to: <bean class="org.springframework.remoting.rmi.RmiProxyFactoryBeanFactory"> <property name="serviceInterface" value="xxx"/> <property name="serviceUrl" value="rmi://#{HOST}:1099/ServiceUrl"/> </bean> which exposes a Object getServiceFor(String hostName); Is there such a service available with Spring? Alternatively, do you see another way of doing this? Please note that the host list will not be known at compile or startup time, so I can't generate it in the xml file.

    Read the article

  • get the list and input from one function and run them in different function

    - by rookie
    i have a programm that generate the list and then i ask them to tell me what they want to do from the menu and this is where my problem start i was able to get the input form the user to different function but when i try to use the if else condition it doesn't check, below are my code def menu(x,l): print (x) if x == 1: return make_table(l) if x == 2: y= input("enter a row (as a number) or a column (as an uppercase letter") if y in [ "1",'2','3']: print("Minmum is:",minimum(y,l)) if x== 3: print ('bye') def main(): bad_filename = True l =[] while bad_filename == True: try: filename = input("Enter the filename: ") fp = open(filename, "r") for f_line in fp: f_str=f_line.strip() f_str=f_str.split(',') for unit_str in f_str: unit=float(unit_str) l.append(unit) bad_filename = False except IOError: print("Error: The file was not found: ", filename) #print(l) condition=True while condition==True: print('1- open\n','2- maximum') x=input("Enter the choice") menu(x,l) main() from the bottom function i can get list and i can get the user input and i can get the data and move it in second function but it wont work after that.thank you

    Read the article

  • Velocity Templates - New Line.

    - by LdSe
    Hello all, I've been working with Apache's Velocity engine and a custom template. The thing is, that I haven't been able to generate a String with the corresponding line breaks. I tried almost everything that I found, such as using $esc.n and $esc.newline (I'm already using escape tools on my project) but it seems that the version I'm currently using doesn't support it (1.4), checked if putting '\n', '\\n' and even '\\\n' would work, but same thing. Does anyone have any solution to this? Thanks a lot in advance! Regards.

    Read the article

  • In which document do file specifications belong?

    - by Andrew
    In which document would a file specification belong? Perhaps this file is used as an input to a third-party system. Would it belong in its own document? Or would it be better to put it in the functional or design spec? Or somewhere else? When I say file specification, I mean a description of what format the file is (CSV, fixed width, etc), columns, data types, etc. Also, where should you document how the file is generated? i.e. business rules/algorithms which are used to generate the file.

    Read the article

  • How to ignore viewstate of a previous request for particular control?

    - by AaronLS
    I am dynamically generating controls, and sometimes I want to create a control and have it ignore the viewstate. For example, sometimes the user has clicked a button indicating they want a different form loaded, so the control tree I generate on postback is different from the original control tree. This is fine, except when I call Controls.Add then it tries to load the viewstate form the old controls into the new controls if the control tree structure is similar, and I want them to instead ignore that viewstate(and also ignore the postback values for input controls as well). Can I do something like set the IDs of the controls or something that would allow me to conditionally prevent them from getting the viewstate/postback data of the previous request?

    Read the article

  • Change master table PK and update related table FK (changing PK from Autoincrement to UUID on Mysql)

    - by eleonzx
    I have two related tables: Groups and Clients. Clients belongs to Groups so I have a foreign key "group_id" that references the group a client belongs to. I'm changing the Group id from an autoincrement to a UUID. So what I need is to generate a UUID for each Group and update the Clients table at once to reflect the changes and keep the records related. Is there a way to do this with multiple-table update on MySQL? Adding tables definitions for clarification. CREATE TABLE `groups` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ CREATE TABLE `clients` ( `id` char(36) NOT NULL, `name` varchar(255) NOT NULL, `group_id` char(36) DEFAULT NULL, `active` tinyint(1) DEFAULT '1' PRIMARY KEY (`id`), KEY `fkgp` (`group_id`), CONSTRAINT `fkgp` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$

    Read the article

  • Dynamic columns in C# rdlc report

    - by Mugume David
    Suppose I have a report that lists employees (as rows) with their respective taxes charged (in columns). It is possible for a new tax to come up. Since my rdlc report file is currently designed (from XML of-course) to statically generate the coulumns. A future shift in events will need me to alter the rdlc file and add in a new column. how can i do this dynamically. I intend to avoid opening the rdlc file and adding XML code.

    Read the article

< Previous Page | 213 214 215 216 217 218 219 220 221 222 223 224  | Next Page >