Search Results

Search found 6477 results on 260 pages for 'special effects'.

Page 21/260 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Get special numbers from a random number generator

    - by Wikeno
    I have a random number generator: int32_t ksp_random_table[GENERATOR_DEG] = { -1726662223, 379960547, 1735697613, 1040273694, 1313901226, 1627687941, -179304937, -2073333483, 1780058412, -1989503057, -615974602, 344556628, 939512070, -1249116260, 1507946756, -812545463, 154635395, 1388815473, -1926676823, 525320961, -1009028674, 968117788, -123449607, 1284210865, 435012392, -2017506339, -911064859, -370259173, 1132637927, 1398500161, -205601318, }; int front_pointer=3, rear_pointer=0; int32_t ksp_rand() { int32_t result; ksp_random_table[ front_pointer ] += ksp_random_table[ rear_pointer ]; result = ( ksp_random_table[ front_pointer ] >> 1 ) & 0x7fffffff; front_pointer++, rear_pointer++; if (front_pointer >= GENERATOR_DEG) front_pointer = 0; if (rear_pointer >= GENERATOR_DEG) rear_pointer = 0; return result; } void ksp_srand(unsigned int seed) { int32_t i, dst=0, kc=GENERATOR_DEG, word, hi, lo; word = ksp_random_table[0] = (seed==0) ? 1 : seed; for (i = 1; i < kc; ++i) { hi = word / 127773, lo = word % 127773; word = 16807 * lo - 2836 * hi; if (word < 0) word += 2147483647; ksp_random_table[++dst] = word; } front_pointer=3, rear_pointer=0; kc *= 10; while (--kc >= 0) ksp_rand(); } I'd like know what type of pseudo random number generation algorithm this is. My guess is a multiple linear congruential generator. And is there a way of seeding this algorithm so that after 987721(1043*947) numbers it would return 15 either even-only, odd-only or alternating odd and even numbers? It is a part of an assignment for a long term competition and i've got no idea how to solve it. I don't want the final solution, I'd like to learn how to do it myself.

    Read the article

  • WCF 3.5 - Remove SVC Extension - Special Case

    - by Brandon
    I have several RESTful endpoints like such: System.Security.Role.svc System.Security.User.svc etc. This is meant to be a namespace so our RESTful URL's would look like: /rest/{class namespace}/{actions} I have tried a few examples to get the SVC extension removed when my endpoint has multiple periods in it, however, nothing seems to work. I have tested with the WCF REST Contrib package (http://wcfrestcontrib.codeplex.com/), this example (http://www.west-wind.com/weblog/posts/570695.aspx), and another StackOverflow post (http://stackoverflow.com/questions/355165/how-to-remove-thie-svc-extension-in-restful-wcf-service). This works great when my endpoint is something like this: Echo.svc It will properly remove the SVC extension. Any ideas on how to handle endpoints with multiple periods in the endpoint name? EDIT: After some further testing, I found out that it is failing because whenever you do: string path = HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath; If the endpoint contains multiple periods, it strips off everything after the endpoint causing all of the standard IHttpModule's to fail. Example: If I call http://localhost/services/Echo/test, my relative app file path has a returned value of: ~/echo/test However, if I make a call as http://localhost/services/System.Security.User/test, then my relative app file path has a returned value of: ~/system.security.user I am missing the '/test' on the end in that situation.

    Read the article

  • Special case when calling InvokeScript with the winforms WebBrowser control does not work

    - by wang-min
    I am trying to use InvokeScript method on the WebBrowser control to execute a script on the web page that has been loaded into my WebBrowser control. If I am calling just a simple javascript function, this works properly. However, the javascript function that I am trying to call is nested within a variable like this: var holder = { DoA: function() { .... }, DoB: function() { ..... } } Calling holder.DoA works fine when called from within the javascript, but the function is not called successfully when I try to call it from within my C# code like this: object obj1 = m_webBrowser.Document.InvokeScript("holder.DoA"); Any ideas?

    Read the article

  • Problem with apostrophes and other special characters when using aspell in windows

    - by Loftx
    Hi there, We seem to be having a problem with the spell checker on our content management system where it marks the ve part of We’ve as a misspelling. The spellchecker uses aspell which is called from a script on the server which executes the cmd.exe and uses it to pipe a file into aspell (it's a long winded way I know, but our server side programming langauge (ColdFusion) doesn't support writing to stdin for executables). Aspell is called by executing: c:\windows\system32\cmd.exe /c type d:\path_to_file\file.txt | "C:\Program Files\Aspell\bin\aspell" --lang=en -a Where file.txt contains the text to be spelled e.g. ^Oh have We’ve (the carat is added to prevent piping problems I believe). Aspell then output: @(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3) * * * & ve 62 12: vie, voe, V, v, veg, vet, Be, Ce, be, Ev, E, e, vex, VA, VI, Va, Vi, vi, we, VD, VF, VG, VJ, VP, VT, Vt, vb, vs, DE, De, Fe, GE, Ge, He, IE, Le, ME, Me, NE, Ne, OE, PE, Re, SE, Se, Te, Xe, he, me, re, ye, Ave, Eve, Ive, ave, eve, VAR, var, veer, vier, view, vow However, we have a dev site, with the same version of Aspell, and when the same file is used it outputs with no misspellings. Both servers are running Aspell 0.50.3 on Windows server 2003, but there could be other differences in configuration: @(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3) I'm wondering if the problem is to do with the piping part of the process or something different in the Aspell configuration. Does anyone have any ideas? Cheers, Tom

    Read the article

  • Regex to Strip Special Characters

    - by Neil
    I am trying to use regex.replace to strip out unwanted characters, but I need to account for spaces: string asdf = "doésn't work?"; string regie = @"([{}\(\)\^$&._%#!@=<>:;,~`'\’ \*\?\/\+\|\[\\\\]|\]|\-)"; Response.Write(Regex.Replace(asdf,regie,"").Replace(" ","-")); returns doésntwork instead of doésnt-work Ideas? Thanks!

    Read the article

  • Nokogiri and Special Characters

    - by Moe
    I'm using Nokogiri to grab the contents of the title tag on a webpage, but am having trouble with accented characters. What's the best way to deal with these? Here's what I'm doing: require 'open-uri' require 'nokogiri' doc = Nokogiri::HTML(open(link)) title = doc.at_css("title") At this point, the title looks like this: Rag\303\271 Instead of: Ragù How can I have nokogiri return the proper character (e.g. ù in this case)?

    Read the article

  • JSP/Servlet CRUD form with special input field based on join table relationship

    - by user1701467
    There's database with a bunch of tables that are joined with join tables. E.g. Members and Division are joined with MembersDivisions table. JSP/Servlet login functionality has been developed, but now the CRUD functionality needs to be implemented and I was unable to find any tutorials about it, especially involving the join table(when creating new division you can add members to it, or add more to the existing one). Maybe someone could, theoretically, explain how to do the Division part of the CRUD web form?

    Read the article

  • Some special characters defined in "ISO-8859-1" can't be shown when encoding with "UTF-8"

    - by Mike.Huang
    I need to get a string from URL request of brower, and then create a text image by requested text. I know the default encoding of the Java net transmission is "ISO-8859-1", it can works normally with all characters what defined in "ISO-8859-1". But when I request a multi-byte Unicode character (e.g. chinese or something like ¤?), then I need to decode it by "UTF-8" from "ISO-8859-1". My codes like: String reslut = new String(requestString.getBytes("ISO-8859-1"), "UTF-8"); Everything is fine, but I found some characters in ISO-8859-1 are not been shown now, which characters are 0x80 - 0xFF(defined in" ISO-8859-1"), i.e. the characters after 0x80 (in "ISO-8859-1") not been shown when converted to "UTF-8" from "ISO-8859-1". Any other method can solve this query?

    Read the article

  • convert special characters but not tags

    - by Tom
    I've got some text which needs converting to use HTML entities, but it also contains tags. Here's a sample: <p>Ofcom issued the warning to Global-owned GWR in Bristol – which is required to operate as a "contemporary and chart music and information station" – for operating outside the music </p> The (" and -) need to be converted but the paragraph tags must remain HTML. Using something like htmlentities converts everything, how can I convert everything but the tags?

    Read the article

  • xml with special character, encoding utf-8

    - by Sergio Morieca
    I have a few simple questions, because I got confused reading all difference responses. 1) If I have an xml with prolog: and I'm going to unmarshall it with Java (for example: JaXB). I suppose, that I can't put CROSS OF LORRAINE (http://www.fileformat.info/info/unicode/char/2628/index.htm) inside, but I can put "\u2628", correct? 2) I've also heard that UTF-8 doesn't contain it, but anything in Unicode can be saved with encoding UTF-8 (or UTF-16), and here is an example from this page: UTF-8 (hex) 0xE2 0x98 0xA8 (e298a8) Is my reasoning correct? Can I use this form and put it in the xml with utf-8 encoding?

    Read the article

  • Implementing a "special" Access database to Expression Web

    - by Newbie
    I have just got an answer to my question about combining the result of a SQL. This was done with "ConcatRelated". Now I want to implement this in Expression Web 3. The SQL's I used in Access: SELECT land.id, land.official_name, vaksiner.vaksiner FROM land INNER JOIN (vaksiner INNER JOIN land_sykdom ON vaksiner.id = land_sykdom.sykdom) ON land.kort = land_sykdom.land ORDER BY land.official_name; and SELECT DISTINCT id, official_name, ConcatRelated("vaksiner","qryVaksinerRaw","id = " & [id]) AS vaksiner FROM qryVaksinerRaw; The last is saved as vaksine_query This is the SQL that I want to add to Expression Web: SELECT vaksine_query.id, vaksine_query.official_name, vaksine_query.vaksiner FROM vaksine_query WHERE vaksine_query.id="?"; Expression Web gives me the error message "Undefined function 'ContactRelated' in expression.

    Read the article

  • Special kind of queue

    - by devoured elysium
    I am looking for something like a Queue that would allow me to put elements at the end of the queue and pop them out in the beggining, like a regular Queue does. The difference would be that I also need to compact the Queue from time to time. This is, let's assume I have the following items on my Queue (each character, including the dot, is an item in the Queue): e d . c . b . a (this Queue has 8 items) Then, I'd need for example to remove the last dot, so to get: e d . c . b a Is there anything like that in the Java Collection classes? I need to use this for a program I am doing where I can't use anything but Java's classes. I am not allowed to design one for myself. Currently I'm just using a LinkedList, but I thought maybe this would be more like a Queue than a LinkedList. Thanks

    Read the article

  • Java special characters

    - by Binaryrespawn
    Hi all, this must be quite simple but I am having great difficulty. You see I am trying to find a string within another string as follows. e = input.indexOf("-->"); s = input.indexOf("<!--"); input = input.replace(input.substring(s, e + 3), " "); The integers e and s are returning -1 in that it was not found and this is causing the replace method to fail. The test string I am using is "Chartered Certified<!--lol--> Accountants (ACCA)". I tried to creat a new string object and pass in the string as an argument as follows e=input.indexOf(new String("<!--")); This yielded the same result. Any ideas ?

    Read the article

  • Extracting one word based on special character using Regular Expression in C#

    - by Jankhana
    I am not very good at regular expression but want to do some thing like this : string="c test123 d split" I want to split the word based on "c" and "d". this can be any word which i already have. The string will be given by the user. i want "test123" and "split" as my output. and there can be any number of words i.e "c test123 d split e new" etc. c d e i have already with me. I want just the next word after that word i.e after c i have test123 and after d i have split and after e i have new so i need test123 and split and new. how can I do this??? And one more thing I will pass just c first than d and than e. not together all of them. I tried string strSearchWord="c "; Regex testRegex1 = new Regex(strSearchWord); List lstValues = testRegex1.Split("c test123 d split").ToList(); But it's working only for last character i.e for d it's giving the last word but for c it includes test123 d split. How shall I do this???

    Read the article

  • special character coming when i am using & and p

    - by radick
    hi all I dont know what exactly i have to type in title for this ,i tried my best anyway coming to topic I am making one acc checker for that purpose ,i am sending user and pass from my bsskinedit1 and bsskinedit2 here is my code s:='http:\\site.com..premlogin='+bsskinedit.text+'&password='+bsskinedit2.text but it giving some error ,then i used showmessage whats wrong with it then i came with strange result see below http://i39.tinypic.com/2415d77.jpg observer after 4 & and p combining together and appearing as a some new symbol :( can any one tell me why its coming like this ?

    Read the article

  • Finding backedges in a graph, with special conditions.

    - by Morteza M.
    There is a vertex v, such that from the subtree rooted at v, there are at least two backedges to proper ancestors of v. The problem is finding whether such backedges exist or not ( finding v is not important at all). I run DFS algorithm, I can find backedges and save them in an array. I know which backedges in this array belong to a common tree. but I have problem on matching this condition in O(E) time. can anyone help me with that?

    Read the article

  • Create a SOCKS Proxy that does nothing special

    - by rwired
    I am trying to create a SOCKS proxy in C++ that runs as a background process on localhost. If the user's browser is configured to use the proxy, I want all HTTP requests to be passed along through the normal TCP/IP stack. i.e. The browser will behave exactly as it normally would. Eventually I will add another layer which will check to see if the requested resource matches certain criteria, and if so will handle the request differently. But for now I'm just trying to solve the basic problem... how to create a SOCKS proxy that doesn't change anything?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >