Daily Archives

Articles indexed Sunday March 28 2010

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

  • Problem with Chrome - embed windows media player

    - by nicolas
    Hi. I am having a problem. I embed WMP in my page, and I need to hide buttons from player. I make it to hide them in IE and FF, but I can't make it happen in Google Chrome. Here is the code <object id="MediaPlayer1" width="690" height="500" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" > <param name="FileName" value='<%= GetSource() %>' /> <param name="AutoStart" value="True" /> <param name="DefaultFrame" value="mainFrame" /> <param name="ShowStatusBar" value="0" /> <param name="ShowPositionControls" value="0" /> <param name="showcontrols" value="0" /> <param name="ShowAudioControls" value="0" /> <param name="ShowTracker" value="0" /> <param name="EnablePositionControls" value="0" /> <!-- BEGIN PLUG-IN HTML FOR FIREFOX--> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src='<%= GetSource() %>' align="middle" width="600" height="500" defaultframe="rightFrame" id="MediaPlayer2" /> </object> and in the JS in a method i do var player = document.getElementById("MediaPlayer2"); player.uiMode="none"; to hide buttons in FF, but seems that not work for Chrome.

    Read the article

  • Wordpress SQL Select Multiple Meta Values / Meta Keys / Custom Fields

    - by Wes
    I am trying to modify a wordpress / MySQL function to display a little more information. I'm currently running the following query that selects the post, joins the 'postmeta' and gets the info where the meta_key = _liked function most_liked_posts($numberOf, $before, $after, $show_count) { global $wpdb; $request = "SELECT ID, post_title, meta_value FROM $wpdb->posts, $wpdb->postmeta"; $request .= " WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id"; $request .= " AND post_status='publish' AND post_type='post' AND meta_key='_liked' "; $request .= " ORDER BY $wpdb->postmeta.meta_value+0 DESC LIMIT $numberOf"; $posts = $wpdb->get_results($request); foreach ($posts as $post) { $post_title = stripslashes($post->post_title); $permalink = get_permalink($post->ID); $post_count = $post->meta_value; echo $before.'<a href="' . $permalink . '" title="' . $post_title.'" rel="nofollow">' . $post_title . '</a>'; echo $show_count == '1' ? ' ('.$post_count.')' : ''; echo $after; } } The important part being: $post_count = $post->meta_value; But now I want to also grab a value that is attached to each post called wbphoto How do I specify that $post_count = _liked and $photo = wbphoto ? Here is a screen cap of my Phpmyadmin

    Read the article

  • Windows 2003 Cluster: Failover Delay

    - by Ramon Marco Navarro
    I am testing the failover policies of our test failover cluster system. When I shutdown the node who is currently controlling the cluster (NODE1), it takes about 2 mins and 40 seconds before the next node on the preferred list (NODE2) takes control of the cluster. I tried changing the looksAlive and isAlive interval to 5000ms to all resources, but that didn't help. Looking at the Event Viewer of the remaining nodes, it shows that it was almost instantly detected that NODE1 was down. But it took another ~2:40 minutes for it to be removed from the live cluster list and for NODE2 to take over. Is there anyway of changing or shortening this "failover delay"? This is the setup of the cluster: (1) One ClusterDC connected to the public network (3) Three nodes running Win2003 with a quorum type of MNS Private network is connected to network hub ________________ _________________ (ClusterDC)=------=| |=------=(Node1)=------=| | |Public Network|=------=(Node2)=------=|Private Network| | (Switch) |=------=(Node3)=------=| (Hub) | ---------------- -----------------

    Read the article

  • jQuery draggable + droppable: how to snap dropped element to dropped-on element

    - by 10goto10
    I have my screen divided into two DIVs. In the left DIV I have a few 50x50 pixel DIVs, in the right DIV I have an empty grid made of 80x80 LIs. The DIVs on the left are draggable, and once dropped on a LI, they should snap to center of that LI. Sounds simple, right? I just don't know how to get this done. I tried by manipulating the dropped DIV's top and left CSS properties to match those of the LI they're dropped into, but the left and top properties are relative to the left DIV. How can I best have the dropped element snap to the center of the element it's dropped into? That's gotta be simple, right? Edit: I'm using jQuery UI 1.7.2 with jQuery 1.3.2. Edit 2: For whoever else has this problem, this is how I fixed it: I used Keith's solution of removing the dragged element and placing it inside the dropped-on element in the drop callback of the droppable plugin: function gallerySnap(droppedOn, droppedElement) { $(droppedOn).html('<div class="drop_styles">'+$(droppedElement).html()+'</div>' ); $(droppedElement).remove(); } I don't the dropped element to be draggable again, but if you do, just bind draggable to it again. For me this method also solved the problem I had when positioning the dropped elements (which would be relative to the left DIV) and scrolling inside the second DIV. (Elements would remain fixed on page, now they scroll along). I did play with the snap options to make it look good while dragging, so thanks to karim79 for that suggestion. I probably won't win any Awesome Code prizes with this, so if you see room for improvement, please share!

    Read the article

  • moving a sprite causes jerky movement

    - by mac_55
    I've got some jerky movement of my sprite. Basically, when the user touches a point on the screen, the sprite should move to that point. This is working mostly fine... it's even taking into account a delta - because frame rate may not be consistant. However, I notice that the y movement usually finishes before the x movement (even when the distances to travel are the same), so it appears like the sprite is moving in an 'L' shape rather than a smooth diagonal line. Vertical and horizontal velocity (vx, vy) are both set to 300. Any ideas what's wrong? How can I go about getting my sprite to move in a smooth diagonal line? - (void)update:(ccTime)dt { int x = self.position.x; int y = self.position.y; //if ball is to the left of target point if (x<targetx) { //if movement of the ball won't take it to it's target position if (x+(vx *dt) < targetx) { x += vx * dt; } else { x = targetx; } } else if (x>targetx) //same with x being too far to the right { if (x-(vx *dt) > targetx) { x -= vx * dt; } else { x = targetx; } } if (y<targety) { if (y+(vy*dt)<targety) { y += vy * dt; } else { y = targety; } } else if (y>targety) { if (y-(vy*dt)>targety) { y -= vy * dt; } else { y = targety; } } self.position = ccp(x,y); }

    Read the article

  • MongoMapper won't let me create an object

    - by Jade
    I'm just learning MongoDB and MongoMapper. This is on Rails 3. I created a blog in app/models/blog.rb: class Blog include MongoMapper::Document key :title, String, :required => true key :body, Text timestamps! end I go into the Rails console: rails c Loading development environment (Rails 3.0.0.beta) ruby-1.9.1-p378 > **b = Blog.new** NoMethodError: undefined method `from_mongo' for Text:Module from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/keys.rb:323:in `get' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/keys.rb:269:in `read_key' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/keys.rb:224:in `[]' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/inspect.rb:7:in `block in inspect' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/inspect.rb:6:in `collect' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/mongo_mapper-0.7.2/lib/mongo_mapper/plugins/inspect.rb:6:in `inspect' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/rails/commands/console.rb:47:in `start' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/rails/commands/console.rb:8:in `start' from /Users/jade/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/rails/commands.rb:34:in `<top (required)>' from /Users/jade/code/farmerjade/script/rails:10:in `require' from /Users/jade/code/farmerjade/script/rails:10:in `<main>' Am I overlooking something really dumb, or is this something in my setup? I'm using the mongo_mapper version you get by adding it to your Gemfile, so I'm wondering if it might be that. I'd appreciate any suggestions!

    Read the article

  • How to determine visibility in 2D

    - by Jack
    Hello, I'm developing an AI sandbox and I would like to calculate what every living entity can see. The rule is to simply hide what's behind the edges of the shapes from the point of view of the entity. The image clarifies everything: I need it either as an input to the artificial intelligence either graphically, to show it for a specific entity while it moves.. Any cool ideas?

    Read the article

  • java: can I convert strings to byte arrays, without a BOM?

    - by Cheeso
    Suppose I have this code: String encoding = "UTF-16"; String text = "[Hello StackOverflow]"; byte[] message= text.getBytes(encoding); If I display the byte array in message, the result is: 0000 FE FF 00 5B 00 48 00 65 00 6C 00 6C 00 6F 00 20 ...[.H.e.l.l.o. 0010 00 53 00 74 00 61 00 63 00 6B 00 4F 00 76 00 65 .S.t.a.c.k.O.v.e 0020 00 72 00 66 00 6C 00 6F 00 77 00 5D .r.f.l.o.w.] As you can see, there's a BOM in the beginning. How can I: generate a UTF-16 byte array that lacks a BOM, from a string? convert from a byte array that contains UTF-16 chars but lacks a BOM, back to a string?

    Read the article

  • actionscript array remove element

    - by Naro
    I have an array Items which has 10 elements. I need to remove the 5th element (index=4) the new array should have 9 elements and all elements after the 5th element will be shifted forward what command(s) should i use?

    Read the article

  • java updating text area

    - by n0ob
    for my application I have to build a little customized time ticker which ticks over after whatever delay I tell it to and writes the new value in my textArea. The problem is that the ticker is running fully until the termination time and then printing all the values. How can I make the text area change while the code is running. while(tick<terminationTime){ if ((System.currentTimeMillis()) > (msNow + delay)){ msNow = System.currentTimeMillis(); tick = tick + 1; currentTime.setText(""+tick); sourceTextArea.append(""+tick+" " + System.currentTimeMillis() +" \n"); } currentTime and sourceTextArea are both text areas and both are getting updated after the while loop ends.

    Read the article

  • How can I round money values to the nearest $5.00 interval?

    - by Frank Developer
    I have an Informix-SQL based Pawnshop app which calculates an estimate of how much money should be loaned to a customer, based on the weight and purity of gold. The minimum the pawnshop lends is $5.00. The pawnshop employee will typically lend amounts which either ends with a 5 or 0. examples: 10, 15, 20, 100, 110, 125, etc. They do this so as to not run into shortage problems with $1.00 bills. So, if for example my system calculates the loan should be: $12.49, then round it to $10, $12.50 to $15.00, $13.00 to $15.00, $17.50 to $20.00, and so on!..The employee can always override the rounded amount if necessary. Is it possible to accomplish this within the instructions section of a perform screen or would I have to write a cfunc and call it from within perform?.. Are there any C library functions which perform interval rounding of money values?.. On another note, I think the U.S. Government should discontinue the use of pennies so that businesses can round amounts to the nearest nickel, it would save so much time and weight in our pockets!

    Read the article

  • How to serialize parameters in Web Service method

    - by Georgi
    Hi, I have this problem. I have WCF .Net C# web service with this method: public interface IMyService { // TODO: Add your service operations here [OperationContract] ListOfRequests GetListOfRequests(string par1, string par2, string par3, DateTime par4, DateTime par5, string par6, string par7); } public class MyService : IMyService { public ListOfRequests GetListOfRequests(string par1, string par2, string par3, DateTime par4, DateTime par5, string par6, string par7) { // .... web method code here; } } The problem is that when I generate the web service the wsdl schema return this: <xs:element name="GetListOfRequests"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="par1" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="par2" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="par3" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="par4" type="xs:dateTime" /> <xs:element minOccurs="0" name="par5" type="xs:dateTime" /> <xs:element minOccurs="0" name="par6" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="par7" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> and I want my parameters to be not null like this: <xs:element name="GetListOfRequests"> <xs:complexType> <xs:sequence> <xs:element minOccurs="1" name="par1" nillable="false" type="xs:string" /> <xs:element minOccurs="1" name="par2" nillable="false" type="xs:string" /> <xs:element minOccurs="1" name="par3" nillable="false" type="xs:string" /> <xs:element minOccurs="1" name="par4" type="xs:dateTime" /> <xs:element minOccurs="1" name="par5" type="xs:dateTime" /> <xs:element minOccurs="1" name="par6" nillable="false" type="xs:string" /> <xs:element minOccurs="0" name="par7" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> How can I serizalize parameters to achieve this? Thank you in advance for your help. Regards, Georgi

    Read the article

  • ODP.NET Code Example Critque or best practices

    - by andrewWinn
    I currently have a DataAccess Layer in Vb.Net. I am not too happy with my implementation of both my ExecuteQuery (as DataSet) and ExecuteNonQuery functions. Does anyone have any code that I could see? My code just doesn't look clean. Any thoughts or critiques on it would be appreciated also. Using odpConn As OracleConnection = New OracleConnection(_myConnString) odpConn.Open() If _beginTransaction Then txn = odpConn.BeginTransaction(IsolationLevel.Serializable) End If Try Using odpCmd As OracleCommand = odpConn.CreateCommand() odpCmd.CommandType = CommandType.Text odpCmd.CommandText = sSql For i = 0 To parameters.Parameters.Count - 1 Dim prm As New OracleParameter prm = DirectCast(parameters.Parameters(i), ICloneable).Clone odpCmd.Parameters.Add(prm) Next If (odpConn.State = ConnectionState.Closed) Then odpConn.Open() End If iToReturn = odpCmd.ExecuteNonQuery() If _beginTransaction Then txn.Commit() End If End Using Catch txn.Rollback() End Try End Using

    Read the article

  • SharePoint MOSS Approve/Reject button customisation

    - by 78lro
    It seems that the out of the box approve/reject buttons in SharePoint CMS try to direct you to an InfoPath form. We have implemented custom .aspx pages that we use for our workflow approval process and would like it to show these when a user clicks the buttons. Currently we get an error that the formURN cannot be found. Can I affect the url that is shown when the approve/reject buttons are clicked or Can I hide those buttons and provide my own buttons/functionality for that purpose Thanks for any suggestions

    Read the article

  • Why does the Combo.SelectedValue get lost after some time

    - by tzup
    So I have this asp:DropDownList on a page. It renders like this (in IE7): <select name="ctl00$cphFilter$cbLista" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphFilter$cbLista\',\'\')', 0)" id="ctl00_cphFilter_cbLista" class="agsSelect"> <option selected="selected" value="4350">A</option> <option value="4352">B</option> <option value="4349">C</option> <option value="4348">D</option> And then I have a grid and a button on the same page. When the user clicks the button the selected item of the dropdown is read (well a datasource object reads it) and the grid does a databind after a trip to a DB where it gets some data based on that selected value. This works fine most of the time. However sometimes, the selection in the dropdownlist seems to get lost even though the rendered page says the A is the selected item. The datasource object is defined like this: <asp:ObjectDataSource ID="dsVM" runat="server" EnablePaging="False" SelectMethod="Select" SortParameterName="sort" TypeName="X.Business.Entities.LPVM.BE"> <SelectParameters> <asp:ControlParameter Name="listaId" Type="Int32" ControlID="cphFilter$cbLista" PropertyName="SelectedValue" /> </SelectParameters> </asp:ObjectDataSource> Any ideas why the grid would reload its data with a select parameter that is 0 instead of the selected value of the dropdownlist? EDIT Suppose the dropdownlist is bound, the user selected B and the grid is bound as well and shows the right data. Now, I wait 2 minutes and I click the Refresh button. Surprisingly, at this particular moment the dropdownlist.SelectedValue (which I already know it was 4352 before I clicked because that's how it looks in the rendered page) is actually an empty string. Where did the value go?

    Read the article

  • Debugging ASP.NET Strings Downloaded to Browser (Montréal instead of Montréal)

    - by jdk
    I'm downloading a vCard to the browser using Response.Write to output .NET strings with special accented characters. Mime type is text/x-vcard and French characters are appearing wrong in Outlook, for example Montréal;Québec .NET string shows as Montréal Québec in browser. I'm using this vCard generator code from CodeProject.com I've played with the System.Encoding sample code at the bottom of this linked MSDN page to convert the unicode string into bytes and then write the ascii bytes but then I get Montr?al Qu?bec (progress but not a win). Also I've tried setting content type to both us-ascii and utf-8 of the response. If I open the downloaded vCard in Windows Notepad and save it as ANSI text (instead of default unicode format) and open in Outlook it's okay. So my assumption is I need to cause download of ANSI charset but am unsure if I'm doing it wrong or have a misunderstanding of where to start. Update: Looking at the raw HTTP, it appears my French characters are being downloaded in the unexpected format so it looks like I need to do some work on the server side... (full size)

    Read the article

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