Saturday, 15 August 2015

javascript - dynamic grid as custom directive -


I am relatively new to Kangaroo and stuck on custom instructions. I am trying to create a dynamic grid as a custom directive. I have already had to work as part of this:

There are some scenarios where I need to set the attributes on some elements of the grid. This part has me Stumped I am planning to include attributes in the form of an array inside the object and then putting it in the html tag of the affiliate entry. This section is shown here:

If you look at the "entries" array in the controller, then I have now changed it to include an "attributes" array In which the property properties and properties should be applied to these related columns then the corresponding columns.

For example

  (first entry of the array) col1: {text: 'Obj1.col1', attributes: [{atri: 'ng-class', attriv : 'Probaul =='? "SomeClass": "someOtherClass" '}, {attr:' id ', attrVal:' {{propName}} {{$ index}} '}]}, ... Sorting for a brief  

This array entry should be translated into:

  & lt; Td ng-class = "propVal ==" 'some class': 'someOtherClass' "id =" col11 "& gt; Obj1.col1 & lt; / TD & gt;  

I have read some articles about executing orders for compilation, controller, pre-link and post-link functions and play with different commands and try to compile themselves. , But all this has failed, probably because I do not understand the depth of how it all are relation together. If someone can help me in the right direction or point in the right direction, if I am going on the wrong path, then I appreciate it.

OK, in the end I thought how using an embedded custom instructions inside an original custom command Grid should be generated in a grid dynamically.

Here is a show that shows how I did this:

I have HTML templates defined:

  & lt; Div ng-grid ng-collection = "entries" ng -collection- headings = "headings" ng-button-click = "the action (INP)" & gt; & Lt; Div ng-checkbox-column & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

and then as ng-grid directive :

 . (NgCollectionHeadings: "=", ngCollection: "=", ngButtonClick: "& amp;"}, Template: function (element, etters); directive ("ngGrid", function () {return: restricted: "A", scope: {Var children = element.html (); Kids = Children (.trim) Copy (/ div / g, "td"); var htmlText = "& lt; input type = 'button' ng-click = 'button clicked ( ) 'Value' = Grid Directive '/> & lt; {{Heading}} & lt; / th & gt; & lt; / tr & gt; & lt; Table Category =' Table Table-boundary '&' Gt; & lt; thead & gt; & lt; tr & gt; & lt; th ng-repeat = 'heading ng cloling heading'; / tad & Gt; TDA & gt; & lt; tr id = 'item {{$ index}}' ng-repeat = 'item in nigulation' & gt; "+ children +" & lt; / tr & gt; & lt; / Tag & gt; & lt; / table & gt; "; HTMLText;} Return, Controller: Function ($ area, $ element) {$ scope.buttonClicked = function (inp) {if (typeof inp! = 'Undefined' ); Inp = inp + ", via grid instruction."; Else inp = "From the grid instruction."; $ Scope.ngButtonClick ({inp: inp});}}}};})  
and finally ng-checkbox-column director :

  .directive ("ngCheckboxColumn", function () {return {restricted: "A" , Template: Function (L Ermines, attributes) {var htmlText = "& lt; Td> & Lt; Label & gt; Input type = 'checkbox' ng-model = 'item.checked' ng-click = 'TempButtonClicked ()' /> From the checkbox directive. & Lt; / Labels & gt; & Lt; / Td> "HTML Text; Return; Controller: Function ($ Scope, $ element) {$ scope.tempButtonClicked = function} {Var val =" From checkbox directive "; $ scope.buttonClicked (val);}}}}}}  

