Thursday, 15 January 2015

In R, kriging gives "system is exactly singular" error -


I have a problem where my specific input generates an error.

  Library (kriging) x  

I honestly do what is wrong I do not know my formatting I've seen seems to combine well with example code.

The problem is, as mentioned by @mokli, that you have duplicate overviews. In this context, the same digit with the same x and y coordinates. The following code appears to be duplicate:

  coor = cbind (x, y) repeated [coor] # [1] false false false false false false false false false false false false # [13] FALSE True Truth False Wrong False True # [25] True Truth True Real True True Real False Wrong false false falsehood [Duplicate (Coral), # [, 1] [, 2] # [1,] 45 40 # [2] , 25 60 # [4,] 40 35 # [5,] 25 50 # [6,] 55 25 # [7,] 40 40 # [8,] 25 55 # [9,] 55 20 # [10, ] 40 35 # [11,] 25 50 # [12,] 50 20 # [13,] 25 45  

This leads to an unconnected congruent matrix in Kriging equations, Programmed to turn dgesv from the Lapack error. The solution is to remove the duplicate from the dataset.

The following dataset works:

  x = runif (100) y = runif (100) z = runif (100)) Krig = kriging (x, y, Z, lag = 3) Image (krig)  

Enter image details here


Javascript Addition wont work -


Can anyone tell me how to add these variables:

  var preciopag = Document valores.T1.value; Var libraz = document.valores.T2.value; Var ServicesOcom = 5.00 var contador1 = 0; Var contador2 = 0; Var tramite = 0; Var angioptis = 0; Var ITBMS = 0; Var Total = Presoep + ServicioCom + NVPT + Tramite + ITBMS;  

Thanks in advance.

values ​​ elements always had a string , Therefore, + will result in concatenation , not except that

String number to get value:

  var preciopag = + document.valores.T1.value; Var libras = + document.valores.T2.value;  

I used + , which will look at the whole string, but you can see the parseFloat which will ignore anything Lastly invalid; It is entirely dependent on what you want to do with semi-valid input.

Display:

  var preciopag = "5"; // Simulate the document. Original. T. 1.value var libras = "10"; // Simulate the document. Differentiation. 2.value var serviciocom = 5.00 var contador1 = 0; Var contador2 = 0; Var tramite = 0; Var angioptis = 0; Var ITBMS = 0; Var Total = Presoep + ServicioCom + NVPT + Tramite + ITBMS; Snippet.log (total); // "55000" - wrong // instead: preciopag = + "5"; // Simulate the document. Original. T. 1.value libras = + "10"; // Simulate the document. Differentiation. 2.value total = presoepag + servercom.c + angiopet + tramite + ITbms; Snippet.log (total); // "10" - Correct  
  & lt ;! - Script provides `snippet` object, see Http://meta.stackexchange.com/a/242144/134069 - & gt; & Lt; Script src = "http://tjcrowder.github.io/simple-snippets-console/snippet.js" & gt; & Lt; / Script & gt;  


javascript - Is it possible to convert stream to buffer synchronously? -


सरलतम Gulp कार्य को देखें जो कि का उपयोग करता है:

  var gulp = require ('gulp '); Var टैप = की आवश्यकता होती है ('गुलप-टैप'); Gulp.task ('mytask', function () {return gulp.src ("src / * / *। Js") .पाइप (नल (फ़ंक्शन (फ़ाइल) {file.contents = नया बफर ('ब्लाला');} )) .पाइप (gulp.dest ('। / Dist'));});   

यह फाइल को src निर्देशिका से लेता है, "blabla" के साथ सामग्री की जगह लेता है और उन "खराब" फ़ाइलों को "वितरण" निर्देशिका में सहेजता है। यह आसान है!

लेकिन क्या होगा अगर हमारे पास "ब्लाला" की बजाय धारा है? उदाहरण के लिए:

  var gulp = require ('गुलप'); Var टैप = की आवश्यकता होती है ('गुलप-टैप'); Var jsdocParse = की आवश्यकता होती है ("jsdoc-parse"); Gulp.task ('jsdoc', फ़ंक्शन) (वापसी gulp.src ("src / * / *। Js") .पाइप (नल (फ़ंक्शन (फ़ाइल) {var stream = jsdocParse (file.path); file.contents = ???;})) .पाइप (gulp.dest ('। / Dist'));});  

इसे आज़माएं:

  gulp.task ( 'माइटस्क', फ़ंक्शन () {return gulp.src ("src / *। Js") .पीप (टैप (फ़ंक्शन (फ़ाइल, टी) {file.contents = बफर.कॉकेट ([jsdocParse (file.path)]) ;})) .पाइप (gulp.dest ('। / Dist'));});  

angularjs satellizer redirect back to previous page -


To handle my authentication with the local API, I am using a satellite operator in my angular code. Integrating any third party API authentication, everything is local if the user is with an invalid token, then I am working on the website, the system will redirect the user to the login page. If I need to get the requested link back after user login, how do I do this?

For example, if the user requests to use '/ client / description / 123', but the user will be redirected to the login page (/ account / login) after login is successful User / customer / description / 123 '

Satellizer is not helping you with this problem I also ran into this and made a service to handle it. So if a user is redirected to / login, I save the path in a service. After login, exit the service from the saved path and redirect it.

  1. When using 'UI-Router', find out every change by listening to '$ state changelog'. When the state changes and requires a login, save the current path by receiving it: '$ location.path ()'

  2. After login, $ Set path to location. Path ();

Hope this is helpful


intellij idea - Tortoise SVN Commit/update Hangs -


I have some issues with Turtle SVN, when I update / update the project folder, it hangs me Tried to uninstall it and install it again. I also tried to downgrade to the following version 1.7.11. This does not allow me to update / commit on this project, I need to download latest version cleanup command works!

In addition to this, I try to make changes with Intel by right-clicking on the file, gives me an error error fails: The program can run "svn": CreateProcess error = 2, the system can not find the file specified Can someone help me solve this? is there any way? It was in working condition till last week !! It is suddenly giving up this problem.

Turtle svn TortoiseSVN version 1.8.10, build 26129 - 64 bit, 2014/12/17 19:35:51 prefix 1.8.11, -release April 1.5. 1 APR-usage 1.5.4 Surf 1.3.8 OpenSSL 1.0.1Jay 15th October 2014 Zelib 1.2.8

< Disable or uncheck the "use the command line client" option from the P> subclasses settings. This will fix your problem.


java - Can I put LOG4J jar at server level and still manage to use LOG4J.XML of individual War files -


Can I add LOG4J jars to server level and still manage to use LOG4J.XML of personal battle files Can i do

I have a problem here I know how to solve this problem is to package LOG4J jar in your own EAR or war file, but I have one of my LOG4J jars in the server level class. The way, and each app follow their own log4j.xml. In this case LOG4J is starting with log4j.xml of the initial application and applies the same properties for all applications. It does not bother to see LOG4J.XML of other applications.

You help is really appreciated. Thanks for your time!


ios - Reading keys in plist and get the values -


In my Swift iOS project I have the following plist file. I want to read the keys without special mention and all the keys I want to get the price. I want to write it in SWIFT code. I tried the code below and received all the keys and values ​​but I want to check each key (especially "1234" etc.) and get value for it. How do I get it?

  var myDict: NSDictionary? (If "MyDict:% @", MyDict!)}     Pre> 

use this code < / P>

  for myDict (key, val)! To print a key / value {println ("\ (key): \ (val)")}  


Global variable has different memory alignment in different threads -


Recently I had a memory alignment problem that crashed my application and in the end a global variable has different threads Got different alignment in The global variable is defined

  typedef struct {double e1; Double E2; Double E3; Double E4; Double E5; Double E6; Double E7; Double E8; Double E9; Unsigned long E10; Unsigned long E11; Float e 12; } Event_t;  

This is declared in main.c

  event_t report [3];  

and two threads (two files) were accessed by T1 and T2. T1 is the manufacturer and fills in the report and fills the data. T2 bus format reads out data for conversion, in T2, the content of the report [1] is always incorrect By checking the address of the report [1], I found that the report [1] has 4 bytes T1 and T2 I have changed the definition to:

  Typeface level {double e1; Double E2; Double E3; Double E4; Double E5; Double E6; Double E7; Double E8; Double E9; Unsigned long E10; Unsigned long E11; Float e 12; } __attribute__ ((pack)) event_t;  

Now both T1 and T2 are correct. Mute locks using T1 and T2 to reach global variables for synchronization. My question is why t1 is always true, but does T2 have different memory alignment for this global variable?

Thanks in advance.


node.js - Use Model collection as data-type in sequelize -


पृष्ठभूमि :

यह एक उत्पाद डेटाबेस प्रोटोटाइप के लिए है, प्रत्येक उत्पाद कई संबंधित उत्पादों हो सकते हैं, और प्रत्येक संबंध में एक प्रकार है, जैसे

प्रौद्योगिकी

हम नोड पर सिक्वेलेट जे एस का उपयोग कर रहे हैं मॉडल को परिभाषित करने के लिए।

मॉडल स्निपेट:

  sequelize.define ('उत्पाद', {id: {type: DataTypes.INTEGER, AutoIncrement: true, primaryKey: true}, नाम: {type: DataTypes.STRING, allowNull: false, टिप्पणी: 'उत्पाद का नाम'} ...}); Sequelize.define ('ProductRelationType', {id: {type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true}, नाम: {type: DataTypes.STRING, अनुमति दें: गलत, टिप्पणी: 'रिश्ते के प्रकार विवरण'}}) ; Sequelize.sync ({force: false})। तब (फ़ंक्शन () {...});  

प्रश्न

