Posts

Showing posts from April, 2013

Is there a way to change the display name in email sent via Google Apps Script? -

I am testing an email sent from Google Apps Script and sending it with the display name of the email address. @). This is a business address: info@example.com and all that is showing is "information". I would like to like it: "Bob Example.com" Is there any way to do this in the app script? I have installed it for emails sent manually. Thanks in advance I did not get help from a Google search Try with options (advanced parameters), using the name More details are here

Import a function in haskell -

I have written a function in which I say which number is weird and then in another function, I want to say this What is strange from the given list is my question: How can I include a data file for the first function, e.g. In other data files, odd.hs, e.g. oddNbrs.hs. To use the first function in the second function? For example, "include" me in C as you know there is nothing like "included" in the shell, too? Or? EDIT: Both files are in the same directory. Is it enough, when I write the first function of the name in another function, or should I do a different job? I think the keyword you are searching for is module File: Odd.hs module where OD is :: int -> Bool isOdd x = x`Rim`2 == file: Even HS module where Also the import is weird isEven :: int - & gt; Bool isEven = isOdd file: numbers hs module numbers where import weird import even nigens :: [Int edit more beautiful in a module File: Predicates.hs < /

c# - How can I intersect two different .NET lists by a single property? -

I am trying to filter my first list of FU based on some values ​​in a second list of ba. For example. Here is ... var foos = new list & lt; Foo & gt; New fu {name = "lea"}, new fu {name = "han solo"}, new fu {name = "chewacka"}, new fu {name = "luke"},}; var bass = new list & lt; Left & gt; New Ba (Elias = "AAAA"), New Ba (Elias = "BBBB"), New Ba (Elias = "Laya"), New Ba (Elias = "Luke"}}; // Expected Output: // List & See how I'm asking for: another list Alias ​​< / code> Filter by first list ( name ) by property. And will it return to a list of foo in 2 results? any clue? You can add baas to the list of < code> any : foos. where (f => baas.Any (b = & gt; B. alias == f.Name)); or join (use cleaner in the query syntax): var from query = f to join foos b f. Choose an alias A complete working .net Bella.

android - How set Orientation Hint of file Image? -

Image
This image is captured by standard camera and opened by the gallery of Android This image capture by my app camera and opens by the gallery of Android How to set the orientation of image image (it displays the same standard camera Can) I try with the camera's saturation, but it does not work: Camera. Parameter parameter = mCamera.getParameters (); Parameters.setRotation (rotation); mCamera.setParameters (parameter); If I use recorded video: MediaRecorder.setOrientationHint (rotation); But the image I do not know can you help me? You need to implement your own photo capture activity to get the desired orientation for each Capture image on every device. I have implemented a capture activity, so you can take photos and set the orientation of photos. You can see my answer about the rotation of images on this topic: Implementation: Save the picture function for the answer given above : Save Photo Function: Public Zero Saved Photos (Bitmap BMP) {im

php - fopen creates the file but fwrite doesn't write any data and returns 0 -

Below is the part of the OpenX server code (SmartP plugin) when called a phopan, the file is created successfully, but the fileta file Does not write any data and returns 0 (and not incorrectly). The folder has the following permissions: drwxrwxrwx none has been created with the following permissions: -R-R-R-A - None Here's the code. function smarty_core_write_file ($ params, & $ smarty) {$ _dirname = Dynamic ($ params ['filename']); If ($ params ['create_dirs']) {$ _params = array ('dir' = & gt; $ _dirname); need_once (SMARTY_CORE_DIR. 'core.create_dir_structure.php'); smarty_core_create_dir_structure ($ $ params, $ smarty); } // to write the tmp file, then rename it to avoid the locking of the file $ _tmp_file = tempnam ($ _ dirname, 'wrt'); If (($ fd = fopen ($ _tmp_file, 'wb'))) {$ _tmp_file = $ _dirname} DIRECTORY_SEPARATOR uniqid ('wrt'); If (($ fd = fopen ($ _tmp_file, 'wb'))) $ $ smarty->

php - Get specific key values as an array from array of object -

यह मेरा कोड है: $ a = सरणी (array ("a" = 1, "b" = & gt; 2), सरणी ("x" = & gt; 2, "a" = & gt; 2), सरणी ("d" = & gt; 100, "a" = & gt; 3, "बी" = & gt; 2, "c" = & gt; 3)); $ MyArray = array (); विदेशी मुद्रा ($ $ के रूप में $ arr) {$ myArray [] = $ arr ['ए']; } Print_r ($ myArray); अरा ([0] = & gt; 1 [1] = & gt; 2 [2] = & gt; 3) इसलिए, मुझे / code> क्या लूप के लिए बिना ऐसा करने का कोई अन्य तरीका है? जैसे ही एक ही प्रतिक्रिया पाने के लिए एक दो PHP सरणी फ़ंक्शंस का उपयोग करना है। उपरोक्त सही है लेकिन फिर भी अगर ऐसा करने के लिए कोई अन्य बेहतर तरीका है जो सराहनीय होगा! क्योंकि मेरे कोड में एक ही सरणी $ a को कई बार पुनरावृति करना आवश्यक है अगर मेरे पास ऐसा करने का कोई बेहतर तरीका है तो मैं एक और पुनरावृत्ति को कम कर सकता हूं (PHP अभी भी अंतर्निहित एफएनएस में आईटेशन करता है, मैं इसे परेशान नहीं करता)। हाँ (चूंकि आप PHP 5.4 पर हैं, यह कोई व

IntelliJ IDEA and Maven: creating a test resource in the same package -

I am using IntelliJ IDEA and my project has a default maven structure. I often need to create a new class or resource in the same package, but in different folders ( src / main / java , src / One of the main / resources , src / test / java , src / test / directory ). A case where I am editing a class in src / main / java and I need to create a test in src / test / java create test What about other scenarios? Often I write myself a unit test and I want to make a test resource in the test resource folder in the same package. Is there a quick way to get it? For my best knowledge (through 10 years of use) Any way to do this Has not been made. It was some recently desired to create the default spring test reference file. Your post has promoted me to open a spring text reference automatically, I request you to give a comment on that request, or open a separate feature request.

html - Is there any known problems with using box-sizing? -

समस्या मैंने अपने सीएसएस को सेट किया है; *, *: पहले, *: के बाद {-मोज-बॉक्स-आकार: सीमा-बॉक्स; -वेबकिट-बॉक्स-आकार: सीमा-बॉक्स; बॉक्स-आकार: सीमा-बॉक्स; मार्जिन: 0; पैडिंग: 0} ऐसा करने से मुझे अलग-अलग ब्राउज़रों में एक डिवा की ऊँचाई के साथ असंगतता है, जो एक निश्चित ऊंचाई है। प्रश्न का डिवीज़ सीएसएस .content.one / * पूछताछ फार्म * / {स्थिति: निरपेक्ष; बाईंओर तैरना; कुछ भी डिस्प्ले मत करो; शीर्ष: 50 पीएक्स; ऊंचाई: 615 पीएक्स; बाएं: -255 पीएक्स; चौड़ाई: 960px; z- इंडेक्स: 5; पैडिंग-बाएं: 50px; पैडिंग-दाएं: 50px; पैडिंग-टॉप: 5 पीएक्स; पैडिंग-नीचे: 10 पीएक्स; पृष्ठभूमि रंग: # 000000; } आपको उपयोग करने के लिए गैर-स्टैन्डर्ट गुणों का उपयोग करना होगा (उदासीन लेकिन कोड बन जाएगा) अमान्य, उनमें से: () -मोझ-बॉक्स-आकार: सीमा-बॉक्स; / * फ़ायरफ़ॉक्स * / -विबिट-बॉक्स-आकार: सीमा-बॉक्स; / * सफ़ारी, क्रोम * / तो पूरी शैली होगी: div {width: 300px; पृष्ठभूमि: #ccc; padding: 20px; -moz-box-sizing : सीमा-बॉक्स; / * फ़ायरफ़ॉक्स * / -वेबकिट-बॉक्स-आकार: सीमा-बॉक्स; / * सफ़ारी, क्

jQuery UI Datepicker on ASP.NET Web Form -

ASP.NET वेब फ़ॉर्म में काम करते समय आप कैसे jQuery UI Datepicker validation को लागू करते हैं? इस मान्यता के लिए आधार इस साइट से है: मेरे पास समस्या नियम के साथ है। उदाहरण: $ ('# validateform')। मान्य करें ({त्रुटि प्लेसमेंट: $ .डेटीपिकार। अंतरिक्ष प्लेसमेंट, नियम: {txtDatepicker: {आवश्यक: सत्य, डीपीडीट: सच},}, संदेश: {TxtDatepicker: 'कृपया एक वैध दिनांक दर्ज करें (yyyy-mm-dd)',}}); "txtDatepicker" एएसपी: पाठ बॉक्स आईडी है जो पृष्ठ को रेंडर करने पर बदलता है। मैं उपर्युक्त नियम वाक्यविन्यास में यह कैसे निर्दिष्ट करूं? मैंने प्रॉपर्टी नाम = "txtDatepicker" का उपयोग करने की कोशिश की लेकिन यह काम नहीं करता। और लेफ्टिनेंट ; एएसपी: टेक्स्ट बॉक्स रनैट = "सर्वर" आईडी = "टेक्सटीडेट पिक्चर" क्लाइंटआईडोड = "स्टेटिक" / & gt; बस क्लाइंटआईडी मोड को बदल दें, फिर क्लाइंट पर आईडी हमेशा txtDatepicker होगा।

asp.net mvc - Trying to configure SMTP correctly in Web.config for Azure Website. Cannot get to work -

I am struggling to work on my SMTP email in Ezur websites. This works on my local setup : & lt; Mail settings and gt; & Lt; smtp delivery method = "network" & gt; & Lt; Network Host = "relay.myIsp.net" userName = "" password = "" port = "25" /> & Lt; / Smtp & gt; & Lt; / MailSettings & gt; I have changed the name of my ISP to "IISP", besides this it is the same. I've read some posts about insecure Azure.config, but I could not find it. I'm using ActionMailer.net, which looks good as my email message maker. Follows through the application, no error, I do not get any email yet. Thanks in advance. Edit: SendGrid Web.config Setup, therefore, no problems on port 25 or 587 Azure websites: & lt; System.net & gt; & Lt; MailSettings & gt; & Lt; Smtp = "test@domain.com" & gt; & Lt; Network host = "server" password = "

c - Compiling the uIP library in Arduino IDE -

I am trying to compile a very simple Arduino program that connects to a server and it "fixes" \ N ". The program makes extensive use of the UIP library (in fact, it is a library based on the UIP, but it seems almost identical). Here's my sketch: #include & lt; uip.h & gt; Zero setup () {connect_example2 (); } Zero loop () {uip_send ("OK \ n", 3); } Zero connect_example2 (zero) {uip_ipaddr_t ipaddr; UIPPepader (& ipaddr, 192,168,1,100); uip_connect (& ipaddr, HTONS (8080)); } However, when I compile, I get the following error: test.cpp.o: `connect_example2 () 'in the function: C : \ Program Files (x86) \ Arduino / test.ino: 14: `Undefined reference 'for test_pict.o: function' loop 'for UIP_connect (unsigned integer (*) [2], unsigned int): C : \ Program Files (x86) \ Arduino / test.ino: 8: Undefined Reference '' for `UIP_SEND (Zero Cost *, Int) ', Arduino IDE Library Is properly connected to What can

c++ - Copy constructor invokes infinite loop although having call by reference -

पाश को लागू करने वाला कोड: फू temp = Foo (token.substr (0 ,मैं)); यह- & gt; बाएंExpression = temp; होने के नाते फ़ू घोषित किया गया: वर्ग फ़ू {निजी: std :: string expr; std :: vector & lt; बार * & gt; टोकन; std :: vector & lt; std :: string & gt; stringtoken; और सीसीटीएआर ने लूप लागू किया है: फू :: फ़ू (कॉन्स्ट फू एंड ए_ एक्सप्र।) {This- & gt; expr = a_expr.expr; यह-> टोकन = a_expr.tokens; यह- & gt; स्ट्रिंग टा टोकन = a_expr.stringtoken; } क्या इस लूप को लागू किया जा रहा है? संपादित करें: असाइनमेंट ऑपरेटर: फ़ू & amp; फू :: ऑपरेटर = (कॉन्स्ट फू एंड ए_एक्सप्र।) {फू टेंप (ए_ एक्सप्र); std :: swap (* यह, अस्थायी); वापसी (* यह); } समस्या यहां है: std :: स्वैप (* यह, अस्थायी); std :: swap का डिफ़ॉल्ट कार्यान्वयन असाइनमेंट का उपयोग करता है, इसलिए अनंत ररकॉन्शन को अपने असाइनमेंट ऑपरेटर से बुलाते समय। यदि आप वास्तव में अपना स्वयं का असाइनमेंट ऑपरेटर लिखना है, फिर अपना खुद का स्वैप लिखें, उदाहरण के लिए: void Fo

ios - Creating a 300 dpi PDF context -

I am trying to create a multipage PDF document that is intended to be printed with an OSX app. The hard part is searching for a decent tutorial to understand the whole process This is a point. Every time a PDF reference is created, I see this line UIGraphicsBeginPDFPageWithInfo (CGRectMake (0, 0, 612, 792), zero); If I correctly understood, a PostScript point is 1/7 inches then 612 x 792 points = 8.5 x 11 inches = 215.9 mm x 279.4 = US letter letter size. But I see a problem here, this page will be printed on 72 dpi, right? Very low resolution How can I create something like 300 dpi ?, just increase the number of proportional points, or in that case create a context of 2550x3300 points? Is this the right way to do this? Another issue is: I am making a reference to the whole page, how do I know if I can really print? All fields printable in a PDF document Page 72 is not printed on dpi, is that only? coordinate system. PDF files (usually) are vector-based, a

javascript - Drawing 3 lines html5 (alpha, beta, gamma via deviceorientation) -

Image
I would like to draw 3 rows through HTML5 using toolwd (alpha, beta, gamma data) & lt; Html & gt; & Lt; Canvas ID = "Mykennas" & gt; & Lt; / Canvas & gt; & Lt; Script & gt; window.addEventListener ('deviceorientation', function (e) {draw (imama, eb eta, a.lfa);}, false); Function Draw (G, B, A) {var gamma = Math.round (g); Var Beta = Math Plains (B); Var alpha = Math field (A); var canvas = document. getElementById ('mechanism'); Var cx = canvas.getContext ('2d'); // How can I draw these 3 lines? } & Lt; / Script & gt; & Lt; / Html & gt; Here is an example of three vectors: Display: [] I think I need your needs. Here are some suggestions: Three. Use Js, and drag the axis here is one. Attach your three.js control with DeviceOrientation. three. JS already provides three types of control. The device is an integration control here. Position your location in three places. Apparent

c++ - Template Class Dependency Issue -

मेरे पास दो वर्ग हैं, DynamicCollection और शब्दकोष । शब्दकोष से डायनामिक कलेक्शन से प्राप्त होता है और दोनों वर्ग टेम्पलेट हैं इस तरह दिखें: टेम्पलेट & lt; typename ValueType & gt; क्लास DynamicCollection; टेम्पलेट & lt; typename कीटाइप, टाइपनामनाम ValueType & gt; क्लास डिक्शनरी: पब्लिक डायनेमिक कलेक्शन & lt; कीवालपेअर & lt; कीटाइप, वैल्यू टाइप & gt; & gt ;; मुझे जो मुद्दा आ रहा है वह यह है कि डायनेमिक कलेक्शन को एक विधि GroupBy होना चाहिए, जिसका घोषणा इस प्रकार दिखता है: टेम्पलेट & lt; typename selector & gt; शब्दकोश & lt; चयनकर्ता, आइकलिंग & lt; मूल्य प्रकार & gt; * & gt; * समूहबी (मानक :: कार्य & lt; चयनकर्ता (मूल्य प्रकार) & gt; मूल्यांकनकर्ता); तो मुझे जो समस्या है वह एक परिपत्र निर्भरता है, और मुझे नहीं पता कि यह कैसे लिखना है ताकि यह काम करे। मैंने डिक्शनरी को DynamicCollection हैडर में आगे की घोषणा करने की कोशिश की है, और फिर डिक्शनरी शीर्ष लेख में विधि को परिभाषित करने की कोशिश की

html - Javascript: Div is opening but not collapsing back -

I have this div that I have created, I want to expand it when a link is clicked and it Click again It seems that it is expanding correctly, but it has not been eliminated. Please & lt; Script & gt; Function Set Display () {document.getElementById ('divCollapse'). Style.display = "none"; } Function expandselected () {if document.getElementById ('divCollapse') style.display = "none") {document.getElementById ('divCollapse'). Style.display = "block";} and if (document.getElementById) ('divCollapse') style.display = "block") {document.getElementById ('divCollapse'). style.display = "none";}} & lt; / Script & gt; To use == to compare you Your if / else if is the block you are currently using = which is setting a display, is not checking it. & lt; Script & gt; Function Set Display () {document.getElementById ('divCollapse'). Style.display = "non

javascript - Angular error in loading correct children -

मेरे पास निम्न कोणीय ऐप है: जब अगले + मेरा शैक्षिक पाठ्यक्रम क्लिक किया जाता है, इससे चयन करने के लिए पाठ्यक्रमों की सूची प्राप्त करने के लिए एक नया पैनल खुलता है। यहां हम ' शैक्षणिक ' पर क्लिक करते हैं तो यह अपने सभी बच्चों के साथ एक नया पैनल दिखाता है। लेकिन जब मैं एप्लाइड साइंसेज डिग्री में एसोसिएट क्लिक करता हूं यह अभी भी मुझे एक ही बच्चे दिखाता है? कोई भी विचार जहां मैं गलत हो रहा हूं? सबसे अच्छा समाधान नहीं हो सकता है लेकिन यहां पर लिंक है संपादित करें : उप-बच्चों के लिए: () यहां मेरे अतिरिक्त हैं: नियंत्रक: $ का दायरा .clickHandler = फ़ंक्शन (इंडेक्स) {$ scope.currentProgram = $ scope.programs [0] .programlist [अनुक्रमणिका]; }; देखें: & lt; li ng-repeat = "प्रोग्राम में p [0] .programlist" डेटा-जासूस = "स्क्रॉल" & gt; & lt; इनपुट प्रकार = "चेकबॉक्स" एनजी-क्लिक = "display.addcourse =! display.addcourse; clickHandler ($ अनुक्रमणिका)" मान = "" / & gt; {{pprogram}} & lt;

java - JSP - How do I print out empty when values are duplicated? -

Image
Below I have a JSP code that prints the first picture. What I am trying to achieve in the second picture. I have a total of 8 columns before 4 columns are printed as long as there is data from the internal inner table, in which the last 4 columns are included, where the data is different. I want to print empty data or place in columns and rows where the information from above is repeated. I can be up to 6 rows for every ID (so far left). & lt; Table range = "1" width = "100%" & gt; & Lt; TR & gt; & Lt; Th & gt; Student ID & lt; / Th & gt; & Lt; Th & gt; Last name & lt; / Th & gt; & Lt; Th & gt; First name & lt; / Th & gt; & Lt; Th & gt; Grade & lt; / Th & gt; & Lt; Th & gt; Events & lt; / Th & gt; & Lt; Th & gt; Interaction Level & lt; / Th & gt; & Lt; Th & gt; Ind / Team & lt; / Th & gt; & Lt; Th & gt; Event name & lt;

r - Aggregate, Date, Values -

I am new to R and am trying to gather results and am trying to find minimum dates. For example if I have date of the ID value 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -02 7 1 2013-12-02 9 I'm seeing the result as: ID date value 2013-02-02 5 1 2013-04-02 7 Any time will be appreciated. here data.table Library (Data Eligible) df $ date & lt; - as.Date (df $ date) is a solution with data. You can use dplyr (thanksgiving): (sd) [which.man (date),] = id < pre> library (dplyr) df%.% group_by (id)%.% filter (date == minute (date)) Both the output of something: ID date value 1: 0 2013-02-02 5 2: 1 2013-04-02 7

PHP - MySQL results to JSON -

I am trying to convert a MySQL result to a JSON format so that I can later use this JSON Javascript to create an HTML table. Although my code produces very nil values ​​and why I am still not understood. $ result = mysqli_query ($ con, "select from clients"); $ test = json_encode ($ result); Print $ test; Output: {"current_field": null, "field_count": zero, "length": blank, "num_rows": empty, "type ": null} I have fields like, for example," customer ID "and" name ", and even they do not even appear in JSON results. What am I doing wrong? Thanks $ result = mysqli_query ($ con, "select from customers"); While ($ line = mysqli_fetch_assoc ($ result)) $ test [] = $ line; Print json_encode ($ test);

javascript - Three js collada animation set time -

Is there a way to set time or keyframe in the Kolada animation keyframe? I am trying, but I get unexpected behavior. function playAt (a) {for (var i = 0; i & lt; kfAnimationsLength; ++ i) {kfAnimations [i] .pause (); KF Animation [I] Play (false, A); KfAnimations [i] .update (0); found: function playat (a) {for (var i = 0; i & lt; kfAnimationsLength; + + I) {kfAnimations [i] .stop (); KF Animation [I] Play (false, A); KfAnimations [i] .update (a); }} But still there have been some unpredictable behaviors, I have imported my camera from Colada. And they do not support updates like this

java - mybatis insert and update index out of bounds error -

I have a mybitalis problem with the updated call. For some reason, I'm getting an index out of an exception exception: Reason by: com.microsoft.sqlserver.jdbc.SQLServerException: Index 1 is out of range I think the parameter is a type of map or archive. However, I pass it to a single object which I use the ratio of using the # {} syntax. I then call a straightforward update. & lt; Update id = "updateFactory" type statement = "CALLABLE" parameter type = "work order" & gt; Update wo SET factory = '# {factory}' WHERE work_order = '# {work_order}' & lt; / update> I know that the parameters meet with the gates and the setters, but it is still an issue, as a collection that treats the type of nickname dealing with the work order. (It seems that it receives the first index (0), but fails in the next (1 index). Why could this be so, but no thoughts? have you tried? & lt; update id = "updateFac

c++ - How could I exit from do-while loop? -

I have code that relates to NIM subtraction game. What I would like to implement is that the user is going to be able to play the game till he wants it. If the user enters the 999 program then he will exit, otherwise he will play until he enters 999. This is my block of code. I'm not sure whether I make a logical mistake or I need to add some specific exit code. Thanks for your time and attention. #include & lt; Iostream & gt; # Include & lt; Cstdlib & gt; using namespace std; int main () {int total, n; While (true) {cout & lt; & Lt; "Welcome to NIM. \ N 99 9 to quit playing! \ NClick an initial total:"; Cin & gt; & Gt; Total; Break if (total = 999); While (true) {/ Choosing the best response and print results if ((% of total 3) == 2) {total = total - 2; Cout & lt; & Lt; "I'm decreasing 2." & Lt; & Lt; Endl; } And {total--; Cout & lt; & Lt; "I'm decreasing 1." & Lt; & Lt; En

class - Python attribute of combination of two objects -

I'm quite new in OOP in Python In a program, I have two types of classes: class character: ... etc ... [ character1 and Character2 are examples of this) / P> and class room: ... etc ... < [ Room1 and < code> Room2 are examples of this] I have a variable pos for each character and cell pos for each possible combination of two classes Balance is: Example for : Type 1 with cell 1 - & gt; Pos = (10, 4) Room 1 - & gt; Pos = (6, 10) Room 2 with cell 2 - & gt; Pos = (3, 12) with class 2, character 2 - & gt; Pos = (7, 5) Is there an easy way to create an attribute for the combination of the classes I described? I have looked around the internet and I have not found any way to do this. Thanks in advance. You can make a tuple of your character and room examples, then add that topless to anything Use as a key to store the value of. ([character 1, cell1]] = (10, 4) You have to allow each of the characters to be r

Fetch Data from website using curl in Android? -

I have a simple application in which I have to get data from the website. I know that using the URL How data can be brought, but I have to execute it using curl. I mean first, we get data from website using curls and then put data in database. My website has a link I searched the Internet but found no solution. how to do this? Please help me get it in Android. It should help you References < / p>

Java applet still getting security error after signing jar -

I'm really wandering here. I have found an old applet and I have been told that people with Java version 7 will get the security error removed. I have received a code signing certificate from GoDaddy.com and signed the jar with it. I then put a new applet on Unix server where it is used by CGI web page (Apache Web server). Now I'm getting the error in saying that 'missing' is required in the main jar, the manifest attribute: [server url] /factorportal.jar I know there is not enough about java, applet, jar and certificates. Do any spoon do I need to do to run this applet without any errors? Only partial and very misleading information has been found in my Google searches, my unfamiliarity with the process is most likely to my problem. Since 7u25 you have the permissions: sandbox in Meta-INF / MANIFEST.MF file ( M option has been added to the jar command line utility). It is here that jar can verify its origin without raising the privilege, traditionally

c++ - Writing a log file with app running in non-admin mode in windows 7 -

My app needs to write and maintain the log file and it is not running in admin mode. My question is, how can my app write in such a situation, how can I get that way? There are two good options: Windows Event Log You can easily create your own log for your application (if you expect to generate a lot of messages), or you can add messages to standard logs (if you only generate a few, sometimes a message ) Since this is an underlying feature, any technical person wants to know about it and will be able to easily locate their log files. There is also much difference with this centralized management system. Write a text file saved in the application data directory. This is where applications have to store non-user data files, because as you have mentioned, the application directory is not something that you can write privileges. For a log file that is specific to a particular computer, I can say that this is local (non-roaming) application data, so you want the local

Rollback Transaction Error - Rails -

Some classmates and I have some problems in our train app for class. Whenever we try the user to the user, then create the ROR app on Rail Console. After filling out the required form, we get a rollback transaction. Any way to fix this? Here's the error: Rail Console development environment is loading (Rail 3.2.13) irb (main): 001: 0> Select User.count (0.0 mms) from COUNT (*) to "user" = & gt; 0 IRB (Main): 002: 0> User.create (name: "Mr. Rush", email: "rush@example.com", password: "firebar", password_confirmation: "fubar") (0.0ms) transaction user current (0.0ms) Select 1 Where "user" from one ("user". "Email") = LOWER ('rush@example.com ') LIMIT 1 (0.0 mms) rollback transaction = & gt; # & Lt; User ID: Zero, Name: "Mr. Rush", Email: "rush@example.com", Created_net: Zero, Updated: Zero, Password_Digest: "$ 2a $ 10 $ quwMA.4fcrBpg2sRy00qEOWrjH

.htaccess to create dynamic subdomain from subfolder -

I wonder how a dynamic subdomain can point to the root folder when the user searches for it. Like apples.domain.com, pointing to domain.com/apples (apple folder is already manually created), then if the apple folder does not exist, it receives 404. Please help, I am a Noah with this topic. Try: rewrite on the rewriting engine %% {HTTP_HOST }! ^ Www. [NC] RevokedContact% {HTTP_HOST} ^ ([^.] +) \. Domain \ .com $ [NC] REVIRCURD% {DOCUMENT_ROOT} /% 1! -D reveritium ^ - [L, R = 404] referenced% {HTTP_HOST}! ^ Www. [NC] RevokedContact% {HTTP_HOST} ^ ([^.] +) \. Domain \ com [nc] rewrite code% {DOCUMENT_ROOT} /% 1-D recriminator% {DOCUMENT_ROOT} /% 1% {REQUEST_FILENAME} -f [or] Rewrite% {DOCUMENT_ROOT} /% 1% {REQUEST_FILENAME} -d Revert Raul ^ (. *) $ /% 1 / $ 1 [L] The document root of domain.com in the htaccess file.

utf 8 - utf8_bin or utf8_unicode for my wordpress site? -

About the database I'm going to create a new blog based on WordPress, should I choose utf8_bin or utf8_unicode? I have read the difference between the two, but still things are not clear to me. Thank you for your help. If you are just creating a WordPress blog then it will not make much difference. But, according to me, you should go with UTF 8 Unicode.

ember.js - EmberRoute renderTemplate: with model: -

I'm trying a custom amber root, like the following: App ResultRoute = Ember.Route.extend ({renderTemplate: function (controller, model) {warning}; this.render ('result / main', {outlet: 'content', controller: controller});}, model: function (Parameters) {return.get ('store'). (Find 'results', parameters.id) then (function (result) {returns result;}}}}}} However, looks like RenderTapplate: Model does not like: Second Sh In these cases, I can get directly into the Render Tumblr when I reach the route, but when I try to apply the model in this way it does not work. How to do this task? Thanks, I think, you then Should not be used: model: functions (parameters) {return.get ('store'). Results, parameters; id); } The search method returns a wired object that is used by the amber routing process. I will also suggest giving the amber render template based on its default. In your case, App.ResultController must expand th

Chef cron provider creates multiple crontab entries -

We are running chef 11.4.4 with non-omnibus installs (this is installed as a gem). In one of our cookbooks, we use cron providers: checksum = digest :: MD5 HexDogest (node ​​['FDDN'] || 'Unknown-hostname') sleep_time = checksum.to_s .hex% node ['custom' command '] [' esplay ']. Two_I cron "custom_command" user "custom_user" hour 1 minute 0 command "/ bin / sleep # {sleep_time}; /home/custom_user/custom_command.sh" end It appears to be about 0.01% of the time multiple cron entries. On the affected server, we receive the following output from crontab -u custom_user -l : # Name of the chef: custom_command 0 0 * * * / bin / sleep 7035 ; /home/custom_user/custom_command.sh # Chef name: custom_command 0 0 * * * / bin / sleep 7035; /home/custom_user/custom_command.sh Running chef-client does not modify crontab. But editing the cronat and removing both entries and running the chef-client again will fix the probl

node.js - Forever not starting when using Jenkins -

So I have a Jenkins build that is always starting with the following command. Sudo NODE_ENV = Development Forever start- a -l /var/nodejs/app/logs/forever.log -o/var/nodejs/app/logs/output.log -e / Var / nodejs / app / log / error log /var/nodejs/app/app.js This command throws the following error. is running on the development server fs.js: 427 return binding.open (pathModule._makeLong (path), stringflag (flags), mode); ^ Error: ENOENT, no such file or directory on object.fs.openSync (fs.js: 427: 18) at Object.fs.readFileSync (fs.js: 284: 15) on object 'ssl / gd_bundle.crt' . & Lt; Anonymous & gt; Object on (module .js: 456: 26) Module._Applications.js (module.js: 474: 10) (/var/nodejs/app/app.js:190:10) on the module. Module._load on function (module .js: 312: 12) load (module .js: 356: 32) function on startup. Module.Rannman (Module JS: 497: 10) (node ​​.js: 119: 16)) at node.js: 902: 3 Error: Skipped as usual detected the script code: 8 < / pre>

wpf - Wait until a background worker is completed without locking out the main thread -

I am trying to run a background worker with a spinner running in the main thread and I would like to wait till then Unless the background worker is finished. Currently I have one or the other I have tried to use an auto reset event, but locking the main pouch so the spinner is not displayed is something similar to the auto reset event which locked the main UI Here I have some code backgroundwalker_boker = new backgroundwork (); _bWorker.DoWork + = _bWorker_DoWork; _bWorker.RunWorkerCompleted + = _bWorker_RunWorker contains; AutoResetEvent = New AutoResetEvent (incorrect); _bWorker.RunWorkerAsync (); // Wait until the background worker is finished. Wait (); ... Private Zero _bWorker_DoWork (Object Sender, DoWorkEventArgs E) {// Spinner Wait SpinnerAdornerText = "Work"; IsWaitSpinnerVisible = True; ... ready(); } Private Zero contains _bWorker_RunWorker (Object Sender, RunWorkerCompletedEventArgs e) {IsWaitSpinnerVisible = false; ...} Any thoughts? Any help is welco

Using a python program to rename all XML files within a linux directory -

Currently, my code uses the name of the XML file as a parameter to take that file, some of it Parsing content and using it to change the name of the file, what I mean is that my program is actually run once and that program will search for every XML file (even if it's inside the zip Too) inside the directory and the same pai Let's name it using the ramometer which is what I'm having problems with. # encoding: utf-8 import os, sys import argv with script again, nombre_de_archivo = argv regexFecha = 'r \ "\ d {4} - \ d {2} - \ D {2} 'regexLocalidad = r'localidad = \ "[\ w, S, -_] * \"' regexNombre = r'nombre = \ "[\ w \ s., -_] * \" 'RegexTotal = r'total = \ "\ d +.? \ D + \" 'fechas = []; Local Dindex = []; Nombres = []; totales = [] archivo = open (nombre_de_archivo) for line in archivo.readlines): fechas.append (re.findall (regexFecha, linea)) localidades.append (re.findall (regexLocalidad, linea)) n

nasm - disassembly issue: wrong result -

I want to separate a very simple line of binary code (.com file) with nasm but I do not expect output The main code is: mov ax, 4 ax ax mouse ax, 7 push 9 But there is output in nasm: (and I also tried To use IDA Pro and this was the same) Add 00000000 B80400 mov ax, 0x4 00000003 B80750 mov ax, 5007 00000006 006809 [bx + c + 0x 9], add 00000009 0000 [BX + SI], Al As you can see that binary code is correct, just the interpretation is wrong (I think because of the previous 3 extra zero bytes which I am due to any other program or maybe something else !) How do I leave the last zero in the binary code? Or any kind of nasm to interpret the code as I want? thanks B80750 is actually mov ax, 0x5007 there is nothing wrong is. Anyway, the given code piece should be collected in something like this: 00000000 B80400 mov ax, 0x4 00000003 50 push ax axis 00000004 B80700 mov ax, 0x7 00000007 6A09 push Byte + 0x9 If you have collected the .com file then you are doing

java - Android - Listening for incoming TCP/Socket messages in background -

I am trying to write a little application that sends TCP messages to the Java server running on PC (printed freer with). Now the client should listen in the background for incoming messages from the server in the background. How can I update incoming messages from GUIs with background messages? "post-text" itemprop = "text"> We want to spin a background thread for this. The easiest way is to use an asynchronous and then use it on PostExecute, or publish the progress, to display your message safely in the UI. Check out.

syntax - How to get numbering to flow properly in Table of Contents -

Can anyone tell me why the following code is not a correct number? I am following the instructions, although the numbering does not continue to the previous 1. I am very new to coding, so any help would be greatly appreciated! & lt; ol class = "inhoudsopgave" & gt; & Lt; li class = "inhoudsopgave" & gt; & Lt; A href = "#" & gt; & Lt; / A & gt; & Lt; / li & gt; & Lt; ol class = "inhoudsopgave" & gt; & Lt; li class = "inhoudsopgave" & gt; & Lt; a href = "# & lt; / a & gt; ol class =" inhoudsopgave "> In short, your list is a mess. You nest your OS inside the OLS Are hunting. If you want to create a list with sub-lists, then archeology should look like this. & lt; ol class = "inhoudsopgave" & gt; & Lt; li class = "inhoudspeag" & gt; & Lt; A href = "#" & gt; & Lt; / A & gt; &

macros - Change font when using MacroButton placeholder in MS Word -

Image
एमएस वर्ड में आप इन्हें बना सकते हैं: एक नया क्षेत्र डालें ( Ctrl + F9 ) टाइपिंग MacroButton NoMacro [ यहां पाठ प्रविष्ट करें ] कोष्ठक के अंदर {} फिर इसे संपादन मोड ( Alt + F9 ) से टॉगल करना यह ऐसा करेगा: < / p> मेरे टेम्पलेट में, खाली फ़ील्ड हाइलाइट में क्यू : क्या कोई व्यक्ति फ़ॉन्ट भरने के बाद फ़ॉन्ट को बदलने का एक तरीका है? एक मूल्य? हाँ, यह संभव है। MacroButton का उपयोग करना के साथ नो मैकारो केवल एक क्लिक के साथ पूरे पाठ क्षेत्र को आसानी से प्रकाश डाला जाता है शब्द में किसी भी हाइलाइट ऑब्जेक्ट के साथ, जब आप टाइप करना शुरू करते हैं, तो यह चयनित भाग को हटा देता है और बाएं सबसे तत्व की शैली के आधार पर नए पाठ को प्रारूपित करता है (जो इस मामले में फ़ील्ड है - भले ही इसे प्रदर्शित नहीं किया गया हो)। शैलियों को बदलने के लिए, बस पूरे क्षेत्र और स्वरूपण को हाइलाइट करके शुरू करें, लेकिन आप परिणाम को समाप्त करना चाहते हैं। फिर पाठ के भाग और प्रारूप को हाइलाइट करें, हालांकि आप प्रांप्ट को प्रदर्शित करना चाहते हैं। जब संपादन मोड में, यह इस तर

sql - MySQL: Count of records with consecutive months -

I searched for it, but all the same questions and answers are not enough to just work. I have a table with the following fields: person, thing, purity, a new record is recorded when a person buys every new thing. I have to count the months in my life, who gave a person "cheese" (cheese 01 or cheese 02, it is not a mater). If there is a break in fourteen consecutive times, then counting should begin. Attached to the data, I want to end it: | Person Days of Cones | | Person_01 | 3 | | Person_02 | 3 | | Person_02 | 2 | I know that I can get a different list of people, (year old to remove) - what I have done in this - but I'm not sure how to count then Continuous record and start at break (like my data, where the person breaks between 0/22 March and May.) Here is the data: Table record (Person varchar (32) not tap, talk varchar (32) no null, vintage date time zero); Enter the record (person, object, purity) values ​​('person_01', 'thing01'

android - requestFeature() must be called before adding content error on super.onCreate -

मेरे पास एक सार वर्ग है जो ActionBarActivity को बढ़ाता है। onCreate में, मेरे पास है: @Override सुरक्षित शून्य को क्रिएट (बंडल सहेजे गए इन्स्टैंसस्टेट) {super.onCreate (SavedInstanceState); supportRequestWindowFeature (Window.FEATURE_INDETERMINATE_PROGRESS); ...} सामग्री त्रुटि, विशेष रूप से लाइन super.onCreate (सहेजे गए इन्स्टैंसस्टेट) पर, requestFeature () के कारण एप्लिकेशन क्रैश हो जाता है। समान पदों के कुछ पढ़ने के बाद, मैं इस समाधान के साथ आया था: @Override संरक्षित शून्य OnCreate (बंडल savedInstanceState) {requestWindowFeature (Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate (savedInstanceState); ...} मेरा सवाल है: सुपर कॉल पर यह क्यों क्रैश हो रहा है? इसके अलावा, मैं सेटिंग कंटेंट वीज कक्षाओं में नहीं हूं, जब तक कि मैं इस कोड को बढ़ाता हूं जब तक कि मैं super.onCreate कॉल नहीं करता हूं। । Android.util.AndroidRuntimeException: गतिविधि ComponentInfo {com.myapp / com.myapp.cycle.Cycle} प्रारंभ करने में अक्षम: requestFeature () चाहिए यह अभी भी कभी-कभी

php - Symfony - Making dev environment inaccessible in prod -

I have recently deployed a Symphony project and have seen that Dev Environment is still accessible. The following URL loads the prod version of the project: http://domain.com/app.php/index < P> The following URL version loads the project: http://domain.com/app_dev.php/index I was thinking that Is it possible to make the Dev version impossible in the project environment? I appreciate any advice, thanks in advance! Add the following lines of code to your app_dev.php // This checkdog prevents access to front controllers which are positioned on the production server by accident. // Free to remove it, extend it, or refine something more. If (! In_array (@ $ _ SERVER ['REMOTE_ADDR'], array ('127.0.0.1', ':: 1',))) {header ('http / 1.0 403 prohibited'); Exit ('You do not have permission to access this file.' Check '.basename (__File__).' For more information. '); }

regex - Weird apache htaccess behavior, not working as its supposed -

My Apache Forwarding works with a weird twist I'm not sure why this is happening ... 301 / old / new redirect /old/some_file2.html code> forward /new/some_file2.html for / old / some_folder21 / for me / new / some_folder21 "post-text" itemprop = " text"> You can use RedirectMatch for its regex capabilities Must do: RedirectMatch 301 ^ / old / new or mod_rewrite : remit rules ^ /? old (/.*)? / / new? [L, NC, R = 301]

html - Can't get inline icon to show up in CSS -

I have a very simple Chrome extension to complement the web page. One of the features is to see relevant matches on the Internet. Link is to add The relevant HTML is here: & lt; div class = "option-wrap" & gt; & Lt; A class = "option" href = "http://www.google.com" target = _blank & gt; & Lt; div class = "option-icon tv-icon" & gt; & Lt; / Div & gt; TV link & lt; / A & gt; & Lt; / Div & gt; with my CSS here: .tv-icon {margin-right: 2px; Swim left; Width: 10px; Height: 10px; Background-image: url ("http://sayeedanwar.co.uk/wp-content/uploads/2014/01/tv-servizi.png") No-repeat; Display: Inline-block; } You will see that many squares appear in HTML which are not in my CSS; They are from web page because it exists. The goal of this code is to get the TV icon specified by the url to appear inline on the right side of the "TV link" text. When I run the code, it seems th

javascript - processing.js inside handlebars not loading -

I have an HTML canvas element that uses a processing. JS script as shown here: & lt; Canvas id = "micekette" data-processing-source = "form.pde" & gt; & Lt; / Canvas & gt; This canvas element is inside a handler script, at the end of the file, before the closing body tag, I have: If I put the canvas inside the Handlabar script, then the processing script does not render. (I think this is a processing script, though it is the last thing in the HTML file, which gives before the handlers script, and so is made even before the canvas element. I'm not sure.) < p> If I put the canvas processing outside the handlers script, it renders correctly, but I need to do it inside the handbar script. Maybe, there is a way of running the processing after all running? processing.js Only loading automatic scripts on content content loading. If you are templating your canvas later (i.e. through the templatelining library), you will have

vim - How can I put cursor back to netrw window after finish editing -

After opening a file in my gvim , it seems ________________________ | | | | | | | | | | NETRW | Editor | | | | | | | | | | ------------------------ The file will open in the default cursor editor window, which is good, but How can I go back to the netRw window after full editing so that I can choose or open other files? Yes, you & lt; C-w & gt; H or & lt; C-w & gt; & Lt; Left & gt; Previous window or & lt; C-w & gt; To go to w the left window or for the circle between the window & lt; C-w & gt; p Help view : window-move cursor .

ios - Detect If between time periods -

I'm having trouble with the code given below. What's the problem with it? I have tried to define the NSUInteger as int , but it still does not work. NSCalendar * cal = [NSCalendar currentCalendar]; NSDateComponents * Component = [KAL component: NSHourCalendarUnitDate: now longer]; NSLog (@ "% LD", [hours of components]); NSUInteger * timeHour = [component hours]; If it is between 5 and 9 in the morning for the code, then it can be ascertained that . > Anything that is timeHour & lt; 5 Automatically timeHour> 9 . You are desirous of these two situations, which can never be true at the same time, so you will always make a wrong return. In addition, if is nothing in the block if (timeout => 5 & amp; amp; Time holes & lt; = 9) {// stuff} timeHour> = 5 gives the right for anything where is greater than or equal to 5. Time gives the right for anything where timeHour is 9 or less. another amp; Amp; Both

arrays - Getting Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5 -

इस सवाल का पहले से ही एक उत्तर है: < / P> 2 जवाब मैं प्रोग्रामिंग के लिए काफी नया हूँ और मेरे शिक्षक ने हमें यह काम दिया है मैंने कोड को अपने सबसे अच्छे रूप में एक साथ रखा है लेकिन मुझे त्रुटि मिल रही है मेरा लक्ष्य 5 लोट्टो नंबरों के लिए एक सरणी बनाना है और 1 पावर बॉल नंबर है, पहले पांच नंबर 1-47 से हैं और पावर बॉल 1-27 है। तब उपयोगकर्ता को वे टिकट की संख्या दर्ज करनी होगी जो वे चाहते हैं और प्रोग्राम को टिकट के प्रारूप में प्रिंट करना होगा 1 2 3 4 5 मेगा: 6. कृपया मदद! import java.util.Scanner; पब्लिक क्लास सुपर लोट्टोप्लस {// स्क्रिप्ट पब्लिक स्टैटिक इन्ट [] जेनरेट करेंसूपर लोट्टनज्यूमेंट्स () {इंट्र [] नंबर; संख्याएं = नया इंट [5]; संख्याएं [0] = (इंट) (47 * मठ। रैंडम ()) + 1; नंबर [1] = (इंट) (47 * मथ.रेन्डम ()) + 1; संख्याएं [2] = (इंट) (47 * मथ.रेन्डम ()) + 1; नंबर [3] = (इंट) (47 * मथ.रेन्डम ()) + 1; संख्याएं [4] = (इंट) (47 * मथ.रेन्डम ()) + 1; संख्याएं [5] = (इंट) (27 * मथ.रेन्डम ()) + 1; वापसी संख्या; } // विधि मुद्रित करने के लिए विधि सार्वजनिक स्थिर श

vb.net - What is the c# of this vb code? -

I need to convert this vb code to c #, my problem is that i do not understand Whether VB has an object and what is its equivalent is in C #. Summary () as the new summary; Dim row = summary as the data row. NewRow () Dim info as Hashtable = reader.Info For every key in the form of information in the string. Case Case Case "Headline" line ("title") = info.Item (key) case "author" line ("author") = info.Item (key) case "subject" line ("subject") = info Select the end summary .meem (key) Rows. Add (line) C # equivalent information [key] . You can find additional information on the Microsoft website:

php - Login Script does not function -

I am having a minor problem with this login mechanism. This does not login to the user on most conditions if the user is newly registered So it works fine but then all other usernames are useless. The login.php page is as follows: This is the script I use to see if the user is logged in or not. I paste it on all my pages. & lt ;? Php $ username = $ _COOKIE ['username']; if ($ username == "") {echo '& lt; Form name = "login" action = "login.php" method = "post" & gt; & Lt; Label & gt; Login & lt; / Labels & gt; & Lt; Label = "username" & gt; Username: & lt; Input type = "text" name = "username" & gt; & Lt; / Label & gt; & Lt; Label = "password" & gt; Password: & lt; Input type = "password" name = "password" & gt; & Lt; / Label & gt; & Lt; Input type = "submit" & gt; &

python - Why doesn't "%0.2f" % (.3) return "0.29"? -

The IEEE 754 floating point value for 0.3 is approximately 0.29999999999999998. Based on this, it looks like when you execute "% 0.2f"% (.3) , then Python should print "0.29" But, it actually prints "0.30" What does Python do behind the scenes to get string representation? Edit : This is interesting: In existing versions, Python displays a value based on the least decimal fraction Returns the correct binary value Rounding rounds the Python number, And 0.29 9999 is the goal of two decimal digits 0.30.

php - Trying to get a list of team names a member is a part of via comparing 2 sql tables -

Trying to get user teams is a part of comparing 2 tables DB Tables (team) 'varchar' (45) default faucet, 'TeamDesk Longtext', 'Founder' varchar (45), 'team dim' (11) faucet atangentement, zero, `date formatted` integer (11) Primary key (`timid ')) engine = InDebby Outangent = 2 defaults charset = Latin 1; The table 'TeamManbars' (`Timed 'int (11) faucet,' Member 'varchar (45) No,' rank 'varchar (45) default faucet, primary key (` timid') engine = InnoDB default charge = latin1; The current function is to stuff me: / * removeProject * / function getTeamNames ($ id) {global $ session, $ database; $ link = $ database-> Connection; $ Stmt = $ link- & gt; Prepare ("WHERE teamid = $ id" from select teamnames teams); $ Stmt- & gt; Executed (); $ R = $ stmt-> Fetch (); Returns array ('team' = & gt; $ r ['teamname']); } Questions for getting team names: $ link = $ da

Django 1.6.2 - Python 3.3 - MySQL 5.6.17 Connector issue on Windows 7/8 -

मैंने कोशिश की: अजगर manage.py syncdb लेकिन इस त्रुटि से पता चला: ट्रेसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "सी: \ पायथन 33 \ lib \ site-packages \ django \ db \ backends \ mysql \ base। py ", पंक्ति 14, & lt; मॉड्यूल & gt; MySQLdb को डेटाबेस आयात के रूप में आयात करें: त्रुटि: कोई भी मॉड्यूल 'MySQLdb' मैंने यहां से अजगर 3.3.5 डाउनलोड किया है: और यहां से MySQL - Python कनेक्टर: < / p> मैं इसे Windows मशीन पर सेट करने का प्रयास कर रहा हूं। यह कोशिश कर रहा है कि कोई भाग्य भी नहीं है: pip mysql-python settings.py में 'इंजन' के रूप में इंजन बदलें: 'mysql.connector.django',

clojure - PI Approximation: Why is my declarative version slower? -

Image
मैं श्रृंखला का उपयोग कर पीआई का अनुमान लगा रहा हूं: श्रृंखला के लिए फ़ंक्शन इस तरह दिखता है: (defn-pi- सीरीज [के] (/ (यदि (यहां तक ​​कि (इन्फ क) 1 -1) (डीसी (* 2 के)))) और फिर मेरी श्रृंखला जनरेटर * जैसा दिखता है: (defn pi [n] (* 4 (लूप [k 1 acc 0] (यदि (= k (inc n)) एसीसी (पुनरावृत्ति (inc k) (+ एसीसी (डबल ( pi-series k))))))))) चल रहे pi के साथ मान 999,999 निम्न का उत्पादन करता है: (समय (पीई 99 99 99));; = & gt; "बीता समय: 497.686 मिसेज";; = & gt; 3.1415 936535907734 यह बहुत अच्छा लग रहा है, लेकिन मुझे पता है कि pi अधिक घोषणात्मक लिखा जा सकता है यहां बताया गया है: (defn pi-fn [n] (* 4 (कम करें + (नक्शा # (डबल (पी-सीरीज%)) (श्रेणी 1 (inc n) ))))) निम्न में जिसके परिणामस्वरूप: (समय (पीआई-एफएन 99 99 99));; = & gt; "बीता समय: 4431.626 मिसेज";; = & gt; 3.1415 936535907734 नोट: घोषणात्मक संस्करण लगभग 4 सेकंड लंबा ले गया क्यों? क्यों घोषणात्मक संस्करण इतना धीमा है? मैं इसे अनिवार्य संस्करण के रूप में तेजी से

python - Using 'If' to run the loop again? -

I'm producing 2 arrays of random numbers from 3 to 3 (this is my x and y coordinate accordingly ). However, if I use a loop related to X and Y over my radius (which is 3) then what is the need to create a new set of numbers? If I take this loop to get it after my loop? import random N = 3x = zero (N, float) y = zero (N, float) in the range for i (0, n): x [ii] = Uniform (6) -3 y [ii] = uniform (6) -3 if (x [n] * 2 + y [n] ** 2) ** 0.5 & gt; 3: thanks Most random library modules have a regular interval [0,1] but to return a floating point number from the same distribution. To choose randomly from an equal distribution on the [a, b] interval, where B & gt; One, you can only multiply by ba , and then add a . I'm not sure which modules you are importing in your example, so I give examples using standard random modules, as well as numpy.random < Strong> random import random def rand_range (a, b): i + rand_range (-3, 3) for range i = in category

php - How to remove a data uri from text using a regular expression? -

What is a great way to remove data URI from a block of text with regular expression ? My application has to be removed from email body texts because Amazon SES (Simple Email Service) rejects any email with data URI. . They should also be removed for security purposes Example data URI: data: image / gif; Base 64, R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o / XBs / fNwfjZ0frl3 / zy7 //// wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7 It can be surrounded by quotes such as HTML: & lt ; img src = "data: image / gif; base64, R0lGODlhEAAQA ...." / & gt; Or this can be a CSS background: Background: URL (Data: Image / GIF; Base64, RLGODLAAAAAAAAA ... .); This should do the trick: $ Regex = '~ Data: [^;] +; [E-za-j 0-9] +, [^] \ '\ s] + ~'; $ Body = preg_replace

Why does this CSS3 Animation happen instantly? -

मुझे इस CSS3 एनीमेशन के साथ समस्याएं आ रही हैं: @ - webkit-keyframes hide_card {0% {width: 250px; मार्जिन-बाएं: 10px; मार्जिन-दाएं: 10px; सीमा चौड़ाई: 3px; } 100% {चौड़ाई: 0 पिक्सेल; मार्जिन-बाएं: 0 पिक्सेल; मार्जिन-दाएं: 0 पिक्सेल; सीमा चौड़ाई: 0 पिक्सेल; }} @ -मोझ-कीफ्रेम लपेटाकार्ड {0% {width: 250px; मार्जिन-बाएं: 10px; मार्जिन-दाएं: 10px; सीमा चौड़ाई: 3px; } 100% {चौड़ाई: 0 पिक्सेल; मार्जिन-बाएं: 0 पिक्सेल; मार्जिन-दाएं: 0 पिक्सेल; सीमा चौड़ाई: 0 पिक्सेल; }} @ -एमएमएस-केफ्रेमों लपेटोकार्ड {0% {width: 250px; मार्जिन-बाएं: 10px; मार्जिन-दाएं: 10px; सीमा चौड़ाई: 3px; } 100% {चौड़ाई: 0 पिक्सेल; मार्जिन-बाएं: 0 पिक्सेल; मार्जिन-दाएं: 0 पिक्सेल; सीमा चौड़ाई: 0 पिक्सेल; }} @कीफ्रेमें लपेटकार्ड {0% {width: 250px; मार्जिन-बाएं: 10px; मार्जिन-दाएं: 10px; सीमा चौड़ाई: 3px; } 100% {चौड़ाई: 0 पिक्सेल; मार्जिन-बाएं: 0 पिक्सेल; मार्जिन-दाएं: 0 पिक्सेल; सीमा चौड़ाई: 0 पिक्सेल; }} यहां तत्व है: .activity। Card.invisible {width: 0px; सीमा चौड़ाई: 0 पिक्सेल; मार्जिन: 0 पिक्स; अस्पष्टता: