Search Results

Search found 602 results on 25 pages for 'victor lin'.

Page 16/25 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Javascript code works only when the page loads

    - by victor
    I have a page with a dropdown and two textboxes. The javascript code checks to make sure that if the dropdown says Appointment Made or Patient Scheduled, the appropriate text boxes will have dates in them. When the page loads and the drop down shows either of the two above, all works fine but when I change the drop down the script does not work. I have put an alert statament after the third line and do see that when I make a change to patient_status, the variable a gets updated but for some reason the script fails and does not prompt. For example if the page loads and Appointment Made is selected, the script will prompt, but if I change the drop down to Patient Scheduled, it will not prompt. Thank You. function calculate() { a= document.getElementById("EditRecordpatient_status").value; b= document.getElementById("EditRecordSurgery_Date").value; c= document.getElementById("EditRecordConsult_Date").value; alert(a); alert(b); alert(c); if (a=="Appointment Made" && c=="") { alert('You have scheduled a patient for consultation but the consult date is missing!'); return false; } else if (a=="Patient Scheduled" && b=="") { alert('You have scheduled a patient for surgery but the surgery date is missing!'); return false; } else { return true; } } document.getElementById("Mod0EditRecord").onclick=calculate;

    Read the article

  • How to skip all the column names in MySQL when the table has auto increment primary key?

    - by Jian Lin
    A table is: mysql> desc gifts; +---------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+----------------+ | giftID | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(80) | YES | | NULL | | | filename | varchar(80) | YES | | NULL | | | effectiveTime | datetime | YES | | NULL | | +---------------+-------------+------+-----+---------+----------------+ the following is ok: mysql> insert into gifts -> values (10, "heart", "heart_shape.jpg", now()); Query OK, 1 row affected (0.05 sec) but is there a way to not specify the "10"... and just let each one be 11, 12, 13... ? I can do it using mysql> insert into gifts (name, filename, effectiveTime) -> values ("coffee", "coffee123.jpg", now()); Query OK, 1 row affected (0.00 sec) but the column names need to be all specified. Is there a way that they don't have to be specified and the auto increment of primary key still works? thanks.

    Read the article

  • Firebug's "net" tab is not showing anything?

    - by Jian Lin
    I usually run Fiddler for net traffic monitoring and now am using a Mac machine. I thought Firebug's net tab can show the traffic that is fetched through AJAX (the net tab is enabled). But if I try google.com, and type in something, its "google suggest" will show a bunch of suggestions, but the Firebug's "net" tab is not showing anything?

    Read the article

  • is there a rule in CSS that says class="one two" vs class="two one" and the second will override the

    - by Jian Lin
    Right now, there seems to be no such effect. Example: both divs are orange in color on Firefox <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style> .one { border: 6px dashed green } .two { border: 6px dashed orange } </style> </head> <body> <div class="one two"> hello world </div> <div class="two one"> hello world </div>

    Read the article

  • An exception to avoid copy and paste code?

    - by Jian Lin
    There are many files in our project that would call a Facebook api. And the call is complicated, spanning usually 8 lines or more, just for the argument values. In this case, we can make it into a function, and place that function in a common_library.php, but doing so would just change the name of the function call from the Facebook API function to our name, and we still need to repeat the 8 lines of arguments. Each time, the call is very similar, but with slight variations to the argument values. In that case, would copy and paste be needed no matter what we do?

    Read the article

  • One fix for all IE6 problems

    - by Victor
    Is there a one fix solution for all IE6 problems? One HTC/jQuery file that fixes IE6 problems like PNG, background position, hover, (even) rounded corners... I'm just tired to look for all fixes, test them and put them seperately.

    Read the article

  • First programming language: PHP, Ruby, Python?

    - by Victor
    I've been a Web developer for over 5 years and am looking to start building more complex Web apps. Currently, I know HTML/CSS/Javascript but I feel it's time to start learning something else. I work with a lot of applications based on PHP. I created a vBulletin forum on my own time and I would definitely want to build off of that since it has gained a bit of popularity. I also work with Wordpress quite often. All of the software I work with tends to be based on PHP but I hear a lot of people say Ruby or Python is better. Since I'm starting out, I really don't care which one I learn but I want to start right. Any recommendations for someone with HTML/CSS/Javascript knowledge but wants to branch out?

    Read the article

  • AppEngine: how do cursors work?

    - by victor a.k.a. python for ever
    hello, i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor = memcache.get('location_cursor') if last_cursor: loc_query.with_cursor(last_cursor) loc_result = loc_query.fetch(1) for loc in loc_result: self.record(loc, date) taskqueue.add( url='/task/query/simplegeo', params={'date':date, 'locid':loc.key().id()} ) if len(loc_result): memcache.add('location_cursor', loc_query.cursor()) taskqueue.add(url='/task/count/', method='GET') else: memcache.add('location_cursor', None) i don't know what i'm doing wrong, but i am getting the same cursor which is not the effect i wanted. why isn't the cursor moving?

    Read the article

  • Determining polygon intersection and containment

    - by Victor Liu
    I have a set of simple (no holes, no self-intersections) polygons, and I need to check that they don't intersect each other (one can be entirely contained in another; that is okay). I can check this by simply checking the per-vertex inside-ness of one polygon versus other polygons. I also need to determine the containment tree, which is the set of relationships that say which polygon contains any given polygon. Since no polygon can intersect any other, then any contained polygon has a unique container; the "next-bigger" one. In other words, if A contains B contains C, then A is the parent of B, and B is the parent of C, and we don't consider A the parent of C. The question: How do I efficiently determine the containment relationships and check the non-intersection criterion? I ask this as one question because maybe a combined algorithm is more efficient than solving each problem separately. The algorithm should take as input a list of polygons, given by a list of their vertices. It should produce a boolean B indicating if none of the polygons intersect any other polygon, and also if B = true, a list of pairs (P, C) where polygon P is the parent of child C. This is not homework. This is for a hobby project I am working on.

    Read the article

  • Problem in using a second call to send() in C

    - by Paulo Victor
    Hello. Right now I'm working in a simple Server that receives from client a code referring to a certain operation. The server receives this data and send back the signal that it's waiting for the proper data. /*Server Side*/ if (codigoOperacao == 0) { printf("A escolha foi 0\n"); int bytesSent = SOCKET_ERROR; char sendBuff[1080] = "0"; /*Here "send" returns an error msgm while trying to send back the signal*/ bytesSent = send(socketEscuta, sendBuff, 1080, 0); if (bytesSent == SOCKET_ERROR) { printf("Erro ao enviar"); return 0; } else { printf("Bytes enviados : %d\n", bytesSent); char structDesmontada[1080] = ""; bytesRecv = recebeMensagem(socketEscuta, structDesmontada); printf("structDesmontada : %s", structDesmontada); } } Following here is the client code responsible for sending the operation code and receiving the signal char sendMsg[1080] = "0"; char recvMsg[1080] = ""; bytesSent = send(socketCliente, sendMsg, sizeof(sendMsg), 0); printf("Enviei o codigo (%d)\n", bytesSent); /*Here the program blocks in a infinite loop since the server never send anything*/ while (bytesRecv == SOCKET_ERROR) { bytesRecv = recv(socketCliente, recvMsg, 1080, 0); if (bytesRecv > 0) { printf("Recebeu\n"); } Why this is happening only in the second attempt to send some data? Because the first call to send() works fine. Hope someone can help!! Thnks

    Read the article

  • What is the exact rule of jQuery's animate() parameters?

    - by Jian Lin
    jQuery 1.4.2's animate() API spec is .animate( properties, [ duration ], [ easing ], [ callback ] ) but it seems that we can supply duration, callback, and no easing .animate({left: '+= 100'}, 600, doThis) and it will work. But if we supply easing and callback and no duration .animate({left: '+=100'}, 'swing', doThis) then the easing won't be taken into effect. So what exactly is the API supposed to be?

    Read the article

  • In Ruby, why is a method invocation not be able to be treated as a unit when "do" and "end" is used?

    - by Jian Lin
    The following question is related to the question "Ruby Print Inject Do Syntax". My question is, can we insist on using do and end and make it work with puts or p? This works: a = [1,2,3,4] b = a.inject do |sum, x| sum + x end puts b # prints out 10 so, is it correct to say, inject is a class method of the Array class, which takes a block of code, and then returns a number. If so, then it should be no different from calling a function and getting back a return value: b = foo(3) puts b or b = circle.getRadius() puts b In the above two cases, we can directly say puts foo(3) puts circle.getRadius() so, there is no way to make it work directly by using the following 2 ways: a = [1,2,3,4] puts a.inject do |sum, x| sum + x end but it gives ch01q2.rb:7:in `inject': no block given (LocalJumpError) from ch01q2.rb:4:in `each' from ch01q2.rb:4:in `inject' from ch01q2.rb:4 grouping the method call using ( ) doesn't work either: a = [1,2,3,4] puts (a.inject do |sum, x| sum + x end) and this gives: ch01q3.rb:4: syntax error, unexpected kDO_BLOCK, expecting ')' puts (a.inject do |sum, x| ^ ch01q3.rb:4: syntax error, unexpected '|', expecting '=' puts (a.inject do |sum, x| ^ ch01q3.rb:6: syntax error, unexpected kEND, expecting $end end) ^ finally, the following version works: a = [1,2,3,4] puts a.inject { |sum, x| sum + x } but why doesn't the grouping of the method invocation using ( ) work in the earlier example? What if a programmer insist that he uses do and end, can it be made to work?

    Read the article

  • Recreation of DB using "mysql mydb < mydb.sql" is really slow when the table has tens of millions of

    - by Jian Lin
    It seems that a MySQL database that has a table with tens of millions of records will get a big INSERT INTO statement when the following mysqldump some_db > some_db.sql is done to back up the database. (is it 1 insert statement that handles all the records?) So when reconstructing the DB using mysql some_db < some_db.sql then the CPU is hardly busy (about 1.8% usage by the mysql process... I don't see a mysqld either?) and also the hard disk doesn't seem to be too busy... Last time, the whole restore process took 5 hours. Is there a way to make it faster? Such as, when doing mysqldump, can it break the INSERT statement into shorter ones, so that the mysql doesn't need to parse the line so hard when restoring the DB?

    Read the article

  • Entity Framework 4 code-only reference column name

    - by Victor
    I created classes: public class Country { public long CountryId {get;set;} public string CountryName {get;set;} } public class Profile { public long ProfileId {get;set;} public string ProfileName {get;set;} public Country Country {get;set;} } and configuration for Profile: public class ProfileConfiguration : EntityConfiguration<Profile> { public IlluminatiCoreProfileConfiguration() { Relation(p => p.Country); } } Then I create context and run context.CreateDatabase(). New database contains table Profiles with column Country_CountryId. How can I write configuration for changing column name to "CountryId"? Thanks.

    Read the article

  • 2-col layout, one col scrolls vertical, other is fixed. Both scroll horizontal.

    - by Victor P
    Im trying to do a 2 column layout where the left column is very long vertically, and the right column is very long horizontally. When I scroll vertically, I want to move up and down the left column while the right one stays fixed. When I scroll horizontally, both columns move left-right (normal behaviour) I hope this drawing explain it more (sorry for the bad quality): Is this possible to do using only css? If not, how can I do it with javascript? Thanks

    Read the article

  • In Ruby, why does a method invocation not be able to be treated as a unit when "do" and "end" is use

    - by Jian Lin
    The following question is related to http://stackoverflow.com/questions/2127836/ruby-print-inject-do-syntax The question is, can we insist on using DO and END and make it work with puts or p? This works: a = [1,2,3,4] b = a.inject do |sum, x| sum + x end puts b # prints out 10 so, is it correct to say, inject is a class method of the Array class, which takes a block of code, and then returns a number. If so, then it should be no different from calling a function and getting back a return value: b = foo(3) puts b or b = circle.getRadius() puts b In the above two cases, we can directly say puts foo(3) puts circle.getRadius() so, there is no way to make it work directly by using the following 2 ways: a = [1,2,3,4] puts a.inject do |sum, x| sum + x end but it gives ch01q2.rb:7:in `inject': no block given (LocalJumpError) from ch01q2.rb:4:in `each' from ch01q2.rb:4:in `inject' from ch01q2.rb:4 grouping the method call using ( ) doesn't work either: a = [1,2,3,4] puts (a.inject do |sum, x| sum + x end) and this gives: ch01q3.rb:4: syntax error, unexpected kDO_BLOCK, expecting ')' puts (a.inject do |sum, x| ^ ch01q3.rb:4: syntax error, unexpected '|', expecting '=' puts (a.inject do |sum, x| ^ ch01q3.rb:6: syntax error, unexpected kEND, expecting $end end) ^ finally, the following version works: a = [1,2,3,4] puts a.inject { |sum, x| sum + x } but why doesn't the grouping of the method invocation using ( ) work? What if a programmer insists that he uses do and end, can it be made to work directly with p or puts, without an extra temporary variable?

    Read the article

  • In Javascript, is it true that function aliasing works as long as the function being aliased doesn't

    - by Jian Lin
    In Javascript, if we are aliasing a function, such as in: f = g; f = obj.display; obj.f = foo; all the 3 lines above, they will work as long as the function / method on the right hand side doesn't touch this? Since we are passing in all the arguments, the only way it can mess up is when the function / method on the right uses this? Actually, line 1 is probably ok if g is also a property of window? If g is referencing obj.display, then the same problem is there. In line 2, when obj.display touches this, it is to mean the obj, but when f() is invoked, the this is window, so they are different. In line 3, it is the same: when f() is invoked inside of obj's code, then the this is obj, while foo might be using this to refer to window if it were a property of window. (global function). So line 2 can be written as f = function() { obj.display.apply(obj, arguments) } and line 3: obj.f = function() { foo.apply(window, arguments) } Is this the correct method, and are there there other methods besides this?

    Read the article

  • delete multi-line block of text with internal flag in povray file

    - by Sibo Lin
    I have a pov-ray file, which defines a lot of cylinders and spheres. Sometimes these shapes are defined to have "color@", which makes the povray unrenderable. One solution I've found is to delete the offending cylinders and spheres. So a file that contains this text cylinder { < -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716 texture { colorO } } sphere { < -0.00950, 0.00357, 0.00227>, 0.00716 texture { color@ } } cylinder { < -0.00950, 0.00357, 0.00227>, < 0.00327, 0.00169, 0.00108>, 0.00716 texture { color@ } } sphere { < 0.15373, 0.00601, 0.18223>, 0.00716 texture { colorO } } would turn into this text cylinder { < -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716 texture { colorO } } sphere { < 0.15373, 0.00601, 0.18223>, 0.00716 texture { colorO } } Is there some way to do this replacement with a shell script? Preferably in tcsh. Thanks!

    Read the article

  • Heroku in real life apps

    - by Victor P
    What is your experience using Ruby on Rails on Heroku in production mode? Apart of the issue of the expensive https, do you see any drawback in the way it manages processes, memory and storage? The people at Heroku is quite nice and I'm sure they are willing to answer my questions, but I would like some opinions in the customer side.

    Read the article

  • In Ruby on Rails, routes.rb, if map.something will create something_path and something_url, does map

    - by Jian Lin
    In Ruby on Rails, routes.rb, if we create a "named route" map.something ":a/:b", :controller => 'foobar' it will also create something_path and something_url which are two methods usable in the controller and in the view. Does map.connect create something like that too? Otherwise, isn't map.connect somewhat disadvantaged in this way? I checked that connect_path and connect_url both aren't created automatically.

    Read the article

  • In HAML on Ruby on Rails, how to use the :sass filter?

    - by Jian Lin
    If using HAML on Ruby on Rails, then :sass #someDiv border: 3px dashed orange won't have any <style> tag around them. and then :css :sass #someDiv border: 3px dashed orange won't kick on the :sass filter, but :css :sass #someDiv border: 3px dashed orange will kick on the :sass filter, but it is outside of the <style> tag. So how can the :sass filter be used?

    Read the article

  • JSP 2.0 SEO friendly links encoding

    - by victor hugo
    Currently I have something like this in my JSP <c:url value="/teams/${contact.id}/${contact.name}" /> The important part of my URL is the ID, I just put the name on it for SEO purposes (just like stackoverflow.com does). I was just wondering if there is a quick and clean way to encode the name (change spaces per +, latin chars removal, etc). I'd like it to be like this: <c:url value="/teams/${contact.id}/${supercool(contact.name)}" /> Is there a function like that out there or should I make my own?

    Read the article

  • div "top" bug IE and everything else. Big problem

    - by Victor
    Hi everyone. I am new in CSS so please help me in this problem. I hope to describe it wright. I am making div named content where my site content is. I made it with z-index:-1; so an image to be over this div. But in Chrome, FF and safari, content became inactive. I cant select text , click on link and write in the forms. So I tried with positive states in the z-index but IE don't know what this means. Damn. So I decided to make conditional div. Here is the code: .content { background:#FFF; width:990px; position:relative; float:left; top:50px; } .content_IE { background:#FFF; width:990px; position:relative; float:left; top: 50px; z-index:-1; } and here is the HTML: <!--[if IE 7]> <div class="content_IE" style="height:750px;"> <![endif]--> <div class="content" style="height:550px;"> Everything is fine with the z-index but the problem is that if there is no top in .content class everything looks fine in IE but there is no space in the other browsers. If i put back the top:50px; there onother 50px like padding in the .content_IE class. I mean that the page looks like I've put top:50px; and padding-top=50px;. I've try everything like margin-top:-50px; padding-top:-50px; and stuff like this but I am still in the circle. It look fine only if there is no top option in .content class. Please help.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >