Posts

io - Sharing i/o between java programs -

io - Sharing i/o between java programs - this question regards redirection of input , output between 2 java programs. source code simplified illustration of problem below. this prog1: import java.io.*; public class prog1{ public static void main(string[] args) throws ioexception{ runtime rt = runtime.getruntime(); process prog2 = rt.exec("java prog2"); system.out.println("prog2 has executed."); } } on separate file, i've written prog2, execute net explorer verify execution successful: import java.io.*; public class prog2{ public static void main(string[] args) throws ioexception{ bufferedreader in = new bufferedreader(new inputstreamreader(system.in)); system.out.print("enter string: "); system.out.println("you entered " + in.readline() + ". starting explorer..."); runtime.getruntime().exec("c:\\program files (x86)\\internet explorer\\iexplo...

C++ How can we insert std::set inside std::vector -

C++ How can we insert std::set inside std::vector<std::unordered_set> - if have std::set<int > a; std::vector<std::unordered_set<int>> b; and went insert a within b method 1: can do: std::set<int > a; std::vector<std::unordered_set<int>> b (a.begin(), a.end()); method 2, cannot this? std::set<int > a; std::vector<std::unordered_set<int>> b; b.insert(a.begin(), a.end()); what error means? error c2664: 'std::_vector_iterator,std::equal_to<_kty>,std::allocator<_kty>>>>> std::vector,std::equal_to<_kty>,std::allocator<_kty>>,std::allocator<_ty>>::insert(std::_vector_const_iterator,std::equal_to<_kty>,std::allocator<_kty>>>>>,unsigned int,const _ty &)' : cannot convert argument 1 'std::_tree_const_iterator>>' 'std::_vector_const_iterator,std::equal_to<_kty>,std::allocator<_kty...

python - How can I call the metaclass's __call__? -

python - How can I call the metaclass's __call__? - given next illustration on instance of x class: class x(): def __call__(self, incoming_list): print incoming_list x()([x x in range(10)]) how can obtain same output using __call__ magic method class instead of instance? example: x([x x in range(10)]) calling directly, if passing __init__ . but, before calls __call__ calls __new__ passes arguments __init__ . how can access "metaclass __call__ " ? possible? just create easier understand, gives me same output there: class x: def __call__(self, incoming_list): print incoming_list x().__call__([x x in range(10)]) i want this: class x: def x.__call__(incoming_list): # syntax error print incoming_list x.__call__([x x in range(10)]) i think think complicated. probably want like class x: def __init__(self, incoming_list): self.data = incoming_list # maintain them later, if need...

c# - Insert values for all 2nd columns of a 1st column of a 2D array -

c# - Insert values for all 2nd columns of a 1st column of a 2D array - i'm trying question says. (it might confusing) here code should create understand i'm trying do. classes = new string[14, 5]; classes[0] = {"value1 [0, 0]", "value2 [0, 1]", "value3 [0, 2]", "value4 [0, 3]", "value5 [0, 4]"}; some languages or environments(like matlab) allow such things work, c# doesn't provide such access rectangular arrays string[x, y]. with such arrays should alter each element individually: string[,] classes = new string[14, 5];classes = new string[14, 5]; int32 rowtochange = 0; for(int32 col = 0; col < classes.getlength(1); col++) { classes[rowtochange, col] = string.format("value{0} [{1}. {0}]", rowtochange , col ); } but utilize jagged arrays : string[][] string[][] classes = new string[14][]; int32 rowtochange = 0; classes[rowtochange] = new string[]{"value1 [0, 0]", ...

jquery - Form fields are overlooked when loaded by ajax -

jquery - Form fields are overlooked when loaded by ajax - i have created little calendar, has input each date. want load monthly calendar using ajax, when seek navigate, input field in calendar not getting hooked form. $.ajax({ type: "post", url: "calendar.php", data: "&renderbydate=y&month=" + month + "&year=" + year, success: function(htmldata) { $("#calendar-content").html(htmldata); } }); <form action="calendar.manage.php" method="post" enctype="multipart/form-data" name="data" id="data" onsubmit="return vail();"> <input type="hidden" name="cmd" value="_calendar"> <div id="calendar-content"></div> </form> this sample htmldata receiving.. ...

can't import-module Hyper-V by powershell 4 in windows server 2008 R2 -

can't import-module Hyper-V by powershell 4 in windows server 2008 R2 - i tried utilize next cmd @ powershell 4 in windows server 2008 r2. (hyper-v has been running normally) import-module hyper-v get-vm --> not recognized name of cmdlet. get-vm -servername "full server name" (from windows 8) --> "hyper-v" module not installed in remote server. please shed lite on how can command hyper-v using ps 4. give thanks answers in advance. i not sure 1 modules tied operating system. link hyper-v module suggests available on windows 2012, explain why not have on older server os: http://technet.microsoft.com/en-us/library/hh846767.aspx just installing newer version of powershell not plenty newer modules released version, need on minimum os released on. powershell hyper-v

java ee - Tomcat filter not invoked for files outside of WEB-INF folder -

java ee - Tomcat filter not invoked for files outside of WEB-INF folder - evrything fine on localhost!!! using tomcat 7.0.53, having css, js, images ressources out of web-inf folder. accessing them : ${pagecontext.request.contextpath}/resources/css/file.css in web.xml file have filter witch trying set response header ressource files <filter> <filter-name>thefilter</filter-name> <filter-class>packages.thefilter</filter-class> </filter> <filter-mapping> <filter-name>thefilter</filter-name> <url-pattern>/ressources/*</url-pattern> <url-pattern>*.png</url-pattern> <url-pattern>*.gif</url-pattern> <url-pattern>*.jpg</url-pattern> <url-pattern>*.jpeg</url-pattern> <url-pattern>*.css</url-pattern> <url-pattern>*.js</url-pattern> </filter-mapping> as said works fine on localhost. 1 time online filter caches declared servlet urls! ...