Friday, 15 June 2012

java - Delete number from the beginning -


I have some strings that start with a number and a white space and I want to remove everything after that whistle. I am

First String:

  1 ABC DF  

What do I need:

  abd def  

second string:

  1 23 asp  

What do I need:

 < Code> 23 abs  

What is the best way to do this in Java? I know that it can be obtained from regular expression and string methods, but the way is the least?

  str = str.replaceFirst ("^ [0- 9] +", " );  

python - Resample a numpy array -


एक सरणी को resample करना आसान है जैसे

  a = numpy.array ([1, 2,3,4,5,6,7,8,9,10])  

एक पूर्णांक resampling कारक के साथ उदाहरण के लिए, एक कारक 2 के साथ:

  b = a [:: 2] # [1 3 5 7 9]  

लेकिन एक गैर- पूर्णांक resampling कारक, यह इतनी आसानी से काम नहीं करता है:

  c = a [:: 1.5] # [1 2 3 4 5 6 7 8 9 10] = & gt; इसकी आवश्यकता नहीं है ...  

यह (रैखिक प्रक्षेप के साथ) होना चाहिए:

  [1 2.5 4 5.5 7 8.5 10]  

या (सरणी में निकटतम पड़ोसी लेने के द्वारा)

  [1 3 4 6 7 9 10]  

एक गैर-पूर्णांक रीसंपलिंग कारक के साथ एक numpy array को कैसे रेस्पल कर सकता है?

NumPy जो रैखिक प्रक्षेप करता है:

  में [1]: numpy.interp (एनपी .रेंज (0, लेन (ए), 1.5), एनपी .रेंज (0, लेन (ए)), ए) आउट [1]: सरणी ([1., 2.5, 4., 5.5, 7., 8.5, 10.])  

SciPy में जो रैखिक और निकटतम प्रक्षेप कर सकता है ( हालांकि, जो बिंदु निकटतम नहीं है, वह स्पष्ट नहीं है):

  में [2]: से scipy.interpolate आयात interp1d में [3]: xp = np.arange (0, लेन (ए), 1.5) में [4]: ​​lin = interp1d (np.arange (len (a)), a) में [5]: lin (xp) आउट [5]: सरणी ([1., 2.5, 4., 5.5, 7., 8.5, 10.]) में [6]: निकटतम = interp1d (एनपी .रेंज (लेन (ए)), ए, प्रकार = 'निकटतम') में [7]: निकटतम (एक्सपी) आउट [7]: सरणी ([1., 2., 4., 5., 7., 8., 10.])  

javascript - How to click after my function read a barcode? -


My app has read a barcode, after which I'm trying to click on the search button, but so far Without success

My search button $ scope.buscar

How can I do it after the $ ('# txtCode')? Val (imageData.text); ?

Barcode Ctrl

  .controller ("barcode", function ($ radius, $ cordova barcode escanner) {$ scope .scanBarcode = function () { $ CordovaBarcodeScanner.scan ()} Then (function (image data) {$ ('# txtCode'). Val (imageData.text);}, function (error) {console.log ('Deu Merda' + error);}) ;}})  