क्या सीक्वेलिज़ में डेटाटाइप के रूप में खुद को मॉडल का उपयोग करना संभव है, उदाहरण के लिए: / P>

  sequelize.define ('ProductRelation', {आईडी: {type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true}, संबंधित उत्पाद: {प्रकार: उत्पाद} // उत्पाद मॉडल के संदर्भ) );  

और इसके बाद के द्वारा:

  उत्पाद। प्रमुख (उत्पाद रीलेशन, {as: 'relatedProducts'}); ProductRelation.hasOne (उत्पादरण प्रकार टाइप करें, {as: 'RelationType'});  

वैकल्पिक रूप से, ProductRelation तालिका परिभाषा को बाहर करें, और उपयोग करें:

  db.Product.hasMany (db.Product, {through: 'संबंधित उत्पाद'}) ; Db.RelatedProduct.hasMany (db.Product, {द्वारा: 'संबंधित उत्पाद'});  

नोट: ये अवधारणा उदाहरण हैं, वे काम नहीं करते हैं।

कोई भी सुझाव, या वैकल्पिक मॉडलिंग दृष्टिकोण की सराहना की जाती है।

धन्यवाद

ऐसा प्रतीत होता है, जो आप चाहते हैं वह सिर्फ एक n: m रिश्ते को स्थापित करना है उत्पाद से उत्पाद

एक लिंक प्राप्त करने का एकमात्र तरीका है- (या "के माध्यम से") तालिका। आप या तो मैन्युअल रूप से कर सकते हैं या इसे sequelize कर अपने आप प्रयोग कर सकते हैं:

  var संबंधित प्रोडक्ट्स = sequelize.define ('RelatedProducts', {// अन्य कॉलम यहाँ}) ; Product.belongsToMany (उत्पाद, {के माध्यम से: संबंधित उत्पाद, विदेशी कि: 'संबंधित ProductId'}); उत्पाद। बेल्ग्सटामनी (उत्पाद, {के माध्यम से: संबंधित उत्पाद});  

Diagonals at different points of a 2D list in Python -


I was wondering how to get a list of values ​​of diagonals that pass through the center.

Say I have a nested list:

  l = [[1,2,3], [4,5,6] [7,8,9] ]]  

How would I say, diagonal [2,6]?

I'm not sure what you want, but this code will give you all the diagonals in each direction Is:

  l = [[1,2,3], [4,5,6], [7, 8, 9]] number of rows, the number of columns: i.e. L. MXNM Se (Diag 2) diagram for P in N = lane (L), lane (L [0]) #NE-SW (Diag 1) and NW-category (M + N-1) 1 [[Diage 2] = []: Diag1.append ([]) diag2.append ([]) q1 = 0 if P & gt; = N: q1 = p - n + 1 q2 = m if p < M1: q2 = p + 1: x, y = p - q, q diag1 [-1] .append (l [y] [x]) for q in range -1 (q1, q2) # to obtain other diagonals For each line "back" x = n - x - 1 diag2 [-1] .append (l [or] [x]) print 'diag1:', diag1 print 'diag2:', diag2  

is:

  diag1: [[1], [2, 4], [3, 5, 7], [6, 8], [9]] diag2 : [[3], [2, 6], [1, 5, 9], [4, 8], [7]]  

c# - Visual Studio Pie Chart - Generate Percentages -


I am generating pie charts by dragging data from the SQL table. Data is a collection of hours for various projects.

The chart is fine, but I would like to display the pie graph related percentage of each piece of pie, which is being used when the graph is generated.

I am making charts in the manner shown below () . [[Series 1]]. Points. ADACI (project [i], progetime [ii]); } Chart 6 Series [0] ["Pylebell Style"] = "Disabled";

I was hoping that I can pass a simple order in the back code to make it, but handcrafted on the web provides usable results without any reason. But these are not the options in Visual Studio Express 2013.

Prepare this way:

  chain s = chart 6 . Series ["Series 1"]; S.ChartType = SeriesChartType.Pie; S.IsValueShownAsLabel = True; S ["PieLabelStyle"] = "Out";  

If you know the total, then make a datapoint like this:

  Datapoint page = new datapoint (project [i], progetime [i]) ; // Check your data type for calculation! P.Label = p.YValues ​​[0] + "H = \ n" + (100d * p.YValues ​​[0] / total). Ostring ("00.00") + "% \ n"; // my format  

enter image details here

If you do not know the total, set the first digit, then calculate the total and set the label at the end:

 For  (int i = 0; i & lt; = Index-1; I ++) {SPNADAC. (Project [i], Progetime [ii]); } // Total Count: Double Total = S. Points SUM (DP => DPY Values ​​[0]); // Now we can set the percentage foreach (Datapoint P in SP Points) {p.Label = p.YValues ​​[0] + "H = \ n" + (100d * p.YValues ​​[0] / Total). Stressing ("00.00") + "% \ n"; // my format} chart1.Titles.Add (SP number. + "Projects, Total" + Total .tostring ("###, ## 0") + "Hours"); Chart1.Titles [0] .Font = new System.Drawing.Font ("Arial", 14f);  

spring mvc - New implementation/method of existing request mapping in controller -


I am trying to find a way to extend an administrator, such as I can use existing request mapping But with a different implementation / method tied to it.

For example, suppose a piece of code under the AdminBasicEntityController in BLC where viewAddEntityForm Method / add request Linked to mapping Now I have to be my own logic to show the Unit Forum (Say Product Unit) using the / add request mapping. ? Is it possible to

  @Controller ( "blAdminBasicEntityController") @RequestMapping ( "/ {sectionKey .: +}") public class AdminBasicEntityController extends AdminAbstractController {@RequestMapping (value = "" method = RequestMethod.GET) public string scene Antitailist (Actiteepiarwlet request, Actiteepisrvet response feedback, model, Path Wheriabl map, string, string & gt; Pthwars, @RequestParam Maltivalumap & lt; string, string & gt; Anurodparm) exception {// Default action Implementation] // string entityType) throws Exception { "/ add" method = RequestMethod.GET) public String viewAddEntityForm (pathVars, @RequestParam (DefaultValue = "" HttpServletRequest request, HttpServletResponse response, models, @PathVariable Map & lt; String , string & gt) default implementation}}  

Also I AdminBasicEntityController , so I mean that I can control the specific unit. If so, How?

{@link #BroadleafAdminAbstractEntityController} default implementation It assigns to the Super each call and a custom-Silsijh does not provide functionality is responsible for providing the administrator of each unit which is not clearly customized by your administrator

@RequestMapping ( "/ {sectionKey :. +}") , the generic path variable < Code> sectionKey uses the controller to make any requests that are not clearly maped Is. For example,

  / product / product / add / category / category / add / store / store / add  

all can kill this controller If these URLs have not explicitly mapped their own controllers

To handle a specific URL yourself, you can.

  @Controller @RequestMapping ( "/ product") public class ProductAdminController {@RequestMapping ( "/ add") public String viewAddEntityForm (...) {...}}  

now, URL / Products / will be routed to the custom controller, while will continue to root for all other normal controller.


gps - R intersection of Shapefiles -


I have a shape file in the UK's road network. I have a long-connected GPS tracking device attached to a vehicle. I can change the GPS latitude-long in spectacles lines for every trip, however, there are some incorrect data points in the GPS tracking device. There are two consecutive couples in addition to each other continuously, when plotting late-night plot on the map, it is easy to see "wrong" points visually, is there a way to do programming in this manner Do the intersection of the local network make the road network shape file? To wit. Is there any function within any R package that will be able to assess that we know that the number should roughly follow the size of the road?

I know gInterserct , but I'm not just searching for a true or false ... result ... I am trying to work out which one of the points Points from the series are "wrong" ...


ruby on rails 4 - Remove avatar - carrierwave and devise -


The carrier service : remove_avatar check box is getting an incredible amount of work to me Develop Profile Change Form I am following CareerWave Documentation.

I placed the uploader on the user model. I have added : avatar and : remove_avatar in ApplicationController sanitizer

application_controller.rb

  def configured.permended_permatates devise_parameter_sanitizer.for (: account_update) do | U | U.permit (: first_name ,: last_name ,: email, password: password_confirmation, avatar, remove_avatar) end devise_parameter_sanitizer.for (: sign_up) do | U | U.permit (: first_name ,: last_name,: email, password: password_uponation) ending  

I've added to edit : remove_avatar

/devise/registrations/edit.html. ARB

  & lt;% = form_for (resource, as: source_name, url: registration_path (Resource_name), html: {method :: put, multipart: true}) Do F | | & Gt%; & Lt;% = f.label: Avatar% & gt; & Lt; Br / & gt; & Lt;% = image_tag (source.avatar_url (thumb))% & gt; & Lt;% = f.file_field: Avatar, Accept: 'Image / JPEG, Image / PNG'% & gt; & Lt; Label & gt; & Lt;% = f.check_box: remove_avatar% & gt; Remove avatar & lt; / Label & gt; & Lt;% = f.label: first_name% & gt; & Lt; Br / & gt; & Lt;% = f.text_field: first_name, autofocus: true% & gt; & Lt;% = f.label: last_name% & gt; & Lt; Br / & gt; & Lt;% = f.text_field: last_name% & gt; & Lt;% = f.label: email% & gt; & Lt; Br / & gt; & Lt;% = f.email_field: email% & gt; & Lt; Div & gt; & Lt;% = link_to 'Cancel', Resource% & gt; & Lt;% = f.submit "Update"% & gt; & Lt; / Div & gt; & Lt;% end% & gt;  

In addition to removing the avatars, there is no other problem with the carrier when I check the box and submit the form, the picture is not deleted.

I did a test, where I used instead of the registration controller for the user's controller and instead of form @user resource And I was able to work it, I want to stay on the Convention and use the Registration Controller. What am I doing or what's wrong?

  @ user Revove_River! @ User.remove_avatar = true @ user.save @ user.reload  

Try it out, you can help.


ios - Find X position of where user is dragging their finger in ScrollView -


I have a scrollview and I am looking at user input. I would like to know that his finger is currently on the X Plane. Is it possible through ScrollView and / or its representative or do I override the touch , etc.?

I assume that you set up your scroll view representative if you have done so You only need to implement scrollViewDidScroll: with the protocol ...

  - (zero) scrollViewDidScroll: (UIScrollView *) scrollView {CGPoint TouchPoint = [scrollView. PanGestureRecognizer Location InView: scrollView]; NSLog (@ "Touch Point: (% F,% F)", TouchPoint.X, Touch Point.i); }  

While the user is scrolling, this will be an update.

Additional information: Note that if you have something like UIPageControl , then it's navigating between your scroll view, The situation can be calculated based on the number of pages (i.e. if each page is 100 pixels wide, page 0 will start from 0 point, one point on page 100 etc.).


ruby - Parsing strings that may have different values each time -


मेरे पास निम्न स्ट्रिंग है:

  "--- \ n-: @error : 'अमान्य फोन नंबर प्रारूप:' '' कृपया जांचें कि फोन नंबर के लिए आपका प्रारूप सही है। '\ N-: @error:' अमान्य आईडी भेजा गया था: '\ n-: @error:' अमान्य तिथि प्रारूप: '\ n " 

मैं केवल त्रुटि संदेशों को वापस करने का प्रयास कर रहा हूं। तो ऐसा होगा

  • "अमान्य फ़ोन नंबर प्रारूप:"
  • "कृपया जांचें कि फ़ोन नंबर के लिए आपका प्रारूप सही है। "
  • " अमान्य आईडी भेजा गया था: "
  • " अमान्य दिनांक स्वरूप: "

कुछ संदेश जो लौटा दिए जाएंगे, ऊपर दिए गए शब्दों से अलग होंगे, इसलिए मुझे नहीं लगता कि regex मिलान का उपयोग करना सबसे अच्छा तरीका होगा। कोई भी विचार मैं इस स्ट्रिंग से केवल त्रुटि संदेशों को कैसे निकाल सकता हूं?

यह प्रयास करें, यह सही नहीं है, लेकिन चाल करें।

  s = "--- \ n-: @error: 'अमान्य फोन नंबर प्रारूप:' '' 'कृपया जांचें कि फोन नंबर के लिए आपका प्रारूप है सही है। '\ N-: @error:' अमान्य आईडी भेजा गया था: '\ n-: @error:' अमान्य दिनांक प्रारूप: '\ n "# स्कैन को उद्धरण चिह्नों के बीच तार मिलेगा जो स्वयं उद्धरण नहीं हैं # सरणियों की सरणी # चपटे से इसे एक एकल सरणी # gsub बना दिया जाएगा, फिर पट्टी परिणाम को सामान्यीकृत करेगी। Msgs = s.scan (/ '([^'] +) '/)। Map {| (msg) | Msg.gsub (/ (\। | \ S +) /, '') .strip} # ["अमान्य फ़ोन नंबर प्रारूप:", "कृपया जांचें कि फ़ोन नंबर के लिए आपका प्रारूप सही है", # "अमान्य आईडी भेजा गया था : ", #" अमान्य तिथि प्रारूप: "]  

bash - Replace all hyphens at the end of line by '?' -


मेरे पास फ़ाइल है:

  ------ एफजीजेएफजी ---- हल्कज ---- एलकेएचजे ------- --- जेकेएलजेएलके ----- यूआईओयूपीओपीआईपीआईपीआईपीपी --- जीजीजेकेएचकेएलजेके ---------- जेकेएलएचकेएल जेएलकेजेएलकेजेएलकेजे   <पी> और मुझे यह चाहिए:  
  ?????? FGJFG ---- हल्कज ---- एलकेएचजे ??????? ??? JKLJLK ----- UIOUOPPOIPIPIPOPIP ??? जीजीजेकेएचकेएलजेके ---------- जेकेएलएचकेएलजेएलकेजेएलकेजेएलकेजे   

यानी, मैं सभी प्रमुखों को बदलना चाहता हूं और ' - ' उसी नंबर की ' कोड>? ', लेकिन' - 'अक्षरों के बीच नहीं

मुझे पता है कि यह कैसे करने के लिए अग्रणी है:

  Sed -i ': a; s / ^ \ (- * \) - / \ 1? /; Ta' फ़ाइल  

लेकिन मैं ' को बदलने के लिए कमांड को कैसे संशोधित कर सकता हूं? - 'लाइनों के अंत में?

आप perl :

  perl -pe 's / \ g- | - (? = - * $) /? / G'  

आउटपुट:

  बिल्ली फ़ाइल ?????? FGJFG ---- हल्कज ---- एलकेएचजे ??? ??? JKLJLK ----- UIOUOPPOIPIPIPOPIP ??? जीजीजेकेएचकेएलजेके ---------- जेकेएलएचकेएलजेएलकेजेएलकेजेएलकेजे  

kramdown - Cant figure out why I am getting this Kramdownn warning -


First, I had this text processed by the Cromons without any problems:

 < Code> * * * [GIT] ** Set up a GIT repo for your team  

Recently I am getting this error:

  Cramdoon Warning: There is no link definition for link id 'GIT' has been found on line 4. I can not see in the Cromon Amendment history that it is now an illegal input and before I get hundreds of files and modify it I am surprised that anyone can shed light on it, and also that I am the easiest How can I modify the line from What do I want to see in the text "[GIT]" bold on a bulleted line?   

This is not an invalid input Kramdown will correctly parse which is expected (version 1.6.0 Accordingly):

  & lt; Ul & gt; & Lt; Li & gt; & Lt; Strong> [GIT] & lt; / Strong> Set up a GIT repo for your team & lt; / Li & gt; & Lt; / Ul & gt;  

I'm not sure why the alerts were suppressed earlier, but I checked through the Ruby Code and the warning was present in the available version as soon as possible. I also checked at 1.3.3 and this also generates a warning.

Although the credroads generate the desired output, if you want to avoid the warning, you can avoid the bracket.

  * ** \ [GIT] ** Set a GIT Repo for your team  

javascript - Dynamically added ng-form and validation -


मेरे पास ng-form युक्त टेम्पलेट के साथ एक निर्देश है:

  & lt; ng-form नाम = "autocompleteForm" & gt; & Lt; div class = "form-group" show-errors & gt; & Lt; input type = "text" class = "form-control" ng- मॉडल = "ctrl.val.value" नाम = "आटोक्लोप्लेटेफ़िल्ड" आवश्यक & gt; & Lt; div वर्ग = "संदेश" एनजी-संदेश = "स्वत: पूर्णतया फ़ार्म। ऑटोकोम्पलेटेफ़िल्ड। $ त्रुटि" & gt; & Lt; span class = "help-block" ng-message = "आवश्यक" & gt; कृपया, मान चुनें & lt; / span & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; / एनजी फार्म & gt;  

और मैं इस रूप को गतिशील रूप से एनजी-दोहराने से जोड़ता हूं। सब कुछ - स्वयं फार्म, सत्यापन - काम करता है, लेकिन एक परेशानी बात है: फ़ॉर्म के बाद जोड़ा गया यह $ अमान्य है और त्रुटि संदेश दिखाया गया है। यह निश्चित नहीं है कि ऐसा क्यों हो रहा है और यह कैसे ठीक करें। फ़ॉर्म के बाद फार्म का ऑब्जेक्ट है:

  {"$ error": {"required": [{"$ validators": {}, "$ asyncValidators": {}, "$ पार्सर्स ": []," $ स्वरूपण ": [नल]," $ दृश्य परिवर्तन लिस्टेनर्स ": []," $ अछूता ": सही," $ छुआ ": गलत," $ प्राचीन ": सच है," $ गंदे ": गलत , "$ मान्य": गलत, "$ अमान्य": सच है, "$ त्रुटि": {"आवश्यक": सत्य}, "$ name": "स्वत: पूर्णतयाफ़िल्ड", "$ विकल्प": null}]}, "$ name "" $ $ ": गलत," $ गंदा ": गलत," $ pristine ": सच है," $ मान्य ": गलत," $ अमान्य ": सच है," $ सबमिट किया गया ": गलत," स्वत: पूर्णतयाफ़िल्ड ": {" $ validators " : {}, "$ AsyncValidators": {}, "$ पार्सर्स": [], "$ फ़ॉर्मेटर्स": [ गलत, "$ गंदा": गलत, "$ मान्य": गलत, "$ अमान्य", "$ viewChangeListeners": [], "$ अछूता" : "$ Error"} {/ code>  

गतिशील रूप से लिखने वाले कुछ ब्लॉग मिलते हैं: सही, "$ error": {"required": true}, "$ name": "autocompletefield", "$ options": null}} जोड़े गए रूप () और उनके समान व्यवहार भी हैं। क्या यह डिफ़ॉल्ट कोण का रास्ता है? या "प्रारंभिक सत्यापन" को रोकने के कुछ विकल्प हैं?

आप एनजी-अगर निर्देश पर आपका संदेश कंटेनर केवल इसे दिखाने के लिए यदि फ़ॉर्म को इस तरह से सबमिट किया गया है:

  & lt; div class = "messages" ng-messages = "autocompleteForm.autocompleteField। $ Error" ng- if = "autocompleteForm $ प्रस्तुत की।" & gt; & Lt; span class = "help-block" ng-message = "आवश्यक" & gt; कृपया, मान चुनें & lt; / span & gt; & Lt; / div & gt;  

python - Calculate all possible columnwise differences in a matrix -


I want to calculate all possible pairing differences (without repetition) between the columns of the matrix. What is an efficient / python way to do this?

  mat = np.random.normal (size = (10, 3) mat array ([[1.5,7 9, 21,282, 0.7,67,43,473 , -0.46 9, 47, 43], [0.542426004, -0.463, 41,769, -0.4,65,72, 9 75], [0.24196227, -1.91328024, -1.72491783], [-0.56228753, -1.01283112, 0.31424733], [-0.90802408, -1.4123037, 1.46564877], [-0.2257763, 0.0675282, -1.42474819], [-0.54438272, 0.11092259, -1.150 99358], [0.37569802 , -0.6,00,63,86,9, -0.2, 9, 1,6, 375], [-0.6,01,70,661, 1.8,52,27,818, -0.0 , 13, 9, 722], [-1.0,57,71,0 9 3, 0.82254, 91, -1.2,2084,365]])  

Differences in the 3 pairs in this matrix (see if the selection of unique combinations of N Switch to, where the order does not matter).

  pair_a = mat [,, 0] - mat [:, 1] pair_b = mat [:, 0] - mat [:, 2] jodi_c = mat [:, 1] - mat [,, 2]  

There is a (ugly) way. You can easily visualize the large matrix using nested for loops, but I hope that is a good way.

The result should be another matrix, in which scipy.misc.comb (mat.shape [1], 2) column and mat.shape [0] Rows

Combinations of 2 lengths can be found using the following combination:

  n = mat [1] me, j = np.triu_indices (n, 1) result = mat [:, i] - mat [:, j]  
< / Div>

javascript - Month view - full hours are only displayed 9 instead of 09:00 -


I can not understand how to change the following problem: When I have a program starting from 09:00 It is then shown properly in the agenda and the agendary but on the month's view it is shown as only 9.

You want the option.

  Timeform: 'hh: mm a'  

It will change to 12 hour clock (09:00 AM).

  Timeform: 'HH: mm'  

for a 24 hour clock.

Full Calendars uses Pulses for its dates. There are formatting rules.


Query in Sql Server Update -


मेरे पास दो टेबल हैं।

टेबल ए :

  नाम empid शहर ----------------------------------- Joesph मॉर्गन जेएम 2345 न्यू यॉर्क < / कोड>  

टेबल बी :

  नाम -------------- मॉर्गन, यूसुफ   

अब मैं B में एक कॉलम जोड़ना चाहता हूं जिसमें empid शामिल होगा।

मैं तालिका नाम के आधार पर तालिका में शामिल हो सकता था लेकिन स्वरूप में अंतर मेरे लिए मुश्किल बना रहा है।

मैं पहली बार तालिका नाम को प्रथमनाम के रूप में नाम बदलना था और बी में नए बनाए गए स्तंभ empid में डेटा प्राप्त करना।

< P> लेकिन मैं डेटा के प्रारूप को बदलना नहीं चाहता।

मैंने निम्न चरणों का पालन किया है।

  ऑप्शन टेबल बी Empid varchar जोड़ें (10) अपडेट टेबल बी सेट नाम = CONCAT (रिक्त स्थान (SUBSTRING ([name], CHARINDEX (',', [name]), लैन ([name]), ',', ''), '', left ([name] CHARINDEX (',', [name]) - 1) तालिका B सेट empid = A को अपडेट करें। Empid जहां B.name = A.name  

कृपया मुझे एक ऐसा तरीका सुझाएं जहां नाम का स्तंभ उस रूप में रहेगा।

इसे प्रयास करें ..

  तालिका ए (नाम varchar (50), empid varchar (50), शहर varchar (50)) बनाएँ ('मॉर्गन, जोसफ़') में एक मूल्य ('जोसफ मॉर्गन', 'जेएम 2345', 'न्यू यॉर्क') को सम्मिलित करें (तालिका) बी (एम्पीड varchar (50), नाम varchar (50)) डालें / कोड>  

अपडेट की गई क्वेरी ..

  अद्यतन बी सेट बी। बीपीड = a.empid B से, ए जहां A.name = (सबस्ट्रिंग (b.name, चारिंडेक्स (',', बी.नाम) + 1, लेन (बी.एन.एन.)) + '' + सबस्ट्रिंग (बी.नाम, 1, चारिंडेक्स (',', बी.नाम) -1))  

c - line splitter from stdout to stdin -


I'm new to C programming, and I was asked to create a simple line filter, (In Stdin), and print it again in stdout (without saving the whole sentence) and except for one line ("\ n") if "@" or "*" is typed (also I want every sentence to begin with its line number) I completed the program and it is a small It works very well except for something: I lose the first letter for every input I was required as the rest.

Can anyone tell me what is wrong?

  #include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; #include & lt; String.h & gt; Int main (int argc, char ** argv) {char cinput; Int i = 1; Int moreData = 1; Printf ("line_splitator, please enter a sentence: \ n"); Fflush (stdout); Cinput = fgetc (stdin); Printf ("% c:", i); I = I + 1; / * Error * / When the file does not end to avoid, while (! Feof (stdin) & more data) {cinput = fgetc (stdin); Fputc (cinput, stdout); Switch (cinput) {case '@': case '*': printf ("\ n"); Printf ("% d:", i); I = I + 1; break; Case '\ n': more data = 0; Default: Break; }} Printf ("\ ndone! \ N"); Return 0; }  

Edit: Thank you, I created it :)

After using fflush immediately, you read a character. The character is never printed / processed

  and then update the loop of its time, while extracting (cinput = fgetc (stdin))! = EOF & amp; More data   

Ensure that you want to repeat cinput as int which is the correct redirect type fgetc.


timer - c++ implementing clock to measure execution time -


I wrote a program in C ++ and trying to take the time to fully execute

  int main (int argc, char ** argv) {clock_t tStart = clock (); // Your program is doing the work here printf ("taken time:% .2fs \ n", (double) (clock () - tStart) / CLOCKS_PER_SEC; Return 0; }  

My problem is that it will always print 0.00s for execution time. Could this be due to using multiple pathabes in my program (my program uses pthread_join to ensure that all the threads have been executed, so I do not think this should be a problem) ?

Edit: // do the program's work = ...

 for  (i = 0; i <4; i ++) {err = Pthread_create (and threads [i], NULL, print, NULL); Pthread_join (thread [i], NULL); } Zero * Print (Zero * Data) {printf ("Hello world"); << code>   

  printf ("taken:% .2fs \ n" , (Double) (clock () - teestrate) / CLOCKS_PER_SEC);  

All your three arithmetic operand are integers, so you divide the integer and get the 0 .

LHS or RHS symbolizes the / symbol for a floating-point type and run your code more often! Your Benchmark is useless if it only measures a single run (which you have not got 0 , 1 ) or 300 or something else Since it is very clear).


Specifying multiple (active model) serializers in a larger, grouped JSON response in Rails? -


Text after "div class =" itemprop = "text">

I have a bigger size JSON response in a controller method:

  json render: {User: {id: @ current_user.id, name: @ current_user.full_name, title: @ current_user.title, phone_work: @ current_user.phone_work, phone_mobile: @ current_user.phone_mobile, address: @ current_user.addresses}, appointments: @ Current_user .appointments} I tried to do  AppointmentSerializer.new (@ current_user.appointments)  and I found this error:  Undefined method 'read_attribute_for_serialization' . The error is coming from the first line, where json has been rendered. ( render json: ) 

I can specify different serializers for the user's address, and for the placements?

"itemprop =" text ">

There is an important issue to answer your question, which version of AIIMS are using?

As a contributor to AMS, I firmly advise you to keep it and see, we are actively working on new version 0.10.0 (which can be 1.0) , It is believed to release next month so keep in mind that you can update it soon and avoid some old issues.

Regarding your question, I think you have forgotten to include the serialization module in your model. Just add it and you can be fine.

ActiveModel :: Ordering Include

You can see the year 0.9 version in the context of this


firefox - How to move the contents(bookmarks, seperator, group) of Group to another Group -


For reference:

How to take the contents of another group (bookmarks, separators, groups)

UNSORTED -> Group 1 -> {bookmark1, separator1, bookmark2, groupIn1 -> {bookmarkIn1}, bookmark3}

To do this:

Toolbar -> Group 2 -> here

  let {search, bookmark, group, save, remove, menu, Toolbar, UNSORTED} = ("SDK / Locations / Bookmarks") is required; Search ({Group: UNSORTED}). On ('data', function (g) {console.log (g);});  

g gives each element separately, instead of an array. What to do to create an array first?


How to store user data in window phone 8 app? -


Please help me to store user data in Windows Phone 8 application? I have a plan to develop an application on Windows Phone 8, allowing the user to create an XML file to store his personal data. Question Window 8.1 is a way to store user data on the phone. After the search solution, I know that + can store separate storage data, but only small data for this app + Store data on the SD card is read-only. So, is there any other way to store data? Thanks and sorry about my English skills!

ApplicationData (LocalFolder on WP8 or LocalFolder and roaming folder on WP8.1) To be designed for Application settings are better for small pieces of data, but apps can save files of any size, which has a location in the LocalFolder for the phone.

Look for details on MSDN while Docs targets are available for the Silverlight app on Windows Runtime App, Application Data and Storage File API, Windows Phone 8 and above.

Additional uses:

  using System.Xml serialization; Use of windows Storage; Using System.IO;  

Code:

  Storagefolder localfolder = ApplicationData.Current.LocalFolder; Select StorageFile saveFile = Local Folder. KreffilesSync ("data.xml", CreationColisionOption.ReplaceExisting); (Var ras = save save.file.OpenAsync (using FileAccessMode.ReadWrite)) {Stream stream = ras.GetOutputStreamAt (0) .AsStreamForWrite (); XmlSerializer serializer = New XmlSerializer (type (list & lt; book & gt;)); Serializer.Serialize (stream, data); }  

If you need more structured data from XML then you can store the SQLite database in the local folder. If you need more space than the app needs to store on the device, you have to take it to the web service. A good place to do this is that you can call this service from a Windows Phone Silverlight app, but the wizard will generate universal apps.


scala - spray-testkit with with scalatest, status doesn't wrok -


I have a post spray-am route to try to test with Skelatst requiring mandatory parameter adId for . And it can not work my code

  import akka.actor._ import akka.event.LoggingReceive import akka.testkit {} TestProbe Import com.ss.rg.service.ad.AdImporterServiceActor {GetImportStatus, StatusOfImport is as} Import org.scalatest. {MustMatchers, WordSpecLike} Import Spray. Http. {StatusPodes, MediaTypes} Import spray.testkit.ScalatestRouteTest class with AdServiceApiTest ScalatestRouteTest to import Extended {"AdService REST API" with WordSpecLikeMasterMatchers {{"POST POST with mandatory mandatory parameters"} {Val P = TestProbe () Val addressServiceMock = System.actorOf (Props (classOf [AdServiceActorMock], p.ref)) Post ("/ service / advertising / import") ~> should fail; New AdServiceApi (addressServiceMock) .route ~ & gt; Testing should be in the (wrong) position (StatusCodes.BadRequest)}}  

The test fails but for a different reason

  request was rejected list (MissingQueryParamRejection (adid)) org.scalatest.exceptions.TestFailedException: (MissingQueryParamRejection (adid)) was rejected with (ScalatestInterface request list spray.testkit.ScalatestInterface $ class.failTest. scala: 25) com.ss.rg.api.ad.AdServiceApiTest.failTest (on AdServiceApiTest.scala: spray.testkit.RouteResultComponent $ RouteResult 19 to $$ anonfun $) reaction $ 1 $$ anonfun $ $ 1.Apply (RouteResultComponent Applicable .scala: spring Of 236): scala.Option.foreach (95) on Option.scala: 97) react spray.testkit.RouteResultComponent $ RouteResult $$ anonfun $ apply $ 1 $$ anonfun $ $ 1.Apply (RouteResultComponent.scala. Testkit.RouteResultComponent $ RouteResult $$ $ $ Apan reaction $ 1.apply (RouteResultComponent.scala: 94) ...  

it seems that the situation is even went not examine other thing that I'm not completely clean, how does he actually set an ad parameter in the spray-testkit? One way would be to set the header, but I would not be surprised that the better way would be present.

Can the spray-turskit experience someone else with the comment?

Thx

No status - route request > Disclaimer and claim that this is the type you want for you if you want to see what the browser really sees, then you use the default RejectHandler You should wrap the route in a handleRejections instruction (it is available sloppy) and then you enable Will be in a position to see the expected status code handled but true will come out as (as it will handle wrapped Route request - failed Stetsod and an error message With back a response).


php - Recursive subpattern regex -


I want to read the name of the server from a nginx config file.
Then I need to rotate a line again:
server_name this.com www.this.com someother-example.com;

I am using PHP's preg_match_all and I've tried different things so far:
/ ^ (?: Server_name [\ s] *) (?: (.: * (?: \ S *)) * $ / m : which gives me nothing / ^ (?: Server_name [\ s] *) ((?: (? :. *) (?: \ S *)) *); $ / M gives me this www www. This.com someother-example.com

but I can not find the right to list the domain as a different value

  [0 = & gt; 'This.com', 1 = & gt; 'Www.this.com', 2 = & gt; Perhaps, one of you know?  

Thank you!

As your uncle of Bob wrote: "post-text" itemprop = "text">

:

(?: Server_name | \ G (?! ^)) \ S * \ K [^; | \ S] +

What a move!


nginx - URL with strange UTF8 symbol -


nginx पर, मेरे पास एक फाइल / यूआरएल है जिसमें जर्मन शब्द " frühling " है।

जब मैक + सफारी से यूआरएल एक्सेस किया जाता है तो एक समस्या है।

मैंने दो यूआरएल की कॉपी / चिपकाई - सही एक और मैक से एक और यहां परिणाम हैं:

<पूर्व> [एनएमएमएम @ ज़ेनबुक ~] $ बिल्ली & gt; एक फ्रेहलिंग ^ सी [एनएमएमएम @ ज़ेनबुक ~] $ बिल्ली & gt; बी फ्रेहलिंग ^ सी [एनएमएमएम @ ज़ेनबुक ~] $ xxd एक 0000000: 66 72 75 सीसी 88 68 6 सी 69 6 ई 67 0 ए फ्रू..हलिंग। [एनएमएमएम @ ज़ेनबुक ~] $ xxd बी 0000000: 66 72 सी 3 बीसी 68 6 सी 69 6 ई 67 0 ए एफ..हलिंग।

"a" सही है, "बी" गलत है लगता है कि अंतर umlaut " ü " के बाद ही है, वहां अतिरिक्त सामान्य " u " है इसके अलावा umlaut " ü " किसी तरह अलग है।

यह प्रतीक कहाँ से आया है? मेरे क्लाइंट कभी-कभी चीजों को तैयार करने के लिए MsWord या LibreOffice का उपयोग करता है क्या कोई रास्ता nginx को किसी भी तरह से संभाल (पुनर्निर्माण) कर सकता है?

Google खोज के बाद मैंने पाया:

लगता है कि यू umlaut करने के दो तरीके हैं:

सही utf8 एन्कोडिंग है (आपको हेडडम्प में c3 bc देखेंगे):

<पूर्व> यू + 00 एफसी ü सी 3 बीसी डाइए के साथ लैटिन छोटे अक्षर यू।

एक मान्य UTF-8 वर्ण अनुक्रम जो समान रूप से दिखाता है, लेकिन "ü" (फिर से, हेक्साडम्प में 75 सीसी 88) नहीं है:

  यू + 0075 यू 75 लैटिन छोटे अक्षर U यू + 0308 ̈ सीसी 88 कॉम्बिनेशन डायरेसिस  

अपडेट करें:

खोज का उपयोग कर आप सभी फ़ाइलों को सही या गलत umlauts के साथ पा सकते हैं, "सामान्य" तरीके से काम करता है:

  ढूंढें -नाम '* ü *'  

हालांकि आपको सही umlaut "मार्ग" को कॉपी / पेस्ट करना होगा या एक बैश फ़ाइल बनाना होगा।

संभव समाधान I

(अब भी यह कैसे एनजीएन स्तर से तय किया जा सकता है यह देख रहा है)


angularjs - When to use spy vs $httpBackend in jasmine -


I have to test the Jasmine code specific / argument I'm writing for I want to test that my 'Foo' object has been triggered, so call foo.getList () method GET / foo Do and return results

I can check it in two ways: I could add foo.getList () to .spy Alternatively, I can use the $ HttpBackend.whenGET ("/ foo") and set my desired result there.

Is one supposed to be?

I think the HTTPBackend would be a better option, because it tests 'subsequent' in the logic flow. If I have used a detective , then I can not prove, for example, that I was not purely disturbed and was trying to solve a different URL.

However, I am looking at the inherited tests and they all use detective , and since I believe this code is better written by me (They can not be more novice then I bronze) I wonder if there is an advantage for using detective on $ httpBackend .

As you are testing foo.getList () , < Code> httpBackend . Once you test the function which only use foo.getList () , use a detective. This is the simplest solution to avoid duplication of exams.

Note that you are writing unit tests, each unit should be independent on other units.


javascript - How to click a link that will execute but not redirect. -


I have some products that are in my SQL database whose links with $ producturl be retrieved in my script These URLs are actually adding products to the cart (). I am trying to create a script that will allow the user to add products to the car but will not redirect them, just execute the link so that the user can remain on the same page.

I am using preventDefault and stopPropgation but it is not working, it seems alert, but when I look at my cart, then it is not executing the link after which the product is not . Any help?

  & lt ;? Php $ producturl = ProductURL :: find (array ('product' = & gt; $ tube1- & gt; tube1)); If ($ product calls [0] - & gt; url! = Null) {echo '& lt; Span id = "shop" & gt; Add Cart NoRedirect & lt; / Span & gt; '; }? & Gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .on ('click', '#shop', function (event) {$ .post ('& lt ;? php echo $ producturl [0] - & gt; URL;; & gt;'); Event.preventDefault (); Event.stopPropagation (); Warning ('Product added to cart);}); & Lt; / Script & gt;  

Your HTML anchor link:

  & lt ; A href = "http://www.google.com" & gt; Link & lt; / A & gt;  

Do not forget to put jQuery inside it (inside a dummy function):

  // Act on an element $ click ("A") . ('Click', function (e) {// stop default action, in this case a link e.preventDefault (); // catching an attribute of the href attribute var url = $ (this) .attr ('href' ); // Get a request to use AJAX for ARF value $ $ .get (href, function () {// success});  

This indicates all the principles required to implement your function.

The page provided in the question and the URL posted on the same subdomain, or cross-open REAS resource must be enabled on the server otherwise the request will fail due to cross domain restrictions.


SharePoint Search + BCS and meaningless non-human-readable urls -


External content type is easy to index. Although I find it very difficult to find specific "crawl stot" of a particular item.

Seeing "URL View" inside SharePoint CA, it shows me all my crawl / indexed items Unfortunately the URL portion is not near anywhere readable. So I do not have a clue where to look for my specific items in the question.

Example:

bdc3: // adventureworksdbtest / default / 00000000% 2D0000% 2D0000% 2D0000% 2D000000000000 / 418 / adventureworksDB / 420? S_ID = i0QMAAA == & amp; S_ce = 0408808680g000g10204000g0o20003s

Guid.Empty?
418? 420?
Some encoded ids?
(This base is not 64 i0QMAAA == nothing).

There is a product ID (int) and a name (string) in the product table of the AdWords Works. In my BDC model I have mapped the "Title" column to my product unit in the "Name" column of the product. See below ...

& lt; Unit name = "product" namespace = "rs.exp.exendingconnector.boltin dbc connector" version = "1.0.0.1" & gt; & Lt; Properties & gt; & Lt; Property Name = "Original Name" type = "System.String" & gt; [Production]. [Product] & lt; / Property & gt; & Lt; Property Name = "EntitySetName" type = "System.String" & gt; [Production]. [Product] & lt; / Property & gt; & Lt; Property name = "title" type = "system.string" & gt; Name & lt; / Property & gt; & Lt; / Properties & gt; & Lt; Identifier & gt; & Lt; Identifier name = "product id" type name = "System.Int32" /> & Lt; / Identifier & gt; & Lt ;! - [...] - & gt; & Lt; / Entity & gt;

This is working, however there is no effect on its "index URL" any sign? Do I have to live with something? How do you debug this ?

Update: Displaysfield looks like a good thing. Although what I've found so far is not what I see. I'm not seeing a way to provide a URL to myself (where will I link anyway?!) - I just want to make the "generated URL" more meaningful.

method (example) property: class = "post-text" itemprop = "text">

And how does it work wondering if it answers your question. " DisplayUriField " is actually providing the desired functionality As a value you can set the name of a typewriter that is part of your unit schema. For example, if you have one type type descriptor below (make sure your selection statement gives a column in question). ..

  & lt; TypeDiscriptor name = "URL" typename = "system.string" & gt; & Lt; Properties & gt; & Lt; Property Name = "ShowInPicker" type = "System.Boolean" & gt; False & lt; / Property & gt; & Lt; / Properties & gt; & Lt; / TypeDescriptor & gt;  

... You can use this as the value of your DisplayUriField property:

  & lt; MethodInstances & gt; & Lt; Legal name = "getAllProducts" type = "finder" returns ParameterName = "GetAllProducts_Returned" default = "true" DefaultDisplayName = "get all products" & gt; & Lt; Properties & gt; & Lt; Property Name = "rootfender" type = "system.string" & gt; X & lt; / Property & gt; & Lt; Property Name = "Listsdifed Timestamp Field" Type = "System.String" & gt; Modified date & lt; / Property & gt; & Lt; Property Name = "DisplayUriField" Type = "System.String" & gt; Url & lt; / Property & gt; & Lt; / Properties & gt; & Lt; / MethodInstance & gt; & Lt; / MethodInstances & gt;  

My database table contains URLs like url

  • < [...]

Whatever your columns will be shown in the SharePoints crawl log ("URL View"). If your column ("URL") is tap and there is no value in it, then BDC will use a default name for that specific item.

Of course, after all custom URLs, it is very useless though it allows me to determine if a specific item has been crawled (successfully) or not because I can add the shown URL to ProductID - which I can not do with those BDC 3: // URLs


powershell - Sublime Text build system generates [WinError 6] The handle is invalid error -


I am trying to create a build system for render and am using escidoco-formatted documents.

AsciiDoc ["ASCIdactor", "$ file"], "selector": "source.asciidoc"}

  {"Cmd" P> When I execute build  Ctrl  +  B , I get an error:  
  [WinError 6 ] Handle is invalid [CMD: ['Asciidoctor', 'C: \\ User \\ XXXX \\ Desktop \ Hello \ hello.'] [DIR: C: \ Users \ x XXXX \ Desktop \ Hello] [Path: C: \ Tools \ Ruby193 \ bin \ asciidoctor] [End]  

I have successfully installed Windows Command Processor, PowerShef, and Ruby Prong Through am able to present the document.

This script script leads to the same error:

  {"cmd": ["asciidoctor", "$ file"], "path": " C: \\ tools \\ ruby193 \  \ "asciidoctor", "shell": true, "selector": "source.asciidoc"}  

what am I missing

found a solution:.

Last reply:

Showka by Sun Oct 02, 2011 at 7:34 pm Thank you very much, you get rid of this problem by launching Sublime Text out of a command prompt.

Signal to run I tried to set the PYTHONPATH , but it will not fix it. In my command prompt there is a lot of environmental variables, I'm sure this is going to increase further. I will create a second batch file to launch the launch with just some other programs added in the path.

...

UPDATE: I found the issue And now it can run from my command prompt.

Here's how my batch file looks:

Code: Select All SET PYTHONPATH = START "Sublime Text 2" / B "C: \ Program Files \ Sublime Text 2 \ sublime_text.exe "% *

The / b option was messing it up for some reason, usually by waiting for the program I started to exit command There is a need to keep the prompts, but for some reason, it worked by unnecessarily reducing the option to Sublime.


sql server - Insert numbers in table in sequence but without IDENTITY set -


I have a few tables, in one of them I am loading with the Excel file and then I put in the selection from the target I have the column id in the table, which does not have IDENTITY and I can not create it, so I select ROW_NUMBER () for my selection. I used the INSERT , but now I am having problems, the next time I am loading the file into my temporary table from which I INSERT Selection data for is started from 1 and if IAM is trying to get involved then I am getting error problems with primary key / hence the ID needs to be added on ID basis, which is already targeted For example, if the previous record in the target table is in the record ID before the new record 1001

  Enter in Table 1 (ID, OKIID, OPPID, Okide ED,) SELECT - RO (Table Choose from 1 MAX (ID) AS 'table Last ID', ROW_NUMBER (by) over (order (SELECT 0)), - ID - Int A. [ID] AS OKaid, - Int c. [ID] AS Okaid, - Int D. [ID] AS OAKID, - Int Ephram [DBO]. # Table B LEFT Outer Table 2 AO BF 6 = A. [National Symbolbo] Add bonus to left over table 3c F 4 = C. Include coded left outer contact in Table4D on b.F5 = D. Coded left over 1 table on 1F on BF1 = F. Code where FCode is faucet  

Anyone Consider how to continue to insert ID in order? I can not use identity on this table. I hope you can understand my explanation

  Enter in Table 1 (id, OKEID, OPDID, OKAIDID) - Select from table 1, MAX (ID) AS 'Last ID in table', a.last_id + ROW_NUMBER () over (line by SELECT 0)), - id - int one. [ID] AS Okeid, - OKEID - At C. [ID] AS O.P.D.D., - OBCDID - IT D. [ID] AS OKDID - OKWID ID - Int FDR [DBO]. # Table B LEFT OTier Table 2 AOBFF 6 = A. [NationalSombol] Left Open Connect Table 3C On BF4 = C Codes Connect Over Left Connect Table 4D On BF 5 = D. Coded Left Outer B1F on BF1 = F. Cold Cross Join (id) as the frame table from last_i D 1) A WHERE f.code is faucet  

and some Test:

Create Table # A (An Integrated Key, AAA) Create Table # B (BIT) in # values ​​(1,1); INSERT #b values ​​(1); Insert #b values ​​(2); Insert in #b values ​​(3); #b Include values ​​(4); INSERT #b values ​​(5); INSERT #A SELECT last_id + ROW_NUMBER () over (ORDER BY bb), #bb cross join from BB (SELECT MAX (a) last_id FROM #a) a

LESS: generate @variables with loops -


I know that using very little CSS classes is possible. I personally used this technique to give another answer.

I am now experiencing the following code:

  @ transparent-black-10: Fade (@Enrow, 0.1); @ Transparent-black-20: fade (@indo, 0.2); @ Transparent-black-30: fade (@ ano, 0.3); @ Transparent-Black-40: Fade (@ Indoor, 0.4); @ Transparent-black-50: fade (@ ano, 0.5); @ Transparent-Black-60: Fade (@ Indoor, 0.6); @ Transparent-Black-70: Fade (@Enro, 0.7); @ Transparent-black-80: fade (@indo, 0.8); @ Transparent-Black-90: Fade (@ Indoor, 0.9); @ Transparent-white-10: fade (@ CBOO, 0.1); @ Transparent-white-20: Fade (@Benko, 0.2); @ Transparent-white-30: fade (@benkoo, 0.3); @ Transparent-white-40: feed (@beccoo, 0.4); @ Transparent-white-50: fade (@ EnglishOn, 0.5); @ Transparent-white-60: fade (@becco, 0.6); @ Transparent-white-70: Fade (@Benko, 0.7); @ Transparent-White-80: Fade (@Benzico, 0.8); @ Transparent-white -990: Fade (@Benjico, 0.9);  

I am thinking that using loop, it is possible to generate lesser variables as above or reject it by language. If possible, do you have some suggestions to generate code more efficiently?


java - J2ee The requested resource is unavailable -


Hello I know this question has been asked before but unfortuanetly I did not think the answer seems to be in the middle Propose a suitable for me! // W3C // DTD HTML 4.01 transitional // - DOCTYPE html public ", Meter still looking forward to J2ee ur help" with this new code. Login.jsp


  & Ltn "" http://www.w3.org/TR/html4/loose.dtd"> & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Title & gt; Login page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form action = "" method = "post" / & gt; & Lt; Br> UserId: & lt; Input type = "text" name = "user id" /> & Lt; Br> Password & lt; Input type = "password" name = "password" /> & Lt; Br> & Lt; Input type = "submit" / & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Log InServlet. Java

  package org.islem.login; Import java.io.IOException; Import javax.servlet.ServletException; Import javax.servlet.annotation.WebServlet; Import javax.servlet.http.httpServlet; Import javax.servlet.http.HttpServletRequest; Import javax.servlet.http.HttpServletResponse; Import org.islem.login.service.LoginService; Public Class Login Incentive HTCServlet {Private Static Final Long Serial Weirsian UID = 1 L; / ** * SEE HttpServlet # doPost (HttpServletRequest request, HttpServletResponse response) * / Protected Zero doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO auto-created method stub string userId, password, UserId = request .getParameter ("userId"); Println (userId); Password = request.getParameter ("password"); LoginService loginService = New LoginService (); Boolean results = Login service. Authentication (user ID, password); If (result) {response.sendRedirect ("home.jsp"); Return; } And {response.sendRedirect ("login.jsp"); Return; }}  

}

LoginService.java

  package org.islem.login.service; Public class LoginService {Public Boolean Certified (string userId, string password) {if (password == null} password.trim (== "") {return false; } And true back; }}  

After the name

Your form action is empty, you must fill it in your Should be like the case:

  & lt; Form action = "loginServlet" method = "post" />  

I think that you already define your servlet name on your web.xml


symfony - Clear Symfony2 Http Cache -


Is there an easy way to quickly remove http cache in Symphony 2? There are more than 30,000 files in our cache directory and it takes too long to remove them. Is there a better way to do this? BTW ... When deleting a link from / dev / null ...

The easiest way to clear The cash console command will be used:

  ap / console cache: clear  

if it is produced - you need to add environment (param- -Anv = props.)

By default all console commands run in the Dev environment.

For example, this command looks like an app / console cache: clear -e = prod.


sql - Query Refactor without union -


The

What might we can factor down the query without using the union that we can use where condition Or logical operator

  One as one. Request number, Akticket_id, Tiketaidi, a.requester, num_business_days (a.last_modified_date, sysdate) choose as business, REM_MAIL_SENT_DTTS (SELECT Tikt_aidi, request number as the number, designed as a requestor, Antim_modifaid_det, Araim_aims_ti Ktititis, Ri_Ticket_Info where Sthiti_aidi = 6 and REM_MAIL_SENT_DTTS tap) a where num_business_days (a.last_modified_date, sysdate) & gt; = 5 Union Select one. Request number, one. Ticket_id as ticketID, a.requester, num_business_days (a.last_modified_date, sysdate) as Businessdays, the a.REM_MAIL_SENT_DTTS (SELECT Tikt_aidi, no request as a request number, designed as the requestor, the Antim_snchalit_det, Araim_aims_diitititio, Ri_Ticket_Info where Sthiti_aidi = 6 and REM_MAIL_SENT_DTTS not null) where num_business_days (a.REM_MAIL_SENT_DTTS, sysdate) & gt; = 5  

I think it can be rewritten as simply :

  SELECT a.requestnumber, ticket as a.ticket_id, a. The requestor, num_business_days (a.last_modified_date, SYSDATE) AS businessman, a.rem_mail_sent_dtts FROM ri_ticket_info a WHERE a.status_id = 6 and num_business_days (nvl (a.rem_mail_sent_dtts, a.last_modified_date, SYSDATE) & gt; = 5;  

Python split list based on difference -


मेरे पास ऐसा एक सूची है

  a = [10,20,20,24 , 25,80,90,100,100,101,102,103,140,141,142,143,120,110,100,90,50,40,0]  

मुझे प्रत्येक लगातार तत्व को पुनरावृति करने और उन तत्वों को चुनना होगा जो अंतर की सीमा के भीतर हैं (4 कहें)। < / P>

इस उदाहरण के लिए निम्नलिखित खंड तैयार किए जाएं

हां, तत्वों को जोड़ते रहें, अगर वे सीमा के भीतर हैं और अन्य उपेक्षा करते हैं।

  [20,24,25 ] [100,101,102,103] [140,141,142,143] [0,0]  

अधिकतर यह आपके जैसा दिखता है डीफ ग्रुपिट (सीईसी, थ्रेज़ = 4, मिनलन = 3): आईआरआर = आईटर (सीईसी) जमा = [अगला (आईआरआर)] जबकि सच: नया = अगला (आईआरआर) , कोई भी नहीं) यदि कोई भी नया नहीं है: एब (नयापन - [accumulative] [= 1]] और lt; = thresh: accum.append (newone) else: if len (accum)> = minlen: उपज जमा accum = [newone]यदि लैन (accum) & gt; = minlen: उपज परिणाम परिणाम = सूची (समूह (seq))

हालांकि आपके इच्छित परिणाम में आप का एक अंतिम समूह दिखाते हैं [0, 0 ] जो किसी भी औचित्य या स्पष्टीकरण के बिना नीले से बाहर आता है - पता नहीं है कि इसका अर्थ क्या है यह कोड नहीं करता है कि एक अंतिम, जाहिरा तौर पर पूरी तरह मनमाना समूह, केवल वास्तविक वाले।


javascript - Disabling all input elements except some in a form using jQuery -


I am trying to disable almost all input elements in the form using jquery, but to enable me Some input elements are required. For example:

  $ (document) .ready (function () {$ ("# document: input [name! = 'TloEnable']). Attr (" disabled ", true) ;});  

This works very well on elements similar to 'tloEnable' elements. However, there are some other elements that have different name attributes (file names, notifications, notifications) How can I include them while disabling the remaining input elements?

  $ (document) .ready (function () {$ ("# document: input [name! = 'TloEnable ], [Name! = 'Filename'], [name! = 'Notify '], [Name! =' Notification ']). Et ("disabled", true);});  

Use a selector and pass it; Matched elements will be excluded:

  $ (document) .ready (function () {$ (": input") No. ("[name = tloEnable], [name = Filename], [name = notifyUsers] ") .Press (" disabled ", true);});  

works the same way:

  $ (document) .ready (function () {$ (": input: not ([name = tloEnable ], [Name = filename], [name = notifier]) ".prop (" disable ", true);});  

java - How to detect File downloaded in android -


Is there a way to detect them, any broadcast receiver, file supervisor, content supervisor or any other method & Amp; Get your route I have Google, but I could not find any luck. Looking forward to your experience advice

Note: I can locate new files from the camera using the File Observer, so I know that the above methods How to use

Edit: A file downloaded from any app, lets it say Hotmail or Dropbox, watch it from the background service.

I suggest you download the file in Asyncast and Observer.

Escapes the onPostExecute method of escache.com to update status and update the flag variable and then use it in the main thread from where it is said in the Observer update method.

New Observer () {

  @Override Public Zero Update (executable, object data) {// Here you can parse your response and take proper action can do. }};  

sql - how to find if incomming parameter in not null and not empty in Sybase -


I'm trying to write something like this in CBS ASE

  @searchstring Varchar (500) If the best way to check this condition is INULLorEpty for the incoming @ parameter (ANNLLERTE (@sizerstring)) {exec (@strexecsql)} and {exec (@ strexecsql1)}  < 
 

"post-text" itemprop = "text">

Best would be ISNULL, that is:

  DECLARE @ SearchString varchar (500 ) ... if (ISNULL (@searchstring, '') = '') EXEC (@strexecsql) ELSE EXEC (@ strexecsql1)  

How to Update Multiple Array Elements in mongodb -


Text after "

I have a Mongo document that holds an array of elements.

I want to reset the .handled attribute of all the objects in the array where .profile = XX. Document is as follows:

  { "_ id": ObjectId ( "4d2d8deff4e6c1d71fc29a07"), "user_id": "714638ba-2e08-2168-2b99-00002f3d43c0", "events": [ {"Handled": 1, "Profile": 10, "Data": "....."} {"Handled": 1, "Profile": 10, "Data": "....."} { "Handled": 1, "Profile": 20, "data": "....."} ...]}  

so, I tried the following: < / p>

  .update ({ "events.profile": 10}, {$ set: { "events held $ ..": 0}}, false, true)  

Although it only updates the element first matching element in each document only ( This is the reason that is defined behavior.)

How can I not all match array elements?

Using Sthitiik operator at this time is not possible to update all the items in an array. See JIRA

can as you work around that:

    Update
  • In each item individually (events.1.handled events.0. handled ...) or ...
  • Read the document, manually edit and save it to replace the old one (see if you want to make sure nuclear update)

html - SQL group names as table header rows using PHP -


I am trying to produce a dynamic table using PHP which looks something like this:

  Paul 56 Paul 6 Paul 78 Paul 34 Paul 76 Mark 56 Mark 5 Mark 34 Mark 87 Mark 23 Mark 765 Basically what I want to produce is something like this:   pre & lt; & Lt; Tr colspan = "2" & gt; Name: Paul & lt; / Tr & gt; & Lt; TR & gt; & Lt; TD & gt; 56 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 6 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 78 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 34 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 76 & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr colspan = "2" & gt; Name: Mark & ​​lt; / Tr & gt; & Lt; TR & gt; & Lt; TD & gt; 56 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 5 & ​​lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 34 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 87 & lt; / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 23 / TD & gt; & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 765 / td> & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; 

How my PHP code looks so far:

  & lt ;? Php $ name_holder = null; ($ I = 0; $ i & lt; Count ($ data); $ i ++) {If ($ name_holder! = $ Data [$ i] - & gt; name) {$ name_holder = $ data [$ i ] - & gt; Name; // sure what to do here ?? } Resonates "& lt; tr & gt;"; Echo "& lt; td align = 'left' & gt; $ Data [$ i] - & gt; Name. "& Lt; / td>"; Echo "& lt; td align = 'left' & gt; $ Data [$ i] - & gt; Bell. "& Lt; / td>"; Echo "& lt; / tr & gt;"; }? & Gt; Select  

sql

 , by name name by name checkin_tbl by name, name by ASC;  

You do not need to group your data at the database level. It is possible to do this, but to read related data for each group, you need another SELECT , and as a result, a large number of databases are being sent to the database.

I have chosen to read data using a direct query, which would be something like this:

  SELECT name, by hour checkin_tbl ORDER by name ASC; I have not supplied the database code below, because it is not clear what database you are using (like MySQL) or what interface you are using (eg. .pdo). I have followed the data source using an array like this - I'm sure you swap it with  fetchAll ()  or  foreach ()  and one line .  

In this way, try to do something like this:

  & lt ;? Php // data from your database $ rawData = [['Paul', 56], ['Paul', 6], ['Mark', 56], ['Mark', 5],]; // Let's reprint this $ = []; Foreign currency ($ pair as $ rawData) {$ name = $ pair [0]; If (! Isset ($ $ [$ name])) {$ out [$ name] = []; } // Pop up the value in the list $ $ [$ name] [] = $ pair [1]; } // Use this to see your structure #print_r ($ out); ? & Gt; & Lt ;! - This is your rendering section - & gt; & Lt ;? Php foreach ($ $ = $ data as $ & gt; $ data):? & Gt; & Lt; Tr colspan = "2" & gt; & Lt; Td> Name: & lt ;? Php echo htmlentities ($ name)? & Gt; & Lt; / Td> & Lt; / Tr & gt; & Lt ;? Php foreach ($ item as $ item):? & Gt; & Lt; Tr & gt; & Lt; Td> & Lt ;? Php echo hougements ($ item)? & Gt; & Lt; / Td> & Lt; Td> Edit & lt; / Td> & Lt; / Tr & gt; & Lt ;? Php endforeach? & Gt; & Lt ;? Php endforeach? & Gt;  

My strategy is to format as much data as possible outside of the template - your code and another answer (at the time of writing) here in my opinion is a mix of logic and layout Is doing it, and you need to separate them.

This is the reason why I have switched to open / stop PHP tags in the rendering section: This is normally HTML with PHP Snippet where dynamic output is required. If you do this, you will benefit from tag matching and syntax color in your IDE.

I've added htmlentities () to avoid XSS.


asp.net mvc - Converting my 2.40 mvc3 version to mvc5 version. Autofac.Core.DependencyResolutionException -


I am upgrading to 2.40 version developed in mvc5 from mvc3, I've updated all the necessary references. I also upgraded the autofac reference for version 3.0.0.0. It was successfully created but to throw exceptions on running applications.

No scope is available with tag matching 'Autofac vobrakewost' in which the request was requested. It usually indicates that the request is being requested by a single interaction () component (or a similar scenario) registered as a per-HTTP request. Under web integration always requests reliance dependency dependency. Current or iialim scoppriver Request Lifetime, Never by Container

Attempted to use different checked positions

Builder. Registration Type (). (). Single instance ();

But no success.

Any solution.


Android for-loop getting stuck in endless loop -



Android for-loop getting stuck in endless loop -

i have jsonarray of jsonobjects in each of string key "kind". i'm trying loop through jsonarray , organize them "kind" utilize fill seperatedlistadapter. trying accomplish structure

{ communications[ { "header":"kind" communications[ {} {} {} {} ] } { "header":"kind" communications[ {} {} {} {} ] } ] }

the problem i'm having loop have created accomplish gets stuck in endless loop , crashes application. know going wrong this?

here's code know gets stuck in loop runs log "1" 1000 times though know there's 5 things in array i'm passing in.

for(int = 0; < communicationsfromfile.length(); i++){ jsonobject communication = communicationsfromfile.getjsonobject(i); log.v("communications", "kind = " + communication.getstring("kind")); log.v("communications", "newcomarray = " + newcomarray); if(newcomarray.length() != 0){ log.v("communications", "newcomarray isnotempty"); for(int = 0; < newcomarray.length();a++){ jsonobject iteminarray = newcomarray.getjsonobject(a); jsonarray communicationsforkind = iteminarray.getjsonarray("communications"); log.v("communications", "1"); if(iteminarray.getstring("header").equals(communication.getstring("kind"))){ log.v("communications", "header exists"); communicationsforkind.put(communication); iteminarray.put("communications", communicationsforkind); newcomarray.put(iteminarray); }else{ log.v("communications", "header not exist"); jsonobject additeminarray = new jsonobject(); jsonarray addarraytoitem = new jsonarray(); addarraytoitem.put(communication); additeminarray.put("header", communication.getstring("kind")); additeminarray.put("communications", addarraytoitem); newcomarray.put(additeminarray); } } }else{ jsonobject additeminarray = new jsonobject(); jsonarray addarraytoitem = new jsonarray(); addarraytoitem.put(communication); additeminarray.put("header", communication.getstring("kind")); additeminarray.put("communications", addarraytoitem); newcomarray.put(additeminarray); } }

in each iteration of inner loop, set new objects in newcomarray. status a < newcomarray.length() satisfied because a , array length both grow @ same rate.

android

ios - AVPlayer change volume, vertical slider -



ios - AVPlayer change volume, vertical slider -

is there way alter volume on avplayer using vertical slider, mpvolumeview horizontal , doesn't seems exist way that. have used custom slider: on ios7 have volume property interact with, on ios6 seems solution audiomix trick, lastly 1 seems work "file" tracks not streaming content (i need utilize them). has came idea?

this worked me (iphone 5, ios 8.3):

mpvolumeview *volumeview = [[mpvolumeview alloc] initwithframe:cgrectmake(225, 270, 160, 30)]; cgaffinetransform sliderrotation = cgaffinetransformidentity; sliderrotation = cgaffinetransformrotate(sliderrotation,-(m_pi / 2)); volumeview.transform = sliderrotation; [self.view addsubview:volumeview];

ios iphone avfoundation avplayer

machine learning - Apache Spark ALS collaborative filtering results. They don't make sense -



machine learning - Apache Spark ALS collaborative filtering results. They don't make sense -

i wanted seek out spark collaborative filtering using mllib explained in tutorial: https://databricks-training.s3.amazonaws.com/movie-recommendation-with-mllib.html algorithm based on paper "collaborative filtering implicit feedback datasets", doing matrix factorization.

everything , running using 10 1000000 movielens info set. info set split 80% training 10% test , 10% validation.

rmse baseline: 1.060505464225402 rmse (train) = 0.7697248827452756 rmse (validation) = 0.8057135933012889 model trained rank = 24, lambda = 0.1, , iterations = 10. the best model improves baseline 23.94%.

which values similar tutorial, although different training parameters.

i tried running algorithm several times , got recommendations don't create sense me. rating kids movies next results:

for ratings:

personal rating: toy story (1995) rating: 4.0 personal rating: jungle book, (1994) rating: 5.0 personal rating: lion king, (1994) rating: 5.0 personal rating: mary poppins (1964) rating: 4.0 personal rating: alice in wonderland (1951) rating: 5.0

results:

movies recommended you:

life of oharu, (saikaku ichidai onna) (1952) more (1998) who's singin' on there? (a.k.a. sings on there) (ko tamo peva) (1980) sundays , cybele (dimanches de ville d'avray, les) (1962) blue light, (das blaue licht) (1932) times of harvey milk, (1984) please vote me (2007) man planted trees, (homme qui plantait des arbres, l') (1987) shawshank redemption, (1994) only yesterday (omohide poro poro) (1991)

which except yesterday doesn't seem create sense.

if there out there knows how interpret results or improve ones appreciate sharing knowledge.

best regards

edit:

as suggested trained model more factors:

baseline error: 1.0587417035872992 rmse (train) = 0.7679883378412548 rmse (validation) = 0.8070339258049574 model trained rank = 100, lambda = 0.1, , numiter = 10.

and different personal ratings:

personal rating: star wars: episode vi - homecoming of jedi (1983) rating: 5.0 personal rating: mission: impossible (1996) rating: 4.0 personal rating: die hard: vengeance (1995) rating: 4.0 personal rating: batman forever (1995) rating: 5.0 personal rating: men in black (1997) rating: 4.0 personal rating: terminator 2: judgment day (1991) rating: 4.0 personal rating: top gun (1986) rating: 4.0 personal rating: star wars: episode v - empire strikes (1980) rating: 3.0 personal rating: alien (1979) rating: 4.0

the recommended movies are:

movies recommended you:

carmen (1983) silent lite (stellet licht) (2007) jesus (1979) life of oharu, (saikaku ichidai onna) (1952) heart of america (2003) for bible tells me (2007) more (1998) legend of leigh bowery, (2002) funeral, (ososhiki) (1984) longshots, (2008)

not 1 useful result.

edit2: using implicit feedback method, much improve results! same action movies above recommendations are:

movies recommended you:

star wars: episode iv - new hope (a.k.a. star wars) (1977) terminator, (1984) raiders of lost ark (indiana jones , raiders of lost ark) (1981) die hard (1988) godfather, (1972) aliens (1986) rock, (1996) independence day (a.k.a. id4) (1996) star trek ii: wrath of khan (1982) goldeneye (1995)

that's more expected! question why explicit version so-so-so bad

note code running not utilize implicit feedback, , not quite algorithm refer to. create sure not using als.trainimplicit. may need different, lambda , rank. rmse of 0.88 "ok" info set; not clear example's values optimal or 1 toy test produced. utilize different value still here. maybe it's not optimal yet.

it stuff bugs in als implementation fixed since. seek comparing implementation of als if can.

i seek resist rationalizing recommendations since our brains inevitably find explanation random recommendations. but, hey, can did not action, horror, offense drama, thrillers here. find kids movies go hand in hand taste arty movies, since, kind of person filled out tastes movielens way when , rated kids movies not kids, parents, , maybe software engineer types old plenty have kids tend watch these sorts of foreign films see.

machine-learning apache-spark collaborative-filtering matrix-factorization

python - Extract an attribute value , Lxml -



python - Extract an attribute value , Lxml -

i have next xml file:

'<?xml version="1.0" encoding="utf-8" standalone="yes"?>\r\n<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingcanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officedocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officedocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingdrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingdrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessinggroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingink" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingshape" mc:ignorable="w14 wp14"><w:body><w:p w:rsidr="00706a37" w:rsidrpr="004a1ce5" w:rsidrdefault="004a1ce5"><w:ppr><w:pstyle w:val="heading1"/><w:numpr><w:ilvl w:val="12"/><w:numid w:val="0"/></w:numpr><w:rpr><w:sz w:val="28"/><w:szcs w:val="28"/></w:rpr></w:ppr><w:commentrangestart w:id="0"/><w:r w:rsidrpr="004a1ce5"><w:rpr><w:sz w:val="28"/><w:szcs w:val="28"/></w:rpr><w:t>h</w:t></w:r><w:commentrangeend w:id="0"/><w:r w:rsidr="00a23794"><w:rpr><w:rstyle w:val="commentreference"/>

and need extract value of id within <w:commentrangestart> tag . have looked on many questions on , found next type:

i tried: (iterate on every p commentrangestart tag , , retrieve attrib. returned nothing.

for p in lxml_tree.xpath('.//w:p/commentrangestart',namespaces = {'w':w}): print p.attrib

i tried various combinations 'commentrangestart[@id]' , commentrangestart/@id none worked. referred many questions , 1 of them here . prefer way in go on every p , search comment tag. like:

for p in lxml_tree.xpath('.//w:p',namespaces = {'w':w}): p.xpath(./w:commentrangestart/...)

and on..

what's wrong expression.??

you need qualify namespace:

for p in root.xpath('.//w:p/w:commentrangestart', namespaces={'w':w}): print p.attrib

output:

{'{http://schemas.openxmlformats.org/wordprocessingml/2006/main}id': '0'}

alternative:

for id_ in root.xpath('.//w:p/w:commentrangestart/@w:id', namespaces={'w': w}): print id_

output:

0

python xml python-2.7 xpath lxml

scala - Why does Play 2.3.4 and jacoco4sbt > 2.1.4 fail with NoSuchMethodError? -



scala - Why does Play 2.3.4 and jacoco4sbt > 2.1.4 fail with NoSuchMethodError? -

i'm trying utilize jacoco4sbt in play 2.3.4 (scala 2.10.4) app 2.1.4 seems work. when utilize .5 or .6, next error:

[error] (main/jacoco:fullclasspath) java.lang.nosuchmethoderror: org.objectweb.asm.methodvisitor.visitmethodinsn(iljava/lang/string;ljava/lang/string;ljava/lang/string;z)v

i tried add together asm-all (versions 4.1 , 5.0.3) dependencies not help @ all.

so problem? need add together dependency?

they have indeed changed asm version 5.0.1, , couldn't reproduce issue.

project/build.properties

sbt.version=0.13.7-m3

project/plugins.sbt

addsbtplugin("com.typesafe.play" % "sbt-plugin" % "2.3.4")

plugins/jacoco4sbt.sbt

addsbtplugin("de.johoop" % "jacoco4sbt" % "2.1.6")

build.sbt

name := """play-jacoco""" version := "1.0-snapshot" enableplugins(playscala) scalaversion := "2.11.2" librarydependencies ++= seq( jdbc, anorm, cache, ws ) pipelinestages := seq(rjs, digest, gzip) jacoco.settings

when ran jacoco:cover worked fine.

[play-uglify] $ jacoco:cover [info] compiling 2 scala sources /users/jacek/sandbox/play-uglify/target/scala-2.11/test-classes... slf4j: next set of substitute loggers may have been accessed slf4j: during initialization phase. logging calls during slf4j: phase not honored. however, subsequent logging calls these slf4j: loggers work expected. slf4j: see http://www.slf4j.org/codes.html#substitutelogger slf4j: org.apache.http.impl.client.defaulthttpclient slf4j: com.gargoylesoftware.htmlunit.incorrectnesslistenerimpl slf4j: com.gargoylesoftware.htmlunit.javascript.stricterrorreporter slf4j: com.gargoylesoftware.htmlunit.defaultcsserrorhandler slf4j: com.gargoylesoftware.htmlunit.javascript.configuration.javascriptconfiguration slf4j: com.gargoylesoftware.htmlunit.webclient slf4j: com.gargoylesoftware.htmlunit.javascript.javascriptengine slf4j: com.gargoylesoftware.htmlunit.webresponse [info] integrationspec [info] [info] application should [info] + work within browser [info] [info] total specification integrationspec [info] finished in 29 ms [info] 1 example, 0 failure, 0 error [info] applicationspec [info] [info] application should [info] + send 404 on bad request [info] + render index page [info] [info] total specification applicationspec [info] finished in 29 ms [info] 2 examples, 0 failure, 0 error [info] passed: total 3, failed 0, errors 0, passed 3 [info] [info] ------- jacoco coverage study -------- [info] [info] lines: 57.5% (>= required 0.0%) covered, 34 of 80 missed, ok [info] instructions: 72.12% (>= required 0.0%) covered, 522 of 1872 missed, ok [info] branches: 27.78% (>= required 0.0%) covered, 26 of 36 missed, ok [info] methods: 81.94% (>= required 0.0%) covered, 41 of 227 missed, ok [info] complexity: 76.73% (>= required 0.0%) covered, 57 of 245 missed, ok [info] class: 57.14% (>= required 0.0%) covered, 12 of 28 missed, ok [info] check /users/jacek/sandbox/play-uglify/target/scala-2.11/jacoco detail study [info] [success] total time: 6 s, completed oct 9, 2014 7:42:31

where differ?

scala sbt jacoco playframework-2.3

How to use php pattern Regex in Delphi -



How to use php pattern Regex in Delphi -

most of time, when regex pattern php code, , need "traslate" delphi. big problem in delphi php escapes doesn't works in delphi, if ignore them of time ok. not in next example, if remove /x pattern, function preg_match_all doesn't output value.

this code in php:

$pattern = "/\n". "\s(counters?\\([^)]*\\))|\n". "\a(counters?\\([^)]*\\))|\n". "\s([\"']) ( (?:[^\"']|\\\\[\"'])+ )(?<!\\\\)\\3|\n". "\a([\"']) ( (?:[^\"']|\\\\[\"'])+ )(?<!\\\\)\\5|\n" . "\s([^\s\"']+)|\n" . "\a([^\s\"']+)\n". "/xi"; preg_match_all($pattern, '"file " counter(file)', $matches, preg_set_order);

this output:

array (size=2) 0 => array (size=7) 0 => string '"file "' (length=7) 1 => string '' (length=0) 2 => string '' (length=0) 3 => string '' (length=0) 4 => string '' (length=0) 5 => string '"' (length=1) 6 => string 'file ' (length=5) 1 => array (size=2) 0 => string ' counter(file)' (length=14)

this i've done in delphi:

type tmatches = array of array of string; var matches: tmatches; pattern := '/\n'+ '\s(counters?\\([^)]*\\))|\n'+ '\a(counters?\\([^)]*\\))|\n'+ '\s([\"'']) ( (?:[^\"'']|\\\\[\"''])+ )(?<!\\\\)\\3|\n'+ '\a([\"'']) ( (?:[^\"'']|\\\\[\"''])+ )(?<!\\\\)\\5|\n'+ '\s([^\s\"'']+)|\n'+ '\a([^\s\"'']+)\n'+ '/xi'; regexmatchall(pattern,'"page " counter(page)',matches);

the function regexmatchall here , works in of case:

procedure regexmatchall(pattern: string; subject: string; out matches: tmatches); var d, sd: integer; regex: tregex; reggroupcoll: tgroupcollection; regcoll: tmatchcollection; begin regex := tregex.create(pattern); regcoll := regex.matches(subject); setlength(matches, regcoll.count); // numero de coincidencias [array [x]] d := 0 regcoll.count - 1 begin reggroupcoll := regcoll.item[d].groups; setlength(matches[d], reggroupcoll.count); // numero de grupos [array [d][sd]] sd := 0 reggroupcoll.count - 1 matches[d][sd] := reggroupcoll.item[sd].value; end; end;

also alter \n #13#10, , doesn't matter, matches array empty.i know if hard pattern regex, if @ lastly can resolve issue, wonderful, there lot of php regex code , if can know how utilize in delphi going great delphi developers.

as far can see, php's regex back upwards built on pcre. delphi's appear using. although i'm guessing there because state this. however, think it's reasonably safe assumption.

the x modifier in php corresponds pcre_extended flag. in delphi corresponding setting roignorepatternspace option. pass alternative when phone call matches.

one aside. please don't post of import code using off-site links. should not have leave question larn code is. reader should able info direct question. is, reader wonder how reply discerns delphi regex library use, , calling matches.

php regex delphi

Inserting an image to MySql type BLOB from python and show from MySql to PHP -



Inserting an image to MySql type BLOB from python and show from MySql to PHP -

i trying store image url database base64, when seek show in webpage based on php, doesn't work..

here's python code:

import urllib3, io, requests pil import image import base64 url = 'www....com/pic.jpg' img_conn = urllib3.connection_from_url('www....com/') img_file = img_conn.urlopen('get', url) image.seek(0) resized_image = image.open(image) resized_image.thumbnail((75,75), image.antialias resized_image = base64.b64encode(resized_image.tostring())

the resized_image added database column called pic type longblob.

my php code looks this:

$sql = "select pic product limit 1"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(); $decoded_image = base64_decode($row['pic']); $formimage = imagecreatefromstring($decoded_image);

i message:

php warning: imagecreatefromstring(): info not in recognized format in /home/...

what doing wrong? there way save image url within database?

php python base64 pillow

c# - Temporary disable certificate validation -



c# - Temporary disable certificate validation -

i need consume web service, has certificate , need disable authentication.

the server side can dummy server using "simulate" results or real 3rd side server utilize secured soap headers

i need able disable certificate validation in server when invoking dummy server, enable when invoking real server (which not ours)

i saw in post way disable this:

servicepointmanager.servercertificatevalidationcallback = delegate { homecoming true; };

which works perfectly.

the problem 1 time line of code executed can't seem "reverse" it

i need like:

if (testmode) { servicepointmanager.servercertificatevalidationcallback = delegate { homecoming true; }; } else { //enable certificate validation }

btw, code in c#.

any ideas ?

you need de-register callback, this:

declare remotecertificatevalidationcallback reference.

static remotecertificatevalidationcallback _callbacktrue;

then in initialization code, assign this:

_callbacktrue = (sender, cert, chain, sslpolicyerrors) => true;

then can register / deregister callback when testmode property changes:

// in setter testmode, when set true. servicepointmanager.servercertificatevalidationcallback += _callbacktrue; // in setter testmode, when set false servicepointmanager.servercertificatevalidationcallback -= _callbacktrue;

just create sure register callback when testmode goes 'false true' , de-register callback when goes 'true false'. i.e. registrations / deregistrations should symmetrical.

c# certificate

.net - One NServiceBus.Host for one EndPoint, what is the recommended approach -



.net - One NServiceBus.Host for one EndPoint, what is the recommended approach -

i'm trying understand nservicebus given online documentation. can't wrap head around overall recommended setup of infrastructure. our app supposed able run both single machine , across multiple (logically different) sites (n stores-1 headquarter). nservicebus (i using v5 through nuget), don't understand notion of host , endpoints.

lets have 15 services (order service, item service, etc.).

do need 15 clients (15 class library projects code sending messages on bus), , 15 servers (one or more receiving messages handler classes handle service specific messages/commands)? 30 total.

should each service utilize own separate msmq?

for 15 "server" projects, in production environment need install nservicebus.host 15 times (hence creating 15 windows service instances). during debugging in vs, nserivcebus.host.exe started when start debugging.

so "host" 1 endpoint each host/server project. or can have single host , 15 endpoints within of it?

you can tell new esb pattern, input.

you don't need 15 class libraries. nservicebus can router messages based on namespace/type. eg: namespace messages of "message.orders" can routed "orders" queue.

in production possibility.. depends on volume of messages , logical grouping/partitioning. in development, have 1 queue messages.

again, deployment issue dictated logical partitioning. have scripted handle installation/un-installation of these services. have mine in powershell script.

nservicebus flexible on how , when partition messages. done @ configuration level in uat or production , outside development lifecycle. maintain in mind, 1 nservicebus host == 1 msmq

i started 1 service first, start partitioning based on volume/priority messages.

also, reason breakdown messages 15 classes, if want expose these assemblies external solutions without exposing other message types.

.net msmq nservicebus esb nservicebus4