Posts

Showing posts from February, 2010

java - Parameterization entity with JPA -

I am trying to create a unit to parameter the values ​​of business rules, I have name, type and value Value: Value: Type: value (double) Value: 20 Usage will be done in a rule to add 20% of the value of the imported product. But I have many situations in the form of string, boolean or multi-valuable I thought of something like this: @NotEmpty private string name; // Enum @Enumerated (EnumType.STRING) @Enumeration (enumClass = ParameterType.class) with possible type (text, value, boolean, etc.) Private parameter type type; @OneToMany (mapped = "value") private list & lt; Parameter Value & gt; Values; ParameterValue unit, how can I implement it, because the value can be of different types (double, string, boolean, etc.)? This does not work: public class parameter value {Private object value; } Reason: org.hibernate.MappingException: Number of columns in property mapping is incorrect: br.entity.admin.ParameterValue.value Type: Object "}} ...

ios - Printing value of a optional variable includes the word "Optional" in Swift -

इस सवाल का पहले से ही एक उत्तर है: 6 उत्तर 3 जवाब .मैं आईओएस और स्विफ्ट के लिए नया हूँ। अपने आवेदन में मैं एक वैकल्पिक मूल्य को मुद्रित करने की कोशिश कर रहा हूं और यह प्रिंट करता है "वैकल्पिक वेरिएबल) "मैं यह शब्द कैसे वैकल्पिक var bDay = StringUtils.convertDateToString (जन्मदिन, प्रारूप: Constants.BIRTHDAY_FORMAT) को हटा सकता हूँ उम्र = self.clientDetail? .getAge () println ("उम्र ..... \ (उम्र)") bDay + = "\ (उम्र)" कंसोल में आउटपुट आयु ..... वैकल्पिक (2 9) मैं एक यूआईएलबल को इस वैरिएबल को आवंटित करने की कोशिश कर रहा हूं लेकिन स्क्रीन पर यह दिखाई देता है कि 17 सितंबर, 1986 वैकल्पिक (29) मेरा उद्देश्य इस वैकल्पिक को दूर करना है शब्द और इसे सितंबर 17, 1986 (2 9) पहले से धन्यवाद वैकल्पिक चेनिंग का यहां प्रयोग किया जाता है: उम्र दें = self.clientDetail। .getAge () तो वापसी getAge () वैकल्पिक मान है वैकल्पिक बाध्यकारी प्रयास करें: यदि उम्र = उम्र {println ("उम्र ..... \ (उम्र)")} या बस खोलना...

html5 - Wrong controller action in rails form with link -

मेरे पास एक फ़ॉर्म है ... = form_for_for_form_, url = & gt ; Update_path,: method = & gt; : क्या करें | फॉर्म | = Form.input_field: name = link_to image_tag asset_path ("icon.png"), {: नियंत्रक = & gt; 'नियंत्रक / नाम',: एक्शन = & gt; 'हटाएं',: id = & gt; Some.id} = form.submit ऊपर के रूप में मेरे पास एक लिंक / इमेज / आइकन है, जो क्लिक पर कार्रवाई नियंत्रक को हटाना चाहिए, लेकिन किसी कारण से यह सूचकांक नियंत्रक को जाता है कार्रवाई। क्या कोई बात कर सकता है कि यहां क्या गलत है? जब आप एक संसाधन मार्गों को परिभाषित करते हैं, तो हटाए जाने की क्रिया को उसी url के रूप में परिभाषित किया जाएगा जैसा कि अपडेट करें कार्रवाई (जो कि PUT या Patch HTTP क्रियाओं का उपयोग करके एक्सेस की जाती है), लेकिन इसे DELETE HTTP क्रिया का उपयोग करके एक्सेस किया जाता है आपको बस अपने ऑब्जेक्ट के अपडेट पथ के लिंक को सेट करना है और इसके बजाय DELETE क्रिया का उपयोग करें: = link_to image_tag ( "Icon.png"), update_path (id: some.id), विध...

qa - Apache JMeter - how to enter a web page and save a parameter? -

I have never used Jmter before and I have to write a script which will usually do the following: Use this parameter to enter another page Enter a web page Save a parameter from the page's resume Use this parameter to enter another page If you can guide me step by step then actually evaluate it. Thanks! See the link below: The recording scenario Correlation (find out the findings between pages and pass) Hope This will help.

javascript - responsive html content carousel plugin or without -

Image
I'm trying to create a responsive HTML content carousel. As shown on the image below. This is trying to use jQuery Cycle2, but I could not find the effect I was looking for. Finding such plug-ins will be able to do that I thought maybe the simple solution would be to try plain javascript / jQuery. Found this topic, I am still struggling to achieve this with the responsible elements. Any help would be greatly appreciated - I am not saying that it should be without a plugin which is not difficult to implement and probably without much more land. Use "bootstrap": You simply type the desired style . & lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-xs-12 col-sm-12 col-md-4 col-lg-4> your first box here your third box here & lt; / Div>

r - Filter rows below a given row element within a group -

I have a datafile with one set of events dated in each row linked from one place to another Index is a series of events and different matches that could have been done after the first and / or index events. Every place needs to reduce all the events occurring before the index event. I data structure looks like this. Localized match date score iid 1 index 4/11/2013 15 1 1 Milan 1/09/2013 23 2 1 Milan 14/04/2013 1 3 1 Milan 7/1/2014 21 4 2 Index 2/4/2013 12 1 2 Milan 1/2/2013 10 2 3 Index 1/5/2013 23 1 3 Milan 2/5/2013 10 2 4 Index 3/3/2013 9 1 4 Milan 10 / 2/2013 32 2 4 Match 1/10/2012 15 3 4 Match 4/3/2013 12 4 4 Milan 10/3/2013 10 5 And to reduce dataframe Is required so that each location needs to end with the rows below the date of the index event. localized match date score iid 1 matched 1/09/2013 2013 23 2 1 match 14 / 04/2013 1 3 2 Milan 1/2/2013 10 2 4 Milan 10/2/2013 32 2 4 Milan 1/10/2012 15 3 I ask here for the first time, so I hope that I am not doing it wrong. ...

java - convert iso 4217 numeric currency code to currency name -

