Search Results

Search found 4656 results on 187 pages for 'sleepy john'.

Page 164/187 | < Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >

  • MySQL auto increment

    - by mouthpiec
    Hi, I have table with an auto-increment field, but I need to transfer the table to another table on another database. Will the value of field 1 be 1, that of field 2 be 2, etc? Also in case the database get corrupted and I need to restore the data, will the auto-increment effect in some way? will the value change? (eg if the first row, id (auto-inc) = 1, name = john, country = UK .... will the id field remain 1?) I am asking because if other table refer to this value, all data will get out of sync if this field change.

    Read the article

  • Java Spam Filter

    - by JackSparrow
    I'm trying to create a spam filter in Java using the Bayesian algorithm. I use a text file that contains email messages and split the tokens using regex, storing these values into a hashmap. My problem is, with regex, the email addresses are split so instead of: [email protected] regex causes the token to be: john smith example The same holds true for ip addresses, so for example, instead of: 192.55.34.322 regex splits the tokens to be: 192 55 34 322 So does anybody know of a way that I could read the email messages and store their contents as is?

    Read the article

  • Excel Macro to copy an entire row from one sheet to another based upon a single word, within a parag

    - by jason
    Guys i'm looking for a simple excel macro that can copy a row from one sheet to another within excel based upon having a specific word in the cell. I have a sheet one, called "data" and a sheet two called "final". Here is an eaxmple of the data A B C D john mary 555.555.4939 initial reply to phone conversation Jim jack 555.555.5555 floor estimate for bathroom jerry kim 555.555.5553 initial response to phone call I'd like to copy than entire row from sheet "data" to a sheet "final" if the data in column D contains either the word "reply" or the word "response" somewhere within the paragraph. Any tips would be much obliged. thanks, J

    Read the article

  • Returning the value of an identity column during/after INSERT command

    - by Adam Kane
    Using VS 2010, with ASP.NET, and .NET 3.0, and C#... When I use a System.Web.UI.WebControls.SqlDataSource and call its Insert() method to insert a new row, and that table has an identity column, I'd like my method to return the value of that column. For example, in my SQL 2005 table, I've got: Customer.Id Customer.FirstName Customer.LastName Where Customer.Id is an identity colum. When I call my method InsertNewCustomerRecord( "John", "Smith" ), I'd like to be able to return the Customer.Id that gets automatically generated in the database. Sorry for such a roughly posed question. Let me know if I can add better detail. Thanks.

    Read the article

  • Big text appears for few second on page refresh in IE, How to solve?

    - by metal-gear-solid
    Text always appears in big size for a few seconds when one refreshes the page on IE only, which doesn't look very good. pleas look at IE 7 and try to refresh (I've e.g. been pressing ctrl + F5) to see what i'm facing. I'm also using sIFR on this site I check a js error of page and this is the problematic area. <script type="text/javascript">var arr = new Array(3) arr[0] = "Jani" arr[1] = "Tove" arr[2] = "Hege"var arr2 = new Array(3) arr2[0] = "John" arr2[1] = "Andy" arr2[2] = "Wendy"document.write(arr.concat(arr2))</script>

    Read the article

  • 'schema' design for a social network

    - by Alan B
    I'm working on a proof of concept app for a twitter style social network with about 500k users. I'm unsure of how best to design the 'schema' should I embed a user's subscriptions or have a separate 'subscriptions' collection and use db references? If I embed, I still have to perform a query to get all of a user's followers. e.g. Given the following user: { "username" : "alan", "photo": "123.jpg", "subscriptions" : [ {"username" : "john", "status" : "accepted"}, {"username" : "paul", "status" : "pending"} ] } to find all of alan's subscribers, I'd have to run something like this: db.users.find({'subscriptions.username' : 'alan'}); from a performance point of view, is that any worse or better than having a separate subscriptions collection? also, when displaying a list of subscriptions/subscribers, I am currently having problems with n+1 because the subscription document tells me the username of the target user but not other attributes I may need such as the profile photo. Are there any recommended practices for such situations? thanks Alan

    Read the article

  • Populating PDF fields in .NET without a API, such as iTextSharp

    - by Kristjan Oddsson
    class mineTest { string pdfTemplate = @"c:\us.pdf"; public mineTest(Customer c, string output) { StreamReader sr = new StreamReader(pdfTemplate); StreamWriter sw = new StreamWriter(output); string content = sr.ReadToEnd(); content.Replace("(Customer name)/DA(/Verdana 10 Tf 0 g)/FT/Tx/Type/Annot/MK<<>>/V()/AP<</N 13 0 R>>>>", "(Customer name)/DA(/Verdana 10 Tf 0 g)/FT/Tx/Type/Annot/MK<<>>/V(John Johnson)/AP<</N 13 0 R>>>>"); sw.Write(content); sw.Close(); sr.Close(); } } Why does the above code fail at producing a valid PDF?

    Read the article

  • HOM with Objective C

    - by Coxer
    Hey, i am new to objective C, but i tried to use HOM in order to iterate over an NSArray and append a string to each element. here is my code: void print( NSArray *array ) { NSEnumerator *enumerator = [array objectEnumerator]; id obj; while ( nil!=(obj = [enumerator nextObject]) ) { printf( "%s\n", [[obj description] cString] ); } } int main( int argc, const char *argv[] ) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray *names = [[NSArray alloc] init]; NSArray *names_concat = [[NSArray alloc] init]; names = [NSArray arrayWithObjects:@"John",@"Mary",@"Bob",nil]; names_concat = [[names collect] stringByAppendingString: @" Doe"]; print(names_concat); [pool release]; } What is wrong with this code? My compiler (gcc) says NSArray may not respond to "-collect"

    Read the article

  • Server Side Javascript

    - by XGreen
    Hi all, I can't help to see in many sites I visit the enthusiasm about server side javascript and the appealing look of a single language governing all tiers of the site. Mozilla Rhino, Aptana Jaxer and various John Resig's articles are some of the highlights of my search. I wanted to ask for some input from you guys on SO. your opinions and preferably experience in this. I do most of the data access and business logic currently either with asp.net or php depending on the hosting package of the client. Is anyone among you who's gave up these for ssjs?

    Read the article

  • D3.js binding an object to data and appending for each key

    - by frshca
    I'm a D3.js newbie and I'm learning how to play around with data. Let's say I have an object with names as keys, and each key has an array of numbers like this: var userdata = { 'John' : [0, 1, 3, 9, 8, 7], 'Harry': [0, 10, 7, 1, 1, 11], 'Steve': [3, 1, 4, 4, 4, 17], 'Adam' : [4, 77, 2, 13, 11, 13] }; For each user, I would like to append an SVG object and then plot the line with the array of values for that user. So here is my assumption of how that would look based on tutorials, but I know it is incorrect. This is to show my limited knowledge and give better understanding of what I'm doing: First I should create the line var line = d3.svg.line().interpolate('basis'); Then I want to bind the data to my body and append an svg element for each key: d3.select('body') .selectAll('svg') .data(userdata) .enter() .append('svg') .append(line) .x(function(d, i) { return i; }) .y(function(d) { return d[i]; }); So am I close??

    Read the article

  • WiX - create a bootstrap that passes arguments to the msiexec

    - by Dror Helper
    I need to create a bootstrap for my WiX project I've tried using setupbld.exe but it will only allow me to create an executable that will show my UI or one that will behave as a silent installer but not both. I need to be able to run the resulting executable with argument that will tell it wether or not to show the UI during installation. I've found this post by John Robbins that explains how to re-build the setup.exe stub used in the creation of the bootstrap but I was hoping there is a simpler way to do what I need. Does anyone know of a way to create a bootstrap that I use to run either as a simple (with UI) install or as a silent install.

    Read the article

  • Trying to speed up a SQLITE UNION QUERY

    - by user142683
    I have the below SQLITE code SELECT x.t, CASE WHEN S.Status='A' AND M.Nomorebets=0 THEN S.PriceText ELSE '-' END AS Show_Price FROM sb_Market M LEFT OUTER JOIN (select 2010 t union select 2020 t union select 2030 t union select 2040 t union select 2050 t union select 2060 t union select 2070 t ) as x LEFT OUTER JOIN sb_Selection S ON S.MeetingId=M.MeetingId AND S.EventId=M.EventId AND S.MarketId=M.MarketId AND x.t=S.team WHERE M.meetingid=8051 AND M.eventid=3 AND M.Name='Correct Score' With the current interface restrictions, I have to use the above code to ensure that if one selection is missing, that a '-' appears. Some feed would be something like the following SelectionId Name Team Status PriceText =================================== 1 Barney 2010 A 10 2 Jim 2020 A 5 3 Matt 2030 A 6 4 John 2040 A 8 5 Paul 2050 A 15/2 6 Frank 2060 S 10/11 7 Tom 2070 A 15 Is using the above SQL code the quickest & efficient?? Please advise of anything that could help. Messages with updates would be preferable.

    Read the article

  • SQL Query - Count column values separately

    - by user575535
    I have a hard time getting a Query to work right. This is the DDL for my Tables CREATE TABLE Agency ( id SERIAL not null, city VARCHAR(200) not null, PRIMARY KEY(id) ); CREATE TABLE Customer ( id SERIAL not null, fullname VARCHAR(200) not null, status VARCHAR(15) not null CHECK(status IN ('new','regular','gold')), agencyID INTEGER not null REFERENCES Agency(id), PRIMARY KEY(id) ); Sample Data from the Tables AGENCY id|'city' 1 |'London' 2 |'Moscow' 3 |'Beijing' CUSTOMER id|'fullname' |'status' |agencyid 1 |'Michael Smith' |'new' |1 2 |'John Doe' |'regular'|1 3 |'Vlad Atanasov' |'new' |2 4 |'Vasili Karasev'|'regular'|2 5 |'Elena Miskova' |'gold' |2 6 |'Kim Yin Lu' |'new' |3 7 |'Hu Jintao' |'regular'|3 8 |'Wen Jiabao' |'regular'|3 I want to produce the following output, but i need to count separately for ('new','regular','gold') 'city' |new_customers|regular_customers|gold_customers 'Moscow' |1 |1 |1 'Beijing'|1 |2 |0 'London' |1 |1 |0

    Read the article

  • Reading xml document in firefox

    - by Searock
    I am trying to read customers.xml using javascript. My professor has taught us to read xml using `ActiveXObjectand he has given us an assignment to create a sample login page which checks username and password by reading customers.xml. I am trying to use DOMParser so that it works with firefox. But when I click on Login button I get this error. Error: syntax error Source File: file:///C:/Users/Searock/Desktop/home/project/project/login.html Line: 1, Column: 1 Source Code: customers.xml Here's my code. login.js var xmlDoc = 0; function checkUser() { var user = document.login.txtLogin.value; var pass = document.login.txtPass.value; //xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); /* xmlDoc = document.implementation.createDocument("","",null); xmlDoc.async = "false"; xmlDoc.onreadystatechange = redirectUser; xmlDoc.load("customers.xml"); */ var parser = new DOMParser(); xmlDoc = parser.parseFromString("customers.xml", "text/xml"); alert(xmlDoc.documentElement.nodeName); xmlDoc.async = "false"; xmlDoc.onreadystatechange = redirectUser; } function redirectUser() { alert(''); var user = document.login.txtLogin.value; var pass = document.login.txtPass.value; var log = 0; if(xmlDoc.readyState == 4) { xmlObj = xmlDoc.documentElement; var len = xmlObj.childNodes.length; for(i = 0; i < len; i++) { var nodeElement = xmlObj.childNodes[i]; var userXml = nodeElement.childNodes[0].firstChild.nodeValue; var passXml = nodeElement.childNodes[1].firstChild.nodeValue; var idXML = nodeElement.attributes[0].value if(userXml == user && passXml == pass) { log = 1; document.cookie = escape(idXML); document.login.submit(); } } } if(log == 0) { var divErr = document.getElementById('Error'); divErr.innerHTML = "<b>Login Failed</b>"; } } customers.xml <?xml version="1.0" encoding="UTF-8"?> <customers> <customer custid="CU101"> <user>jack</user> <pwd>PW101</pwd> <email>[email protected]</email> </customer> <customer custid="CU102"> <user>jill</user> <pwd>PW102</pwd> <email>[email protected]</email> </customer> <customer custid="CU103"> <user>john</user> <pwd>PW103</pwd> <email>[email protected]</email> </customer> <customer custid="CU104"> <user>jeff</user> <pwd>PW104</pwd> <email>[email protected]</email> </customer> </customers> I get parsererror message on line alert(xmlDoc.documentElement.nodeName); I don't know what's wrong with my code. Can some one point me in a right direction? Edit : Ok, I found a solution. var xmlDoc = 0; var xhttp = 0; function checkUser() { var user = document.login.txtLogin.value; var pass = document.login.txtPass.value; var err = ""; if(user == "" || pass == "") { if(user == "") { alert("Enter user name"); } if(pass == "") { alert("Enter Password"); } return; } if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else // IE 5/6 { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.onreadystatechange = redirectUser; xhttp.open("GET","customers.xml",true); xhttp.send(); } function redirectUser() { var log = 2; var user = document.login.txtLogin.value; var pass = document.login.txtPass.value; if (xhttp.readyState == 4) { log = 0; xmlDoc = xhttp.responseXML; var xmlUsers = xmlDoc.getElementsByTagName('user'); var xmlPasswords = xmlDoc.getElementsByTagName('pwd'); var userLen = xmlDoc.getElementsByTagName('customer').length; var xmlCustomers = xmlDoc.getElementsByTagName('customer'); for (var i = 0; i < userLen; i++) { var xmlUser = xmlUsers[i].childNodes[0].nodeValue; var xmlPass = xmlPasswords[i].childNodes[0].nodeValue; var xmlId = xmlCustomers.item(i).attributes[0].nodeValue; if(xmlUser == user && xmlPass == pass) { log = 1; document.cookie = xmlId; document.login.submit(); break; } } } if(log == 0) { alert("Login failed"); } } Thanks.

    Read the article

  • How to create a custom yaml config file in Symfony

    - by Guillaume Flandre
    What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directory and added the following at the top of the file: config/something.yml: class: sfDefineEnvironmentConfigHandler param: prefix: something_ But if I'm calling sfConfig::get("something_foo"); I keep getting NULL. What did I do wrong? I just want to read values, so no need to create a custome config handler, right? I've read the doc here: http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files even though I'm running 1.4 (I don't think that changed since then). Edit: Of course I can use sfYaml::load() but I'd like to do things in a better way.

    Read the article

  • jquery Tree Traversal prev() problem.

    - by Guido Lemmens
    Hello, I like to click a label and check the previous checkbox. I've tried the next code, but this is not working. I have tried for 2 hours, but what am i missing? JQUERY jQuery(document).ready(function() { $('.profilename').live('click', function() { if ($(this).prev("input:checked").val() != null) { $(this).prev("input").removeAttr("checked"); } else { $(this).prev("input").attr("checked","checked"); } }); }); HTML <input type="checkbox" class="check" name="example"> <label class="namelabel">John Doe</label> Who can help me to solve this question? Many thanks! p.s. I know i can easy solve this with the <label for=""> tag, but that is not the question.

    Read the article

  • Selecting the most common value from relation - SQL statement

    - by Ronnie
    I have a table within my database that has many records, some records share the same value for one of the columns. e.g. | id | name | software | ______________________________ | 1 | john | photoshop | | 2 | paul | photoshop | | 3 | gary | textmate | | 4 | ade | fireworks | | 5 | fred | textmate | | 6 | bob | photoshop | I would like to return the value of the most common occurring piece of software, by using an SQL statement. So in the example above the required SQL statement would return 'photoshop' as it occurs more than any other piece of software. Is this possible? Thank you for your time.

    Read the article

  • how to store BigInteger values in oracle database.

    - by Bipul
    I have connected Java program to Oracle database using JDBC. I want to store BigInteger values(512 bits) in the database. What should be the type of the column? I m trying like this: I have taken a column of number type in the database. I converted BigInteger to BigDecimal like this: BigInteger b=new BigInteger("5779857570957802579079"); Number n =b; BigDecimal d=(BigDecimal)n; PreparedStatement pstmt=con.prepareStatemant("insert into database values(?,?)"); pstmt.setString(1,"john"); pstmt.setBigDecimal(2,d); I am getting the following exception: javax.servlet.ServletException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.math.BigDecimal root cause java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.math.BigDecimal Is there anything wrong in this code snippet? If there is, please suggest other methods.

    Read the article

  • Find elements based on xsd type with lxml

    - by joet3ch
    I am trying to get a list of elements with a specific xsd type with lxml 2.x and I can't figure out how to traverse the xsd for specific types. Example of schema: <xsd:element name="ServerOwner" type="srvrs:string90" minOccurs="0"> <xsd:element name="HostName" type="srvrs:string35" minOccurs="0"> Example xml data: <srvrs:ServerOwner>John Doe</srvrs:ServerOwner> <srvrs:HostName>box01.example.com</srvrs:HostName> The ideal function would look like: elements = getElems(xml_doc, 'string90') def getElems(xml_doc, xsd_type): ** xpath or something to find the elements and build a dict return elements

    Read the article

  • How to do an IF statement based on the value of a MySQL table cell?

    - by Susan
    How can I do an if statement based on the value of a mysql table cell. For example, I have a table of people with a column called marital_status. This column has one of two values: yes or no. But this doesn't work: $query = mysql_query("SELECT marital_status FROM people WHERE first_name = 'John'"); while ($row = mysql_fetch_assoc($query)) { $maritalStatus = $row['marital_status']; } if ($maritalStatus == "yes") { echo "This person is married."; } else { echo "This person is NOT married."; } $maritalStatus == "yes" doesn't return as true even though that is exactly the value in that cell.

    Read the article

  • SubSonic: MySqlDataReader closes connection.

    - by SchlaWiener
    I am using SubSonic 2.1 and entcountered a problem while executing a Transaction with SharedDbConnectionScope and TransactionScope. The problem is that in the obj.Save() method I get an "The connection must be valid and open" exception I tracked down the problem to this line: // Loads a SubSonic ActiveRecord object User user = new User(User.Columns.Username, "John Doe"); in this Constructor of the User class a method "LoadParam" is called which eventually does if (rdr != null) rdr.Close(); It looks like the rdr.Close() implicitly closes my connection which is fine when using the AutomaticConnection. But during a transaction it is usally not a good idea to close the connection :-) My Question is if this is by design or if it's an error in the MySqlDataReader.

    Read the article

  • Using XPath to access comments a flat hierachy

    - by Sebastian
    I have a given XML document (structure can not be changed) and want to get the comments that are written above the nodes. The document looks like this: <!--Some comment here--> <attribute name="Title">Book A</attribute> <attribute name="Author"> <value>Joe Doe</value> <value>John Miller</value> </attribute> <!--Some comment here--> <attribute name="Code">1</attribute> So comments are optional, but if there is one, I want to get the comment above each attribute. Using /*/comment()[n] would give me comment n, but for n=2 I would naturally get the comment of the third attribute, so there is no connection between attributes and comments Any ideas? Thanks

    Read the article

  • problems with UTF-8 encoding in PHP

    - by user296516
    Hi guys, The characters I am getting from the URL, for example www.mydomain.com/?name=john , were fine, as longs as they were not in Russian. If they were are in Russian, I was getting '????'. So I added $name= iconv("cp1251","utf-8" ,$name); and now it works fine for Russian and English characters, but screws up other languages. :))) For example 'Janis' ( Latvian ) that worked fine before iconv, now turns into 'j??nis'. Any idea if there's some universal encoder that would work with both the Cyrillic languages and not screw up other languages?

    Read the article

  • Using attribute text value in AngularJS directive

    - by C1pher
    Using a YouTube tutorial created by John Lindquist, I was able to create a directive using a template. See fiddle: http://jsfiddle.net/37PSs/ Now, I want to use the value of the attribute as a variable to a function call. Something like this: html: <hello-world name="World"></hello-world> javascript - directive: template: '<span>myFunction({{name}})</span>' javascript - myFunction(theirName): return ("Hello, " + String(theirName) + "!"); The closest I've been able to get is passing an [object Window] to my function.

    Read the article

  • jquery ajax image

    - by Nishima
    Hi all, I am sending an ajax request on dblick for creating the image of the screen where it is double clicked.I am ising imagegrabscreen() function of PHP to create image but instead of creating its image it is creates a black image. dblclick(function (ev,ui) { var response = $.ajax({ type:"POST", url: "grabImage.php", data:"name=John&location=Boston&function_name=img", complete: function(msg){ var resp = msg.responseText; if(msg && msg.readyState != 4) { alert("Ready State :"+msg.readyState); return; } else{ //wb_load(); alert( "Data Saved: " + resp); } } }); } ); GRAB IMAGE FUNCTION function img() { $im = imagegrabscreen(); imagepng($im, "C:\myscreenshot.png"); //echo $im; //imagedestroy($im); return $im; define('imge',$im); }

    Read the article

< Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >