Monday, 15 August 2011

symfony - Symfony2 - I can't get gmail mail transport get to work ... authentication fails -


I have a mailer configuration but when I am sending an email with a custom symphonic console command, I am getting this error: [2015-03-16 20:38:09] APIR: An exception occurred when flipping the email queue: Username "?????????" Failed to authenticate on SMTP server with. Using 1 possible authenticator

I tried two Gmail accounts for authenticity but no luck ... any idea what's wrong here?

Hull: The problem was ... I only enabled it ...

"post-text" itemprop = "text">

@ David Marco Credit:

P> You have to either upgrade to a more secure app that uses the most up-to-date security measures All Google products, such as Gmail, Use the latest security measures. ()

Or allow less secure apps and select "Allow" to allow at least secure apps to access their Google account. We do not recommend this option because it can make it easier for anyone to gain access to your account.

Source:


javascript - Cannot read property 'replace' of undefined - replacing text in JS generated HTML -


मेरी एक अनोर्ड सूची ( ul ) है जो बाहरी जावास्क्रिप्ट द्वारा उत्पन्न होती है। प्रत्येक सूची वस्तु में एक दोहराई गई पंक्ति है जो मैं हटाना चाहूंगा क्योंकि मैं बाहरी जावास्क्रिप्ट को संशोधित नहीं कर सकता, मैं प्रतिस्थापन पद्धति का उपयोग करने का प्रयास कर रहा हूं। सूची को प्रत्येक li तत्व को दिए गए वर्ग द्वारा पहचाना जाता है; आरएसएस-आइटम

निम्नलिखित मेरा कोड है:

  & lt; स्क्रिप्ट & gt; फ़ंक्शन myFunction () {var str = document.getElementsByClassName ('आरएसएस-आइटम')। InnerHTML; Var res = str.replace ('को बदलने के लिए पाठ', ''); Document.getElementsByClassName ('आरएसएस-आइटम')। InnerHTML = res; } & Lt; / script & gt; & Lt; बटन onclick = "myfunction ()" & gt; बदलें & lt; / बटन & gt;  

निम्न पंक्ति पर त्रुटि उत्पन्न हो रही है:

  var res = str.replace ('प्रतिस्थापित करने के लिए टेक्स्ट', '');  

त्रुटि बताती है:

  अनक्यूट टाइप एरर: अपरिवर्तित  

की संपत्ति को 'प्रतिस्थापित' नहीं पढ़ा सकता है I समझो, यह शायद इसका अर्थ है कि जावास्क्रिप्ट क्लास के नाम 'आरएसएस-मद' के साथ तत्व को नहीं खोज रहा है, या मैं पाठ बदलने की कोशिश कर रहा हूं। मैं पूरी तरह से निश्चित हूं कि यह सही वर्ग का नाम है, और यह पाठ वास्तव में वहां बदलने की कोशिश कर रहा है। क्या यह समस्या आ रही है क्योंकि जावास्क्रिप्ट द्वारा मार्कअप उत्पन्न किया जा रहा है? मैं एक मृत अंत में आया हूँ

document.getElementsByClassName ('आरएसएस-आइटम') एक सरणी- वस्तु (ए) की तरह यदि आप पहले तत्व चाहते हैं, तो आपको इसके लिए पूछना चाहिए:

  var str = document.getElementsByClassName ('rss-item') [0]। WinnerHTML;  

यदि आप थोड़ा और अधिक रक्षात्मक होना चाहते हैं, तो वास्तव में यह जाँच कर लायक हो सकता है कि किसी भी तत्व को इस तरह से उपयोग किया गया है:

  var तत्व = दस्तावेज़.getElementsByClassName ('आरएसएस-आइटम'); यदि (elements.length & gt; 0) {तत्वों [0]। WinnerHTML = तत्व [0]। WinnerHTML.replace ('को बदलने के लिए पाठ', ''); }  

जैसा कि आप टिप्पणियों में सुझाव दिया है, आप पाए गए सभी तत्वों पर प्रतिस्थापन कर सकते हैं। इस मामले में, आप इस तरह के तत्वों के माध्यम से लूप कर सकते हैं:

  var तत्व = document.getElementsByClassName ('rss-item'); के लिए (var i = 0; i & lt; elements.length; ++ i) {तत्व [i] .innerHTML = तत्व [i]। WinnerHTML.replace ('को बदलने के लिए पाठ', ''); }  

testing - How do I create an Arbitrary for a System.Type? -


I am trying to start my model organizations using FsCheck. Models live in C # and typically begin through the unit framework through their own personal setters. For example (contrived):

  public class model {public string one {get; Private set; } Public int two {get; Private set; }}  

I want to create an FsCheck Generator which automatically uses the generator registered for each property's model. Something like this:

  model model maker = gene (event) = new model () type & lt; Model & gt; .GetProperties () | & Gt; Array.filter (funny p - & gt; p.CanWrite). & Gt; Array.iter (funny p -> NewVal = Arb.generateType p.PropertyType // I believe I can drink it. Set value (event, newwall)) event of return}  

Two things are wrong with it:

  1. Come on! can not be used outside the gene computing expression.
  2. Arb.generateType is not present, and I can not find any way to equal it

Is it possible to make this generator automatic Will you set a private field on your model?

With the power of reflection, everything is possible (or throws at runtime).

  module array = open system. Reflection // This is just a helpful type on which there is reflection. Type Internal GenerateInvoker = Fixed Member Invitation & lt; 'Typ & gt; () = Generate billion & lt; 'Typ & gt; | & Gt; Gen.map box // invokes a common method using a runtime type as the normal sequence. Type typed type (type: type) = typhus & lt; GenerateInvoker & gt; .GetMethod ("Invoke", Binding Flex. Static ||| Binding Falges Nonpolic). Mascogenic Meth ([| type |]). Invoke (empty, [||]):? & Gt; General's & lt; Obj & gt; Model Generator = Gin (Give Event = Enter New Model) (Prop = Type ; GetProperties () | & gt; Array.filter (Fun p - & gt; p.CanWrite) // GEN Builder Implementation, so you can do something to support in Sahara! NewVal = Arb.generateType prop.PropertyType prop.SetValue (event, newVal) event of return} Gen.Sample 1 3 modelGenerator  < / Pre> 

video - FFMPEG Concat Dropping Frames -


I am using FFMPEG to do the following two things:

  • An MP 4 Create a set of images
  • Compile MP3 to make long video (MP3)

To create mp4s from images, I use the following command I do:

  ffmpeg -r 5 -i 'img% 03d.jpg' output.mp4  

As far as I know, this 5fps Creates a video with the framerate of

But when I try to compile MP4s, it seems that the frames are being dropped within each MP4.

To create compiled footage, I create a text file that points to all MP3s that should be included in the compilation, such as

  file 'set1 / Output.mp4 'file' set2 / output.mp4 'file' set3 / output.mp4 'file' set4 / output.mp4 'file' set5 / output.mp4 'file' set6 / output.mp4 'file' set7 / output. Mp4 '/ code>  

Then I run the following command:

  ffmpeg -f concat -i input.txt -codec copy compilation.mp4  

The resultant video leaves 2-3 frames with each output video

How do I ensure that the compiled video does not leave any frame?

(For reference, I have used the following tutorial :)

I was able to find work-charts using the following tutorial:

Instead of compiling MP3, I can point out all the image properties that are last The video file should be compiled in

I created a text file that looks like this:

  file 'set1 / img% 03d.jpg' file 'set2 / img% 03d.jpg' file ' Set3 / img% 03d.jpg 'file' set4 / img% 03d.jpg 'file' set5 /img%03d.jpg 'file' set6 / img% 03d.jpg 'file' set7 / img% 03d.jpg ' 

where naming conventions in each set folder are images with img001 jpg, img002.jpg, etc.

Then I can compile all the images in the final video using the following images:

  ffmpeg -f concat -r 5 -i Input.txt compilation.mp4  

java - How to catch null pointer exception by the right way -


I have implemented that method, which should be redirected to the personal page if the data and users with data in the database ID is successfully received, but if it is empty it must be redirected to the login page. How can handle empty exceptions in this method? The logged in for the logged in filter requires attention and thanks for your help!

  get public strings (user) (UserDao ud = new UserDao); SessionBean.setCurrentUser (ud.getSessionUserFromDb (Input Login, InputPassword)); Try {currentUserId = sessionBean.getCurrentUser () GetUserId (); } Hold (NullPointerException e) {System.out.print ("NullPointerException caught"); } If (currentUserId! = 0) {loggedIn = true; If (login = true) {System.out.println ("successfully logged in");} Return session bn.directPoseral (); } Else {FacesMessage msg = New FacesMessage ("Login Error!", "Error MSG"); Msg.setSeverity (FacesMessage.SEVERITY_ERROR); FacesContext.getCurrentInstance (). AddMessage (null, msg); Return session Bean.redirectToLogin (); }}  

should do this:

  If (sessionBean.getCurrentUser ()! = Null) {currentUserId = sessionBean.getCurrentUser (). GetUserId ()} and {System.out.println ("The current user is empty!"); }  

Improving bulk insert performance in Entity framework -


I want to insert 20000 records from an entity structure into an entity and it takes about 2 minutes. Is there any way other than using SP to improve its performance? This is my code:

  foreach (employee items in order) {t = new employee (); T. Text = item Text; DataContext.Employees.AddObject (t); } Datacontext Save Changes (); There is an opportunity for many improvements (if you are using  DbContext  then  

code>):

set Do:

  yourContext.configuration.AutoDetectChangesEnabled = false; YourContext.configuration.ValidateOnSaveEnabled = false; In the package of 100 codes, do  SaveChanges ()  do ... or you can try with 1000 items and see changes in performance. 

Because during all this insertion, the context is the same and it is getting bigger, you can rebuild your reference object in every 1,000 inserts. var yourContext = new YourContext (); I think this is a big advantage.

By making this improvement in my imported data process, it took it from 7 minutes to 6 seconds

Actual number ... your case can not be 100 or 1000. ..Try it and tweak it.


sass - SCSS change variable out of scope from inside @if -


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

  • 1 उत्तर

क्या इसके लिए कोई वैकल्पिक हल है स्थिति, जब आप अपने फ़ंक्शन के दायरे के बाहर एक चर को संशोधित करना चाहते हैं? :

  $ ui- थीम: 'गुलाबी'; @if $ ui- थीम == "गुलाबी" {$ ui-main: # eb82b0; $ Ui-secondary: # fff5f9; $ Ui-third: # f6c2d9; } @else {$ ui-main: # ff8067; $ Ui-secondary: # fff6e5; $ Ui-third: # ffb1a2; } एक {रंग: $ ui-main; पृष्ठभूमि: $ ui-secondary};  

मैं ui-theme नामक वैश्विक वैरिएबल बनाना चाहता हूं जो $ ui-main, $ ui-secondary ... परिभाषा के नीचे लिखे गए सभी अन्य कोड में ऐसा लगता है कि @if जैसे निर्देशों का उपयोग करते समय परिवर्तनीय गुंजाइश भी लागू होती है।

क्या कोई जानता है कि यह कैसे प्राप्त किया जा सकता है?

आपको नियंत्रण ब्लॉक के बाहर अपने चर को प्रारंभ करना है:

  $ ui- थीम: 'गुलाबी'; $ Ui- मुख्य: नल; $ Ui- माध्यमिक: नल; $ Ui-third: नल; @if $ ui- थीम == "गुलाबी" {$ ui-main: # eb82b0; $ Ui-secondary: # fff5f9; $ Ui-third: # f6c2d9; } @else {$ ui-main: # ff8067; $ Ui-secondary: # fff6e5; $ Ui-third: # ffb1a2; } एक {रंग: $ ui-main; पृष्ठभूमि: $ ui-secondary};  

आउटपुट:

  a {color: # eb82b0; पृष्ठभूमि: # fff5f9; }  

कूट कोडिंग वैरिएबल के बजाय @ शामिल करें के माध्यम से ही करना संभव है।

_pink.scss: < / P>

  $ ui-main: # eb82b0; $ Ui-secondary: # fff5f9; $ Ui-third: # f6c2d9;  

शैलियां.scss:

<पूर्व> @ "गुलाबी" शामिल करें; // या यदि आप डिफ़ॉल्ट रंग $ ui-main: # ff8067 डिफ़ॉल्ट चाहते हैं, तो कुछ भी शामिल न करें; $ Ui-secondary: # fff6e5! डिफ़ॉल्ट; $ Ui-third: # ffb1a2! डिफ़ॉल्ट; एक {रंग: $ ui-main; पृष्ठभूमि: $ ui-secondary};

android - How to Parse json with many slashes -


इस तरह मेरी वेब सेवा के json प्रतिक्रिया:

  "{\ u000d \ U000a \ "tblworksheets \": [\ u000d \ u000a {\ u000d \ u000a \ "action \": \ "& lt; एक शैली = \\\" कर्सर: सूचक; पाठ-सजावट: रेखांकित करें \\\ "runat = \ \\ "सर्वर \\\" onclick = \\\ "getWorksheet (640) \\\" & gt; संपादित करें & lt; \ / a & gt; \ ", \ u000  

कृपया मेरी मदद करें इस प्रकार की संरचना से निपटने के लिए।

सभी स्लैश को हटाने के लिए फ़ंक्शन का उपयोग करें

< / div>

java - Storing multiple strings in a class hierarchy designed to hold a single string -


I have a hierarchy of classes, each category represents a variety of questions in a survey.

So far, users can give a single answer to the question (from input box, ratio button or dropdown). The answer to each question is stored in the form of a string inherited from the question in the answer field.

The hierarchy is done to add a multi-option question to me. A multi-choice question can provide many answers to users (like selecting multiple options in a group of checkboxes, or through multiple text boxes ).

In the picture below, the green square should add to me. My problem is that the present structure considers only one answer.

I have thought of two possible modifications:

  • Encoding multiple responses as a CSV and giving them the Answer field.
  • A new area list & lt; String & gt; Adding multichoice to answer and a getter getAnswers ()

I see problems in both ways. First person connects the responsibility of parsing the potential CSV to answer the caller. Second, Liskov violates the replacement principle.

My question is: how do I support many such problems in MultiChoice ?

Enter image details here

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

interface

  list & lt; String & gt; Getanswers (); Zero addAnswer (string reply);  

But this is a straight-object rather than an object-oriented design. For me it feels like a Visitor Pattern case like

  Acceptor (Visitor v) is valid;  

and

  Interface Visitors & lt; T & gt; {T visit (T AGR, dropdown answer); T Travel (TArg, Multichoice Answer); T visit (T AGR, answer to single rice); ...}  

with a solid response type per visit method. And then apply the figures on the answer as the visitor's implementation, if there are data you want to do, however, do not always be in the dump areas, think about what you want to do with the data.


floating point - C - Comparing floats with if statements -


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

  • 4 जवाब

मैं वर्तमान में एक लालची लिख रहा हूँ एल्गोरिदम, लेकिन फ्लोट की तुलना करते समय मैंने एक समस्या पर ठोकर खाई है।

मैं इस तरह से कोड का उपयोग करेगा:

  float f = 0; अगर (एफ == 0) {// code}  

मैंने एक अलग प्रोग्राम पर इसका परीक्षण किया है और यह ठीक काम किया है, लेकिन प्रोग्राम पर मैं काम नहीं कर रहा हूं।

यहाँ मेरे अपने कार्यक्रम से एक उद्धरण है।

  फ्लोट chf2 = fmod (chf, 0.1); नाव ch3 = chf - chf2; यदि (chf2 == 0) {/ * 0.1 की संख्या से * उपयोगकर्ता संख्या को विभाजित करें / फ्लोट सी 3 = सीएचएफ / 0.1; / * राउंड नंबर * / इंट ch4 = राउंड (सी 3); / * सिक्कों की मात्रा और अंत * / printf प्रिंट करें ("% d \ n", ch4 + coin2); वापसी 0; }  

अजीब तरह से, यह पिछले के साथ काम करता है अगर बयान करता है कि जब उपयोगकर्ता के इनपुट से 0.25 का एफएमओडी होता है।

क्या जांच करने का एक बेहतर तरीका है एक फ्लोट दूसरे फ्लोट के बराबर है?

आपका कोड सही ढंग से काम करता है

fmod फ़ंक्शन हमेशा एक सटीक परिणाम देता है - जब आप c = fmod (a, b) लिखते हैं। ) , c एक संख्या है, जैसे कि c + k * b (अनंत परिशुद्धता में मूल्यांकन) वास्तव में कुछ पूर्णांक के लिए a बराबर होता है कश्मीर । तो आपका कोड वास्तव में ध्वनि है --- यदि (c == 0) बिल्कुल सही होगा जब a बिल्कुल b का एक बहु होगा। < / p>

आप <कोड> डबल 0.1 , जो वास्तव में अंश 3602879701896397/36028797018963968 , अंश 1/10 नहीं। इसलिए यदि मैं fmod (1, 0.1) की गणना करता हूं, तो मुझे अंश <0> (36028797018963968% 3602879701896397) / 36028797018963968 प्राप्त करने की अपेक्षा करनी चाहिए , जो कि 3602879701896395 36028797018963968 । यह डबल को 0.1 से थोड़ी छोटी है।

यह भी बताता है कि जब आप 0.25 के बजाय ; 0.25 आपको बिल्कुल 1/4 देता है।

आप फ्लोटिंग-बिंदु संख्याओं के प्रतिनिधित्व के बारे में जानने के लिए पढ़ सकते हैं।


javascript - Function onclick makes open new link, no go to original link -


मेरे पास href टैग दूसरे पृष्ठ पर लिंक है।

  & lt; एक नाम = "mylink" class = "mylink" href = "पथ-टू-नया-पृष्ठ html" & gt; नए पेज पर लिंक & lt; / a & gt;  

मैं यहाँ क्या हासिल करने की कोशिश कर रहा हूं यह है कि जब उपयोगकर्ता लिंक पर क्लिक करता है, तो एक onclick घटना शुरू हो गई है। एक वापसी की पुष्टि की तरह कुछ।

  onclick = "वापसी की पुष्टि करें ('क्या आप पहले हमारी सहायता केंद्र देखना चाहते हैं?')"  

अगर उपयोगकर्ता "हाँ" क्लिक करता है, तो उसे help.html पृष्ठ पर ले जाया जाता है।

अगर वह "नहीं" पर क्लिक करता है, तो वह मूल href के लिंक पर भेज दिया जाता है। < / P>

मुझे इसके लिए एक चेतावनी बॉक्स के बजाय पॉपअप विंडो के साथ jquery का उपयोग करना चाहिए?

पहले अपने दूसरे प्रश्न का उत्तर देने के लिए, आपको ऐसा करने की आवश्यकता नहीं है, क्योंकि आप अपने जावास्क्रिप्ट में अलर्ट बॉक्स इनलाइन का नतीजा प्राप्त कर सकते हैं।

& lt; a & gt; टैग, जो वास्तव में एक बटन की तरह लगता है सिवाय एक सिंटैक्स को छोड़कर आप ऐसा कुछ कर सकते हैं:

  & lt; बटन onclick = 'myfunction ()' & gt; यहां क्लिक करें & lt; / button & gt;  

तब आपका जावास्क्रिप्ट ऐसा दिखेगा:

  फ़ंक्शन myFunction () {यदि (पुष्टि करें ("क्या आप पहले हमारी सहायता केंद्र देखना चाहते हैं?") ) {// क्या होगा यदि वे हां चुनते हैं तो // document.href.location = "helpcenter.html"; } Else {// क्या होता है यदि वे कोई नहीं चुनते हैं // document.href.location = "linktarget.html"; }}  

कहां से, helpcenter.html आपका सहायता केंद्र है, और linktarget.html मूल लक्ष्य URL है लिंक।

पुष्टि () बस एक बूलियन देता है कि क्या वे ठीक ( true ) दबाए या रद्द करें या x डायलॉग के शीर्ष पर ( गलत ), और document.href.location बिल्कुल कहने के समान है और

jquery - How to exclude a particular <div> from javascript -


I'm a begineer and I'm having trouble solving the problem. I have a website I have used javascript to scroll effect below:

  jQuery (function ($) {$ ('a [href * = #]: no ([ Href = #]). '(Function () {If (location.pathname.replace (/ ^ \ //,' ') == this.pathname.replace (/ ^ \ //,' ') and ; Location.hostname == this.hostname) {var Target = $ (This.hash); target = target.length? Target: $ ('[name =' + this.hash.slice (1) + ']') ; If (target.length) {$ ('html, atom ({scrollTop: (target.offset (top-80)}, 1000); return return;}}}) $ ('. Nav a ') ('Click', function) {$ (". Navbar-toggle"). Click ()});});  

The problem is that This content is conflicting under the "Testimonials" section.The text to be clicked on the image (internal link) is not showing the text associated with it, on the other hand, it is giving scrolling effect

testimonials Section code can be found here:

How to fix it?

PS: I hope the details of my problem are clear: /

< P>

I suggest that your javascript In global rather than specifically to help "implement behavior".

Instead of dealing with all the links on your page

  $ ('a [href * = #]: no ([href = #])') Try typing it to an anchor tag with a normal class (in this example,  nav-link ), and each link in your nav bar Assign that category to 

  $ ('a.nav-link [href * =]: no ([href = #])')  
< P> or at least only your .nav anchor tag

  $ ('. Nav a [href * = #]: no ([href = #]) ')  

this Also, all the other links on your page can behave normally when "hijacked" the behavior of your nav links.


c - Playing around with signals -


I am currently working on a project to learn about signals, basically I have clients and servers , The server Pid on which I should have the input as a parameter with the string with the client, after the launch, the customer sends this string to the server and the server displays it.

What I have done so far is the string in the binary and if the integer is a 0 then I otherwise send SIGUSR1 (if it is 1) I send the SIGUSR2, in this way I want to convert binary to string I am thinking but how can I do this?

Here the main one is for the server, as you can see that it shows its PID (so we can launch the customer after this) and are waiting for the signal. Once it gets hold of one, it calls my_sig (which you will find later in this thread).

  int main () {int pid; Pid = getpid (); Printf ("Server is Paid:% d \ n", pid); If (sign (SIGUSR1, my_sig) == SIG_ERR) {printf ("Error. \ N"); Exit (1); } If (sign (SIGUSR2, my_sig) == SIG_ERR) {printf ("Error. \ N"); Exit (1); } While (1); }  

And here's my simple simplest my_sig, as you can see that it receives the SigrousR 1 as the signal, it displays a 0, otherwise 1.

  zero my_sig (int param) {char * src; Four * destination; If (param == SIGUSR1) {my_printf ("0"); } If (param == SIGUSR2) {my_printf ("1"); }}  

What it does at the end of the day, the word given in the client is displayed in binary four characters.

How do I use it? Edit: As much as I would like to know about other signals, I would love to know about other signals, unfortunately, I I am limited to the projects.

Using both signals to transmit binary data will be slow and disabled if you still do so If you insist, you will have to pack bits in byte rather than print "1" or "0"

Here's a way you can do that.

  # MAX_BYTES64 constant id current_bit = 0, current_byte = 0; Fixed four bytes = 0, output_byte [MAX_BYTES]; Zero my_sig {char * src; Four * destination; If (param == SIGUSR1) {bytes and = ~ (128>> current_beat); } If (param == SIGUSR2) {byte | = (128>> current_beat); } Current_bit ++; If (current_bit> 7) {current_bit = 0; Output_byte [current_byte] = byte; Byte = 0; If (current_byte & lt; (MAX_BYTES-1)) {current_byte ++; }}}  

This is bad code but the idea of ​​sending signals data is not good anyway.

Output will be in the output_byte array.


objective c - Preventing SKSpriteNode from going off screen -


I have a SKSpriteNode that runs with accelerometer using the following code:

  - (zero) process User: Fare date: (NSEInInternewall) ONLINE {SKSprintNode * SHIP = (SKSCRTNode *) [Own child nodeVithname: @ "fielder"]; CMAccelerometer data * Data = self.motionManager.accelerometerData; If (fibes (data.Scillary)> 0.2) {[gameFish.physicsBody applies: CGVectorMake (0, data.acceleration.y)]; }}  

It works well, however, the gamefish runs away from the screen. How can I stop it and live on the screen?

Try using a SKConstraint that was designed exactly for this purpose and in iOS8 Introduced:

Just add it to the setup method of the gamefish node, after the physics run, the game engine impedance will apply. You will not need to worry about it, okay?

  // Get Screensaver CGSize scr = self.scene.frame.size; // Setup condition barrier SKConstraint * c = [SKConstraint position X: [Lift limit with SKRange limit: 0 upper limit: scr.width] Y: [lift limit with SKRange limit: 0 upper limit: scr.width]] ; GameFish.constraints = @ [c]; // can take an array of constraints  

json - Creating hive table over complex parquet file -


I am trying to put a hive table above a wooden roof table made of the following JSN material:
"": "", "Provider": "[4]": "", "Provider": [{"id": "4220", "name": "dbmvl", "behaviors": {"B1": "gxybq", "b2": "ntfmx" "id": "4173", "name": "dvjke", "behaviors": {"b1": "sizow", "b2": " Knuuc "}"} user_id ":" 3960 "," providers ": [{" id ":" 1859 "," name ":" ponsv "," behavior ": {" b 1 ":" ahfgc "," b2 ":" txpea "}}, {" id ":" 103 "," name ":" uhqqo "," behaviors ": {" b1 ":" lktyo "," b2 ":" Ituxy "}}}}

" user_id ":" 567 "," providers ": [{" id ":" 9622 "," name ":" crjju "," behavior ": {"B1": "": "B1": "eipse", "b2": "r2q", "b2": "b2": "npnot",} "{{id}:" 6965 "," name ":" fnheh "," behaviors " Nvxqk "}}}}

I used Spark SQL to read json and write a wooden roof file.

On top of the wooden roof file I produced I'm running into problems by hive hav IP: string, name: string, behavior: mapp & lt; String, string & gt; & Gt; & Gt; Make table test (Mycollo STRUCT & lt; user_id: string, provider: ARRAY & lt; STRUCT & lt; id: string, name: string, spelling: & gt; & gt;; & gt;) as a wooden roof Archived; Set the table test Change the location 'HDFF: ///tmp/test.parquet'; Perform the above statement exactly, but when I try to do a selection * on the table I get errors: with the exception failed: java.io.IOException: java.lang.IllegalStateException: Columns mycol index 0 does try to change your query in {Providers = providers, user_id = user_id}

: Testing of the table (user_id: string, provider: ARRAY & lt; STRUCT & lt; id: string, name: string, behavior: map & lt; string, string & gt; & gt; & gt; ;) Stored in a wooden roof;

The root JSON object is flat out when the wooden roof file is stored.


f# - Clarification of List<'T> definition syntax -


While reading the source code of F #, give me the list & lt; 'T & gt; Type found which looks like this:

  type list & lt; 'T & gt; = | ([]): 'T list | (: :): Head: 't * Tale:' t list - & gt; 'T list  

Anyone, please, can explain the syntax above? The compiler warns that 'this building is disliked: it is only for use in the F # library', is the syntax of defining contradictory unions just an old way? If so, why is the type of tail 't list - & gt; Instead of 't list ' t list

my Believe it what it means:

  type list & lt; 'T & gt; = | ([]): 'T list | (: :): (Head: 't * tail:' t list) - & gt; To say that,  (: :)  is a function, which is a ordered pair  'T *' T list  

Code> creates a 't list'

The excluded construction is giving type annotation to the discriminated union constructor. You do not have to do that, any version of F # In, as far as I know. I do not know why he had to do this in the F. Library?


node.js - MongoDB embedded document as key-val array -


I am trying to use Mongoos to represent an organization between 3 schemas:

  Schema1: {// fields} Schema 2: {// field} Scehma3: {// field - [Scehma1: Scehma2] - Collection of key-val elements where there is a referral for key schema 1 and Val scehma2} is the reference  

Does this king of cohesion support the creation of a schema 4?

You can not create ambiguous keys in Mongoose because its entire purpose is to handle your document structure for you. What you can do, however, is to create an array of objects.

  Schema 4: {schemaRefs: [{refToSchema1: {type: mongoose.Types.ObjectId, Ref: 'Schema1'}, Rifoschema 2 For future reference, when you use false names Instead of giving actual examples, it is very easy to understand your question: {{type: mongoose.Types.ObjectId, ref: 'schema 2'}}]}  

Even here That if you prove your example wrong (for example restaurants and some relationships or something between customers), then it is very easy to understand the connection that you make Are trying.


python - Try, Except:Pass on multiple lines -


I am writing a script for a program called Abaqus, which plots XY data on a chart .... and change line styles at my scripts if they are based on a specific names ....

so I have a bunch of different curve names and if the chart in the specific Name, I want to execute the code to change the style ... for example ...

  session.curves [PathNameNew + '_ S201-16']. SymbolStyle.setValues ​​(show = true) session.curves [PathNameNew + '_S201- 16']. SymbolStyle.setValues ​​(Marker = FILLED_DIAMOND) session.curves [PathNameNew + '_ S201-16']. SymbolStyle.setValues ​​(size = 2) session.curves [PathNameNew + '_ S201-16']. SymbolStyle.setValues ​​(color = '# 009afb') session.curves [PathNameNew + '_ S247-16']. SymbolStyle.setValues ​​(show = true) session.curves [PathNameNew + '_ S247-16']. SymbolStyle.setValues ​​(Marker = FILLED_DIAMOND) session.curves [PathNameNew + '_S247-16']. Icons Style Set Value (size = 2) session. Cover [Pathnem eNew + '_ S247-16'] SymbolStyle.setValues ​​(color = '# 009afb') session.curves [PathNameNew + '_ release']. SymbolStyle.setValues ​​(show = true) session.curves [pathNameNew + '_ release']. SymbolStyle.setValues ​​(Marker = FILLED_DIAMOND) session.curves [PathNameNew + '_ release']. SymbolStyle.setValues ​​(size = 2) session.curves [PathNameNew + '_ release']. SymbolStyle.setValues ​​(color = '# 009afb') session.curves [PathNameNew + '_S205-18']. Line Style Kset value (thickness = 1)  

which I have called about 50 different curve that will have to do with different styles and use all curves every time, so Apart from trying to try: Pass method to get this method ... though it would mean that I have to do this for every curve name ...

Is there a better way ?

You can always make a stop function to it:

 < code> def my_big_function (): ... Do def try: set_symbolstyle_value (key, ** kwargs): session.curves [PathNameNew + Key] .symbolStyle.setValues ​​(** kwargs) except MyException: do_something () set_symbolstyle_value ( '_ S201-16', show = true) set_symbolstyle_value ( '_ S201-16', marker = FILLED_DIAMOND) ...  

work cheaper do not be afraid to use them.


javascript - Angularjs foreach only returns one object -


This can be a bit easier and I'm ignoring it but I'm creating a filter by categories and one Once the user clicks on a category, it updates a scope (my example $ scope.productStuff) and displays the items accordingly. My problem occurs when I click on the category that gives me back the original objects in my console. Then I look at the dom and it shows only all objects in my console instead of one object (and this is the last object) here my job is:

  $ scope.update = function (Val) {angular.forEach ($ scope.productStuff, function (item) {if (item.s2 === val.toUpperCase ()) {$ Scope.productStuff = [item];}}); }  

This is my factory that is receiving data on page load

  dataFactory.getProducts (). Then (function (race) {$ scope.productStuff = Res.data; $ scope.loading = false;});  

So my question is, why is an object displayed in dom and multiple objects in the console, and how do I put items on $ scope.productStuff?

  $ scope.update = function (val) {// an empty array var stuff = [] Create; Angular.forEach ($ scope.productStuff, function) {if (item.s2 === val.toUpperCase ()) {// Push to our array while completing the position (filter) stuff.push (item) ;}}); // $ scope.productStuff now includes all filtered items $ scope.productStuff = stuff; }  

.net - C# and HID without windows dlls -


I am developing the supervisory system with C # and connects it to some devices through an RS 485 controller. This controller was created with a microscable processor and the Windows OS recognizes it as an HID device (USB Plug and Play). He said, I have developed using Windows DL Functions (HID DLL), as the code below is illustrated in the block:

  [DllImport ("hid.dll", SetLastError = true) ] Public stable Exxon zero HidD_GetHidGuid (Referee Good Headguide); [DllImport ("hid.dll", SetLastError = true)) Public Static Extensions Boole HidD_GetNumInputBuffers (Secure FileHandleHidDeviceObject, ref Int32 numberBuffers); [DllImport ("hid.dll", SetLastError = true)) Public Static Extensions Boole HidD_GetPreparsedData (Secure FileHandleDeviceObject, ref IntPtr preparsedData);  

Today, I'm studying the port of this application in a Linux OS (Debian Disto) with Mono and I believe that Linux will be able to connect with these Windows based OS Will not work.

Is there any other way to integrate the HID device with C # without using these DLS? Or even if you have any clue?


java - Big theta run time of string concatenation? -


I have an assignment for my own implementation of a class to handle the unlimited size integer, and its After comparing the sequence of my implementation, when I measured and sorted the sequence of my concert function for Java's BigIntega, it was a parabol, which means that the time for a large theta of Ө (N2) to run. I do not have a nested loop, so I hope it will be Ө (n) and it does not understand why it is not. I suspect that it may be that I use

  string + integer  

inside a loop in my add method. I am not sure how this operation is implemented, is it the runtime of Ө (N)? If not, why can not someone tell me why my code is not Ө (n)?

Here is my add method and the constructor calls it.

  Public wide integer (string wall) invalid throws Exercise exception {string temp = ""; Boolean pioneer = true; // Valid input to check (int i = 0; i & lt; val.length (); i ++) {if (val.charAt (i) & lt; '0' || Val. Chaat (I) > '9') // Check if each digit is a number from 0 to 9 if the (i! = 0 = val.charAt (i)! = '-') // does not throws points, 'The string's character is the new illegal random exception ("input string should be a number"); } Remove the leading zero for // (int i = 0; i & lt; val.length (); i ++) {if (! Leading || val.charAt (i)! = '0') temp + = Val.charAt (i); If (Well Chat (I)> '0' & amp;;; Val.charAt (i) & lt; = '9') // First non zero score major = false; } If (temp == "") // This happens when the input was a string of zero = temp = "0"; Val = temp; If (val.charAt (0)! = '-') {// no negative sign points = new int [val.length ()]; For (int i = 0; i & lt; val.length (); i ++) {number [i] = (int) (val.charAt (val.length () - 1-i) - 48); // ASCII four '0' == 48} negative = false; } And {number = new int [val.length () - 1]; '-' for the mark number [i-1] = (int) (after val.length ()) (int i = 1; ilait; vine.lamp (); i ++) {// Loop starts for - I) - 48); // ASCII in four '0' == 48} negative = true; }} Add Public Large Integer (Large Integer H) {int carry = 0; Integer size = number Height & gt; H. DIGITS Langhai? Points. Length: H. Digits Laugh; Choose // greater number # string yoga = ""; String horoscope = ""; Int big = 0; Boolean swapped = false; Int temporary; Int sign = 1; Int hsign = 1; // Specify the signal on the basis of the negative; if negative (negative & amp;; h. NHG) marks = -1; If (! Negative & amp; H.H. Negative) hsign = -1; // Compare comparisons 1 means bigger and 1 means h is larger (digits.length> gt; h.digits.length) big = 1; And if (digit length = l = hits.length) is greater = -1; Else {// For equal length (int i = 0; i & lt; digits.length; i ++) {// Both digit arrays have the same length (if digits (digits). Digits.length-1 -i]) {big = 1; break; } If (points [number-long -1]]  = digits.length) is temporary = h.digits [i] * hsign + carry; And if (i> = h.digits.length) is the temporary = number [i] * sign + layer; Other temporary = points [i] * sign + h. Digits [i] * HSING + Layer; If (temporal> 9) {// adds digits for the string, the increment increases which is used in the next frequency - = 10; Yoga + = Floating; Lay = 1; } And if (temp & lt; 0) {temp + = 10; Lay = -1; Yoga + = Floating; } And {sum + = temp; Larry = 0; }} If (layer == 1) yoga = = 1; If (negative & amp; h. neagul || swap) yoga + = '-'; // for flip string (int i = 0; i & lt; sum.length (); i ++) {sumFlipped + = sum.charAt (sum.length () - 1 - i); } Massive Integer sumHugeInteger = New Massive Integer (sumFlipped); Return SumHugeInteger; }  


StackEdit: cannot start server.js -


StackEdit स्थापित करने के बाद:

  git क्लोन https://github.com/benweet/ Stackedit cd stackedit npm install bower install (निर्यात पोर्ट = 5000 और amp; नोड server.js)  

यह त्रुटियों की रिपोर्ट करता है:

मैं किसी भी समाधान को खोजने के बिना googled क्या कोई भी मदद कर सकता है? मैं 80 को बंदरगाह सेट करने की कोशिश कर रहा था, लेकिन 5000 के साथ ठीक था जब मैं एक ही त्रुटि को देखा था

। तो आप यह देखने के लिए कि क्या यह काम करता है, पोर्ट को दूसरों के पास बदलने का प्रयास कर सकता है। उदाहरण के लिए:

  (निर्यात पोर्ट = 3000 & amp; नोड server.js)  

error handling - java.lang.NullPointerexception in java -


When I set up the interface using topic.getSubjectHasProgram () I am getting NullPointerException. But subject.getSubjectHasProgram () Show the size () equal to 2 which is what I want .. !!

  set & lt; Subject & gt; Sub = (set & topic; topic & gt;) this.teacher.getSubjects (); (Iterator & Lt; subject & gt; Iterator = sub .iterator (); iterator.hasNext ();) {subject next = (theme) iterator.next (); If (next.getID () == this.ID) {this.Name = next.getName (); System.out.println ("Subject name =" + this.Name); This.CourseCode = next.getCourseCode (); This.CreditHour = next.getCreditHour (); ** System.out.println ("programscount =" + next.getSubjectHasPrograms (). Size ()); ** for (iterator2 = next .getSubjectHasPrograms (). Iterator (); iterator2.hasNext ();) {ProgramHasSubject ProgramHasSubject = (Program HasSubject) iterator2.next (); This.selectedPrograms.add (programHasSubject.getProgram_ID ()); System.out.println ("Program ID:" + programHasSubject.getProgram_ID (). GetID ()); System.out.println ("Program Name:" + Program HasSubject.getProgram_ID (.) GetName ()); System.out.println ("semester:" + program HasSubject.getSemester_ID ()); }            break; }}  

You actually have two statements for the loop.

Iterator Iterator 2 = Next .get Thematic Program (). Iterator (); And iterator2.hasNext ();

Did you verify that next.getSubjectHasPrograms () Iterator (); a null not back


jquery - Javascript function variable scoping issue -


मेरे पास निम्न जावास्क्रिप्ट फ़ंक्शन हैं:

  $ ('div [id = ("आईडी"); ऑब्जेक्ट = $ (यह); idOnly = fullID.replace (/ ^ \ D + / g, '') प्रत्येक (फ़ंक्शन (इंडेक्स) {fullID = $ (this) .attr ('id'); ; Var jqxhr = $ .ajax ({type: 'POST', url: '/ स्वागत', डेटा: {'lat': lat, 'lon': lon, 'eventID': idOnly}, सफलता: कार्य (msg) {Object.show ();}}})}};  

मैं क्या करना चाहता हूं कोड का यह टुकड़ा निम्न है:

प्रत्येक आईआईडी आईडी के लिए जिसकी पहचान इवेंट से शुरू होती है, उस नंबर का भाग लें Div तत्व आईडी (उदाहरण के लिए, 'event39410' का एक आईडी हो सकता है) - तो '39410' टुकड़ा प्राप्त करें - एक एजेएक्स सेवा के लिए 2 चर के साथ भेजें - और जब प्रतिक्रिया वापस आ जाती है, तो आईडी 'event39410 '। एजेक्स घटक ठीक काम करता है - समस्या यह है कि अगर मेरे पास 10 इवेंट टैग हैं, तो मुझे अपने बैकएण्ड पर 10 एजेक्स कॉल मिलते हैं, लेकिन मैं केवल पिछले' इवेंट 'डिवेल दिखाया गया है - जो बताता है कि जिस समय तक सफलता समारोह को कहा जाता है वह ऑब्जेक्ट हमेशा लूप में आखिरी प्रविष्टि को संदर्भित करता है।

क्या कोई मुझे इस चर की समस्या को ठीक करने में मदद कर सकता है?

आपको उन 3 ग्लोबल्स वेरिएबल्स के सामने var की आवश्यकता है!

  $ ('Div [id = id = "event"])। प्रत्येक (फ़ंक्शन (इंडेक्स) {var fullID = this.id; var वस्तु = $ (This); Var idOnly = fullID.replace (/ ^ \ D + / g, ''); Var jqxhr = $ .ajax ({type: 'POST', url: '/ स्वागत', डेटा: {'lat': lat, 'lon': lon, 'eventID': idOnly}, सफलता: कार्य (msg) { Object.show ();}}); });  

assembly - Encrypt & Decrypt String Routine ASM x86 -


Actually I'm trying to create a program that encrypts the input string & amp; Then decrypts it back to the original state using ASM x86.

The program accepts an encryption key (referenced as an EK in the program) which is a random letter and then encrypts the 6 character string after that. / P>

I'm having trouble writing the decrypt function. I just started leaving each line of encryption behind (the exx was changed to pop ecox, etc.) but it was advised that this is not correct.

Here is the main encryption function:

  zero encrypted_chars (int length, four ek) {char temp_char; Temporary store for variable // (int i = 0; i  

Returns;

and By-laws encrypt '':

  Encrypt: ASI push Isiaks mop ASI, EX and Diward PTR [SSI], 0 Aksff RoR byte ptr [ASI] 1 RoR byte ptr [SSI] 1 by byte ptr [SSI], 0x01 Emoji Isiaks [SSI] pop ADX X 17: RoR DL, 1 dc Ansisian Jeanji x 17 Mega eX, ADX Ed eX, 0 x 20 XX eX, 0 XAAPAP ASIT  

Input: EE C = Register 32-bit address of the e-e, Isiaks = Register is being encrypted characters (8-bit field, cl)

Output: EX = source (encrypted value of character Less 8-bit fields, AL).

Can anyone tell me (or can I indicate that I can find out somewhere) what lines are required for the decryption function?

Thanks in advance for any answers!

Try it:

  decrypt: ESI push Isiaks mop ASI, EX and Divord PTR [SSI], 0 Aksff RoR byte ptr [SSI], 1 RoR byte ptr [SSI] 1 by byte ptr [SSI], 1 Emoji XX [SSI] pop EX XX EX, 0xAA all AX, 0x20 And EX, 0x FF X18: ROL L, 1 DC NCX JNG X18 POP SI RT  

Why do you do it in the assembly Do not? You can simulate left and right bit rotation with view of shift operator or table.


javascript - jQuery Mobile to detect phone call has been made and then has ended -


I'm new to jQuery mobile.

I am developing an application that I have to find out that a phone call has been created by clicking on the hyperlinked phone number in my application.
I also need a hook to find out when the phone call is over.

Is this possible?


javascript - Set multiple scrollbar positions on EndRequest -


I have an ASP.Net page which posts so many times every time, so I have a solution to keep scrollbar posts I found a solution for the scrolling device on the page around that works for a single divas (first gets $ get with a jquery), but I have to do it every I am trying to try again to go through one.

  var xPos = []; Var yPos = []; Var prm = Sys.WebForms.PageRequestManager.getInstance (); Prm.add_beginRequest (BeginRequestHandler); Prm.add_endRequest (EndRequestHandler); Start the functionRextHandler (Sender, Args) {yPos = []; XPS = []; $ ('Tablecontainer') each (function (theIndex, element) {xPos [theIndex] = $ (this) .scrollLeft; yPos [theIndex] = $ (this) .scrollTop;}); } Function EndRequestHandler (Sender, Args) {$ ('tablecontainer'). Each (function (theIndex, element) {$ (this) .scrollLeft = xPos [theIndex]; $ (this) .scrollTop = yPos [theIndex];}); }  

Here I have so far earned, but it seems that it does not do the trick and I am not sure where it hangs. I put it in jsfiddle to make sure that there was no syntax errors I was missing, but I'm pretty sure where do not go from here.

Can someone provide some insight? It's been running for a while and then finally eliminates an indicator from a direct error; I think that at the beginning of the request handler, resetting the arrays will have to stop it at least.

After a little bit of tinkering, in this way I ended up resolving this issue. I realized the elements I was using were identical IDs, so I was walking through the classroom again.

  var xPos = [4]; Var yPos = [4]; Var prm = Sys.WebForms.PageRequestManager.getInstance (); Prm.add_beginRequest (BeginRequestHandler); Prm.add_endRequest (EndRequestHandler); Start the function (requestor, args) {$ ("Table Container"). Each (function (index, element) {xPos [theIndex] = $ (this) .scrollLeft; yPos [theIndex] = $ (this) .scrollTop;}); } Function EndRequestHandler (Sender, Args) {$ ("tablecontainer"). Each (function (theIndex, element) {$ (this) .scrollLeft = xPos [theIndex]; $ (this) .scrollTop = yPos [theIndex];}); }  

Error while configuring Ruby on Rails - pg_ext (LoadError) on Windows -


यह तब होता है जब मैं अपने सर्वर को चलाने का प्रयास करता हूं सीएमडी प्रॉम्प्ट एरर्स

मैं एक समाधान ऑनलाइन खोज नहीं कर सकता क्या कोई मुझे मदद कर सकता है?

अगर यह मदद करता है तो मैं डेटाबेस फ़ाइल और pgAdming एप्लिकेशन स्क्रीनशॉट भी शामिल कर रहा हूं।

बस यूआर रूबी कंसोल पर बंडल अपडेट का उपयोग करें


OpenGL 3.2 Sphere - Texture coordinates -


I am translating a hemisphere into Open Glow 3.2 (Java Y / LWJGL3).

Algorithms already working to generate a spherical magnitude (with GL_TRIANGLE_STRIP primitive) However, I do not know how the texture coordinates & amp; Normal for these headings.

  Float angle, angel; Float cos, sin; Float R1, R2; Float H1, H2; For (angela = -90.0 f; angle A & lt; 90.0 f; anga + = SPHERE_STEP) {R1 = (float) mathos (angle * math.pi / 180.0); R2 = (float) Math.cos ((angle + + SPHERE_STEP) * Math.PI / 180.0); H1 = (float) Math.sin (angle * meth .pi / 180.0); H2 = (float) math. ((Angle + SPHERE_STEP) * Math.PI / 180.0); For (Angelbe = 0.0f; angelby & lt; = 360.0 f; angleb + = SPHERE_STEP) {cos = (float) mathos (angle b * monastery. Pi / 180.0); Sin = - (float) math sin (angle b * monastery. Pi / 180.0); Renderer.addVertex (r2 * cos, h2, r2 * sin, s1, t1, n1x, n1y, n1z); Renderer.addVertex (r1 * cos, h1, r1 * sin, s2, t2, n2x, n2y, n2z); }}  

My problem is that the texture is unknown along with the coordination of S1, S2, T1 and T2, and Normal N1X, N1A, N2 G, N2X, N2N, N2 SG (in two advertex lines). I do not know what kind of texture I should use - I just want a ball (like a marble or soccer ball). The folving image shows that the way the pigments are produced (I do not have 10 reputation ...):

Is anyone's idea? If your proposal is completely different, it also includes a new algorithm, but texture coordinates & amp; Normal, this is absolutely right!

You can calculate the normal given head as normal. Therefore, if your vertical is located at:

  vec3 (r2 * cos, h2, r2 * sin) // and vec3 (r1 * cos, h1, r1 * sin)  

... then this would be normal:

  normal (vec3 (r2 * cos, h2, r2 * sin) / and normal (vec3 (R1 * cos) , H1, r1 * sin))  

They get out of the field at each given point.

Texting, however, is slightly more difficult. I would suggest reading to understand this:

  U = ((-Z / | X |) + 1) / 2V = ((-Y / | X |) + 1) / 2  

java - OpenGL scaling GUI -


I am developing a 2D game, my own monitor is 1080p, so the GUI is based on the monitor which is 1080p Because of this, the GUI looks bad when the monitor has a resolution that is smaller then 1080p. I know that this is probably not the right programming, but I am very far in the development to change the entire GUI.

A clear solution to this problem for me was to just add a glScalef (scale, scale, 1) at the beginning of my render code, but it looks deceptive to look textured Was not scaling, and the text also looked terrible.

My next idea was to present the whole scene at the quad (quad 1920x1080), and then how the scale works in the size of that monitor downsampling problem is that I do not know that How to apply it in OpenGL. I have seen people before, so I know that this would be possible, although I can not find any tutorials that tell it exactly how to do it.

Edit

This problem is: Problem

See blue and orange lines (1 pixel wide only) on the left picture is the right original and desired effect (only I want it to point down)

Here is my code that I used for normal dosaskling:

  // rendering screen size (1080p) public static final dimension RENDERING_SCREEN_SIZE = new dimension (1920, 1080)); // A temporary fixed screen size, which is usually the public fixed final dimension SCREEN_SIZE = new dimension (1366, 768); Private Static Float Scale = 1.0 F; //.../ Public static final zero start () {//..// scale = (float) (SCREEN_SIZE.getWidth () / RENDERING_SCREEN_SIZE.getWidth ()); } Public Fixed Final Zero startRenderLoop () {while (Display.isCloseRequested ()) {GL11.glLoadIdentity (); GL11.glClear (GL11.GL_COLOR_BUFFER_BIT); GL11.glScalef (scale, scale, 0); // Display the scene. SYNC (60); Display.update (); } Display.destroy (); }  

Please note that the quads have been seen not color quads, they are textured quads

/ edit < / Strong>

Any help or any other solution to my downscaling with this has been greatly appreciated.

Development of GUI is not easy for skilled programmers. To implement GUI scaling you have to decide what this will look like. Do you want to scale all the elements for the dimensions given or for some of them? Do you want bad looking elements, because you bring them in the proportion of height in the dimension with the other dimension? If you do not want to scale it, then you want to manage it - you should scale each element on the screen. As I can see, you want to render the entire screen in a texture and then you want to apply each frame to fourfold. FBO (frame buffer object) should help you provide visualization for texture. And the last step - scaling if you believe it somehow wrong - you'll get the kind of artwork if it is very sad - try to play with texture parameters such as filtering mode Now implement in real hands, well wishes!


css - Style radiobutton without using JS or CSS3 or HTML5 -


I was assigned to make the following radiobutation without using JS or CSS3 or HTML5. Is this possible in some way?

Enter image details here

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

OK ... try this:

CSS

  Input [type = checkbox] {opacity: 0; Height: 40px; Width: 40px; Status: Completed; Top: 0; Left: 0; Z-index: 2; } Input [type = checkbox] + label {background: url ("http://www.csscheckbox.com/checkboxes/u/csscheckbox_796472012f96c8785e1ab96779a4ee3c.png") No-repeat 0px; Height: 40px; Width: 40px; Display area; Padding: 0 pixels; } Input [type = checkbox]: check + label {background: url ("http://www.csscheckbox.com/checkboxes/u/csscheckbox_796472012f96c8785e1ab96779a4ee3c.png") No-repeat 0 -40px; }  

HTML

  & lt; Input type = "checkbox" value = "1" /> & Lt; Label & gt; & Lt; / Labels & gt;  


jquery - Getting innerWidth of a div using javascript in mm -


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

  • 10 उत्तर

मुझे पूर्वावलोकन दिखाने की आवश्यकता है एक चालान का इसके लिए मुझे पूर्वावलोकन दिखाने के लिए div के अनुसार पूर्वावलोकन के आकार को स्केल करना होगा। यह डिविजन उत्तरदायी है जैसे कि हम खिड़की के आकार को कम करते हैं, डिव का आकार भी कम हो जाता है और इसलिए मुझे डिवि के अनुसार पूर्वावलोकन स्केल करना है।

चूंकि मिमी में इनवॉइस पेपर आकार इसलिए मुझे मिलना चाहिए मिमी में डिवेल के भीतर की चौखट ताकि मैं उचित पैमाने पर मूल्य प्राप्त कर सकूं।

उसी को प्राप्त करने के लिए कोई अन्य विकल्प भी स्वागत है 'पीएक्स' के मामले में, यह ठीक से काम कर रहा है, लेकिन मुझे मिमी में चौड़ाई प्राप्त करने की आवश्यकता है

  $ ("# preview")। सीएसएस ({सीमा: "1 पीएक्स ठोस चांदी", चौड़ाई : "794 पीएक्स", ऊंचाई: "1123 पीएक्स", स्थिति: "रिश्तेदार", मार्जिन: "ऑटो", बॉक्स शेडो: "2px 2px 4px चांदी"}); // स्केल का पूर्वावलोकन स्क्रीन के आकार के साथ var updatePreviewScale = function (cssObj) {$ ("# preview")। सीएसएस (cssObj); }; // ए 4 पेपर आकार पिक्सेल में: 794 पीएक्स एक्स 1123 पीएक्स var स्केल प्रिव्यू = फ़ंक्शन () {var width = $ ("# preview-container")। आंतरिकव्यूथ (); Var अपेक्षितWidth = 794; Var अपेक्षित हेट = 1123; Var अनुपात = चौथा / अपेक्षित वाइड; यदि (अनुपात & gt; 1) {वापसी झूठी; } Var चौड़ाई मार्जिन = - (अपेक्षित वाइड * (1 - पार्सफ़्लोट (अनुपात)) / 2; Var ऊँचाई मार्जिन = - (अपेक्षितहैइट * (1 - पार्सफ़्लोट (अनुपात)) / 2; ("+ अनुपात +") "," -ms-transform ":" scale ("+" अनुपात + ")", "रूपांतरण": "पैमाने (" + अनुपात + ")", "बायां": चौड़ाई मार्जिन, "शीर्ष": ऊँचाई मार्जिन}; updatePreviewScale (cssObj); }; scalePreview ();  

आप मेरे दोस्त पिक्सल की अवधारणा को नहीं समझते।

< P> हालांकि अधिकांश मॉनिटर समान मानक के आधार पर बनाये जाते हैं। आप यह नहीं मान सकते कि पिक्सल में वे मिमी के बराबर मान हैं। आप देख सकते हैं कि कुछ मॉनिटर छोटे और बड़े होते हैं।

आप इसे कुछ सन्निकटन के साथ कर सकते हैं लेकिन आप कभी भी सुनिश्चित नहीं कर सकते। मिमी केवल मुद्रण प्रयोजनों के लिए काम करेगा।

यहां W3C को क्या कहना है:


1 पीएक्स ≈ 0.2645833333333 मिमी

चीयर्स!


vba - Export excel data to word template -


  आईडी कर्मचारी का दिनांक 1234 मई 11/03/2015 99 99 यू 11/03/2015 1111 हमें 11/03 / हाय,  

हाय,

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

मैंने 'निर्यात' बटन पर निम्नलिखित कोड लिखा है लेकिन मैं काम करने के लिए निर्यात पाने के लिए प्रतीत नहीं होता जब तक टेम्प्लेट खोला नहीं जाता है तब तक कोड चलाता है, लेकिन बुकमार्क को डेटा की पोस्टिंग के कारण त्रुटि उत्पन्न होती है।

पुनरारंभ करें अगला सेट करें WRD = CreateObject ("Word.Application") यदि Err.Number & lt; & gt; 0 तब सेट करें WRD = CreateObject ("Word.Application") यदि त्रुटि गोटो पर सेट करें 0 DOC = WRD.Documents.Open ("C: \ RC_QA_TEST \ Template \ QA_REPORT.dotm") WRD.Visible = True ac = ActiveCell डॉओ के साथ पंक्ति .फ़ॉर्मफिल्ड ("आईडी")। परिणाम = कक्ष (एसी, "ए") .फ़ॉर्मफिल्ड ("कर्मचारी")। परिणाम = कक्ष (एसी, "बी") .फ़ॉर्मफिल्ड ("दिनांक")। परिणाम = कक्ष (एसी, "सी") एंड के साथ 'सक्रिय सक्रिय प्रिंटर के साथ' यहां आप WRD का उपयोग करते हैं। एक्टिवप्रिंट = "प्यारा पीडीएफ लेखक" 'प्रिंट दस्तावेज़ DOC.PrintOut' दस्तावेज़ को सहेजने के बिना करीब दस्तावेज़। बंद करें बंद अनुप्रयोग WRD.Quit सेट WRD = कुछ भी सेट नहीं DOC = कुछ नहीं अंत उप

इस पर कोई भी मदद काफी सराहना की जाती है।

अगर कोड में DOC.FormFields भाग से शुरू होने वाली त्रुटियां हो रही हैं, तो मुझे लगता है कि समस्या यह है कि आपने वास्तव में प्रपत्र फ़ील्ड का उपयोग नहीं किया है, आपने बुकमार्क्स का उपयोग किया है, इसलिए आपको उपयुक्त तरीकों का उपयोग करने की आवश्यकता है। / P>

इसे आज़माएं:

  डॉक के साथ। बुकमार्क्स ("आईडी")। रेंज। पाठ = कक्ष (एसी, "ए")। अंक ("कर्मचारी")। रेंज। पाठ = कक्ष (एसी, "बी")। बुकमार्क्स ("दिनांक")। रेंज। पाठ = कक्ष (एसी, "सी") के साथ समाप्त  
< P> ध्यान दें कि एक बार जब आप किसी बुकमार्क में पाठ को अपडेट करते हैं, तो दस्तावेज़ को दस्तावेज़ से निकाल दिया जाता है। चूंकि आप इसे सहेजे बिना दस्तावेज़ को बंद कर रहे हैं, जब आप फिर से खोलते हैं, तो बुकमार्क फिर से होगा, लेकिन आपको बुकमार्क रीसेट करने की आवश्यकता होगी यदि आप शब्द डॉक को सहेजते हैं, या इसे खोलते हैं और पाठ को फिर से बदलने का प्रयास करते हैं


objective c - Can I selectively display physicsBody's? -


I have this in GameViewController:

  - (zero) viewDidoadload {[Super Viewedload]  

"post-text" itemprop = "text"; // Configure View Self.skView = (SKView *) self.view; Self.skView.showsFPS = Yes; Self.skView.showsNodeCount = Yes; Self.skView.showsPhysics = Yes; // & lt; & Lt; & Lt; & Lt; & Lt; Question about this // create & amp; Configure the view self.scene = [Size with the GameScan View: self.skView.bounds.size]; Self.scene.scaleMode = SKSceneScaleModeAspectFill; // submit the view [self.skView presentScene: self.scene];

}

When physics = yes shows, is there any code I could write that just wants to show physics body? Some physics body looks very good in combination with some presets during the gameplay.

You can not show physical science bodies by selecting self.skView.showsPhysics < / Code>. Although you can use too much of SKShapeNode, there is the same effect as showing your physics body. Using SKShapeNode will give you more control using some of its properties and stroke properties.


python 3.x - Python3 TKinter set Canvas coordinates shown -


I am working on creating a map's GUI representation, but there is a problem measuring the canvas correctly . I am currently mapping the Dubrovnik city and between latitude 42N to 43N and 18E and 19E between all points of Dubrovnik, is a latitude. I was wondering if there was any way to set the canvas so that there were coordinates (42,19) and lower right corner (43, 18) in the upper left corner of the window? Any help is greatly appreciated.

You can not do this, there is no built-in method to do this as far as I know. But you can certainly implement your own canvas that works by doing this

Like:.

  Category GeoCanvas (Tk.Canvas): def __init __ (self, master, uperleftcoords, bottomrightcoords, ** kwargs): canvas____ init __ (self, master, ** kwargs) self .minLat = uperleftcoords.getLat () self.maxLong = uperleftcoords.getLong () self.maxLat = bottomrightcoords.getLat () self.minLong = bottomrightcoords.getLong () self.width = ** kwargs ["width"] self.height = ** kwargs ["height"] self.geoWidth = self.maxLat - self.minLatself.geoHeight = self.maxLong - Self. MinLong def fromLatLong2pixels (self, coords): "coordinate" a "coordinate using a latitude / longitude coordinate for every pixel you want to attract every point you want to attract." "" If (not self.minLat & lt; = coords.getLat () & lt; = self.maxLat) or (not self.minLong & lt; = coords.getLong () & lt; = self.laxLong): Return no one else: deltaLat = coords.ge tLat () - self.minLat deltaLong = coords.getLong () - self.minLong latRatio = deltaLat / self.geoWidth longRatio = deltaLong / self.geoHeight X = latRation * self.width y = LongRatio * self.height Return X, Y  

Then you can override the drawing method that you use to convert each latitude / long coordinate to a point on your canvas Are there.


python - Tweepy error with install involving parse requirements -


I am trying to install tweepy on Windows, and it returns an error Specifically it says:

Type error: parse_requirements > An unexpected keyword argument 'session' was found

My install code was: <

>

Not sure if you have solved this issue, try to upgrade PIP to pip6.0 +, it has mer Resolving the issue on Ubuntu machine you can try it

PP set - Upgrade P


copy file function in C -


I try to copy the file using this function, but we have strange characters in the output file.

  Int filecopy (four filesource [], four file dependencies []) {good result = -1; Four c [1]; File * stream_r = fopen (file resource, "r"); FILE * stream_w = FOPN (file specificity, "W"); // When typing to write and write in file (([0] = (four) fgetc (stream_R)) = EOF {fprintf (stream_W, c); } // close clauses fclose (stream_R); Falcos (stream_w); Return result; }  

I do not know what is wrong. help please.

The problem is that c [1] will not work for a string In form, because it can not eliminate null byte, it should be

  char c [2] = {0};  

and c [2] should be int , like

  int c [2 ] = {0};   

Because fgetc () returns int so that your code is potentially overflowing c [0] , But you also have some other things that you can improve.

  1. You do not need c for a code, you can declare it like this. / P>

      int c;  

    and then fprintf () instead of fputc (); Use .

  2. You have to check that none of the fopen () calls are unsuccessful, otherwise your program \ code> NULL indicator Due to Derences will introduce undefined behavior.

This is a strong version of your own program, which is with the problem fixed in your question

  / * ** Function Return Value Mean * -1 Can not Open Source File * -2 Destination File Can not Open * 0 Success * / Int Filecopy (Four File Resources [], Four File Definitions []) {int c; File * stream_r; FILE * stream_W; Stream_r = FOPN (file processing, "r"); If (stream_r == faucet) return -1; Stream_w = FOPN (file density, "W"); // Write to write and write file (stream_W == NULL) {fclose (stream_R); Return -2; } While ((c = fgetc (stream_R)! = EOF) fputc (c, stream_W); Falcos (stream_r); Falcos (stream_w); Return 0; }  

How would I match a jumbled word from one array to it's correct spelling word in another array in Java? -


Say I have two arrays of strings, one word with which their letters are messed up, and the other array is correct spelling The word (to match with the banana in the second array in X Aran).

In addition to the Brutforce method, which compares every syllable of every word in the correct words, the array, rather than the method of starting a simple code to use it?

try it

  package com.se; Import java.util.Arrays; Import java.util.Date; Import java.util.HashMap; Import java.util.Map; Public category dosas (public zeros) doTask () {string {] word = {"apple", "banana", "kiwi", "water", "football", "ocean", "sports", "fear" "Frost", "Crocodile", "Rabbit", "Road", "Blockbuster", "Cruise", "Light", "Aba"}; String [] jumbledWords = {"aabann", "wiki", "plepa", "water", "football", "nco", "ex", "fray", "tifers", "arcodisel", "brittb" Dora "," BTBolocker "," urcz "," ILLG "," BAB "}; Maps & lt; String, string & gt; FoundWords = New Hashmop & lt; String, string & gt; (); For (string jwItem: jumbledWords) {char [] wordChars = jwItem.toCharArray (); Arrays.sort (wordChars); For (string w: words) {char [] jwChars = w.toCharArray (); Arrays.sort (jwChars); String str1 = new string (word chars); String str2 = new string (jwChars); If (str1.equalsIgnoreCase (str2)) {foundWords.put (w, jwItem); }}} System.out.println (found word); } Public static zero main (string [] args) {date 1 = new date (); JumbledWords jw = new jouled word (); Jw.doTask (); Date 2 = new date (); System.out.println ("Time taken:" + (date2.getTime () - date1.getTime ())); However this matter is sensitive.  

UPDATE

OK, I have the word = word.toLowerCase () for the insensitive match; getCharacterList method

UPDATE 2

Removed the conversion in ArrayList, the applicable code

<3d> update < / P>

There was a slight bug in the previous code. Now the code is correct. It is now more compact.


delphi - How to Draw Vertical Centered Content on DBGrid -


edited: I JDI a vertical centered triangular graphic and text (the project on a Tixaveedibigreed descendants of Teedibigreed) I disable DefaultDrawing method JvDBGrid and try to override it, but I can only fill the cells with black (I think that override my address is incomplete).

Now I draw the mark on the cell and the text stays with the default drawing. How can I do the icon (vertical and horizontal) and text (just vertical) like the center?

Here is my code:

  process TFrmXXX.JvDBGridXXXDrawColumnCell (Sender: Tubakst; construct Rikt: Trkt; Detacol: integer; Column: TC columns: State: Tigreed Deravstet) ; Var icon: TIcon; FixRect: TRCT; IMGuuth: integer; Correct start: reference =; If the column.index = 0 then / always always the first symbol will start Icon: = GetIcon; Try Returning TIcon Object: imgWidth: = (Rect.Bottom - Rect.Top); FixRect.Right: = Rect. Left + img-depth; (Sender as TJVDB Grid) .Canva. Stretch Draw (FixRect, Icon); The icon at the end. free; End; FixRect: Rectangle; FixRect.Left: = fixRect.Left + imgWidth; End; (Sender as TJVDB Grid) Default dourecolmel (lowercase, datacol, column, state); End; After several trials, I got the solution to merge various tutorials on the internet. At DrawColumnCell event, I wrote something like this:  
  canvas.fillart (rect); // Fill the cell using the current brush  

And in the case of each specific column, I used one of these methods:

  canvas. Draw ((Rikt. Right - Rikt. Left - icon width) div 2 + rect.Left, (Rikt. Batm - Rikt. Top - icon. Height) div 2 + Rect.Top, icon); // focuses on cell canvas Graphic Draw draft text (Kanwaskhandl, Pisihara (Colmkfild. Display text), length (Colmkfild. Display text), Riktat, Ditiviviakveyr or D Tisiiattr or Ditisisijiielian or Ditiantiapiariaksaks); // Draw vertical and horizontal centered text Canvas. Devtekst (Kanwaskhandl, Pisihara (Colmkfild. Display text), length (Colmkfild. Display text), Riktat, Ditiviaviaksar or Ditisisijiielian or Ditiantiapiariaksaks); // Vertical and leave horizontally appropriate text  

c# - Binding grid to linq where date is stored as integer -


I want to pair a webdata or redridge into a LinuxSaath. Date is stored in DB as an integer such as 20070205 (iM.M.) when I select i .LASTRCPTDT.ToString ("MM / dd / yyyy") in iiLOCs in IICLOS, then the intersection of a date in the Linux query Try to change;

  var q =  

I get an error:

method 'System.String ToString (System.String ) 'Does not have any supported translations in SQL.

I can load the result with memory toList () and then parse it. The problem is that I will lose efficient paging with the grid. Or I can parse it on ItemDatabound, the problem is how do I set filters for this field in the grid? It should be a calendar dropdown, not an integer text box. Do you have any solutions for this?


c# - IDifferenceBuffer error - (Exception has been thrown by the target of an invocation.) -


I am creating an extension in Visual Studio but there is an error using IElisionBuffer and IDifferenceBuffer. Below is my code

  Public ViewportAdornment1 (for viewing IWpfTextView, IProjectionBufferFactoryService proxingbufferFactory, IDifferenceBufferFactoryService differenceBufferFactory) {_projectionBufferFactory = projectionBufferFactory _differenceBufferFactory = Difference BufferFactory; _view = view; Generalized snapshot span clonal span = new generalized snapshot transparency scan (_view.TextSnapshot, new span (5, 10)); _buffer = _projectBufferFactory.CreateElisionBuffer (empty, period, ElisionBufferOptions.FillInMappingMode); IPOsation snapshot snapshot = _buffer.ElideSpans (span); IDifferenceBuffer differenceBuffer = _differenceBufferFactory.CreateDifferenceBuffer (_view.VisualSnapshot.TextBuffer, snapshot.TextBuffer); Interbuffler Changed snapshot defaults + = applied snapshot directions; } Private Zero ApplySnapshotDifference (Object Sender, SnapshotDifferenceChangeEventArgs e) {ISnapshotDifference snapshotDifference = e.After.DifferenceBuffer.CurrentSnapshotDifference; Var diffs = snapshotDifference.LineDifferences; Edit ITextEdit = _buffer.CreateEdit (EditOptions.DefaultMinimalChange, blank, "myedit"); Forkaries (diff in different diff) {edit.Replace (diff.Left, diff.After.ToString ()); } Edit.Apply (); }  

Below seems to create internal exceptions, but I do not know what's wrong.

  IDifferenceBuffer differenceBuffer = _differenceBufferFactory.CreateDifferenceBuffer (_view.VisualSnapshot.TextBuffer, snapshot .TextBuffer); MSDN commented: "The differences on background threads are calculated in response to various changes (text changes, options change, etc.), although all of the events surrounding differencing, like SnapshotDifferenceChanged, the thread that has LeftBuffer and RightBuffer (usually , UI thread) is bossed on. "

(I can not upload images) Error popup:

Type An exception to 'system.Reflection.TargetInvocationException' is an exception to mscor Lib.dll

Additional information came in: The exception is given by the goal of one.

PS My goal is creating an ornament box which is linked to some text, such as error popup (but instead of text). Is there any easier way to use IElisionBuffer?


class - Java - Using scanner to read in specific type -


  सार्वजनिक शून्य लोडर () IOException फेंकता {स्कैनर infile = new स्कैनर (नया FileReader (SHOP_TILL_DATA_FILE)); Int tillSize = infile.nextInt (); के लिए (इंट आई = 0; आई & lt; तकसिस * 2; आई ++) {यूके डीयनिनेशन सीटी = इन्फ़ील। एक्सएक्स (); Int nc = infile.nextInt (); मूल्यनिर्धारण फ्लोट मी = नए भरोसेमंद फ्लोट (सीटी, एनसी); till.addFloat (एम); }}  

मुझे सीटी टाइप यूके डिनोमिनेशन की तरह होगा, मैं जावा के लिए नया हूँ और इसके बारे में काफी समझ नहीं पाई है ....

नोट: यूके डिनोमिनेशन एक ईएनडी है

यूके के साथ-साथ कई तरीकों से नीचे दिखाया गया है, जहां यूके डोनोनोमनिशन को 1 के रूप में दिखाया गया है)

  public static यूके डैनमिनेशन फ्रॉम स्ट्रिंग (स्ट्रिंग स्ट्रेल्यू)   

2)

<पूर्व> निजी यूके डीनामन (इंट v) {value = v; }

3)

  सार्वजनिक enum यूके डैनोमिनेशन { 

आपको अपने ऑब्जेक्ट को इन्स्तांत करना होगा, फिर इसे अपनी विधि का उपयोग करके, निम्न को आज़माएं:

  यूके डिनोमिनेशन सीटी = नया यूके डिनोमिनेशन (); Ct = ct.fromString (infile.next ());  संपादित करें:  

यदि यह एक एन्यूम है, तो आप इस एन्यूम के एक नए प्रकार के रूप में इनपुट को नहीं सहेज सकते हैं, क्योंकि केवल एक कन्स्ट्रक्टर के लिए और हम इसका इस्तेमाल नहीं कर सकते (इसका उपयोग केवल कंपाइलर द्वारा किया जाता है):

संरक्षित एन्यूम (स्ट्रिंग नाम, इंट ऑर्डिनल)

एकमात्र निर्माता प्रोग्रामर इस निर्माता को नहीं ला सकते। यह एंज प्रकार की घोषणाओं के जवाब में कंपाइलर द्वारा उत्सर्जित कोड द्वारा उपयोग के लिए है। पैरामीटर:

नाम - - इस एन्यूम स्थिर का नाम, जो इसे घोषित करने के लिए इस्तेमाल करने वाला पहचानकर्ता है।

क्रमवृत्त - - इस गणितीय स्थिरांक का क्रमफल (इसकी स्थिति enum घोषणा, जहां प्रारंभिक स्थिरांक को शून्य के एक ऑर्डिनल को असाइन किया गया है।)


c# - WPF: Selectable usercontrol - How? -


I'm new to C # and WPF and there is a problem I hope you can help with it.

I have a WPF application with a stackpanel for which I add the user control by code to display the information stored in a class example. User can create an example, and selecting usercontrol is necessary to edit and delete class instances. In the example, to create a simple sketch as part of the information stored, there is a canvas in the user control.

My problem is how can I select user controls, so that users can choose or delete an instance for editing, and so that I can address canvas by code in a particular example Am I

I hope you can help me.

/ Murney


casting - Make Matlab issue a warning when converting a double to a uint8 and vice versa? -


Normally in Matlab colors, RGB intensity values ​​are displayed with three element vectors, precision UIT 8 (range 0 - 255) or double

imshow make it easy to use both in a program.

This is an analogy, but when specifying the color value from a matrix, it is easy to start a bug type, for the second (because the value is quietly converted, but the new category will not increase again) . Just spend many hours searching these bugs, I would like to make sure that it never re-starts.

How can matlab show a warning when a type conversion occurs?

Ideally this will happen only when the conversion between double and uint8 . It should also be difficult to disable (i.e. when the workspace is not reset when loading, or when the matlub crashes).

A possible solution is to define your uint8 function uint8 is inserted and warns that some values ​​have been truncated.

You should put this function in that folder where it shifts the biltin uint8 funciton. For example, your User Folder is a good option, because it usually appears first in path . Or, as noted by Sam Roberts, if you want to call this function convert from double to uint8 (But not in any other way to uint8 ), by entering it, a folder named @ double in your path.

  function y = uint8 (x) y = builtin ('uint8', x); If any (x (:)> 255) ||  

Warning ('Metap: Cost Transaction', 'Cost Charted During Conversion to UIT 8') Any (X (:) <0) Warning You can call it Warning (can be turned on or off with 'on', 'MATLAB: CastTransconization') and Warning ('Closed', 'MATLAB: CastTruncation') (for suggestions Thanks to Citizen Einsen).


c++ - Set a background texture to my osgWidget::frame -


As stated in the title, I have to texture the background of the Ogwyddt :: frame and it does not matter what I do for it, it does not change with its default white color ...

Even I have tried so far:

  titleframe = osgWidget :: frame :: createSimpleFrameFromTheme ("frame", architecture, 5.0F, 5.0F, OSGWaidet :: frame: : Frames_arecoverware); Titleframe-> GetBackground () - & gt; Set Collar (OSS :: VC4 (1,1,1, 1)); Titleframe-> GetBackground () - & gt; Settections (New Oz :: Texture 2D (BgTactection)); TitleFrame-> GetBackground () - & gt; SetTexCoordWrapHorizontal ();  

I tried to change the color with red color but it is of no avail. The only solution I've found so far is to fill it with empty labels, to be able to scroll through the problem, I need that frame, and I'll need to add and remove objects from it, so the empty label solution is very much not good.

In addition to this, I should also mention that this frame is in the Ogewoodt :: Box, not in the box, t knows if anything changes or not .

Anyway, if I have a solution to this problem, I would be grateful.

(Is it possible to focus on widget BTW?)

I think That you have titleframe-> gt; before title-> setFlags (osgWidget :: Frame:: frameOction :: FRAME_TEXTURE) GetBackground () - & gt; Settimes (image) .

Otherwise titleFrame->

>

unity3d - move object to another position (blinking) -


What I mean by blinking is that objects move instantly (change) into second position Gradually without showing the path of the movement? Its like popping in another position

Enter image details here

Box status, when press right, the object goes to the next position on the right and when pressed, the object goes to the next position on the left.

  speed of the public float;  

if (Input.GetKey (KeyCode.LeftArrow)) transform.Translate (new vector 3 (-Piped, 0, 0) * Time. DeltaTime);

if (input .getkey (keycode. Right arrow)) transform.Translate (new vector 3 (speed, 0, 0) * time DeltaTime );

How do I do this with my code?

If you want an instant x amount according to user input To move left and right, you can use GetKey's GetKeyDown insted to create "one step" every time the key is pressed.

But if you want to leave the pressed key and take the x amount every t using the amount of timer, when T Time has passed since the last move, then move as you say, making it "blink" something like this:

  Speed ​​of public float = 10; // X amount to move public float time = 0ff = 0.5f; / / Tim Time Private Blow Timer "Blink"; Zero start () {timer = timeToMove; // Initially you can move} Zero Update () {// Add Timer Time if (Timer & lt; timeToMove) {timer + = Time.deltaTime; } If (input.Getkey (KeyCode.A)) {// only run when the time has passed (timer> = timetavov) {conversion. Translate (new vector 3 (-pid, 0, 0) * time daltatime); Timer = 0; // Reset timer}}}  

In this case, the object runs 0.5 seconds per second, so that it snaps. You can do this for the right and you can set the pace and time as you like it.

Hope it helps.


window - How can I set "echo" off on user input? (python) -


खिड़की, पुलता काम नहीं करती।

  "message" return fallback_getpass (संकेत, स्ट्रीम) GetPass चेतावनी: टर्मिनल पर प्रतिध्वनि को नियंत्रित नहीं कर सकता। चेतावनी: पासवर्ड इनपुट को प्रतिध्वनित किया जा सकता है  

क्या कोई अन्य तरीका है?


java - String validation for operators like & , !, ),(, | through regex -


I'm totally new to reg-ex and for valid string Getting verification (! , & amp; nbsp; , (, ) , | < Combination of logical operators like / strong>) For example, if & amp; | should be ineligible by the joint because AND OR should come together. Similarly, possible invalid combinations and | , | & Amp; , () , ! & Amp; , & Amp ;! etc

Below is a string example

  1 (ABC) and (dfg). (ZXC) - Pass as all operators are connected correctly 2.! (ABC | DKJ) and VBN - Pass 3.! (ADF and (! And (BER | CTY)). DGH = failed! & Amp; Combined 4! (ABC and DKJ) & amp;; VBN - & amp; | I know that I know in many ways as if I do not have the verification, to check the check and reject  string  < I can use the> code> method in the  method. But i  reg-ex  in  java  

To avoid matching just the invalid operator combo, you can use negative letterhead reagues like this:

  ^ (?!. *? (& Amp; \\ || \\ | & Amp; | \\ (\\) | | & Amp ;; & amp ;;))  

Use it for multiline input such as multiline With option:

  pattern p = Pattern.compile ("(? M) ^ (?!. *? ([& Amp; [| |] | [] | ([] | | \\ (\\))))  

with a string input You can do this to:

  Boolean value = Input.matches ("(?!! *? (& Amp; [!!] | [[(| ] And | \\ (\\)). + ");  

regex - vim how to remove encoding special signs -


I have a document that contains encoding-related characters to get rid of i (like replace with "") .

I have a common problem in describing their origin. There are various examples (for example, vim ) which are displayed in different editors.

Osh

  • 9c & gt; Więcim ( & lt; 9c & gt; is a part that I would like to get rid of)

    • these Geany :

    Enter image details here

    (But copy the copy copy without this 'square' symbol)

    • In these LibreOffice Calc :

    Enter image details here please

    Please note that my text is whcih in other Polish-language-specific Symptoms appear correctly Areas are.

    Question: How to regex it in Vim?

You can & lt; 9c & gt; via : help Ctrl + V (In Windows, often Ctrl + Q by pressing Q X and hexadecimal number:

> Optionally, special \% x 9c < / Code> Regular Expression Atom matches that value:

 :% s / \% x9c // g  

Alternatively, when you Also the cursor is on it through yl , and then : s via the command line & lt; C-R & gt; ".


c# - How to release/free IntPtr to function pointer? -


I've got two original DLL (without sources with external methods): Init and < code.> DoSomeWork

here is my class-wrapper:

  public class MyClass: IDisposable {[DllImport (@ "myDLL.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl, charset = CharSet.Ansi, EntryPoint = "EntryPoint # 1", ExactSpelling = true)] private static exile IntPtr InitNative (); [DllImport (@ "myDLL.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl, charset = CharSet.Ansi, EntryPoint = "EntryPoint # 2", ExactSpelling = true)] DoSomeWorkN (byte [] ArrayOut Ushort private static exile , [IN] intact inithendal); Private Readonly IntPtr _initHandle; Public MyClass () {_initHandle = InitNative (); } Secure Override Byte [] DoSomeWork () {... DoSomeWorkN (buffOut, _initHandle); ...} Remove public override zero () {// ??? }  

I have tried:

  Marshall.FreeHejiloble (_initHandle); // throws exception: invalid access to storage location. (HRESULT: exception 0x800703E6) "} Marshall. Frikotskm (_initHandle); // access violation exception Marshall Frebrad (the _initHandle); // exception does not throw, but does not work (after calling the method IntPtr isn not IntPtr.Zero)  

so, how to apply the correct disposal of _initHandle?

Your library should / will give you a third method:

  Zero intro (intptr handle);  

You do not know If memory was allocated, then the memory was allocated through malloc C . You can not even freely release it. Even worse, if it is a C ++ object Only C ++ can correctly revert it (called the perfect Destroyer). This library should be done to give you a method to free your memory.

(Technically you Can not even know what is IntPtr :-) Perhaps it is Is not an indicator Stw. This can be a number and you have nothing blank ... or it can be handle back by win32 CreateFile )

< / Html>

c# - PictureBox.Handle Intptr to Image or Bitmap -


I need help with HikVision IPCam video streaming. I discovered two holes weeks without luck.

My problem streams the IPCamm DLL image into Picture Box using PictureBox.Handle. Its work is perfectly fine:

  [DllImport ("HCNetSDK.dll")] Public static extern int NET_DVR_RealPlay_V30 (int lUserID, referee NET_DVR_CLIENTINFO lpClientInfo, RealDataCallBack_V30 fRealDataCallBack_V30, IntPtr pUser, bool bBlocked) ; This.realDataCallBack = New RealDataCallBack_V30 (RealDataCallback); This.clientInfo.hPlayWnd = PictureBox.Handle; This.clientInfo.lChannel = Channel; This.clientInfo.lLinkMode = 0; This.playHandle = NET_DVR_RealPlay_V30 (this.userID, ref.clientInfo, realDataCallBack, IntPtr.Zero, true);  

My point is that I need to process the image, but I have no way of capturing the image as a bitmap or image and then look like it.

I tried bitmap. FHHMMAP (PictureBoxHandle), tried some memory merciless solutions without any luck.

My only way is to get the data from the call back function which is with low quality, low frame-count, ...


compilation - Difference between a constant and variable member in compiled or interpreted code -



compilation - Difference between a constant and variable member in compiled or interpreted code -

for while have been little confused role of constant members within language, such java or c. understand @ source code level, prevent critical members beingness mutated , changed, when compiled or interpreted, there difference between them , variable members @ or pointers memory addresses?

i thought perhaps compiler/interpreter has implement special allow variable mutable, wouldn't have when handling constant fellow member (perhaps making execution faster or making utilize less memory?), true or wrong tree?

the const variable , variable not stored in same place 1 time code executed. constant values go in flash memory program. variables go in flash copied in ram modified programme runs. making variable const makes computer save time , space not pushing in ram. when need modify it, force ram anyway, of time const variables not modified. in add-on software fact might want prevent code modify value mistake.

variables compilation constants language-design interpretation

magento - SOAP-ERROR: Parsing WSDL: Couldn't load from : failed to load external entity -



magento - SOAP-ERROR: Parsing WSDL: Couldn't load from : failed to load external entity -

we getting next error

soap-error: parsing wsdl: couldn't load 'https://www.example.com/api/v2_soap?wsdl=1' : failed load external entity "https://www.example.com/api/v2_soap?wsdl=1"

what perchance reason soap error?

curlwrappers disabled.

as suggested, checked out post soap api : start tag expected, '<' not found' found ini_set('display_errors',0); turned off. still unable overcome soap error.

i had same issue , discovered provider had closed server ports , restricted access ip (i don't know if case). after security changes works fine.

wapone

magento soap wsdl

c# - Linq query returning duplicates -



c# - Linq query returning duplicates -

so have 2 datatables, both taken same odbc info source. 1 has rows sales (estado='ventas') , estado='exist' (the database creates row pairs each sale, 1 indicates sale info , other info stock movements off store's deposit, in order know store made sale, have match each ventas row corresponding exist row [by 'documento' id field] , "deposito" value off exist row).

i built query (the odbc driver i'm using doesn't allow joins doing in linq next best thing)

datatable dtresult = new datatable(); dtresult.columns.add("documento", typeof(int64)); dtresult.columns.add("fecha", typeof(datetime)); dtresult.columns.add("articulo", typeof(string)); dtresult.columns.add("deposito", typeof(string)); dtresult.columns.add("impdmn", typeof(decimal)); dtresult.columns.add("cantidad", typeof(decimal)); dtresult.columns.add("partida", typeof(string)); var result = datarows1 in ventasdt.asenumerable() //ventasdt datatable ventas info bring together datarows2 in existdt.asenumerable() // existdt datatable exist info on datarows1.field<int64>("documento") equals datarows2.field<int64>("documento") select dtresult.loaddatarow(new object[] { datarows1.field<int64>("documento"), datarows1.field<datetime>("fecha"), datarows1.field<string>("articulo"), datarows2.field<string>("deposito"), datarows1.field<decimal>("impdmn"), datarows1.field<decimal>("cantidad"), datarows1.field<string>("partida"), }, false); result.copytodatatable();

and works reason duplicates some rows. checked rows duplicated , identical each other. document numbers equal (and there 1 ventas , 1 exist row per documento number, including these duplicates) don't know why they're getting duplicated. checked on source datatables i'm joining , likewise, there 1 corresponding line in each duplicates. exist table larger ventas table (it records transfers between stores aren't sales) joined table larger either (yet not big both combined)

ventas: 85123 exist: 116857 join: 141287

is there wrong query? should include grouping clause or .distinct or should construction (which far i've seen should mimic left join) have been enough?

since reason doing bring together value of "deposito" fields existdt, can replace joining dictionary lookup. here how can it:

var depositopordocumento = existdt.asenumerable().todictionary( dr => dr.field<int64>("documento"), dr => dr.field<string>("deposito") ); foreach (var vr in ventasdt.asenumerable()) { int64 id = field<int64>("documento"); string deposito; if (!depositopordocumento.trygetvalue(id, out deposito)) { continue; } dtresult.loaddatarow(new object[] { id, vr.field<datetime>("fecha"), vr.field<string>("articulo"), deposito, vr.field<decimal>("impdmn"), vr.field<decimal>("cantidad"), vr.field<string>("partida"), }, false); } result.copytodatatable();

c# linq

making online calculator using HTML and javascript -



making online calculator using HTML and javascript -

i want create online calculator, figured out, can utilize forms html, made forms, there little problem, need take values (input type="number" name="first number") , (input type="number" name="second number") , set them script equation , result write in (input type="text") when user file numbers , press submit button http://jsfiddle.net/nco5r74k/

<pre> <!doctype html> <html lang="cs-cz"> <head> <meta charset="utf-8"> <meta name="generator" content="prace"> <title>kalkulačka</title> </head> <body> <form> <label for="vypln_cislo1">zadej zde první číslo</label> <input type="number" name="prvni_cislo" min="0" max="10000"> <select name="znamenko"> <option value="+">+</option> <option value="-">-</option> <option value="x">x</option> <option value=":">:</option> </select> <label for="vypln_cislo2">zadej zde druhé číslo</label> <input type="number" name="druhe" min="0" max="10000"> <input type="submit" value="vypočítat"> <label for="vysledek">výsledek:</label> <input type="text" size="15" name="vysledek" readonly> </form> <script> var a, text; y = x = = y + x text = + a; document.write(text); </script> <script> var b, text; y = x = b = y - x text = + b; document.write(text); </script> <script> var c, text; y = x = c = y * x text = + c; document.write(text); </script> <script> var d, text; y = x = d = y / x text = + d; document.write(text); </script> </body> </html> </pre>

here's little illustration of how can utilize document.getelementbyid() read input elements , write span element, using onclick event handler button.

class="snippet-code-html lang-html prettyprint-override">a: <input id="a" value="3"/><br/> b: <input id="b" value="5"/><br/> <button onclick="document.getelementbyid('product').innertext = document.getelementbyid('a').value * document.getelementbyid('b').value;">calculate</button> <br/> * b = <span id="product"></span>

javascript html forms var equation

node.js - Nodejs check gender by name -



node.js - Nodejs check gender by name -

i need check gender name. have list of name in first form, such as: "peter", "anna" , etc. not complicated, application must homecoming probability of gender,than name not in first form, illustration "peter" , "petka" equal. maybe knows solution nodejs?

it fail quite often, , pointed in comments, may offend some. beingness said, there api : genderize.io

it returns results : {"name":"peter","gender":"male","probability":"0.99","count":796} can localize query more accuracy.

and db 177k names large, it's best bet.

edit :

to take illustration mention, here's returns 'petka' :

{ name: "petka", gender: "female", probability: "1.00", count: 2 }

so guess there's room improvement.

node.js

java - Dynamic web service client from wsdl -



java - Dynamic web service client from wsdl -

one of scheme need invoke soap based webservices. of now, every new webservices, generate java stubs provided wsdl file , redeploy web application new webservice consumer code. there approach dynamically create webservice client can invoke methods provided wsdl files? expecting

put wsdl file in location can accessed web application invoke servlet keyword having wsdl file name, , other params required webservice method.

can apache cxf help in this? read in post, generating wsdl2java in runtime , loading classes, on time, can exhaust pemgen memory space.

you should here : http://cxf.apache.org/docs/dynamic-clients.html that.

here example:

clientimpl client = (clientimpl)doc.getclientfromwsdl("http://myurl:8080/datacentersws?wsdl"); string operationname = "getvirtualisationmanageruuid"; bindingoperationinfo op = doc.getoperation(client, operationname); list<messagepartinfo> messagesparts = op.getinput().getmessageparts(); object[] params = new object[messagesparts.size()]; /* feed yours params here (this feeding heavy in code */ object[] res = client.invoke(op, params);

there many other examples in source distribution of cxf.

java web-services wsdl cxf