I have ISO 4217 numeric currency code: 840 I want to get the currency name: USD I am trying to: currency curr1 = currency .get instances ("840"); But how do I fix java.lang.IllegalArgumentException ? Any ideas? java.util.Currency.getInstance only supports ISO 4217 Currency Code No, currency numbers, however, you can retrieve all the currencies by using the getAvailableCurrencies method, and then the result of the getNumericCode method By comparison, you can search for code 840. Like it: Public Stable Currency Matchinance (Int Numericcode) {Set

Java 2 Platform, Enterprise Edition 1.3 Specification -

Do anyone know where I can find it? Google will not be open and it is not working too Google has not helped a lot. I have got the specification for 1.2 and 1.4 but can not get it for 1.3. Is it after you? This is not the last version but should be closed.

web - Crawler to extract only content, excluding photos/ads and etc' -

Anyone know a good open source crawler, I can only use to remove the contents of the page, whose Means only text / photos / text without menus and etc. '? If you know how ads appear in HTML, then you can do this. This is a very flexible open source web crawler when you configure your Importer module, you can ask it to strip sections of text before and after some tags, or what to strip between known tags Are there. To give you an idea, if you know that a certain site displays it, ads between these tags: & lt; Div class = "myAdd" & gt; ... add to ... ... & lt; / Div & gt; The related Importer section will then look like this: & lt; Transformer class = "com.norconex.importer.transformer.impl.StripBetweenTransformer" inclusive = "true" & gt; & Lt; StripBetween & gt; & Lt; Start & gt; & Lt ;! [CDATA [& lt; Div class = "myAdd" & gt;]] & gt; & Lt; / Start> & Lt; E...

javascript - express.static, pending files -

I am using express.static to serve several stable files: App.use ("/ property", express.static (process.cwd (+ + "/ build / asset")); It works correctly most of the time, although in some cases (especially when many files are downloaded once) file pending one minute Or holds for two. I am using: Express: 4.9.5 node: v0.10.31 chrome: 36.0.1985.125m I have tried to debug it, the problem occurs when the session closes etc. The problem does not occur when there are only a few files. Any idea how files are actually being finally admitted, this issue can not be done with the code. . Here are some places I would suggest that you look for the problem Do you have too many files in the '/ build / assets /' folder? Is there any other process to type disk? There are some big files that are taking a long time to serve and hence block requests for other files

javascript - Angularjs change scope variable on window resize -

I am trying to change scope variable: $ scope.tab The size changes and the $ scope.tab == 'more' . code: $ scope.closeMoreTab = function () {if ($ scope.tab == 'more') $ scope.tab = 'extra'; }; Angular.element (.bind) .bind ('resize', function) ($ scope.closeMoreTab ();}); Well, it is actually calling $ scope.closeMoreTab () , and this is actually $ scope.tab The variable is changing, but in reality, it does not change anything on the scene. I tried: console.log ($ scope); to check the variable tab and it actually changes to 'extras', but when I do: & lt; Div & gt; ; {{Tab}} & lt; / Div & gt; It shows me that the current tab variable is still 'more' Please help me get stuck with this 1 hour and why not Is or what to do. Thank you very much You can get your $ scope.closeMoreTab () ; $ scope in $$ Apply function, as it currently changes the value, but does not do the 'trigge...

c# - TryParse create inline parameter? -

Is there any way to create a convertible inline in C #? Something like this: int x = int.TryParse ("5", out of the new int intender) IntOutParameter: 0; Do you think it is more useful than creating a variable and then never using it again? Announcement Expressions - The proposed feature list for the next version of C # (version 6) was on the list. You think this is only useful. For example, call a complete TryParse (there is no need to give a statement to declare a variable). Although from current work to C # 6 I'm sure I'm not the only one hoping that it will return to the future version. This is included in C # 7 as the declaration ( new ): int x = int.TryParse ("5", int intOutParameter )? IntOutParameter: 0;

javascript - Form validation with more than one files and other input fields together -

I have a form that allows the user to upload text input and upload at least one file, from 1GB With less file size. When clicking the "Submit" button on the form, this requirement will be validated by JavaScript. However, when I add validation to the file, there is no response to display the file name and size, especially if the file is more than 1 GB. Which of the following would be better? Check the file size after selecting the file, if the file size is greater than 1 GB, then the user will be given an alert to say that the file is too large and it will To choose from. After selecting the file, before going to PHP to upload the file to the server, clicking on the "Submit" button, the full form including the input text field and the file size validation, with Javascript is done . Here's my form: & lt; Script type = "text / javascript" src = "validate.js" & gt; & Lt; / Script & gt; & Lt; Form id = "f...

Inno Setup Reading a Registry Gives Empty String -

I'm new to these setup, so let me tell you that this question is for childish. Shows: RegQueryStringValue (HKEY_LOCAL_MACHINE, 'Software' Altera Corporation \ Quartus', 'Quartus Version', QR_ver); Results: = True; QR_ver should have a value inside 'quartus version', but instead it returns an empty string. And of course, I examined 'quartus version', it is not empty. It contains a '14 .0 'value please My Crystal Ball Tell me that you are on a 64-bit system and in this way you have verified that value in the 64-bit regattat. If so, use the HKLM64 Root Key instead of HKEY_LOCAL_MACHINE The default regedit on 64-bit systems is 64-bit and shows 64-bit views on the registry (32-bit view shows under WOW6432Node node). Inno Setup Maps (by default) for 32-bit views and thus you could not read it. - (Credit: Tilama)

c# - cannot convert string to datetime using ParseExact -

I have a string like this in the XML string data file (in 12 hour clock): expires = "10/27/2014 2:42:57 PM" I used that value as a member of a class (datetime) in this way Assign to: General. OEE XPRIZ = Datetime. Parsexact (GSAT attribute ("expires"). Value, "MM / DD / YY HH: MM: SS", Culture Info. Inverteenthalic); But I'm getting the error 'string not recognized as a valid date time' What am I doing wrong here? This should be BTW in the UK, so cultureInfo should be cured It should be : "MM / DD / YY H: mm: SSTT" As you know about tt For AM / PM, and H because you have 1-12 hours, not the format 01-12. Think if your seconds and minutes should be s and m

Single plus operator in javascript -

इस सवाल का पहले से ही एक उत्तर है: 12 जवाब बस इसे अंडरस्कोर के स्रोत में देखा : यदि (obj.length === + obj.length) {...} प्लस क्या करें? मैंने इसे पहले कभी नहीं देखा। क्या यह डेवलपर्स के बीच एक अच्छा अभ्यास माना जाता है? यदि (obj.length === संख्या (obj.length)) {// ...}

java - Can junit test method throw an exception? -

Can you please tell me the general practice to write example alias genus test, which throws an exception, example For example, the class A {public string F (int param) throws an exception (if (absolute == 100500) throw a new exception (); return "";}} private object object = new A (); @Test Public Zero Test Some Throws Exception {String Expected = ""; AssertEquals (object.f (5), Expected);} In fact, Method f () does not throw an exception for that parameter (5), but I still have to declare that exception. Yes it's perfectly ok, and if it throws an exception, then the test will be treated as unsuccessful. The method requires that the method break a exception , even if you know that there is no specific case (this is done by the check compiler). In this case, what do you expect object.f (5) gives an empty string Any other result (without empty string or throw an exception) will result in unsuccessful test case .

c# - Pass value from view to controller using DisplayFor -

I want to give the controller the value of the model from the scene. When I go to @ Html.TextBoxFor , the value goes to the controller, but when I use @ Html.DisplayFor , the value is in the controller null is there. View.cshtml @using (Html.BeginForm ("EditView", "Home")) {@Html. TextBoxFor (model = & gt; model.Name) // The first method is @ Html.DisplayFor (model => model.Name) // The second method is & lt; Input type = "submit" value = "OK!" Class = "btn btn-success btn-sm" /> } Administrator Public ActionSecult Edit View (Modellist Models) {Redirect Return Action ( "Index"); } Basically, the controller value is received for the first time; But for the second time, it becomes null how can I solve it? @ html.DisplayFor just display values ​​in the view. If you want to return the value to the controller on the poster, then you @ Html.HiddenFor

recursion - Recursive Assembly Program -

निम्नलिखित कोड सीधे पुस्तक से है: INCLUDELIB C: \ Irvine \ Kernel32.lib शामिल सी: \ इरविन \ Irvine32.lib सी शामिल हैं: \ इरविन \ Irvine32.inc। मुख्य कुंजी प्रोक पुश 5; कैल्क 5! फैक्टोरियल कॉल; फ़ैक्टिकल (ईएएडी) की गणना करें WriteDec; इसे सीआरएलएफ एक्जिट मेन ईएनडीपी पर कॉल करें; ------------------------------------------ ---------------- फैक्टोरियल प्रोसी; एक फैक्टरियल की गणना करता है ; प्राप्त करता है: [ईबीपी + 8] = एन, गणना की संख्या; रिटर्न: ईएक्स = एन के फैक्टरैरल; ----------------------------------------- ----------------- ईबीपी मूव ईबीपी, ईएसपी mov ईएक्स, [ईबीपी +8] पुश; एन सीएपी ईएक्स, 0 प्राप्त करें; N & gt; 0? जे एल 1; हाँ: जारी रखें mov eax, 1; नहीं: 0 के मूल्य के रूप में 1 वापसी! जेएमपी एल 2; और कॉलर L1: dec eax पर लौटें; फैक्टोरियल (एन -1) ईएक्स कॉल फ़ैक्टिकल; प्रत्येक बिंदु पर निष्पादित होने पर इस बिंदु से निर्देश; रिकर्सिव कॉल रिटर्न रिटर्नफैक्ट: mov ईबेक्स, [ईबीपी +8]; एन एमयूएल ईबीएक्स प्राप्त करें; ईडीएक्स: ईएक्स = ईएक्स * ईबीएक्स एल 2: पॉप ईबीपी; ईएसीएस 4 रि...

python termination error when ctypes dll calls printf -

I am developing a dragon system with some core DLL accessed via CTIP. I have reduced this problem in this condition: execute a module that loads (no need to call) Two DLL, one of which is called printf - this error is exited. Requested to end this application runtime abnormally. For more information, please contact the application's support team. My environment: - Windows 7, SP1 - Python 2.7.8 - Miniziw 3.20 This tutorial will help you with a tutorial on writing DLL with minidade Optimized: / * add_core.c * / __declspec (dllexport) int sum (int a, int b) {return a + b; } / * Sub_core.c * / #include & lt; Stdio.h & gt; __DCLC (Dilexport) int sum (int a, int b) {printf ("hello to all_core"); Return A - B; } prog.py import ctypes add_core_dll = ctypes.cdll.LoadLibrary ('add_core.dll') add_core_dll = ctypes.cdll.LoadLibrary (' Sub_core.dll ') & gt; GCC -Wall -O3 -g -ansi -c add_core.c -o add_core.o GCC -G-L-Ensy-Lion add_c...

python - Google Cloud Storage gives 'insufficient permissions' -

I am using: get_media (bucket = *, object = * , IfgenerationNotMatch = None, Generation = None, IfMetAgeneration Match = None, If Genation Match = None, If METGenNationName = None, Projection = None) Gives: Apiclient.errors.HttpError: code: service = build ('storage', 'v1') content = service.objects (). Get (bucket = item ['bucket'], object = item ['name']). Execute (http = http) Item from last (successful) call buckets.list This is why the service account Permission error for is so strange. This is currently on my localhost, and my authentication is: Open (FILE_KEY, 'rb') as F: key = f.read () Credentials = SignedJet Encryption credentials (SERVICE_EMAIL_ADDRESS, key, scope = 'https: //www.googleapis.com/auth/devstorage.full_control'), http = httplib2.Http () http = Credential. Authorized (HT) Objects (and subsequently new test objects uploaded) are created with default ALL permissions. How does this ser...

PHP cut text from a specific word in an HTML string -

I would like to deduct every text (include image alt) in a HTML string as a specific word. For example, this is the string: & lt ;? Php $ string = '& lt; Div & gt; & Lt; A href = "#" & gt; & Lt; Img src = "img.jpg" alt = "cut this text form here" /> Cut this text form here & lt; / A & gt; & Lt; / Div & gt; '; ? & Gt; And this is what I would like to output & lt; Div & gt; & Lt; A href = "#" & gt; & Lt; Img src = "img.jpg" alt = "cut this text" /> This text cuts & lt; / A & gt; & Lt; / Div & gt; Actually there is an element of an object, but I did not want to keep a long code here, obviously I can not use the explosion because it's HTML Markup will kill. And also str_replace or substr is out because the term is not constant before or after the length where it needs to cut. So what can I do to get it? OK, I res...

Meteor - Strange behavior when using {{#if}} to setup table rows -

I am trying to set the table using alternate row colors. Simple to help determine whether the row number is odd or even; Template.drillDown.trx = function () {return trx.find ({userID: Meteor.userId ()}); } Template.drillDown.isEven = function (num) {Return! (Num & amp; 1); } And I have this template called Drilldown; & lt; Table & gt; {{#each trx}} {{#if is also trx_num}} & lt; Tr class = "even" & gt; {{Else}} & lt; Tr square = "weird" & gt; {{/ If}} & lt; Td> {{Trx_num}} & lt; / Td> & Lt; / TR & gt; {{/ Every}} & lt; / Table & gt; I get an unexpected error {{else}}. I have tried to set it up other ways, where I would like the entire tag like & lt; Tr class = "even" & gt; , but then it throws an error when this closing tag appears, what is the suggestion to avoid this problem? The issue is that you are just wrapping the start tag {{# if}} In the spacebar in the blo...

c - Determine the most appropriate install location using the $PATH variable -

How can I execute the normal user program so that I have the most appropriate installation place for my program from the $ PATH variable set in my makefile? Or any other method, because all systems are different, there can not be a stable price at every makefile at all. For me, the first value is / usr / sbin - maybe / usr / local / bin? Do not guess. You get it wrong. Use / usr / local and override it to the user at install time. To see the standard GNU Make variable to use for it.

c - Warning] data definition has no type or storage class [enabled by default] -

For college, I need to create a basic desk calculator using the template. I have managed to do most of these work, but this error message is on line 9 ( iScreenSetup (); : "[Warning] No definition of data Type or storage class [enabled by default] " Any tips? #include" stdio.h "#include" conio.h "#include" stdlib.h "#include" string.h "/ * prototype * / iScreenSetup (); iDataCapture (); iCrocasAdata (); ReportIarport (); IXit (); / * and declare global variable * / Float FNM1 = 0.0; Float fNum2 = 0.0; f Lot FANs = 0.0; Int iOption = 0; int main (Zero) {/ * Screen Set * / iScreenSetup (); / * Prompt User and Capture Data * / iDataCapture (); / * Data Processing * / IcroSdata (); / * Generate report / IREport (); / * exit routine * / IEXIT ();} / * main * / * ​​ There is no return type in your prototype. If nothing is returned, then it will be zero . / * prototype * / zero iScreenSetup ();

ios - Weak linking modules -

तो इस प्रोजेक्ट लेआउट के बारे में सोचें: शीर्ष स्तर> ऑथ मॉड्यूल शीर्ष स्तर> किराया मॉड्यूल> प्रमाणिकरण मॉड्यूल किराया मॉड्यूल कमजोर लिंक प्रमाणिकरण मॉड्यूल, क्योंकि इसे संकलित करने की आवश्यकता है। शीर्ष स्तर के एथ मॉड्यूल को मजबूत लिंक। आदम मॉड्यूल का किराया मॉड्यूल संस्करण पुराना है जब एक परिदृश्य की कल्पना करो। जब मैं सिम्युलेटर में एप चलाता हूं, व्युत्पन्न डेटा को हटाने के बाद, मेरा ऐप रेंटल्स मॉड्यूल से पुरानी ऑथ मॉड्यूल का उपयोग कर रहा है और मेरा नवीनतम एथ्यूल्यूम्यूल नहीं है! यदि यह कमजोर जुड़ा हुआ है तो यह संस्करण क्यों खींच रहा है?

ios - Code builds for device, not for simulator... Expected identifier or "("? -

This part of my code has been placed in the encode 6 under my import statement: #if __IPHONE_OS_VERSION_MAX_ALLOWED & gt; = 80000 (if answers to [self.locationManager] Controller: @selector (requestWhenInUseAuthorization)]) {[self.locationManager requestWhenInUseAuthorization]; } #else #endif When I select a physical device to run, the projects are fine. When I select the simulator to run, I hope Received identifier error: Expected identifier or "(" on this line: if (answers [self.locationManager Tselector: @sillector (Request when InoAuthorization)] { I have the exact number of brackets because it is physically If I have an explanation on this website for this incident, then I am not able to find it. Thanks.

javascript - jQuery is not working on Joomla site -

I need imageflip to fadeIn () and Is a Joomla feed on the 2.5.19 site () I am fadeIn () and animated with imageflip . There are strange things happening on my Joomla site. The template comes with jQuery, even though I have jQuery installed easy because there are many jQuery versions loaded in the template (do not know why). Surprisingly, fadeIn () and fadeOut () effect works on two mapped areas in my imagemap (yet on the right, green and blue color which Highlighting, but not on others, testing the image flip on my computer, offline, it works for two similar areas but is testing it in JSFDL, (if necessary, any jQuery From version to version PureJS to the left hand side Does.) I think, must be something wrong with JQuery?! But again, why do two fadeIn () and fadeOut () work on my site and on my computer, but not others ?! Good afternoon, If you have any problems then you can get "JQuery Easy Plugin ", Can answer your problem. Regards.

python 2.7 - Openshift "no listening sockets available", how to change binding port? -

I have two python applications on my opening account, today an application does not load, and gives feedback "Address already in use: make_sock: 127.11.204.1:8080 could not share address, no hearing, shut down" I have both Stop the applications and then try to restart one, but it still has not solved this issue. How can I change the port which Attempts to bind one of the applications from 8080 to free port? An Android platform error is over, I checked IRC messages and many others have similar It was only trouble. Solve now

ios - SpriteKit Label Node not appearing -

I have a strange problem. I'm using a label node in one of my projects last time when I Custom font was adding and since that moment my label nodes are not working properly. If I set a font on my label (such as for example under this text), the label will not appear on the screen only, but if the app works properly click on the button, then load the game It takes some time (I think the font is loading?): label1 = [SKLabelNode labelNodeWithFontNamed: @ "Arial"]; But if I do not set any font on my label, the app simply crashes and I get a warning: * ** Exception exception to 'attach to add neil node', reason: 'Attempting to add zodiac node to parent: & lt; SKScene & gt; Name: '(empty)' frame: {{0,}, {568, 320}} ' I've read many posts here with people with problems with fonts. But I can not get any equal right now. The code where the error appears (calling the node to see the stopwatch is calling the function): - (zero...

python - How to include block of code to every page except base.html -

I need to create a small side block with the form (it has only one field and button) and I I wanted to make simple view functions on every page except base.html , but maybe there are better ways to do this? I'm using Python and Django 1.6 Normally, you Base.html should not be used directly, but because you and it will be a big problem to change it in every other template, whatever you can do, it is in the visual function, which gives the base 2.0, Boolean can add and check the boolean which template you are something like this: def view_that_uses_b Ase.html (request): is_base = true return render_to_response ("base.html", {"is_base": is_base}, RequestContext (request, {}) and then in the template : {% block sidebar%} {% if is_base%} {% else%} # Your code here {% endif%} {% endblock sidebar%}

Array with chars in c -

I'm new to everyone and just want to try some programming for fun! My first idea was to make a tick-tank-toe game. In the following code I am trying to generate a field. It works to some degree, but when I test it, it clears entries fail [1] [0] and fails [2] [0] Besides, I do not understand anything, if I save more of a letter in an entry, for example XX, it is moving in some other place, I'm guessing that C. There is a problem with saved space work, happy for any response! #include & lt; Stdio.h & gt; Main () {int i, j; Four folds [3] [3]; For (J = 0; J & lt; 3; J ++) {for (i = 0; i From this line: scanf ("% S", and fail [i] [ja]); You are reading a string (multiple characters) and keeping them where there should be only one letter, it will damage the adjacent letters which are stored nearby. Use something like: scanf ("% c", and fail [i] [j]); Reading a letter around each time. But this solution is not perfect, bec...

R: How do I retain the time index when running na.spline() on a timeSeries object? -

लापता मूल्यों के साथ एक टाइमशरीर ऑब्जेक्ट बनाते समय और na.spline () कार्य निष्पादन एक डेटा संरचना बन जाता है जिसके पास कोई समय इंडेक्स नहीं है। यह कैसे ठीक किया जा सकता है? एक टाइम शरिअस ऑब्जेक्ट मान लें जैसे कि: # कुछ डेटा सेटअप लाइन्स। X & lt; - '' 1987-01-01 "7.1 एनए 3 "1987-01-02" 5.2 5 2 "1987-01-06" 2.3 एनए 9 'लाइनें।' & Lt; - '"1987-01-01" 55.3 66 45 "1987-01-03" 77.3 87 34' # टाइमशरीज ऑब्जेक्ट बनाओ x & lt; - read.zoo (text = Lines.x) y & lt; - read.zoo (text = lines.y) z & lt; - as.timeSeries (मर्ज (x, y)) z एक उचित समय है शृंखला ऑब्जेक्ट: str (z) समय श्रृंखला: नाम: ऑब्जेक्ट डेटा मैट्रिक्स: आयाम: 4 6 कॉलम नाम: V2.x V3। एक्स V4.x V2.y V3.y V4.y पंक्ति नाम: 1987-01-01 ... 1987-01-06 स्थिति: शुरू: 1987-01-01 समाप्ति: 1987-01-06 साथ: प्रारूप:% Y-% m-% d FinCenter: GMT इकाइयां: V2.x V3.x V4.x V2.y V3.y V4.y शीर्षक: टाइम सीरीज़ ऑब्जेक्ट डॉक्युमेंटेशन: मंगल 4 नवंबर 19:09:43 2014 स...

ios - ITunesConnect dont display additional languages on submit for review -

Image
I use Unity 4.6 beta 20, XCode 6.1. I made an app with Integration 3D and is currently uploading it to the App Store. I do not use the functionality of the xcode (localization) localization, because unity provides its own framework for localization. So I do not have any language metadata in the xcode project. I have uploaded binary in iTunes Connect and compared to appastore details and screenshot localization. But there are only 9 languages ​​in the list of languages. (I need Russian and Ukrainian, which is not included in the list of languages) After that, I read in Apple Doctor, that I should add language metadata in the exode project to make it happen to connect it to iTunes (why do not I do this for brazilian, Danish, etc.)? I added languages ​​to the XCode project file and in the plist file You can, Xcode recognize English as "N", but do not recognize Russian and Ukrainian as RU and UK. In addition, if I click on it, then there will be no need of langua...

c# - WCF odd behavior: application/xml but JSON body in request -

मेरे पास एक समापन बिंदु परिभाषित है: [सेवा का संप्रेषण] इंटरफेस आईआरइकेस्टस्ट {{ऑपरेशनकॉन्ट्रक्ट] [ WebInvoke (UriTemplate = "टोकन", विधि = "पोस्ट", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] RespondData RequestStuff (RequestData अनुरोध); } मैं इसे इस के माध्यम से कॉल करता हूं: का उपयोग करके (var f = नया वेबचैनलफैक्चरर & lt; IRequestStuff & gt; (नया यूरी ("http: // myhost / TestService /RequestStuff.svc "))) {var अनुरोध = नया अनुरोधडेटा () (सदस्य 1 =" सदस्य 1 ", सदस्य 2 =" सदस्य 2 "}; Var प्रतिक्रिया = f.CreateChannel ()। RequestStuff (अनुरोध); } मेरे पास निर्दिष्ट स्थान पर सुन वेब सेवा समापन बिंदु भी है जब मैं किसी परीक्षण ऐप से कॉल करने की कोशिश करता हूं, तो सबकुछ ठीक काम करती है। लेकिन, जब मैं एक अन्य वेब सेवा के अंदर से RequestStuff पर कॉल करता हूं, तो अनुरोध में चीजों की अजीब बात है - इसमें "सामग्री-प्रकार: एप्लिकेशन / एक्सएमएल" है, लेकिन शरीर JSON {"Member...

scala - Forcing Redis to Timeout -

I am trying to force my radis client to timeout for the testing purpose and I fail to do so I am I specify the time limit of up to 2ms in my config and I set it to> 2ms, so why not do it timeout? Are these settings as soft settings and are not strict enforcement? I am doing zadis 2.6 and using Scala 2.10 with 2.2.3 @Singleton class extends the RedisClient cache {// set timeout value timeout = 2 private val Pool = new Jedispool (new zdispole config) GetStringFromConfig ("redis.url"), getIntFromConfig ("redis.port"), TIMEOUT); Def isOpen = pool.getNumActive () def set (key: string, value: string) = {isOpen match {case -1 = & gt; New exception throw ("Radis server is not running") Case _ = & gt; {Val jedis = pool.getResource () before the wall = current.timeTime jedis.set (key, value) println ("time taken" + (Platform.currentTime-before)) pool.returnResource (jedis)}}}} As a Java Socket Connection Timeout More information abou...

datastax - Cassandra production Monitoring -

I am new to Cassandra and the Cassandra production cluster for monitoring setting. What else is recommended in addition to monitoring using the noddate command in the crontab? Is it a normal practice to use ganglia for monitoring? Can you direct me to a good resource for setting up production monitoring? We are using Apache cassandra, so opcenter was not very useful. Free version of OpsCenter works with OpsCassandra and most of the monitoring capabilities are available If you have a DSE If not, you do not remember the good amount of cluster management capabilities:

excel - VBA to open Word document and refresh links -

I'm hoping to find a solution to my problem (or be a VBA). I ​​have a Word document in it which includes Linked Excel The tables are all the links work correctly, but I have to manually open the Word document to refresh the excel data. The reason for this is that I am using Word instead of Excel, because it contains large amounts of text. Is there any way that I can program any type of code that is known through all the word documents in a folder, open each document, refresh all links, documents Saves, and moves on? What I have is so far Sub OpenFiles () Dim MyFolder String Dim MyFile String MyFolder = "LOCATION" MyFile = Dir (MyFolder & In the form, "\ * docx") while myfile & lt; & Gt; "" Document. Open file name: = MyFolder & amp; "\" & Amp; MyFile MyFile = Dir loop and all UPDATE OK, I was able to work open files! Now I write it up / save the file and try to close it Error message:. ObjWord.Visible ...

php - Using in_array for multidimensional arrays -

OK, so I have this array: - 0 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0707105396' (length = 10) 0 = & gt; String '0707105396' (length = 10) 1 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0704671668' (length = 10) 0 = & gt; String '0704671668' (length = 10) 2 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0707333311' (length = 10) 0 = & gt; The string '0707333311' (length = 10) and I am trying to use the in_array in this code. But, I never get any real value here what I am trying to do: - $ searchnumber = '0707333311'; If (in_array ($ searchnumber, $ arrayAbove)) {// do something} But if there is always a result of a false output, I think I'm not using the in_array correctly I am What should I do to get this job done? Thank you. $ array = array ("0" = & gt; array ("receiver_telmob"...

node.js - Simulating Failure to Access Mongodb -

I create an Express.JS Library which uses the official Node.js driver for its Mongodb operation. I am currently in the process of writing the unit test and I have to simulate the failures to reach the database to ensure: accept cases of library failure (Error is handled) Creates the right error callback and removes the appropriate events. I want to run the exams cross-platform, specially without having to turn off the database of special parameters or start for the command , This order is doing exactly what I want, but waiting time in seconds is too long, plus it has been marked only for internal use and you have to set the database to fire a particular parameter with The command looks good, but again, it's only been listed for internal use and details at ambiguous to say the least. I'm wondering if there is a recommended (preferably not swan) ways to do this Here, to execute this script, the node process requires superuser privileges for mono ddb process...

PHP Websocket echo server crashes -

We are using a websocket algorithm on a dedicated server running with apache and php5, everything works properly Sometimes, we create errors without any errors in the eco server crash algorithm (the comment in this part of the code): $ numbytes = @socket_recv ($ socket, $ Buffer, $ this-> Max buffer size, 0); If ($ numBytes === incorrect) {/ * 110: connection time has expired / / * 113: no root to host / / * 104: connection reset by peer * / $ error_msg = socket_strorror (socket_last_error) ($ Socket)); Socket_close ($ this-> Master); New exception throw ('socket error:'. $ Error_msg); } This code part is within infinite time, while I do not paste everything and nothing to keep the post clean, but feel free to ask me more code Someone knows why these errors happen, and do they have a way of not breaking the whole script? The way the server is started here: $ this - & gt; Maxbuferies = 2048; $ This- & gt; Master = socket_create (AF_INET, SOCK_STREAM,...

Programatic Strategy issue about Interstitials ads to earn fast in Android -

I've put an interstitial ad on the buttonclick. The possibility of clicking this will increase. But I want the user to click on the cross button (to stop advertising) instead of clicking on the ad, (if he does not like the ad), the ad automatically clicks and in my AdMob account Help add points. / P> If there are any other strategies please suggest. Thank you Here's the code: // In the advertisements of the interstitial ad interstitial.oday (adRequest); // An interstitial ad listener interstitial. Set AdListener (New AdListener) (Adloaded on Public Zero) (// Call DisplayInststational () function DisplayInstitutional ();}})}} Public void displayInterstitial () {// If ads are loaded, then Interstitial Show (Intermediate.edloaded)} {interstitial.show ();}} From the Adobe Publisher Guidelines and Policies: Invalid Clicks and Impressions Publisher Can not click on the advertisements of the device or use any medium of impression and / or increase the clicks wit...

database - What type of entity is this? -

Image
So I'm trying to get it into 3 NF. is this correct? If so, what do you call this unit? If I have details in the table It would depend on donut name, so I had to put it in 3 NF and take it to my desk. correct? Thank you for any help, just to make sure I am on the right track. :) * Edit Example of Data: I think your data is name details Unit Pays Based on your description, a basic assumption: Name is a candidate key, no two donuts will have the same name If the details are also unique within the table, then it is also a candidate key. If it is not unique, So this is just one feature, similar to the unitpiece (i.e. the table can have the same value in two rows). When you have two candidate keys, you choose one and make it Primary key , and all other Optional keys This does not violate the third common form. Next impression: DonutId is an identity column - or , Any other device that remembers one (essentially) in each line Specifies the integer inte...

mysql: find newest non null values -

I have a huge table with 100 fields. Each line is timestamp, I want to find the latest non-empty values ​​for all the columns. I am using MySql 5.6 InnoDB like CREATE TABLE Tester (pub_id int, pub_name varchar (20), Pbbt varchar (20), country varchar (20) Am no_of_branch varchar (20), estd datetime); Insert the tester (pub_id, pub_name, pubault, country, estd) values ​​(1, 'A', 'Akswaijh' Absiti ',' A ',' 1 9 7l-0l-0l 00:00:01 '); (2, 'A', 'X', '', 'A', '71 71-01-01 00:00:01'), (3, 'A', 'X', 'ABC 1' 'B', '1972-01-01 00:00:01'), (4, 'A', 'Expose', '', 'A', '1973-01-01 00:00: 01 '), (5,' A ',' X ',' ABCT 2 ',' ',' 1974-01-01 00:00:01 '), (6,' B ',' LMN ' 'Abcity', 'a', '1974-01 -01 00:00:01'), (7, 'b', 'exay', '', 'a...

javascript - jQuery AJAX: unexpected end of input -

I am trying to check the value of the input using AXX. Every time the user is sent to a major AJAX and then the server is sent on the basis of the result I am adding valid or invalid class in the input. .js: $ ("input [name = username]"). Key (function (event) {processAJAXCheck (this, "user name");}); $ ("Input [name = username]"). Change (function (event) {processAJAXCheck (this, "user name");}); Function processexcheck (element, to cheek) {contentOfInput = $ (element) .val (); $ .jax ({url: "ajax.php", type: "post", data: {content: contentOfInput, toCheck: toCheck}, success: AFJAXResponse}); } After the function, AJXSpace (data) {result = $ .SESSON (data); If (result ['toCheck'] = undefined) {inputSelector = 'input [name =' + result '[' check '] +'] '; If (result ['result'] == true) {$ (input selector) .removeClass ('invalid'); $ (InputSelector) .addClass ('val...

markdown - How to avoid automatic appended file extensions to directory links when converting to pdf using pandoc? -

I am writing the company's internal documents in R. MarkDown and am compiling using Rostudio weaving. I am trying to add a link to point to a directory: [testdir] (file: //// c: / test /) (It's following the notification being described) When I compile it in html, I get the following link. & lt; A href = "file: / /// C: / test /" & gt; Testdir & lt; / A & gt; And it works as expected in Internet Explorer. However, when I try to convert from RDDDO directly to PDF, an unwanted PDF extension is added to the link. I tried to disintegrate this problem and it seems that this change is happening within Pandok. Code> The link in the latex output file looks like this: \ href {file: /// c: / test}} {testdir} So far everything is good. However, when I convert latex output to pdf in pandoc, & gt; Pandoc -f latex -t latex-o test.pdf test.tex has been added on a .pdf extension link. Here is the copy / paste of t...

postgresql - SQL Query error insert into -

I am trying to do this function: create the function "SA_PRJ" or Change .usp_verify_allocated_time (p_uid integer, p_project_id integer, numeric p_allocated_time, numeric, p_task_desc character gives different p_achieved_time, declared different character, p_date timestamp $ body $ alloc_id integer as p_obs) without time zone zero; "SA_ADM" .usp_check_permission not start (p_uid, 'SA_PRJ', 'usp_add_timesheet_record') exception raise "user ID% New permisii pentru aceasta operatie! ', P_uid; end if; Select *, case when SUM (fld_allocated_time) / 24 I want to create a function to join tables in two columns "SD_PRJ". Tbl_project and "SD_PRJ" .tbl_project_timesheet and compare compare SUM (fld_allocated_time) / 24 & lt; Fld_allocated_days is an input parameter p_project_id (where t.fld_project_id = p_project_id) to and if it is okay to insert it. The input column can be higher than the fld_project_id in...

android - Element relative height in layout -

I have seen that elements of width can be set to the width of the screen one Using relative layout (code showing only relevant properties): & lt; LinearLayout & gt; & Lt; ImageView Android: layout_width = "0dp" Android: layout_weight = ".40" /> & Lt; / ImageView & gt; & Lt; TextView Android: layout_width = "0dp" android_layout_weight = ". 60" /> & Lt; / LinearLayout & gt; But ... apparently it can not be done with the same trick to specify proportionally height of the same element. If I try to define layout_hett of 0dp, eclipse complains if I want a picture with a caption, what should I do, where the image raises 40% of the height of the screen and the caption below becomes 60% is? You can actually assign loads for both horizontal and vertical orientation of a linear line. Horizontal orientation example: & lt; LinearLayout Xmlns: Android = "http://schemas.android.com/apk/res/an...

java - jTable function getSelectedRow(), getSelectedColumn() returning -1 -

I'm new to Java programming I need to get the index of the selected column and row I am both for the column and line -1 is getting the selected index. I have searched for a solution, but I could not find anything satisfactory. My code is the following: Private Waste DelayPart Button Actioned (java.awt.event.ActionEvent evt) {Default Table Model Table Model = (Default Table Model) . Product DisableableGetModel (); JTable table = new JTable (tablemodel); Int selectedRoundEx = table.getSelectedRow (); Int selectColIndex = table.getSelectedColumn (); System.out.println (SelectedRoundX); Println (selectedColIndex); } In your code you create a new jetty but you do not add this component Thus, it will never be visible to any container and no row, nor can the column be ever chosen. Now, while we can add components in the swing dynamically, we have seen top level containers (in this case) when you start your components (do not forget the scroll pane) The table should be tak...

phash - matlab code for perceptual hashing -

I need a matlab code here for the conceptual hashing algorithm: Actually I remove it Want to delay an image and leave only information about the key structure components. To do this, I think I need the following steps: 1. Reduce the DCT. Let's say the DCT is 32x32 (), just keep the top-left 8x8. They represent the lowest frequencies in the picture. Calculate the average value, like the average hash, the average DCT value (using only 8x8 DCT low frequency values ​​and excluding the first term, the DC coefficient other Calculate the values ​​can be quite different and the average will be off). Reduce further DCT to determine 64 thousand bits based on 0 or 1 depending on whether the average of 64 dct values ​​is above or below each average value. The result does not tell us the actual low frequencies; It only tells the attacks the many relative values ​​of the frequencies, the result will not be different unless the overall structure of the image remains the same; It can a...

sed - compare first 60 characters and delete the duplicate row -

How to use sed to test continuously lines, where the first 10 characters are the same? If same, then the second line of rows will be removed. Example: Before ABCDEF123456 123456ABCDEF 123456789012 123456789090 after ABCDEF 123456 123456 ABCDEF 123456789012 This work for you (GNU SAD): sed 'n'; P; / ^ \ (. \ {10 \} \). * \ N \ 1 / d; D 'file Read two rows, print first and then compare the first ten letters of the first line with the second line if they are equal, then delete the two rows or else delete them first Please give it.

cgi - Run Python 3.3 On My Webpage -

For the argument of pure education, I would like to know how to run a similar Python 3.3 script below. I know that I have to convert it to index.cgi , and it will be inserted into cgi-bin and what should I do? I am using Heliohost, so they are capable of compiling Python. I have also entered file_name.txt in cgi-bin I file = open ('file_name.txt') print ( File.read () print ('we just read the file') Thanks for your help! You have to make sure that the permissions file is executable by the web server user. Usually: # chmod 755 index.cgi

linux - How to run a Bash script that calls a Python script from any location? -

मेरे पास एक पायथन स्क्रिप्ट है, myscript.py कहते हैं, जो सापेक्ष मॉड्यूल आयात करता है, अर्थात से .. आयात मॉड्यूल 1 , जहां मेरा प्रोजेक्ट लेआउट इस प्रकार है: project + outer_module - __init__.py - module1.py + आंतरिक_मॉडल - __init__.py - myscript Py - myscript.sh और मेरे पास एक बैश स्क्रिप्ट है, myscript.sh बोलें, जो कि मेरे पायथन स्क्रिप्ट के लिए एक आवरण है, नीचे दिखाया गया है: #! / Bin / bash python -m outer_module.inner_module.myscript $ @ यह myscript.py निष्पादित करने के लिए और आगे काम करता है मेरी स्क्रिप्ट के लिए वांछित तर्क, लेकिन यह केवल तभी काम करता है जब मैं ./ outer_module / inner_module / myscript.sh से ऊपर दिखाए गए project निर्देशिका में से कॉल करता हूं। मैं इस स्क्रिप्ट को कहीं से भी कैसे काम कर सकता हूं? उदाहरण के लिए, मैं यह काम कैसे bash /root/to/my/project/outer_module/inner_module/myscript.sh ? जैसे कॉल के लिए कर सकता हूँ: कहीं और से myscript.sh निष्पादित करते समय, मुझे त्रुटि मिलती है: कोई मॉड्यूल outer_module.inner_module नहीं ...

math - Python PIL to draw a circle-segment of sunshine -

Image
I have a problem for which I want to draw a circle / object in a fixed position in an image, and then I I want to attract the rays coming out of the image - with each beam being separated from 1 degree. The rays will be applied only to 145 degree segments, however - it is not making a full circle. I am using Python PIL (on which I am a newbie) to complete that task - although I am not strict on language requirements. Def drawSunshine (im): draw = ImageDraw.Draw (im) x, y = im.size draw.ellipse ((370,200, 400,230), fill = 'red', outline = ' Black ') draw.line ((370,205,390,218), fill =' black ', width = 3) I was thinking that I could resume on every pixel around the circle. (Score: 3, Informative) And then I could change the color of that pixel. Edit I understood this approach because I had a black and Adam-white PNG file for this image if the current pixel was white, then I could see another pixel line Had to pull, if the current pixel is black: I consi...

php - Only pass GET information if isset -

I am using a form with GET method to add to the query string. I am running an issue. When a form is presented, each field is sent and added to the query, with any value. Example: http://web.com/?filter-types=News and Filters -Document-Type = & amp; Filter-Subjects = We-are-one-topic & amp; Filter-featured = & amp; Filter-Rating = Can I not add these query strings if they are not set? ! Isset () or another way to do this? You can optionally manipulate the input via javascript, just a mic comment In the said Submit Submit field, if empty, disable them so that they are not included in the submission. This is just the basic idea (with jQuery): & lt; Form method = "GET" id = "form_inputs" & gt; & Lt; Input type = "text" name = "field1" value = "field_w_main" gt gt; & Lt; Br / & gt; & Lt; Input type = "text" name = "field2" value = "" /> gt; & Lt...

html - How to join multiple numbers together as a string in PHP? -

I need to create a separate string with numbers of commas The issue I am running is That is, in the end, I am getting the total numbers of all the numbers when it should be: 2, 10, 35, 56, 67 ', etc. What I'm doing here: $ field_ids = ''; // loop & lt ;? Php $ field_ids = bp_get_the_profile_field_ids (); ? & Gt; // end while loop // start loop & lt ;? Php $ field_ids + = bp_get_the_profile_field_ids (); ? & Gt; // End Loop & lt; Input type = "hidden" name = "field_ids" id = "field_ids" value = "& lt ;? php echo $ field_ids ;; & gt; & Gt; How can I get it: & lt; Input type = "hidden" name = "field_ids" id = "field_ids" value = "2, 10, 35, 56, 67" & gt; Instead of: & lt; Input type = "hidden" name = "field_ids" id = "field_ids" value = "170" & gt; Yes, you can assemble them as an...

java - Check if integer has repeating digits. No string methods or arrays -

I am trying to see if there are multiples of the same number in an int without string methods or arrays The main method I'm trying to do is having trouble with this hedistentdegit () . This works when repetitive points occur in the end, but when they do not come in the beginning or middle. public static zero main (string [] args) {System.out.println (hasDistinctDigits (12234)); } Public stable boolean handicid Digits (int number) {Boolean ritter = true; Int count = 1; Int newNum = number; Int digit = 0; While (count> numDigits (number)) {while (count> numDigits (newNum)) {points = newon% 10; NewNum / = 10; If (points == getDigit (new name, count)) {returner = false; } Calculate ++; } Calculate ++; } Return returner; } Public static int numbers (numeric digits) {int count = 0; While (number! = 0) {number / = 10; Count ++; } Calculation of return; } Public Fixed int getDigit (int number, int i) {int number = 0; Int count = 0; Int element = number; While (calculation ...

how to add an array of variables to a matrix of variables in Julia? -

I want to implement a column generation algorithm with Julia package for Julia. So on each iteration, I want to add a multi-dimensional variable size of size to n-1 in the second multi-functional variable of n . I know that like push! () and attachments () with parameters, but I could not use them for the variable. Would you please tell me if you know the function or a way to do this? This question just came to the Julia-Opt Group: In short, you You can not attach to special containers of Jumper, but you can use a standard vector {variable} and push! .

Generating six random cards with Javascript -

I use math.random () in javascript to try to get six random cards from a deck of 52 I am here. Thus far none of my images is visible, all my CSS 3 and Javascript embedded in my html5 code. Apart from this, all my images are GIF pictures. You can see in html5 code which is die1 is blank.gif while evrything else is blank.png my set image function should be changed to SRC, so I think that it will not make any difference to me. The code is as follows, thanks for any help: id startButton . In your current code, you are trying to get the button by id , but the button does not have id but the value of the class attribute Startbutton . You can change the class attribute for your id attribute to fix your problem: & Lt; P & gt; & Lt; Input id = "startbutton" type = "button" value = "start" & gt; & Lt; / P & gt;

python - How to check if the string has digits without a try/except or str.isdigit? -

संख्याएं = "123456789" def digit_checker (x): x में टी के लिए: यदि टी में NUMBERS: y = सही दूसरा: y = गलत वापसी y वाक्य = इनपुट ("सभी अंकों की जांच करने के लिए एक स्ट्रिंग दर्ज करें":) चेकर = डिजिटली_चेकर (वाक्य) प्रिंट (चेकर) शीर्षक के रूप में , यदि मुझे स्ट्रिंग में सभी कोड को str.isdigit या का प्रयास करें / को छोड़कर का उपयोग किए बिना मिला है, तो मुझे कैसे पता होगा? यह कोड पहले चरित्र की जांच करता है और सभी नहीं। मैं कैसे तय कर सकता हूं? संख्याएं = "123456789" def डिजिटली_चेकर (x): y = एक्स में टी के लिए सच: यदि टी नंबरों में नहीं है: y = गलत वापसी y

How to apply a random number to every cell in matrix - Matlab -

I want to apply randomity for each element in my matrix. I have provided a MWE below. x_len = 1000; Y_len = 100; X = 0: 1: x_len; Y = 0: 1: y_len; [X, y] = meshagrid (x, y); Z = (0.04 * X); I for = 1: (x_len * y_len) rand = rand (); Z = Z + RAND; End This implements the same random number in each cell in the bar exactly the matrix (x_len * y_len) . I want to add each cell to a different random number. I have searched, and feel that this is a simple thing, but I have failed to recognize the necessary syntax thanks. AM If I understand correctly, then you can just type: Z = Z + rand (size (z)); Where Z is your M-by-N matrix.