People & amp; Corp. Ctrl

 . Controller ('logon', function ($ radius, $ http) {$ scope.people = []; angular.lement (document) .ready (function () {var httpRequest = $ http ({method: 'GET', url : 'Json / clients.json',} Success (work (data, position) {$ scope.people = data;}}}};}). Controller ('CtrlCorpo', function ($ radius, $ http) { $ Scope.people = []; angular element (document) .ready (function () {var httpRequest = $ http ({method: success (function (data, position) {$ scope.people = data;});} );  

strong> search button

  $ scope.buscar = function (angular.forEach ($ scope) .people, function (c, i) {var item = "& lt; td> & lt; a href = cardapio.html?" + Cid + "& gt; + + c.id +"  & lt; / td> "+" & lt; td & gt; "+ c.name +" & Lt; / td & gt; "if (c.id == $ ('# txtCode'). Val ()) {$ ('# tabelaPessoa'). Html (''), $ ('# tabelaPessoa'). Attachment (item);}});}});  

I have to search for all the clients in JSON and show my app.

When I click on my barcode sens button, I read the ID and automatically find me and if present. Automatic second page 'cardapio.html? Clientid 'for now I'm trying to search after reading the barcode.

Your problem is that you use a scope outside your controller

My button is in the control of the CtrlCorpo , which in turn is under the control of the barcode.

In the corner parent the controller can not modify the data of a child controller. But a child controller is used, and $ scope. Using parental.varName can modify parental scope variable. There is a great article on this

You are trying to reach a scope variable inside the external controller. Look at this example that I have put together which replicates your problem.

  var app = angular. Module ("MyApp", []); App.controller ("OuterCtrl", function ($ scope) {$ scope.myOuterCtrlVariable = "OuterCtrl";}); App.controller ("InnerCtrlOne", function ($ scope) {$ scope.ok = function (data) {$ scope.myOuterCtrlVariable = data;};});  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js" & gt; & Lt; / Script & gt; & Lt; Div ng-app = "MyApp" & gt; & Lt; Div ng-controller = "OuterCtrl" & gt; Outside: {{myOuterCtrlVariable}} & lt; Div ng-controller = "infiniteom" & gt; Inside: {{myOuterCtrlVariable}} & lt; Button ng-click = "OK ('from inner' Ctrl ')" & gt; OK & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

To fix this, you can $ broadcast make an event when your Textfield takes the amount of data according to your process requirement; This program will broadcast below the $ range and press ChildCtrl where The button remains ; You can execute the button above (above the original controller) with the above data.

Keep in mind that $ broadcast send the name of an event using $ emit to go all hair scope downwards Will happen.

For more information, $ emit versus $ broadcast .

See this example how this can be accomplished by $ broadcast .

  function firstCtrl ($ scope) {$ radius $ Broadcast ('some event', [1,2,3]); } Function secondCtrl ($ scope) {$ scope. $ ('SomeEvent', function (event, mass) {console.log (mass);}); }  

html5 - Canvas layout with JavaScript -


I want to layout with a javascript in a canvas. This code is full screen how do I get to the canvas?

Enter image details here

  html, body {margin: 0; Padding:}} .header {status: fixed; Top: 0; Left: 0; Correct: 0; Height: 20px; Background color: moccasins; }. Wiper {status: complete; Top: 21px; Correct: 0; Bottom: 0; Left: 0; Background color: fuzzy; } .net-wrapper, .center.pane. Zinc {display: table; Width: 100%; Height: 100%; }. Pen {display: table-cell; }. Left.pane {background color: oliverbred; } .center.pane {background color: light blue; } .center.pane. Winner .top, .center.pane. Winner .bottom {display: table-row; } .center.pane .inner .top {background color: light; } .center.pane. Commander .bottom {background color: orange; Height: 100%; Width: 100%; } .right.pane {background color: # 999; }  
  & lt; Div class = "wrapper" & gt; & Lt; Div class = "inner-wrapper" & gt; & Lt; Div square = "left pane" & gt; Left & lt; / Div & gt; & Lt; Div class = "center pane" & gt; & Lt; Div class = "inner" & gt; & Lt; Div class = "top" & gt; Center Top & lt; / Div & gt; & Lt; Div class = "bottom" & gt; Center bottom & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div square = "right pane" & gt; Right & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

JQueryUI.resizable a canvas Originally not applicable for the element.

To do the same thing in the canvas you have to do it manually. This is because the canvas does not "remember", where it attracts any individual rectangle and canvas individually can not change any rectangle again or change its size. What you should do is to clean the entire canvas and re-draw all rectangles in their new position and sizes.

Rectangles representing your div areas: context.fillRect
  • < P> Listen to mouse events on the canvas: addEventListener ('Masudown' ... etc.

  • Repeat in response to "Manually" mouse events Size Replaces:

    • Save each rectangle property in an object: var rect1 = {x :, y :, width:, height:} < / P>

    • Hit-test on each rectangle, at Massundown. Hit, as resizing the rectangle Hit Test Algorithm: var isHit = mousex> Rect.x and MXx

    • Empty the entire canvas and all Rectangle the rectangles. Resize the flag rectangle flagged from the drawn distance: rect.width + = (mouseX-startMouseX); rect.height + (mouse-starting mouse); Premma

    • On the mouseover, stop resizing.


  • php - Proper way to escape query in Codeigniter -


      $ sql = ("इन्वेंटरी सेट अपडेट करें? =? +1 WHERE आईडी =?"); $ Query = $ this- & gt; db- & gt; क्वेरी ($ sql, ऐरे ($ फ़ील्ड, $ फ़ील्ड, $ id)) - & gt; प्रभावित_श्रेणी ();  

    त्रुटि:

    आपकी SQL सिंटैक्स में एक त्रुटि है;

    असल में यह उद्धरण जोड़ रहा है कि निकटतम '' अपवोट्स '=' अपॉवेट्स '+ 1 WHERE आईडी = 386464' का उपयोग करने के लिए सही सिंटैक्स के लिए मैन्युअल जो आपके MySQL सर्वर संस्करण से मेल खाती है, जांचें Upvotes फ़ील्ड के आस-पास यह एक विकृत क्वेरी होने के कारण एकल उद्धरण को हटाने या पूरी तरह से क्वेरी को फिर से लिखने का सबसे व्यावहारिक तरीका क्या है?

    यहां दिए गए उत्तर बिल्कुल सही नहीं हैं, क्योंकि वे उम्मीद कर रहे हैं कि आपके पास पहले से ही अपवी गणना की गई है। मुझे लगता है कि यह वही है जो आप खोज रहे हैं:

      $ this- & gt; db- & gt; जहां ('आईडी', $ आईडी); $ This- & gt; db- & gt; सेट ('अपवोट्स', 'अपवोट्स + 1', FALSE); $ इस- & gt; db- & gt; अद्यतन (इन्वेंट्री);  

    आउटपुट को यह सुनिश्चित करने के लिए नीचे पंक्ति का प्रयोग करें कि आपको इसे कुछ देना चाहिए:

      $ echo-> gt; & gt; last_query ();  

    UPDATE इन्वेंटरी SET अपवोट्स = अपवोट्स + 1 WHERE आईडी = 386464

    गलत का तीसरा पैरामीटर सीआई को बताता है कि बैकटीक्स के साथ क्वेरी की रक्षा नहीं की जाती।


    Modulus.io and Meteor - Deploy to a subdomain -


    I have an app in development that I have installed on the Galaxy and it works very well! There are two versions of the site, each in different languages I am using a standard domain for the English version http://website.com and for a French version a subdomain http://fr.website.com

    While using the standard $ meteor deployment , you can specify the domain you are sending. For example, I have a French branch in the same branch and an English I can keep the branch, and then when I want to deploy on the French subdomain, then $ meteor deploy fr.website.com I can deploy on

    I have properly configured the DNS setting with Gaudadi.

    The syntax appears to be different with modulus.o ... I have a different version of the site for modulus .o for a subdomain?

    You must add your domain to the "custom domain" in the project administration and you also set the ROOT_URL environment variable Have to do.


    publishing - iOS Add UDIDs without re-exporting app? -


    Whenever I am sent to UDID for a test device, then I will send them to the developer on our portal Adding the list to Apple.com Then I will add a new device to the provisioning profile for the application, then I will export the compiled application again with the new provisioning profile.

    It's fun, but when it's happening every other day it starts to become trivial i've read about testflight , but I have to make sure that first There is not a better way to install. What is the best way to do this? Unfortunately, I do not think you have a better solution to often add / manage devices.

    An app needs to be signed before iOS is executed. You have basically 3 options:

    • Development & amp; Ad-hoc delivery profile: You list the list of each device UIDID which can run the app
    • App Store: No UIDID list needed , you can upload the app from iTunes and enable testflight beta testing for it, but as far as I know there is no way to install the app, which is an app store profile New iTunes Connect / Test The light was made on the device except for the beta through the system and app store.
    • Enterprise: Need an UIDID list , do not install it on any device but for a different type of Apple Developer Account , More expensive and more legal work (you have to "promise" that you will not distribute your app except members of your organization)

    Only the last two devices need to list the UIDID is not.


    angularjs - AngularFire: How to apply partial update (a single field) to an item in $firebaseArray? -


    I'm thinking how I can apply a partial update of an item in $ firebaseArray , And the documents do not mention any of this. . $ Save seems to stop the whole item:

      var ref = new Firebase ("https://xxxx.firebaseio.com/items"); $ Scope.items = $ firebaseArray (ref); SomeItem = getItem (); SomeItem.newField = 'test'; . Save $ scope.items $ (someItem);   

    This causes the whole object to be completely overridden, just updating newField

    Instead of how I have seen it using $ asObject , but I still have a $ firebaseArray

    I think I can help here. First, some things:

    • I do not use your getItem () and therefore is not some item $ Id property, properties of some items can be set as properties of $ scope.items .
    • You . $ Add (someItem) can add to itemsArray if you want to create a new item.
    • You can $ scope.items. $ Save (someItem) can be used if some item has $ id .

    code

      reef = new firebase (FBURL + '/ item'); ItemsList = $ firebaseArray (referee); $ Scope.items = item list; $ Scope.addItemObject = function () {var someItem = {}; SomeItem.newField = 'test'; . ItemsList $ add (someItem); Console.log ('$ scope.items is', $ scope.items); } $ Scope.updateItem = function () {console.log ('$ scope.items was', $ scope.items); Var id = prompt ("enter $ id to update"); Var someItem = itemsList $ GetRecord (ID); Var newField = sign (enter new value for 'newField'); SomeItem.newField = newField; ($ $ Scope.items is now '$ scope.items);}) ;; }  

    example

    • See this job
    • I created things that would get the same result as given above code Are there.
    • li>

    Hope that helps!


    php - Route on Laravel keeps redirecting (301) to root of website -


    I have an application using the A2 host provider, and inside my public directory, my MyWorld folder (www. Website.com/app)

    and I'm redirecting to "/" from "/" in my server preferences

    The app was okay, but today a specific one The root has started redirecting.

      Root :: find ('/ postgains / {alias} / {datainio?}', Array ('as' => Artista.get.posts.all ', 'Uses' = & gt; ArtistaController @ getPostsMainFeed')); Generates within HTML Generate: But when I send this request or send a request via jquery, it redirects me, and it gives me a 404 (since there is no lairve app inside the root Is ...)  

    All other routes are still working ...

    Any ideas?

    thanks

    edit

    I put the wrong route here, but BTW, I have solved it without making the second parameter "resolved" and it's URL LerlL :: Added to Javascript using the route.

    There was only one problem reaching a path on the AuthController provided to me. Mildware (except for 'Guest', ['Exclude' = & gt; 'Logout'])

      $ this-> Middleware;  

    On the root page were 302-non-non-guests, even with the exception, even for the logout route.


    User Placement Rotation Algorithm -


    I am trying to come up with an algorithm that provides users "Q", "W", "E" , And "R" for a different line position ("A", "B", "C", "D") after each iteration of a job. I have tried to solve it manually (using different combinations) and can not, so I'm obviously having a conceptual problem (or no ideal solution is possible, my obstacles are given) Any If you have suggestions in the code, do not hesitate to use any language.

    Thank you!

    I have some obstacles:

    • Change the frequency of each user (Q, W, E, R).
    • The next "Frequency" column can not be placed in the "D" column in "A".
    • The user "e" can not be equal to possible distribution in all columns of "A", "W", and "R" (meaning, for example, the user "Q" In a column, users should not be too much in comparison to "W" and "R".)

        ABCD 1 2 3 4 5 6 7 8 9 10 And after the error, I think it works?   

        ABCD1QRRE2RQ33QR 4WQ5QVR6Wirk 7RQE8WetQ9RequusQWE (repeats with 1)  

      I got the first three rows from rotating the Q, W, and R.

        QWR WRQ RQW  

      Then insert those three rows three times below each other, once in the column, the rectangle, column one column and column One of the B

        QWRE WRQE RQWE QWER WREQ RQEW QEWR WERQ REQW  

      Then finally manages to rotate those two rows, as long as they have the first two demands Do not meet.


    angularjs - Angular: Returning a $q.defer().promise instead of an $http promise -


    See Aghedkaio video, I noticed a common pattern is to return a custom promise and resolve it

    Callbacks.

      .factory ( 'myFact', function ($ q, $ http) {returnData: function () {var deferred = $ q.defer (); $ http.get ( '/ Path / To / api ') .success (function (data) {deferred.resolve (data);}); Returns; Promote;}};});  

    I typically thus write:

      .factory ( 'myFact', function ($ http) {return} {getData: function () { Return $ Http.get ('/ path / to / api'). Then (function (race) {return res.data;});}};});   

    Instead of making a promise to $ http , do you have any advantage of making promise? Attitudes look the same for me.

    No, no benefit, this is the same, if you have created an example in your first code You have applied your solution () method to create solved promises .

    The same procedure that you know must have asynchronous functions and The future of object to work with Time Angular JS which you will have different values ​​or new data in a few moments the future will know you when that happens, your app interested parties deferred action access to the results May need to be done.

    Now when you work with, none of it has already been pledged to a resolve these will return you can apply directly to you things There should not be a different way of doing it and you need to apply a different approach.

    But not all angular JS services are going to work for you, for example look at $ resource , which will be used for use in RESTful Web API scenarios $ Http wraps $ resource will not return a solved promise , a promise Yes, you are getting one But you will need the final step of solving this (or else).

    How are you doing this, it is good, like this I'm working with $ http , but the first snippet code is what we will all search for. When we will need to work differently with $ http or other services with ' at work ' or ' ' AJX Work like that.


    javascript - Backbone rendering collection in other collection element -


    I have a structure that I need to render. Its linear types are: [{name: [{name: "D17043"}, {name: "D91832"}, {name: "D32435"}}, buildings: [{name: "B14745", District: "D 17043 ", Address:" First Phase "}, {Name:" B14746 ", District:" D9 1832 ", Address:" First Phase "}, {Name:" B14747 ", District:" D 17043 " Address: "First St"}]}

    It is easy to look a little better In the districts they have attached buildings. Probably, the structure can be nested, but I thought it would create additional trouble, and, because this "tree" is not structured, I have made simple objects. The question is how can it be displayed properly with the spinal cord? It looks like something like this (some details are left behind the scenes):

      App Colections. Distills = Backbone compilation. Extension ({Model: App.Models.District}); Var district = edit new app. Selection .Digital (Data Distilled); See Var district = new app View. District ({Collection: Districts Collection});  

    Then in the district archive scene, we create a loop that creates a single district scene:

      View the district = new app. View. District ({model: district});   

    and within the same district call the second collection in the view i render method:

      App.Views.District = Backbone.View.extend ({tagname: 'div', classname: 'district listname', render: function () {this. $ El.html (this.model.get ('name') ); Select Var buildings = new app.collections.Imons (All data.building); Selecting buildings.Composition (task (object) (if (item.get ('district') == this.model.get (' Name ')) {var buildingview = New App.Views.Building ({Model: items}), this. $ El.append (buildingView.render (). El);}}, this); }};  

    This thing works but it's not a bit scary? Maybe it's a fair way to do this? Especially if I have a building inside other buildings, thanks. < / P>


    java - Check if a checkbox is checked from JPS file -


      बूलियन फ़्लैग_आउट्यूक; स्ट्रिंग स्ट्रिंगआउटlook = request.getParameter ("Send_outlook"); If (stringoutlook! = Null) flag_outlook = true; Else flag_outlook = false; स्ट्रिंग डेटास्टार्टअप्यूमॉन्ट = कनेक्ट.टाइमफॉर्मैटफॉरडेटाबेस (डेफोर्मैट, इंटीजर.परसेइंन्ट (टाइमफ्रोमेडिट)); स्ट्रिंग डेटाऐन्ड्यूपॉइमेट = कनेक्ट। टाइमफ़ॉर्मैटफ़ोराडेटाबेस (डेफोर्मेट, इंटीजर। पीआरआईआईआईएनटी (टाइमफ़ोमेडिट) +1); If (flag_outlook = true) {apppoiment send = new apppoiment (); भेजें। ऐप्यूट (डेटास्टार्ट ऐप्यूमेन्ट, डेटाइंडबूट, कंटेंटसेल); }  

    जेएसपी से चेकबॉक्स इस तरह दिखता है

      & lt; इनपुट प्रकार = "चेकबॉक्स" नाम = "भेजें_आउटक्लक" & gt;  

    मैं कोड का एक टुकड़ा निष्पादित करने का प्रयास करता हूं, अगर कोई चेकबॉक्स चेक होता है (अप मेरा कोड है), लेकिन ठीक से काम नहीं कर रहा है, हर बार मेरा ध्वज सच है। मैं समझ नहीं पा रहा हूं कि मेरी गलती कहां है

    कारण आपका ध्वज हमेशा true है क्योंकि आपके if-statement में आप कहते हैं:

      यदि (flag_outlook = true)  

    यह होना चाहिए:

      यदि (ध्वज आउटलुक == सही)  

    आपकी समस्या यह है कि आप तुलना की स्थिति में निर्दिष्ट कर रहे हैं।

    < / html>

    java - define a list in BeanShell (jmeter) -


    Can anybody help in the Beanshell script? Therefore, I am trying to use a list in my code sample, however, I could not properly define the list such code from the Beanshell Post Proportional Sample:

      import Java.io. *; Import java.util. *; Import org.json *; Import org.apache.jmeter.samplers.SampleResult; If ((prev.getResponseCode ()! = Null) & amp; (prev.getResponseCode (.) Equals ("200") == true)) {JSONObject feedback = New JSONObject (prev.getResponseDataAsString ()); JSONArray array = response.getJSONArray ("user"); & Lt; String & gt; Users_list = new ArrayList & lt; String & gt; (); (Int i = 0; i & lt; arrays.lamban (); i ++) {JSONObject object = array.getJSONObject (i); Users_list.add (object.getString ("user_id")); Print (users_list); }} Jmeter.extractor.BeanShellPostProcessor: Problem in BeanShell script org.apache.jorphan.util.JmeterException: Error in starting bsh method: in eval file: inline evaluation: `` Import java.io. *; Import java.util. *; Import org.json *; Import org.apache.jmete. . Finally, in the form of '' expected '' = 10, column 31.  

    In the list list = new ArrayList ();


    javascript - Zoom in on array of locations -


    I'm facing some minor issues about setting the optimum view on Bing Maps.

    I already got something in the internet solution but unfortunately none of them is working for me My Bing Map is displaying several addresses that are working fine and now I see the scene I want to adjust, so that my map is zooming on my push pin.

    The following is my source code:

      function addData (locationInput) {counter = 0; Var locationset = locationInput.split ("#"); // Array location = new array from the public; (If i == 0) {locationSet [0] = locationSet [0] .substr (1); (var i = 0; i & lt; locationInput.length; i ++); } Var locSet = locationSet [i] .split (";"); Var Location = New Microsoft. Map. Location (Locets [0], Loksat [1]); Locs.push (location); Var Pushpin = New Microsoft. Maps. Pushpin (location, {text: counter.Tosting ()}); Map.entities.push (pushpin); Counter ++; Console.log (this); } // Set the visual limits map.setView ({range: Microsoft map. Location location. (Place)}); }  

    When you calculate a location line from your places, then it's for coordinates Tight and do not have an account for the size of your push pin icon. You set the padding value in this account for this set. Try it:

      map.setView ({boundary: Microsoft map.locationline.frame location (local), padding: 100});  

    objective c - iOS - XCODE 6 - Build 64bit application for simulator -


    I believe the build setting of my project is "Standard Architecture (ArmV7, Arm 64)" and "Valid Architecture (Armwi 7, Armwheel) 7 and "Arm64"), I can create a project for the iPhone 3G, the iPhone 5 and the iPhone 5S (hardware with 32 and 64 bit architecture), but when I use the project for simulator If I try to build, then I have a problem. Why do I? There are such errors.

      "_BIO_f_base64", referenced from:  

    This is because the simulator is running on an i386 architecture and there is no hand involved in some supported architectures like I386. (See many answers here for details and screenshot on SO)


    ggplot2 - line graph with 2 categorical variables and 1 continuous in R -


    I am fairly new to R and figures in general. I am trying to plot a line graph in 2 ggplot2 (clear position of speech "position", position "truck") and a numerical one (score "total view").

      & gt; Df1 & lt; -df [, c ("trcond", "subtitle", "pos", "totacc")]> Head (DF1) Traction Subtitle Status Total 7 L New Sini_16 Lex 0.250 29 N New Sny_16 Lex 0.500 8 L New Seene 295 Lex 0.875 30 N New Sene 265 Lex 0.666 9 L New Scene 9 Lex 1.000 31 N New Scene 9 Lex 0.833  

    I have used this ggplot2 command:

      & gt; Ggplot (data = summdfo, aes (x = pos, y = totacc, group = trcond, color = trcond)) + Geom_line () + geom_point ()  

    but it is not working The graph is more colorful (blue and red) points in place and more than the two rows connecting to them. I have to post this article, as I lack words to understand, but this is my first post and I The image does not seem to be able to upload.

    I have a standard simple 2 line graph in this page as blue and red (where y = total bill, x = time (grouped by gender):

    Is this possible with my data? If so, what's wrong with the code?

    < P> Here I tried to create a data frame

      df1 & lt; - data.frame (trcond = rep (c ('L', 'N') on your sample from your data. , 3), subtitles = delegate ('new view' 9 ', 6), # not use Only one dummy pause = C ('Lex', 'Lex', 'Lex', 'Knowles', 'Knowles', 'Knowles'), Nosycic = C (0.250, 0.5, 0.875, 0.666, 1.000, 0.833) )  

    Because trcond is not balanced in this data frame, the plot is going to be messed up like this:

      ggplot (data = df1, aes (x) = Pos, y = totacc, group = trcond, color = trcond)) + geom_line () + geom_point ()  

    However, if you apply a summary function which means the tools for each condition A perfect plot will appear:

      ggplot (data = df1, aes (x = pause, y = etx, group = trunk, color = truckman)) + GOML line (state = 'Summary', funny. '=' Mean ') + GOM_point (state =' summary ', funny. Y =' mean ')  

    again, it is trying to figure out what's in your data. The best part is that here you provide a sample of your data using DTP (head (DF1, 50)) to give you better answers.


    java - Real-time collaborative editor with Atmosphere -


    I would like to be a real-time collaborative editor (like Google Docs). I have been successful in implementing it.

    So now I am able to send text between two clients. But I have to understand how to manage a collaborative document / editor.

    I have read about the operational change, so what do you think about the following setup:

    There are three clients: Client A, Client B, Client C

    < P> All changes connected through all the three websites are sent to the API (this will be a full Jason object). Customers receive Jason object and accordingly they have nothing left to the database on / insert / delete / update content. My easiest way would be, only Client A (he's impressive) saves the database on every change (including changes to other customers). With this solution I will not have to apply the OT at the API level. If the client leaves A, another client will become effective and save the database.

    My only issue is right now, there is no easy solution to handle OT among the customers. / P>

    Do you have any suggestions? Does this solution understand or is it completely nonsense?

    My TechStack is up to now:

    Backbone / jQuery

    MySQL

    Java Servlet / Talket 7 (JT is better with WS - It will be implemented later)

    Good if it fits with this stack;)

    Best Fabian

    OK - so I'm solving it myself a great project called WebState if you want to make rich-text-editing in real-time, Should check.

    Best Fabian


    Prefill Formfield using Javascript/Jquery and Labels from URL -


    I'm having difficulty in prefixing the form using labels in front of form fields.

    ID is generated randomly of my form files, so also for label = "fieldID"

    An example:

      & lt; Td> & Lt; Label class = "required" = "ebc2566ad1c3793b" & gt; Name: & lt; Font class = "error" & gt; * & Lt; / Font & gt; & Lt; / Labels & gt; & Lt; Period & gt; & Lt; Input id = "_ ebc2566ad1c3793b" class = "form-control" type = "text" value = "" name = "ebc2566ad1c3793b" placeholder = "max length =" 30 "size =" 16 "& gt; & Lt; / Span & gt; & Lt; / TD & gt;  

    I am able to use javascript to fill the fields using the ID from the URL, but the identifier is not using "name:" that is between labels.

    As I am also using jQuery in the Soem script, I am also not sure which DOM to use.

    The example is very welcome.

    I'm not sure that I understand 100% of the problem, depending on your content, form labels Want to use? If so:

    You can get form labels in this way by using the selector () selector in:

      var NameLabel = $ ("label: ('name:')");  

    From there you can use the .next () method to capture the brotherhood element which is span in this case Input field to use input, you will do something like this:

      var nameInput = nameLabel.next (). (Find 'Input');  

    Use .value () to set your content this way:

      nameInput.val ( 'John doe')  

    WSO2 API Manager - Is it possible to create a custom workflow by API or tiers? -


    I am trying to create a custom workflow on the Wso2 api manager. Now, I will add a custom subscription workflow and define which API or arrows should be used.

    For example with different levels:

    1. I am a developer and select the API A Bronze : When I subscribe to the API, Workflow 1 is executed.
    2. Choose another developer meter and I with the API A Silver : When I subscribe to the API, Workflow 2 is executed.

    I did not get the document about it. Is this possible? Should I code the normal custom workflow and use the switch case ?

    Thank you very much

    This is possible with wso2 API Manager and BPS. When you subscribe to an application, it will execute customized subscription flow To do this, you should extend membership flows by increasing the subscription purchase WSWorkflowExecutor.java class. Override complete () method Create a jar file and run the following path & lt; APIIMOHME & gt; / Add to the repository / component / lib. Start the Impimenger Server, log into the API Management Console and choose Browse under resources. Go to the /_system/governance/apimgt/applicationdata/workflow-extensions.xml resource, disable Simple Workflow Executioner and enable the WS Workflow Executioner. Then change the working class in the newly created classroom.


    php - How to speed up MYSQL query with Multiple Join tables -


    Do not get me in trouble with my questions, they move to the product results of age. I have only 13,000 records in the main table, and then link to other tables which is mainly used their inside connecting tables with a dozen or so records

    I first sequencing But only when the query is used is not being included in one table and the other.

    Here's my query

      SELECT product_data.id ASC, product_data.sku AS screw, product_data.barcode as barcode, product_data. Title AS title, product_data.attrib_releasedate AS attrib_releasedate, product_category_main.id AS Sreni_man_aidi, product_category_main.name AS Sreni_man_diskripshn, product_category_sub.id AS Sreni_subi_aidi, Utpad_gt_subi.am ASC Sreni_sb_deskripshn, Utpad_grahik_sb_deskrip_sort AS On_id, as product_condition.name condition_description, attrib_pegi.name aS attrib_pegi, attrib_region.name aS attrib_region, product_data.asin asin, from Utpad_deta as Product_datakcex Cex Utpad_deta on Utpadk_detaim productive category. Product_category_sub is included on category_man_id = product_category_main.id product_data. Category_sub_id = product_category_sub.id LEFT JOIN product_condition ON product_data.condition_id = = product_data.attrib_region on attrib_region.id to leave product_condition.id attrib_pegi on attrib_pegi.id = product_data.attrib_pegi Leave attrib_region WHERE title & lt; & Gt; '' And product_category_main.id = 1 Sreni_man_aidi by Category, Title  


    Google Places API - Places Details Request 404 -


    There is a strange problem with Google Maps. I {key} an auto-complete request and receive 5 addresses. JSON response:

      { "predictions": [{ "description": "Dniprovs'kyi district, Kiev, Kiev City, Ukraine", "id": "023b6f6008f0b58208c7c1360c15966d591ebbf5", "matched_substrings": [{ "length": 2, "offset": 0}, { "length": 4, "offset": 23}], "place_id": "CHIJ-2Pud7La1EARRomoyKV9Nvg", "context": "CoQBcQAAAM61hA62d_nNjn2xs7ooCbeAFvnHn9tlTWYxqxotYheKHD6-XVLEcTvnkRss16cMRVXF-9Wk3EmvrRm_R4_Tnvwyd1XVno0TWSk30OBb8b7n_f9rZjOgir0LIFDVDgVJY0cWmx5WHG2rxxtW_qz1r37 -tw39WA6g6Qfv0yGf8-H2EhB1B8ZaolsxZ6IKGSp49aJHGhTSd8BUIKFeJ4Rbvh5cjqytLN8mBQ "," reference ": [{" offset ":" value ":" Dniprovs'kyi district "}, {" offset ": 23," value ":" Kiev "}, {" offset " : "", "Price": "Kiev city"}, {"offset": 40, "value": "Ukraine"}], "type": ["sublocality _level_l "," sub-region "," political "," geocode "]}, {" description ":" Dnprowska embankment, Kiev, Kiev City, Ukraine "," id ":" 584f6c97be66f9dfd62c318ce83f6534004a6c8a "," matched_substrings ": [{ "length": 2, "offset": 0}, { "length": 4, "offset": 24}], "Place_id": "EjBEbmlwcm92cydrYSBlbWJhbmttZW50LCBLaWV2LCBLeWl2IGNpdHksIFVrcmFpbmU", "context": "CmReAAAAtDXrk0vEFiKYHNPPhPXYBoQOJ38NGGjbUf7mTRH8-_cqtiIkTDDsZXzuUSATgr_uiflldtH4nUrhW0rsFmUtrkQIUz6CZCGRQTUdAJh83zagGLcuVEs1xchGY1A2izTOEhCaI_oBksWVRhO_CRaYvgSzGhQr0eOrWKZV1GJoHpGbvrtO6QZ_Ug", "context": [{ "offset": 0, "value": "Dniprovs'ka embankment"}, { "offset": 24, "value", "Kiev" "," offset "30," values ​​":" Kiev city " }, {"Offset": 41, "value": " Ukren "}]," type ": [" path "," Jiokod "]}, {" description ":" Dnepr, Kiev, Kiev City, Ukraine "," id ":" a3c4a39941ac4c54c2b176849696118af448a090 "," matched_substrings ": [{ "length": 2, "offset": 0}, { "length": 4, "offset": 7}], "Sthan_ id": "ChIJjcChbKPP1EARTXya5VgHmOk", "context": "CmRYAAAAZuPj8SP1flByvXUVAcO3eeYb-das4IJeBPxo_usffK_Oq2mZFPZdPwhyCmyCfrCECX5ZwssyGQdaEWCCkSkyKbDCq3ZPxbEqYlyGXDFGNJ4DqGn7mXVoEHwMKKb5DG3sEhBaeZXXm9Fh-zh_Ajl0paRKGhSy1Z9s4Uv1AU609L0sztasqQU6rg", " Reference ":", "" value ":" "," value ":", "" value " Kiev city "}, {" offset ": 24," value ":" Ukraine "}]," type ":" subway_station "," train_station "," transit_station "," est No "," geocode "]}, {" description ":" Dnepr, Parkova Road, Kiev, Kiev City, Ukraine "," id ":" 973dc14397b70d5be6d2ddd3c5bc2a6e2de04b59 "," matched_substrings ": [{" length ": 2," Offset ": 0}, {" length ": 4," offset ": 21}]," place_id ":" ChIJQ_49j7LP1EARLXp2vRI8pws "," context ":" CnRlAAAAiR50_V3AfqkhvGnoHhc4n6QjXkm-aWerLtLHEhxD6cJmGuirRktoafooAdbbGOzh97TSk1MklDfBs0fyrQgRnVjkDz zjioCspJ1La6gh8I8BUC0LTpABJOlkjrvz5wpC0HhXgYm4EbHqwZZY2aBYdBIQVqbAYC42ALmzxEqWXL5H9RoU4g-MKNF34R3Y9c_-5Z7lxf9n1vY "," context ": [{" "Offset": "offset": {"offset"}, "price": "parkova road"}, {"offset": 21, "value": "Kiev"}, {"offset "," Type ": [" installation "," geocode "]}, {" descrip: 27, "" price ":" Kiev city "}, {" offset ": 38," value ":" Ukraine "}]," type " tion ":" Dnipro, Kiev, Kiev City, Ukraine "," id ":" 9e94078fbf056913f1bf0e3de90b04fc261d21b0 "," matched_substrings ": [{" length ": 2," offset ": 0}, {" length ": 4," offset ": 8}]," Place_id "" ChIJMe5dbqPPlEARSnZi_bKNY0A "," context ":" CmRYAAAAbkjesqoz4jiN86mZU5KG_hNatcXIc5GJMHvSzmIKgedGz5hmlVl_QKqyO1vupXGBLOi-wx64i0e_15mgNQbwjzGBabLTDuAC0H73PD9Dz3w0C4hMqHhsNjJmRsKLYTFMEhCvwWcBT_EWiCU5Fmr32bn2GhRKADBuv9Qq52rH2Ru5-0EdDPWlGw "," context ": [{" offset ": 0," value ":" Nipro "}, {" offset "," Price ":" Price ":" Offset ": 14," Value ":" Kiev City "}, {" Offset ": 25," Value ":" Ukraine "}]," Type ": ["Bus_station", "transit_station", "installation", "geocode"]}], "status": "ok"}  

    The I try to get location details for all these locations. Everything works fine for address 4, but for the address, Google responses with "Dniprovs'ka embankment, Kiev, Kiev city, Ukraine" placeid = EjBEbmlwcm92cydrYSBlbWJhbmttZW50LCBLaWV2LCBLeWl2IGNpdHksIFVrcmFpbmU 404: Request: {key}, Feedback: {"html_attributions" : [], "Status": "NOT_FOUND"}

    What am I doing wrong? Thanks for the help


    javascript - Google Maps JS APIV3 -


    I am experiencing difficulty solving a problem that I have used Google Maps JS API3.

    :

      typeError: google.maps is undefined  

    This is always the case, and I can not understand it. This is driving me crazy

    I have my JS files:

      & lt ;! - Javascript file - & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / jquery-2.1.3.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "https://maps.googleapis.com/maps/api/js?key=****" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / lightSlider / js / jquery.lightSlider.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / light-gallery / js / light gallery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ resources / js / cycle.js" defer & gt; & Lt; / Script & gt;  

    And my code for getting maps is:

      $. Each (google.results, function (x, y) {var lat = y geometry.location.lat; var lng = y.geometry.location.lng; var map; function initialize (lat, lng) {var mapOptions = {zoom : 8, center: new google.maps.LatLng (lat, lng)}; map = new google.maps.Map (document.getElementById ('gmaps'), map options);} google.maps.event.addDomListener (windows , 'Load', start (lat, lng)););  

    Let me tell you that the last block of code ($ .each) is in an AJAX call when AJAX is done.

    Edit: I've tried something

    Do you load the API Are you using your right key? Src = "https://maps.googleapis.com/maps/api/js?key=****"


    java - Emulator can not download data from Internet (endless loading) -


    I have a problem testing my app: it loads data from the internet and outputs it on the screen. When I try to test it with the emulator - the download starts but does not end. When I try it with a normal smartphone - everything is fine and data is loaded in a second. Here's a code, but there is no problem in it, I think:

      last button butTest = (button) findViewById (R.id.parse); Final text view TVInfo = (text view) Find VVBID (RIDGetData); ("Http://yandex.ru");} AsyncLoad asyncTask and string, zero, string & gt; Extends up to; {} Document Doctor = Faucet; Personal progress DIOLOPprogression; @ Override protected string inbackback (string ... parameter) {published progress (new zero [] {}); Try {doc = Jsoup.connect (parameter [0]). } Hold (IOException e) {e.printStackTrace ();} Return doc.title ();} @Override Secure zero PreExecute () {supe r.onPreExecute (); MProgressDialog = new progressionDLOG (GetData.This); MProgressDialog .setMessage ("Download ..."); MProgressDialog.show (); } @Override Protected Zero on PostExecute (string result) {super.onPostExecute (results); TvInfo.setText (Results); MProgressDialog.dismiss (); }}});  

    I work in Eclipse and these are emulator settings: RAM 1024, internal storage 200, VM heap 64. It does not work so fast with other tests, but still work I can wait 10, 15, 20 minutes with this code - it goes to preextec (), but no further.

    Check the weather You have allocated some memory in the emulator settings.


    postgresql - Django: is using a ForeignKey likely to affect read performance on a big db? -


    I have a large postgraduate database (approximately 500m rows, total 150 GB). This figure is relatively stable (only once Updated in the quarter), I want to optimize it for reading, not written.

    Currently I have the following database structure using a foreign key:

      class practice (model. Model): code = models.IntegerField () name = models .CharField (Max_length = 200) Class Prescription (Model. Model): Practice = Model. Frequing (practice) project_action = model.feedfield (max_long = 15)  

    If I often want to question this way, the big dataset is returning:

     < Code> p = practice.objects.filter (code = 1234) prescription = prescription.obays.filter (practice = P)  

    will it be more efficient to reconstruct the database So that it does not have a foreign key:

      class prescription (model. Model): practice_id = models.IntegerField () presentation_ Code = models.CharField (max_length = 15)  

    And then what to do in this view?

      p = practice.objects.filter (code = 1234) prescriptions = prescription. Filter (pract_id = 1234)  

    I understand that if I do this, I run the risk of making orphan stories in data import - this is not a problem. I'm more interested in ensuring that the database runs faster and can cope with many users.

    I currently have the first setup, and the Django-debug-toolbar shows that the visual query looks like this:

      from SELECT COUNT (*) "Frontend_prescription" WHERE "Frontend_prescription". "Chemical_id" = '0212000AA';  

    Looking at this, maybe we can guess that changing the database structure will not speed up the questions read?

    I understand that I can test my database by restructuring and test execution time, but with enough 500M rows, which is quite a lot :)

    IntegerField ;

    Excessive compulsion will not affect single-table reading performance, although using joins They affect the performance impact (positive), ie select_related .


    Angular Material Design layout -


    How do I design a layout with an angular content layout:

    I took an example from

    : with an MD-content box dropdown An MD-Toolbar

    I do not think you can do this completely in angular content, but you do so It can be added mostly in content and then on a simple CSS class. Assume that you have all the necessary script and CSS dependencies, your HTML will look like this:

      & lt; Body ng-app = "contentDesignApp" ng-controller = "MainCtrl" layout = "column" & gt; & Lt; Md-toolbar flex = "33" & gt; & Lt; / MD toolbar & gt; & Lt; Div layout-align = "center start" layout = "row" & gt; & Lt; Md-content class = "md-whiteframe-z2 hill-up" flex = "66" & gt; & Lt; P layout-margin & gt; Advertise on this website Integer number differences are talking about Phasellus sollicitudin, or bubble Anne Cogu Rutrum syspit. The postage stamp can be included in SEO sultur. In EU ads, there are things in Duas Bibendum Octor Lorem Hendrate's temporary Anne Granth, Matt's Intermedium, which are free for flexibility before lenses. At the time of integral, the skill for the duration of the present time, it has been determined, and depends on it. How do you know how you can work, Maurice Peliner Dignisim is now a Loreket thanks to your rights & lt; / P & gt; & Lt; / MD-content & gt; & Lt; / Div & gt; & Lt; / Body & gt;  

    And your CSS will look like this:

      .move-up {position: relative; Top: -60px; Z-index: 99; }  

    Here is a working function:

    The key here layout-align = "center start" , Which focuses on the page horizontally from page (usage) and only puts it under the MD-toolbar. It is necessary to ensure that we use a flexbox layout on Div content as well as the layout = "row" .

    From there, returns the flex = "66" box width of 66%, adds .md-whiteframe-z2 background, and Then our .move-up class simply takes it up to 60 code position: relative; Top: -60px and z-index .

    above the toolbar.

    Connecting two running terminals Linux -


    I have two terminals running Linux, I would call them T1 and T2 < Code> Call.
    I want to connect stdout from T1 to T2 and stdout to T2 to T1 .

    I've redirected the stdout to another terminal but came empty handed.


    java - how to read array in another method/class -


    is new to Android I is quite familiar with Objective-C as you can see that I have an array list which That's loaded with a CSV file. I can not seam to straighten it that I was stolen in my "Public Zero Button (see V)" for this string "string ARR: list" why can I read the array list ... "

      @ override protected form zero (bundle saved instenstate) {super.ncre (savedinstenstate); setContentView (R.layout.activity_main); SearchButton = (button) Find ViewById (R.id. FindButton); //searchButton.setOnClickListener(this); MainSearchView = (EditText) findViewById (R.id.searchText); spinner1 = ( Piner) Find VVBID (Rd Titel category 1); List of & lt; string & gt; list = new arrelist & lt; string & gt; (); {InputStreamReader csvStreamReader = New InputStreamReader (MainActivity.this.getAssets ( Try "csv"); csvr reader = new csvrder (csvstream reader); log d. ("Test", "csv read"); string [] next line; while ((nextLine = Reader.readNext () = = null) {list.add (next line [0] + next line [1] + next line [2]);}} grip (IOException e) {e.printStackTrace (); }} Public Zero Button Clicked (see V) {Log D. ("Test", "button click"); StrFind2 = Main Search View .getText (). ToString () ToLowerCase (); / * (String ARR: list) {if (Stront Constants (Striffind 2)) {Log D. ("Test", "Easy"); } And {Log D. ("Test", "not easy"); } * /}}  

    Can anyone guide me?

    Prepare your code, I think you are reaching the list within the same activity.

    Just declare,

      list & lt; String & gt; List; Access  

    as a class level member field ,

    and click on the button (see V)

      private list & lt; String & gt; List @ Override Protected Zero (Bundle Saved InstantState) {super.onCreate (SavedInstanceState); SetContentView (R.layout.activity_main); SearchButton = (Button) Find ViewById (R.id.findButton); //searchButton.setOnClickListener(this); MainSearchView = (EditText) findViewById (R.id.searchText); Spinner 1 = (spinner) Find VVBIID (R. Tietel Category 1); List = New Arrestist & lt; String & gt; ();  

    In addition to this, I am suggesting you to read basic Java programming tutorials about class and variables and scope of methods.


    angularjs - Angular JS - How can I get the ngModelController by its model name? -


    In my custom command, I need to update the validity of another input. The instruction is something like this:
    & lt; CustomDirective = "foo" & gt; , in which the value foo is the name of the other ngmodel.

    My director, I can get the model of this like this:
    var foo = scope [attrs.foo];

    But how can I get its NGMDL controller to determine its validity? Just like this: fooModelController $ SetValidity ('custom directive' is true);

    Edit:

    In HTML, the input is defined:

      & lt; Input type = "text" name = "dateDebut" id = "dateDebut" class = "form-control" ng-model = "formData.dateDebut" customDirective = "dateFin" required & gt; & Lt; Input type = "text" name = "dateFin" id = "dateFin" class = "form-control" ng-model = "formData.dateFin" customDirective = "dateDebut" required & gt;  

    I get the dome node by angular.element.find (document.querySelctor ('# dateDebut')) ;

    angular Element (document.querySelctor ('# dateDebut')) controller ('ngModel') - This will be given on the ngModelController defined #dateDebut element.

    Here is plnkr:


    javascript - Calling function of non amd in requirejs -


    I & amp; have read; I want to understand this concept more clearly, so I have made my two files

    lorem.js :

      var lorem = { }; Lorem.fun1 = function () {console.log ('aaa'); };  

    ipsum.js :

      var ipsum = {}; Ipsum.color = 'a'; Ipsum.fun1 = function () {lorem.fun1 (); };  

    Depending on Ipsum Lorame I have done something like this in the Shim configuration:

      // file name: main.js // Require.js us The shortcut allows the nickname to be configured // The usage will be more clear in this tutorial. Need help .config ({baseUrl: 'js', path: {/ * jquery: [//' https://ajax.googleapis.com/ Ajax / libs / jquery / 2.1.3 / jquery.min ',' Libs / Jquery / jquery '], backbone: [' Libs / Backbone / Backbone '], underscore: [' Libs / underscore / underscores'], * / Ipsum: 'Non Amed / Ipsum', Loram: 'Non Amed / Lore '}, Shim: [/ Jquery: {export:' jQuery '}, underscore: {export:' _ '}, spinal cord: {deps: [' jquery ',' underscores'], export: 'backbone' }, * / Ipsum: {Deps: ['Lorem'], export: 'epsom'}}}); Expected (['ipsum'], function (Ipsum) {console.log (Ipsum);});  

    However, in console.log (Ipsum) print undefined console. What am i doing wrong

    Your mistake is in Shim configuration.

      ipsum: {deps: ['lorem'], should be exported: 'epsom'}  

      Ipsum: {deps: focus on changing case with '' Ipsum 'from ' ipsum '.  .  should be a global variable in  ipsum  in  ipsum.js . 

    In Javascript, variable names are case-sensitive, so Ipsum and Ipsum are different because you have Ipsum , only < Code> ipsum , it was printed undefined .


    graph - Linear time single-pair-shortest-path algorithm? -


    क्या कोई एल्गोरिदम है जो एकल-जोड़ी-छोटी-छोटी समस्या का नकारात्मक, वास्तविक किनारे-भार और के साथ, मिश्रित रेखांकन के लिए रैखिक समय (यानी निर्देशित और अंडर्रॉइड किनारों या दो निर्देशित किनारों के रूप में दर्शाए गए अंडरडाइड किनारों) गैर-नकारात्मक चक्र ?

    केवल समस्या का एकल-स्रोत और सभी-जोड़े प्रकार के लिए एल्गोरिदम का उल्लेख किया है मुझे पता है कि इन समस्याओं में से एक को सुलझाने में भी एकल-जोड़ी समस्या का समाधान होता है, लेकिन उनमें से कोई भी रैखिक समय और उपरोक्त सभी मानदंडों के साथ काम करता है।

    सभी उपरोक्त मानदंडों के साथ सिंगल-जोड़ी के सबसे कम पथ समस्या के लिए रैखिक समय algorthm?

    नहीं, नहीं। Intuitively, कोई एकल-जोड़ी कम से कम-पथ एल्गोरिथ्म जो नकारात्मक बढ़त के वजन को एक-स्रोत एल्गोरिथ्म की तुलना में अधिक अस्मित रूप से सक्षम हो सकता है, क्योंकि लक्ष्य के लिए सबसे छोटा रास्ता खोजना संभवतः सबसे बुरे मामले में प्रत्येक निश्चित अनुपात के प्रत्येक के लिए सबसे छोटा रास्ता मिल सकता है अन्य नोड्स (यह निर्धारित करने के लिए कि क्या प्रत्येक के नकारात्मक-वजन किनारों को घुसने के लायक है) की।


    c# - Issue with writing a Unit Test for HttpContext.Current.Session -


    I have a working application for which I must now add a complete set of unit test. The current code stores user information in the following ways:

      HttpContext.Current.Session ["UserInfo"] = userData;  

    I am using moq for my test, and my unit test has the following code:

      var Server = new fake & lt; HttpServerUtilityBase & gt; (MockBehavior.Loose); Var response = new mask & lt; HTTPRPSPassbase & gt; (Fake Biievic. Secret); Var Requests = New Imitation & lt; HttpRequestBase & gt; (MockBehavior.Strict); Var reference = new fake & lt; HttpContextBase & gt; (); Context.SetupGet (x => x.Request). Return (request.Object); Reference.setupGet (x => x.Response). Response.Object; Reference.setupGet (x = & gt; x.Server). Return (server.Object); Var Controller = New Login Controller (); Controller Controller Resources = New Controlling (context, new RootData (), Controller); JsonResult result = Controller.login (new login inhale {user name = "myusername", password = "invalidpassword"}) as JSN;  

    Of course, when I try to create session process session data, I get an "object reference not set for an example of an object". Error because hpp The file is zero.

    Some research has shown to me that using the current is not very compatible with MSTE, so I understand that the way I store / load my user information will need to be changed, however, I would like some advice on how to go here.

    I would appreciate any suggestions on how to make tests for my unit, or to collect user information in a different way to make it compatible with unit tests.

    This solution I came up with is a combination of some things that I have here in different places I've got:

    First of all, I have created 2 squares. MockHttp session and MockHallers public class MockHttp session: HttpSessionStateBase {dictionary & lt; String, Object & gt; M_SessionStorage = New Dictionary & lt; String, Object & gt; (); Public override object this [string name] {return m_SessionStorage [name]; } Set {m_SessionStorage [name] = value; }} Public override zero Abandon () {// nothing}} Public class MockHelpers {public static HttpContext FakeHttpContext () {var httpRequest = new HttpRequest ("", "http: // localhost /", ""); Var stringWriter = new stringwriter (); Var httpResponse = New HttpResponse (stringWriter); Var httpContext = New HttpContext (httpRequest, httpResponse); Var sessionContainer = New HttpSessionStateContainer ("id", new session state compilation (), new HttpStaticObjectsCollection (), 10, true, HttpCookieMode.AutoDetect, sessionStateMode.InProc, incorrect); Session status AdhesHepiationStatisticsContact (HTQIntext, SessionContainer); Return httpContext; }}

    Then I changed my unit test code to use them:

      var server = new mask & lt; HTTP server utilitybase & gt; (Mokavihar, Loz); Var response = new mask & lt; HTTPRPSPassbase & gt; (Fake Biievic. Secret); Var Requests = New Imitation & lt; HttpRequestBase & gt; (MockBehavior.Strict); Var session = new MockHttp session (); Var reference = new fake & lt; HttpContextBase & gt; (); Context.SetupGet (x => x.Request). Return (request.Object); Reference.setupGet (x => x.Response). Response.Object; Reference.setupGet (x = & gt; x.Server). Return (server.Object); Context.SetupGet (x = & x; session.). Return (session); HttpContext.Current = MockHelpers.FakeHttpContext (); Var Controller = New Login Controller (); Controller Controller Resources = New Controlling (context, new RootData (), Controller); JsonResult result = Controller.login (New Login Heller {userName = "MyUserName", password = "" InvalidPassword}) as JsonResult;  

    This code was able to test successfully with both valid and invalid passwords.

    Thanks to everyone for your help


    What is the Regex to Search a XML tag and remove comma from the value in a notepad++ -


    एक्सएमएल टैग एक xml दस्तावेज़ में है

    XML डॉक:

     < कोड> & lt; रूट & gt; & LT; जनक & gt; । । & LT; एबीसी & gt; 1543 & lt; / एबीसी & gt; । । & Lt; / जनक & gt; & Lt; / रूट & gt;  

    आउटपुट:

      & lt; रूट & gt; & LT; जनक & gt; । । & LT; एबीसी & gt; 1543 & lt; / एबीसी & gt; । । & Lt; / जनक & gt; & Lt; / रूट & gt;  

    मुझे एक एक्सएमएल संपादक या नोटपैड ++ में चलाया जाने वाला रिजक्स क्या है, जो मुझे आउटपुट देता है या फिर उस विशिष्ट टैग से कॉमा को दूर करता है

    xml इस तरह से बहुत बड़ा । 1,543 । । । 1,543 । । । 1,543 । । । 1,543 । । । 1,543 ।

    यह करने का सबसे अच्छा तरीका क्या है

    मान लें कि आपके पास केवल एक अल्पविराम है , के लिए खोजें:

      (& lt; एबीसी & gt;। *) [,] (। *  

    इसके साथ बदलें:

      $ 1 $ 2  

    यदि आपके पास कई अल्पविराम हैं, तो आपको इसे कई बार चलाने होंगे यदि टैग नई लाइनों (\ r \ n या सिर्फ \ n) के साथ टूट गए हैं तो आपको उन लोगों को रिगेक्स में शामिल करना होगा।

    ध्यान दें कि यदि आपका एक्सएमएल एक पंक्ति पर है, तो यह रीजेक्स

      & lt; एबीसी & gt; 123 & lt; / एबीसी & gt; & amp; lt; अन्यटैगWhereCommasAreOk & gt; और & lt; / अन्यटैगवेरेकैमआरेक & gt; & lt; एबीसी & gt; 456 & lt; / एबीसी & gt; अनपेक्षित परिणाम हो सकता है।  

    और अलग टैग में अल्पविराम की जगह।

    वास्तव में एक मजबूत समाधान के लिए, आप शायद XSLT का उपयोग करना चाहते हैं रेगेक्सस आपको केवल एक्सएमएल में तुच्छ मामलों के साथ मिल जाएगा। टेम्पलेट में

      & lt; xsl: के लिए प्रत्येक चयन = "/ रूट / अभिभावक / एबीसी" & gt; & Lt; xsl: if test = "इसमें शामिल हैं (।, ',')" & Gt; & Lt; xsl: value-of select = "concat (substring- से पहले (।, ','), Substring-after (।, ',') / & Gt; & lt; / xsl: if & gt; & lt; / xsl: for- प्रत्येक & gt;  

    आप टेम्पलेट बनाते हैं और इसे नोटपैड ++ में XML उपकरण का उपयोग करके चलाते हैं


    php - Removing first dimension element if second dimension value is repeated -


    मेरे पास इस तरह एक सरणी है

      $ posts = array (array ('post_title) '= & Gt; 10,' post_id '= & gt; 1), सरणी (' पोस्ट_ शीर्षक '= & gt; 11,' पोस्ट_आईडी '= & gt; 2), सरणी (' पोस्ट_शीर्षि '= & gt; 12,' post_id '= & gt; 3), सरणी ('पोस्ट_शीर्षि' = & gt; 13, 'पोस्ट_आईडी' = & gt; 4), सरणी ('पोस्ट_ शीर्षक' = & gt; 10, 'post_id' = & gt; 5));  

    अगर उसका 'पोस्ट_ शीर्षक' या 'पोस्ट_id' मान दोहराया जाता है तो मैं पहले आयामी तत्व कैसे निकाल सकता हूँ?

    उदाहरण:

    मान लीजिए हम जानते हैं कि 'पोस्ट_चिटिल' दो प्रथम आयामी तत्वों में '10' है।

    मैं $ पदों से दोहराए गए तत्व को कैसे निकाल सकता हूँ? धन्यवाद।

    एक नया सरणी बनाएं जहां आप इन पोस्ट_चिटिल मानों को संग्रहीत करेंगे। लूप के माध्यम से $ posts सरणी और किसी भी डुप्लिकेट को अनसेट नहीं करें उदाहरण:

      $ posts = array (array ('post_title' = & gt; 10, 'post_id' = & gt; 1), सरणी ('post_title' = & gt; 11, 'post_id' = सरणी ('पोस्ट_शीर्ष' = & gt; 13, 'post_id' = & gt; 4), सरणी ('पोस्ट_शीर्ष' '& gt;), सरणी (' पोस्ट_शीर्षि '= & gt; 12,' पोस्ट_आईडी '= & gt; 3) ; 10, 'पोस्ट_आईडी' = & gt; 5)); $ Tmp_array = array (); Foreach ($ i = & gt; $ पोस्ट के रूप में $ पद) {if (! In_array ($ post ['post_title'], $ tmp_array)) // यदि यह मौजूद नहीं है, तो इसे {$ tmp_array [] = $ post ['शीर्षक पोस्ट करें']; } अन्य {// तत्व मौजूद है, इसे अनसेट ($ पोस्ट [$ i]) में हटाएं; }}  

    अब आपके $ posts ऐरे में आपके पास अद्वितीय पोस्ट_शीर्षक मान होंगे।


    primefaces - JSF selectonemenu il8n -


    I would like to make a p: selectOneMenu items where the values ​​and selected values ​​display the translation strings. The French has changed their language for the user, the dropdown content and selection will be displayed in all French, etc. Is

    present their string value that knows the list of values, each of which appear in each language (I know this is probably a antipattern, will refactor once it is working. )

    I solved the problem in displaying the elements drop down in the translation fashion using the following code. . I have also created a subclass of the Omnifaces SelectItemsConverter class to get the translated string of each object

       & Lt; P: column & gt; & Lt; Div class = "link-item - # {lnk.linkageTypeId}" & gt; & Lt; H: outputtext value = "# {lnk.getKeyValue (language.localeCode)}" /> & Lt; / Div & gt; & Lt; / P: column & gt; & Lt; / P: selectOneMenu & gt;  

    Link type Select Internet

      @FacesConverter ( "linkageTypeSelectItemsConverter") public class applied LinkageTypeSelectItemsConverter SelectItemsConverter the Serializable implement {@Override public string getAsString ( FacesContext reference, UIComponent component, object value) {last string locale = context.getApplication (). EvaluateExpressionGet (reference, "# {language.localeCode}", String.class); If (value instanceof LinkageTypeKey) {return (LinkageTypeKey) value) .getKeyValue (Locale); } And {return super.getAsString (reference, component, value); }}}  

    When the form is displayed, I can debug the converter, it is being translated, but the selected element ID is always the default language displayed in English . idea?

    converter item values, not to change item labels.

    You obviously need to specify itemLabel

      & lt; P:. SelectOneMenu value = "# {linkagecontroller.selectedLink}" converter = "omnifaces.SelectItemsConverter" & gt; & Lt; F: selectItems value = "# {linkagecontroller.linkageTypes}" var = "item" itemValue = "# {item}" itemLabel = "# {item.getKeyValue (language.localeCode)}" / & gt; & Lt; / P: selectOneMenu & gt;  

    This is just a bit weird approach to localization, you usually translate into the resource bundle instead of the model. It can also be used without a converter if it is a enum is

    See also:

    • .

    c# - Display the score in unity -


    I am totally new to unity, I am using a simple 2D platformer game unity. Does anyone help me display scores on the game? I'm stored the value on a variable variable below to the C # code which I used for the distance.

      using UnityEngine; Using System.Collections; Distance of public squared: Monobehavier {Private Ent Dish; // It is initialization zero awake () {dist = 0; } // update is called zero update per frame () {dist = dist + = 1 * Time.deltaTime; Print ("district:" + distribution); }}  

    I have to display the dist value on the screen. I have put a GUI text on the screen.

    To make it simple, you can - where are you printing something like this:

      GameAbject.Fund ("GUIText"). GuiText.text = dist;  

    , assuming that your GITED object is called GUIText . In fact, with that, you will find the object named, enter your text element, and modify it with the dist value.


    matlab - Table data is not editable at this location, why won't this checkbox let me check it? -


      f = shape; Column name = {'x', 'y'}; Selection = {'A', 'B', 'C', 'D', 'E'} [Wales {1: Number (Selection), 1}] = Deal (Wrong Columns) == 'Logical', 'Logical' '}; T = utility ('data', 'wal', column name ', column names,' column formom ', column form,' column idit ', [true true truth],' roanam ', selection);  

    If you run this script, it should remove a figure, but I can select only the checkbox in the X column of the table. Why is this?

    because variables vals have enough data to fill the table .

    Simply make it a 2-column array to repeat and it works. I.e., add this line: before making table

      vals = [vals vals]  

    .

    The whole code:

      f = shape; Close all the clear column names = {'x', 'y'}; Selection = {'A', 'B', 'C', 'D', 'E'} [Wall (1: Number) (Selection), 1}] = Deal (Wrong); Vals = [vals vals] column form = {'logical', 'logical'}; T = UTF ('data', 'wal', column name ', column name,' column format ', column form,' ro name ', selection,' column edit ', true (1,2 * size (selection, 1)); >  

    Output:

    Enter Image Details here

    Edit:

    In order to get the index of selected cells, you do not have to add new variables especially. < P> cell selection callback You can bring a direct index.

    Assume that you After creating Lika, this line combines:

      set (t, 'cell selection callback', @ selcb)  

    then use the function to function Can be done in the following way:

      function SLC (~, event) selected seals = event index and  

    each time When a cell is selected / deselected, one 1x2 element will produce vector.


    javascript - Onsen UI show a datepicker on ng-click -


    I'm thinking, is there a way to show a date picture by clicking on some claim tags?

      & lt; Input type = "date" ... & gt;  

    Shows a basic datepicker. I do not know any datepicker native connery but you can use the bootstrap date picker to get this really realistic Easy to use and can make a simple instructions datepicker.


    visual studio - VC++ specify library order - error LNK2005: already defined -


    मैं एक संपूर्ण विज़ुअल स्टूडियो समाधान को wxWidgets-2.6.4 (A) से wxWidgets-3.0.2 (B) । एक समस्या है क्योंकि कुछ प्रोजेक्ट wxhttpengine-2.0 (Z) का उपयोग करते हैं, जो 2.6.x से अधिक नए wxWidgets के संस्करणों के साथ काम नहीं करता है। प्रश्नों को सरल बनाने के लिए, मैंने ए, बी और जेड अक्षरों के साथ 3 स्थैतिक पुस्तकालयों को लेबल किया है। तो, मेरे समाधान में ए और जेड, ज़ में ए के हिस्से हैं, लेकिन मैं Z का रखरखाव करने के बजाय A का उपयोग करते हुए B का उपयोग करना चाहता हूं मेरे समाधान के कोड को आसान बनाने के लिए समस्या यह है कि केवल एक त्रुटि के कारण - LNK2005: पहले से ही httpengine.lib में परिभाषित - wxWidgets.3.0.2 स्थिर पुस्तकालयों के लिए ए और बी से विरोधी प्रतीकों को लिंकर द्वारा खोजा जाता है क्योंकि Z ए के शीर्ष पर बनाया गया है।

    सामान्य प्रश्न: मैं जे से किस प्रोजेक्ट को ए से अपग्रेड कर सकता हूं?

    < P> विशिष्ट प्रश्न: क्या दृश्य स्टूडियो में निर्दिष्ट करना संभव है जिसे मैं बी के साथ पहले और फिर जेड के साथ जोड़ना चाहता हूं

    यहाँ एक नमूना त्रुटि है:

    त्रुटि 1 त्रुटि LNK2005: "सार्वजनिक: वर्ग wxSize __thiscall wxWindowBase :: GetBestSize (शून्य) स्थिरांक" (? GetBestSize @ wxWindowBase @@ QBE AVwxSize @@ XZ) \ wxmsw30ud_core.lib पहले से ही में httpengined.lib (proxysettingsdlg.obj) पथ परिभाषित (Hidden_filename.obj)

    आप wxWidgets के दो अलग-अलग संस्करणों के साथ स्थिर रूप से लिंक नहीं कर सकते । सबसे अच्छा आप कर सकते हैं गतिशील रूप से कम से कम एक के साथ लिंक करने के लिए और, भ्रम से बचने के लिए, संभवतः उन दोनों के साथ बेहतर होगा।

    हालांकि मैं वास्तव में देख रहा हूं कि वास्तव में wxhtttpengine के साथ काम क्यों नहीं करता WxWidgets 3.0 इसे ठीक करने के लिए कठिन नहीं होना चाहिए और लाइब्रेरी के एक संस्करण का उपयोग करना बहुत आसान है।


    ios - Guidance - Custom UICollectionView animation -


    I'm looking for guidance to contact with the following animation scenario.

    I have UICollectionView's custom circular UICollectionViewLayout subclassed layout. Circles around the perimeter of the circle (circular) and in the center of the circle is a 50% larger (circular) image.

    When the user touches one of the perimeter images, then I want the image to go to the center (being 50% larger) and "join" with the middle image then I want to float on top of viewing two images. (The bottom part of this scene will be a reference to the things related to the two joining images).

    If this is understood by somebody, then I really appreciate any kind of starting point.

    Anyway, I'm an old developer, but new to iOS and development in Swift (but I can read the purpose).

    Thank you!

    I solved this using a visual move. Of course, I'm sure there is a better way.

    When one of the periphery chakras is used, then I make a change in the visual controller which immediately duplicates the center circle and tape circle places in its east, it appears that Other elements disappeared.

    Then I simulate the tape circle with the center and center image at the top of the scene together. I enclose the circle with tape in brief and then it is carried over the view next to the circle of the center so that the original shape of the image of the tape can be restored.

    Not elegant, but it works.


    gruntjs - Add css to vendor.css with yeoman angular generator -


    I have even created a new angular app using. I have chosen not to create an app with Bootstrap or Ches, because I want to use a theme.

    I have already installed the bootstrap using the booker

      bower install --save bootswitch  

    and related line first The same is in the bower.json file. But I do not know how to include it in a vendor's CSS file

    If I include style on index.html then it is deleted after running it

      grunt  

    but it keeps component-font-awesome, before I've already installed it with the Kunj.

    This build (head only)

      & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Meta name = "description" content = "" & gt; & Lt; Meta name = "viewport" content = "width = device-width" & gt; & Lt ;! - place favicon.ico and apple-touch-icon.png in the root directory - & gt; & Lt ;! - Build: CSS (.) Styles / vendor.css - & gt; & Lt ;! - bower: css - & gt; & Lt; Link rel = "stylesheet" href = "bower_components / components-font-awesome / css / font-awesome.css" /> & Lt ;! - Endbower - & gt; & Lt ;! - endbuild - & gt; & Lt ;! - Build: CSS (.tmp) styles / main cass - & gt; & Lt; Link rel = "stylesheet" href = "genres / main case" & gt; & Lt ;! - endbuild - & gt; & Lt; / Head & gt;  

    and this granular build

      & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Meta name = "description" content = "" & gt; & Lt; Meta name = "viewport" content = "width = device-width" & gt; & Lt ;! - place favicon.ico and apple-touch-icon.png in the root directory - & gt; & Lt ;! - Build: CSS (.) Styles / vendor.css - & gt; & Lt ;! - bower: css - & gt; & Lt; Link rel = "stylesheet" href = "bower_components / bootswatch / cerulean / bootstrap.css" /> & Lt ;! - Endbower - & gt; & Lt ;! - endbuild - & gt; & Lt ;! - Build: CSS (.tmp) styles / main cass - & gt; & Lt; Link rel = "stylesheet" href = "genres / main case" & gt; & Lt ;! - endbuild - & gt; & Lt; / Head & gt;  

    My grunting file is generated by default


    nservicebus - Output List of message routes -


    As part of my startup sequence, I am trying to log in those configurations that are defined in the configuration . I see (in the debugger) that what I see is coming in "StaticMessageRouter.routes". Is there any way to get programmatic access to these routes? This will allow me to see (in the log file) which are visible in this service, in the command / events as well as in the config files in the UnicastBuskConfig section.

    Does this mean? Is there any other way to accomplish the same goal?


    php - How to make image name with post_id wordpress -



    php - How to make image name with post_id wordpress -

    i have project auto create images each post id have save each separated image associated each post , image name should post id tried these methods not succeed

    wp-content/uploads/2014/<?php the_id(); ?>.png

    ===================================

    $id = get_the_id();

    then

    file_put_contents('wp-content/uploads/2014/text-$id.png', $image);

    so need php method save image post id in ths line

    file_put_contents('wp-content/uploads/2014/imagenamepostidhere.png', $image);

    thanks

    if $image fine, simple utilize concatenation or utilize double quotes utilize id:

    file_put_contents('wp-content/uploads/2014/text-$id.png', $image); // you're using single quotes, variables not interpolated

    either:

    $id = get_the_id(); file_put_contents('wp-content/uploads/2014/text-'.$id.'.png', $image);

    or

    file_put_contents("wp-content/uploads/2014/text-$id.png", $image);

    note: assuming have proper permissions.

    php wordpress imagesource

    php - How to show data stored in Liferay database in another website? -



    php - How to show data stored in Liferay database in another website? -

    i'm developing wordpress website in have show data/information stored within liferay database. new liferay, don't know best practices access info stored liferay's db , show them website.

    i want know if there guides or documentation can explain me how can access data, in same way access mysql db php. took @ official liferay documentation, describes accesses through usage of php portlets.

    is there way connect database , info query, or have perform sort of "middleware" translation info in liferay website?

    my cms contains info formatted in xml, have translation xml php-style variables? also, need create sort of correspondence xml objects php variables?

    i can think of 3 ways can info liferay display in website:

    directly through liferay database, if have access.

    but info straight database tables of liferay should have fair amount of understanding each table for. liferay db schema have been helpful think liferay likes providing puzzles users ;-). still tables , columns not complex understand if can give time. or post specific query , reply if know it.

    another recommended way of accessing liferay's info through liferay web-services, assets, users, organizations , sites available services. can build web-service clients , consume data.

    another way through sharing of portlets. user-guide help understand this. can straight embed portlets in site can embed video player youtube in site youtube's embed script.

    hope have understood require , hope helps.

    php mysql xml liferay portlet

    php - Codeigniter, how do i get 2 params in the controller using javascript? -



    php - Codeigniter, how do i get 2 params in the controller using javascript? -

    hey guys got shopping cart loads using jquery, im using codeigniter, , dont know how 2 of params utilize get. this's javascritp method calls script.

    function anade() { var idnumero = $(this).val(); var quant = $("#num" + idnumero).val(); $("#carrito").load("http://example.com/cart/addtocart?p=" + $(this).val() + "&cant=" + quant); }

    this old script, im implementing mvc codeigniter, wont re write this:

    session_start(); $suma=0; if (isset($_get['p'])) { $_session['product'][$_session['count']] = $_get['p']; $_session['quantity'][$_session['count']] = $_get['quant']; $_session['count']++; } $conexion = mysqli_connect($bd_servidor, $bd_usuario, $bd_contrasenia, $bd_basededatos); mysqli_set_charset($conexion, "utf-8"); echo"<table>"; ($i = 0; $i < $_session['count']; $i++) { //echo "product: " . $_session['product'][$i] . "<br />"; $query = "select * producto idproducto=" . $_session['producto'][$i] . ""; $resultado = mysqli_query($conexion, $query); while ($fila = mysqli_fetch_array($resultado)) { echo "<tr><td>unid : ".$_session['quantity'][$i]."</td><td>" . $fila['name'] . "</td><td> " . number_format(($_session['quantity'][$i]*$fila['price']),2) . "</td></tr>"; $suma+= $_session['quantity'][$i]*$fila['price'] ; } } //echo"<hr>"; echo "<tr><td>subtotal</td><td></td><td>". number_format($suma,2)."</td></tr>"; echo "</table>";

    i know how should controller. ok? function getcart($p, $cant){ method...}

    thxs!

    here code should utilize 2 parameters in codeigniter.

    java script

    function anade() { var idnumero = $(this).val(); var quant = $("#num" + idnumero).val(); $("#carrito").load("http://example.com/cart/addtocart/" + $(this).val() + "/" + quant); }

    in codeigniter

    function getcart($p, $cant) { }

    javascript php jquery ajax codeigniter

    python - Taking a function stdout output to shell and print it tkinter -



    python - Taking a function stdout output to shell and print it tkinter -

    i using pafy module download youtube videos,but in 1 of pafy functions, called "download" prints screen progress of download, take output , set in tkinter window.

    here pafy function:

    video = pafy.new(url) best_video = video.getbest(preftype="mp4") write_prog("started downloading "+video.title) best_video.download()

    the lastly function("best_video.download()") 1 prints screen

    any ideas of how that?

    python printing tkinter

    android - Receiving No apps can perform this actions error -



    android - Receiving No apps can perform this actions error -

    i attempting app offer me selection of browser use. have assigned url http://google.com. when run it, 'no apps can perform actions' error. i'm missing , cant figure out.

    public class myclass{ static private final string url = "http://www.google.com"; .. .. implicitactivationbutton.setonclicklistener(new onclicklistener() { // phone call startimplicitactivation() when pressed @override public void onclick(view v) { startimplicitactivation(); } }); private void startimplicitactivation() { log.i(tag, "entered startimplicitactivation()"); intent baseintent = new intent(intent.action_send,uri.parse(url)); string title = "choose browser"; intent chooserintent = intent.createchooser(baseintent, title); log.i(tag,"chooser intent action:" + chooserintent.getaction()); startactivity(chooserintent); } ... ... }

    to view web page, utilize action_view, not action_send.

    android android-intent browser

    linux - All files put into a folder "foo" by user "a" or "b" should belong to the "bar" group and only be visible by them -



    linux - All files put into a folder "foo" by user "a" or "b" should belong to the "bar" group and only be visible by them -

    pre requisite steps:

    create 2 new user accounts "a" , "b"

    # useradd # useradd b

    create grouping "bar". create directory "foo".

    # groupadd bar # mkdir /tmp/foo

    task:

    all files set "foo" directory users "a" or "b" should belong "bar" grouping , visible them.

    chgrp bar /tmp/foo [changes grouping ownership of foo bar due added foo belong bar]

    you can set acl permissions as:

    setfacl -m u:a:rwx /tmp/foo

    linux command-line chmod rhel chgrp

    c++ - Difference between allocating memory in struct and main? -



    c++ - Difference between allocating memory in struct and main? -

    i have 2 simple structures this:

    struct point{ double x, y; };

    what difference between defining this

    struct circle{ point *p; float radius; };

    and this

    struct circle{ point *p = new point; float radius; };

    is there advantages if utilize first sample , in main function

    circle *c = new circle; c -> p = new point;

    this:

    struct circle{ point *p = new point; float radius; };

    uses c++11 in-class initialization. means default, if no other constructor otherwise (there none in example), p set new point constructed circle. equivalent less lines of code illustration explicitly set p after creating circle.

    of course, illustration code you've provided, you'd improve off using value instead of pointer:

    struct circle{ point p; float radius; };

    then there point within circle, , won't have have long awkward conversation resource management, memory leaks, etc.

    c++ pointers new-operator

    python - Use numpy.average with weights for resampling a pandas array -



    python - Use numpy.average with weights for resampling a pandas array -

    i need resample info numpys weighted-average-function - , doesn't work... .

    this test-case:

    import numpy np import pandas pd time_vec = [datetime.datetime(2007,1,1,0,0) ,datetime.datetime(2007,1,1,0,1) ,datetime.datetime(2007,1,1,0,5) ,datetime.datetime(2007,1,1,0,8) ,datetime.datetime(2007,1,1,0,10) ] df = pd.dataframe([2,3,1,7,4],index = time_vec)

    a normal resampling without weights works fine (using lambda function parameter how suggested here: pandas resampling using numpy percentile? thanks!):

    df.resample('5min',how = lambda x: np.average(x[0]))

    but if seek utilize weights, returns typeerror: axis must specified when shapes of , weights differ:

    df.resample('5min',how = lambda x: np.average(x[0],weights = [1,2,3,4,5]))

    i tried many different numbers of weights, did not better:

    for in xrange(20): try: print range(i) print df.resample('5min',how = lambda x:np.average(x[0],weights = range(i))) print break except typeerror: print i,'typeerror'

    i'd glad suggestions.

    the short reply here weights in lambda need created dynamically based on length of series beingness averaged. in addition, need careful types of objects you're manipulating.

    the code got compute think you're trying follows:

    df.resample('5min', how=lambda x: np.average(x, weights=1+np.arange(len(x))))

    there 2 differences compared line giving problems:

    x[0] x. x object in lambda pd.series, , x[0] gives first value in series. working without raising exception in first illustration (without weights) because np.average(c) returns c when c scalar. think computing wrong averages in case, because each of sampled subsets returning first value "average".

    the weights created dynamically based on length of info in series beingness resampled. need because x in lambda might series of different length each time interval beingness computed.

    the way figured out through simple type debugging, replacing lambda proper function definition:

    def avg(x): print(type(x), x.shape, type(x[0])) homecoming np.average(x, weights=np.arange(1, 1+len(x))) df.resample('5min', how=avg)

    this allow me have @ happening x variable. hope helps!

    python numpy pandas weighted-average

    r - How to apply a summary function to multiple columns of a data table -



    r - How to apply a summary function to multiple columns of a data table -

    first off, let's false data

    >library(data.table) >dt = data.table(x=c('a','a','b','b'),y=c('x','y','x','y'),z=c(1,2,3,4)) >dt x y z 1: x 1 2: y 2 3: b x 3 4: b y 4 >df<-data.frame(dt) >df x y z 1 x 1 2 y 2 3 b x 3 4 b y 4 cols<-cbind('x','y') > df[,cols] x y 1 x 2 y 3 b x 4 b y > lapply(x=df[,cols],fun=paste,sep=', ',collapse=', ') $x [1] "a, a, b, b" $y [1] "x, y, x, y"

    this feels should simple. how do apply dt? i'm trying stick data.frame can run on big info sets (n > 1 mil). closest i've been able come has been:

    > dt[,lapply(x=list(get(cols)),fun=paste,sep=', ',collapse=', ')] v1 1: a, a, b, b

    it's applying function first of 2 columns specified.

    as.list(dt[, lapply(.sd, paste, collapse = ","), .sdcols = c('x','y')]) #$x #[1] "a,a,b,b" # #$y #[1] "x,y,x,y"

    r data.table

    php - Linux Ubuntu 14.00 - Apache2 file not found error - where file exists -



    php - Linux Ubuntu 14.00 - Apache2 file not found error - where file exists -

    i using vps installed ubuntu 14 os. installed apache2 , php5, more info installed think can see here: http://www.crankpost.com/phpinfo.php

    i have unusual problem. when transfered website old hosting vps started receive unusual error.

    the problem says file post.php missing when it's not.

    i've created phpinfo.php , can see can open it. file phpinfo.php right next post.php post.php can't opened.

    try yourself: rankpost.com/post.php <- can't open it.

    the file permission post.php same phpinfo.php 644.

    i downloaded website filezilla , uploaded new hosting vps winscp if matters. maybe someting transfer method ?

    can please help me resolve unusual problem ?

    edit:

    here .htaccess file:

    options +followsymlinks rewriteengine on rewritecond %{http_host} ^crankpost.com [nc] rewriterule ^(.*)$ http://www.crankpost.com/$1 [l,r=301] rewriterule ^home mhome.php rewriterule ^checklogin clogin.php rewriterule ^login login.php rewriterule ^logout log-out.php rewriterule ^registration createacc.php rewriterule ^create-account register.php rewriterule ^confirm-email=([^/.]+)?$ activateacc.php?id=$1 [l] rewriterule ^profile=([^/.]+)?$ member.php?id=$1 [l]

    here content of post.php

    if(isset($_post['querystring'])) { $querystring = mysql_real_escape_string($_post['querystring']); if(strlen($querystring) >0) { $query = mysql_query("select * profiles name '%" .$querystring . "%' limit 10"); if(mysql_num_rows($query) >= 1) { while($row = mysql_fetch_array($query)) { $name = mysql_real_escape_string($row['name']); echo '<a href="# "onclick="fill(\''.$name.'\');">'.$name.'</a>'; } } else { ?> <div style="display:block;line-height:35px;color:black;"> <?php echo noresult;?> </div> <? } } else { // nil } } else { echo 'there should no direct access script!'; }

    and when hold content file not opening if alter content more simple this:

    if(1 == 1) {echo "hi";} else{ echo "bye"; }

    with content it's opening normal. going on !?!?

    i don't know hapening...

    am missing library ?

    thanks in advance!

    you using mysql_ function deprecated since php 5.5. need alter this, file isn't usable installed version of php 5.5.

    that's error comes from

    have on mysqli_ or pdo

    php linux apache ubuntu

    python - How to get current ID record in a domain field in OpenERP7? -



    python - How to get current ID record in a domain field in OpenERP7? -

    simple openerp7 question:

    i adding new field model. field many2one. going show every active partner has specific parent_id: parent_id must id of current record. how can this?

    here, 1 of failed attempts. should this:

    'main_contact_id': fields.many2one('res.partner', 'main contact', domain=[('active','=',true), ('parent_id','=',self.id)]),

    you can't in model definition there no concept of id of current record (this model definition after all, not instance of record). should add together domain on field in form , should able utilize id memory. domains in model can utilize static info such active = true.

    python openerp openerp-7

    solr - No statistics shown at DSpace home -



    solr - No statistics shown at DSpace home -

    i see statistics our dspace instance. if click statistics link (in dspace demo it's: http://demo.dspace.org/xmlui/statistics) see:

    no reports available there no reports available service. please check later.

    in solr, usage statistics, search statistics , workflow statistics fine. checked code , found statistics page class org.dspace.app.xmlui.aspect.artifactbrowser.statisticsviewer used. uses old statistics implementation (where text files need generated , parsed).

    is expected behaviour , why working @ http://demo.dspace.org/xmlui/statistics ? think create work have run legacy scripts stat-general, stat-initial, stat-monthly ... (https://wiki.duraspace.org/display/dsdoc4x/command+line+operations)

    christian

    you're right. /statistics link directs old legacy statistics.

    on dspace demo seem generated when accessed http://demo.dspace.org/xmlui/statistics

    using legacy statistics not advised since not subject modern robot detection , filtering principles used in more recent solr statistics implementation.

    solr statistics dspace

    SQL Server 2008 R2 Upgrade / Server Move to SQL Server 2014 -



    SQL Server 2008 R2 Upgrade / Server Move to SQL Server 2014 -

    i have new server , want install sql server 2014 standard , migrate database across old server runs sql server 2008 r2 (10.50.1600.1).

    i have upgraded locally, having move servers on production environment complicates matters, thought i'd inquire best way progress giving situation. can think of different options upgrade, not sure best choice:

    would best upgrade current sql server 2008 r2 box service pack 2 before thinking upgrade, or not create difference if i'm upgrading? if do, best alternative below?

    1) install sql server 2008 r2 service pack 2 on current server, upgrade in-situ sql server 2014, perform backup. restore sql server 2014 backup on new server.

    2) install sql server 2008 r2 service pack 2 on current server, perform backup. restore sql server 2008 r2 backup on new server on sql server 2014.

    i understand sql server 2014 includes new total text search features not available in 2008 prompted part of installation process, i'm thinking if restore 2008 backup on 2014 not 'upgrading' in full. hence improve take alternative 1 (above) on alternative 2?

    -> restoring backup not upgrade database. so, 1)microsoft sql server 2014 installation setup provide options upgrade database either 2008 r2 or 2012. preform process , provide info if database upgrade able or required create changes old database. after can proceed upgrade database 2008 r2 2014.

    eg. click start, point programs, point microsoft sql server 2014 , , click sql server 2014 upgrade advisor. farther details http://msdn.microsoft.com/en-us/library/ms144256.aspx

    my recommendation install sql server 2014 instance , backup , migrate database sql server 2008 r2 sql server 2014

    2) there other 3rd party tools preform necessary processes , messaging before upgrade.

    sql-server sql-server-2008 sql-server-2014 sql-server-administration

    java - Select different file in file browse window during rumtime -



    java - Select different file in file browse window during rumtime -

    i using selenium web driver deal file browse window. after trying different things find solution using autoit.

    script

    @test public void test() throws interruptedexception, ioexception { driver.manage().window().maximize(); thread.sleep(1500); driver.findelement(by.xpath("//div[@id='input-file-wrapper']")).click(); thread.sleep(1000); process proc =runtime.getruntime().exec("d:\\upload.exe"); driver.findelement(by.xpath("//div[@id='go-btn']")).click(); //driver.findelement(by.name("file name")).sendkeys("d:\\[limetorrents.cc]_daawat e ishq (2014) dvdscr x264 [dtrc] .torrent"); driver.findelement(by.xpath("//div[@id='cloud-free-btn']")).click(); /* webdriverwait wait=new webdriverwait(driver,50); wait.until(expectedconditions.visibilityofelementlocated(by.xpath("//div[@class='vlc- playlist']"))); */ thread.sleep(1000); // string i= driver.findelement(by.xpath("//div[@class='seed-number']")).gettext(); boolean i1=driver.findelement(by.xpath("//div[@class='vlc-playlist']")).isdisplayed(); system.out.println(i1); { driver.manage().timeouts().implicitlywait(10, timeunit.seconds); i1=driver.findelement(by.xpath("//div[@class='vlc-playlist']")).isdisplayed(); } while(i1!=true); thread.sleep(1000); driver.findelement(by.xpath("//img[@alt='trash']")).click(); driver.findelement(by.xpath("//div[@class='confirm-to-remove']")).click(); }

    script autoit follow has generate upload.exe file, , have given in path name

    winwaitactive("file upload") send("[kickass.to]desi.kattey.2014.1cd.dvdscr.rip.hindi.xvid.mp3.mafiaking.teamtnt.exclusive.torrent") send("{enter}")

    here takes single file every time run this. how take different files.

    autoit script has provision pass parameters command line. when using runtime.exec("process") execute autoit script, @ point of time pass file name argument , take command line argument in script. allow me know if helps.

    java selenium