Search Results

Search found 3646 results on 146 pages for 'escape sequence'.

Page 10/146 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Computational complexity of Fibonacci Sequence

    - by Juliet
    I understand Big-O notation, but I don't know how to calculate it for many functions. In particular, I've been trying to figure out the computational complexity of the naive version of the Fibonacci sequence: int Fib(int n) { if (n <= 1) return 1; else return Fib(n - 1) + Fib(n - 2); } What is the computational complexity of the Fibonnaci sequence and how is it calculated?

    Read the article

  • Why is an oracle sequence named hibernate_sequence being created with JPA using Hibernate with the O

    - by JavaRocky
    All my entities use this type of @Id @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MYENTITY_SEQ") @SequenceGenerator(name = "MYENTITY_SEQ", sequenceName = "MYENTITY_SEQ") @Column(name = "MYENTITY", nullable = false) private Long id; Or @Id @Column(name = "MYENTITY") I find that an oracle sequence named hibernate_sequence is always created. Why is this so? And how can i avoid this? I am using JPA1 with Hibernate 3 and the Oracle 10g dialect.

    Read the article

  • generating sequence number

    - by stackoverflowuser
    Hi Based on following TableA Data -------- Dummy1 Dummy2 Dummy3 . . DummyN is there a way to generate sequence number while selecting rows from the table. something like select sequence() as ID,* from Data that will give ID Data --------- 1 Dummy1 2 Dummy2 3 Dummy3 .... N DummyN Thanks.

    Read the article

  • question bitonic sequence

    - by davit-datuashvili
    A sequence is bitonic if it monotonically increases and then monotonically de- creases, or if it can be circularly shifted to monotonically increase and then monotonically decrease. For example the sequences 1, 4, 6, 8, 3, -2 , 9, 2, -4, -10, -5 , and 1, 2, 3, 4 are bitonic, but 1, 3, 12, 4, 2, 10 is not bitonic. please help me to determine if given sequence is bitonic?

    Read the article

  • Using Oracle Sequence in SQL Loader?

    - by Sujee
    Hi, I am using SEQUENCE keyword in SQL Loader control file to generate primary keys. But for a special scenario I would like to use Oracle sequence in the control file. The Oracle documentation for SQL Loader doesn't mentioned anything about it. does SQL Loader support it?

    Read the article

  • Most Frequent 3 page sequence in a weblog

    - by Sundararajan S
    Given a web log which consists of fields 'User ' 'Page url'. We have to find out the most frequent 3-page sequence that users takes. There is a time stamp. and it is not guaranteed that the single user access will be logged sequentially it could be like user1 Page1 user2 Pagex user1 Page2 User10 Pagex user1 Page 3 her User1s page sequence is page1- page2- page 3

    Read the article

  • sequence generators are getting ignored

    - by luvfort
    I'm getting the following error while saving a object. However similar configuration is working for other model objects in my projects. Any help would be greatly appreciated. @Entity @Table(name = "ENROLLMENT_GROUP_MEMBERSHIPS", schema = "LEAD_ROUTING") public class EnrollmentGroupMembership implements Serializable, Comparable,Auditable { @javax.persistence.SequenceGenerator(name = "enrollmentGroupMemID", sequenceName = "S_ENROLLMENT_GROUP_MEMBERSHIPS") @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "enrollmentGroupMemID") @Column(name = "ID") private Long id; @ManyToOne() @JoinColumn(name = "TIER_WEIGHT_OID", referencedColumnName = "OID", updatable = false, insertable = false) private TierWeight tierWeight; public EnrollmentGroupMembership() { } } Code: @Entity @Table(name = "TIER_WEIGHT", schema = "LEAD_ROUTING") public class TierWeight implements Serializable, Auditable { @SequenceGenerator(name = "tierSequence",sequenceName = "S_TIER_WEIGHT") @Column(name = "OID") @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "tierSequence") private Long id; @OneToMany @JoinColumn(name = "TIER_WEIGHT_OID", referencedColumnName = "OID") private Set<EnrollmentGroupMembership> memberships; public TierWeight() { } } The logic layer's code is @Override public void createTier(String tierName, float weight) { TierWeight tier = new TierWeight(); tier.setWeight(weight); tier.setTier(tierName); tierWeightDAO.create(tier); } Similar Many-one configuration is working through out the project. I don't know why this one instance is failing. Any help would be greatly appreciated. The following is the error that I'm getting Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): edu.apollogrp.d2ec.model.TierWeight at org.hibernate.id.Assigned.generate(Assigned.java:3 3) at org.hibernate.event.def.AbstractSaveEventListener. saveWithGeneratedId(AbstractSaveEventListener.java :99) The log file is telling that the sequence generator tierSequence is not getting created. However other sequence generators are getting created. 2010-06-03 11:24:51,834 DEBUG [org.hibernate.cfg.AnnotationBinder:] Processing annotations of edu.apollogrp.d2ec.model.TierWeight.dateCreated 2010-06-03 11:24:51,834 DEBUG [org.hibernate.cfg.AnnotationBinder:] Processing annotations of edu.apollogrp.d2ec.model.TierWeight.dateCreated 2010-06-03 11:24:51,834 DEBUG [org.hibernate.cfg.Ejb3Column:] Binding column DATE_CREATED unique false ....................................... ....................................... 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.AnnotationBinder:] Processing annotations of edu.apollogrp.d2ec.model.CounselorAvailability.id 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.Ejb3Column:] Binding column OID unique false 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.Ejb3Column:] Binding column OID unique false 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.AnnotationBinder:] id is an id 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.AnnotationBinder:] id is an id 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.AnnotationBinder:] Add sequence generator with name: counselorAvailabilityID 2010-06-03 11:24:51,756 DEBUG [org.hibernate.cfg.AnnotationBinder:] Add sequence generator with name: counselorAvailabilityID While debugging, I see that the org.hibernate.impl.SessionFactoryImpl is returning the "Assigned" identifierGenerator. This is horrible. I've specified the identifierGenerator as "Auto". Please see the above code. As a sidenote, I was trying to debug and seeing how the objects are getting retrieved from the database. Looks like the enrollmentgroupmembership records have the tierweight value populated. However if I look at the tierweight object, it doesn't have the enrollmentgroupmembership records. I'm puzzled. I think these two problems must be related. Maddy.

    Read the article

  • How to cancel a touch sequence

    - by Alex
    I have an UIImage view that responds to touch events. I want to cancel the touch sequence if the touch goes outside of certain bounds. How can I do that? I know that I can inspect the coordinates of the touch object, what I don't know is how to cancel the sequence. I don't see any event in the API that allows for that.

    Read the article

  • doubt regarding sequence points

    - by tushar
    i recently came across a question about sequence points in c++ at this site what the code will output: int c=0; cout<<c++<<c; it was answered that the output is undefined and << is not a sequence point but still i want to know why does it that even if i compile it 25 times it still prints 01

    Read the article

  • Remove a single non-unique value from a sequence in F#

    - by mavnn
    I have a sequence of integers representing dice in F#. In the game in question, the player has a pool of dice and can choose to play one (governed by certain rules) and keep the rest. If, for example, a player rolls a 6, 6 and a 4 and decides to play one the sixes, is there a simple way to return a sequence with only one 6 removed? Seq.filter (fun x -> x != 6) dice removes all of the sixes, not just one.

    Read the article

  • ghc6 install trouble: hGetContents: invalid argument (invalid UTF-8 byte sequence)

    - by olimay
    Having trouble installing ghc6 on Ubuntu Maverick via apt. Here's what seems to be the relevant error that comes up when I try to (apt-get|aptitude) install ghc6: A package failed to install. Trying to recover: Setting up ghc6 (6.12.1-13ubuntu1) ... ghc-pkg: /home/opm/.ghc/i386-linux-6.12.1/package.conf.d/unix-compat-0.2-edefa7bced91ebe610d455bab466e200.conf: hGetContents: invalid argument (invalid UTF-8 byte sequence) (Here's the full output, if you're interested: http://paste.ubuntu.com/566475/ ) This still happens after apt-get clean and apt-get update. My searching around has not really helped me understand what's going on, except that it might be caused by a mismatch in locale. So, here's the output of locale too: LANG=en_US.utf8 LANGUAGE=en_US:en LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL= Any ideas? Additional background: this all seems very strange to me, because I used to have ghc6 installed correctly--I use XMonad as my main window manager most of the time. I tried to install haskell-platform (through apt), which failed and told me that there was something wrong with ghc6, and so I reinstalled ghc6 and began to get the above error message.

    Read the article

  • Undefined control sequence

    - by Jelle Fresen
    Hi, I am making my Master's Thesis with LaTeX, but I can't get the provided style to work. Specifically, I get the error 'Undefined control sequence' when using the function makeformaltitlepages, which is defined in mscthesis.sty. On the internet, the only answer I could find is the straightforward 'you probably made a typo', or 'you probably forgot to include the package', but I have reason to believe neither of those apply to me. I am quite sure that the function exists, for when I add a little verification, using the @ifundefined command, the logfile shows that the function actually does exist. And, as can be seen in the following piece of code, I also include the package: \usepackage{mscthesis} % setup information like author, company, title, etc. \begin{document} \formatmatter \thispagestyle{empty} \maketitle \makeatletter \@ifundefined{makeformaltitlepages}{\message{Function is not defined.}}{\message{Function is defined.}} \makeatother \makeformaltitlepages{\input{abstract}} % add chapters, sections, etc. and end the document Now, the output shows the line "Function is defined." just before the output of maketitle (which I think is rather strange on its own, but that might be a flushing issue), followed by the following infinitely repeated error (well, cut off after 100 times by LaTeX): Function is defined. // some gibberish about font info ! Undefined control sequence. \GenericError ... #4 \errhelp \@err@ ... l.112 \makeformaltitlepages{} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. While the error keeps repeating, the line that starts with '#4' cycles between the following four lines: #4 \errhelp \@err@ ... \let \@err@ ... \@empty \def \MessageBreak... \endgroup Ok, so, do any of you have a suggestion of how I might continue to hunt this bug? Or what blatantly obvious mistake did I make?

    Read the article

  • Accessing previous activity instances in a sequence activity

    - by Dan Revell
    This has a rather SharePoint spin to it but the problem is straight workflow. I've got a parallel replication activity which contains a sequence activity. The sequence activity contains a CreateTask activity, a CodeActivity, a OnTaskChanged activity and finally a CompleteTask activity. The idea is to create a task for each username passed into the ReplicatorActivity.InitialChildData property. Typically in workflow I bind a field to the CreateTask.TaskId and CreateTask.TaskProperties and inside the CreateTask.MethodInvoking I set these through the local bound fields. This works and my tasks all get created properly. However in the CodeActivity that follows, I want to then access the TaskProperties. The problem I am encountering is that this field holds the values of the final task to be created as the CreateTask runs for all the replications before the CodeActivity gets to runs. From the CodeActivity, here are two ways I've tried to access the CreateTask activity instance from the same context or instance or whatever the terminology is for the replicated sequence. CreateTask task = ((CreateTask)sender.Parent.GetActivityByName("createSoftwareRequestTask", true)); CreateTask createTask = (CreateTask)sender.Parent.Activities[0]; Unfortunately the CreateTask activities both refer back to the last task to be created and not the task from the context that the CodeActivity is executing within. Two reasons why this might be that I can think of. I'm not accessing the correct instance with my code. I am accessing the correct instance, but as the properties I require were bound to and set through local fields then their previous data was overwritten. I'm hitting a brick wall with my understanding of workflow with this and would very much appreciate some assistance here.

    Read the article

  • Reversible pseudo-random sequence generator

    - by user350651
    I would like some sort of method to create a fairly long sequence of random numbers that I can flip through backwards and forwards. Like a machine with "next" and "previous" buttons, that will give you random numbers. Something like 10-bit resolution (i.e. positive integers in a range from 0 to 1023) is enough, and a sequence of 100k numbers. It's for a simple game-type app, I don't need encryption-strength randomness or anything, but I want it to feel fairly random. I have a limited amount of memory available though, so I can't just generate a chunk of random data and go through it. I need to get the numbers in "interactive time" - I can easily spend a few ms thinking about the next number, but not comfortably much more than that. Eventually it will run on some sort of microcontroller, probably just an Arduino. I could do it with a simple linear congruential generator (LCG). Going forwards is simple, to go backwards I'd have to cache the most recent numbers and store some points at intervals so I can recreate the sequence from there. But maybe there IS some pseudo-random generator that allows you to go both forwards and forwards? It should be possible to hook up two linear feedback shift registers (LFSRs) to roll in different directions, no? Or maybe I can just get by with garbling the index number using a hash function of some sort? I'm going to try that first. Any other ideas?

    Read the article

  • Set "Start With" value for Oracle sequence dynamically

    - by Allan
    I'm trying to create a release script that can be deployed on multiple databases, but where the data can be merged back together at a later date. The obvious way to handle this is to set the sequence numbers for production data sufficiently high in subsequent deployments to prevent collisions. The problem is in coming up with a release script that will accept the environment number and set the "Start With" value of the sequences appropriately. Ideally, I'd like to use something like this: ACCEPT EnvironNum PROMPT 'Enter the Environment Number: ' --[more scripting] CREATE SEQUENCE seq1 START WITH &EnvironNum*100000; --[more scripting] This doesn't work because you can't evaluate a numeric expression in DDL. Another option is to create the sequences using dynamic SQL via PL/SQL. ACCEPT EnvironNum PROMPT 'Enter the Environment Number: ' --[more scripting] EXEC execute immediate 'CREATE SEQUENCE seq1 START WITH ' || &EnvironNum*100000; --[more scripting] However, I'd prefer to avoid this solution as I generally try to avoid issuing DDL in PL/SQL. Finally, the third option I've come up with is simply to accept the Start With value as a substitution variable, instead of the environment number. Does anyone have a better thought on how to go about this?

    Read the article

  • Domain: Netlogon event sequence

    - by Bob
    I'm getting really confused, reading tutorials from SAMBA howto, which is hell of a mess. Could you write step-by-step, what events happen upon NetLogon? Or in particular, I can't get these things: I really can't get the mechanism of action of LDAP and its role. Should I think of Active Directory LDS as of its superset? What're the other roles of AD and why this term is nearly a synonym of term "domain"? What's the role of LDAP in the remote login sequence? Does it store roaming user profiles? Does it store anything else? How it is called (are there any upper-level or lower-level services that use it in the course of NetLogon)? How do I join a domain. On the client machine I just use the Domain Controller admin credentials, but how do I prepare the Domain Controller for a new machine to join it. What's that deal of Machine trust accounts? How it is used? Suppose, I've just configured a machine to join a domain, created its machine trust, added its data to the domain controller. How would that machine find WINS server to query it for Domain Controller NetBIOS name? Does any computer name, ending with <1C type, correspond to domain controller? In what cases Kerberos and LM/NTLM are used for authentication? Where are password hashes stored in, say, Windows2000 domain controller? Right in the registry? What is SAM - is it a service, responsible for authentication and sending/storing those passwords and accompanying information, such as groups policies etc.? Who calls it? Does it use Active Directory? What's the role of NetBIOS except by name service? Can you exemplify a scenario of its usage as a "datagram distribution service for connectionless communication" or "session service for connection-oriented communication"? (quoted taken from http://en.wikipedia.org/wiki/NetBIOS_Frames_protocol description of NetBIOS roles) Thanks and sorry for many questions.

    Read the article

  • Prevent Character Escape When Calling XmlWriter.WriteElementString

    - by Ibrar Afzal
    I have a string <entry key="Provider">Comcast Cable Communications, Inc.</entry> <entry key="Challenged">No</entry> I need to call the using xmlwriter.WriteElementString I need to what the string mentioned earlier. Problem here is the xwriter.WriteElementString will escape all "<" and "" symbols with &lt and &gt. I have checked MSDN to see if there is a way to disable it, but have not found an answer. Is there a way to disable the auto-escape features?

    Read the article

  • Prevent Character Escape When Calling xmlwriter.xwriter.WriteElementString, C%

    - by Ibrar Afzal
    I have a string <entry key="Provider">Comcast Cable Communications, Inc.</entry> <entry key="Challenged">No</entry> I need to call the using xmlwriter..WriteElementString I need to what the string mentioned earler. Problem here is the xwriter.WriteElementString will escape all "<" and "" symbols with &lt and &gt. I have checked MSDN to see if there is a way to disable it, but have not found an answer. Is there a way to disable the auto-escape features?

    Read the article

  • java regex illegal escape character error not occurring from command line arguments

    - by Shades88
    This simple regex program import java.util.regex.*; class Regex { public static void main(String [] args) { System.out.println(args[0]); // #1 Pattern p = Pattern.compile(args[0]); // #2 Matcher m = p.matcher(args[1]); boolean b = false; while(b = m.find()) { System.out.println(m.start()+" "+m.group()); } } } invoked by java regex "\d" "sfdd1" compiles and runs fine. But if #1 is replaced by Pattern p = Pattern.compile("\d");, it gives compiler error saying illegal escape character. In #1 I also tried printing the pattern specified in the command line arguments. It prints \d, which means it is just getting replaced by \d in #2. So then why won't it throw any exception? At the end it's string argument that Pattern.compile() is taking, doesn't it detect illegal escape character then? Can someone please explain why is this behaviour?

    Read the article

  • Disable escape in Zend Form Element Submit

    - by Joaquín L. Robles
    I can't disable escaping in a Zend_Form_Element_Submit, so when the label has special characters it won't display it's value.. This is my actual Zend Form piece of code: $this->submit = new Zend_Form_Element_Submit('submit'); $this->submit->setLabel('Iniciar Sesión'); $this->submit->setIgnore(true); $this->addElement($this->submit); I've tried $this->submit->getDecorator('Label')->setOption('escape', false); but I obtain an "non-object" error (maybe submit isn't using the "Label" Decorator).. I've also tried as suggested $this->submit->setAttrib('escape', false); but no text will be shown either.. Any idea? Thanks

    Read the article

  • Oracle 10g - Best way to escape single quotes

    - by satynos
    I have to generate some update statements based off a table in our database. I created the following script which is generating the update statements I need. But when I try to run those scripts I am getting errors pertaining to unescaped single quotes in the content and &B, &T characters which have special meaning in oracle. I took care of the &B and &T problem by setting SET DEFINE OFF. Whats the best way to escape single quotes within the content? DECLARE CURSOR C1 IS SELECT * FROM EMPLOYEES; BEGIN FOR I IN C1 LOOP DBMS_OUTPUT.PUT_LINE('UPDATE EMPLOYEES SET FIRST_NAME= ''' || I.FIRST_NAME|| ''', LAST_NAME = ''' || I.LAST_NAME ''', DOB = ''' || I.DOB|| ''' WHERE EMPLOYEE_ID = ''' || I.EMPLOYEE_ID || ''';'); END LOOP; END; Here if the first_name or last_name contains single quotes then the generated update statements break. Whats the best way to escape those single quotes within the first_name and last_name?

    Read the article

  • Kohana v3, automatically escape illegal characters?

    - by Dom
    Quick question, does Kohana (version 3) automatically escape data that is passed into ORM::factory..... (and everywhere else that has to do with the database)? For example: $thread = ORM::factory('thread', $this->request->param('id')); Would the data passed in the second argument be auto-escaped before it goes in the SQL query or do I have to manually do it? Probably a stupid question and it's better to be safe than sorry, but yeah... I usually do manually escape the data, but I want to know if Kohana does this for me? Thanks

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >