Monday, 15 July 2013

regex - Perl regular expression to grep for a word after specific pattern -


मेरे पास एक चर के लिए निम्न पंक्ति है:

  "[कुछ सामग्री] NAME : सरण्य "  

मैं इस शब्द के बाद एक शब्द के लिए grep कैसे कर सकता हूं?

एक सरल कैप्चर आपकी आवश्यकताओं के अनुरूप हो सकता है हालांकि यह काफी स्पष्ट नहीं है कि आपका क्या मतलब है।

  मेरे ($ शब्द) = $ string = ~ / \ Q [कुछ सामग्री] NAME: saranyya \ E (। +) /;   

\ क्यू .. \ ई से बचने से आपके रीजेक्स के अंदर मेटा अक्षर [] के उपयोग की अनुमति होगी। आपके पैटर्न के बाद का कोई भी पाठ कैप्चर और $ शब्द को सौंपा जाएगा।

c# - ASP Dropdown list not changing the value -


First of all, I still find me down my web god I so posts, blogs, newsgroups and stacks of articles I have been working through and I am unable to fix my problem. This is similar to at least 10 different positions seen by me.

I have an ASP gridview, which acts as a demonstration and a select column. When you click on the selection, it throws the data in the description view. I have a field that needs to be a drop down box, but whenever I change the value and update the value that is sent to the command The original value is

Page Markup:

  & asp: TemplateField HeaderText = "Planner Name" & gt; & Lt; ItemTemplate & gt; & Lt; / ItemTemplate & gt; & Lt; EditItemTemplate & gt; & Lt; ASP: DropDownList ID = "cboCurrentPlanner" runat = "server" DataSourceID = "plannerDataSource" DataTextField = "planner_name" DataValueField = "planner_id" SelectedValue = '& lt;% # Eval ( "planner_id")% & gt;' AutoPostBack = "true" & gt; & Lt; / Asp: DropDownList & gt; & Lt; / EditItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; Asp: CommandField ShowEditButton = "True" /> & Lt; / Fields & gt; & Lt; FooterStyle BackColor = "#CCCC99" ForeColor = "Black" /> & Lt; HeaderStyle BackColor = "# 333333" font-bold = "true" ForeColor = "white" /> & Lt; PagerStyle BackColor = "White" ForeColor = "Black" HorizontalAlign = "Right" /> & Lt; / ASP: DetailsView & gt;   

SQLDataSource:

  SelectCommand = "vendor_key, vendor, Planner_name, road, select the city, State_country, Planner_id, country V_MAP_MarkerInfo where (vendor_key = @vender_ke) "Updtkmnd =" Map_usp_vebpdteplantovendor "Updtekmmandeepe =" Storedprosedure "Onupdting =" Mpdaetalsurs_updting "& gt; & Lt; SelectParameters & gt; & Lt; Asp: ControlParameter ControlID = "GridView1" name = "vendor_key" property name = "selected value" type = "int32" /> & Lt; / SelectParameters & gt; & Lt; UpdateParameters & gt; & Lt; Asp: parameter name = "vendor_key" type = "string" /> & Lt; Asp: parameter name = "planner_id" type = "int 32" /> & Lt; Asp: parameter name = "vendor" type = "string" / & gt; & Lt; / UpdateParameters & gt; & Lt; / ASP: SQLDataSource & gt; & Lt; ASP: SQLDataSource id = "plannerDataSource" runat = "server" ConnectionString = "& LT;% $ ConnectionStrings: vendor_mapConnectionString% & gt;" Select [MAP_planners] from SelectCommand = OldValuesParameterFormatString = "original_ {0}" & gt; [planner_id] [planner_name] "; & Lt; / ASP: SQLDataSource & gt;   

I will not post the stored procedure code, I know that it is working. The original value makes it easy for the price parameter only

I have tried all kinds of combinations of and ### Bind / eval ()% & gt; Postbacks But I'm not getting the right combination.

When I click on the selection, I want the current planner to be selected in the dropdown list. When I select a new Planner and click Update, I would like Planner to update. I am not sure why this is so difficult or I have made it difficult for this, but I am at the end of my mind, if possible, I would like to know what is happening and not just that magical line code Which does this work.

There is a particular badge.

EDITS: Wustaitianbag ટેડ = "true" has been added to the dropdown list, selected index has changed event is firing

Re-edit: & lt; Asp: ControlParameter & gt; DetailsView1_OnDataBind and MapDataSource1_updating and the value is in all places but I do not know why it is being reset. Set to EnableViewState = "false"

@ Control or @ Page settings? If visibility is not enabled, the control will always be the default value as the selected value. It can be set at the ASPX level or SSCX level.



Python progress bar and downloads -


I have a dragon script that launches a URL that is downloadable file. Is there any way to use the command line to download the python to oppose the browser launch?

Updated to your sample url:

To scrap a PDF, just a simple (slightly hacked) approach is written. Note that this works correctly only on Unix-based systems (Linux, Mac OS) because PowerShell "\ r"

  link = "http: // indy / abcde1245" file_name = F: Print "Downloading% s"% file_name response = requests.get (link, stream = true) total_length = response.headers.get ('content-length') if the file: "" (file_name, "wb"). Total_length None: # no content length header f.write (response.content) else: dl = 0 total_length = int (total_length) for data in feedback.iter_content (chunk_size = 4096): dl + = len (data) f .write (data) done = int (50 * dl / total_length) sys.stdout.write ("\ r [% s% s]"% ('=' * done, '' * (50-made))) Sys.stdout. Flush ()   

It uses it so that you can install it. This is similar to the following in your console:

& gt; Downloading DataData

& gt; [=============]

The progress bar script has a width of 52 characters (2 characters are only [] therefore 50 characters of progress). Represents 2% of each = download.

javascript - Resize parent element when inner one is dragged. (jqueryUI draggable) -


When the #right element is drawn, Parents want to change shape My example works incorrectly and I have failed to understand why any signal to fix it?

Just in case, what I'm trying to do here is to make a resizable scroll similar to that. But for now, I'm just interested in the right element.

The simplest solution is as follows (note # left and #right changes in SCSS):

SCSS:

  # container {width: 500px; Height: 100 pixels; Background: #F9F9F9; } # Nav {width: 100px; Height: 100 pixels; Background: # E9799; Cursor: move; } #left {width: 10px; Height: 100 pixels; Status: Completed; Top: 0; Left: 0px; Background: # A9A9A9; Cursor: W-resize; & Amp ;: Hover {background: # 999; }} #wright {width: 10px; Height: 100 pixels; Status: Completed; Top: 0; Correct: 0px; Background: # A9A9A9; Cursor: changing the e-shape; & Amp ;: Hover {background: # 999; }}   

Javascript:

  var cont = $ ("# container") var nav = $ ("# nav") var left = $ ( "# Left") var correct = $ ("# right") nav.draggable ({prevention: cont}); Right.draggable ({prevention: cont, drag: function (e, ui) {nav.width (ui.position.left);}});   

The only problem was that you were getting very fancy with your javascript. All the information you needed in Ui.position.left was what I did, the content was changed from floating to position: absolute;

c - Stuck on linked list exercise -


I wrote this function that creates nodes.

When I add only one node, the program works, but if I add another node I get a split mistake, so obviously the problem is "second" of "add_node ()" Is in the part, but I can not understand it

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Typedf Structure node {four * city; Structure node * next; } Node; Node * start = null; Node * on; Zero add_node (char * cityname) {node * y = molok (node)); Y-> city = city name; Y-> gt; Next = null; Current = start; If (start == tap) {start = y; } And {while (current! = Null) {current = current-> next; } Current-> Next = y; }} Int main () {add_node ("Paris"); Add_node ("London"); Current = start; While (current! = Null) {printf ("% s \ n", current-> city); Current = current-> next; }}    

You have a loop that is current Takes the tap up ... then you set the current-> to y , but current is essentially zero.

A simple way to fix this is to change the loop

  (current-> next! = Null) {  

I also note that you should avoid the global current should be a local variable and start should be a parameter ... and I just call it list Call because it reflects that it should return the value (possibly new) to add_node to list .

php - How refresh the page in post method -


मैं वसा रहित PHP ढांचे का उपयोग करता हूं

PHP:

  F3 :: मार्ग ( 'पोस्ट / वोट', function () {वैश्विक $ टहनी, अगर (isset ($ _ प्राप्त [ 'studentKey']) ) {$ studentKey = $ _GET [ 'studentKey']; // Ð²Ñ ?? Ð ± Ð¾Ñ ?? кР° आईडी n ?? Ñ ?? Ñ ?? Ð'ÐμÐ½Ñ ?? Ð ° $ SELECT_student_Id = "का चयन करें पहचान की ID कहां studentKey = '$ studentKey' "; डीबी :: एसक्यूएल ($ SELECT_student_Id); $ studentId = F3 :: ( 'DB- & gt; परिणाम'); मिल // Ð²Ñ ?? Ð ± Ð¾Ñ ?? кР° आईडी п Ñ ​​?? ÐμпоÐ'Ð ° вР° N ?? ÐμÐ »एन ?? $ SELECT_teacher_Id = $ studentId [0] [ 'आईडी']" kbinding कहां idStudent = से idPrep का चयन करें। "; डीबी :: एसक्यूएल ($ SELECT_teacher_Id ); $ teacherId = F3 :: प्राप्त ( 'DB- & gt; परिणाम'); गूंज $ twig- & gt; प्रस्तुत करना ( 'vote.html', सरणी ( 'आईडी' = & gt; $ studentId [0] [ 'आईडी' ], 'teacherId' = & gt; $ teacherId [0] [ 'idPrep']));} else {$ twig- & gt गूंज;, प्रस्तुत करना ( '404.html' सरणी ( 'त्रुटि' = & gt; 'डी ?? Ñ ​​?? иР± кР° '));}});   

जावास्क्रिप्ट:

  $ (document) .ready (function () {$ ('# sendData')। क्लिक करें (function () {$। एजेक्स ({type: "POST", url: "engine.php", डेटा: some_data, सफलता: फ़ंक्शन () {*** location.reload (); ***}, त्रुटि: फ़ंक्शन () {चेतावनी (" त्रुटि ");}});});});   

और मैं पृष्ठ को ताज़ा नहीं कर सकता, क्योंकि यह एक पोस्ट विधि है मैं बिना किसी समस्या के पोस्ट विधि का उपयोग कैसे कर सकता हूं और इस पेज को ताज़ा कर सकता हूं?

मेरा समाधान अगले है:

  1. फ़ॉर्म बनाएं, विधि 'पोस्ट' जोड़ें
  2. अस्थायी पृष्ठ बनाएं, जो प्रपत्र से मूल्य प्राप्त करता है।

    2.1 सत्र में यह मान संग्रहीत करें < / P>

    2.2 इसके बाद, किसी अन्य पृष्ठ पर रीडायरेक्ट करें

java - How do I create an embedded WebSocket server Jetty 9? -


I hate to ask such a vague question, but I'm having a hard time finding a simple example. That's what I have so far:

  Public Sector JettyWebSocketServlet extends WebSocketServlet {@Override Configure Public Zero (factory). (Factory.register (MyEchoSocket.class); }} @WebSocket Public Square MyEchoSocket {@OnWebSocketMessage Text on Public Zero (WebSocket Connection Connection, String Message) {System.out.println ("Text:" + Message); {Conn.write (Tap, New FutureCollection (), "Found:" + Try); } Hold (exception e) {e.printStackTrace (); }}}   

In embedded Jetty examples, I can always show something like the following to start running a server instance, but I do not know how to update my WebSocketServlet. server server = new server (8080); Server.start (); Server.join ();

How can I create an embedded server that can handle the webserver connection request?

Update: December 2, 2013

Embedded See for example a date with WebSock with JetT:

Original Answer

An example of test cases Has been found.

Short answer:

  server server = new server (8080); WebSocketHandler wsHandler = New WebSketchesHandler () {@Override Configure Public Zero (); factory.register (MyEchoSocket.class); }}; Server.addHandler (wsHandler); Server.start (); Server.join ();   

This will create a simple server that controls 1 reference, the original reference.

  http: // localhost: 8080 /   

If you want to pair WebSocketHandler in another context, wrap it in a contextual handler.

  server server = new server (8080); WebSocketHandler wsHandler = New WebSketchesHandler () {@Override Configure Public Zero (); factory.register (MyEchoSocket.class); }}; Reference Handler Reference = New ReferencesHandler (); Context.setContextPath ("/ echo"); Context.setHandler (wsHandler); Server.addHandler (reference); Server.start (); Server.join ();   

This is your websocket

  http: // localhost: 8080 / echo /