Posts

scheme - SICP - Which functions converge to fixed points? -

in chapter 1 on fixed points, book says can find fixed points of functions using f(x) = f(f(x)) = f(f(f(x))) .... what functions? it doesn't work y = 2y when rewrite y = y/2 works does y need smaller everytime? or there general attributes function has have find fixed points method? what conditions should satisfy work? according banach fixed-point theorem , such point exists iff mapping (function) contraction. means that, example, y=2x doesn't have fixed point , y = 0,999... * x has. in general, if f maps [a,b] [a,b] , |f(x) - f(y)| should equal c * |x - y| 0 <= c < 1 (for x, y [a, b]).

What is the <base> element in HTML for? -

i learning how code on w3schools.com. there explanation on it's not helping. says "defines default address or default target links on page" why need this? you don’t need base element. used when most urls on page refer site other site of page; in case, <base href="..."> lets use relative urls those; other urls must absolute. in past, <base target=...> used on frameset pages in order make link open in particular frame.

c - Swap two pointers using XOR -

i have quick question using xor 2 swap 2 string literals. so have following: #include <stdio.h> #include <stdlib.h> #include <string.h> void intswap(int *a, int *b){ *a=*a^*b; *b=*a^*b; *a=*a^*b; } void swapstring(char **a, char **b){ char *temp=*a; *a=*b; *b=temp; } void main(){ char *s= "ha"; char *t= "oh"; printf("%s , %s \n",s,t); // prints ha oh swapstring(&s,&t); printf("%s , %s \n",s,t); // prints oh ha int a=10; int b=5; printf("%d %d\n",a,b); //print 10 5 intswap(&a,&b); printf("%d %d\n",a,b); //print 5 10 } as can see, used binary operation xor intswap. however, when tried same thing swapstring, it's not working. i error message saying: invalid operands binary ^ (have ‘char *’ , ‘char *’) do know how use xor swap 2 string literals? possible in c? ahead!! there's no bitwise operation...

syntax - unknown error in shell script -

i have cobbled shell script submit multiple jobs on cluster, appears without giving me error message, output files missing , error log files empty. script supposed 1.) make bunch of new directories, 2.) copy 4 files each (mainparams, extraparams, infile, , structurejobsubmissionfile) 3.) submit each 1 cluster run structure while changing 1 parameter in mainparams file every tenth directory (that's 's/changethis/'$k'/g' line). test running on front end gives no errors, structure program date on cluster, , cluster administrators don't see wrong. thanks! #!/bin/bash reps=10 numk=10 k in $(seq $numk); in $(seq $reps); #make folder name (ex. k4rep7) tmpstr="k${k}rep${i}" #echo "making folder , filename $tmpstr" #make new folder mkdir $tmpstr #go folder cd ./$tmpstr #copy in input files cp ../str_in/* ./ ...

c# - Hide XML data in a WPF Application -

i creating app in wpf. need store data related user. had figured how create folder in documents , stored data in xml file. but problem it editable persons , change value in xml file . is there way hide information? or need make choice storing data? you use compression password protection save data in .zip file. application can decompress zipped file xml original , read settings there. can use sharpziplib nuget achieve this.

Installing external linux kernel module into /lib/modules/`uname -r`/ directory -

i have small usb driver kernel module, want install module running kernel directory i.e. (/lib/modules/ uname -r /). should updates modules.alias , modules.usbmap file. any script available install external kernel module? thanks all: make -c /lib/modules/$(shell uname -r)/build m=$(pwd) modules install: make -c /lib/modules/$(shell uname -r)/build m=$(pwd) modules_install clean: make -c /lib/modules/$(shell uname -r)/build m=$(pwd) clean do "make" , "make install" --- 5.2 install_mod_dir external modules default installed directory under /lib/modules/$(kernelrelease)/extra/, may wish locate modules specific functionality in separate directory. purpose, use install_mod_dir specify alternative name "extra." $ make install_mod_dir=gandalf -c $kdir \ m=$pwd modules_install => install directory: /lib/modules/$(kernelrelease)/gandalf/

java - Handled exception still being written to stdout -

i'm using jetty server hosting java app. added request timeouts kill requests take long. file logs stdout (which should empty) started fill interruptedexception stack traces. like: java.lang.interruptedexception ...... lower level code-lines of project @ com.mycompany.webapps.mycontroller.mymethod(mycontroller.java:252) @ sun.reflect.generatedmethodaccessor67.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:219) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:104) @ org.springframework.web.servlet.mvc.method.annotation.requestmappi...