Posts

string - Split when character changes in Python -

Then I have this string. / Code> so that I can replace 6 = M or 666 = O or 9 = W just like the phone's dial pad. 6 # 666 # 665533999 -> 6, 666, 66, 55, 33, 999 so I used to remove # split ('#') > And it does not understand what to do next. I have tried the methods of brute force which solves it to some extent, but is it easy or more elegant solution? Use: & gt; & Gt; & Gt; C = "6 # 666 # 665533999"> gt; & Gt; & Gt; ("6", '666', '66', '55', '33', '999 '] ["". Then there is a dictionary which MAP for a character in the dial pad. cmap = {'77': 'Q' '9999': 'z') #and further ...

Setting Loading Message duration in Jquery Mobile -

I get jQuery mobile $ The user using the mobile.loading () method, I am also using a function: function show_screen_msg (msg) {$ .mobile.loading (' Show ', (text: msg, text, visual: truth, text: true}); } Show_screen_msg ('OK'); For example, when the user updates my profile on the database, I use it; I want to set the time the message is displayed on the screen. Can someone help me? Thank you You can set this function as defined by Omar. But generally we use the functionality of this loading to keep the users waiting for all back end network delays and operations. I think that you are running at the local level so you are not seeing these delays, so specifying a clear timeout function is probably not the best thing you want. For example, if you use AJAX requests to update the database to update, get the feedback back and hide it from loading the success. $ Ajax ({type: "POST", url: "some.php", data: {name: "John", locati...

c# - Microdata & ASP.NET -

I am currently adding microde to an existing C # ASP.NET MVC3 project. Stack overflow here, I got an answer for a question called "" "Kuchi Jerimba. He provides a very good visual studio solution to connect HTML5 5DMD in an application using metadata providers, which I am able to integrate and use in my solution. My question is, does anyone know that something like this exists in the form of a structure or NuGet package? I have seen in NewGate and see only two such packages which are for webapp projects. Thanks, Philip "try MXTires Microdata .NET" NuGet package If you use defined sections there, then call them tojson-ld by calling the TOGEASION method. For example: var offer = new offer () {name = "helper for your car.", Availability = item availability. InStock,}; offer.ToJason (); The result should be like this: & lt; Script type = "application / ld + json" & gt; {"Availability": "http: /schem...

serversocket - Building a chat server using Amazon EC2 -

I am working on creating chat servers using simple sockets. I was thinking that this is a basic chat server It is possible to make use of the Dragon Socket Server Library and an Amazon ec2 example. Also, if you have any better recommendations please let me know You use Amazon EC 2 server can facilitate communication from server to server. Depending on how you open the socket, you may need to configure your EC2 instances to listen to incoming connections on some ports; To allow inbound connections, see more details about how to modify your server's security settings. As far as alternative recommendations are there, I have a real-time network like PubNub relay data between your chat client and server. Using real-time networks means that you can spend less time thinking about low-level socket issues such as Concurrency and creating your application. In the case of PubNub, your server will be allowed to subscribe to chat channels, while it can work better for any web-b...

c# - Adding a circular button to a Windows Form -

I have created a round button in a windows form. The button is fine. The only problem is that I want a different color for the background, so I'm setting up Bangalore in GoldenRoad. However, it only creates a "goldenrod" cube around the circular button ... how do I make it, so that only the button becomes colored? Public Mainstream () {Initial Group (); MyButtonObject start = new myButtonObject (); EventHandler My Handler = New Event Handler (Startcall); Start.Click + = myHandler; Start.Location = New system. Drawing Points (5, 5); Start.Size = New System Drawing. Size (101, 101); Start.BackColor = System.Drawing.Color.Goldenrod; This.Controls.Add (start); `} Zero start_Click (Object Sender, System.EventArgs e) {MessageBox.Show (" Start "); } Public category myButtonObject: UserControl {// Draw new button. Secure Override Zero OnPaint (PaintEventArgs E) {Graphics Graphics = E. Graphics; Pen myPen = new pen (color black); // Draw a button as a circle graph...

php - What is 'module_number' as argument to zend_register_list_destructors_ex -

I am writing a php extension and need to register a resource. I have read how to do this and read all the examples. module_number Zend_register_list_destructors_ex (NULL, NULL, DESCRIPTOR_NAME, module_number); There is no document given to me that what is 'module_emember' I tried to use that call in my call in the function and I got the following error: The last argument of the function call is considered or the' module_member ' Or are using all other examples? Thanks in advance. zend_register_list_destructors_ex should should be called inside a PHP_MINIT function. Your Extension If you see the macro definition for PHP_MINIT, its extension int zm_startup _ # # module (int Type, int module_number TSRMLS_DC) with the # # module is the string name of your module module_number is a integer engine Has been passed in the startup function The number of that module is the ID that PHP remains internally to recognize the extension when it is...

c# - How to call different JQuery functions from a dropdownlist? -

How do you tie each item in a dropdown list to a different JQuery function? For example, I have a dropdown with different report names, I want to select drop down to trigger a new report to display every time. I already sent it to & lt; A href = "#" Id = "btnReport1"> Report 1 which is called $ ("# btnReport1"). Bind ("click", Function () {...} I want to call the same function above each separate report item in the dropdown list. 5 Or I will need to call either. Is there a way to embed a link, am I using "Change" in some way on "Click"? I am using Razor and MVC .Net I can do something like @ html. Dropdown list (...) with a selectList object and code is inserted in the controller file if needed. But I prefer to handle HTML though . As you are trying to bind with the select dropdown, this is the best way to accomplish this. On Change () Handler (for details). From there, you will decide that the...