something

jQuery load something based on whose class is “active”

匿名 (未验证) 提交于 2019-12-03 10:09:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to use this with tabs that load content with ajax into a div. I can't get it to refresh on the interval. The top part does work, however. <script type = "text/javascript" > $ ( function rlAl () { if ( $ ( "#xicon1" ). hasClass ( "active" )) { $ ( "#actionlist" ). load ( "alcurrent.php" ); } else if ( $ ( "#xicon2" ). hasClass ( "active" )) { alert ( "icon2" ); } else if ( $ ( "#xicon3" ). hasClass ( "active" )) { alert ( "icon3" ); } }); $ ( function () { setInterval ( rlAl , 5000 ); }); </script> 回答1: rlAl is undefined

Could anyone tell me something about Scheme Common-Lisp and FASL File

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can anyone tell me something about this file? As I know: Common-Lisp and Scheme are both dialects of lisp. Common-Lisp source file *.lisp can be compiled into binary file *.fasl which can be loaded faster than the source file. Q:Can the Scheme source code *.scm be compiled into some binary file that will be loaded faster than the source code? Thanks in advance, joe 回答1: Yes, if the Scheme implementation you're using has that feature. FASL in Racket: http://docs.racket-lang.org/reference/fasl.html FASL in Chez Scheme: http://www.scheme.com

Does something like a VB “Variant” implementation exist which uses C#'s dynamic dispatch?

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I realize that it goes against the strongly typed nature of C#, but I find that when working with dynamic objects in the language, some of the more useful features typically found in JavaScript or PowerShell are simply not practical. For example, the following C# code will fail at runtime and it's obvious why. dynamic x = 1.0 ; int y = x ; But that makes the dynamic features of C# pretty limited when dealing with loosely typed data such as that produced by JSON payloads or CSV where subtle variations in the representation can

Vim: do something in a function based on character under a cursor?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm writing a function that edits a certain environment in LaTeX. The environment basically looks like this: \begin { quicktikz } ... some stuff ... \end { quicktikz } or like this: \begin *{ quicktikz } ... some stuff ... \end { quicktikz } I want to write a function that toggles between the two, when called from within the environment. Since my Vim knowledge ain't all that, I'm coming up with a simple solution: Get cursor position with let save_cursor=getpos(".") Backward search for \begin{quicktikz} using: ?\\begin{quicktikz}\|\

How to have one resource in routes for namespace and root path altogether - Rails 4

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making a custom admin panel in a namespace "admin". I have resources "courses" within that namespace. But I would also like a route to "courses" that is not in that namespace: eg: BOTH localhost:3000/admin/courses AND localhost:3000/courses It's OK if this requires different controllers. My concern is that its not really DRY if i have both resources for the same route. namespace admin do resources :courses end and just resources :courses Is there a way to have one resource be shared between namespace and without namespace, or is the

Python with matplotlib - reusing drawing functions

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a follow up question to this question . Is it possible to streamline the figure generation by having multiple python scripts that work on different parts of the figure? For example, if I have the following functions: FunctionA: Draw a histogram of something FunctionB: Draw a box with a text in it FunctionC: Draw a plot of something C FunctionD: Draw a plot of something D How do I go about reusing the above functions in different scripts? If I wanted, for instance, to create a figure with a histogram with a plot of something C, I would

How to have list() consume __iter__ without calling __len__?

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a class with both an __iter__ and a __len__ methods. The latter uses the former to count all elements. It works like the following: class A : def __iter__ ( self ): print ( "iter" ) for _ in range ( 5 ): yield "something" def __len__ ( self ): print ( "len" ) n = 0 for _ in self : n += 1 return n Now if we take e.g. the length of an instance it prints len and iter , as expected: >>> len ( A ()) len iter 5 But if we call list() it calls both __iter__ and __len__ : >>> list ( A ()) len iter iter [ 'something' , 'something' ,

PHP array as variable name

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to send an indexes name for php array vairable. the array is $array = array('Somthing'=>array('More'=>array('id'=> 34))); and now I want to display this thing but with a variable name I don't know how to explain so I write what I want to have. $index_name = '[Something][More][id]'; $array{$index_name}; Is it possible in any way ? 回答1: Not in one go like that. Here's how you'd do it: $array['Something']['More']['id'] If you particularly wanted access multidimensional arrays with a single string, then you could build a function to do that:

Is there an implementation of something like autotest-fsevent for windows?

匿名 (未验证) 提交于 2019-12-03 03:09:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Basically it's an extension for autotest that listens for notification from OS and allows autotest not to scan for file changes permanently while testing only necessary changes. It saves CPU and disk use. 回答1: Windows provides an API for File Change Notification called FindFirstChangeNotification http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx It turns out that somebody already made a small ruby-bridge for this you might use for a starting point: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/36807 回答2: There is rb

Should I be using something other than getResource().getStringArray() to populate a large array?

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Following the Android sample for populating a ListView , I query an array from my strings.xml using Activity.getResource().getStringArray() : String [] mDefinitions = getResources().getStringArray(R.array.definition_array); The documentation for this method is pretty clear and I didn't expect to encounter any problems with it: Return the string array associated with a particular resource ID. This approach worked as expected for small data sets. However, when I populated strings.xml with the full data set (close to 2000 entries), I find that