My data collection is very straight forward:

  $ scope.headings = {head1: 'title1', head 2: 'Heading 2', Head 3: 'Heading 3'}; $ Scope.entries = [{col1: 'Obj1.col1', col2: 'Obj1.col2', col3: 'Obj1.col3', checked : Incorrect}, {col1: 'Obj2.col1', col2: 'Obj2. Col2', col3: 'Obj2.col3', checked: incorrect}, {col1: 'Obj3.col1', col2: 'Obj3. Col2 ', col3:' Obj3.col3 ', checked: incorrect}, {col1:' Obj4.col1 ', col2:' Obj4.col2 ', col3:' Obj4.col3 ', f OK: It is still not completely completed, but you should get the original idea. 


php - Calculate and Convert IPv6 Address based on CIDR Prefix -


I have an IPv6 address with a CIDR prefix. Ex: 2001: 0: 3238: DFE1: 0063 :: efef / 32

I would like to write a function such that the IPv6 address matches the number of bits CIDR The prefix is ​​provided, this means if a prefix of 32 is provided, then 32 bits in the IP address should start from left and the remaining should be zero. In the above example, the desired output should be:

  2001: 0000: 0000: 0000: 0000: 0000: 0000: 0000/32  

I 2001 :: / 32

The CIDR prefix can range from 0-128.

It is based on this post so far what is mine, but I'm not sure it is giving the desired output. Can anyone see it and help? Am I thinking about the representation of CIDR directly?

  public function getCIDR metadata ($ ipAddress) {// address and prefix length divided into list ($ firstaddrstr, $ prefixlen) = explosion ('/', $ IPADDRESS); // Parse the address in a binary string $ firstaddrbin = inet_pton ($ firstaddrstr); // To convert binary string into hexadecimal characters with #expack (), the string is used with bin2hex () # unpack () for packing with perpendiculars ($) below $ firstaddrhex = reset (unpack (' H * ', $ firstaddrbin)); // Overwrite the first address string to ensure that the notation is optimal $ firstaddrstr = inet_ntop ($ firstaddrbin); $ CidrMatchedString = $ firstaddrstr '/'. $ Prefixlen; Countercurrent $ cidrMatchedString; }  

here:

  function getCIDRMatchedIP ($ IP) {if (strokes ($ IP, "::")! == incorrect) {$ parts = explosion (":", $ IP); $ Cnt = 0; // The number of numbers in that number ($ i = 0; $ i & lt; count ($ parts); $ i ++) {if (numeric_emeric ("0x". $ Parts [$ i]) $ Cnt ++; } // How many 0000 blocks is required $ required = 8 - $ cnt; $ Ip = str_replace ("::", str_repeat (": 0000", $ required), $ ip); } List ($ ip, $ prefix_len) = explosion ('/', $ ip); $ Parts = explosion (":", $ ip); // This start bit mask is $ bstring = str_repeat ("1", $ prefix_len) Str_repeat ("0", 128 - $ prefix_len); $ Mins = str_split ($ bstring, 16); $ Start = array (); For ($ i = 0; $ i & lt; 8; $ i ++) {$ min = base_convert ($ min [$ i], 2, 16); $ Start [] = sprintf ("% 04s", dickhex (hexdack ($ parts [$ i]) and hexack ($ min)); } $ Start = implode (':', $ start); Return $ start '/' $ prefix_len; }  

and you call the function getCIDRMatchedIP :

  echo getCIDRMatchedIP ('2001: 0: 3238: DFE1: 0063 :: FEFB / 32 ');  

language agnostic - Is floating point math broken? -


  0.1 + 0.2 == 0.3 - & gt; झूठा  
  0.1 + 0.2 - & gt; 0.30000000000000004  

ऐसा क्यों होता है?

बाइनरी गणित की तरह है इस। अधिकांश प्रोग्रामिंग भाषाओं में, यह पर आधारित है। जावास्क्रिप्ट 64-बिट फ्लोटिंग प्वाइंट प्रस्तुति का उपयोग करता है, जो जावा के डबल के समान है समस्या की जड़ यह है कि संख्याएं इस स्वरूप में एक पूर्ण संख्या के रूप में दो की शक्ति का प्रतिनिधित्व करती हैं; तर्कसंगत संख्याएं (जैसे 0.1 , जो कि 1/10 है) जिसका दोरार्य दो की शक्ति नहीं है, वह बिल्कुल प्रतिनिधित्व नहीं किया जा सकता।

मानक binary64 स्वरूप में, प्रतिनिधित्व ठीक तरह से लिखा जा सकता है

  • 0.1000000000000000055511151231257827021181583404541015625 दशमलव में, या
  • 0x1.999999999999ap-4 इन।

इसके विपरीत, तर्कसंगत संख्या 0.1 , जो कि 1/10 , जैसा कि

  • 0.1 दशमलव में, या
  • 0x1.99999999999999 के रूप में लिखा जा सकता है .. .पी -4 सी -1 99 हेक्सफ्लोट नोटेशन के एक एनालॉग में, जहां ... 9 के एक अंतहीन अनुक्रम का प्रतिनिधित्व करता है।

स्थिरांक 0.2 और 0.3 अपने कार्यक्रम में भी उनके सच्चे मूल्यों के अनुमानों का अनुमान लगाया जाएगा। ऐसा होता है कि निकटतम डबल से 0.2 तर्कसंगत संख्या 0.2 से बड़ा होता है, लेकिन यह निकटतम डबल से < कोड> 0.3 तर्कसंगत संख्या 0.3 से छोटा है। 0.1 और 0.2 का योग तर्कसंगत संख्या 0.3 से बड़ा है और इसलिए आपके कोड में निरंतर से असहमति।

अस्थायी बिंदु अंकगणित मुद्दों का एक काफी व्यापक उपचार है एक आसान-से-पचाने की व्याख्या के लिए, देखें।


javascript - How to capture data and send to server API using angular -


I am using angular for the first time and I am having problems sending back normal data to the server.

I have a server running on the API: http: // localhost: 8080 / lppayment which accepts POST requests and TokenId .

My JS looks like this and is successfully withdrawing a token from the stripe. I just want to send this token to the above mentioned API URL as a POST request.

How can I do this in angular?

'strict use'; Angular.module ('angularDjangoRegistrationAuthApp'). Controller ('TakeMoneyCtrl', function ($ radius, djangoAuth, valid) {$ scope.complete = false; djangoAuth.profile (). Then (function (data) {$ scope.model = data;}); $ scope.handleStripe = Function (status, response) {If there was an error, fix it. Warning ("Error")} Other {// found bar token, now charge it or smt token = response .id warning ("success:" + token);}}});

I just want to send the token to the server, when I successfully get back from the basket back. So I put a warning ("success"); But even that warning is not being shown on the page. Neither is the warning ("error"); However, on Chrome's Networks tab, I can see that the token is actually coming back from the bar. http: // localhost: 8080 / takepayment

question

how can I send the token received from the strip with my API call As an a POST request /

Requires angular $ http service () to inject it and then consume it in your controller Here is a simple example that consumes Kangaroo $ http and one POST

  Angular.module ('Angular digestrationships'). Controller ('techkrutkur', ['$ http', function ($ radius, $ http, DJ, auth, valid) {$ scope.complete = false; djangoAuth.profile (). Then (function (data) {$ scope.model = Data;}); $ Scope.handleStripe = function (position, response) {if (response.error) {// there was an error.} Please correct this. Warning ("Error")} Other {// founder token, You can put it in an object $ http.post var dataModel = {token: response.id}; // in a different service than your $ http post or priority. $ Http.post ('/ someUrl', JSON Error (function (Day (Status, data, position, header, config) {This callback will be called asynchronous / when response is available}.... Is called asynchronously if there is an error / / Server responds with error status.}); Warning ("success:" + token);}}}]);  

There is a way to do this above. But for this, call $ http in a different mascara service and NO Waiting for a response to finish using an JS promise or an expiry of time.

Create a new angular service to handle $ http

  Var app = angular.module ('Connection DegenerationAnthap App', []); App.service ('CommService', ['$ http', function ($ http) {this.processLoginToken = function (token) {var model = {token: token}} var promise = $ http.post ('/ api / Tokenproc ', JSON.stringify (model)) then (function (feedback) {return response.data;}, function (error) {console.log ("communication error, server not answered.");}); Return   

Now outside of your service, you will use it this way.

  var token = "02394924924929424 "; CommService.processLoginToken (token). Then (function (feedback) {// process of your reaction here}}, the function () {// server did not respond.});  

asp.net - Sending string list from Android to vb.net -


Now I am trying to get stuck I send complex data to vb.net WCF service after 2 days. This service request is: From the list & lt;

  Expand class saveLoadParts asyncTask & lt string>, string, string & gt; {@Override protected string doInBackground (list of & lt; string & gt; ... parameter) {from the list & lt; String & gt; Checklist = New Arrestist & lt; String & gt; (); Checklist = Old List; SOAP object request = new SOAP object (NAMESPACE, METHOD_NAME4); Soap-object soapbox = new sapong bag (NAMESPACE, "checklist"); (String i: checklist) {soapLogs.addProperty ("Itemlist", I); } Request.addSoapObject (SOONLogs); SoapSerializationEnvelope envelope = new saponification anaphf (sopenalaphase envelope.setOutputSoapObject (request); envelope.dotNet = true; httpTransportSE transport = new HTTP transcesee (url); {transport.call (GETUSER_SOAP_ACTION + METHOD_NAME4, envelope); try soap reaction feedback = (Sopprimitiv) Lifafakgetrespons (); FinalResult = response.toString ();} catch (Sopfolt e) {e.printStackTrace ();} catch (Acteepiarpispointaksepshn e) {e.printStackTrace ();} catch (IOException e) { E.printStackTrace ();} hold (XmlPullParserException E) {e.printStackTrace ();} eventual return result;} @Override protected void onPostExecute (string result) {if "(lists stored", Toast.LENGTH_SHORT .show () (result.equals ( "{Toast.makeText OrderDetailView .this,))!) ";}}}  

and this is my VB.net code

  public class item list public ABC string End class Return SaveLoadParts (ByVal Suchisuchi as list ()) as string Implements IService1.SaveLoadParts dim as string = checklist (0) KabckToString () functions as a termination problem I have tried almost everything I could possibly find on the internet, it always give me an error. 

  Now I'm getting this Soffolt - Doshkod: a: Desriyalaijeshnfold 'Foltstring' Formetr the message threw an exception while trying to deserialize: parameter was an error while trying to deserialize. InnerException message 'error 1 was in line 361. Element 'http ...' contains a type of data that maps to the name 'http ...'. Deserializer has no knowledge of any kind that is a map for this name. Using a DataContractResolver is the type of idea or type known in the list to add corresponding to the 'checklist'. For example, by using the KnownTypeAttribute attribute or by adding them to the list of types known for the DataContractSerializer. Please see InnerException for more information. 'Mistake:' Zero 'Description: Zero 

Please help!


io - Change from formatted stream I/O to direct I/O in c -


I used this code to use direct I / O instead of writing files, able to change instead of the format stream I want to be? Although I'm not sure how to do this, the help would be greatly appreciated.

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; #Meder100 defined # FORMATREAD "% 12s% 100s% 100s" int main (zero) {FILE * in_ptr, * out_ptr; Four fname [max], lanm [max], number [12]; In_ptr = fopen ("phonelist.txt", "r"); Out_ptr = fopen ("history.txt", "w +"); If ((NULL == in_ptr) || (NULL == out_ptr)) {fputs ("Opening Files, Problems Removing Problems!", Stderr); Exit (1); } If (3 = fscanf (in_ptr, FORMATREAD, number, fname, lname)) {fprintf (out_ptr, "% s% s% s \ n", number, fname, lname); Printf ("% s% s% s \ n", number, fname, lname); Printf ("The phone book has format: name of the phone number \ n"); } And {fprintf (* out_ptr, "unknown type \ n"); Printf ("The phone book has an unknown format \ n"); } Fclose (in_ptr); Fclose (* out_ptr); Return 0; }  

If there are any errors then I have a lot to regretfully coding.

To not use formatted output such as fprintf () , < Create a string in the code> sprintf () or other different ways in the code and write it. It is important that buffer is large enough.

  // fprintf (out_ptr, "% s% s% s \ n", number, fname, lname); // slightly oversize buffer, but it has% s format and variables in the form of four buffer [sizeof number + size fname + sizeof lname + size formatted]; Sprintf (buffer, "% s% s% s \ n", number, FNN, LN); Foots (buffer, out_pTR);  

Concern about fscanf (in_ptr, FORMATREAD, number, fname, lname) exists, which means line Formatted data FORMATREAD does not detects '\ n' as different from '' . Recommend using fgets () to read the data line and then parse it.


The code also needs to improve buffer size and input format

  # max 100 define formatted "% 12s% 100s% 100s" ... four fname [MAX + 1], lname [MAX + 1], number [12 + 1];   

Good code is checking the retrun value from the input function, but instead of == using = @WeatherVane If (3 = fscanf (in_ptr, FORMATREAD, number, fname, lname)) (3 == fscanf (in_ptr, FORMATREAD, number, fname, lname))

>

html5 - Notification api not working -


I have used the HTML5 notification API and saved it as an index on my desktop but after the notification API Clicking on the Permission option also works from demo sites

This link does not work let's check.

I was also running in the same problem while running from file system. // file / desktop like la bla

Then I went to my local server and it worked ...


WORDPRESS PHP Strict Standards: Redefining already defined constructor for class error -


I have a plugin for WordPress, and a client has strict criteria enabled. I have fixed most of the notices and warnings, but it is stumped to me. How can I fix this information in error reporting? What am I doing wrong for PHP?

Error: [13-Mar-2015 17:04:41 UTC] PHP strict criteria: redefining the already defined constructor for class GARD_PRO_CSE in D: \ home \ .

Code:

  if (strpos ($ $ globals) \ wwwroot \ wp-content \ plugins \ gard-pro \ insert.php [ 'GARD_PRO_CSE'] ['CSE'], 'CSE' and Class_Exists ('GARD_PRO_CSE')) {class increases GARD_PRO_CSE WP_Widget {Function GARD_PRO_CSE () {Origin: WP_Widget (wrong, $ name = "GARD Pro Custom Search Engine "); } Public Function __construct () {Origin: __ Construction ('GARD_PRO_CSE', // Base ID 'GARD Pro Custom Search Engine', // Name Array ('Description' = & gt; __ ("The Custom Google Search Engine Shows ", 'Text_domain'),) // Args); } // add_action ('widgets_init', create_function ('', 'return register_widget ("GARD_PRO_CSE");')) to delete deleted WP code WIDGET;); }  


cocos2d iphone - Apply impulse working on x axis but not on y axis -


First of all, a bit of background. I am using cocos 2d with a purpose casing for the chipmunk as a physics engine. I have a physical node called Action node. On ActionNode, I have a physics body, called running fax. Action node and runningfox are scrolled in opposite directions to give an idea of ​​endless runners. It is done in this update method:

  - (zero) update: (CCTEM Delta {runningFox position = CCP (runningFox.position.x + ActionNodeScroll Speed ​​* Delta, running fox.position.y); ActionNode.position = CCP (Action node. Position.x-action nodescroll speed * delta, action node.mO.c.}  

When I'm getting swiped I'm just running the CCActionJumpBy action Now when it is in the air and swipe is done, then I need it to come back faster on the ground, because it is in opposition to normal landing, which is automatically controlled by gravity .When it was a good deal The reason for this purpose can be argued is to try this method:

  [runningFox.physicsBody implementedIpply: local point on CCP (0, 300): CCP (0.5, 0.5)];  

But I have not seen any effect. But if I change x and y values ​​like this

  [runningFox.physicsBody applyImpulse: CCP (300 , 0) local point: CCP (0.5, 0.5)];  

The body is further compelled, therefore for some reason the impulse applies to the X axis, but not on the y axis. Or do I have to be I'm wrong?

honest, I have read the documentation and do not mean the arguments for that method. Therefore, I'm not 100% sure what I want


How to combine two strings together in PHP? -


I really do not know what I wanted, but I'll show you:

example To:

  $ data1 = "color is"; $ Data2 = "red";  

What should I do (or process) so is the combination of $ result $ data1 and $ data2 ?

Desired result:

  $ result = "color is red";  

  $ result = $ data1 $ Data2;  

This is called string containment. There is a lack of space in your example, so in particular you will need it:

  $ result = $ data1 ''. $ Data2;  

python - robot-framework prints logs in console with blank lines & seperators -


रोबोट फ्रेमवर्क "रेखा" शब्दशः के साथ प्रीफ़िक्स है & amp; हर पंक्ति बराबर प्रतीकों से अलग है और प्रत्येक पंक्ति के बीच में रिक्त स्थान के साथ छपा हुआ है?

लॉग को प्रिंट करने के लिए रोबोट को कॉन्फ़िगर कैसे करें?

कंसोल लॉग अंश: रेखा ========= ================================================== ===================

<पूर्व> रेखा किरायेदार बनाएं | असफल | लाइन अनबाउंडलोकलएर्रर: स्थानीय वेरिएबल 'रोबोट रिस्पॉन्स' को असाइनमेंट लाइन से पहले संदर्भित किया जाता है -------------------------------------- ---------------------------------------- लाइन टीसी बनाएँटेन्नेट & amp; टीसी CreateWLAN.tc CreateTenant | असफल | रेखा 1 महत्वपूर्ण परीक्षा, उत्तीर्ण 1, 1 असफल

===================================== ================================================= < / P>

आप ऐसा नहीं कर सकते कस्टम के रास्ते के लिए पूछते हुए एक पुरानी पुरानी सुविधा है आपका एकमात्र विकल्प सभी आउटपुट को / dev / null में रीडायरेक्ट करने के लिए है और फिर एक श्रोता बनाने के लिए जो आपके द्वारा इच्छित कोई भी जानकारी प्रिंट करता है।


Concurrent network XML file updates via PowerShell -


I need to maintain a shared XML file on the network, which will be updated by several machines.

My understanding is that 1: There is no native PowerShell or .NET function to maintain an XML file, especially in a concurrent access scenario. And 2: If there is no native power shell mechanism to lock a file on the network, then I would need a generous solution of some type of house. Extreme files can be updated every 15-20 times every year by the machine, and it needs to be scaled along with thousands of machines. But the actual amount of data written is small, while the other things run in the past, are very time consuming, and by diversity. And in most cases this will not be updated on any large scale, mostly on the order of a few hundred machines, maybe to update the file during 15-20 minutes. Therefore, the possibilities of many machines reaching the file at the same time are remote, but still need to address them.

I think the script running on the machines has to change the name of the XML file with the machine name. It can then read XML, modified as needed, write to the previous file, then rename script, there is a wait loop in the script which sees that there is no correct file, but it is again named file, and wait As long as the other machine working with the file gets worked out and changes the file back, and before moving it forward with your efforts. Machine scripts will be started from the central script as remote jobs, which can reduce jobs to reduce the chances of conflict.

My first question is, am I getting a better view of some happiness? I have to be here with simple, I can not get into the database and like It needs to be a simple flat file.

And, there is no other obvious view, can there be any major loss or anyone? I'm sure I'll need to complete different error conditions, and possibly save a data in each file for each machine, after a fallback and all the updates, to drag that data into the main file, The utility is. But I do not want to be a primary workflow if I can help it.

I know, there is a 10,000 ft question, but any insights is appreciated. I have a plan to create a dummy XML file with 1000 records and then the process of running a simple remote script on 3-4 machines, which launches at the same time, and puts a timer on the process, so I see How long does each operation last, and if a machine also needs to wait to write, but if I can learn from someone else's mistakes then I would rather I


java - Clear method removes all links in all Hashmap's objects -


I was surprised when I saw that when I cleaned the internal map, then after adding it to an external map. Is there any way to reset the inner map, but not to remove objects from the map of the outside?

Main category:

  Public static zero main (string array []) {person per person = new person ("1", "AA", 56, true) ; Person = 2 new person ("20", "BBB", 34, wrong); Map and lieutenant; Integer, map & lt; Integer, person & gt; & Gt; External = new hashmop & lt; Integer, map & lt; Integer, person & gt; & Gt; (); Maps & lt; Integer, person & gt; Internal = new hashmap & lt; Integer, person & gt; (); Internal. Input (100, per 1); Internal. Input (200, 2); External Input (1000, internal); // Internal: Size = 2, External: Size = 1 (Key = 1000, Value Size = 2) Inner clear (); // Internal: Size = 0, External: Size = 1 (Key = 1000, Size of value = 0) // External value Size = 0 Why? }  

person:

  public class person {private string id; The name of the private string; Personal gaps ages; Private boolean is something; Public string getId () {return ID; } Public Zero Set ID (string id) {this.id = id; } Public string getName () {return name; } Public Zero Setname (string name) {this.name = name; } Public int getAge () {return age; } Public Zero setAge (int age) {this.age = age; } Public boolean is something () {return is something; } Public Zero Set is something (Boolean is Paid) {this.isSome = isPaid; } Public person () {} public person (string id, string name, int era, boolean something) {this.id = id; This.name = name; This.age = age; This.is something = something; }}  

external.product (1000, internal); In the external code, the reference in the internal variable as a value does not make a copy of the example specified by inside , so if you later Inner clean the map, you also clear the stored value in the external map.

If you want to copy the original map's value to the original inner map, then you can create a new instance:

  outer.put (1000 , New hashmap  (internal));  

Note that in this case, in the new inner map, the person examples will have the same example as the original person examples. > Internal map, so if you change one of these, the example stored in the map will also be mutated.


jquery - Drop down choice slides textbox to the right making it required, and undoing if other option is chosen -


I'm trying to figure out how I will look and hide and require fields or dropdowns I can not use jQuery on the basis

So I have a drop like this:

What am I trying to do, when the second is selected from the dropdown, I want other textbox (# other 1) to slide to the right and need that textbox A make.

But if any other option is selected from the dropdown then I want to slide it back and no longer want to do the text box.

I can not understand the correct way to write this JavaScript so that any help greatly appreciated!

  $ (document) .on ('change', '#boatfuel', function () {var other1 = $ ('# other1'); var boatFuelOther = $ ("# boatFuelOther" ) If ($ (this) .val () === 'other') {boatFuelOt her.slideRight (); other1.prop ('required', true);} other {nafeel other goldlight (); hide (); Other1.prop ('required', false);}});  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> & Lt; Div class = "clearfix" & gt; & Lt; Label = "boatfuel" & gt; Fuel: & lt; / Label & gt; & Lt; Select Name = "NAFFUIL" id = "NAFUFUL" is required & gt; & Lt; Option value = "" selected = "selected" & gt; Select Fuel & lt; / Option & gt; & Lt; Option value = "gas" & gt; Gas & lt; / Options & gt; & Lt; Option value = "diesel" & gt; Diesel & lt; / Options & gt; & Lt; Option value = "Electric" & gt; Electric & lt; / Options & gt; & Lt; Option value = "Other" & gt; Other & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt; & Lt; Div id = "boatFuelOther" style = "display: none" & gt; & Lt; Label = "other 1" & gt; Other: & lt; / Label & gt; & Lt; Input type = "text" name = "other 1" id = "other 1" value = "" /> & Lt; / Div & gt;  

I can hide it and work with show options but I am actually trying to figure it out Slide Out Options

Your best bet is to show and hide only:
< / P>

Otherwise I have a problem when I slide right and then to hide it, again to slide it again, if the user is running back and forth. Using the code given below:

  $ (this). Show ("slide", {direction: "right"}, 1000); $ (This). Side ("slide", {direction: "left"}, 1000); 
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> & Lt; Div class = "clearfix" & gt; & Lt; Label = "boatfuel" & gt; Fuel: & lt; / Label & gt; & Lt; Select Name = "NAFFUIL" id = "NAFUFUL" is required & gt; & Lt; Option value = "" selected = "selected" & gt; Select Fuel & lt; / Option & gt; & Lt; Option value = "gas" & gt; Gas & lt; / Options & gt; & Lt; Option value = "diesel" & gt; Diesel & lt; / Options & gt; & Lt; Option value = "Electric" & gt; Electric & lt; / Options & gt; & Lt; Option value = "Other" & gt; Other & lt; / Options & gt; & Lt; / Select & gt; & Lt; Label = "other 1" style = "display: none" & gt; Other: & lt; / Label & gt; & Lt; Input style = "display: none" type = "text" name = "other 1" id = "other 1" value = "" /> & Lt; / Div & gt;  


database - Use REST API with Neo4j? -


In the last few months I am creating a Neo4j database, I'm Neo 4j & amp; The cipher is really easy to use and of course it's suitable for data that I'm working on.

I am hoping that there is someone who can give some indication on the way to start with some episodes. I have no experience coding in Java and I'm looking a little harder to follow the Neo4J documentation. It is possible to send an REST request through a direct HTTP URL (in this way) which I think will receive some data in JSON

My ultimate goal is to get the current status of my database To summarize, there is some form of very high level dashboard, to show data from some high level cipher queries like this:

  match (n) returns different (enumerate), count (count) N)  

Whatever advice you give Es, it will be much appreciated.

You can better use where you can send any one of your questions like a cipher query statement Are there.

Default endpoint

Neo4J documentation to use it from Java:

Use of the Transactional Endpoint By doing so, there is the benefit of being able to send many statements in one transaction, resulting in operation or rolled back.

The Rest API is like any other HP API, only the guidelines for adhering to the body content and the cipher query parameters are well explained in the Neo4j documentation:


javascript - D3: Hierarchy child accessor function using AJAX -


I am looking to represent a whole hierarchy of objects, which can be accessed through a reset API is.

To do this, I would like to use the D3 tree layout to load and drag nodes. This API can return all elements of a given type. However, the children of those elements are accessed through a contextual URL instead of the nested array.

In the installation of my tree in D3, I am trying to set up a child accelerator function which uses d3.json () using this url for all children for a node to the back. Here is my tree builder function, where there is a top-level item with root a child attribute:

  function buildTreeFor (root) {Var tree = d3.layout.tree (); Tree Child (function (node) {d3.json (node ​​child.function (data) {return data;})}); Var nodes = tree.node (root); Var link = tree Links (nodes); }  

As someone hopes, these links are empty, and nodes do not reference the children searched. After reading the D3 documentation and some tutorials, I have a pattern here I am in loss, I can return child data to the promise, but where will it be resolved? Somewhere in the node resolution process behind the scenes?

I need to ensure that all levels of this hierarchy are shown in the final diagram. What can I do to resolve these AJAX calls?

Thank you!


How to set dynamic input dependency on gradle task -


I am working on a Gradle plugin that has a work that generates compatible Java source code. This code takes the generator into the input of a "static" directory (property value) in which the files should be placed in a particular language (using a specific threshold). In addition, if a particular configuration property is set to True, then it will search for files with the same border (or better, in a specific configuration) in the entire cell path.

I have to make sure that this work runs when any of its input dependencies are new.

In the property definition for "stable" location, it is easy to add @InputDirectory, but I "dynamic" input dependency.

I have a property that defines the name of the configuration that will be used to find additional files to that extent. We will call that "search configuration". This property is optional. If this is not set, then it will use "compilation" I also have the property which states that we will search for additional files in the first place or not. We will call that "dependency of inspection"

I think I can type an @input-annotated method which essentially returns the "configurations.searchConfiguration.files" list. We will call that "friendly" I think that this is the basic idea, though, I do not understand what to do about the "dependency of inspection" I can easily return "empty-handed" an empty list If "dependency of inspections" is false, but what exactly is the right thing to do? It seems that if a person has inspected "false" "after the building" after "building", then the next build should be run again.

Well, this is temporary, but I asked about this on the Gradal Forum and Mark Viere convinced me It really should be simple, though it requires @InputFiles instead of @Input. My special method looks like this:

  @InputFiles def getOptionalYangClasspath () {Return introspect continuation? Project.configurations [yangFilesConfiguration]: Collections.emptyList ()}  

java - Map part of composite PK to composite FK -


My data model contains items with history, I call an "instant" call in time; That's why all the tables have a "instant_id" that specifies how that item was configured on that instant "Instant_id" rolled into the entire primary key for all tables. Imagine the following example:

  Table Computer ============ PK Int Instant_ID & lt; - Shared ID PK int computer_id & lt; - Child ID int computer_type_id & lt; - Generator ID varchar foo Table Computer Type ================== PK Int Instant_ID & lt; - Shared ID PK Intel computer_type_id & lt; - Parent ID varchar bar  

In computer mapping (Instant_ID, computer_type_id), the computer type is a foreign key in the primary key.

We use some kind of

  @mbedded computerId {@column (name = 'quick_id', falsifiable = false) int instant_id, @column (name = 'Computer_id', tapable = false) Intel Computer_ID}  

then:

computer {@EmbeddedId ComputerId id; @MapsId ('instant_id') @ManyToOne @JoinColumn ({@JoinColumn (name = 'instant_id', ...), @JoinColumn (name = 'computer_type_id', ...)}) ComputerType computerType; }

No matter how I add MapsId with JoinIdColumn, I can not seem to do this work. Any ideas?

I can not find many organizations, you are not showing us how ComputerType < / Strong> has been declared, I am assuming that if it is a case if it is a matter, the definition per table you provided is Computer and ComputerType both Share an overall primary key: instant_id and computer_type_id .

If this is true and they share the same primary key, then you can do better by optimizing those two tables in one table as normal.


filewriter - Android: Write file from other class nullpointerexception -


I am trying to write a file from another category, but I get a null portefecope that I can not solve . The following code can be used primarily without any problem, but when I try to use it in my second class, I get an error.

  Public Zero WriteFile () {string text = "Hello world"; String filename = "TestFile.txt"; FileOutputStream fileApricotStream; Main activity maObj = new main activity (); Try {FileOutputStream = maObj.openFileOutput (fileName, maobj.MODE_PRIVATE); FileOutputStream.write (text.getBytes ()); FileOutputStream.close (); } Hold (IOException e) {e.printStackTrace (); }}  

You passed the activity reference instead of creating a new activity instance in the method of writing Do

  write public zip file (reference reference) {  

and remove

mainActivity maObj = new MainActivity (); As can be done in an Android application like this can not be instantified, change

  fileOutputStream = maObj.openFileOutput (filename, maobj.MODE_PRIVATE);  

to

  fileOutputStream = context.openFileOutput (filename, theme. MODE_PRIVATE);  

Once completed, your method should look like this:

  write public zero file (reference reference) {string text = "Hello world"; String filename = "TestFile.txt"; FileOutputStream fileApricotStream; Try {FileOutputStream = context.openFileOutput (filename, reference. MODE_PRIVATE); FileOutputStream.write (text.getBytes ()); FileOutputStream.close (); } Hold (IOException e) {e.printStackTrace (); }}  

Now call your method as

  file (main activity) as this;  

to main activity class.


python - DGESDD Lapack routine loading from numpy failed -


मुझे pinv फ़ंक्शन से numpy.linalg मॉड्यूल मैं एक आयताकार मैट्रिक्स :

  प्रयास करें: Binv = np.linalg.pinv (ए) को छोड़कर: पंट ("एक त्रुटि होती है") पलटना चाहते हैं   

जब कोई कोड अपवाद उठाया जाता है, लेकिन मेरे पायथन में निम्न लाल पाठ प्रकट होता है: init_dgesdd init

लेकिन जब मैं अन्य संदर्भों (अलग आकार, अलग कंडीशनिंग मानों ...) में अन्य मैट्रिक्स के साथ अपने कोड का उपयोग करता हूं। यह ठीक काम करता है।

त्रुटि की जांच के बाद, ऐसा लगता है कि स्मृति मुद्दों से आते हैं जब मैं एक (105 x 177144) आकार के साथ एक मैट्रिक्स का उपयोग करता हूं, तो यह काम करता है। लेकिन जब मैं एक मैट्रिक्स का उपयोग (105 x 178668) आकार के साथ करता हूं, तो यह काम नहीं करता।

इसके अलावा, numpy.linalg.umath_linalg.c.rr कोड पर एक quik देखो दिखाता है कि त्रुटि में उल्लेख मेरी पिछली पोस्ट उठाई गई जब मेमोरी बफर का स्मृति आवंटन विफल हुआ। यह स्मृति बफर यू, एस, वीटी और सभी मध्यवर्ती arrays को स्टोर करने के लिए उपयोग किया जाता है, जो कि एसवीडी गणना के दौरान आवश्यक होता है।


DataStax Enterprise 4.6.1 / C* Pagination in Python using cqlengine 0.21.0 -


After the

I currently query results page from the Delhi stock exchange 4.6.1 (cassandra 2.0.12.200) with python and cqlengine 0.21.0 I'm trying to pointe.

My table is being asked:

  table tags_for_search (village_id integer, tag_prefix text, tag text, time timeuuid, author_id integer, tag_id UUID, create type text, primary Key ((gm_id, tag_profix), tag, time by clustering order (time digc) and bloom_filter_fips_chance = 0.010000 and caching = 'kas_only' and 'comment' and 'decalogical_read_re__chance = 0.100000 and gc_grace_second = 864000 and index_interval = 128 and reed_premier_chance )) = 0.000000 and populate_io_cache_on_flush = 'false' and default_time_to_live = 0 and speculative_retry = '99 .0PERCENTILE 'and memtable_flush_period_in_ms = 0 and compaction = {' class': 'SizeTieredCompactionStrategy'} and compression = {'sstable_compression': 'LZ4Compressor'};  

Is there an option for paging / paging.org (Datastex Enterprise / DSE 4.6.1) for the results of Python (using cqlengine 0.21.0)? Documentary solution () appears to be broken due to #

My initial query for data is:. Choose

  from that_keyspace.tags_for_search where "tag_prefix" = 'der' and 'tag_text' = '#drp1' and 'village_id' = 1 million 10000;  

or via cqlengine in Python:

  village_tags = VillageSearch.objects.filter (village_id = 1, tag_prefix = 'der', tag_text = ' # Derpy1 ') tags_data = [] Village_tags for village_tag: tags_data.append (village_tag.to_dict ()) FIRST_PAGE = village_tags previous = FIRST_PAGE [-1] next_page = list (village_tags.filter (pk__token__gt = cqlengine.Token (last. Pk)))  

Throw this error:

  code = 2200 [invalid query] message = "column" village_id "not both are restricted by a similarity Can be done and an inequality relationship " 

Is there any such option that I can use immediately C I can use to avoid this bug?

Thanks for any help you can provide!

There is no direct substitution for this functionality. The best and most appropriate answer is to upgrade (now this bug Fix is ​​available).

Upgrade your environment for DSE> = 4.6.2 will solve this problem.


recurring events - DDay iCal RecurrenceId -


I'm actually using the telerecise cando scheduler instead of an iCal file, but I have an event list in a way There is a need to demonstrate the addition of the schedulers agenda list and the mapping between schedule object and a right-handed object are the same, so I thought I would use DDA.

Creating an iCalendar object and loading it in the schedule table. Code is working with me. I can create the Events list and filter deleted events from the series. Where I am having a problem, where an incident in the series was modified.

The way the data is stored in DB when a modified event is created in a series, then it creates a new record and the recurring ID field will be the original record With the Event ID

Against the ID field, it just seems easy enough, is not it? Problem in DDA iCal Recurring ID is an IDateTime and not int I'm not sure how to process it because we have a lot of incidents, which are the start / end at the same time so that the original start / Grabbing the end does not seem feasible unless I am misunderstood what is happening in reality.

I have figured out a complicated way of handling a modified incident if it is the only revised event for a master event in the event. But this method is not an account for an event series, which may include master events and many modified events of the master.

I think there will be 2 lists from a possible solution scheduler table, only recurring events and other master events are revised.

Then as I am taking action on the events, I check against each incident whether it is in the revised event list or not. If so, update the incident accordingly. It seems like a very cool solution even if it will address all revised scenarios, I think I'm missing something in the library which will handle it.

Any help can be always made on this issue which will be appreciated.

Thank you, Chris

It looks like my test set data got spoiled It appears that this works, the recurrence exception will occur in the master event, so when you call to receive an event, the exception is in that range when the master record will be omitted / filtered. Revised event will be created for the series. Additionally, if the event was removed in the event category then the event will not appear in the event category.

There were some errors in my test data set which would make it an additional filter step.


mongodb - Finding a null value in a collection and update -


The process of writing for the criteria below.

I have some collections in which objects, arrays, and nested arrays and not all are the same:

  {first name: "something", last name: "thing", Nickname: {address1: "i234 some road", address line 2: empty, city: "city", phone: {landline: 1234556778, function: blank, mobile: 832923891}}}}  

How can I write a recovery process, even if a blank space is found, the values ​​and updates are "unavailable"

You can ask the following question You can use and it can run with multiple correct options.

  db.collection.update ({nickname}, {$ set: {alias: "missing"}}, {multi: true})  
< P>


c# - CSS not displaying the same across different broswers -


यह मेरा पृष्ठ ऐसा दिखना चाहिए, यह IE में प्रदर्शित होता है:

यहां छवि विवरण दर्ज करें

यह वही है जो इसे फ़ायरफ़ॉक्स में दिखता है:

< Img src = "https://i.stack.imgur.com/Zm2b0.png" alt = "छवि विवरण यहां दर्ज करें">

यह मेरा कोड है:

  @ करस्टोर्ट। सेवा वर्ग के उपयोग से @ मॉडेल ग्राहकडेटा & lt; br / & gt; & Lt; div class = "leftdiv" & gt; & LT; fieldset & gt; & Lt; किंवदंती & gt; ग्राहक जानकारी & lt; / legend & gt; @ एचटीएमएल.पार्टी ("ग्राहक इन्फो", मॉडल) & lt; / फ़ील्ड & gt; & Lt; / div & gt; & Lt; div class = "rightdiv" & gt; & LT; fieldset & gt; & LT; कथा & gt; शेष & lt; / कथा & gt; & Lt; div & gt; @ एचटीएमएल.पार्टी ("अकाउंटबेलेंस", मॉडल) & lt; / div & gt; & Lt; / fieldset & gt; & Lt; / div & gt; & Lt; div & gt; & Lt; तालिका शैली = "चौड़ाई: 100%" id = "थिनलाइन टेबल" & gt; & LT; टीआर & gt; & Lt; th क्लास = "थिनलाइन टीडलाइन पाउलिनलाइन" शैली = "चौड़ाई: 15%" & gt; दिनांक & lt; / th & gt; & Lt; th क्लास = "थिनलाइन टीडलाइन पाउलिनलाइन" शैली = "चौड़ाई: 15%" & gt; संदर्भ # & lt; / th & gt; & Lt; th वर्ग = "थिनलाइन टीड-लेफ्ट थिनलाइन टी" शैली = "चौड़ाई: 30%" & gt; विवरण & lt; / th & gt; & Lt; th वर्ग = "थिनलाइन टीडराइट थिनलाइन" शैली = "चौड़ाई: 10%" gt; मात्रा & lt; / th & gt; & Lt; th वर्ग = "थिनलाइन टीडराइट थिनलाइन" शैली = "चौड़ाई: 15%" & gt; कुल & lt; / th & gt; & Lt; th वर्ग = "थिनलाइन टीडआरइट थिनलाइन" शैली = "चौड़ाई: 15%" & gt; बैलेंस & lt; / th & gt; & Lt; / टीआर & gt; @ फ़ॉरेनच (विभिन्न मद (आईएनआईमेरेबल & लेफ्टिनेंट; लेनदेन इतिहास & gt;) ViewBag.TransactionHistory) {& lt; tr & gt; & Lt; td वर्ग = "थिनलाइनटीड लिफ्ट" & gt; @ वस्तु.TransactionDate & lt; / td & gt; & Lt; td वर्ग = "थिनलाइन टीडएलईएफटी" & gt; @ आइटम.रिफरनंबर & lt; / td & gt; & Lt; td वर्ग = "थिनलाइन टीड लिफ़्ट" & gt; @ आइटम.निर्देशन & lt; / td & gt; & Lt; td वर्ग = "थिनलाइन टीड्राइट" gt; @ item.Quantity & lt; / td & gt; & Lt; td वर्ग = "थिनलाइन टीड्राइट" & gt; @ वस्तु के अतिरिक्त & lt; / td & gt; & Lt; td वर्ग = "थिनलाइनटीड राइट" & gt; @ वस्तु.बल्लेंस & lt; / td & gt; & Lt; / टीआर & gt; } & Lt; / table & gt; & Lt; / div & gt;  

और मेरी सीएसएस:

  .थिनलाइनटड्राइट {पैडिंग: 5px; सीमा: ठोस 1px # d4d0d0; पाठ संरेखित: सही; }। थिनलाइनटीड लेफ्ट {पैडिंग: 5px; सीमा: ठोस 1px # d4d0d0; पाठ संरेखित करें: बायां; }। थिनलाइनथ {पृष्ठभूमि रंग: # ई 8eef4; } .rightdiv {float: right; चौड़ाई: 49%; पाठ संरेखित करें: बायां; } .leftdiv {float: left; चौड़ाई: 49%; पाठ संरेखित करें: बायां; }  

मैं सीएसएस के साथ अच्छा नहीं हूं, मैं अब भी सीख रहा हूं।

धन्यवाद!!


python - How to switch off suggestion mechanism of language tool? -


I am using languageTool with Python but it is quite slow when I actually have long text or lots of texts I want to move forward. I continue to read that how long the suggestion mechanism is, I really do not need any suggestions, I am interested only on rule_ID and category.

Do anyone know how to stop this suggestion mechanism to get some suggestions on processing power?

It looks like the closest argument is -a , but it To enable automatic application of suggestions only, do not disable suggestions, this is an open source so that you can edit it yourself and a logic.

parser.add_argument ("file", help = "plain text file" or "for stdin") parser. Add_argument ("- c", "- encoding", help = "input encoding") parser.add_argument ("- l", "--language", metavar = "CODE", help = "language code of input or Parser Add_argument ("- d", "-" "parser.add_argument" "parser.add_argument" ("- m", "-mother-tongue", metavar = "CODE", help = "language code of your first language" Disabled ", metavar =" rule ", type = get_rules, action = rulesAction, default = set (), help =" list of rules ID to disable ") parser.add_argument (" - e "," --enable " , Metavar = "Rule", type = get_rules, action = rulesAction, default = set (), help = "list of rules ID to enable") parser.add_argument ("- api", action = "store_true", help = "XML's Parser.add_arg script ("version", action = "version", version = "language language {} ({}). Format (language_tool.get_version (), language_tool.get_build_date ()), help = Parser.add_argument ("- A", "--apply", action = "store_true", help = "Apply the suggestions automatically if available") "parser.add_argument" (" Parser.add_argument ("file", "-spell-check-off", "=" Spell_check ", action =" store_flash ", help =" disable spell-checking rules ") return parser. Help = "plain text file or Parser.add_argument ("- l", "--language", metavar = "CODE", help = "parser.add_argument" for stdin ("- c", "- encoding", help = "input encoding" "Language code input or" auto ") parser.ad_argent (" -m "," -master-tongue ", metabar =" CODE ", that Lp =" language code of your first language ") parser.add_argument (" D "," --disable ", metavar =" rule ", type = get_rules, verb = rule verb, default = set (), help =" list of list rule id "," list of rule id ", "To pars", "to enable") parser.add_argument ("- api", action = "store_tru" E ", help =" print result in XML ") parser.add_argument (" - version ", action =" version ", version =" language tool {} ({}) ".format (language_tool.get_version (), language_tool Parser.add_argument ("- a", "--apply", verb = "Store_true", help = "if available, suggestions automatically ("--spell-check-off", des T = "spell_check", action = "store_false", help = "disable spell-checking rules") returns the parser.add_argument ("--s",) Parser.pre_arag ()


c++ - What is this weird colon-member (" : ") syntax in the constructor? -


हाल ही में मैंने निम्नलिखित की तरह एक उदाहरण देखा है:

  #include & lt; iostream & gt ; वर्ग फू {सार्वजनिक: इंट बार; फू (इंट संख्या): बार (संख्या) {}; }; Int मुख्य (शून्य) {std :: cout & lt; & lt; फू (42) .बार & lt; & lt; std :: endl; वापसी 0; }  

यह अजीब : बार (num) क्या मतलब है? यह किसी तरह से सदस्य चर को प्रारंभ करने के लिए लगता है लेकिन मैंने पहले कभी यह वाक्यविन्यास कभी नहीं देखा है। यह फ़ंक्शन / कन्स्ट्रक्टर कॉल की तरह दिखता है लेकिन int के लिए? मेरे लिए कोई मतलब नहीं है शायद कोई मुझे उजागर कर सकता है और, वैसे, वहाँ इस तरह की कोई अन्य गूढ़ भाषा की विशेषताएं हैं, आप एक साधारण सी ++ किताब में कभी नहीं पाएंगे?

यह एक सदस्य प्रारंभिक सूची है आपको इसके बारे में किसी भी जानकारी मिलनी चाहिए।

(हालांकि, अकसर किये गए प्रविष्टि के अंत में सूचीबद्ध अपवादों पर ध्यान दें)।

अकसर किये गए सवाल से ले जाने वाला बिंदु यह है कि,

अन्य सभी चीजें समान हैं, यदि आप असाइनमेंट की बजाय प्रारंभिक सूची का उपयोग करते हैं तो आपका कोड तेज़ी से चल जाएगा।


Python : creating an array, weighed by sine function -


I can create an array of 100 Equally distance number from 0 to 30 - It is possible to get an array of 100 numbers from 0 to 30, which can be equally distinction -

  theta = linspace (0,30,100)  

Is not weighed, but by its sign function ??

Explanation: Here's a picture to give you a ambiguous idea of ​​what you want theta which I defined , Selects the number evenly (like the first picture). I want the array to be weighed by its sign function. As the number of 0 to 30 increases, their sign (value) increases, so I want to take the higher number more often (like a second picture) in my array -

Enter image details here

I think I got your solution, it takes an original linear line of space and takes it sign , then it brings back the array so that Linear array As is the same end.

np import as matplotlib.pyplot plt def sinespace as import (m = 90, n = 10): x = np.linspace (0, m, n) s = Np.sin (np.deg2rad (x)) returns (s / s [-1]) * ms = sinespace () print (s) plt.plot (s, np.ones_like (s), 'ro') plt. Show ()

Note, for a maximum of 30, the space is similar to the linear space. The reason for this is that it is linear with theta for sin (theta) small theta (and when theta In radians, theta ~ = sin (theta) ). To show "signage", I've plotted it to 90 degrees to make it more clear.

Enter image details here


racerjs - Get count of documents without loading the whole collection in DerbyJS 0.6 -


How can the results of a query be counted without loading the entire result in the memory?

The easy way to calculate the given documents will be:

  var q = model.query ('mycollection', {date: today}); Q.fetch (function () {var length = q.get (). Length;});  

But this will load the whole result in memory and "count" an array in JavaScript. When you have a lot of data, you do not want to do it, I guess.

Built-in mongodb archive is rather complicated by LiveDB (I think it is LiveDB) creates several mongodb documents for a derbyjs document.

International point to this fact from 2013, but there is a description of the solution there (by entering $ count: true query options) 0.6 and work in the current mangodeb. ". query.extraRef is undefined .

This is done as described in the Google Groups thread. But query.extraRef now query.refExtra .

example:

  q.refExtra ('_page.docsOfToday'); q.fetch ();  

javascript - AngularJS: render table columns before content is received -


How do I properly assign table columns before receiving AngularJS material required for them?

I'm using ng-if to show content, since I need different elements depending on the value coming back from the API call, see below ng- This is the only reason for not using the bind, which I think it would be a more legitimate solution.

  & lt; Td ng-if = "someArray.length> 0" & gt; & Lt; A ng- href = "some links" & gt; Yes & lt; / A & gt; & Lt; / Td> & Lt; Td ng-if = "someArray.length == 0" & gt; No & lt; / Td>  

Using it, due to obvious reasons, special columns are not shown at all, whereas someArray is not started I have another ng-if undefined in code>, but while waiting for the value I will have the column completely empty. I'm still quite new in the AngularJS and I think there is a best practice here.

You can use ng-in the internal door elements

 < Code> & lt; Td> & Lt; A ng-if = "someArray.length & gt; 0" ng- href = "some links" & gt; Yes & lt; / A & gt; & Lt; P ng-if = "someArray.length == 0" & gt; No & lt; / P & gt; & Lt; / TD & gt;  

Hadoop CDH5 Maximum Network Performance on 10 node using 1 MapReduce TaskTracker -


मैं 1 MapReduce TaskTracker के साथ 10 नोड्स के साथ सीडीएच 5 क्लाउडेरा के साथ अधिकतम नेटवर्क प्रदर्शन प्राप्त करने की कोशिश कर रहा हूं, लेकिन ऐसा प्रतीत नहीं हो सकता यातायात की जरूरत है मैं यातायात का उत्पादन मेरे पास 40 जी नोट कार्ड हैं और वर्तमान में केवल 10 जी के साथ सबसे अधिक मिलना वास्तव में कम है।

1 मानचित्ररडस टास्कट्रैकर का उपयोग करते समय मैं बेहतर प्रदर्शन और नेटवर्क थ्रूपुट कैसे बना सकता हूं?

रनिंग - 10 नोड्स रेडहाट 6.6 चालू एनआईसी चालक सीडीएच 5 कर्नेल: 3.18.1

मैंने 9 मैप रेड्यूस टास्कट्रैकर नोड्स को डिमशन किया है, लेकिन अभी भी अच्छे परिणाम नहीं मिल रहा है।

मैंने अंत में यह सोचा था कि नेटवर्क डफीयो टेस्ट के लिए डेटा नोड पर वास्तव में एक कार्य ट्रैकर की आवश्यकता नहीं है, इसलिए मैंने सभी डेटानोड "कार्य ट्रैकर्स" को निष्क्रिय कर दिया और कार्य ट्रैकर को नाम नोड और अब मेरे पास दोनों लिखना / टीएक्स और पढ़ा / आरएक्स यातायात है जो कि मैं नेटवर्क थ्रूपुट डेटा के लिए चाहता था।


mysql - Better Database design for hibernatre? -


I am new to database design I am using a MySQL

form is a table in which a field is country

because it can contain values ​​in this column from only one country list, so I varchar Instead of creating this column int and putting the list in a new table.

country varchar (255) do not tap

  1. ol start = "2">
  2. I It has created COUNTRYCODE with datatype INT and added a foreign key to the table CountryMaster which

... countryCode INT No NULL, Foreign Key (Country Code) Reference CountryMaster (cOUNTRYCODE), ...

Table CountryMaster create (countryCode INT not NULL Primary key AUTO_INCREMENT, name VARCHAR (255)) ;

This is working fine, but the point is that formStatus (with possible value drafts on the same table, there are many more columns like saved , gender , blood group (A, B, O), rHFactor (+ ve, -ve) Business (service, business, student, unemployed) etc. If I create a separate table for each such column then I will get 20 to 25 Master tables.

In addition to this, all Master's dates in a table, such as CommonMaster , type, key and value are shown below, Tried to insert:

create table CommonMaster (commonCode INT not NULL primary key AUTO_INCREMENT, type VARCHAR (255) No NULL, key INT not NULL, value VARCHAR (255) NULL); With values ​​like:

  Code type key value 7 BLOOD_GROUP 1A8 BLOOD_GROUP 2B 9 BLOOD_GROUP 3 O 10 RH_FACTOR 1 + ve 11 RH_FACTOR 2 -ve 12 OCCUPATION 1 Service 13 OCCUPATION 2 Profession 14 OCCUPATION 3 Business 15 OCCUPATION 4 Student 16 Oak Appointment 5 Unemployed  

I want to know what a better approach is and why do I The design should be in hibernation, so the design should be related to that.

I like hundreds of master tables compared to a normal table with all; More adaptive to more structure, more organization, report, add, remove, and update afterwards.


cordova - PhoneGap offline event fires too slow -


In my phonegap app, I first check whether the device was connected to the internet before running the code and before calling the API. is.

  if (window.navigator.onLine == incorrect) {// error handling} else {// do stuff & amp; Call API}  

This works perfectly, but if the device loses its connection and within 5 seconds or the page reloads, then when I get disconnected Even after the code releases and the API is called the device is no longer connected. If the page is reloaded after approximately 5 seconds then the error is removed as expected to deal with it

It seems that about 5% of lost to convert the connection to "offline" It took up to seconds I checked it again with offline events and it was only removed after 5 seconds.

  document.addEventListener ("Offline", offline, incorrect); Function onoffline () {warning ("now offline"); }  

Is there a way to lose or deactivate connections or something else?

If the problem is specifically with page status check on page load, then the network-info plugin Use and call the function after page load is completed:

  function check connection () {var networkState = navigator.network.connection.type; Var state = {}; States [connection. Unknown] = false; States [connection. Ethernet] = true; States [connection. FII] = true; States [connection. CELL_2G] = true; States [connection. CELL_3G] = true; States [connection. CELL_4G] = true; States [connection. NONE] = False; Return state [networktate]; }  

After use in the application Offline and online events work specifically deviceready The event is removed as soon as the network-information plugin can return the connection status.


windows phone 8 - Text in encoded PNG or JPEG blurry after encoding from RenderTargetBitmap -


I was trying to create a PNG file from a canvas. An image canvas and three Tekstblons was also aimed at allowing to move around the user's text block canvas, and then save the screenshot in a photo.

The captured image looks ok To capture on canvas I use Rendertaijet bitmap I but once I tried to change RenderTargetBitmap encode the PNG or JPEG, text becomes blurry

Here is the original image :.

Image details recorded on

Here's the code I used Goes:

prefix pixels = wait ArrangePicturePage. ArrangedImage.GetPixelsAsync (); Byte [] bytes = pixel .oerere (); IRandomAccessStream stream = new InMemoryRandomAccessStream (); BitmapEncoder encoder = wait BitmapEncoder.CreateAsync (BitmapEncoder.JpegEncoderId, stream); encoder.SetPixelData (BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, (uint) ArrangePicturePage.ArrangedImage.PixelHeight, (uint) ArrangePicturePage.ArrangedImage.PixelWidth, 96.0, 96.0, bytes); Wait for the encoder. Flush async (); Byte [] resulting buffer = new byte [stream.Size]; Wait for the stream. ReedSync (resulting buffer. Asbuffer (), (UIT) resulting buffer, length, inputstream option .a);

The resultant buffer is a blob that I think is PNG or JPEG. It looks like this:

here

there is something wrong with my conversion obscures the code that text?

After

You can control the compression by seting but you pass near.

Customize the default setting for quality display. If you need quality quality, then you can use it in BitMap Interface mode. Can strike in the trunk.


android - Calling Service From Broadcastreceiver Issue -


I need to use a service within the broadcasting receiver (I start the receiver with an alarm), but the problem It happens when I have to call service. Apparently this was never executed. It was never executed. I have also set debugger to check, but this is not also related to the code.

I do not know why the service never triggered

my receiver call

  private zero getHour () {/ / Use it to start and trigger service INTENCE i = new intent (reference, getHourService.class); I.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Context.startService (i); }  

service

  public class provides getHourService service {public int horaR; Public IT Miner; @ Override public int onStartCommand (intended intent, int flags, int startId) {android.os.Debug.waitForDebugger (); // some logical code here}}  

I add to the manifest

  & lt; Application Android: allowBackup = "true" android: icon = "@ Mipmap / ic_launcher" android: label = "@ string / app_name" Android: Theme = "@ Style / Aaptim" & gt; & Lt; Activity Android: Name = ". Main Activity" Android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt ;! - Too many receivers - & gt; & Lt ;! - service - & gt; & Lt; Service Android: name = "alarmas.getHourService" & gt; & Lt; / Services & gt; & Lt; / Application & gt;  


deployment - Websphere 7 takes a very long time to deploy a war -


I'm trying to deploy a war in Websphere 7 / Windows 7. I tried both methods, and command line from GUI console. From the command line, I tried

  wsadmin> $ AdminApp install c: /app.war  

In both cases it takes a very long time to terminate, there is really nothing special about the hour deployed application, such as Time-consuming work done in the initial time. Why is it like this? On the same server, an update of an already existing app expires in minutes. What is the way to make the deployment faster?


java - Copy Cloud Storage File ( create a duplicate of the file ) -


I used to upload a file, and my files are stored on Google Cloud Storage within a specified bucket. Used to be.

Structure

I am storing files in cloud storage and keep it BlobKey to manage it anywhere , Whenever I need to serve it I use

  Blob's Blobke = Service. Creation Blob (BlobString); Service.serve (Blobby, Feedback);  My requirement   

I want to give the user a function so that the user can copy the file. I do not know how this can be done. Will I be able to get raw byte [] and store it back on cloud storage? There is no such method in the API.

You GcsServiceFactory class, which has been documented, and its one Overloading of static method is called to get an example of the interface GcsService on the createGCSService , which, in turn, is documented on.

The latter method is copy , see, com.google.appengine.tools.cloudstorage.GcsFilename), that's what you are looking for.

GCSFileName , which has two examples that you have to go through in the copy method, is documented - it's really simple, as You can see from its creator:

  GcsFilename (java.lang.String bucketName, java.lang.String objectName)  

Therefore it is essentially Only the name of the bucket and the object name inside it.


I want triggers to delete from 2 tables in sql server -


I have 2 SQL Server tables (A and B).

I want to delete the following lines: A, when removing a line in B by using a trigger

and I want to delete the rows from it: B, when one is in Deleting a line leads to a trigger.

This is my trigger so far:

  Instead of creating / removing triggers deleted from DELETE B to B, WHERE B. Id = deleted.Id deleted from deleted A, deleted WHERE A.Id = deleted.Id  

and my second trigger:

  after Create the trigger after- Delete the A after the deletion after deletion, A. Aid = deleted when deleted. Id  

but it does not work correctly, I get a straightforward repetition (instead of triggers, do not support direct recursion. Trigger execution failure - this error).

How can I fix this?

I wanted to delete a hierarchy of records in a self-referenced table that had foreign key restrictions. Later using the Daily Trigger was not working as the foreign key restriction was already violated. The trigger did not work by using any INSTEAD because it did not support "direct recycling from inside the trigger" error, changing the setting directly and indirectly to the database did not have any effect. I could not find a solution where I only solution that one by records from the great depth with a number of uses CTE depth / level was to select all records in succession and avoid foreign key violations To remove it was to use the cursor. The example is triggered:

create triggers [dbo]. [DBO] at [relatedAccountindedDeliet] Start with [the related ACC] as the start of DELETE; - Log in to related accounts deleted from related accounts (select rye). [Guide], ra1.relatedAccount_guid related account ra1 Internal included Deleted d. [Guid] = ra1. [Guid] Union Select all ra1. [Guid ], Ral RelatedAccount RA1 joined relatedAccounts RA2 on relatedAccount_guid RA2 interior. [GUID] = ra1.relatedAccount_guid where ra1.relatedAccount_guid not null) select RA1 putting relatedAccount_history. * RelatedAccount RA1 to join the Inner RA2 with relatedAccounts RA2. [GUID] = RA1 [GUID]; - Remove the relevant bodies with the relevant authorities (Raia 1 pick. [Guid], ra1.relatedAccount_guid related Account Ral deleted add interior d. [Guid] = ra1. [Guid] Union Select all ra1. [Guid], ra1.relatedAccount_guid joined relatedAccounts RA2 on RA1 inner RA2 from relatedAccount. [GUID] = ra1.relatedAccount_guid where ra1.relatedAccount_guid not null) remove dbo.relatedEntity where [GUID] for (t1 selection. [GUID] from relatedAccounts D joining inner t1.relatedAccount_guid = d on dbo.relatedEntity T1. [Guid]); - Delete related accounts @guid uniqueidentifier; - Select the relatedAccounts_cursor cursor (related to 1 as selection, RA1 [GUID], associatedAccount to r1.relatedAccount_guid, RA1 inclusion on the inner d for associatedAccounts along with relatedAccounts as the selection of all accounts in any of your hierarchies. deleted D [GUID] = RA1 [... GUID] union all select joined on as ra2.depth + 1 depth, RA1 [GUID], ra1.relatedAccount_guid RA1 inner RA2 from relatedAccount. relatedAccounts RA2. [ GUID] = ra1.relatedAccount_guid where ra1.relatedAccount_guid is not empty) Selection of [GUID] with respect to the related digits in depth; - violate foreign key constraints open relatedAccounts_cursor while @@ fetch_status = 0 @guid bring next relatedAccounts_cursor initially delete dbo.relatedAccount delete accounts from the top down to avoid the [GUID] = @guid; The next arithmetic by related counting @Gangband related points related to related end; Related departments; END

batch: get relative filepath of files -


I need to get a file path relative to files with the bat.

Folder structure

  file.bat - folder1 - subfolder1 ----- abc.image ----- def.image - subfolder 2 ---- more . Image - Folder 2 - Subfolder 1 ---- Bhimize .image - subfolder2  

For abc.image, I want to get the name of the folder (such as folder 1) and the combination folder + Subfolder (Folder 1 / Subfolder 1 on here)

I looked at this post: but I can not work for it. The output is giving me a lot of chaos.

I finally want to do this:

  set "prefix = td" set "file = list_of_images.xml" echo ^  gt; & gt;% file%) echo ^ < / Files ^ & gt; & Gt; & Gt; Thanks for the help and suggestions!   

% file%
"Lang-dos prettyprint-override"> For / f "tokens = 1, * delims = \" %% a in ('xcopy'. *. * Image ""% temp% "/ s / e / l ') if not" %% b The easiest way to get a list of files with relative path is to xcopy

You can use "virtual" You can also use the subst command to create the drive. The drive letter with the root of the drive pointing to the drive start, and then refer to this code and Use the same code, which will no longer retrieve the top folder structure

Edit for comments for optimization

  for / f" tokens = 2-4 delims = \ "%% a in ('xcopy'. * * Image" "% temp%" / s / e / l ') do Echo folder = %% output from a subfolder = %% b file = %% c  

format xcopy is in the format

 . Folder \ subfolder \ file  

Then, using backslash as delimiter, we skip the first token and retrieve the second (folder), the third (subfolder) And the fourth (file)


html - Connecting with an IP address and IP subnet? -


I'm looking to connect to these addresses, but I do not know where it starts from me The IP address given is given: 65.51.180.122 and this IP subnet (which I have changed for posting purposes): 47.19.102.176/28 I have seen in this reply. However when I used the given responses to me, "This webpage is not available error" I decided to use the more famous address for testing, Facebook and received the same error. It is not necessary to see a webpage, just need to access its data through a curl request in my Mac terminal.


Get selectedvalue from combobox in DataGridTemplateEditColumn c# WPF -


मैं इस विधि से codebehind से एक डाटाग्रीड को बाध्य कर रहा हूं:

  निजी शून्य BindDataGridSetup () { // datefiltereing पहले काम करने के लिए वर datefiltered = data.View_NAV_Entries.Where में शामिल होने के लिए छोड़ दिया करने के लिए करते हैं (; e.DATO & gt; ई = & gt = this.StartDate & amp; & amp; e.DATO & lt; = this.EndDate); // लिनक "सेटअप" ग्रिड के लिए डेटा प्राप्त करने के लिए वर querySetup = data.R_Masterdata में मीटर से m.SubsidiaryId पर data.View_R_GetAccounts में एक setup.DefaultIfEmpty में accplan से सेटअप में a.S_Dataset के बराबर होती है में शामिल होने के () नई पर data.R_Configuration में config में शामिल होने {MasterDataId = m.MasterDataId, खाता = accplan.No_} conf.DefaultIfEmpty में एक्स से conf में नए {config.MasterDataId, config.Account} बराबर () नए {ComponentID = x.ComponentId, MasterDataId = x.MasterDataId} को data.R_Component में घटक में शामिल होने के नए {घटक के बराबर होती है .ComponentId, this.MasterDataId} comp.DefaultIfEmpty में कॉम से COMP में () ई में शामिल होने के नए {डेटासेट पर datefiltered में = accplan.S_Dataset, KONTO = accplan.No_} नए {e.DATASET बराबर होती है, e.KONTO} प्रविष्टियों में प्रविष्टियों से प्रविष्टियों में। डिफॉल्ट IFEmpty () जहां एम। एसबीआई डिविज़िरी इकोल्स (यह.सिब्डिजरीआईडी) और amp; amp; accplan.S_Dataset.Equals (this.SubsidiaryId) नए {accplan.No_, accplan.Name, x.Eliminate, com.ComponentId, com.ComponentName} जीआरपी orderby में से समूह ईएनटी grp.Key.No_ नए {AccNumber = जीआरपी का चयन करें। Key.No_, AccName = grp.Key.Name, Saldo = grp.Sum (ई = & gt; (e.BELOBDKK == बातिल 0: e.BELOBDKK)?), घटक = grp.Key.ComponentName == बातिल? "कामकाजी": grp.Key.ComponentName, ComponentId = grp.Key.ComponentId == शून्य? 0: grp.Key.ComponentId, अवयव = डेटा.R_Component.ToList ()। जहां (x = & gt;! X.ComponentName.Contains ("खाली")), ConfEliminate = grp.Key.Eliminate}; {DataGridSetup.ItemsSource = querySetup.ToList () का प्रयास करें; } पकड़ (अपवाद ई) {System.Windows.MessageBox.Show (e.InnerException.ToString ()); }}  

और मैं इस XAML के साथ बाध्य कर रहा हूँ:

  & lt; DataGridTemplateColumn x: नाम = "घटक" हैडर = "कंटेंट" & gt; & LT; DataGridTemplateColumn.CellTemplate & gt; & LT; DataTemplate & gt; & Lt; टेक्स्टब्लॉक टेक्स्ट = "{बाध्यकारी घटक}" / & gt; & Lt; / DataTemplate & gt; & LT; /DataGridTemplateColumn.CellTemplate> & LT; DataGridTemplateColumn.CellEditingTemplate & gt; & LT; DataTemplate & gt; & Lt; कॉम्बो बॉक्स x: नाम = "कॉम्बो बॉक्स सेटअप" ऊँचाई = "16" आइटमस्सोर्स = "{बाध्यकारी घटक}" प्रदर्शनमंबरपैथ = "कम्पोनेंटनाम" चयनित वैल्यूपाथ = "{बाध्यकारी कम्पोनेंट आईडी}" & gt; & LT; ComboBox.ItemContainerStyle & gt; & Lt; शैली TargetType = "ComboBoxItem" & gt; & Lt; सेटर संपदा = "पैडिंग" मान = "1" / & gt; & Lt; सेटर संपदा = "ऊंचाई" मान = "1 9" / & gt; & Lt; / शैली & gt; & LT; /ComboBox.ItemContainerStyle> & Lt; / ComboBox & gt; & Lt; / DataTemplate & gt; & LT; /DataGridTemplateColumn.CellEditingTemplate> & Lt; / DataGridTemplateColumn & gt;  

टेक्स्टबॉक्स ठीक दिखता है और जब मैं कॉम्बो बॉक्स पर डबल-क्लिक करता हूं तो यह संभावनाओं के साथ नीचे जाता है सब ठीक। लेकिन मैं कॉम्बोबॉक्स में चयनित वैल्यू को पीछे कोड से पकड़ नहीं सकता।

मैं कॉम्बो बॉक्स से चयनित मूल्य कैसे प्राप्त करूं?


javascript - Unable to send push notification with ACS REST API after login -


I would like to create html / javascript form on my website. With the form I want to send a push notice to Wired Android and iOS devices.

Login http request works fine:

  httpRequest.open ('POST', 'https: //api.cloud.appcelerator.com/v1/users/ Login .json key = xxxAPKEYxxx & amp; login = xxxEMAILxxx & password = xxxPASSWORDxxx '); HttpRequest.send (); HttpRequest.onload = function () {var data = JSON.parse (this.responseText); Var sessionID = data.meta.session_id; SendPush (); } ":" "Meta": {"code": 200, "status": "right", "method_name": "login user" .... so entry is success . But then when I call the sendPush function, I get a response error: Feedback error: "Status": "Failed", "Code": 400, "Message": "Failed to authenticate user".  
  function sendPush () {httpRequest.open ('POST', 'https: //api.cloud.appcelerator.com/v1/push_notification/notify.json?key = xxxAPPKEYxxx and channel = XxxCHANNELxxx & payload = test '); HttpRequest.send (); HttpRequest.onload = function () {console.log (this.responseText); }; }  

  function sendPush () {var BASEURL = 'https: // Api.cloud.appcelerator.com/v1/ 'httpRequest.open (' Post ', BASEURL +' push_notification / notify.json? Key = APPKE '); HttpRequest.send ({channel: "xxxCHANNELxxx", payload: "test"}); HttpRequest.onload = function () {console.log (this.responseText); }; }  

java - How to run JAR in an IntelliJ plugin -


To run a jar in IntelliJ, just right-click on the jar in the module and click Run ' Xyz Choose jar ' or debug' xyz.jar '*

How can I run / debug a jar in the intelligible plugin (for example < Em in the form of a menu entry> Tools menu) so that it looks like a above (including the run tool window) and looks?

I have already define the action handler ( com) as the sub-category in the plugin.intellij.openapi.actionSystem.AnAction It is known only.

According to the description, the easiest way is to use the Run Configuration Here:


java generics return an array -


Edit: I do not think how the second question gives me an answer. I already have a clear artist (e []), who is not the author of the second question. I also tried something like seq1 = (integer []) iw.result (); But that does not work either.

I have the following code:

  Public class is something comparative & lt; E & gt; & Gt; {E] [] Sack; Some public () {seq = (e []) new object [100]; } Public E [] results () {Return sequence; } Public static zero main (string [] args) {some & lt; Integer & gt; Iw = new something & lt; Integer & gt; (); Integer [] sAC1 = new integer [100]; Seq1 = iw.result (); }}  

I get a misunderstanding in this way: [Object can not be inserted in [Comparative

, so I change some-maker to:

  seq = (e []) new comparative [100];  

Now I get a misunderstanding in this way: [Comparative can not be inserted into [integer]

Is there any way to work above code? I know I'm better off working with collections, but I'm just curious what's wrong with my code.

Here are some problems.

First of all, this is not an unlimited general parameter; enclosed comparative .

During the extinction of type, your class has been declared as:

  public class something & lt; E comparative & lt; E & gt; & Gt; {E] [] Sack; }  

... is bound to e comparative .

  public squares some {comparative [] Seq; }  

This therefore your casting is not working, because object is not a comparable . You want to use the new comparative instead.

  public class something & lt; E extractable comparative & lt; E & gt; & Gt; {E] [] Sack; Some public () {seq = (e []) new comparative [100]; }}  

Now, Java and should break on the previous two statements.

  integer [] seq1 = new integer [100]; Seq1 = iw.result ();  

is bound to iw.result () comparative [] , not integer [] . A comparative [] can never become a integer [] .

You can do this instead to leave ClassCastException :

  comparative [] seq1 = new integer [100];  

This will work since a integer is comparative . This is due to the fact that arrays are co-sensation (which is a subtype of a integer [a] a comparable [] ).


Returning sum of duplicate elements in javascript array -


I have checked the forum to see that I am the answer to this question but so far, not me I have this 2 dimensional array that I want to add to their values ​​if they are similar here is an example.

  CAR CH 394 CAR CH 96 CAR CAP 268 DOOR CAF 71 DOR CAP 96 DOR CAP 268 VACC DISTRICT 71  

Array, I have the above values. How do I add all duplicates to the array list? In this case, this is the CAR and DOR. Cap will affect. Therefore, instead of returning to duplicate, to return the combined sum to the combined sum.

if I understand what you are saying correctly ( Because it is not really very clear), and given that your array has already been sorted, then I can use it by using it:

"source-=" snippet-code-js lang-js prettyprint-override ">" source "= [[" ["DOR" CAF ", 71], [" DOR "," CAR "," CAH ", 96], [" CAR "," CAP ", 268]," , "CAP", 96], ["DO Ray "," cap ", 268], [" vac "," gilab ", 71]]; past last; var todays = source.reads (function (first, curry) {if (last) {if (last [0 ] === curr [0] and last [1] === curr [1]) {last [2] + = curr [2]; Return to return;}} Last = curr; prev.push ( Curr; coming back;}, []); alert (JSON.stringify (folded));

If you get the first two elements, then you add the last one to the previous value and return the array. If they do not match, then you press the new value in the array.


.net - Why is GroupBy multiple fields not grouping correctly> -


I have found a model object with a timestamp asset, and I want to group in this year and month, so I did this:

Months of events up to months dull month = model Aventus New {x.Timestamp.Year, x.Timestamp.Month}} with group (function (x)

but this is actually returning a group for every event, even so With that same year and month: wrong grouping

what's going on here is? Instead of a group based on year and month, why is GroupBy creating a separate group for each event, and how can I fix it?

only the fixed key property equality determines if no major properties , You get the reference equality.

  with new {key x.Timestamp.Year, Key x.Timestamp.Month}  

Key Properties

Key properties are different from non-core properties in many basic ways:

  • To define properties It is done whether two examples are the same.

  • The values ​​of the key properties are read-only and can not be changed.

  • Only the key property value is included in the compiler-generated hash code algorithm for an anonymous type.

Parallels

Anonymized type of examples can be the same if they are the same anonymous type examples. Examples consider the same type of example as if they meet the following conditions:

  • They are declared in the same assembly.

  • The names are the same as their properties, they are the approximate types, and they are declared in the same order.

  • In each, the same properties are marked as the key properties.

  • At least one asset is an important asset in each manifestation.

There is no instance of an anonymous type in which there is no major quality, it is similar to that only.

to


http - Simple POST PHP via DHC chrome extension -


I have trouble making a simple post request on the PHP page.

Here's the PHP.

  & lt ;? Php if (isset ($ _ POST ['username']) and isset ($ _ POST ['password'])) {$ _POST resonant ['username']; Copy $ _POST ['password']; } Else {resonant "Parameters not posted"; }? & Gt;  

Here is my postal system in DHC.

User Name = Value1 and Password = Value2

Image

I do not understand why it always goes to the other and the response parameters are not posted.

When I try to post in JSON, this is the same result. Even if I used to make both points before the pulse of EPL, but it does not show anything.

My goal is to achieve something like this but I have been blocked on the post.

set your content-type To:

  Content-Type: Application / x-www-form-urlencoded  


javascript - Error: Expression 'undefined' used with directive is non-assignable -


बेला यहाँ

मेरे पास जेसन से डेटा है

  $ Scope.info = {"company1": "यह", "कंपनी 2": "है", "कंपनी 3": "स्पार्टा"}  

मैं एनजी-दोहराने का उपयोग कर रहा हूं सभी डेटा प्रिंट करने के लिए और मैं खेतों में परिवर्तन के लिए मोनटर चाहता हूं।

  & lt; इनपुट प्रकार = "टेक्स्ट" एनजी-दोहराने = "आइटम में जानकारी" value = " {{Item}} "मॉनिटर-परिवर्तन & gt;  

मेरे पास एक मॉनिटर परिवर्तन डायरेक्टिव है:

 । डायरेक्टिव (मॉनिट चेंज), फ़ंक्शन () {वापसी {प्रतिबंधित: 'ए', क्षेत्र: {ChangeFlag: '='}, लिंक: फ़ंक्शन (स्कोप, एलिमेंट, एटर्स) {var $ el = angular.element (element); $ el.on ('keyup', फ़ंक्शन () {// element scope से बाइंड करें $ लागू (फ़ंक्शन () {key.changedFlag = true; // key प्रेस मान बदल जाता है}}}}}}}}}};  

डेटा बदलने की कोशिश करते समय, मुझे त्रुटि त्रुटि: [$ compile: nonassign] अभिव्यक्ति 'अपरिभाषित' निर्देश के साथ प्रयोग किया जाता है 'मॉनिटिवेंज' गैर-असाइन करने योग्य है!

मैं अपने दृश्य में डेटा को प्रिंट कर रहा हूं:

  {{changedFlag}}  

इसमें क्या गलत है जैसा कि आपने क्षेत्र का उल्लेख किया है: {caretPosition: '='}

  1. / Code> निर्देश परिभाषा में, हमें मार्कअप में caret-position = "obj.changedFlag" पास करना होगा।
  2. जैसा कि ng-repeat बनाता है प्रत्येक आइटम के लिए एक नया दायरा, नियंत्रक के दायरे में प्रतिबिंबित परिवर्तनों के लिए डॉट संकेतन का उपयोग करना अच्छा है।

यह अपडेट किया गया बेला है।


Layout Master/Flow not work android -


Hello I have my custom master / flow layout but do not work for tablets.

My List Active Layout:

& lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: app = "http://schemas.android.com/ apk / res-auto" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: orientation = "vertical" Android: FitsSystemWindows = "true" & gt; & Lt; Include in Android: id = "@ + id / toolbar_actionbar" layout = "@ layout / toolbar_default" /> & Lt; Fragment xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: id = "@ + id / item_list" android: name = "it.package.ItemListFragment" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Layout_marginLeft = "L6dp" Android: Layout_marginRight = "L6dp" equipment manual = "it.package. items list Activity "tool: layout =" @ layout / list_grast_sign "/> & Lt; / LinearLayout & gt;

My extension layout:

  & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: app = "http://schemas.android.com/apk/res-auto" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Orientation = "Vertical" Android: fitsSystemWindows = "true" & gt; & Lt; Include in Android: id = "@ + id / toolbar_actionbar" layout = "@ layout / toolbar_default" /> & Lt; FrameLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: id = "@ + id / item_detail_container" Android: layout_width = "match_parent" Android: layout_height = "match_parent" tool: reference = "it.package.ItemDetailActivity" tool: ignore = "mergeRootFrame" /> & Lt; / LinearLayout & gt;  

And the tablet has a two-way layout:

  & lt; linearLayout xmlns: android = "http://schemas.android.com/apk/res / Android" xmlns: device = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" Android: baselineAligned = "false" android: divider = "android: attr / divider horizontal" android: orientation = "horizontal" Android: Shows Diwhiders = "Medium" tool: reference = "it.package.ItemListActivity" & gt ; & Lt ;! - This layout is a two-way layout for item master / extension flow - & gt; & Lt; Include in Android: id = "@ + id / toolbar_actionbar" layout = "@ layout / toolbar_default" /> & Lt; Piece android: id = "@ + id / item_list" android: name = "it.unifi.package.ItemListFragment" Android: layout_width = "0dp" Android: layout_height = "match_parent" Android: layout_weight = "1" Equipment: layout = "@ Layout / list_success_content" /> & Lt; FrameLayout android: id = "@ + id / item_detail_container" Android: layout_width = "0dp" Android: layout_height = "match_parent" Android: layout_weight = "3" / & gt; & Lt; / LinearLayout & gt;  

All works for the smartphone, but in the tablet I have a white page.

Try this:

  & lt; LinearLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: baselineAligned = "false" android: divider =: Android: orientation = "horizontal" Android: showDividers = "Medium" Android: layout_below = "@ + id / Toolbar_actionbar "Tools:" Android Attr / DividerHorizontal? " Context = "it.package.ItemListActivity" & gt; & Lt; Piece android: id = "@ + id / item_list" android: name = "ItkpackagekItemListFragment" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" equipment layout = "@ Layout / list_grad_content "/> & Lt; Android: layout_height = "wrap_content" Android: layout_weight = "3" & Lt; / LinearLayout & gt; & Lt; Android.support.v7.widget.Toolbar Android: id = "@ + id / toolbar_actionbar" Android: layout_width = "match_parent" android: layout_height = "wrap_content" android: background = "@color / background_color" android: minHeight = "? Atri / actionbarsis "/> & Lt; / RelativeLayout & gt;  

javascript - Highcharts Image Renderer Auto Height -


I am trying to install a logo on the top left corner of the graph and the code below is working fine, But did I want to know that any of their direct is the way I can height or width automatically such as we can do in CSS?

  function (chart) {chart.renderer.image ("http://i.imgur.com/mX5qRdP.png", 5, 5, 30, 30) .add (); }  

I know that I can do this by calculating the height and width.

But is he a more sophisticated way?

Highlight a SVG library, and width for the SVG 1.1 specification and < Code> height attributes & lt; Image & gt; is required for element

See the feature definitions to see.

What I wanted to know is any direct way of them, from which I can make the height or width auto as if we do in CSS?

Actually, I do not think there is a way of automatic shapes like CSS because the SVG features width and & lt; Image & gt; element height .


c - ERROR : Expected Expression '/' before token -


This is my program. I am getting an error in the code that I could not debug, help me find the solution . I am getting this error: Expecting expression '/' token in the first line of the main function

  #include & lt; Stdio.h & gt; #include & lt; String.h & gt; #define NUM_CDS 100 #define TITLE_SIZE 70 # defined ARTIST_SIZE 70 int main () {/ ** declaration of variable ** / four heading [NUM_CDS] [TITLE_SIZE + 1]; Two-dimensional array with /// line size of 100 and type # 70, the Nordic four artist [NUM_CDS] [ARTIST_SIZE]; # Andif In Spot Tracks with NUMA / 70 Array 70 [NUM_CDS]; /// CD track available in four types; /// Whether the CD is the single or album int album [NUM_CDS]; Float value [NUM_CDS]; Int count = 0; /// How many CDs are tracked Int i; /// more; ("Welcome to the CD Shop"); Printf ("You can store up to% d cd.", Sizeof size / sizeof price [0]); Says ("======================================"); Fflush (stdin); / ** ** Loops they do not require more CDs until / / (;;) /// Loops are always convenient for this type of things {/ *** Program now for more entries from the user Asks *** / puts ("Do you want to store more data, yes for yes or not for N:"); Fflush (stdin); Scanf ("% c", & more); If (Tupar (type)! = 'Y') /// If user input is not equal to Y or Y, loop brake break; Printf ("\ n"); / ** For good practice we use new line ** ///// (more == 'Y' || more == 'Y' ?: break); /// Title description fputs ("Enter the title of the CD:", stdout); Fflush (stdin); Fgets (title [count], headline [count], stdin); Title [Count] [Stellen (title [counting]) - 1] = '\ 0'; #ifndef NOARTIST /// Artist Details Fputs ("Artist of CD": "Standout"); fflush (stdin); Fgets (artist); Size artist [count], stdin; Artist [Count] [Stellen (artist) [Count]) - 1] = '\ 0'; #endif /// track description printf ("how many tracks are in it:"); fflush (stdin); scanf ("% d", & tracks [count] ); /// The user has to ask if it is single for album or (;;)) If a valid entry is made then the loop exits from the only exit {printf ("album or single" (for album 'A 'Or' A 'for singles Left): "); Fflush (stdin); Scanf ("% c", & amp; Type); Type = topler (type); /// Only valid letters {A, A, S, S} are accepted if (type == 'A' || type == 's' || type ==' a '|| type ==' s ' )             break; Else {printf ("Re-enter the invalid entry. The valid entry is one, s, a, s. \ N"); /// fflush (stdin); }} Album [count] = type == 'a'; /// For user value ask printf ("dollar price in cd (enter this format in 6.30):"); Fflush (stdin); Scanf ("% f", & amp; value [count]); /// calculation + = 1; /// count increases and if prompted, then start next / ** check whether we have inserted an array of 100 elements / ** (++ calculation == NUM_CDS) {printf ("We maximize size Reached the limit \ n \ n "); break; }} / *** This is where the output section starts / i (i = 0; i  

  1. I think, that scanf ("% c" , & Amp ;;); should be scanf ("% c", and type);
  2. You can ; inserts (album [i]? "Album": "single")
  3. you #include & lt; Ctype.h & gt; for Tuper () function

After these changes, I am able to compile and run this program (which looks like) In Studio 2005