Posts

Showing posts from July, 2010

javascript - Is it possible to strip more than X digits in a string using regex? -

I am trying to filter points by string, when the string gets 6 or more digits. I do not want to remove the digits all in the string, only anyone 6 and more The first 5 should be kept. For example: var val = 'Hello, this is my lesson I was born in 1984, and currently my age is 29 Year is; If (any matches in the match (/ [0- 9] / g, ''), length> 5) {// any number bar above 5th}} whatever It also comes in if, now in Val: var val = 'Hello, this is my lesson I was born in 1984, and at present my age is 2 years; I think that maybe something very easy for this is that I am ignoring, though my search on the web was not generated. var val = 'Hello, this is my lesson I was born in 1984 , And currently my age is 29 years; Var calculation = 0; Var str = val.replace (/ \ d / g, function (match) {return (++ calculation & lt; 6) match: "";}); Console.log (STR);

java - MySQL: How to Update values into multiple rows and use where clause as well? -

मैं अद्यतन एक int मान ( प्राथमिक कुंजी , देश नामित अन्य तालिका से city_id स्तंभ में पुनर्प्राप्त (जो कि विदेशी कुंजी है व्यक्ति तालिका देश से तालिका), सभी पंक्तियों में जहां नाम विशेषता / कॉलम का मान जॉन, एमी, एडम, अब्राहम, बॉब, डेविड, रॉबर्ट, जॉर्ज, एलिजाबेथ, माइक और बारबरा है। मैंने इस प्रश्न का उपयोग करने की कोशिश की लेकिन मुझे एक अपवाद मिलता है कि मेरी MySQL वाक्यविन्यास में कोई त्रुटि है स्ट्रिंग क्वेरी 1 = "अद्यतन व्यक्तियों को सेट करें city_id =" + rid + "जहां" + "(नाम = 'जॉन' और '+' नाम = 'एमी' और '+' नाम = 'एडम 'और' + 'नाम =' इब्राहीम 'और' + 'नाम =' बॉब 'और' + 'नाम =' डेविड 'और "+" नाम =' रॉबर्ट 'और "+" नाम =' जॉर्ज 'और' + " नाम = 'एलिजाबेथ' और '+' नाम = 'माइक' और '+' नाम = 'बारबरा') "; मैंने कोष्ठक को भी हटाकर यह कोशिश की। तो क्या कोई यह ब...

Parameter Value in main report is not passed to a parameter in the subreport -

I need your help, while defining the value of the parameter in the main report to the passport, I defined a parameter in the main report Whom {? ReportNumber} and its type is the number and it is stable In the main report selection specialist, I added the code below: {engine.reportnumber} = {? ReportNumber} This will take the report number from the table and specify this parameter. Every time I run a report, the value will vary based on the data received. In SubReport, I renamed the same name? ReportNumber} and it's type number and it's stable. I've added a subreport link that is {? ReportNumber} and below I {? ReportNumber} parameter which is in sub-data However my issue is that when I run the report, the report is asking me to enter the sub-report parameter , Even though I have added it and given a value for it as I have stated in the steps above. I'm using Crystal Reports 2011 Even tried to use the shared variable in the main report: shared n...

java - Call WebService method created with Netbeans and Glassfish from browser(localhost) -

This may look like a dumb question, but I'm new to web services. I followed myself and successfully created a calculator web service to that point where I created a local client application that used the web service method (the main method is a Java class that calls the web service method Does). My question is how do I set parameters using this method through my browser, just get an XML / JSON result? My guess is that I am missing something and I need to publish some web service in some way. Any solution, the link is highly appreciated. You hosted your webservice on the glassfish server now you want to use it as an internet browser You were using it Test Web Server option in Net bean. This means that you need to create your own client which runs on the web browser. You have created a webpage in it as two input fields and one button result and whenever you press this button, call your web service and display the result. You can follow any simple tutorial of web ...

javascript - export requirejs application as a module for use in third party require application -

I need the module with dependencies. define (['dep1', ' I need third party requirements in a single file to be used as a single file Use RJS Optimizer to bring all dependencies including Shim in. is required (['myCompiledModule'], function (MyModule) {var module = new MyModule (); module Init ();}); The adapter can be used in such a way that such a module is needed? In the scan, I am using the following options in my grandfather: Option: {baseUrl: '

php - Getting error with function to check for set variables to propagate form fields -

I am creating a form that promotes field names if a specific condition is completed with the variable from the SQL query And if it does not, it leaves the field blank. I have a function that checks whether the checkbox has been set or not, if so, then a query is running and get value to enter in the field, if it is' I field Do not want to be empty, but I'm getting an error message in that field that the variable is not defined. function addEditValue ($ fieldName) {global $ edit_check_gtg; If ($ edit_check_gtg) {echo $ fieldName; } }; And this is html that brings it to the field time: & Lt; Br> I tried to make a function to test, if the variable is set using the isset (), but not working until I write it every time Does function Amiset ($ fieldName) {if (isset ($ fieldName)) {echo "I am set"; } And {echo "I'm not set"; }}; I can understand that there is another way to do this. I know that I could have added the variable at...

android - AIRPLANE_MODE action not receiving -

Android Airplane mode is not showing the log My code is below public class increases main activity activity {@ override protected zero creation (InstanceState saved from bundle) {super.naught (savedinstenstate); SetContentView (R.layout.activity_main); IntentFilter intentFilter = new intent filter (ACTION_AIRPLANE_MODE); Register receiver (mBroadcastReceiver, intentFilter); // AppRater.app_launched (new WeakReference & lt; activity & gt; (this)); } @ Overhaired Protected Zero Destroy () {Super. Onesteroy (); UnregisterReceiver (mBroadcastReceiver); } Private Final Broadcast Receiver mBroadcastReceiver = New Broadcast Receiver () {@ Override Public Records on Receive (Context Reference, Intent of Intent) {Log D. ("Mass", "Action" + Intent. Gate Action ()); If (intent.getAction (.) Equal (ACTION_AIRPLANE_MODE)) {mHandlerRedrawUI.sendEmptyMessage (UPDATE_VISIBILITY); }}}; Private static final full UPDATE_VISIBILITY = 1; Private static final string ACTI...

http status code 404 - how can I send response 404? -

I have a page when it loads, then check it first in the database if the page exists. The problem is that if the page does not exist, the page loads with the response 200. Is there a way to send header response 404 from the HTML page? Or can I call a function in CGI who will do this? Thanks! I agree that your page is not just HTML as you do in your database. All you need to do is send an HTTP header 404: (example in PHP) & lt ;? Php ob_start (); // Turn on the Outdoor buffering, to ensure that nothing is sent before the header (your code) ob_end_clean (); // Clear Output Buffer Header ("HTTP / 1.0 404 not found"); Send // Header? & Gt;

drop down menu - In Bootstrap 2.3.2, when there is multiple dropdown element and when the key pressed is enter, it is not showing the right dropdown -

When I press "Enter" in the text box, a dropdown menu is shown which is the first one. It should be a dropdown menu related to textbox. I'm using Bootstrap 2.3.2. Is there any way to correct this behavior? See the CodePan for an example: This is how I fixed my problem var $ this = $ (this); $ This.find ('input') Bind ('keypress', function) {if (event.keyCode == 13) {if ($ this.find ('.btn-group button trackdown-toggle') .length & gt; 0) {event. PreventDefault (); $ this.find ('.btn-group button. Trackdown-toggle'). ();}}}); The problem is with the button button when you change the enter button event fire button The tag will be resolved to increase your problem

java - How can I extract specific terms from each string line? -

I have a serious problem in extracting words from each string line to be more specific, I have a CSV formatted file Which is not actually a CSV format (it saves all the positions in the [0] line only) So, here is an example between thousands of string lines of string lines; test.csv line1: "31451 cid00531904415393353c8h14o3s2 beta-lipoic acid C 1 cs @ s [c @ hh] 1 cccccc (= hey)) o " line 2:" 12232 COD 05374044 23439353 C 9 24 o3s2 saponin CCCC (= O) O " Line 3:" 9048 CTD 42032 23241C3HO4O3S2 Berberin [C @ HH] 1CCCCC (= O) O " I want to remove " beta-lipoic acid " , " saponin " and " berberine " Only 5 Located at the threshold. You can see that there are large spaces between words, so I said at the 5th position. In this case, how can I remove positions located in the 5th position for each row? One more thing; The length of white space between each of six words is not always the same. Length can ...

How can I use the "label" version of List.nth in OCaml? -

तो मूल रूप से मैं कुछ ओकैमल कोड लिख रहा हूँ जैसे: चलो p_op p = show .show & LT; सेशन & gt; पी | & gt; Str.split (Str.regexp "+") | & gt; सूची। एनथ आइटम्स 1 (आइटम स्ट्रैट्स के परिणाम हैं) | & gt; String.lowercase तो समस्या यह है कि मैं कैसे Str.split के List.nth के लिए निहित तरीके से पारित कर सकता हूं? अगर मुझे label का list.nth पता है, तो मुझे लगता है कि मैं यह कर सकता हूं, सूची । Nth ~ num: 1 लेकिन मूल रूप में मैं कोर का उपयोग नहीं करता हूं, मुझे नहीं पता कि कैसे label list.nth कोई मुझे कुछ मदद दे सकता है? फिर शायद मुझे लेबल के साथ List.nth को लपेटने की आवश्यकता है? यह देखने के लिए स्पष्ट स्थान ListLabels में है। लेकिन जो भी कारण से ListLabels.nth के पैरामीटर लेबल नहीं हैं! आप flip का उपयोग कर सकते हैं: फ़्लिक करें Fxy = fyx ... | & gt; फ्लिप लिस्ट.नेट 1 | & gt; ... फ्लिप को ओकैम बैटरियों में परिभाषित किया गया है, जैसे कि BatPervasives.flip (और भी कोर में)।

javascript - Forward slash in rest call using angularjs client and Flask server -

I am calling a comfort flask server from an AngularJs client in a call, a forward in my ID (key) If it does not, then the call works fine if there is a slash, so I did not get any 404 error. I tried to encode the key (EncoderIconConent) , The key (escaped) ... but still has a 404 error. My code in the flask @ app.route ('/ user / & lt; string: uid & gt; / subuser / & lt; string: subuse & gt; P > $ Scope.uri = ctrlURL + "S3 / user /" + user_id + "/ subs_user /" + subscribe + "/ key /" + key; $ Http ({method: "delete", url: $ scope.uri} ). Success (Tasks (Data, Position) {...}). Error (Tasks (Data, Status) {...}); Does anyone have an idea? Thanks for Brian's comment, I The problem was solved that the slash was resolved when my phone was rejected by Apache. I've added directions to my appetite: Allow the unified slash nodecode

updating and than commiting to svn with java code -

* Hi all I just started using SVNkit and tried to use its features. I wanted to update the special directory first and instead of earning it in svn, but I'm facing problems code for taking update public class test SVN conection {public static zero main (string [] Args) {DAVRepositoryFactory.setup (); FSRepositoryFactory.setup (); SVNRepositoryFactoryImpl.setup (); // This is a general way of how an SVNRepository driver creates an object: file dstPath = new file ("C: / Users / Testcases / NEWFrameWork / src / de / eb / test / generic / destinationentry /"); String url = "http: // replace / svn / navi / testtools / work / somu8950 / newfrework / src / de / eb / test / generic / destinationentry"; String user name = "user name"; String password = "password"; SVN Repository Repository = Faucet; ISVNAuthenticationManager authManager = null; Try {repository = SVNRepositoryFactory.create (SVNURL .PERSURICcode (URL)); ISVNOptions option = SVNW...

php - opening file with vim creates a new file although the file exists -

I am trying to read in the apache error log var / log . I have a error.log file, but when I sudo vim this is a new error.log file is created. I'm pretty sure there should be anything in it because I'm trying to debug 500 internal server errors. Thank you for your help! Was followed by sudo vim error.log .

c - Why isn't there a round()-type function that returns an int? -

The C standard library defines a bunch of spherical functions. Originally there are two "full" families, print: double holes (double x); Float quintro (float x); Long double double arctic (long double x); / / / Printing point current logic direction uses a long int lint (double x), in the floating-point form an integer value // rounds its argument; Long int lintif (float x); Long interval Little (Long Double X); Longer than the only Larring (Double X); Long-term lolin (float x); Laurentl long (long double X) long; // Lint and Lirin do the rounds on their logic / second closest integer values, round the current / spherical direction. If the round value is outside of // // return type, the numerical result is unspecified and may be a domain // error or category error. * round: double round (double x); Float round (float x); Long double round (long double x); // Round Functions in the round of the nearest integer value / Floating-Point format, regardless of th...

c++ - Data structures for traversable memory pool -

I am implementing a memory pool in C ++ with the following constraints: To promote allocated cache reuse elements must be in linear time in order of their memory address. Delete the elements (memory block) and make them memory pool. Allocation and deallocation are often during a real time program runtime, so there is a need to be as fast as possible. I have implemented one of these allocated elements for free, by using two linked lists as slots, so far this memory pool has been implemented. It works, but of course it is very slow, because once an element is either free or allocated, the element should be removed from one list and the other should be added, which is linear. I would like to do it fast What data structure can I use to make it as efficient as possible (D) allocation? I was thinking of using the red-black tree (or similar balance BST) to store allocated elements and the priority queue for free elements. This will lead to O (log n) allocation and delocati...

jogl - Viewing while sitting on a sphere -

In my JOGL program, I have (0,0,0) objects. I am using spherical coordinates to modify the angle (tilt) and f (rotation) to see my object on the original. But I am not able to see it properly. Occasionally the object disappears on some angles, and I can not see it from all angles. Here is my code: zero decTheta () {theta--; East = Distance * Math.sin (Math. Tudian (Theta)) * Math.cos (Monastery (Fia)); Ez = Distance * Math.sin (Math. Tudian (Theta)) * Math.sin (Math.toRadiians (phi)); Ey = Distance * Math (Math. Tudian (Theta)); } Zero incTheta () {theta ++; East = Distance * Math.sin (Math. Tudian (Theta)) * Math.cos (Monastery (Fia)); Ez = Distance * Math.sin (Math. Tudian (Theta)) * Math.sin (Math.toRadiians (phi)); Ey = Distance * Math (Math. Tudian (Theta)); } Zero incPhi () {PHI ++; East = Distance * Math.sin (Math. Tudian (Theta)) * Math.cos (Monastery (Fia)); Ez = Distance * Math.sin (Math. Tudian (Theta)) * Math.sin (Math.toRadiians (phi)); Ey = Distance * Math (Math. T...

video - Android MediaRecorder Multiple Files -

I am using a MediaRecorder to record video from the camera, save it as an SD card in MP4, which Works flawlessly without any timing. I would like to limit the length of .mp4 files to 10 seconds and then automatically create a new file (i.e.: if a user records 30 seconds then I want to create three files, volume 1.MP4 (0: 00) -0: 10), Segment 2. MP4 (0: 10-0: 20), and Segment 3. MP4 (0: 20-0: 30)). Here I set up the recorder and the output What should I do to do this during the recording? Private Boolean Ready Video Recorder () {this.mMediaRecorder = New MediaRecorder (); This.mcamamera.stopPreview (); This.mcamamera.unlock (); This.mMediaRecorder.setCamera (mCamera); This.mMediaRecorder.setAudioSource (MediaRecorder.AudioSource.CAMCORDER); This.mMediaRecorder.setVideoSource (MediaRecorder.VideoSource.CAMERA); This.mMediaRecorder.setOrientationHint (90); This.mMediaRecorder.setMaxDuration (this.VIDEO_CHUNK_LENGTH_MS); // 10,000 ms if (android sdkersian ()> = 8) {this.mMediaR...

php - Joining a count query mysql for performance -

has been searched but can not find the answer that is in line with the exact requirements for this mysql query. I have the following questions on several tables to generate "statistics" for a table: SELECT COUNT (id) as `mod_ **` Publish with 'WHERE'; = '1'; Choose `mod _ ***` where 'published' = '1' by counting as COUNT (id); Select COUNT as Count (Mode) from `Mode _ ****`; Select number (ID) as counting from `id_ _ *****`; Very easy to do sometimes sometimes calculates rows based on a situation. However, in search of performance I would love to receive it in 1 query to save resources. I am using php to get this data with the simplest mysql_fetch_assoc and retrieving $ res [count] If I make it a difference (the supporters are not guaranteed, even plain old mice). Overhead to send a query and receive a single-line response If you do not yet have a INDEX index published columns will speed up the first two quest...

How can ant pickup java result and use as property value? -

I search for many places which is still not able to find what I'm looking for. Not sure if this is possible or not, while the ant script Java code is going on, the result should be alive in GVM, how do I copy it, not Java? Because I want to use the result again in the second part of the ant script. Say, I have followed the Java method and I have string result = "sebest string"; Return result; Is there no way in the anti script, while the same JVM & Lt; Property = "food" value = $ {result} & gt; & Lt; / Java & gt; & Lt; Jmeter jmeterhome = "Homepath" testplan = "name .jmx" resultlog = "name.html" & gt; & Lt; Jvmarg value = "- Djavax.net.ssl.keyStore = Pathtoos /> & lt; jvmarg value =" - Djavax.net.ssl.keyStorePassword = $ {food} / & gt; & Lt; / JMeter & gt; & Lt; / Target & gt; Thanks! You can set a property in your system, Java program, and the ...

regex - MySQL | REGEXP vs LIKE and character special -

मैंने जैसा और REGEXP एक विशेष वर्ण के साथ खोज की थी " n ", यहाँ परिणाम: टेबल बनाते हैं नहीं` मौजूद testCharacter` ( `id` पूर्णांक (11) नहीं NULL प्राथमिक कुंजी AUTO_INCREMENT,` name` varchar (255) डिफ़ॉल्ट शून्य utf8_unicode_ci मुक़ाबला , `name2` चार (255) utf8_unicode_ci मुक़ाबला डिफ़ॉल्ट शून्य,` name3` पाठ मुक़ाबला utf8_unicode_ci) इंजन = InnoDB डिफ़ॉल्ट charset = UTF8 मुक़ाबला = utf8_unicode_ci AUTO_INCREMENT = 4; जांच `testCharacter` (` id`, `name`,` name2`, `name3`) सम्मिलित मान (1, 'nn', 'nn', 'nn'), (2, 'nn', 'nn', 'एनएन'), (3, 'एनएन', 'एनएन', 'एनएन'); पहला परीक्षण, जैसा SELECT * से 'testCharacter` जहां नाम'% और सभी कॉलम ( जहां name2 जैसा '%'% ', जहां name3 जैसा'% ñ% ' जैसा होता है) के लिए समान परिणाम: + - + ----- + ------ + ------ + | आईडी | नाम | NAME2 | NAME3 | + - + ----- + ------ + ------ + | 1 | 'Nn' | 'Nn' | 'Nn' |...

javascript - BreezeJs, saveChanges() - Uncaught TypeError: Cannot read property 'statusText' of undefined -

I used a SAP networkware gateway system provided by an anchor to consume data from the Odata service, with bridges of glass I am using. The application is currently reading data correctly from the service including metadata and as expected it has been organized in all EntityManager. However, when I change the position of one unit and save it (), neither the success and failure callback is called, instead a console error is displayed. Unicode Type Error: Unconstrained Can not read property 'status text' The save code is as follows: $ Scope.doSave = function () {$ scope.purchases [0] .rever = "Dave"; $ Scope.items [0] Details = "new details"; If saving (! $ Scope._is) {console.log ("Saving!"); Save $ scope._is = true; Manager.saveChanges () Then (function (data) {console.log ("saved"); console.log (data); $ scope._is save = false;}, function (error) {console.log (error); $ scope._is Save = false;}); }} The Manager is a sta...

Retrieve Lotus Designer information from java -

Is there a way from the external Java program that is usually available in Lotus Designer? I am able to get form names, field names and field types, and do so to look through such notes. But I am unable to draw data about other information such as combobox options or pages, codes, navigators, etc. Do anyone know if there is an existing utility (clearly in addition to the designer) who is capable of pulling this information, or a jar file in addition to the notes that are capable of pulling this information is. There are several options that you can consider in all those jars made available through IBM Has been included. You can define notes on the design elements by using Java methods as objects in the Java API. Design elements are documents, so you can process them. Most of the time which is not very useful. Access DXL to design elements, which is a relative accurate representation of domino objects in XML. OpenTTF is a project on which I have designated DXLMagic, w...

java - Any benchmarks wrt JDK8's ConcurrentHashMap against the JDK7 baseline? -

इसमें, जम्मू-कश्मीर के समवर्तीहाशमैप के कार्यान्वयन का उल्लेख नहीं है और अब खंड वाले हैश तालिका का उपयोग नहीं करता है। मुझे लगता है कि "सेगमेंट्स" शीर्ष स्तर विभाजन हैं जो कि पुराने कार्यान्वयन के लिए किया करते थे। नया कार्यान्वयन क्या करता है, और यह JDK7 के सापेक्ष कैसे करता है, जब यह तालिका बढ़ने की बात आती है? इसके अलावा, क्या कारकों (रिक्त उदाहरणों के मेमोरी पदचिह्न के अलावा) में कोई भी अंतर्दृष्टि के कारण परिवर्तन का सबसे स्वागत होगा।

.net - Generic list in C# 4.0 -

I am trying to create a general list using C # and .NET 4.0 list & lt; On & gt; Varlist = new list & lt; Var & gt; (); This code generates an error "The relevant keyword 'var' may only appear in a local variable declaration" The reason for this is that I want to do something like this: list & lt; Var & gt; VarList = new list & lt; Var & gt; (); // Announce generic list & lt; Object1 & gt; ListObj1; List of object 1 list & amp; Object 2 & gt; ListObj2; // List of object 2 varList = listObj1; // Assign the var list to list in the list of object 1 varList = listObj2; // Assign the var list to the list of object 2 Is there any way to do this in C # .NET 4.0? If you want a general list, then you have to define that normal type somewhere I'm assuming that this is on classwell: class MyClass & lt; T & gt; {List & lt; T & gt; SomeGenericList = new list & lt; T & gt; (); } Or...

c++11 - std::ostream to file or standard output -

If a file name is available or on screen (stdout) otherwise I want to write my output in a file, I have read the post on the forum and I got a code, wrapped in a method below: std :: shared_ptr gt; {of.open (fname); Buf = of.rdbuf (); } Else buf = std :: cout.rdbuf (); Std :: shared_ptr & lt; Std :: ostream & gt; P (new study :: ostream (buff)); Return p; } The code works perfectly when using in-place, unfortunately it behaves strangely when wrapped in a different method (given above). Is it because because after the call is over, the object defined within the method (or fond) is destroyed? I am using this part of the code in many places and it should actually be removed as a separate non-repeating piece: a method or a class. How can I get this? You are right that the problems that you are coming from destruction are due to of Will there be nothing like this (involuntary) work? std :: shared_ptr & lt; Std :: ostream & gt; Out_stream (const std :: ...

web config - Proper ODBC Connection string syntax -

This summary is not available. Please click here to view the post.

python - What is the reason this variable isn't printing? -

This is a program that I am writing. After I get my thinking that loop over my global variable ABSDEV_SUM Why is not printing # python_fitness_function = Import Panda PD import itertools infile_path " C: \\ users \\ \\ Tim Dropbox \\ Lela.com_DrBx \\ APR14_query_work \\ "df = pd.DataFrame.from_csv (infile_path +" mp_viewed_item_AGG_affiliate_item_TOP_10.csv "September = ',', index_col = true) groups = df .groupby ( 'Affiliate_ID') df_cameta = groups.get_group ( "Cameta") columns = list (df_cameta.columns) while 'Affiliate_ID' Cols: cols.remove ( 'Affiliat_ID') Motivator_list = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "A "," L "] index = 0 in column for ABSDVIM = 0: column = DF [i] absdiv = yoga (abdominal [1] - pair [0]) for pair pair in ettertols .combinations (column, 2 )) is ABSDEV_SU...

jquery - Select child element of previous element -

How do I go about selecting the basic element of the previous element I know how to use the previous primary element .prev (), but how did I choose the element of that last element, so that I can modify CSS? Thanks for any help. jQuery: $ ("li.selected"). Prev () CSS ("border-right", "none"); Edit: I want the element to apply the CSS style with only the "selected" category before the element. Currently all elements are being CSS selector application Are there. Thank you. & lt; Ul id = "nav_1510737" & gt; & Lt; Li & gt; & Lt; A href = "about /" & gt; About & lt; / A & gt; & Lt; / Li & gt; & Lt; Li class = "selected" & gt; & Lt; A href = "/ bookkeeping" & gt; Bookkeeping & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "/ ms-office-support" & gt; MS Office Support & lt; / A ...

c - I'm trying to interpret this IA32 assembly language code -

I have this IA32 assembly language code, I am trying to convert to regular c code. .global FN. Type Fn, @functionfn: pushl% ebp #setup movl $ 1,% eax #setup 1 is in a movl% esp,% ebp #setup movl 8 (% ebp),% edx # pointer x is de sempel $ 1 In,% edx # (* x> 1) Jelly.4 .5: Imul% Adx,% ex subl $ 1,% edx cmpl $ 1,% edx jne.5 .l4: popl% ebp ret The problem I am facing is deciding which type of comparison is going on. I do not know how the program is in the L5 cache. L5 seems to be because it has a comparison, because there is a comparison between it. I do not even know what is being returned because it seems that most of the work is% of ADX registrations, but does not return to% eax for the return. What do I have so far: int fn {} It seems to me that this is a factual computing, ignoring the manipulation of the stack frame and as such, we leave it with: movl $ 1,% eax #setup is in 1a puts EX in 1 movl 8 (% ebp), % Edx # pointer is in XD Recovers a paramete...

xaml - Change the checkbox mark color in windows phone 8 -

Image
My app uses dark background, I change the border of the checkbox with the border, but I want to change its color There is no attribute for the checkbox inside the mark, then a solution? You have some options. If we check the glyph path , then the check mark fills in to CheckBoxforegroundThemeBrush , which you can change at the template level. Or at the resource level where you get the resource announcement Or you can change it at the human level. Hope it helps, Cheers.

javascript - Async function not working -

I am using rades using nodes (nod_redis module) and am trying to wrap my recovery code for debugging and drought. Trouble understanding why the following function 'is not working' I am more than basic async with Javascript, so I do not think this is anything to do except JS. It works fine, but it is very redundant when there is a cover: // asyncLoad (className, id, callback) {redisClient.hget (className) , Id, callback); } // execution asyncLoad ('person', 1234, function (error, res) {if (err) {console.log (err);} else {var obj = JSON.parse (res); console.log (obj) ;}}); I thought that if I can do this it would be useful for debugging and repetition, but I am definitely doing something wrong ... // AsyncLoad2 (className, id, callback) {redisClient.hget (className, id, function (error, res, callback) {console.log (callback); if (error) {console.log (err) );} Else {var obj = JSON.parse (res); callback (obj);}}); } // execution asyncLoad2 ('person'...

javascript - Why does IE inject an extra </tbody> end tag into my table when parsing and serializing HTML? -

I have already considered this question, which states why domParsing is being added & lt; Tbody & gt; To tag tags, if the parseed is not already in the table me & lt; Tbody & gt; There is not a problem adding the tag, but I see an issue with IE 11 where two & lt; / Tbody & gt; & Lt; / Tbody & gt; End tags are being added to the output, even if only a & lt; Tbody & gt; Start tag breaks my application because the resulting XML is no longer valid XHTML html = '& lt; Html & gt; & Lt; Principal & gt; & Lt; Title & gt; Serializer difference & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H2 & gt; Software & lt; / H2 & gt; & Lt; / TD & gt; & Lt; TD & gt; Some text & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Lt; / Ht...

php - Invalid MySQL expression? -

इस सवाल का पहले से ही एक उत्तर है: मेरे पास एक निम्न कोड है, जिसे पहचानकर्ता (नाम) के साथ एक पंक्ति मिलनी चाहिए: & lt;? Php शामिल हैं "constants.php"; $ Namee = $ _ पोस्ट [ 'नाम']; $ Passw = $ _ पोस्ट [ 'पासवर्ड']; गूंज $ namee। "& Lt; br & gt;"; प्रतिधारा $ passw। "& Lt; br & gt;"; $ Databaseconnection = mysqli_connect ( "", dbuser, userpassword, "db"); $ Res = mysqli_query ($ डेटाबेस कन्नेक्शन, "चयन पहचानकर्ता, पासवर्ड से खातों में पहचानकर्ता = $ namee"); जबकि ($ पंक्ति = mysqli_fetch_array ($ res)) {print_r ($ पंक्ति); }? & Gt; मुझे जो त्रुटि मिलती है वह है "चेतावनी: mysqli_fetch_array () पैरामीटर 1 को mysqli_result होने की उम्मीद है, बुलियन C: \ Xampp \ htdocs \ tests \ loginlogic.php पंक्ति 15 पर दिया" जिसका अर्थ है ऐसा कोई रिकॉर्ड नहीं है मुझे लगता है "चयनकर्ता पहचानकर्ता, पासवर्ड से खातों में पहचानकर्ता = $ namee" गलत है। किस तरह से? आपको...

android - Django all auth with access token, what settings to test? (for app) -

My usecase: User login from your Android app & amp; Get access token, then pass it on the dango. More specifically for the code below. I've included the administrator using Django my app customer ID and a token (ie localhost / admin) My code def Facebook_login (request): ACCESS_TOKEN = request.POST [ 'allauth.socialaccount.models from allauth.socialaccount imports providers ACCESS_TOKEN'] print (ACCESS_TOKEN) SocialLogin from allauth.socialaccount.providers.facebook.views import fb_complete_login, SocialToken, SocialApp import complete_social_login from allauth.socialaccount.helpers Try import: App = SocialApp .objects.get (Provider = "Facebook") Print (Application) Token = SocialToken (Apps) Ation = application, token = ACCESS_TOKEN) print (token) login = fb_complete_login (application, token) login.token = token print (login) login. # FIXME :: State = SocialLogin.state_from_request (request) retired = complete_social_login (Request, Access) Print (r...

ios - Proper way to upload multiple images to Parse -

I am saving multiple images using an open source custom class called ELCImagePicker. To use ELCImagePicker, code is found in the controller's ViewDidLoad method for specific tabs. ELCImagePickerController * imagePicker = [[ELCImagePickerController alloc] initImagePicker]; ImagePicker.maximumImagesCount = 20; ImagePicker.imagePickerDelegate = self; [Self present ViewController: animated imagePicker: yes complete: zero]; Currently, the method I use to upload images to myself is backend as a service - (Zero) elcImagePickerController: (ELCImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSArray *) information {NSData * fileData; NSString * fileName; NSString * fileType; For (ID image in info) {fileData = UIImagePNG mapping (image); FileName = @ "image.png"; PFFile * imageFile = [PFFile FileWidthName: Filename Data: FileData]; [ImageFile saveInBackgroundWithBlock: ^ (BOOL succeeded, NSError * error) {if (error) {UIAlertView * errorAlert = [[UIAlertV...

javascript - Hiding and showing divs when user uses select box not working correctly -

For my website I allow the user to use the drop down to select several options, when they If you choose an option, then I should hide or show different pictures according to some jquery they choose. Although it does not seem to change. I have made a JS Bella and have done some to test and test the text by putting it in the check section but it still does not work. Why can anyone see? $ (document) .ready (function () {$ ('. Box'). Hide (); $ ('# option1 $ (' # Select -portion '). $ (' # '- $ (' $ ') ($ ('. Box ') Hide (); $ (' # '+ $ (this) .val ()). Show (); $ ('$'); $ (Document) .ready (function () {$ ('prepbox'). Hide (); $ ('# option10') Show (); $ ('# select-prep-time' Change (function () ($ ('.prepaybox'). Hidden (); $ ('#' + $ (this) .val ()). Show ();});}); $ (Document) .ready (function () {$ ('cookbox'). Hide (); $ ('# cook1') Show (); $ ('# select...

java - NullPointerException when iterating over arrays -

When I execute this piece of code, I got a nullioner exception. Exception in the thread "main" matrix on the java.lang.NullPointerException matrix. Calleyhargers average (matrix. Java 31) matrix. (Matrixer.java:75) Code: Import java.util.Scanner on Matrixer.main ; Import java.lang *; Class Matrix {Fixed double [] [] matrix, compute matrix; Last intense rows, columns; Public matrix (int n, int m, double [] [] imatrix) {rows = n; Cols = M; Matrix = iatrix; Compute matrix = new double [n] [m]; } Public Zero Mathematical Average (for {{int i = 1; i & lt; rows -1; i ++} {for (int j = 1; j & lt; cols - 1; j ++) {computed Matrix [i] [j] = cell neibor average (i, j); Private Double Cell Nilbars Average (Ent Sol, Int Colley) {// Undiscovered Center Cell Double Zodiac = Matrix [Line-1] [Cola -1] + Matrix [Line -1] [Cola] + Matrix [Line - 1] Matrix [row + 1] + matrix [row] [black-1] + matrix [row] [collect + 1] + matrix [row + 1] [colon1] + matrix [row + 1] [cola] +...

ios7 - Wrong vertical alignment of a UITextField in a TableView when using Dynamic Type to change the user-selected font sizes and weights -

When using the dynamic type to change the user-selected font size, I would like to have a vertical alignment of a UITextField in the table view Problems and weight Due to my terrible English, I will use screenshots: ups, not enough prestige to post them. : - ( I am using Autolayout in my table view with custom table. Disabling Autolayout does not make any difference to my problem, so I think it is not the reason Everything looks fine. When I change to "setting" and after returning to the app, after selecting the second font size, the vertical of the UITEX field Alignment increased by about 5 points, basis of new fonts When a happens, then it comes in the right position: When I close the form and it Then open it again, everything is fine! viewDidLoad Self selector: @sillector (preferred contracts change) Name: UIContentSizeCategoryDidChange information object: zero]; OK, there is a small problem, but it does not look professional; -) 1 Edit Ther...

numpy - Understanding axis in Python -

मैंने numpy.apply_along_axis का उपयोग करके कुछ कोड देखे हैं और मुझे हमेशा कोड का परीक्षण करना है यह देखने के लिए कि यह कैसे काम करता है, मैं अभी तक पायथन में अक्ष विचार नहीं समझ पाया। उदाहरण के लिए, मैंने संदर्भ से सरल कोड का परीक्षण किया। मैं देख सकता हूं कि पहले मामले के लिए मैट्रिक्स की प्रत्येक पंक्ति का पहला कॉलम लिया गया था, और दूसरे मामले में, पंक्ति को ही माना जाता है। इसलिए मैं यह परीक्षण करने के लिए एक उदाहरण बनाऊँगा कि यह कैसे मैट्रिक्स की एक सरणी के साथ काम करता है (समस्या जो मुझे इस अक्ष प्रश्न पर ले गई), जिसे 3 डी मैट्रिक्स के रूप में देखा जा सकता है, जहां प्रत्येक पंक्ति मैट्रिक्स है, ठीक है? a = [ [[1,2,3], [2,3,4]], [[4,5,6], [9, 9 7,7]] आयातित आंकड़े = numpy.array ([बी के लिए बी में ]) Def my_func (a): रिटर्न (a [0] + a [-1]) * 0.5 b = numpy.apply_along_axis (my_func, 0, डेटा) b = numpy.apply_along_axis (my_func, 1, डेटा) मुझे दिया गया है: सरणी ([[2.5, 3.5, 4.5], [5.5, 5.5, 5.5]] और: सरणी ([1.5, 2.5, 3.5], [6.5, 6.5, 6.5] ]) पहला परिणाम...

java - Iterating through ArrayList in JSP in Spring using foreach -

I have the following code to run again via the arrayList: Lt; Form: for every item = "$ {list}" var = "list" & gt; & Lt; TR & gt; & Lt; Td> & Lt; C: Out value = "$ {list}" /> gt; & Lt; Td> & Lt; / TR & gt; & Lt; / Form: foreach & gt; Now, my code is running through the list, but instead of printing one by one as shown below, printing all the values ​​once: How do I work to print them line by line? Can i do Try it: & lt; C: forEach items = "$ {list}" var = "list number" varStatus = "list status" & gt; & Lt; C: If test = "$ {listStatus.index & Lt; C: out value = "$ {listNumber}" /> gt; & Lt; Td> & Lt; / TR & gt; & Lt; / C: If & gt; & Lt; / C: foreach & gt; When you specify var as a list and access it in C: it does not select the entire list in every element in the list. To restrict display on ...

How to write sql query efficiently in this case? -

I have a table that lists the students and their rank. Similarly, in my UI client side, I show a list of all the students in the list list, sorted by their rank. Code> [student name, student-rank] Now this user has a professor drop and re-order Students can choose, and then "saves" is left, I need to get the list from the listbox and then make an update on the table so that the students rank according to the list in the UI Got it To do this, I'm just fixing the easiest way, to delete all the previous rows and then after each of the student tables, insert the rank one by one after adding each one. I think it is unnecessary .... but I'm not sure. I was wondering if there is a better way of achieving this? If you are worried about reducing database changes, you can track that line In which the change has happened and only updates for those people if it is appropriate or depends on the scale of your data and how much, if any, you have to enter...

linux - Securely Allow PHP Read & Write Access to System Files -

I can not find solid information to allow php to be configured on preferred (best practices) and / or secure methods I am not in the public web directory or the other type of files are not owned by the user, so I am hoping to find some answers here. I am a fairly capable PHP programmer, but it is faster to write web applications (most of which are not publicly available through the web), which are some services or applications on the server Requires updating, changing or adding config files or files created by For example, I need to create a web interface that will see, add, or remove entries from the root /etc/mail/spamassassin/white-list.cf file. Another scenario is that I need PHP to parse the user mime message in / var / vmail in the ownership of Vimal. These are just some examples, other files owned by other processes may have other files. How can I access those files safely and manipulate these files without opening the risk of security? How do I write PPL application...

Ubuntu Trusty 14.04 guest install on Hyper-V 2012 R2 doesn't have appropriate drivers for LIS? -

I recently created a new fresh gene 2 virtual machine on Hyper-V and the recently released Ubuntu version 14.04 Has installed. / P> On startup, even on startup, my Windows Server 2012 R2 complains about downlal drivers in Hyper-V events on Hyper-V events Synthetic Display Driver: Device 'Microsoft Synthetic display controller 'has been loaded' Dev Ubuntu 14.04 Jane 2 ', but there is a separate version from the server Server Version 3.3 Client Edition 3.2 (Virtual Machine ID 9FC171E7-B2C6-4BD2-9FF0-253209B2A69D). The tool will work, but this is an unsupported configuration. This means that until the problem is resolved, technical assistance will not be provided. To fix this problem, upgrade the integration services To upgrade, connect to the virtual machine and insert the Integration Services Setup disk from the Actions menu. (Of course this does not work) And Data exchange integration service: The hyper-V data exchange attached to the virtual machine '...

apache - Convert bash line to use in perl -

How do I go about changing the following bash line to Pearl? Can I run the system () command, or better way? I'm looking to print out my Appreciate access_log file every day. In the Bash: awk '{print $ 4}' / etc / httpd / log / access_log | Cut-D: -f1 | Uniq -c prints the following: 632 [27 / April / 2014 156 [28 Apr / 2014 awk '{print $ 4}' / etc / httpd / logs / access_log | Cut-D: -f1 | UniC-C perl -lane '($ val) = partition /: /, $ F [3]; #The first element of the fourth column # + $ c {$ val} is the element separated by colon; # Increasing the number of frequencies {Print to map {"$ c {$ _} $ _"} keys% c} # 'Do not use print' in any order access.log Switch: -l automatically adds a new line to the print statement. New lines from -l are also deleted; the line read by -n (and -p ). -a divides the row into an array on the green space @f . -n lines on the lines of the input, but do not print ea...

javascript - Return AJAX data before iterating parent loop -

Sorry guys and girls, this is not able to wrap my head around this one, I read various online situations in spite of . So here's the situation: I have found an array of strings that the recipient list for each string in that array, Want to create AJAX call which passes string as a parameter, then returns data from AJAX for my callback function. What is happening below my code is that if I have three strings in the recipient list array, my expansion distribution list function 3 times It is called, but this code never hits the successful part of the AJAX call until my Consideration: Function Extended Distribution List (Email Address, CB) {$. Data: {DistListName: emailAddress,}, Success: Function (Data) {cb (data): Ajax ({url: "extension / distribution list", type: 'get', datatype: 'jason', reference: data, ;}, Error: Work () {ace.search.mainframeErrorSignal = $ .signal ({'message': 'Unable to expand distribution list.', ...

html - html5 drawing multiple canvas images -

I have problems with canvas in html. I want to attract many canvas images I have created a loop which is more than one Makes canvas and then I want to draw an image in each canvas. For (var i = 1; i & lt; = playerStuff.MovingCards.length; i ++) {$ ("# playersField") Attachment ("& lt; canvas id = 'moving cardsfield" + I + "' height = '" + movingCardSizeY + "' \ n \ quarter = '" +++ CardSizeX +' '\ n \ data =' "+ PlayerStaff . Matting card [i-1] .movePoints + "'& gt; "); Var imgObj = new image (); Var Drafted = document.getElementById ('movingCardsField' + i) .getContext ("2D"); ImgObj.onload = function () {drawField.drawImage (imgObj, 0,0); }; ImgObj.src = "./img/moveCards/"+playerStuff.MovingCards[i-1].name; } The result is that only the image painted in the final canvas is what I remember here? Please do not use JQuery for this. Generally I...

css - How to add a gradient to the navbar in bootstrap 3 using LESS.js -

Either looks: but without using raw CSS, I want to write it in my fewer files ... In my low.Webels I have tried this before: Any thoughts? You can do the following low code: @ navbar -gradient-start-color: # 004400; @ Navbar-gradient-stop-color: # 009900; .navbar-default {#gradient & gt; .diver (@ navbar-gradient-start-color, @ navbar-gradient-stop-color); } You must add this code at the end of bootstrap.less (or navnbar.less) file. (Better customlessless file creation and import that at the end of bootstrap.less) See also: The following code will produce the following CSS code: .navbar-default {background-image: -webkit-linear-gradient (top, # 004400 0%, # 009900 100%); Background image: -o-linear-slope (top, # 004400 0%, # 00 9900 100%); Background image: Linear-slope (bottom, # 004400 0%, # 00 9900 100%); Double-repeat: repeat-x; Filters: Przid: Dximage Transforms. Microsoft.grad (startColorstr = '# ff004400', endocrostustrate = '# FF009900...

Get Facebook list of friends in Titanium -

I am trying to figure out how to get users using titles in graphic APIs. Something like this Titanium.facebook.quickwithgraphpath ('me / friend', 'received', function (e) {...}); But this can not work Thank you! thanks

python - Single slash not doing float division -

कोड निम्नानुसार है #! / Usr / local / bin / python3 def main (): num = 42/9 प्रिंट (प्रकार (num), num) यदि __name__ == "__main__ हालांकि, मुझे 4.666666666666667 का एक डिफ़ॉल्ट आउटपुट देने के बजाय उपरोक्त कार्यक्रम मुझे सिर्फ 4 का पूर्णांक आउटपुट दे रहा है / code>। मैंने पढ़ा है कि पायथन 3 में डिफ़ॉल्ट एकल स्लैश उपयोग मुझे फ्लोटिंग प्वाइंट आउटपुट मिलेगा, हालांकि मुझे यकीन नहीं है कि यहां क्या गलत है (मुझे एक इंट आउटपुट क्यों मिल रहा है?) मेरे पायथन 3 स्थापना मै मैक पर हूं, इसलिए मैक का डिफ़ॉल्ट 2.7 अजगर संस्करण भी है। केवल जिस तरह से यह संभव है यदि आप पायथन 2 में हैं, तो पायथन 3 नहीं। आपके संदर्भ स्वरूपण को पायथन 2.7 में भी कार्यान्वित किया गया है, इसलिए यह बहुत संभावना है कि आप इसका उपयोग कर रहे हैं। निश्चित, यह पता लगाने का एक बहुत आसान तरीका है: import sys print (sys.version_info) यदि आप पायथन 2 के साथ फंस रहे हैं, तो आप यह आपकी स्क्रिप्ट के शीर्ष पर सही विभाजन सक्षम करने के लिए रख सकता है:

android - Storing a file to internal storage and reading it -

What I am trying to do is store a JSON file as a string in internal storage This is done to access it later. The logic behind this is not to reach the server on every request, because this data is stable. Once it has been archived, it will not have to be retrieved, unless there are some updates. File storage I have done something before, and I was hoping someone could hand me my current code is throwing an empty pointer exception on this line: file file = new File (getFilesDir (), filename); My code: protected string doInBackground (string [] runeId) {String url = "https://prod.api.pvp.net/ Api / lol / static-data / "+ region +" /v1.2/rune/ "+ runeId [0] +"? Api_key = "+ api_key; JSONParser jsonParser = new JSONParser (); JSONObject runeInfo = jsonParser.getJSONFromUrl (url); String jsonString = runeInfo.toString (); String filename = "runeinfo"; File file = new file (getFilesDir (), filename); String readjustment = null; If (RunesCa...

javascript - AngularJS - Binding radio button selection to model inside ng-repeat -

I have a data model person who takes the following form: personsInfo = { Name: Adam Dub: 31-FB-198: Docs: [{DocType: Driver License, No: 121212, Selected: Wrong ID: 1}, {Selected: Truth, Doctor Type: None}, {Doctor Type: State ID, number: 132345, in my markup I have defined the following to generate radio buttons. & lt; Div ng- repeat = "person dock in person" Info.docs "> gt; input type =" radio "name =" personDocs "ng-model =" personDoc.selected "value =" "/> { {PersonDoc.docType}} & lt; span ng-hide = "personDoc.docType === 'none'" & gt; Number: {{persondoc.number}} & lt; / Div I want to be able to check the documents that have been selected as correct on the page load, and then the flag chosen by the user is given to my people's Infodah Models In the case of saving it is to choose. My intention here is to send the Infofuo model to another page. If someone can tell me...

combining two columns separated by semicolons in SAS -

I have the following dataset id field NUMTYPE NY us; 1015; 10x16 Bo Ours, 1015; 10x17 ID nonus 1018 I would like to add another column "REGION_NUMTYPE" which combines all fields and ";" ID field NUMTYPE REGION_NUMTYPE NY us; 1015; 10x16 US 1,015; Us10x16; Ne1015; Ne10x16bo us; 1015; 10x17 us1015; Us10x17; Ne1015; Ne10x17 id nonus 1018 nonus1018 An easy way to do this? Many thanks for your help The easiest way would be to have a double loop. want data; Is set; Format Area_Name Type 2000 $.; / * Change shape if necessary * / do I = 1 to countw (region, ";"); Do j = 1 to countw (NumType, ";"); Region_NumType = Cats (field_max type, scan (region, I, ";"), scan (Num type, J, ";", ",";);); End; End; Run;

ios - Making image view disapear and re appear over the view controller -

Hello is new to IM programming and there is a problem in my image view. I have a login view controller and I have a UIButton is animated on a visual view animated view controller which is: - (IBAction) Already user: (ID) sender {[_usnernameField resignFirstResponder]; [_passwordField Regaining First Responder]; [UIView animated disk: 0.3 animation: ^ {_ loginOverlayView.frame = self.view.frame; }]; } But I can not understand how to undo this action I tried [_ loginOverlayView setHidden: yes] but then when I come manifest: [_ loginOverlayView sethead: NO ]; disappear: [_ login overlayview sethead: yes]; You can keep the animation hidden or before or after showing the log-in overlayview.

c# - How to use Windows API Code Pack? -

I would like to make my application transparent with air glass, I looked around the internet, and I think any Information about using the aeroglass demo code, therefore, I compiled the DLL files Microsoft.WindowsAPICodePack.dll and Microsoft.WindowsAPICodePack.Shell.dll and referenced in my project, even then Cant also use slang code Code Sample / Eroglass / CS / Windows Forms Glace Demo / Form 1C Code 1 Form Cc: Anyone have any ideas about using code? Airplos found to work without WindowsPicodePack.

Unable to edit/save Google Calendar Event via Chrome Extension \ Content Script -

I am writing to Google Calendar to add functionality I click on the page, then I update the calendar events based on some dynamic content "WHERE" and the "DESCRIPTION" input on the page. Editing these inputs works fine, but when you save the event, the title and description are not saved (I'm assuming because I'm entering values ​​via javascript) if I Inject the content, and then there is a keyboard character (literally typing on my keyboard) before saving manually, then the title and description are saved. I have tried to trigger all kinds of incidents on input after editing. Value to trigger whatever dirty flag / event it is looking for, but with success: Try: input.change (); Input.focus.blur (); Var E = $ Event ('keypress'); E.which = 13; // enter input.trigger (e); I do not know that this is because my JavaScript is a sandbox, or Google is doing something special here. If this is sandbox because of it, I'm probably blocked....

android - findFragmentById return null -

When I call fragmentiIID () with my piece ID, then it is empty. Let me show you the code activity_main.xml & lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; LinearLayout xmlns: android = "Http://schemaskandroidkcom/apk/res/android" android: orientation = "vertical" android: Layout_width = "Fill_parent" Android: layout_height = "fill_parent" & gt; & Lt; Fragment android: name = "com.madduck.test.app.fragment.MainFragment" android: id = "@ + id / main_fragment" Android: layout_width = "match_parent" android: layout_height = "match_parent" /> & Lt; Fragment android: name = "com.madduck.test.app.fragment.LoginFragment" Android: id = "@ + id / login_fragment" Android: layout_width = "match_parent" Android: layout_height = "match_parent" /> & Lt; / LinearLayout & gt; Main activity. Java pr...

JavaScript addEventListener requires 2 clicks to fire function -

There is a small demo of what I'm experiencing: And here are the code snippets: HTML: & lt; Div id = "frame" & gt; & Lt; Div class = "beed col_a" id = "a1" & gt; & Lt; / Div & gt; & Lt; / Div & gt; CSS: #frame {status: relative; Height: 205px; } .bead {status: complete; Background: black; Width: 50px; Height: 25px; -image-radius: 50%; -Vibit-boundary-radius: 50%; Limit-Radius: 50%; }. Beed: Hover {background color: white; Limit: 1px solid black; } # A1 {top: 0px; } JS: var a1 = document.getElementById ("a1"); Function five toggle (bead1) {if (beed 1. style.top === "0 pixels") {bead1.style.top = "25px"; } Else {bead1.style.top = "0px"; }} A1.addEventListener ("click", function () {five toggle (a1);}, false); It is an idea that when the click is done, the position of bead is shifted up or downwards. To toggle, in other words but adding the if / e...