Tuesday, 15 April 2014

php - Extending core Laravel 5 functionality -


The question is quite simple - can any lurewell 5 functionality be extended in any smart way or will you have to copy Required

Because it is quite broad, I give you 2 examples.

1) I would like to change the URL for Edit \ illuminate \ routing \ ResourceRegistrar for and create . At the moment I have found the only way to get it: To pass the main lightening application to your routing service provider />, then increase the expansion of the router , Then expand publish \ routing \ ResourceRegistrar and finally bootstrap / app.php use our expanded application class to replace just 2 lines, many amendments many Ways To Really Share Our Custom Class The code which is replicated to pass is accurate, apart from it uses the square from the other namespace

2) Other similar changes - Set the custom path for the cache config - you can expand it again Required to change the application override method getCachedConfigPath and then bootstrap / app.php

then The question is - the way in which some modifications should be done or may be the same (for example those 2 o Any way the core application class can not be extended and so many changes can be made?

You overwrite the core ResourceRegistrar by binding your own implementation to the service container Should be able to:

  $ this-> App- & gt; Tie ('\ Roshaning \ Routing \ Resourcerigestor', function () {New MyResourceRegistrar ();}); Increase the   

command main ResourceRegistrar and you should be able to overwrite the edit and < / Code> Methods:

  class expands MyResourceRegistrar \ Roshaning \ routing \ ResourceRegistrar {// your methods overwrite here}  

Powershell -replace regex not working on connection strings -


I use powershell -replace command to update the data source in my configuration Attempting File However, the -replace regex $ oldServer will not remove the value below

I have a string in the $ _ ConnectionString is stored in the variable and it has been saved properly, so I know that this is not a problem. Only seems to be regex

  #environment variable $ env = "dev" $ oldServer = "quasq10" $ newValue = "$ env-AR-SQL.CORP.COM" $ doc = [XML ] (Get-content "D: \ AMS \ app.config") $ doc.configuration.connectionStrings.add |% {$ _. ConnectionString = $ _ Change ConnectionString- $ oldplace, $ newValue; } $ Doc.Save ($ file.FullName)  

Edit

For the comment below I have a write-host Added $ _. ConnectionString statement is the console output as the first line in the loop

metadata = rijs // /MonetDb.csdl|res:// / MonetDb .ssdl .res: // www / MonetDb MSL; Provider = System.Data.SqlClient; Provider connection string = "data source = quasq10 \ sql08a, initial list = mydb; integrated security = true; multipleactiveresultsets = true; application = EntityFramework"

I just put it in the correct ISE, I copied my connection string into one variable and was able to convert it to a closed form.

  $ connectionstring = 'metadata = race: ///MonetDb.csdl | Race: ///MonetDb.ssdl | Race: //*/MonetDb.msl; Provider = System.Data .SqlClient; Provider Connection String = "Data Source = Quasq10 \ sql08a, Initial List = mydb; Integrated Security = True; Multipleactiveresultsets = True; Application = EntityFramework" '$ env = "Dev" $ oldServer = "quasq10" $ newValue = "$ env- AR-SQL.CORP.COM "$ connectionstring -replace $ oldServer, $ newValue  

Race: ///MonetDb.csdl | Race: // initial list = mydb; Integrated Security Connection String = "Data Source = DEV-AR-SQL.CORP.COM \ sql08a /MonetDb.ssdl|res://*/MonetDb.msl;provider=System.Data.SqlClient;provider = True; Multiple Methodology = True; App = EntityFramework "

I think your foreach loop is not getting information about your information, because it seems that your place is OK.

$ doc.configuration.connectionStrings.add

I have not done much with XML, does the XML data type contain an ADD member function? You are not really adding anything, right?

As a test, what do you get from it:

  $ doc.configuration.connectionStrings | % {$ _. ConnectionString- moved $ oldServer, $ newValue; }  

Go against a dummy file and see what happens.

  $ string = "Quick brown fox to jump on a celestial dog" $ old color = "brown" $ new collar = "Orange" $ string- moved $ old color, $ newColor  

This method works to avoid digging through comments

  $ String.Replace ($ oldColor, $ newColor)  

php - Disable access from url -


I want to create a custom post type "portfolio", so I had this code in Argus:

 < Code> $ args = array ('label' = & gt; __ ('blabla', 'blabla'), 'description' = & gt; __ (label 'label', 'label', 'label' = & gt ; $ Label, 'support' = & gt; array ('title', 'editor', 'fraction', 'author', 'thumbnail', 'custom field'), 'hierarchical' = & gt; wrong, 'public True_, 'show_in_menu' = & gt; true, taxonomies = & gt; class', 'show_in_admin_bar' = & gt;, 'show_in_nav_menus' = & gt; true,' show_ui '= & gt; Gt; wrong, 'menu_position' = & gt; 5, 'menu_icon' = & gt; 'Dashikon-format-gallery', 'can_export' = & gt; true, 'has_archive' = & gt; true, 'exclude_from_search' = & gt; false, 'publicly acceptable' = & gt; wrong; Query_var '= & gt; portfolio', 'rewrite' = & gt; $ rewrite, 'ability_type' = & gt; 'post');  

Everything is great, But I want to show portfolio items only on home page with PHP. After creating new portfolio item, I can access it from the link which Wordpress generates for me What I want to disable this capability for all users. If it is possible without any redirection.

this

'exclude_from_search' = & gt; True, 'publicly acceptable' = & gt; Wrong,

Do not forget to flush the rules.

If you do not want to access a single portfolio item page, add it:

'query_var' = & gt; Wrong,

And, perhaps, you also want to delete the archives support or even setting

'rewrite' = & gt; Incorrect,


Why git add all the files even some of them specified in .gitignore -


I am very good for GET, currently learning how to ignore the file in GIT.

I used the order history:

  mkdir testgit cd testgit git init touch .gitignore echo "./toign.txt" & gt; & Gt; Again, it shows:  
  To commit initial commit commitments: ("git rm - .gitignore.txt git add git status  

-cached & lt; file & gt; ...) to new file: .gitignore new file: toignore.txt

I wonder if GIT still has toignore on stage Why is it able to add .txt

The argument is that git "is called" a ./ prefix meaningless and should be ignored by it. Regardless of whether the argument should continue on the day, there is another question, and the fact is that git is effectively matching the output directly to the git ls-files output given by you, not That against the canonizedelized path of those files they can solve is very easy: Use a text-matching pattern, which relies on the local file system naming conventions.

See for full details


javascript - OnClick event doesn't work for values over 10 entries -


जावास्क्रिप्ट - yadcf फ़िल्टर OnClick घटना के बाद काम नहीं करते:

  • 10 पंक्ति प्रविष्टियों के बाद
  • इस स्थिति में: आप html पृष्ठ लोड करते हैं, आपके पास दस प्रविष्टियों के बाद 1-10 प्रविष्टियां और एक्स 2 टैग के बीच X1 टैग है। आप के आधार पर फ़िल्टर onclick घटना का उपयोग कर फ़िल्टर करते हैं X आप है लोड हो रहा है के समय में एक्स 1 टैग यदि आप घटना का उपयोग कर onclick लेकिन X2 अगर आप घटना का उपयोग कर onclick क्योंकि X2 मूल रूप था काम नहीं करता है काम कर रहा है, पृष्ठ html, 10 से अधिक प्रविष्टियां

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

यह मेरा जावास्क्रिप्ट कोड है:

  var oTable; $ (Document) .ready (function () {oTable = $ ( '# उदाहरण') DataTable () yadcf ([{COLUMN_NUMBER:।। 0} {COLUMN_NUMBER: 3, FILTER_TYPE: "range_number_slider", filter_container_id: "external_filter_container" } {COLUMN_NUMBER: 2, text_data_delimiter: ",", FILTER_TYPE: "auto_complete"}, {COLUMN_NUMBER: 1, text_data_delimiter: ",", FILTER_TYPE: "auto_complete"}, {COLUMN_NUMBER: 4, column_data_type: "html", html_data_type : "पाठ", filter_default_label: "टैग का चयन करें", FILTER_TYPE: "auto_complete"}]); $ ( "। label.lightblue") .on ( "क्लिक", function () {yadcf.exFilterColumn (oTable, [[4 , $ (this) .text]] ());}); $ ( "। label4.lightblue4") .on ( "क्लिक", function () {yadcf.exFilterColumn (oTable, [[4, $ (this) .text ()]]);}); $ ( "। label2.lightblue2") .on ( "क्लिक", function () {yadcf.exFilterColumn (oTable, [[2, $ (this) .text ()] ]);});});  

jsfiddle पर लाइव उदाहरण:

टैग (लेबल्स) गतिशील रूप से जोड़ा जा रहा है और इसलिए उन्हें उनके साथ जुड़ी घटनाएं नहीं हैं। इसके बजाय .click () इस तरह से उपयोग करें।

  $ ('# उदाहरण')। पर ('क्लिक करें', "। लेबल। प्रकाशब्लू", फ़ंक्शन ( ) {चेतावनी ('ऑनक्लिक लेबल'); yadcf.exfilterColumn (oTable, [[4, $ (यह) .text ()]]);});  

और .label4.lightblue4 और .label2.lightblue2

के लिए वही तरीका यहां एक < / P>

आशा है कि यह मदद करता है।


c++ - invoke-oracle: malloc.c:2451: sYSMALLOc: Assertion -


तो मुझे यह त्रुटि मिलती है

  invoke-oracle: malloc.c: 2451: sYSMALLOc : निषेध `(पुराना_पश्चिमी == (((एमबीएनपीटीआर) ((चार *) और ((एवी) - & gt; डिब्बे [((1) - 1) * 2])) - __बिल्टिन_ऑफसेट (स्ट्रेट मॉलोक_चंक, एफडी) )) & Amp; amp; पुराने_आकार == 0) || ((अहस्ताक्षरित लंबे) (पुराने_आकार) & gt; = (अहस्ताक्षरित लंबे) ((((__ बिल्टिन_ऑफसेट (ढाँचा मॉलोक_चंक, एफडी_एक्ससिस)) + ((2 * (आकारओफ़ (आकार_टी))) - 1)) & amp; ~ ((2 * (Sizeof (size_t))) - 1))) & amp; ((old_top) - & gt; आकार & amp; amp; amp; और amp; ((अहस्ताक्षरित लंबे) old_end और पृष्ठमास्क) == 0) 'विफल एबॉर्ट (कोर डंप)  

जब प्रोग्राम इस फ़ंक्शन को चलाता है

  int bloom_filter (int * filter, const char * word, int num, int hnum) {Uint64_t * हैश; Printf ("ब्लूम_फ़िल्टर का उपयोग करना \ n"); हैश = (uint64_t *) malloc (hnum * sizeof (uint64_t)); Int i, j, count = 0; के लिए (i = 0; i & lt; hnum; i ++) {हैश [i] = हैश_बी (i, शब्द); जम्मू = हैश [i]% num; यदि (फिल्टर [j] == 1) गिनती ++; अन्य फ़िल्टर [j] = 1; } अगर (गणना == hnum) 1 रिटर्न; और वापसी 0; }  


How to create dynamic cron in Ruby on Rails? -


I want to execute a cron after every unit created every 2 minutes and only prevent me through code Should be able to. Is this possible?

In the simplest way, I can now think what you can say and the code in the "Czech flag "(Probably just a simple variable inside the file name)

So before the cron starts, it should check a file with X which is true / false.

If it is true then it should

(Then you enable / disable the cron "check file "Can write other code to modify)


python - Django change url programmatically -


मुझे अपने डीजेंगो पावर वेबसाइट में पृष्ठ होना चाहिए। index.html और books.html

मेरे पास यह लिंक है books.html मेरे पहले पृष्ठ में P>

  & lt; a href = "books.html" & gt; किताबें & lt; / a & gt;  

और यह पहला पृष्ठ पर वापस पाने के लिए books.html में है।

  & lt; a href = " index.html "& gt; घर और lt; / a & gt;  

और मेरे url conf इस तरह से है

  urlpatterns = पैटर्न ('', url (r '^ $', 'mysite.views.home' , नाम = 'घर'), यूआरएल (आर '^ books.html / $', 'mysite.views.bookpage', नाम = 'पुस्तकें'), यूआरएल (r'index.html / $ ',' mysite.views .home ', name =' home '),)  

और views.py

  def होम (अनुरोध): रिटर्न रेंडर_टो_प्रॉन्स ('index.html') डेफ बुकपेप (अनुरोध): रिटर्न रेंडर_टो_प्रोशन ('books.html')  

जब मैं घर वापस आने के लिए दूसरी लिंक पर क्लिक करता हूं I मेरा यूआरएल पता इस तरह दिखता है

  mysite.com/books.html/index.html/  

मैं यूआरएल को mysite पर कैसे बदल सकता हूँ .com / जब books.html ?

में दूसरी लिंक पर क्लिक करने पर खेद है कि शीर्षक उपयुक्त नहीं है मुझे नहीं पता था कि मेरे प्रश्न का शीर्षक क्या होगा

अपडेट

मैंने हटा दिया है url (r '^ index । Url / $ ',' mysite.views.home ', name =' home ') मेरे यूआरएल पैटर्न से और इस्तेमाल किया & lt; a href = "{% url' home '%}' & gt; दूसरे पृष्ठ में लेकिन जब मैं उस लिंक पर क्लिक करता हूं, तब कुछ नहीं होता

  1. Django के साथ & Lt; a href = "anything.html" & gt; पेज पतों के लिए आपको url टेम्पलेट टैग का उपयोग करना चाहिए। उदाहरण के लिए: & lt; a href = "{% url 'home'%} '& gt; >

    1. आपके urls.py में आपके पास ^ books.html / $ और index.html / $ । अनुपलब्ध ^ सूचकांक से पहले? आप इसे जोड़ना चाह सकते हैं।

    2. urls.py में भिन्न पैटर्न के लिए समान नाम का उपयोग न करें।


java - copy contents jar file from another jar file -


Is it possible to copy the content of a jar file to another jar file? I'm talking about creating a clean collection here In the previous jar file, the file data is still intact (I can use it as an archive utility, such as Winrar, but JCK / JRE fails to load it for some reason or other)

< P> I am having difficulty opening the entire jar because my OS considers some files in the case of sensors and trashes when those people are removed.

So I should do it in memory or some other case-sensitive file or collection system like Raar, Tar, 7z or Gunzip, it would be good if the shelf code is closed but I have no problem that I I can do it with grammar too.

Java 7 NIO.2 API (java.nio.file) can easily complete this. This jar file (which is actually the only .zip file) can use it as a filesystem in its own right, and can copy files directly.

See javadoc on java.nio.file. Path and java.nio.file.files, and then look at a cookbook recipe based on those classes.


gnu make - Can a makefile Pattern Rule prerequisite be a Pattern Rule? -


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

  .फ़ोन: सभी सब: foo.o मेसेफाइल: ; % .inc: इको इंडस्ट्रीज़ स्पर्श $ @% .o: bar.inc इको ओ स्पर्श $ @% .o: FAIL  

मुझे उम्मीद है कि यह पहला % का उपयोग करेगा। नियम, एक शर्त के रूप में bar.inc बनाएँ, और फिर foo.o बनाएँ। इसके बजाय यह अंतिम नियम का उपयोग करता है और मुझे यह मिलता है:

  असफल: विफल: कमांड नहीं मिला: *** [foo.o] त्रुटि 127  
< P> यह ठीक काम करता है यदि मैं % .com से bar.inc बदल या %। O से foo.o < / code>। कहते हैं,

लागू करने के लिए पैटर्न नियम के लिए, इसके लक्ष्य प्रतिमान को फ़ाइल नाम से मेल करना चाहिए और इसके सभी आवश्यक शर्तें (पैटर्न प्रतिस्थापन के बाद) में मौजूद फाइलों को नाम होना चाहिए या किया जा सकता है

क्या पैटर्न नियम %। Inc नहीं किया जा सकता है "बनाया जा सकता है"? मैं जीएनयू बनाओ 3.81 का उपयोग कर रहा हूं।

संबंधित विवरण जो आप याद कर रहे हैं अनुभाग में है।

विशेष रूप से (जोर मेरा):

एक प्रतिमान नियम का उपयोग किसी दिए गए फ़ाइल को बनाने के लिए किया जा सकता है, यदि कोई लक्ष्य प्रतिमान फाइल नाम से मेल खाता है, और उस नियम की सभी आवश्यकतानुसार मौजूद है या बनाया जा सकता है आपके द्वारा लिखे जाने वाले नियमों को प्राथमिकता दी जाती है। हालांकि, ध्यान दें कि एक नियम जिसका पूर्वापेक्षा वास्तव में अस्तित्व में है या जिसका उल्लेख किया गया है, हमेशा अन्य आवश्यक नियमों के साथ एक नियम पर प्राथमिकता लेता है जो कि अन्य निहित नियमों को चैन करते हैं।

तो यह मुद्दा यह नहीं है कि आपकी शर्त को नहीं बनाया जा सकता बल्कि यह आपके दूसरे नियम "जीत" के बाद भी कोशिश नहीं कर रहा है।

MadScientist यह अतिरिक्त जानकारी और उनके उत्तर में विस्तार के साथ थोड़ा सा।


c++ - What does this strange code do? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 4 जवाब

मुझे यह अजीब कोड मिला शुद्ध लेकिन पता नहीं कर सकते कि यह क्या करता है। जब मैं इसे संकलित करता हूं, मुझे कोई आउटपुट नहीं मिलता है।

  int main () & lt;% auto f = & lt; :: & gt; & lt; %% & gt;;% & gt;  

डायग्राफ का उपयोग करना, & lt;% से मेल खाती है <, और % & gt; के } से मेल खाती है।

इन उपज में प्रतिस्थापन करना

  Int main () {auto f = & lt; :: & gt; {}; }  

अंत में, [ और : & gt; से के बराबर है) ] , इसलिए हम

  int main () {auto f = [] {} के साथ समाप्त होते हैं; }  

जहां [] {} एक खाली लैम्ब्डा है, और f बंद ऑब्जेक्ट की एक प्रति है।


ajax - Receiving null parameters from request in JSP file when are being sent -


I have a JSP app, it uploads a file, but to do so, the user can use the name and password. Must have to certify. So my JSP file starts:

  // 0.2.- We get password string password (string) request.getParameter ("pass"); // -> It returns zero / 0.20 returns. We get the "uvus" string uvus = (string) request.getParameter ("uvus"); // -> It also gives zero / more code  

So I want to know why why am I being nullified with those variables .

I went to the form I uploaded, and look for the data that was being sent. I looked up using the Firefox debug tool:

example of data

< P> In fact, it was being sent.

As an additional information, I am creating a request like this:

  var pUvus = document.getElementById ("uvus") .Value; Var pPassword = document.getElementById ("pass"). Values; Var file = document.getElementById ("userFile"); Var formatta = new form data (); FormData.append ("Upload", file.files [0]); FormData.append ("uvus", puvus); FormData.append ("pass", pPassword); Xmlhttp.open ("post", "uploadFile.jsp", true); Xmlhttp.send (formData); Finally, I would like to say that without any error, I can get the VAs from the application object in a single JSP, and in the other pair of JSP files the requested object will be more There are problems without getting more, so I think my mistake should be in the form of a request in Ajax, but I have no clue about it ...  

Anybody guided me May God?

Updates : @ricix asked me how to get a file and parse the request (what would be done after my problem The scope of the request to objects):

  list item; Item = servlet_up.parseRequest (requested); For (int i = 0; i & lt; item. Size (); i ++) {file item item = (filesystem) item. Gate (i); If (! Item.isFormField ()) { 

request.getParameter () won 'Multipart / Do not work for a form-data request If you are using org.apache.commons.fileupload, then you should use something like


Perl data structure to xml -


$ data = {id = & quot; Gt; 1, name = & gt; "A", user = & gt; [{Id = & gt; 1, name = & gt; "U1"}, {id = & gt; 2, name = & gt; "U2"}], group = & gt; [{Id = & gt; 1, name = & gt; "G1"}]};

I would like to convert it to an XML below:

  & lt; Map & gt; & Lt; Item ID = "1" name = "A" & gt; & Lt; Users & gt; & Lt; User ID = "1" name = "u1" /> & Lt; User ID = "2" name = "u2" /> & Lt; / Users & gt; & Lt; Groups & gt; & Lt; Group id = "1" name = "g1" /> & Lt; / Groups & gt; & Lt; / Item & gt; & Lt; / Map & gt;  

I could manually make each line manually but I am looking for any CPAN module based solution.

I tried XML :: stroll but did not go anywhere. I have used XML :: in the past for simplicity, but this time XML is trying to do something as simple: it is getting bad reviews.

Yes, intelligent choice ... is not it for simple XML

As mentioned in the comments - your data is a bit unclear - in particular, how can you tell what the elements within 'groups' or 'users' should be told?

It looks like you can parse some JSON (in fact, you can change it back in JSON directly:

  print to_json ($ data, {beautiful = & Gt; 1});  

The core problem - where JSON supports the arrays, XML does not. So actually there is very little you can do that Directly will convert your data structure to XML.

However, if you are doing some work:

In this way you use some XML cass Use

  Strict; Use cautionary; XML :: Use the tweak; My $ twig = XML :: Twig-> New ( 'Pretty_print' = & gt; 'indent'); $ twig- & gt; set_root (XML :: Tweg :: Alt-> New ('map',)); $ $ = $ Item - & gt; My $ item = $ Twig- & gt; Root- & gt; insert_new_elt ('item', {'id' = & gt; 1, 'name' = & gt; 'A'}); $ Users - & gt; insert_new_elt (' User '& gt; insert_new_elt (' user ', {' id '= & gt; 1,' name '=>' u1 '}); {' id '=> 2, Name '= & gt; 'U2'}); My $ groups = $ item - & gt; Insert_new_elt ('last_child', 'groups'); $ Groups - & g; Insert_new_elt ('group', {'id' => 1, 'name' = & gt; 'g1'}); $ Twig- & gt; Set_xml_version ("1.0"); $ Twig- & gt; Set_encoding ('utf-8'); $ Twig- & gt; Print;  

What prints:

   & Lt; User ID = "1" name = "u1" /> & Lt; / Users & gt; & Lt; Groups & gt; & Lt; Group id = "1" name = "g1" /> & Lt; / Groups & gt; & Lt; / Item & gt; & Lt; / Map & gt;  

To change your data structure is left as an exercise for the reader.

As Borodin notes correctly - you have map from your data structure to items group or Users can guess Maybe based on plurals, but looking at your data set, the best I can come up with is something like this: < Pre> use strict; Use warnings; XML :: Jogging; My $ data = {id = & gt; 1, name = & gt; "A", user = & gt; [{Id = & gt; 1, name = & gt; "U1"}, {id = & gt; 2, name = & gt; "U2"}], group = & gt; [{Id = & gt; 1, name = & gt; "G1"}]}; My $ twig = XML :: Twig- & gt; New ('pretty_print' = & gt; 'indented'); $ Toggle- & gt; Set_rote (XML :: tweg :: ALT-> new ('map',)); My $ item = $ twig- & gt; Root- & gt; Insert_new_elt ('item'); Forward my $ key (key $% data) {if ($ ref $ data- & gt; {$ key}) {$ item- & gt; Set_at ($ key, $ data-> {$ key}); the upcoming; } If (ref ($ data-> gt; {key $}) "ARRAY") {my $ fakearray = $ item- & gt; Insert_new_elt ($ key); Prefer my $ element (@ {$ data- & gt; {$ key}}) {my $ name = $ key; $ Name = ~ s / s $ / g; $ Fakearray- & gt; Insert_new_elt ($ name, $ element); } the upcoming; } If (reference ($ data -> gt; {$ key}) eq "HASH") {$ item - & gt; Insert_new_elt ($ key, $ data - & gt; {$ key}); the upcoming; }} $ Twig- & gt; Set_xml_version ("1.0"); $ Twig- & gt; Set_encoding ('utf-8'); $ Twig- & gt; Print;

This is not ideal because - map is hard, as is the object and I take a very simplistic approach to accepting the array , Finally a s , to make it plural


bash - Recursively iterating through subdirectories and removing certain file -


I have music collections with many folders and sub-folders (cover art etc.), so manually remove hundreds Instead of Folder.jpg, Desktop.ini and Thumb.db files, I decided to do a simple Bash script but things really got messy.

I did a simple test by creating dummy folders like this: / home / dummy / all 1 - all 1 sub 1 sub 1 sub 1 sub 1 sub 1 sub 1 all 2 - all 2 sub 1 all 2 sub 2 All 2 SUB 2 SUB 1

And some random jpg in these memories. MP3, my bass script currently looks like this:

  function delete_jpg_ini_db {if [[$ f == * .jpg]]; Then resonance ".jpg file, $ f removal" gvfs-trash $ f elif [[$ f == * .i]]]; Then remove the ".inie file", $ f, "gvfs-trash -f $ f elif [[$ f == * .db]]; then" echo ".db file, extract $ f" gvfs-trash -f $ F else echo "is not a .jpg, .ini or .db file, $ f 'fi} for function iterate_dir {d *; if [-d $ d]; then inserting" sub-directory: $ d " For amp; CD $ d for PWD F *, if [-f $ f]; then check # .jpg, .ini or .db, then delete delete_jpg_ini_db elif [-d $ f]; then Repeat the center sub-diary and repeat again if echo "[$ (ls-A $ f)"]; then iterate_dir else "sub-directory $ f is empty!" It successfully goes through all 1, all 1 SUB1 and all 1 SUB 1 SUB1, but it stops there instead of going back home and searching for the next subbase.  < P> I am new in Bash scripting, all help is appreciated .. Thanks.   

and In an order you can run:

  find / home / dummy / all 1-name "* .jpg" -o -name "* .ini" -o -name "* .db "-Detailed  

And if you want to see it What files will be deleted, replace -delete with -print (just the filename) or with -ls (like Ls -l output).


Difference between overriding and overloading of a function in C++ -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 10 उत्तर
  • 13 उत्तर

मैं अपने कॉलेज में सी प्लस प्लस कोर्स का अध्ययन कर रहा हूं और मैं किसी समारोह के ओवरराइडिंग और ओवरलोडिंग के बीच अंतर करने में असमर्थ हूं, कोई भी मेरी सहायता कर सकता है।

ओवरलोडिंग का मतलब है कि समान मापदंडों वाले समान नाम के साथ कार्य करता है, यह वास्तव में नहीं है यह निर्भर करता है कि आप प्रक्रियात्मक भाषा या ऑब्जेक्ट ओरिएंटेड भाषा का उपयोग कर रहे हैं आप ओवरलोडिंग कर सकते हैं जहां तक ​​सवारी का संबंध है, इसका मतलब यह है कि हम स्पष्ट रूप से उस फ़ंक्शन को परिभाषित कर रहे हैं जो आधार वर्ग में मौजूद क्लास में मौजूद हैं स्पष्ट रूप से आपको सवारी करने के लिए ऑब्जेक्ट ओरिएंटेड भाषा की आवश्यकता होती है क्योंकि यह आधार और व्युत्पन्न वर्गों के बीच किया जाता है।


random - Randomly choosing multiple groups of "strings" in R -


So basically I randomly ~ 200 unique IDs "numbers" (strings that contain a letter and a number eg x1,

X2, y40, ...) and some id "numbers" are not assigned to any group in the group of 5 groups without any replication.

For the least work example, I have 32 unique ID "numbers" on which I use 11 unique ID "numbers" with "21 unique ID" numbers "using" 7 of 3 I want to sort in groups. # 32 Unique ID id = C ("y6", "x1", "x3", "x4", "x5", "x12", "x7", "x8",

"X9", "z6", "x10", "y1", "x11", "z3", "y2", "y3", "y4", "y5", "y7", "y8", "y9 "," Z10 "," z10 "," z1 "," z1 "," z1 "," z1 "," z8 "," z1 "," 2 "," z2 "," z4 "," z5 "," z7 " "X2") # and how will I create the first group of 3 unique ID "numbers" sample (id, 3, location = FALSE, replace prob = NULL) #Output [1] "x3" "x6" "y8 "

So far, one way to do this is to select the next group from ID and group 3 without removing the selected number of thAs long as I have 7 groups of 3? Since it is possible for small datasets, but not for the big ones.

PS: Yes I have searched, but whatever has been implemented I did not get it and I'm a little bit of R. NuB.

I think it should work, Actually randomize random vectors to a group, you can divide it into a list, but Uje think it is better to keep the data. Frame

  `ID & lt; - Sample (ID, Length (ID), Replaced = FALSE) ID & lt; - data.frame (id) id $ group & lt; - Rooftop (seq_along (id $ id) / 3) `` ` 

r - RStudio opens documentation in web browser -


When I type in the name of the function, open the help box in RStudio in the web browser instead of the R-studio Got the answer - The window is the same when the ? The function is typed in , for example ? When I do this, I also get the following error in the console:

  & gt; (Function): Error in (function (): Attempt to apply non-function error (function): Attempt to apply non-function Error (function :): Attempt to apply non-function  

This version happened after the upgrade to 3.1.3 and I am at Ubuntu 14.04.

Does anyone know how to fix this - how in the RStudio RStudio window To open the document, not the browser in the web?

RStudio Need to upgrade to 0.98.1103 or newer version.


css - Sass compiler issues with ampersand and with update -


I am trying to follow a link to style and BEM principles but I get an error from the saas compiler. Click the icon & lt; / A & gt; Has a link with html

   

And here's the stuff:

  .sg-link {color: # 111; Text-decoration: None; & Amp; -Con {& amp;:: {margin-right: 10px; }} & Amp ;: Hover {Color: $ maggie; }}  

Now when the mother-in-law looks, I find this error in the terminal:

  error source / scss / atoms / _02-links.scss ( Line 7: After "& amp;" invalid CSS: "{" was expected, "-con" {"" -con "can only be used at the beginning of a mixed selector.)  

I have used this technique before and have always worked, so I thought maybe this is something to do with the sauce version. I am using Sass 3.2.13 (Media Icon) . So I checked on the sass website and the latest version should be Sass 3.4.13 (selective Steve) , but when I try to update with gem update sass It does not say anything to update Try with pseudo but there is no luck

Edit: I have just checked the same code on Sassmeister and it Well done

thanks in advance

Using the right about, you can see that your snippet compiled at Sass v3.4.x, but not at 3.2.x (you can configure the Sass version in the control panel, under the coop icon menu ).

As you are having trouble updating Sass in your environment, perhaps it is beyond the scope of this question, but it may be that the version of your system of Ruby / GEM is outdated. You can consider a Ruby Edition management tool or for better control which versions of gems are installed. I suspect that to install rbenv (for example), use it to install the latest version of Ruby, and then from gem to Sass Installing will solve your problem.

(Disclaimer: I am not feeling well with Ruby, but I have found a setup to work well for me as described above.)


javascript - Function run on multiple elements inserts multiple images -


I have a function called several li elements when you scroll down to the page function to a class Removes and creates an image element based on the data-attribution of each Lee:

  function createImg (param) {var img = $ ('& lt; img & gt;') ; Img.attr ('src', $ (this) .attr ("data-src")); Img.appendTo (this); } $ (Window) .scroll (function () {if ($ (window) .scrollTop () + $ (window) .height () === $ (document) .height ()) {$ ("li.hidden "). Slice (0, 2) .removeClass ('hidden'). Each (createImg);}); & Lt; Ul & gt; & Lt; Li class = "hidden" data- src = "img / 1.jpg" & gt; & Lt; P & gt; 1 & lt; / P & gt; & Lt; / Li & gt; & Lt; Li class = "hidden" data- src = "img / 2.jpg" & gt; & Lt; P & gt; 2 & lt; / P & gt; & Lt; / Li & gt; & Lt; Li class = "hidden" data- src = "img / 3.jpg" & gt; & Lt; Div class = "image-cont" & gt; & Lt; / Div & gt; & Lt; P & gt; 3 & lt; / P & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

However, now I want to create an image within div.image-cont within Lee. Ive tried javascript below, but it creates multiple pictures in each div.image-cont, instead of just 1 in each:

  function createmg (param) {var img = $ ( '& Lt; img & gt;'); Img.attr ('src', $ (this) .attr ("data-src")); Img.appendTo ("image-per-message", this); } & Lt; Ul & gt; & Lt; Li class = "hidden" data- src = "img / 1.jpg" & gt; & Lt; Div class = "image-cont" & gt; & Lt; / Div & gt; & Lt; P & gt; 1 & lt; / P & gt; & Lt; / Li & gt; & Lt; Li class = "hidden" data- src = "img / 2.jpg" & gt; & Lt; Div class = "image-cont" & gt; & Lt; / Div & gt; & Lt; P & gt; 2 & lt; / P & gt; & Lt; / Li & gt; & Lt; Li class = "hidden" data- src = "img / 3.jpg" & gt; & Lt; Div class = "image-cont" & gt; & Lt; / Div & gt; & Lt; P & gt; 3 & lt; / P & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

  function createImg (param) {var img = $ ('& lt ; Img & gt; '); Img.attr ('src', $ (this) .attr ("data-src")); //img.appendTo(".image-cont ", this); $ (". Image-per", this) .append (img); }  

Use attachment instead of attachment to resolve it.


visual studio - VS2013 freezes when working with a javascript file -


I am working on a site and I need to make some changes to a JavaScript file. At any time I freeze VS 2013 for about 30 seconds. Then just typing $ takes 30 seconds if I use go to definition then it takes about 2 minutes.

This is not my code, it's the code from an envato template. There are a lot of JSHint alerts on the code, but it is working fine in the browser, so there is no use to correct the alert through all the code files, I need to modify some functions, but 30's Rate per second for a long time at your rate.

Simply open the code file (with the selected tab) in the solution Explorer slows down everything, including the right-click context menu.

My own javascript files are okay with no speed delay, so there is something in the code that is slowing down the IDE, but going through the line line and refactoring this job Is worth.

Does anyone know what this can be? I know that I can only use a different editor, but I did not have to do this and I would like to do this too, I'm guessing that this should be some intellisense related problem. How do I go about debugging? Can I close Intelligence for a personal file?


javascript - How to change input Value without changing the input content -


I am updating the validation process of a custom form class that we will be user friendly by using masks on our form Are created for Input.

We will have to save the form via HTTP request due to file upload.

There are situations where we can use AJAX to save a form, and we created a method in those circumstances which modify the content based on that legal type, such as:

01/02/1234 to 1234-02-01 123.45678 has been changed to 123456.78

The problem occurs when I have to send it via HTTP request

Example of:

  & lt; Form id = "formID" action = "UrlToCRUDClass" onsubmit = "return validateForm (this);" & gt; & Lt; Input id = "datefind" type = "text" value = "" data-valid = "DATE" & gt; & Lt; / Form & gt;  

I want to know how to change the value sent through POST without changing the value of the input which is visible to the end-user.

| 08/04/1992 | & Lt; = User input value (input is visible inside container). 1992-04-08 | & Lt; = Post value (invisible to user input)

I tried to change with success:

  $ ('# datefield'). Attr ('value' 'unmaskedvalue'); // - Post Value is 08/04/1992 $ ('# field'). Val ('unmaskedview'); // - Change the visible content for end-user $ ('# fieldfield') Prop ('value', 'unmaskedview'). Ether ('value', 'mask'); // - changes the content visible to the end user  

to format the input within the input format and without redirecting the value within the input container, without any other The way?

I was able to thank my Ajax upload:


php - SQL Server outputs inconsistent data -


I'm getting strange results for this query.

  & lt;? ('Conf / conector.php'); Echo "start"; $ ConnSQL = mssql_connect ($ AconnSQL [$ CONF_connSQL_default] [1], $ AconnSQL [$ CONF_connSQL_default] [2], $ AconnSQL [$ CONF_connSQL_default] [3]); Mssql_select_db ($ AconnSQL [$ CONF_connSQL_default] [4], $ connSQL); $ Result = mssql_query ("Select top 300 codem, descripcion, from codsbr item (NOLOCK) with WHERE itemprefi = 'B' and descripcion! = '' And descripcion is not"); Echo "& lt; br & gt; Rows:" .mssql_num_rows ($ result). '& Lt; Br> & # 39; & # 39; Mssql_free_result ($ result); Mssql_close ($ connSQL); Repeat "End"; Included ('../ included / funciones / conector_by.php'); ? & Gt;  

The code above is expected because of "Top 300" "Lines: 300" prints.

But if I run (using the same code):

  SELECT Coditm, descripcion, from codsbr item (NOLOCK) This item "F" = "B" And descripcion! = '' And not descripcion  

This prints the "Rows: 272" (I get 272 lines if I 'mscllftrearAr'

If I " Top 500 ", I also get 272 lines.

It's just crazy but it goes crazy ...

If I go:

Items with test from SELECT SELECT SELECT (*) (NOLOCK) WHERE itemprefi = 'B' and descripcion! = '' And do not descripcion

Test column is 1936 (which is the habit of rows

I am totally confused, I do not know where to find an error I am using mssql_ * for a long time (in the same server) and I have not found a problem like this, it works only with this table.


java - SharedPreferences not saving boolean -


On my Galaxy Note 3, I'm having a strange problem with shared preferences, the "saved_name" preference is working fine , Though when I try to save the boolean which does not save it. Actually the log reads: First: After the truth: False makes no sense to it completely.

  Last shared reference prefs = PreferenceManager.getDefaultSharedPreferences (MainActivity.This); // Get the primary sharing preferences. Editor Editor = prefs.edit (); Auto_login_checkbox.setOnCheckedChangeListener (New Compound Button. Check Chainlaster () {@ Changed in face (Compound Button Button View, Boolean Check) {Log.e ("Login", "Before:" + Checked) ; Editor.PoolBoline ("saved logline", is checked); editor.committ (); boolean is_saved = prefs.getBoolean ("saved_login", false); // Why is this printed right if top is correct? E ("saved", "after:" + + isassaid);}}); String name = prefs.getString ("saved_name", tap); // Get a string if (name! = Null) {usernameField.setText (name); }  

Removing location from "saved_login" in putBoolean like this:

Editor. InputBoline ("saved_ login", to check);

objective c - Listening for iMessage or SMS via private API's -


I am trying to develop an internal application for my organization, but I'm trying to get the SMS or images Have to find out, and send some silent SMS I still can not get any helpful code which I want to use.

I tried to use ChatKit.framework but I am not able to work it (I'm getting the error to add to the building)

Is there any other private structure? Or is anyone able to work on the socket structure with a legitimate project?

Thank you.

You are not able to achieve what you want and can also get the app on the app store . However, you mention that your app is used internally and it is probably no problem at all

  • I CoreTelephony


java - Flying Saucer: Convert Multiple Html to 1 PDF document -


मेरे पास एक रिपोर्ट टेम्पलेट है जिसमें 4 HTML फाइल शामिल है I

/ Ol>

मैं फ्लाइंग सॉकर का उपयोग करके प्रत्येक पृष्ठ को अलग से पार्स करता हूं और स्थान धारक को गति के द्वारा बदलकर पीडीएफ में सफलतापूर्वक रूपांतरित कर देता हूं। अब इन 4 HTML पृष्ठों को एक एकल पीडीएफ दस्तावेज़ में कनवर्ट करना समस्या है।

इसे प्राप्त करने के दो तरीके हैं।

विलय HTML

विलय करके सभी HTML दस्तावेज़ और फिर प्लेसहोल्डर को गति के द्वारा पॉपुलिंग करना जो कि सफलतापूर्वक किया जा रहा है लेकिन पृष्ठ पर अंक लगने पर समस्या उत्पन्न होती है। मैं चाहता हूं कि प्रत्येक एचटीएमएल पेज को 1 पीडीएफ पेज में बदल दिया जाए लेकिन इस परिदृश्य में सभी टेक्स्ट मर्ज किए गए हैं।

रूपांतरण के बाद पीडीएफ मर्ज करें

यह दृष्टिकोण मुझे सही नहीं लगता क्योंकि प्रत्येक पीडीएफ पृष्ठ को अलग से संबंधित HTML पृष्ठ से और फिर 1 पीडीएफ दस्तावेज़ में विलीन करना एक उन्नत-सक्षम समाधान नहीं है।

कोडिंग उदाहरणों के साथ आपके सुझावों की अत्यधिक सराहना की जाएगी।

< Div class = "post-text" itemprop = "text">

मैं दस्तावेज़ों को एक साथ जोड़ने का एक तरीका भी देख रहा हूं।

मुझे पता है कि एक HTML दस्तावेज़ का उपयोग करते समय नए पेजों को कैसे शुरु करें हालांकि। इसे आज़माएं:

  & lt; html & gt; & Lt; शीर्ष & gt; & LT; शैली & gt; द्वितीय दस्तावेज़ के लिए @ पेज {/ * डिफ़ॉल्ट पृष्ठ शैलियाँ * / @page p1 {/ * पहले टेम्पलेट के लिए पेज टेम्पलेट * /} @ पृष्ठ पृष्ठ 2 / / * पृष्ठ टेम्पलेट * /} @ पृष्ठ पृ 3 {/ * तीसरा दस्तावेज़ के लिए टेम्पलेट चौथा दस्तावेज़ * /} # p1 {पेज: p1; } / * पी 1 पेज टेम्पलेट का उपयोग करने के लिए # पी 1 को बताता है / / # पी 2 {पेज: पी 2; } / * पी 2 पेज टेम्पलेट का उपयोग करने के लिए # पी 2 बताता है / / # पी 3 {पेज: पी 3; } / * P3 पेज टेम्पलेट का उपयोग करने के लिए # p3 बताता है / / # p4 {पेज: p4; } / * P4 पृष्ठ टेम्पलेट का उपयोग करने के लिए # p4 बताता है / / lt; / style & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; / body & gt; & Lt; लेख आईडी = "पी 1" & gt; & Lt;! - पृष्ठ 1 यहां सामग्री - & gt; & Lt; / लेख & gt; & Lt; लेख आईडी = "पृष्ठ 2" & gt; & Lt;! - पृष्ठ 2 सामग्री यहां - & gt; & Lt; / लेख & gt; & Lt; लेख आईडी = "पी 3" & gt; & Lt;! - पृष्ठ 3 सामग्री यहां - & gt; & Lt; / लेख & gt; & Lt; लेख आईडी = "पी 4" & gt; & Lt;! - पृष्ठ 4 सामग्री यहां - & gt; & Lt; / लेख & gt; & Lt; / html & gt;  

मेरी समझ यह है कि जब एक तत्व को एक अलग पृष्ठ टेम्पलेट की आवश्यकता होती है, तो एक पृष्ठ विराम जोड़ा जाएगा।

यदि आपको अलग पृष्ठ टेम्पलेट्स की ज़रूरत नहीं है हेडर, पाद लेख आदि सभी समान हैं) तो आप शायद प्रत्येक लेख के लिए एक पृष्ठ ब्रेक के लिए पूछ सकते हैं:

  आलेख {पेज-ब्रेक-पहले: हमेशा; }  

database - Alternative/Faster way to model this data -


Our mother-in-law helps in promoting eCommerce stores effectively, to do so, to maintain a lot of data Required - Promotional data and all the products which are promoted with each customer group that apply to these promotions I have made this data normal but I think one of these tables, Promotion Products, is very fast Sic And can slow down our most important questions.

Here's how this table comes so fast: If a promotion runs 25,000 products and 10 customer groups per week in a store, then 250,000 new entries / week (2) in the promotional product table 1 million / mo). Since this is a mother-in-law product, we have so many customers who create similar data or more.

How can I improve this schema so that the data of promotion products can be inquired quicker?

  Products - Product_id - Customer_ID - Name Promotion - Promotion_ID - Customer_ID - Promotions (i.e., lack of 20%) Promotion - Products (Need to be read fast) - Product_id - Promotion_Aud - Customer_ID - Group_ID (each offer related w / one or several client groups)  

Is that you've denormalized it by adding customer_id to the Promotion_products table, which will help You should consider, especially if this is indexed, you can consider the promotional table clustering by the customer and promotion_id

I am wondering why group_id and customer_id are in promotion products, because it seems that in a group_id It seems that it is related to many customers.

All indices are the fields that you intend to query.


sql - How to group through a string part? -


I have a table in which logs from a web portal, in this URL is visited, the duration of the request, the referrer

One of these columns is path information and it contains the following strings:

  / admin / / export / / project2 / / Project 1 / News / Project 1 / User / User / ID / 1 / User / ID / 1 / History / User / ID / 2 / Forum / Topic / 14 / Post / 456  

This call Want to count on the SQL query a data base, so I would like to know that I can make to overall based on the first part of the path information ?

This will be sent to me as the / admin / , / export / , / project1 / , / project2 / Calculate the number of URLs starting with , / user / , / forums / , ...

it's programming language Regex would be easy to create with, but the same work I read does not exist on SQLServer.

I first find the first occurrence of "/" followed by the first letter / ' For the use of fourteenx (), then after the second anything is snatched. Select LEFT (pathInfo, CHARINDEX ('/', pathInfo, 2)) as RootLevelPath, count (*) as left-hand as LEFT (pathInfo , CHARINDEX ('/', pathInfo, 2))


How to solve set of equations Matlab -


I have a set of equations that define the system. I do not know how to do this in Matlab, the fact Apart from that it is possible, and iterations are required.

I have three unknown ( Q , T_a_out and T_b_out ).

The system is divided into several sub-parts, information about temperature in the first and last sub-sections should be used to find the temperature in the sub-parts in the middle. I need Q , T_a_out and T_b_out

for each sub-section

The equations used to describe the system are as follows:

  Q = U * ((T_a_out-T_b_in) + (T_a_in-T_b_out)) / 2Q = m_a * (cp_a_in * T_a_in-cp_a_out * T_a_out) Q = m_b * cp_b * (T_b_out-T_b_in)  

This parameter is known:

  Initial T_a_in (110) Initial T_b_in (5) U m_a m_b n (number of sub-parts) cp_b  

CP one element of the price temperature For he is related to roh:

  cp_a_in has a function of temperature: cp_a_in = function_a (T_a_in) cp_a_out is a function of temperature: cp_a_out = function_a (T_a_out)   one  value (110), the value of  b_out  is more important than the last sub-section final  a_out  value Begins the lower value of the initial  b_y  value (5) 

How do I calculate outside Temperature for each sub-section in Matlab?

Based on your comments, I have put together a quick script that you should start in the right direction - In addition to some notes

The first thing that you are trying to solve is unnecessary, especially the CP (T) is highly non-existent and near the critical point above that deviation .

In addition, assuming that H = CPDT, and you are using REFPROP, a more accurate calculation will be H (T_out) -. H (T_in) which includes temperature effects

It is being said that by writing your collective balance you can prepare a system of non-linear equations to solve as follows. Since I could not solve the use of your UA , I therefore replaced it with "effect factor". Use your congressional option to fill it (say, NTU).

I caution you that what I posted below is incomplete and this is a starting point and there are some problems to consider:

I am specifying the n-2 specifying the temperature variable while the n equations mean that the boundaries are likely to be satisfied as Ta_end = Tb_end (you will see That's what I mean if you run it and plot it). This is probably the reason for an imbalance in temperature as a function of the stage.

Depending on your pressure and fluid, if you are going through 1 order phase transition then you may experience some strange numerical issues.

If you can absorb continuous heat capacity, then you can change the matrix very easy and in the solvable system. I offer this more complex example as a starting point.

  function Tf = gen_mat n = 10; Number of steps A = zero (n, 2 * n + 2); % Coefficients matrix m = 10; Mass flow of% ABB = 5; B F.F.T = mass flow of 1.0; % Effectiveness factor to (1) = 383.15; Entrance of% A T (2) = 278.15; B their TTP = 15000; % P (KPa)% Estimate TI = Linspace (TE (1), TE (2), N + 1) '; Tg = zero (2 * n + 1,1); I for = 1: n + 1 Tg (2 * i-1) = ti (i); TG (2 * I) = TI (I); End Tg ([1,2 * n + 1]) = []; % We are only interested in middle classes to build% coefficient matrix for = 1: na (i, 2 * i-1) = -ma; A (i, 2 * i) = eff * mb; A (i, 2 * i + 1) = ma; A (i, 2 * i + 2) = -Eff * mb; Solve the system of end% nonlinear equations Tf = fsolve (@ (T) obj_fxn (T, A, P, Te), Tg, optimset ('Display', 'iter')); TF = [TE (1); TF; To (2)]; % Adding the end temperature B = obj_fxn (T, A, P, TE) T = [TE (1); T; To (2)]; I = 1: 2 for: length (t) -1 x (i) = refropamp ('h', 't', t (i), 'p', p, 'co2'); X (I + 1) = Refropome ('H', 'T', T (I + 1), 'P', P, 'Water'); End b = a * x ';  plot (0: 10, Tf (1: 2: end) -273,10: -  

You can make the above mentioned crude plot after running it: 1: 0, TF (2: 2: end) -273) .

Sorry it's not too organized, but I hope it will be helpful.


node.js - introducing delay within async.forEachSeries -


  async.forEachSeries (jList, फ़ंक्शन (json, cb) {setTimeout (foo, 600000); function1 (j , फ़ंक्शन () {}};  

Iterator के प्रत्येक प्रविष्टि को निष्पादन के लिए उठाया जाने से पहले एक विलंब शुरू करना चाहता हूँ। मैंने एक setTimeOut की कोशिश की लेकिन यह काम नहीं कर रहा है।

कोई भी विचार?

अपने कोड में सेट टाइमआउट बाद में चलाने के लिए टाइमर और एक कोड सेट करता है टाइमर ट्रिगर होने के बाद, लेकिन आपका कोड चलना जारी रखता है और थ्रेड को नहीं रोकता है और समय समाप्त होने के लिए इंतजार कर रहा है। इसलिए आप किसी भी तरह के अंतहीन लूप को चलाने के लिए 2 तरीके देख सकते हैं ... गुणा करना चाहते हैं और तब जारी रखें या सेट टाइमर को अंतराल में ट्रिगर करना चाहते हैं, जो आपको इंडेक्स का समय चाहते हैं। फिर अपना धागा चलाने के लिए स्वतंत्र है और इसकी प्रतीक्षा नहीं है।

<पूर्व> var forEach = की आवश्यकता होती है ('async-foreach')। ForEach; var टाइमआउट लांघ = 3000; ["A", "b", "c"], फ़ंक्शन (आइटम, इंडेक्स) {setTimeout (function () {console.log ("प्रत्येक", आइटम, अनुक्रमणिका); }, समयबाह्य लांघ * सूचकांक); });

javascript - Is it possible to load external js ressources in a jade file? -


I want to call Google API and execute it inside a ZD file. Is it possible to do something like this?

Does any similarity

  include myjs.jade  

but something like this:

  Included https://apis.google.com/js/client.js?onload=init  

my purpose is not included

    

in my HTML but to call Google Shortchers to help create my HTML before serving my HTML. (I do not have to use Google Shortcuts in my HTML.)

In advance thanks

Is there any special reason that you want to inline javascript?

  script (src = "& lt; path to source and gt;")  

algorithm - Permutations in VBA Excel -


I am trying to generate all possible combinations of array of characters. Input array contains n characters, 5 & lt; = N & lt; = 7, and I would like to generate a second array A (C, N, 5), 5, which contains all C (N, 5) combinations. The order of letters in the array is not important.

Here is an example: Input array: {A, B, C, D, E, F}, therefore n = 6 should be output array:

  {ABCDE }, {ABCDF}, {ABCFE}, {ABFDE}, {AFCDE}, {FBCDE},  

It is very easy for N = 5 and n = 6, but n = 7 becomes very complicated for. Does anyone know how I should do this?

Thanks

repeat this regularly

for example , Your n = 7 case in the outer layer, you start with {A, B, C, D, E, F, G}. From this, you take a letter; You have 7 elements in 7 output orange sets in a different one 7 times (A, B, C, D, E, F), {A, B, C, D, E, G} etc. Each: 6 characters with.

For these outputs each , you reduce the use of the same algorithm after it. You already know how to deal with {A, B, C, D, E, F}.


javascript - how to add strings that are in the same parameter -


I would like to add two strings together so that if 7 and 8 Clicks, sets the HTML inside the function output box to 78 . However, with this current work, it only shows the recently selected number. How can I get it to show every number to be selected?

  select the function number (num) {num = num + num // what goes here? Document.getElementById ("Outputbox"). InnerHTML = num; }  
  & lt; Button onclick = "select no ('7')" & gt; 7 & lt; / Button & gt; & Lt; Button onclick = "selectNum ('8')" & gt; 8 & lt; / Button & gt; & Lt; Button onclick = "selectNum ('9')" & gt; 9 & lt; / Button & gt; & Lt; Button onclick = "selectN ('4')" & gt; 4 & lt; / Button & gt; & Lt; Button onclick = "selectN ('5')" & gt; 5 & ​​lt; / Button & gt; & Lt; Button onclick = "selectN ('6')" & gt; 6 & lt; / Button & gt; & Lt; Button onclick = "selectNum ('1')" & gt; 1 & lt; / Button & gt; & Lt; Button onclick = "selectN ('2')" & gt; 2 & lt; / Button & gt; & Lt; Button onclick = "selectN ('3')" & gt; 3 & lt; / Button & gt;  

Try:

  var number = ' '; Select the function number (num) {number + = num; Document.getElementById ("Outputbox"). InnerHTML = number; }  

android - How to parse my json data? -


I'm starting in Android and I want to get data from the server and show data in the data view. I get the data correctly from the server and show the result in toast, but my data is:

  [{"countryname": "China", "calculation" : "200"}]  

How can I parse that result in this block?
For example: countryname = China

  @Override protected void OnPostExecute (string result) {//Toast.makeText (getBaseContext (), "Data sent! ", Toast.LNGTH_LONG). Show (); //Log.d (I have my backup backup: "result.toString ()); try {JSONObject jsonObj = new JSONObject (result);} hold (JasonXExtension) {e.printStackTrace ();}}  

Please do not show me the link to the tutorial or any other site, please write your code. Thanks for all.

  protected void onPostExecute (string result) {//Toast.makeText (GetBaseContext ()," Data Sent! ", Toast.LNGTH_LONG) Show (); // Log. D (i have my backup backup: ", result.toString ()); Try {JSONArray jsonArray = New JSONArray (Results); For (int i = 0; i & lt; jsonArray.length (); i ++) {JSONObject jsonObj = jsonArray.getJSONObject (i); String country = jsonObj.getString ("country name"); String calculation = jsonObj.getString ("Calculate"); }} Hold (JasonX Express E) {e.printStackTrace (); }}  

php - yii CJuiAutoComplete not working online but working fine locally -


I have been working on my yii project for some time. All are working properly locally, but when I upload it online, all CJEAsoutputed input fields do not work. No auto completion option is given when you start typing the user in the input field. what is wrong? Thnx in advance.

Look at the CJuiAutoComplete import path. The Linux server is case sensitive. If the actual path is "name / script.php", then you can not use "name / script.php"


cakephp - find with conditions on assosiated models only -


I am using containable behavior in Cake 2.4. I have 2 tables - Page and Page_ Translated I have many page_translations in page I

Since the page can be in different languages, there are only numbers in the page table (id, data, image, act). Page_translated has its own ID, Page_ID, Name, Slug, Locale, Description Act.

My problem is that I have only data that can be specifically chosen from page_translated (combination of slug and locale). If I had to type a different query to choose a translation of page_ID form pages by specifying the slip and locale, I would get 1 result. Then I'll search from that page_id in the table of pages and get a result again. I want to get it in 1 query. Is this also possible? Whenever I put a query in the cake without unconditional on the main table, it always says:

pages_translated from WHERE pages_translated .locale = eng and pages_translated.slug = 'Www.mypage.com' and pages_translated.page_id` = (1)

in the last part where page_ id = 1 breaks everything, but I think the cake keeps it there To make sure that only 1 row is selected, how can I direct it, so this final statement O writes?


mouseevent - mouseClicked() won't execute while mouse is in motion -


So basically the title says all this. I tried to search around; You will feel despised as something because it will have immediate results, but no.

Is it really annoying to me, can someone suggest suggestions or solutions? Thanks

That's because, by definition, there is no mouse click in motion while clicking a mouse , This is a drag event

You can still access mouse poked () and mouse release () events, so if you want to detect a mouse click during a drag event, then use them instead.

Here's a short example to get you started:

  zero moodlight () {println ("clicked"); } Press zero mouse () {println ("pressed"); } Zero mouse-related () {println ("release"); } Zero mouse dragged () {println ("scratched"); } Zero draw () {background (0); }  

SAPUI5 routing throws error "Control (ID of an App control) does not has an aggregation called pages" -


I have these routes in my component.js:

  Route: [Pattern: "Reports", Name: "Split Container": "" "," Name ":" Menu ", see:" Manual ": Target Page:" Page ", Target Control:" idAppControl ", Sub -Root: [{Pattern: "report", name: "report" (URL / # / report) throws applications (chrome) when I try to use sub-route (URL / # / report):  

Control the idAppControl Pages have no aggregation -

It is confused due to the fact that "idAppControl" is an app and there is a group page for it. In addition, the first "main" route is very good Works, even if I am using the same control (and aggregation) as above.

What can be wrong?

< Div class = "post-text" itemprop = "text">

I found out what's wrong. This is a little "scope" problem. You can not join the same control. You can create the following error message with the same problem:

The control with id idAppControl was not found

The goal is: "Page", Target Control: "idAppControl"}, ["Pattern:", "Name": "Menu", see: "Menu", GoalAggrisition: "Page" {Pattern: "Report", Name: "Report", see: "Split Continent", GoalAugrasion: "Page", Target Control: "idAppControl", Clear Goal: Correct}]

Behind the things it seems logical: D


spring - Sprint Date Rest successful, but no data -


इकाई

  @ Data @ accessators (श्रृंखला = सच, धाराप्रवाह = सच) @ एंटीटी @Table (name = "T_NOTE") @Access (AccessType.FIELD) सार्वजनिक वर्ग नोट Serializable लागू {@Id @GeneratedValue निजी लांग आईडी; निजी तिथि; @ स्तंभ (लंबाई = 2000) निजी स्ट्रिंग सामग्री; निजी स्ट्रिंग शीर्षक; निजी स्ट्रिंग मौसम; }  

रिपॉजिटरी

<पूर्व> @RepositoryRestResource (collectionResourceRel = "नोट", पथ = "नोट") सार्वजनिक इंटरफ़ेस नोटरिपॉझिटरी AbstractRepository विस्तारित & lt; नोट, लोंग & gt; {}

प्राप्त करें

  {"_links": {"self": {"href": "http: // localhost: 8080 / note / 2}}}}  

कोई इकाई फ़ील्ड डेटा नहीं है, क्यों?

ईआईडीटी

मैं मानक सेटर जोड़ने के बाद / गेटेर, सब कुछ ठीक है अब।

  सार्वजनिक लाँग आईआईडी () {वापसी आईडी; } सार्वजनिक शून्य सेट आईडी (लांग आईडी) {this.id = id; } सार्वजनिक तिथि getDate () {वापसी की तारीख; } सार्वजनिक शून्य सेट डेट (तारीख की तारीख) {this.date = date; } सार्वजनिक स्ट्रिंग getContent () {वापसी सामग्री; } सार्वजनिक शून्य सेट कंटेंट (स्ट्रिंग सामग्री) {this.content = content; } सार्वजनिक स्ट्रिंग getTitle () {वापसी शीर्षक; } सार्वजनिक शून्य सेटटाइटल (स्ट्रिंग शीर्षक) {this.title = title; } सार्वजनिक स्ट्रिंग getWeather () {वापस मौसम; } सार्वजनिक शून्य सेट मौसम (स्ट्रिंग मौसम) {this.weather = मौसम; }  

क्या जैक्सन मैपर द्वारा यह कारण है? मैं इस के साथ धाराप्रवाह एपीआई का उपयोग कैसे कर सकता हूं? JSON उत्पन्न करने के लिए प्रतिबिंब का उपयोग क्यों न करें?

संपादित करें

मुझे इसकी आवश्यकता है

  @ कॉन्फिगरेशन @ आयात (रिपोजिटरी आरएस्टएमवीसी कॉन्फिगरेशन.क्लास) पब्लिक क्लास शोएआरआरएस्टएमवीसी कॉन्फ़िगरेशन रिपोजिटरी आरएस्टएमवीसी कॉन्फिगरेशन विस्तारित करता है {@ ओवरराइड संरक्षित वायर्ड कॉन्फ़िगर जेकसनऑब्जेक्ट मैपरपर (मैपपर। Mapper.setVisibility (PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); }}  

@ एसेसर्स < / कोड> शायद @ डेटा एनोटेशन पर कदम रख रहा है, और धाराप्रवाह = सच के साथ यह एक ही नाम के साथ गेटर्स को फ़ील्ड के रूप में बनाता है, जैसे id () < / कोड> और दिनांक () ()। यही कारण है कि स्प्रिंग किसी भी क्षेत्र को नहीं देखता है।

मुझे लगता है कि आप सुरक्षित रूप से दोनों @ एसेटर्स और @Access को हटा सकते हैं, क्योंकि @ प्रवेश 'से आईडी से डिफ़ॉल्ट मान लेता है (यदि आप क्षेत्र को एनोटेट करते हैं, तो यह FIELD होगा, यदि आप प्राप्तकर्ता का एनोटेट करते हैं, तो यह < कोड> प्रॉपर्टी )।


java - Regex Match Word with special character -


I want to see a word in a file that contains dates and percentages and some strings like the different notifications.

Input:

  21-02-2015 The word A22 word B word:  

Result:

  word a word b wordC  

Please help me because I'm new to regex.

Supports the regex implementation of Java, for which this is a textbook used for use.

[\ w & amp; Amp; [^ \ D]] Thus a word corresponds to the character, but not the numbers, it should match the 'special character'.

Thus this code:

  import java.util.regex.Matcher; Import java.util.regex.Pattern; Class test {public static zero main (string ... args) {string input = "21-02-2015 word A22 word be word sea differences"; Matcher matcher = Pattern.compile ("[\\ w and [^ \\ d]] +", pattern. UNICODE_CHARACTER_CLASS) .Misper (input); While (matcher.find ()) {System.out.println (matcher.group ()); }}}  

produces:

  word a word word forwards  

highmaps - How to transform a point with latitude and longitude value to a coordinates in highcharts map? -


There is an option 'HC-transform' in highmap metadata, can anyone explain how to use it?

I used the default China map Geodata in the highmap but now I want to add a new point, for example [latitude, loan] [121,23], I want to know that I How to change in any coordination

  "CRS": {"type": "name", "property": {"name": "vase: OGC: def: CRS: EPSG: 3415"}}, "hc "": {"Cn-all": {"xpan": 350, "ypan": 25, "hitZone": {"type": "polygon", "coordinate": [[[7902,3046], [ 7929,3041], [794, 3014], [79152929]]]}, "CRS": "+ proj = tmerc + lat_0 = 49 + lon_0 = -2 + K = 0.999 6012717 + x_0 = 400000 + y_0 = -100,000 + ellps = airy + toWGS84 = 446.448, -125.157,542.06,0.15,0.247,0.842, -20.489 + units = m + vunits = me + no_defs "," scale ": 0.0,00,12, 9 83 1107685, "jsonres": 15.5, "jsonmarginX": -999, "jsonmarginY": 9851.0, "xoffset": -31,3 9, 9 37.4930, "yoffset": 43,58, 9 72.7,486}} < / Code> 

Here's what I do.

  var transform = Highcharts.maps ['countries / cn / cn-all'] ['HC-transform'] ['default']; Var position = $ ("chart"). High Chart (). TransformalLetton ({lat: 121, lon: 23}, transform); Console.log (status); // {x: NaN, y: NaN}  

Am I wrong in the 'HC-Transform' setting? How do I make a case


html - How to make the background color animate of an element? -


I'm trying to run colors (or background images) again, but this does not seem to work . I have tried the following, but it only changes once and does not release.

 . Landing-background {background color: red; Webkit-Animation-Name: Example; / * Chrome, Safari, Opera * / -WebKit-Animation-Duration: 4S; / * Chrome, Safari, Opera * / Animation-name: Example; Animation-period: 4s; Animation-repetition-count: infinity; } / * Chrome, Safari, Opera * / @ -WebKit-keyframe example {0% {background color: red; } 25% {background-color: yellow; } 50% {background-color: blue; } 75% {background color: green; } 100% {background-color: red; }} / * Standard syntax * / @ keyframe example {0% {background color: red; } 25% {background-color: yellow; } 50% {background-color: blue; } 75% {background color: green; } 100% {background-color: red; }}  

You are probably using another browser in comparison to Internet Explorer . Try adding:

  - Webkit-animation-repetition-count: infinite; / * Chrome, Safari, Opera * /  

EDIT:
Browse browsers to support prefixed (prefixed). Nowadays each browser supports it without the prefix, although not everyone has updated their browser. Probably the prefix is ​​completely safe to remove in mid-2017.


.net - Getting X509SerialNumber integer value from X509Certificate2 -


I am trying to receive a X509.v3 evidence (as I X50 9Certificate2 object) Serial Number It is an XML signature created by another software working with a lot of certificates, and it has a serial number of X509 serial number element in XADDC XML, which is considered to be an integer. Is:

  & lt; Ks509SerialNumber xmlns = "http: //wwwkv3 org / 2000/09 / Ksmldasing #" & gt; 1315010063538360283821765366094690 & lt; / X509SerialNumber & gt;  

Unfortunately, I assume it would be unable to get out of X509Certificate2 object that has been started with the certificate used to sign the above XML. The value that I get

  X509 Certificate 2-> SerialNumber = "40D5C2ADDEFD92740000000B9B62" X509Certificate2- & gt; GetSerialNumber () = "40D5C2ADDEFD92740000000B9B62" Convert :: ToBase64String (X509Certificate2- & gt; GetSerialNumber ()) = "YpsLAAAAdJL93q3C1UA ="  

I GetSerialNumber () Returns a Base64String . As you can see, GetSerialNumber () and GetSerialNumber () return different values, out of these values ​​"131501006353836028382121366366094690" what is the way to get an integer value ?

Something like this should work:

  var serialHexString = "40D5C2ADDEFD92740000000B9B62 "; Var serial = Bigintegrkprs (Siriylhaksstring, number Stailkhaksonnbr);  

c# - Error while loading XmlDocument - IOException: unknown user name or bad password -


I have a network resource, an XML file on which I have full access, in fact I open that file in Notepad I can change content as well.

But when I access the XML file through the XmlDocument.Load () statement, by running an XE under my default window credentials, this error fails below.

  System.IO.IOException: Logon failure: unknown username or bad password System.IO .__ Error.WinIOError (Int32 errorCode, String maybeFullPath) on System.IO.FileStream.Init (string path, FileMode mode, using FileAccess, Int32 rights, Boolean useRights, fileshare share, Int32 BufferSize, FileOptions options, secAttrs SECURITY_ATTRIBUTES, string msgPath, Boolean bFromProxy, Boolean useLongPath) (string path System.IO.FileStream..ctor, use FileMode mode, FileAccess, fileshare stock, System.Xml.XmlDownloadManager.GetStream on Int32 BufferSize) (Uri uri, ICredentials System.Hreading.CompressedStack.RunTr credentials, System.Xml.XmlTextReaderImpl.OpenUrlDelegate IWebProxy Proxy on RequestCachePolicy Cache Policy System on System.Xml.XmlUrlResolver.GetEntity (URI absoluteUri, string role, type object object) on yCode (Object UserData) system. Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode Code, CleanupCode backoutCode, UserData object) on System.Threading.CompressedStack.Run (CompressedS nail compressedStack, ContextCallback callback, object state) SystemkXmlkXmlTextReaderImplkOpenUrl (on System.Xml.XmlTextReaderImpl.Read system ()) on System.Xml.XmlLoader.Load (XmlDocument Dock, XmlReader Reader, Boolean preserveWhitespace). System.Xml.XmlDocument.Load (string filename) on Xml.XmlDocument.Load (XmlReader reader)  

I do not know what could be wrong here all my same authorization people Exe can run fine.


java - JDBC - Connection extremely slow on Windows, Fine on Linux -


By using JDBC to connect to SQL Server on a Windows Server 2008 computer, I ran into an extremely confusing problem

Using Microsoft's JDBC driver and JTDS, it works very well on my Linux laptop, but when executing the application on a device running Windows, then executing a single SQL command It takes 4 to 10 seconds!

I have tried to connect all of the following technologies to the database server, almost all Linux is fast and very slow on Windows, using the JTD data source, I have learned that it is on Windows 8 Works fine, but when I go to a computer on a computer (Windows Server), it always slows down the code.

  // = ============== jTDS JtdsDataSource DS = New JtdsDataSource (); Ds.setUser (DB_USERNAME); Ds.setPassword (DB_PASSWORD); Ds.setServerName (SERVER_ADDRESS); Ds.setPortNumber (SERVER_PORT); Ds.setDatabaseName (Database_Name); Ds.setLoginTimeout (server.SQL_LOGIN_TIMEOUT); Try {_Conn_ = ds.getConnection (); } Hold (SQLException e) {e.printstaxtrace (); return false; } // ============== Try Microsoft {string connectionRuril = string.format ("jdbc: sqlserver: //% s:% d;" + "database name =% s ; "+" Ssl = require ", SERVER_ADDRESS, SERVER_PORT, DATABASE_NAME); Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver"); This._conn_ = DriverManager.getConnection (connectionUrl, DB_USERNAME, DB_PASSWORD); } Grip (Klassnotfound Expression E) {e.printStackTrace (); Throw New Runtime Exception ("JDBC Not Loaded"); } Hold (SQLException e) {e.printstaxtrace (); return false; } // =============== Apache string connection = "jdbc: sqlserver: //" + SERVER_ADDRESS + "; database =" + DATABASE_NAME + "; integrated security = false;"; String jtdsConnectionUrl = "jdbc: jtds: sqlserver: //" + SERVER_ADDRESS + ":" + SERVER_PORT + "/" + DATABASE_NAME + ""; Connectionfactory connectionfactor = new driver managerconnectfactor (jtdsConnectionUrl, DB_USERNAME, DB_PASSWORD); Poolable Connectivity Fittering Console Connection Factor = New PoolBal Connection Fitterator (Connection Faner, Empty); PoolableConnectionFactory.setDefaultAutoCommit (true); PoolableConnectionFactory.setDefaultReadOnly (incorrect); GenericObjectPool connectionpool = new GenericObjectPool (poolableConnectionFactory); PoolableConnectionFactory.setPool (connectionPool); This.pooledDataSource = New PoolingDataSource (connectionPool);  

It's already a week, I'm stuck on it, any help is appreciated.

Good, this is not really the right solution, but works a few hours after working on it And after almost everything (writing a custom connection pool to use Apache DBC), I came to know that the problem begins, after a TCP connection to my server

I realized that Do I reconnect with each connection made from server to SQL database Class I, too slow behavior just does not happen so fast, this is a transaction which is almost that takes 50 seconds instead of 5 seconds is good enough.

I do not even know why this happens and my condition is in the Windows Server or VMWire network bug because this behavior changes by changing the platform. I hope it helps if someone else is facing the same problem.


angularjs - Html angular intellisense in visualstudio -



angularjs - Html angular intellisense in visualstudio -

i wondering how intellisense angular on html pages in visual studio 2013 update 3

i can intellisense js pages using _references.js. to able reference controllers , properties in html quicker coding.

so if have

ng-controller=""

i able references controllers have created.

also in ng-repeat. if have created

ng-repeat="foo in vm.foos"

i intellisense able pick properties foo utilize

{{foo.fooproperty}}

is possible?

i have web essentials 2013 update 3, not functionality. thinking of moving webstorm ide because has built in prefer have in visual studio

updated 2/16/2016 added comments , attribute type examples

this hack visual studio's own internal files, beware when upgrading visual studios.

by editing html.xsd file, can add together custom directives, directive attributes, , directive attribute value options.

copy , paste location in windows explorer location bar:

location visual studio 2013

c:\program files (x86)\microsoft visual studio 12.0\common7\ide\commonextensions\microsoft\web\schemas\1033\html

location visual studio 2015

c:\program files (x86)\microsoft visual studio 14.0\common7\ide\extensions\microsoft\web tools\schemas\1033\html

make re-create of html.xsd file , backup new location.

look line @ around 103 begins:

class="lang-xml prettyprint-override"><xsd:group name="flowcontent"> <xsd:choice> <!-- add together references custom elements here--> <xsd:element ref="my-simple-directive" /> <xsd:element ref="my-complex-directive" /> <xsd:element ref="a" /> <xsd:element ref="abbr" /> <xsd:element ref="acronym" /> ...

then farther down, before closing tag, add together element definitions each of directives.

class="lang-xml prettyprint-override"><!-- basic custom element--> <xsd:element name="my-simple-directive" vs:description="108"> <xsd:complextype> <xsd:choice> <xsd:group ref="flowcontent" /> <xsd:group ref="phrasingcontent" /> </xsd:choice> <xsd:attributegroup ref="commonattributegroup" /> </xsd:complextype> </xsd:element> <!-- define few attribute types want utilize in our fancy element example. --> <!-- create type enumerate values of attribute --> <xsd:simpletype name="scopevalues"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="these items" /> <xsd:enumeration value="show in scope option" /> <xsd:enumeration value="dropdown in visual studio" /> </xsd:restriction> </xsd:simpletype> <!-- define allowed icons icon attribute --> <xsd:simpletype name="myicons"> <xsd:restriction base="xsd:nmtoken"> <xsd:enumeration value="pause" /> <xsd:enumeration value="play" /> <xsd:enumeration value="rewind" /> </xsd:restriction> </xsd:simpletype> <!-- define attribute groups maintain code dry --> <xsd:attributegroup name="iusethesescopevaluesalot"> <xsd:attribute name="isbusy" type="xsd:boolean" /> <xsd:attribute name="icon" type="myicons" /> <xsd:attribute name="isdisabled" type="xsd:boolean" vs:icon="myicon.png" /> </xsd:attributegroup> <!-- element custom attributes--> <xsd:element name="my-complex-directive" vs:description="108" vs:icon="my16x16pxicon.png"> <xsd:complextype> <xsd:choice> <xsd:group ref="flowcontent" /> <xsd:group ref="phrasingcontent" /> </xsd:choice> <!-- attribute grouping references mutual attributes "id" "class", etc. our custom element --> <xsd:attributegroup ref="commonattributegroup" /> <!-- can define own custom attribute grouping --> <xsd:attributegroup ref="iusethesescopevaluesalot" /> <!-- define more properties on scope --> <xsd:attribute name="directive-scope" /> <!-- hint scope value must boolean --> <xsd:attribute name="isdisabled" type="xsd:boolean" /> <!-- can define own often-used attribute types --> <xsd:attribute name="icon" type="myicons" vs:icon="icomoon.png" /> <!-- or define them inline --> <xsd:attribute name="mydropdown1" vs:multivalue="true"> <xsd:simpletype> <xsd:restriction base="xsd:string"> <xsd:enumeration value="these items" /> <xsd:enumeration value="show in scope option" /> <xsd:enumeration value="dropdown in visual studio" /> </xsd:restriction> </xsd:simpletype> </xsd:attribute> <!-- enumerates same value options attribute mydropdown1, we've pointed reference --> <xsd:attribute name="mydropdown2" type="scopevalues" /> </xsd:complextype> </xsd:element>

as cherry-on-top, can add together vs:icon="mycustomicon.png" each attribute or element own icon in dropdown, place 16x16px png in 1033\html folder (the same folder updated html.xsd).

i found had restart visual studio twice these take. , create sure provide administrator rights when re-create new files or save new files programme files directory. if don't administrator warning, either you've disabled them, or something's not quite right. in setup found wasn't able save straight 1033\html folder, had drag files folder after saving in folder outside "program files" folder.

angularjs visual-studio intellisense

rest - EXTJS model idProperty field populated with model name? -



rest - EXTJS model idProperty field populated with model name? -

i trying create simple extjs5 app against restful rubyonrails backend. reason when instantiate model extjs populates "idproperty" field name of model (and counter). e.g.

{"traffic_id":"myapp.model.person-1","external_id":0,...

i thought "idproperty" field primary key of info record , set when record inserted in db (autoincrement)

so field should null or similar model has yet added store , syncd backend.

whats more amaising field defined 'int' , extjs puts string in it!

can tell me going on?

peter

below app.js fiddle with:

ext.application({ name : 'fiddle', launch : function() { var model = ext.create('myapp.model.person'); ext.msg.alert('fiddle', json.stringify(model.data)); } }); ext.define('myapp.model.person', { extend: 'ext.data.model', idproperty: 'traffic_id', proxy: { type: 'rest', // url: '/traffics.json', format: 'json', api: { create: 'traffics', read: 'traffics', update: 'traffics/edit', destroy: 'traffics' }, reader: { type: 'json', rootproperty: 'traffic', successproperty: 'success', messageproperty: 'message' }, writer: { type: 'json', //writeallfields : false, //encode: true, rootproperty: 'traffic' }, afterrequest: function(req, res) { console.log("ahoy!", req.operation.response); }, listeners: { exception: function(proxy, response, operation) { //debugger; ext.messagebox.show({ title: 'xxx remote exception', msg: operation.geterror(), icon: ext.messagebox.error, buttons: ext.msg.ok }); } } }, fields: [{ name: 'traffic_id', type: 'int' }, { name: 'external_id', type: 'int' }, { name: 'description', type: 'string' }, { name: 'insertuser', type: 'string' }, { name: 'insertdate', type: 'date' }] });

extjs assigns "provisional" id newly created models; can distinguish between models have been created client side have not yet been saved ("phantom" models) vs ones have been downloaded. such, knows when phone call create vs update, , (i think, memory) delete id when uploading create rest endpoint.

it needs id newly-created model can go stores (e.g. session, if nil else).

the style of id see default sequential generator.

see http://docs.sencha.com/extjs/5.0/apidocs/#!/api/ext.data.identifier.generator more.

rest extjs5

amazon ec2 - How do I leave Node.js server on EC2 running forever? -



amazon ec2 - How do I leave Node.js server on EC2 running forever? -

as can tell question, i'm new this...

i built first website, set first node.js server serve , pushed live on ec2.

i tested on ec2 ip address , seems working.

now until now, i've been testing app locally makes sense whenever closed terminal, app.js stop running nil served on localhost.

now server on ec2, same thing happens ("obviously" 1 say..) whenever close terminal.

so question how maintain node.js server running on ec2 like... forever..so site stays live.. forever :)

i read node module called "forever" i'm wondering (being new , all..) why isn't "forever" functionality default setting of node.js-ec2 scheme ?

i mean, right me if i'm wrong, isn't whole point of setting web server , pushing live have remain live forever? isn't servers supposed anyway (infinitely listening requests) ? , if that's case why need modules/settings accomplish ?

thanks help.. can tell i'm not looking solution explanation because got confused.. :-)

edit (a few details might need) - after installing app on ec2 these steps follow on terminal (the app running on amazon linux way) :

i type ssh -i xxxxxxxxxxx.pem ec2-user@ec2-xx-xx-xx-x.eu-west-1.compute.amazonaws.com on terminal

after logging onto amazon machine go relevant folder , execute node app.js

there 3 folders in machine : node, node_modules , *name of app*

app.js resides in *name of app*

after that, site goes live on ec2 ip

once close terminal, switched off

before invoke node.js, run command:

screen

this create persistent environment allow process maintain running after disconnect.

when reconnect, can utilize screen -r reconnect environment.

here's random link larn more screen:

http://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

however, won't help if ec2 instance restarts. there many different ways that. adding startup command /etc/rc.local 1 way. here's link amazon guide includes adding /etc/rc.local.

http://docs.aws.amazon.com/awsec2/latest/userguide/building-shared-amis.html

hope helps,

james

node.js amazon-ec2 webserver

ios - how to undo the line draw using CGContextAddLineToPoint? -



ios - how to undo the line draw using CGContextAddLineToPoint? -

i'm developing 1 brush application freehand drwing , i'm new in core graphics framework.

right application ready drawing using below code

override func touchesbegan(touches: nsset!, withevent event: uievent!) { println("enter in touchesbegan method"); mouseswiped = false; var touch : uitouch = touches.anyobject() uitouch; lastpoint = touch.locationinview(self.view); } override func touchesmoved(touches: nsset!, withevent event: uievent!) { println("enter in touchesmoved method"); mouseswiped = true; var touch : uitouch = touches.anyobject() uitouch; var currentpoint : cgpoint = touch.locationinview(self.view); uigraphicsbeginimagecontext(self.view.frame.size); self.tempdrawimage!.image?.drawinrect(cgrect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height)); println("lastpoint.x :\(lastpoint!.x) , lastpoint.y :\(lastpoint!.y)") cgcontextmovetopoint(uigraphicsgetcurrentcontext(), lastpoint!.x, lastpoint!.y); println("currentpoint.x :\(currentpoint.x) , currentpoint.y :\(currentpoint.y)") cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), currentpoint.x, currentpoint.y); cgcontextsetlinecap(uigraphicsgetcurrentcontext(), kcglinecapround); cgcontextsetrgbstrokecolor(uigraphicsgetcurrentcontext(), red!, green!, blue!, 1.0) cgcontextsetlinewidth(uigraphicsgetcurrentcontext(), brush!); cgcontextsetblendmode(uigraphicsgetcurrentcontext(), kcgblendmodenormal); cgcontextstrokepath(uigraphicsgetcurrentcontext()); //contexts!.addobject(uigraphicsgetcurrentcontext()); self.tempdrawimage!.image = uigraphicsgetimagefromcurrentimagecontext(); tempdrawimage!.alpha = opacity!; uigraphicsendimagecontext(); println("dot"); lastpoint = currentpoint; } override func touchesended(touches: nsset!, withevent event: uievent!) { println("enter in touchesended method"); if mouseswiped == false { println("false"); uigraphicsbeginimagecontext(self.view.frame.size); self.tempdrawimage!.image?.drawinrect(cgrect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height)); cgcontextsetlinecap(uigraphicsgetcurrentcontext(), kcglinecapround); cgcontextsetlinewidth(uigraphicsgetcurrentcontext(), brush!); cgcontextsetrgbstrokecolor(uigraphicsgetcurrentcontext(), red!, green!, blue!, opacity!); cgcontextmovetopoint(uigraphicsgetcurrentcontext(), lastpoint!.x, lastpoint!.y); cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), lastpoint!.x, lastpoint!.y); cgcontextstrokepath(uigraphicsgetcurrentcontext()) cgcontextflush(uigraphicsgetcurrentcontext()); self.tempdrawimage!.image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); } uigraphicsbeginimagecontext(self.mainimage!.frame.size); self.mainimage!.image?.drawinrect(cgrect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height ), blendmode: kcgblendmodenormal, alpha: 1.0); self.tempdrawimage!.image.drawinrect(cgrect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height), blendmode: kcgblendmodenormal, alpha: opacity!); self.mainimage!.image = uigraphicsgetimagefromcurrentimagecontext(); self.tempdrawimage!.image = nil uigraphicsendimagecontext(); }

but in application see give undo functionality in application want give facility if utilize draw 2 line , press undo button lastly added line remove 1 1 image view

i searched can't understand , none of reply accepted i'm confused please help me.

thank you!

in situation since adding lines becomes simple. need create mutable array contain points user input.

now on every touches begin or whatever utilize in end create nsvalue point got in code , add together value array mentioned previously. after added line need phone call "refresh" method or rather yet tell view redisplay using setneedsdisplay trigger draw rect method called. rest of code moved method...

now in target undo button remove lastly 2 points array (i hope no problem here) , phone call refresh or redisplay (same on touch event).

so either move drawing code "refresh" method or "draw rect" need first clear context background, iterate through array of points , draw each of line.

simple enough?

ios core-graphics cgcontext

matlab - How to obtain the number of discontinuities -



matlab - How to obtain the number of discontinuities -

suppose sawtooth function (or other periodic function discontinuities). want obtain number of discontinuities in function stated range.

for example, looking @ figure at

i should scalar result of 2 since there 2 discontinuities plotted in range.

does knows how that?

cheers, felipe.

it's question consider discontinuity. need threshold define that. can utilize next yoursignal (variable name of data)

occ = sum( abs( diff( yoursignal ) ) > threshold )

matlab signal-processing

w3c validation - "The frameborder attribute on the iframe element is obsolete. Use CSS instead." -



w3c validation - "The frameborder attribute on the iframe element is obsolete. Use CSS instead." -

i'm trying validate website w3c validator doesn't work. have youtube iframe , error:

the frameborder attribute on iframe element obsolete. utilize css instead.

screenshot: http://i.stack.imgur.com/vcijv.png

and index.html (cropped):

<!-- video --> <div class="video-container box-size"> <iframe width="700" height="312" src="http://www.youtube.com/embed/ofupsnatzmi" frameborder="0" allowfullscreen></iframe> </div>

how can right it?

as state "the frameborder attribute not supported in html5. utilize css instead."

the equivalent of frameborder in css border: 0px;. add together iframe in css.

iframe w3c-validation

ios - Restkit is freezing -



ios - Restkit is freezing -

i have bug under ios 8 freezes iphone app. during loading info backend using restkit don't know why code in :getobjectsatpath method not executed. i'm assuming there should returned code success or failure block of method. looks rest kit trying info backend can see network activity indicator spinner still active. have no thought how perchance investigate issue because xcode not homecoming error. app still working can't tap on button jump parent view.

-(void)loadalerts{ _credentials = [[efcredentials alloc]init]; nsstring *remembertoken = [_credentials authtoken]; if ([efreachabilitymanager isreachable]) { [[[rkobjectmanager sharedmanager]httpclient]setdefaultheader:@"authorize" value:remembertoken]; rkresponsedescriptor *responsedescriptor = [rkresponsedescriptor responsedescriptorwithmapping:[efmappingprovider alertsmapping] method:rkrequestmethodget pathpattern:[nsstring stringwithformat:@"/%@/alerts.json",_id] keypath:nil statuscodes:rkstatuscodeindexsetforclass(rkstatuscodeclasssuccessful)]; [[rkobjectmanager sharedmanager]addresponsedescriptor:responsedescriptor]; [[rkobjectmanager sharedmanager] getobjectsatpath:[nsstring stringwithformat:@"/wearers/%@/alerts.json",_wearer_id] parameters:nil success:^(rkobjectrequestoperation *operation, rkmappingresult *mappingresult){ nslog(@"%@",mappingresult.array); [self.tableview reloaddata]; } failure:^(rkobjectrequestoperation *operation, nserror *error) { uialertview *alertview = [[uialertview alloc] initwithtitle:@"error" message:[error localizeddescription] delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alertview show]; } ]; } else{ _alertviewreachability = [[uialertview alloc]initwithtitle:@"error" message:@"no network connection " delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"try again", nil]; [_alertviewreachability show]; }

}

libsystem_kernel.dylib`semaphore_wait_trap: 0x196954eb0: movn x16, #35

0x196954eb4: svc #128

0x196954eb8: ret

it looks possible deadlock. refreshdata: method in efalertshistorytvc responding notification. perhaps in method waiting synchronously info won't available until method returns.

ios ios8 restkit

Using image in place of Rectangle in Java? -



Using image in place of Rectangle in Java? -

it's first time trying create 2d game in java , made little 8-bit character want set in place of rectangle appears on screen. can't quite understand how .png image rectangle's place, or how go making character, in case, image saved hard drive. thanks!

import javax.swing.*; import java.awt.*; import java.awt.event.keyadapter; import java.awt.event.keyevent; public class keying extends jpanel { public rectangle character; public int charw = 24; public int charh = 36; public boolean right = false; public boolean left = false; public boolean = false; public boolean downwards = false; public keying(display f, images i) { character = new rectangle(180, 180, charw, charh); f.addkeylistener(new keyadapter() { public void keypressed(keyevent e) { if (e.getkeycode() == keyevent.vk_d) { right = true; } if (e.getkeycode() == keyevent.vk_a) { left = true; } if (e.getkeycode() == keyevent.vk_s) { downwards = true; } if (e.getkeycode() == keyevent.vk_w) { = true; } } public void keyreleased(keyevent e) { if (e.getkeycode() == keyevent.vk_d) { right = false; } if (e.getkeycode() == keyevent.vk_a) { left = false; } if (e.getkeycode() == keyevent.vk_s) { downwards = false; } if (e.getkeycode() == keyevent.vk_w) { = false; } } }); } public void paintcomponent(graphics g) { super.paintcomponent(g); this.setbackground(color.white); g.setcolor(color.black); g.fillrect(character.x, character.y, character.width, character.height); if (right) { character.x += 1; } if (left) { character.x -= 1; } if (down) { character.y += 1; } if (up) { character.y -= 1; } repaint(); } }

the process relatively simple...

start loading character image...

public class keying extends jpanel { //public rectangle character; private java.awt.bufferedimage character; private java.awt.point characterlocation; //... public keying(display f, images i) throws ioexception { character = javax.imageio.read(...); characterlocation = new point(0, 0); //...

see reading/loading image more details...

then, want paint character image...

@override protected void paintcomponent(graphics g) { g.drawimage(character, characterlocaiton.x, characterlocation.y, this);

advice

avoid keylistener, it's prone focus issues don't want deal with. instead utilize key bindings, see how utilize key bindings more details avoid putting logic within of paint routines, painting can occur @ time, many of don't control, have character moving in directions don't expect or faster should. instead, belongs within main game loop responsible updating state , scheduling paint requests. never alter state of component within paint method, cause infinite loop of paint requests, consume systems resources. within context, don't phone call setbackground (by time phone call this, background has been painted anyway) or repaint

java