Search Results

Search found 1817 results on 73 pages for 'corina 123'.

Page 41/73 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • How active record is automatically setting up the autoincremental value of ID?

    - by piemesons
    Here this is what we are doing:-- an_order = Order.new an_order.name = "Dave Thomas" an_order.email = "[email protected]" an_order.address = "123 Main St" an_order.pay_type = "check" an_order.save Now it will insert a new row in orders table right. I m having a ID column in that table. Now suppose after inserting this record the value of the ID corresponding to this record is 100. Now how this 100 value came to know? Does the previous value of ID ie 99 (Suppose) is stored somewhere in some variable/file in the ORM layer or before inserting this value a query was fired to know about the last inserted value or database is itself doing that or anything else???

    Read the article

  • What is "=C2=A0" in MIME encoded, quoted-printable text?

    - by TheSoftwareJedi
    This is an example raw email I am trying to parse: MIME-version: 1.0 Content-type: text/html; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Mailer: Verizon Webmail X-Originating-IP: [x.x.x.x] =C2=A0test testing testing 123 What is =C2=A0? I have tried a half dozen quoted-printable parsers, but none handle this correctly. Honestly, for now, I'm coding: //TODO WTF encoded = encoded.Replace("=C2=A0", ""); Because I can't figure out why that text is there randomly within the MIME content, and isn't supposed to be rendered into anything. By just removing it, I'm getting the desired effect - but WHY?!

    Read the article

  • Extracting Mail from Microsoft Exchange server 2007 through IMAPS in java

    - by abhishekgem84
    props.put("mail.debug", "true"); props.setProperty("mail.store.protocol","imaps"); props.setProperty("mail.imaps.auth.plain.disable","false"); props.setProperty("mail.imaps.host","Mail3.connect.com"); props.setProperty("mail.imaps.port","135"); props.setProperty("mail.imaps.user","test"); props.setProperty("mail.imaps.pwd","123"); props.setProperty("mail.imaps.ssl.protocols","SSL"); props.setProperty("mail.imaps.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); props.setProperty("mail.imaps.socketFactory.fallback", "false"); props.setProperty("mail.imaps.socketFactory.port", "135"); i have done all this but it still says javax.mail.AuthenticationFailedException: failed to connect, no password specified? kindly help me out thanks

    Read the article

  • How to avoid timestamp issue in a long query?

    - by pingi
    Hi, I have the following 2 tables: items: id int primary key bla text events: id_items int num int when timestamp without time zone ble text composite primary key: id_items, num and want to select to each item the most recent event (the newest 'when'). I wrote an request, but I don't know if it could be written more efficiently. Also on PostgreSQL there is a issue with comparing Timestamp objects: 2010-05-08T10:00:00.123 == 2010-05-08T10:00:00.321 so I select with 'MAX(num)' Any thoughts how to make it better? Thanks. SELECT i.*, ea.* FROM items AS i JOIN ( SELECT t.s AS t_s, t.c AS t_c, max(e.num) AS o FROM events AS e JOIN ( SELECT DISTINCT id_item AS s, MAX(when) AS c FROM events GROUP BY s ORDER BY c ) AS t ON t.s = e.id_item AND e.when = t.c GROUP BY t.s, t.c ) AS tt ON tt.t_s = i.id JOIN events AS ea ON ea.id_item = tt.t_s AND ea.cas = tt.t_c AND ea.num = tt.o;

    Read the article

  • Shallow Copy in Java

    - by Vilius
    Hello there! I already know, what a shallow copy is, but I'm not able to impliment it. Here's a short example. public class Shallow { String name; int number; public Shallow (String name, int number) { this.name = name; this.number = number; } } Test the implementation ... public class ShallowTest { public static void main (String[] args) { Shallow shallow = new Shallow("Shallow", 123); Shallow shallowClone = new Shallow(shallow); shallowClone.name = 'Peter'; shallowClone.number = 321; System.out.println(shallow.name + " - " + shallow.number); } } As I purpose, just the reference of the non primitive datatype String would be copied, so that by calling "shallowClone.name = 'Peter';" I would also change the name of "shallow". Am I right? But somehow, it just does not want to work ....

    Read the article

  • How to select only the first rows for each unique value of a column

    - by nuit9
    Let's say I have a table of customer addresses: CName | AddressLine ------------------------------- John Smith | 123 Nowheresville Jane Doe | 456 Evergreen Terrace John Smith | 999 Somewhereelse Joe Bloggs | 1 Second Ave In the table, one customer like John Smith can have multiple addresses. I need the select query for this table to return only first row found where there are duplicates in 'CName'. For this table it should return all rows except the 3rd (or 1st - any of those two addresses are okay but only one can be returned). Is there a keyword I can add to the SELECT query to filter based on whether the server has already seen the column value before?

    Read the article

  • is it possible to dynamically set the level of for loop nesting

    - by galaxy
    I'm working out an algorithm to get permutations like 123 132 213 231 312 321 I'm doing it using nested foreach loops. for (..) { for(..) { for(..) { echo $i . $j . $k . "<br />"; } } } Problem is those # of nested loops are optimized for 3-spot permutations. How can I could I dynamically set the number of nested for loops to generate 4-letter or 5-letter permutations?

    Read the article

  • how to have separate keys per record in mongo_mapper + Rails

    - by Vitaly Kushner
    When I'm adding a record in mongodb I can specify whatever keys I want and it will store it in the db. The problem is that it will remember those keys for the next time I insert another record. so for example if I do the following: Product.create :foo => 123 and then Product.create :bar => 456 I get :foo => nil field in the 2nd record. This is definitely not a limitation of mongodb itself, since if I restart the rails console and create yet another record with different set of columns, it will not add the columns from the 1st 2 records. So it seems like mongomapper remembers all the keys used and inserts them all into all records, even if values are not provided. The question is obviously: how do I disable this crazy attributes explosion? Basically I want only the 'permanent' keys that I specify in the model to be in every record, but all the 'extra' attributes to be specified per record and not to mess the consequent records.

    Read the article

  • how to find the max index of a string from variable in c#?

    - by zoya
    suppose i have a string as string[] _strFile; foreach (ListViewItem item in listview1.Items) { string _strRecFileName = item.SubItems[5].Text; _strFile = _strRecFileName.Split('\\'); } in my listview i have a string as \123\abc\hello\.net\*winxp* now i want to get the last value of the string i.e. winxp in this case.. what is the function to do that? can i use getupperbond function to calculate the upper bound of the string and how to use it?

    Read the article

  • Can I send a variable to paypal, and have it post it back to me when payment completes?

    - by Yegor
    Ive been using express checkout API to convert people's accounts on my site to premium accounts after paying. The only problem with it is that it doesn't send the user back to the site until they click the button to return, and it updates their permission when that happens. About 40% of the users don't seem to do that.... so their accounts never get credited after payment. Although paypal does an instant post-back upon the successful payment, I was never able to make it actually update the user's account right away, since I cant get it to send back some sort of informational that would identify the user that just completed the payment. I could only do that when you are sent back to the site, which sends the transaction ID, that I logged with a post-back. It searches for it, and grants permission if it was found int he DB. Is there a way to submit some sort of a variable to paypal, that it will then post back to me? Something like &user_id=123, which would make it very handly to update the user's permission.

    Read the article

  • db2 sql pattern matching

    - by Jitesh
    I have a table in db2 which has the following fields int xyz; string myId; string myName; Example dataset xyz | myid | myname -------------------------------- 1 | ABC.123.456 | ABC 2 | PRQS.12.34 | PQRS 3 | ZZZ.3.2.2 | blah I want to extract the rows where myName matches the character upto "." in the myId field. So from the above 3 rows, I want the firs 2 rows since myName is present in myId before "." How can I do this in the query, can I do some kind of pattern matching inside the query?

    Read the article

  • Duplicate an AppEngine Query object to create variations of a filter without affecting the base quer

    - by Steve Mayne
    In my AppEngine project I have a need to use a certain filter as a base then apply various different extra filters to the end, retrieving the different result sets separately. e.g.: base_query = MyModel.all().filter('mainfilter', 123) Then I need to use the results of various sub queries separately: subquery1 = basequery.filter('subfilter1', 'xyz') #Do something with subquery1 results here subquery2 = basequery.filter('subfilter2', 'abc') #Do something with subquery2 results here Unfortunately 'filter()' affects the state of the basequery Query instance, rather than just returning a modified version. Is there any way to duplicate the Query object and use it as a base? Is there perhaps a standard Python way of duping an object that could be used? The extra filters are actually applied by the results of different forms dynamically within a wizard, and they use the 'running total' of the query in their branch to assess whether to ask further questions. Obviously I could pass around a rudimentary stack of filter criteria, but I'd rather use the Query itself if possible, as it adds simplicity and elegance to the solution.

    Read the article

  • INSERT INTO error MYSQL/PHP

    - by bat
    I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (total, addy, cc) VALUES ('798' , '123 sadf' , '12124123')' at line 1 $total = addslashes(($_SESSION['total'])); $addy = addslashes(($_POST['addy'])); $cc = addslashes(($_POST['cc'])); echo "$total"; echo "$addy"; echo "$cc"; mysql_query("INSERT INTO order (total, addy, cc) VALUES ('$total' , '$addy' , '$cc')") or die(mysql_error()); help plz =]

    Read the article

  • How can I capture a multiline pattern using a regular expressions in java?

    - by lampShade
    I have a text file that I need to parse using regular expressions. The text that I need to capture is in multiline groups like this: truck zDoug Doug's house (123) 456-7890 [email protected] 30 61234.56 8/10/2003 vehicle eRob Rob's house (987) 654-3210 [email protected] For this example I need to capture truck followed by the next seven lines.In other words, in this "block" I have 8 groups. This is what I've tried but it will not capture the next line: (truck)\n(\w). NOTE: I'm using the program RegExr to test my regex before I port it to Java.

    Read the article

  • python list directory , subdirectory and files

    - by thomytheyon
    Hi Alls, I'm trying to make a script to list all directory, subdirectory, and files in a given directory. I tried this : import sys,os root="/home/patate/directory/" path=os.path.join(root,"targetdirectory") for r,d,f in os.walk(path): for file in f: print os.path.join(root,file) Unfortunatly it doesn't work properly, i get all the files, but not them complete path. like : if the dir struct would be : /home/patate/directory/targetdirectory/123/456/789/file.txt It would print: /home/patate/directory/targetdirectory/file.txt What i need is the first result, any help would be greatly appreciated ! Thanks

    Read the article

  • How is the ">" operator implemented (on 32 bit integers)?

    - by Ron Klein
    Let's say that the environment is x86. How do compilers compile the "" operator on 32 bit integers. Logically, I mean. Without any knowledge of Assembly. Let's say that the high level language code is: int32 x, y; x = 123; y = 456; bool z; z = x > y; What does the compiler do for evaluating the expression x > y? Does it perform something like (assuming that x and y are positive integers): w = sign_of(x - y); if (w == 0) // expression is 'false' else if (w == 1) // expression is 'true' else // expression is 'false' Is there any reference for such information?

    Read the article

  • Collections not read from hibernate/ehcache second-level-cache

    - by Mark van Venrooij
    I'm trying to cache lazy loaded collections with ehcache/hibernate in a Spring project. When I execute a session.get(Parent.class, 123) and browse through the children multiple times a query is executed every time to fetch the children. The parent is only queried the first time and then resolved from the cache. Probably I'm missing something, but I can't find the solution. Please see the relevant code below. I'm using Spring (3.2.4.RELEASE) Hibernate(4.2.1.Final) and ehcache(2.6.6) The parent class: @Entity @Table(name = "PARENT") @Cacheable @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, include = "all") public class ServiceSubscriptionGroup implements Serializable { /** The Id. */ @Id @Column(name = "ID") private int id; @OneToMany(fetch = FetchType.LAZY, mappedBy = "parent") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) private List<Child> children; public List<Child> getChildren() { return children; } public void setChildren(List<Child> children) { this.children = children; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Parent that = (Parent) o; if (id != that.id) return false; return true; } @Override public int hashCode() { return id; } } The child class: @Entity @Table(name = "CHILD") @Cacheable @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, include = "all") public class Child { @Id @Column(name = "ID") private int id; @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "PARENT_ID") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) private Parent parent; public int getId() { return id; } public void setId(final int id) { this.id = id; } private Parent getParent(){ return parent; } private void setParent(Parent parent) { this.parent = parent; } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Child that = (Child) o; return id == that.id; } @Override public int hashCode() { return id; } } The application context: <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="annotatedClasses"> <list> <value>Parent</value> <value>Child</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServer2008Dialect</prop> <prop key="hibernate.hbm2ddl.auto">validate</prop> <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop> <prop key="hibernate.connection.charSet">UTF-8</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.use_sql_comments">true</prop> <!-- cache settings ehcache--> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.region.factory_class"> org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.transaction.factory_class"> org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory</prop> <prop key="hibernate.transaction.jta.platform"> org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform</prop> </props> </property> </bean> The testcase I'm running: @Test public void testGetParentFromCache() { for (int i = 0; i <3 ; i++ ) { getEntity(); } } private void getEntity() { Session sess = sessionFactory.openSession() sess.setCacheMode(CacheMode.NORMAL); Transaction t = sess.beginTransaction(); Parent p = (Parent) s.get(Parent.class, 123); Assert.assertNotNull(p); Assert.assertNotNull(p.getChildren().size()); t.commit(); sess.flush(); sess.clear(); sess.close(); } In the logging I can see that the first time 2 queries are executed getting the parent and getting the children. Furthermore the logging shows that the child entities as well as the collection are stored in the 2nd level cache. However when reading the collection a query is executed to fetch the children on second and third attempt.

    Read the article

  • Remove a certain value from string which keeps on changing

    - by user2971375
    I m trying to make a utility to generate a Insert script of sql tables along with relational table. I got all the values in c#. Now I want to remove the one column name and its value from the script.most probably the identity column. Eg. The string I have (which keeps on changing with table name and varies) INSERT Core.Customers ([customerId],[customername],[customeradress],[ordernumber]) Values(123,N'Rahul',N'244 LIZ MORN',2334) NOW I know I have to remove CustomerId. (sometimes need to be replaces with @somevariable) Please give me an efficient way how to retrieve customerId value and Deleting column name and value . Conditions: insert script length and columns names keep changing. Method should return the deleted value. At some point of time customer id can be same as order id. In that case my string.remove method fails.

    Read the article

  • how to solve nested list programs [closed]

    - by riya
    write a function to get most popular car that accepts a car detail as input and returns the most popular car name along with its average rating .Each element of car details list is a sublist that provides the below information about a car (a)name of a car(b)car price (c) list of ratings obtained by car from various agencies.Incase two cars have the same average rating then the car with the lesser price qualifies as most popular car? here's my solution-: (define-struct cardetails ("name" price list of '(ratings)) (define car1 (make-cardetails "toyota" 123 '( 1 2 3))) (define car2 (make-cardetails "santro" 321 '( 2 2 3))) (define car3 (make-cardetails "toyota" 100 '( 1 2 3))) (define cardetailslist(list(car1) (car2)(car 3))) (let loop ((count 0)) (let (len (length cardetailslist)) (if(< count len) (string-ref (string-ref n)0) now please tell me how to find maximum average and display car name.it's not a homework question tomorrow is my test and we have not been taught this concept in class although it is very important from test point of view

    Read the article

  • How do I draw an arrow on a histogram drawn using ggplot2?

    - by jon
    Here is dataset: set.seed(123) myd <- data.frame (class = rep(1:4, each = 100), yvar = rnorm(400, 50,30)) require(ggplot2) m <- ggplot(myd, aes(x = yvar)) p <- m + geom_histogram(colour = "grey40", fill = "grey40", binwidth = 10) + facet_wrap(~class) + theme_bw( ) p + opts(panel.margin=unit(0 ,"lines")) I want to add labels to bars which each subject class fall into and produce something like the post-powerpoint processed graph. Is there way to do this within R ? ...... Edit: we can think of different pointer such as dot or error bar, if arrow is not impossible Let's say the following is subjects to be labelled: class name yvar 2 subject4 104.0 3 subject3 8.5 3 subject1 80.0 4 subject2 40.0 4 subject1 115.0 classd <- data.frame (class = c(2,3,3,4,4), name = c ("subject4", "subject3", "subject1", "subject2", "subject1"), yvar = c(104.0, 8.5,80.0,40.0, 115.0))

    Read the article

  • How do I get query string value from script path?

    - by TruMan1
    I am adding my Javsacript file in pages with different query strings in the script path like this: Page1: <script type="text/javascript" src="file.js?abc=123"></script> Page2: <script type="text/javascript" src="file.js?abc=456"></script> Page3: <script type="text/javascript" src="file.js?abc=789"></script> In my Javascript file, how can I get the value of the "abc" param? I tried using window.location for this, but that does not work. In case it helps, below is a function I use to find the value of a query string param: function getQuerystring(key, defaultValue) { if (defaultValue == null) defaultValue = ""; key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + key + "=([^&#]*)"); var qs = regex.exec(window.location.href); if (qs == null) return defaultValue; else return qs[1]; }

    Read the article

  • Replacing substring in a string

    - by user177785
    I am uploading a image file to the server. Now after uploading the file to the server I need to rename the file with an id, but the extension of the file should be retained. Eg: if I upload the file image1.png then my server script should retain the extension .png. But I need to change the substring to some other substring (primary key of db). image1.png should be renamed to 123.png image2.jpg should be renamed to somevalue.jpg The image can be of any extension like .png, .jpg, .jpeg etc. I want to rename then in such a way that the image/file extension should be retained.

    Read the article

  • CSS, fill all div width with text

    - by lolalola
    Hi, How to automatically change the space between the letters.I want the text to take up the entire width of the div. Text is not static. (Always changing text, can be 123" or "text text"...) <style type="text/css"> #menu{ width: 200px; background-color: #000; color: #336699; font-size: 16px; letter-spacing: 100%; } </style> <body> <div id="menu"> tekstas </div>

    Read the article

  • handle json request in PHP

    - by wo_shi_ni_ba_ba
    When making an ajax call, when contentType is set to application/json instead of the default x-www-form-urlencoded, server side (in PHP) can't get the post parameters. in the following working example, if I set the contentType to "application/json" in the ajax request, PHP $_POST would be empty. why does this happen? How can I handle a request where contentType is application/json properly in PHP? $.ajax({ cache: false, type: "POST", url: "xxx.php", //contentType: "application/json", processData: true, data: {my_params:123}, success: function(res){ }, complete: function(XMLHttpRequest, text_status) { } });

    Read the article

  • Problem with NHibernate and saving.

    - by Vilx-
    When I do this: Cat x = Session.Load<Cat>(123); x.Name = "fritz"; Session.Flush(); NHibernate detects the change and UPDATEs the DB. But, when I do this: Cat x = new Cat(); Session.Save(x); x.Name = "fritz"; Session.Flush(); I get NULL for name, because that's what was there when I called Session.Save(). Why doesn't NHibernate detect the changes - or better yet, take the values for the INSERT statement at the time of Flush()?

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >