Search Results

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

Page 70/316 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • How to overcome an apparent REST vs. DRY dilemma in rails?

    - by Chris
    A rails app I'm working on features examples of quadratic equations. Obviously, these are all of a common structure: ax^2 + bx + c = 0. I don't want to store every single example of these. I'd rather generate them from a template. Storing hundreds of possible versions of this structure seems highly wasteful and un-DRY. On the other hand, if I generate them, I can't access them again reliably as I could if they were simply multiple database objects. I'm sure there must be a way to overcome this, but I'm still learning rails and I'm obviously not grasping something here. Thanks.

    Read the article

  • SQL Compact import DB from SQL Server Express with Server Management Studio

    - by Sasha
    Hi! I try to import sql script, generated with Server Management Studio, into SQL Compact 3.5 and get a lot of error. What I am doing wrong? I generate script with "Task/Generate Script" context menu. Part of my script: CREATE TABLE [LogMagazines]( [IdUser] [int] NOT NULL, [Text] [nvarchar](500) NULL, [TypeLog] [int] NOT NULL, [DateAndTime] [datetime] NOT NULL, [DetailMessage] [nvarchar](max) NULL, [Id] [int] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_LogMagazines] PRIMARY KEY ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] Knowledge Base: http://stackoverflow.com/questions/1525063/how-to-import-data-in-sql-compact-edition http://stackoverflow.com/questions/1515969/exporting-data-in-sql-server-as-insert-into/1515975

    Read the article

  • C++ - dynamic pointer of array

    - by Eagle
    Hi to all, first i would like to say i am Newbie in C++. As part of my master thesis i am writing a program in C++ which also get as parameters the variables m and d (both integers). Were d is the power of 2 (this means 2^d elements). Parameter m define the number of possible interactions between one element and the total group (2^d elements). The number of possible interactions is computed as following: \kappa = \sum_{i=0}^m\binom{d}{i} (at present i generate vector of vectors for 2^d x \kappa, but my Prof. would like me to create different statistics to different m's. My first though was to to generate a dynamic array of m arrays of different sizes... Then i though of defining a 3-dim array with the biggest needed 2d array, but also program speed is important (e.g d = 20). i would like to ask for your advice how to define such kind of dynamic array that will also be fast. Regards

    Read the article

  • Build a JavaScript wrapper for a rails-generated XML API?

    - by Thor Thurn
    I am working with a large website written in Ruby on Rails. Thanks to the support for REST in Rails 2, the site's business logic is all accessible via a consistent XML API. Now I want to be able to easily write one or more JavaScript frontends to the site that interact with the generated Rails XML API. Ideally, an automated wrapper for the API could be created in JavaScript, since this would minimize the effort required in writing XML processing code for the more than 500 API functions. How, then, can I automatically generate a wrapper around a given XML API in JavaScript so that it's more pleasant to work with? I've worked with solutions of this nature for Java that generate classes and methods to wrap an API, so my current thinking is that I want something of that nature for JavaScript. I'd be open to an alternative take on the problem, though.

    Read the article

  • In Drupal, how to change the values passed to Pathauto?

    - by Vinicius Pinto
    I have Pathauto configured to generate an alias based on the title of a node, for a specific content type. The problem is that I want to make small changes in this title before Pathauto uses it to generate the alias. The first comment in this post suggests the use of hook_token_values, but I couldn't really understand how to use it, even after reading the docs. In my tests, when I implement this hook, the alias generated is always "array", which means I'm missing something. Any help? Thanks.

    Read the article

  • Vectorizing sums of different diagonals in a matrix

    - by reve_etrange
    I want to vectorize the following MATLAB code. I think it must be simple but I'm finding it confusing nevertheless. r = some constant less than m or n [m,n] = size(C); S = zeros(m-r,n-r); for i=1:m-r for j=1:n-r S(i,j) = sum(diag(C(i:i+r-1,j:j+r-1))); end end The code calculates a table of scores, S, for a dynamic programming algorithm, from another score table, C. The diagonal summing is to generate scores for individual pieces of the data used to generate C, for all possible pieces (of size r). Thanks in advance for any answers! Sorry if this one should be obvious...

    Read the article

  • Password reset by email without a database table

    - by jpatokal
    The normal flow for resetting a user's password by mail is this: Generate a random string and store it in a database table Email string to user User clicks on link containing string String is validated against database; if it matches, user's pw is reset However, maintaining a table and expiring old strings etc seems like a bit of an unnecessary hassle. Are there any obvious flaws in this alternative approach? Generate a MD5 hash of the user's existing password Email hash string to user User clicks on link containing string String is validated by hashing existing pw again; if it matches, user's pw is reset Note that the user's password is already stored in a hashed and salted form, and I'm just hashing it once more to get a unique but repeatable string. And yes, there is one obvious "flaw": the reset link thus generated will not expire until the user changes their password (clicks the link). I don't really see why this would be a problem though -- if the mailbox is compromised, the user is screwed anyway.

    Read the article

  • How can i tell jaxb / Maven to genereate multiple schema packages?

    - by M.R.
    Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>src/main/resources/dir1</schemaDirectory> <schemaIncludes> <include>schema1.xsd</include> </schemaIncludes> <generatePackage>schema1.package</generatePackage> </configuration> </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>src/main/resources/dir2</schemaDirectory> <schemaIncludes> <include>schema2.xsd</include> </schemaIncludes> <generatePackage>schema2.package</generatePackage> </configuration> </plugin> </plugins> What happened: Maven executes the the first plugin. Then deletes the target folder and creates the second package, which then is visible. I tried to set target/somedir1 for the first configuration and target/somedir2 for the second configuration. But the behavior does not not change? Any ideas? I do not want to generate the packages directly in the src/main/java folder, because these packages are genereated and should not be mixed with manual created classes.

    Read the article

  • I'm working on a website that sells different artwork, what's the best way to handle different image

    - by ThinkingInBits
    I'm working on a website that will allow users to upload and sell their artwork in different sizes. I was wondering what the best way would be to handle the different file sizes automatically. A few points I was curious on: How to define different size categories (small, medium, large) in such a way that I'll be able to dynamically re-size images with proportional dimensions. Should I store actual jpegs of the different sizes for download? Or would it be easier to generate these different sizes for download on the fly My thumbnails will be somewhat larger than your average thumbnails, should I store a second 'thumbnail image' with the sites watermark overlaying it? Or once again, generate this on the fly? All opinions, advice are greatly appreciated!

    Read the article

  • DocuSign Connect xsd [on hold]

    - by Brian
    I'm trying to parse xml inbound to our system from the DocuSign Connect service (which publishes status updates to a given web service). I typiclly use jaxb to process xml but as far as I know I need xsd's in order to generate the jaxb. I don't have (or can't find) xsd's from DocuSign in order to do this. I could use other java classes/libraries to parse the xml but without xsd's I'd have to guess at types, restrictions and formats. Is there a way to generate jaxb without having xsd's?

    Read the article

  • Creating Videos: Which Framerate is common in the US?

    - by Stebi
    I know that there are differences in different regions of the world regarding the framerate of videos. E.g. a DVD in Europe is in PAL with 720x756 and 25.0 fps. In the US its the NTSC standard with 720x480 and 29.97 fps. When I don't want to generate a DVD but a plain video file, e.g. WMV oder AVI what framerate is used in USA? I have a end user application where the user can generate videos, so what framerate does the US user expect it to have? Is there a difference in SD and HD video?

    Read the article

  • HOw I can verify my SQL / SQL Pl syntax

    - by rima
    Hi all Sorry my English is bad.I hope u can get what I want. I have lots of *.sql files that i want to write a program to compile them and if there is any issue(problem or mistake) report me. One of my friend write an IDE for java,as I remember he use javac to generate the codes error,in other hand maybe u see when u try to write code in a Visual stadio or Netbean the IDE generate errors for u.so now I want to know any one have any idea how I can do it for my sql files? In other mean I want to write a Editor for SQL files(PL/SQL) that compile my code and tell me what is my error. this problem raise up when I try to compile all of them in SQL PLUS,it's so boring. please help me...

    Read the article

  • Put logic behind generated LinqToSql fields

    - by boris callens
    In a database I use throughout several projects, there is a field that should actually be a boolean but is for reasons nobody can explain to me a field duplicated over two tables where one time it is a char ('Y'/'N') and one time an int (1/0). When I generate a datacontext with LinqToSql the fields off course gets these datatypes. It would be nice if I don't have to drag this stupid choice of datatype throughout the rest of my application. Is there a way to give the generated classes a little bit of logic that just return me return this.equals('Y'); and return this==1; Preferably without having to make an EXTRA field in my partial class. It would be a solution to give the generated field a totally different name that can only be accessed through the partial class and then generate the extra field with the original name with my custom logic in the partial class. I don't know how to alter the accesibility level in my generated class though.. Any suggestions?

    Read the article

  • Unit testing a SQL code generator

    - by Tom H.
    The team I'm on is currently writing code in TSQL to generate TSQL code that will be saved as scripts and later run. We're having a little difficulty in separating our unit tests between testing the code generator parts and testing the actual code that they generate. I've read through another similar question, but I was hoping to get some specific examples of what kind of unit test cases we might have. As an example, let's say that I have a bit of code that simply generates a DROP statement for a view, given the view schema and name. Do I just test that the generated code matches some expected outcome using string comparisons and then in a later integration or system test make sure that the drop actually drops the view if it exists, does nothing if the view doesn't exist, or raises an error if the view is one that we are marking as not allowing a drop? Thanks for any advice!

    Read the article

  • Compose synthetic English phrase that would contain 160 bits of recoverable information

    - by Alexander Gladysh
    I have 160 bits of random data. Just for fun, I want to generate pseudo-English phrase to "store" this information in. I want to be able to recover this information from the phrase. Note: This is not a security question, I don't care if someone else will be able to recover the information or even detect that it is there or not. Criteria for better phrases, from most important to the least: Short Unique Natural-looking The current approach, suggested here: Take three lists of 1024 nouns, verbs and adjectives each (picking most popular ones). Generate a phrase by the following pattern, reading 20 bits for each word: Noun verb adjective verb, Noun verb adjective verb, Noun verb adjective verb, Noun verb adjective verb. Now, this seems to be a good approach, but the phrase is a bit too long and a bit too dull. I have found a corpus of words here (Part of Speech Database). After some ad-hoc filtering, I calculated that this corpus contains, approximately 50690 usable adjectives 123585 nouns 15301 verbs This allows me to use up to 16 bits per adjective (actually 16.9, but I can't figure how to use fractional bits) 15 bits per noun 13 bits per verb For noun-verb-adjective-verb pattern this gives 57 bits per "sentence" in phrase. This means that, if I'll use all words I can get from this corpus, I can generate three sentences instead of four (160 / 57 ˜ 2.8). Noun verb adjective verb, Noun verb adjective verb, Noun verb adjective verb. Still a bit too long and dull. Any hints how can I improve it? What I see that I can try: Try to compress my data somehow before encoding. But since the data is completely random, only some phrases would be shorter (and, I guess, not by much). Improve phrase pattern, so it would look better. Use several patterns, using the first word in phrase to somehow indicate for future decoding which pattern was used. (For example, use the last letter or even the length of the word.) Pick pattern according to the first bytes of the data. ...I'm not that good with English to come up with better phrase patterns. Any suggestions? Use more linguistics in the pattern. Different tenses etc. ...I guess, I would need much better word corpus than I have now for that. Any hints where can I get a suitable one?

    Read the article

  • Fibonacci using SBN in OISC in Machine Language

    - by velociraptor
    Hello, I want to generate fibonacci series using SBN in an OISC architecture. My initial approach is to implement it in assembly language first and then convert it to machine language. The first steps involve storing 0 and 1 in 2 registers and then subtract 1 from 0 and repeatedly subtract 1 in the consequent steps. Everytime it will generate a negative number and since its negative, it branches off and fetches the absolute value finding instruction. Is my approach correct? My confusion in the meaning of OISC. Correct me if i'm wrong, if i perform a subtraction and then an absolute value finding, it means that that i'm using 2 instructions everytime. or is it that in the OISC processor both these instructions are done at the sametime which would mean that my approach is correct. Please help. thank you all

    Read the article

  • Custom event listener on Android app

    - by Bilthon
    Hi everybody, I need to set up a simple event listener to refresh a listview from once in a while. The problem is I don't know how could I generate an event. I know that for events like key or button pressing I just need to implement the handler. But in this specific case I actually need to generate the event, which will be fired everytime another running thread of my app wakes up and refreshes it's list of news from a rss feed. I've done everything, but got stucked in here. Can I get any suggestion or link with some more info on how to implement this? Thanks Nelson R. Perez

    Read the article

  • Data table with legends in JfreeChart/Java

    - by TiNS
    Hi All, I am using JFreeChart to generate images. I am trying to create barchart like below. I am able to create it successfully without data table. I tried to get more information from the jfreechar forums and found this post. According to the post , its not supported by JfreeChart. Is it still not supported by jfreechart API ? If yes, can I use any other charting (open source) tool to generate chart with data table ? Thanks

    Read the article

  • msbuild/clickonce publish files generated during the build

    - by Anonym
    As a part of my build process I generate some files that should be included when creating a clickonce deployment. Here is a blog post of someone telling you how to include items that's not part of the project. However, as someone mentions in the comments of that blogpost, it won't update the deploymentmanifest when you do it in the "BeforePublish" task and the files won't get downloaded - it works fine if you do it in the "BeforeBuild" task though. This gives me a chicken and egg problem as I have to perform the build first to generate the files I want included.. Does anyone have a solution for this ? (p.s. at the moment generating the clickonce deployment using mage.exe is not an option, it have to be done using the Publish target)

    Read the article

  • jQuery Sparklines: $.getJSON data can't be read

    - by Bob Jansen
    I'm trying to generate a pie graph with Sparklines but I'm running into some trouble. I can't seem to figure out what I'm doing wrong, but I feel it is a silly mistake. I'm using the following code to generate a sparkline chart in the div #traffic_bos_ss: //Display Visitor Screen Size Stats $.getJSON('models/ucp/traffic/traffic_display_bos.php', { type: 'ss', server: server, api: api, ip: ip, }, function(data) { var values = data.views; //alert(values); $('#traffic_bos_ss').sparkline(values, { type: "pie", height: "100%", tooltipFormat: 'data.screen - {{value}}', }); }); The JSON string fetched: {"screen":"1220x1080, 1620x1080, 1920x1080","views":"[2, 2, 61]"} For some reason Sparklines does not process the variable values. When I alert the variable it outputs "[2, 2, 61]". Now the jQuery code does work when I replace the snippet: var values = data.views; with var values = [2, 2, 61]; What am I doing wrong?

    Read the article

  • iOS Facebook Access Token To Get User Wall Feed (status)

    - by Felix
    [DISCLAIMER : None of the access token or ID below here are real] I've done research for three solid days and no result on how to get user wall feed(post). I have used https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials and get the access token which is something like this access_token=454345994651138|bAMGfuW-ueNXGCahley7ga125HN and then https://graph.facebook.com/100005939123542/feed?access_token=454345994651138|bAMGfuW-ueNXGCahley7ga125HN It gives me general information such as user's likes, name, id, current city... but NOT user's wall posts. I've learned that there are three types of access token, which is App Token, User Token, and Page Token. In order to get user/feed by using graphAPI, I need to request to get User Token, but there's NO information in the lousy Facebook Doc! (Which frustrated me the most!) In order to generate the user access token, we need to set some permission, generate the access token, and GET the user's wall feed, which is in JSON format. My question is : How do I get the User Access Token in order to get user wall post in iOS Xcode?

    Read the article

  • Maximizing the number of threads to fully utilize all available resources without hindering overall

    - by Matt
    Let's say I have to generate a bunch of result files, and I want to make it as fast as possible. Each result file is generated independently of any other result file; in fact, one could say that each result file is agnostic to every other result file. The resources used to generate each result file is also unique to each. How can I dynamically decide the optimal number of threads to run simultaneously in order to minimize the overall run time? Is my only option to write my own thread manager that watches performance counters and adjust accordingly or does there exists some solid classes that already accomplish this?

    Read the article

  • why javascript can not read the cookie in asp.net ?

    - by MemoryLeak
    I want to read the sessionid in cookie which is automatically generated by asp.net. such as ASP.NET_SessionId. but when i use javascript: document.cookie = "ASP.NET_SessionId=;" since i want to set the ASP.NET_SessionId to be empty. but after the javascript executed, i found instead of change the ASP.NET_SessionId to empty, system generate a new cookie with ASP.NET_SessionId equal to empty. why system not modify the cookie but generate a new one ? Thanks!

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >